Skip to content

ENG-1741 Prevent duplicate keyboard shortcuts for node types#1020

Merged
trangdoan982 merged 2 commits into
mainfrom
eng-1741-modify-keyboard-shortcut-behavior-for-node-type-dropdown
May 19, 2026
Merged

ENG-1741 Prevent duplicate keyboard shortcuts for node types#1020
trangdoan982 merged 2 commits into
mainfrom
eng-1741-modify-keyboard-shortcut-behavior-for-node-type-dropdown

Conversation

@trangdoan982

@trangdoan982 trangdoan982 commented May 11, 2026

Copy link
Copy Markdown
Member

https://www.loom.com/share/10168beedb5548b38b716ba59b10138f

Summary

  • On node creation, skip auto-assigning the first-letter shortcut if it is already taken by any existing node type; leave empty instead so the user is prompted to set a unique one manually
  • In node type settings, validate the shortcut field against all other node types and surface an inline error when a conflict is detected (same warning pattern as the existing tag/format validation)

Fixes: ENG-1741

Changes

  • DiscourseNodeConfigPanel.tsx — collision-aware shortcut auto-assignment on "Add node"
  • NodeConfig.tsxvalidateShortcut callback + shortcutError state wired to the Shortcut text panel

Test plan

  • Create a new node type whose label starts with the same letter as an existing node (e.g. add "Concept" when "Claim" with shortcut C exists) — shortcut should be empty, not C
  • In node settings, manually set a shortcut that matches another node's shortcut — inline error should appear immediately
  • Setting a unique shortcut clears the error
  • Existing nodes with no conflicts are unaffected

Made with Cursor

- On node creation, skip auto-assigning the first-letter shortcut if it
  is already taken by any existing node type; leave empty instead
- In node settings, validate the shortcut field against all other node
  types and surface an inline error when a conflict is detected

Co-authored-by: Cursor <cursoragent@cursor.com>
@linear-code

linear-code Bot commented May 11, 2026

Copy link
Copy Markdown

ENG-1741

@supabase

supabase Bot commented May 11, 2026

Copy link
Copy Markdown

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 requested a review from mdroidian May 11, 2026 23:22
Comment thread apps/roam/src/components/settings/NodeConfig.tsx Outdated
Comment thread apps/roam/src/components/settings/NodeConfig.tsx Outdated
@trangdoan982
trangdoan982 requested a review from mdroidian May 18, 2026 15:45
@trangdoan982
trangdoan982 merged commit 154c7cd into main May 19, 2026
9 checks passed
@trangdoan982
trangdoan982 deleted the eng-1741-modify-keyboard-shortcut-behavior-for-node-type-dropdown branch May 19, 2026 17:10
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.

2 participants