Skip to content

ENG-1626 Pre-fill Create node dialog with selected text#1003

Open
trangdoan982 wants to merge 1 commit intomainfrom
eng-1626-pre-fill-the-create-node-dialog-title-field-with-currently
Open

ENG-1626 Pre-fill Create node dialog with selected text#1003
trangdoan982 wants to merge 1 commit intomainfrom
eng-1626-pre-fill-the-create-node-dialog-title-field-with-currently

Conversation

@trangdoan982
Copy link
Copy Markdown
Member

@trangdoan982 trangdoan982 commented May 5, 2026

https://www.loom.com/share/47e8af6482514084a413b1660abf27d6

Summary

  • When the "Create discourse node" command is triggered with text selected in the editor, the selected text is now passed as initialTitle to ModifyNodeModal, pre-filling the title field
  • When no text is selected, the modal opens with an empty title as before
  • Mirrors the existing behaviour of the right-click context menu ("Turn into discourse node")

Changes

Single change in apps/obsidian/src/utils/registerCommands.ts:

  • Dedupe getActiveViewOfType into one activeView call
  • Capture editor?.getSelection()?.trim() and pass it as initialTitle to ModifyNodeModal

Test plan

  • Select text in an Obsidian note → run "Create discourse node" command → confirm title field is pre-filled with selected text, cursor at end
  • Run command with no text selected → confirm modal opens with empty title field

Fixes ENG-1626

🤖 Generated with Claude Code

When the "Create discourse node" command is triggered with text selected
in the editor, pass it as initialTitle to ModifyNodeModal so the title
field is pre-filled — matching the existing behaviour of the right-click
context menu.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 5, 2026

@supabase
Copy link
Copy Markdown

supabase Bot commented May 5, 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 ↗︎.

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.

1 participant