Skip to content

Render the native menu from the shared command registry (Phase 2b) (#2721)#699

Merged
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync
Jul 20, 2026
Merged

Render the native menu from the shared command registry (Phase 2b) (#2721)#699
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync

Conversation

@inkeep-oss-sync

Copy link
Copy Markdown
Contributor

Copybara-translated 1 Inkeep OSS change. Rebase-merge this PR so the prepared commit lands directly on public main.

…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
@inkeep-oss-sync
inkeep-oss-sync Bot merged commit d0f3b04 into main Jul 20, 2026
@inkeep-oss-sync
inkeep-oss-sync Bot deleted the copybara/sync branch July 20, 2026 07:06
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.

1 participant