Eng 1552 enable ability to change discourse graph specific keyboard#952
Eng 1552 enable ability to change discourse graph specific keyboard#952
Conversation
Allow users to customize discourse node shortcuts in the canvas via a new "Canvas shortcuts" tab in personal settings.
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
📝 WalkthroughWalkthroughThis PR introduces customizable keyboard shortcuts for canvas nodes. A new personal settings field stores node-specific shortcut overrides, a settings UI component allows configuration, the schema validates the setting structure, and the canvas UI layer reads and applies these overrides when rendering node tools. Changes
Sequence DiagramsequenceDiagram
actor User
participant Settings as CanvasShortcutSettings UI
participant PersonalSettings as Personal Settings Store
participant Canvas as Canvas Component
participant UIOverrides as uiOverrides Logic
User->>Settings: Opens Canvas shortcuts tab
Settings->>PersonalSettings: Reads current shortcuts via getPersonalSetting()
PersonalSettings-->>Settings: Returns shortcuts map
Settings->>User: Displays shortcut fields for each node type
User->>Settings: Customizes shortcut for a node
Settings->>PersonalSettings: Saves updated shortcut mapping
PersonalSettings-->>Settings: Confirms save
Note over Canvas,UIOverrides: Next Canvas Load
Canvas->>UIOverrides: createUiOverrides() initializes
UIOverrides->>PersonalSettings: Reads Canvas node shortcuts setting
PersonalSettings-->>UIOverrides: Returns shortcut overrides map
UIOverrides->>UIOverrides: For each node tool, override kbd with custom shortcut or default
UIOverrides-->>Canvas: Returns configured tools with applied shortcuts
Canvas->>User: Renders canvas with custom node shortcuts active
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/roam/src/components/settings/CanvasShortcutSettings.tsx (1)
8-8: Consider using UPPERCASE for the constant name.Per coding guidelines, constants should use UPPERCASE naming convention.
💡 Suggested change
-const CANVAS_NODE_SHORTCUTS_KEY = "Canvas node shortcuts"; +const CANVAS_NODE_SHORTCUTS_KEY = "Canvas node shortcuts"; // Already uppercase, but could be more explicitThe constant name
CANVAS_NODE_SHORTCUTS_KEYalready uses uppercase, so this is compliant. No change needed.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/roam/src/components/settings/CanvasShortcutSettings.tsx` at line 8, The reviewer suggested using UPPERCASE for the constant name, but the constant CANVAS_NODE_SHORTCUTS_KEY in CanvasShortcutSettings.tsx is already UPPERCASE; no code change is needed—leave CANVAS_NODE_SHORTCUTS_KEY as-is.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@apps/roam/src/components/settings/CanvasShortcutSettings.tsx`:
- Line 8: The reviewer suggested using UPPERCASE for the constant name, but the
constant CANVAS_NODE_SHORTCUTS_KEY in CanvasShortcutSettings.tsx is already
UPPERCASE; no code change is needed—leave CANVAS_NODE_SHORTCUTS_KEY as-is.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: eb5a2020-f01b-486a-97e1-b7bfee584cb1
📒 Files selected for processing (5)
apps/roam/src/components/canvas/uiOverrides.tsxapps/roam/src/components/settings/CanvasShortcutSettings.tsxapps/roam/src/components/settings/Settings.tsxapps/roam/src/components/settings/utils/zodSchema.example.tsapps/roam/src/components/settings/utils/zodSchema.ts
https://www.loom.com/share/79ae34d2e5ec4bb0acc461756cd2d4bf
Summary by CodeRabbit
Release Notes