Commit e86b1c5
[ENG-1123] Right sidebar page title (#729)
* Fix: Use canvas page title for auto-generated relations in sidebar
- Store canvas page UID on editor instance when mounting
- Update relation creation to use canvas page UID instead of main page UID
- Fixes issue where relations created from canvas in right sidebar incorrectly use main page title
Co-authored-by: doantranghp2000 <doantranghp2000@gmail.com>
* Refactor: Use discourseContext for canvas page UID
- Add canvasPageUid to DiscourseContextType instead of monkey-patching editor
- Store canvas page UID in discourseContext on mount
- Use discourseContext.canvasPageUid in relation creation
- Removes @ts-expect-error comments and follows existing patterns
Co-authored-by: Trang Doan <trangdoan982@users.noreply.github.com>
* Fix: Support multiple canvases with WeakMap
- Replace single canvasPageUid with editorToPageUid WeakMap
- Maps each editor instance to its specific canvas page UID
- Fixes issue where multiple canvases in sidebars would share wrong page UID
- Ensures relation creation uses correct canvas page even with multiple open
Co-authored-by: Trang Doan <trangdoan982@users.noreply.github.com>
* light cleanup
* Refactor: Use DOM-based approach for canvas page UID
- Add data-page-uid attribute to canvas container div
- Read page UID from DOM using focus/active element detection
- Supports multiple canvases by detecting which one is being interacted with
- Removes WeakMap complexity - simpler, cleaner solution
- No state management needed - single source of truth in DOM
Co-authored-by: Trang Doan <trangdoan982@users.noreply.github.com>
* small cleanup
* cleanup
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Trang Doan <trangdoan982@users.noreply.github.com>1 parent 8e9e2fc commit e86b1c5
1 file changed
Lines changed: 33 additions & 3 deletions
Lines changed: 33 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
70 | 97 | | |
71 | 98 | | |
72 | 99 | | |
| |||
76 | 103 | | |
77 | 104 | | |
78 | 105 | | |
79 | | - | |
80 | 106 | | |
81 | 107 | | |
82 | 108 | | |
| |||
654 | 680 | | |
655 | 681 | | |
656 | 682 | | |
657 | | - | |
658 | | - | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
659 | 689 | | |
660 | 690 | | |
661 | 691 | | |
| |||
0 commit comments