refactor: centralize shortcut lifecycle with TanStack Hotkeys - #572
Merged
Conversation
Model: gpt-5
Model: gpt-5
Model: gpt-5
Model: gpt-5
Model: gpt-5
wibus-wee
marked this pull request as ready for review
September 10, 2026 12:17
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Model: gpt-5
Model: gpt-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
Refs #288
Problem / pressure
Issue #288 needs configurable workspace shortcuts, but the current foundation mixed DOM listeners, key parsing, command policy, and persisted binding refresh inside one mutable registry. One authenticated cloud success path also omitted
AppCommands, and binding changes stayed stale in other open renderer windows.Summary
@tanstack/hotkeys0.8.0 and use its parser, validation, canonical normalization, DOM matcher, event normalization, and display formatter.CommandShortcutHostper renderer throughAppInitializer; it owns one capture-phasekeydownlistener with symmetric React cleanup.CommandRegistryfocused on Lody semantics: command stacks, mounted precedence,when,KeyScope, user overrides, conflict lookup, and analytics.useCommand/ registry as the only application-command registration port.storageevents.$modtokens to the library-nativeModform at read boundaries while retaining Electron accelerator compatibility.AppCommandshost.Visual explanation
flowchart LR A[AppInitializer] --> H[CommandShortcutHost] H -->|one capture listener| T[TanStack Hotkeys] T -->|canonical match| R[CommandRegistry] U[useCommand] -->|register and dispose| R S[user-bindings storage] -->|validated reload| R R -->|live snapshot| HBefore / after
AuthenticatedWorkspaceContent.Library boundary and risk
TanStack Hotkeys is used for generic shortcut mechanics, but not its manager: the manager currently installs bubble-phase listeners, while Lody needs one capture-phase listener so command policy can negotiate with focus traps and editor scopes. Lody retains only domain behavior and the recording-boundary
event.codeadaptation needed to preserve physical letter, digit, and punctuation semantics on macOS Option/Shift input.The package is still alpha, so the dependency is exact-pinned. Upgrades must rerun matcher, capture, registry, settings migration, and Electron accelerator contracts.
Verification
b4d54439and the refactored head: 1 scenario, 8 steps on each.b4d54439at the secondary renderer synchronization checkpoint: 7 steps passed, 1 failed, 2 skipped.app.openWindowIPC and verifies both real renderers.Mod+K, physical punctuationMod+,, physicalMod+Shift+9rebinding in window A, old-binding invalidation and new-binding execution in both windows, and restoration after reloading renderer B.pnpm check,pnpm format,pnpm --filter @lody/e2e check,pnpm run docs check, andgit diff --checkpassed locally under Node 22.Context handoff
Instructions for reviewing agents
$modmigration, and storage refresh symmetry.Mod/ Control / Meta collisions and editor scopes.Authoring context
$modto library-nativeMod; reads migrate old persisted values. The alpha dependency is exact-pinned.