-
-
Notifications
You must be signed in to change notification settings - Fork 2
Contributing a Shortcut
itsmylab edited this page Aug 4, 2026
·
1 revision
Generated from
docs/contributions/shortcut.md. Edit the canonical source through a pull request.
Use this playbook to add a command chord shared by WebView handlers and native menus. The shortcut manifest is the authority.
flowchart LR
Manifest[shared/shortcuts.json]
Resolver[src/shortcuts.ts]
Web[WebView command handlers]
Rust[src-tauri/src/shortcuts.rs]
Menu[Native menus]
Profiles[Cross-platform keymap profiles]
Manifest --> Resolver --> Web
Manifest --> Rust --> Menu
Manifest --> Profiles
Do not hardcode the same chord independently in React and Rust.
shared/shortcuts.json command, profiles, platforms, surfaces, collisions
src/shortcuts.ts resolver only if the schema needs a new concept
src/<handler>.tsx command behavior
src-tauri/src/shortcuts.rs native resolution/parity
src-tauri/src/lib.rs native menu command, if applicable
src/shortcuts.test.ts TypeScript behavior and parity
- Choose a stable command ID describing the action, not the current chord.
- Search existing commands and OS/application defaults for collisions.
- Add the command once to
shared/shortcuts.json. - Define profile defaults and platform overrides.
- Declare whether it is active in application, terminal, editor, or menu surfaces.
- Document terminal/readline collisions explicitly.
- Bind the resolved command in the owning WebView handler or native menu.
- Match by normalized command/chord helpers, not raw
KeyboardEventchecks. - Ensure user-selected keymap profiles flow through both TypeScript and Rust.
- Test macOS, Windows, and Linux resolution and collision behavior.
flowchart TD
Command[Command ID]
Profile[Selected keymap profile]
Platform[Current platform]
Surface[Current surface]
Collision{Reserved by terminal/editor?}
Skip[Do not handle]
Execute[Execute command]
Command --> Profile --> Platform --> Surface --> Collision
Collision -- yes --> Skip
Collision -- no --> Execute
npm run test -- src/shortcuts.test.ts
cargo test --manifest-path src-tauri/Cargo.toml --no-default-features shortcuts::tests
npm run typecheck- Stable command ID added once to the manifest.
- Platform and profile defaults defined.
- Surface and terminal collision policy defined.
- Handler uses resolver helpers.
- Native menu and WebView remain in parity.
- macOS, Windows, and Linux behavior tested.
- Documentation names the command, not only the chord.
Generated from FluidWorksApp/canopy-ide. Canonical documentation changes belong in the main repository.
Canopy Architecture
- Home
- Architecture
- Core Rust System
- LLM Context
- Integration Guide
- Contribution Playbooks
- Testing and Coverage
- Publish the Wiki
Playbooks