Render the native menu from the shared command registry (Phase 2b) (#2721)#699
Merged
Conversation
…2721) Promote command identity to one serializable declaration in @inkeep/open-knowledge-core: COMMAND_IDENTITIES plus a pure evaluateCommandAvailability over a declarative spec and a plain context. The native application menu and the Cmd+K palette now render their actionable command leaves from that single source. Labels resolve through each command's labelKey (the palette maps it to a Lingui descriptor, the menu reads MENU_LABELS directly), accelerators are single-sourced per menu placement, availability flows through the shared evaluator, and platform placement is data (the Check for updates and Settings App/File/Help split). The menu's structural scaffolding stays declarative: Electron role items, separators, submenu parents, the dynamic Recent-project list, and the isMac branches. A desktop-side binding wires each command's click, dep-presence gate, presence, and checkbox state by id. The palette renders the same rows from a thin app-side wrapper over the same identity; the registry join fails loud (throws at module load) if a command is ever missing an icon. No user-facing change on any platform: menu items, order, labels, accelerators, and enabled/checked states are verified byte-identical across a platform, deps, and target matrix. The parity ratchets stay green, assert the state-dependent menu output (Show/Hide toggle labels, smart-hide visibility, checkbox state, presence-gated absence), and gain declaration-level checks that fail if a command is placed twice in one platform's menu bar or if a menu-placed command lacks a desktop binding. GitOrigin-RevId: e314ae854e07a911d39dffd9964c7fb04a6f922e
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.
Copybara-translated 1 Inkeep OSS change. Rebase-merge this PR so the prepared commit lands directly on public main.