Repository navigation
ENG-2463 unable to update title of node created from tldraw canvas shape #1629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -580,9 +580,9 @@ export class DiscourseNodeUtil extends BaseBoxShapeUtil<DiscourseNodeShape> { | |
| mode: isCreating ? "create" : "edit", | ||
| nodeType: getDiscourseNodeTypeId({ shape }), | ||
| initialValue: { text: initialTitle, uid: shape.props.uid }, | ||
| // Only pass it when editing an existing node that has a valid Roam block UID | ||
| // Block nodes only: updateBlock on a page uid stores a block string on the page, and Roam then refuses to rename it | ||
| sourceBlockUid: | ||
| !isCreating && isLiveBlock(shape.props.uid) | ||
| !isCreating && !isPageUid(shape.props.uid) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Canvas page renames lack regression coverage When Learn moreThe canvas node edit flow passes a source block UID to the dialog only for block nodes. The dialog writes that UID with onSubmit, while the canvas success callback handles page renames. This change fixes the page case but does not add a test for either side of the new branch. Repository contribution rules require tests that validate fixes. Example: Editing page Recommended fix: Add a focused test for the canvas dialog props or extract the page-versus-block source UID decision into a testable helper. Cover both page and block UIDs, including the call that persists the page title. Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| ? shape.props.uid | ||
| : undefined, | ||
| extensionAPI, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit mode passed every live uid as
sourceBlockUid, andisLiveBlockis true for pages too. ModifyNodeDialog then calledupdateBlockon the page uid beforeonSuccesscalledupdatePage. Roam keeps that:block/stringon the page and rejects every laterupdatePagewith "is a block, not a page". Its own title editor stops saving too.Page nodes now get no
sourceBlockUid, so the only write is theupdatePageinonSuccess. Block nodes keep the old path. This is the onlymode: "edit"caller ofrenderModifyNodeDialog, so the fix lives here rather than in ModifyNodeDialog.