Commit 699d119
committed
Fix insert link flow for new page creation
🔧 Fixed URL generation for new page links:
- Updated SlateEditor to generate proper URLs: /new?title=PageName instead of /new:PageName
- Added isNew flag to LinkElement type definition
- Fixed malformed URLs that were breaking navigation
✨ Added automatic new page creation:
- Extract new page references from content during save
- Automatically create referenced pages with empty content
- Works for both new page creation and existing page updates
- Ensures all linked pages exist after save operation
🎯 Improved user experience:
- Insert link flow now works correctly for new pages
- Proper URL parameters for title pre-filling
- Seamless page creation workflow
- No more broken links to non-existent pages
Technical changes:
- Updated insertLink function in SlateEditor.tsx
- Added extractNewPageReferences and createNewPagesFromLinks helpers
- Enhanced save process in both new/page.tsx and PageView.tsx
- Proper URL encoding for page titles with special characters1 parent bd799fa commit 699d119
File tree
3 files changed
+141
-2
lines changed- app
- components
- editor
- pages
- new
3 files changed
+141
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
713 | 714 | | |
714 | 715 | | |
715 | 716 | | |
716 | | - | |
| 717 | + | |
717 | 718 | | |
718 | 719 | | |
719 | 720 | | |
720 | 721 | | |
721 | 722 | | |
| 723 | + | |
722 | 724 | | |
723 | 725 | | |
724 | 726 | | |
| |||
734 | 736 | | |
735 | 737 | | |
736 | 738 | | |
737 | | - | |
| 739 | + | |
738 | 740 | | |
739 | 741 | | |
740 | 742 | | |
741 | 743 | | |
742 | 744 | | |
| 745 | + | |
743 | 746 | | |
744 | 747 | | |
745 | 748 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
800 | 800 | | |
801 | 801 | | |
802 | 802 | | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
803 | 864 | | |
804 | 865 | | |
805 | 866 | | |
| |||
857 | 918 | | |
858 | 919 | | |
859 | 920 | | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
860 | 928 | | |
861 | 929 | | |
862 | 930 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
419 | 480 | | |
420 | 481 | | |
421 | 482 | | |
| |||
680 | 741 | | |
681 | 742 | | |
682 | 743 | | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
683 | 751 | | |
684 | 752 | | |
685 | 753 | | |
| |||
0 commit comments