Skip to content

[ENG-1123] Right sidebar page title#729

Open
trangdoan982 wants to merge 4 commits intomainfrom
cursor/ENG-1123-right-sidebar-page-title-35df
Open

[ENG-1123] Right sidebar page title#729
trangdoan982 wants to merge 4 commits intomainfrom
cursor/ENG-1123-right-sidebar-page-title-35df

Conversation

@trangdoan982
Copy link
Collaborator

@trangdoan982 trangdoan982 commented Jan 25, 2026

https://www.loom.com/share/c409751c64654304b8ba05c64c7168c0

Fixes auto-generated page title using the main page instead of the canvas page when the canvas is in the right sidebar.

The relation creation logic was incorrectly retrieving the main page's UID via getCurrentPageUid() instead of the active canvas page's UID. This PR stores the canvas page UID on the editor instance when it mounts and uses this stored UID for relation title generation.


Linear Issue: ENG-1123

Open in Cursor Open in Web


Open with Devin

- 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>
@cursor
Copy link

cursor bot commented Jan 25, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@linear
Copy link

linear bot commented Jan 25, 2026

@supabase
Copy link

supabase bot commented Jan 25, 2026

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@trangdoan982 trangdoan982 changed the title Right sidebar page title [ENG-1123] Right sidebar page title Jan 25, 2026
cursoragent and others added 3 commits February 5, 2026 20:14
- 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>
- 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>
@trangdoan982 trangdoan982 marked this pull request as ready for review February 5, 2026 20:28
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Copy link
Contributor

@mdroidian mdroidian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we just pass pageUid to createAllRelationShapeUtils instead of storing it? This would be more direct and easier to debug.

Another alternative would be grabbing it from the DOM if the relation shape gives you that (I'm guessing it would) because the page uid's are stored in the h1 wrapper's now.

const canvasPageUid = discourseContext.editorToPageUid.get(
this.editor,
);
const parentUid = canvasPageUid || getCurrentPageUid();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably don't want getCurrentPageID because this would return false if we were on the sidebar, and that would be a no-good bug. If there is no canvas page ID, we should probably throw an alert and an internalError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants