Skip to content

Externalize the keybind catalog and preset registry to a shared contract - #8328

Draft
burnhamrobertp wants to merge 57 commits into
beyond-all-reason:masterfrom
burnhamrobertp:feature/shared-keybind-catalog
Draft

Externalize the keybind catalog and preset registry to a shared contract#8328
burnhamrobertp wants to merge 57 commits into
beyond-all-reason:masterfrom
burnhamrobertp:feature/shared-keybind-catalog

Conversation

@burnhamrobertp

Copy link
Copy Markdown
Contributor

Externalizes the in-game keybind editor's data into a shared, cross-surface contract, so Chobby and the new lobby can build their own keybind editing on the same data and rules instead of re-implementing them.

The hard-coded catalog (categories / labels / actions) and the preset registry (which bind file each preset maps to) move out of Lua into JSON under common/configs - keybind_catalog.json and keybind_presets.json. The game reads them through thin adapters: keybind_catalog.lua and keyboard_layouts.lua become Json.decode(VFS.LoadFile(...)) loaders that return the same shapes / same API, so every existing consumer (the editor, Settings > Control, cmd_bar_hotkeys) is unchanged.

Alongside the data:

  • JSON schemas for both files.
  • A README documenting the behavioral contract - how the active preset is derived from the KeybindingFile config, and the switch / reset / seed rules each surface implements (game via Spring APIs, a lobby via config + file I/O).
  • A busted spec that guards the contract in CI: structure plus referential integrity (every preset file exists, every catalog i18n key resolves).

Stacked on #8153 (the in-game keybind editor); leaving this in draft until that merges. Until then the diff here also includes #8153's changes - it'll reduce to just the externalization once #8153 lands in master.

Deferred to later iterations (noted in the README): a widget/mod action-declaration API so widgets register their own bindable actions, and command-description tooltips built on the engine's cmd.* descriptions.

Developed with AI assistance (Claude).

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Integration Test Results

15 tests  ±0   7 ✅ ±0   4s ⏱️ ±0s
 1 suites ±0   8 💤 ±0 
 1 files   ±0   0 ❌ ±0 

Results for commit 59d0159. ± Comparison against base commit 2764bb1.

♻️ This comment has been updated with latest results.

@WybrenKoelmans

Copy link
Copy Markdown
Contributor

May I suggest also adding the "default" per binding? That way we can offer a "restore to default" function as well per keybind

@burnhamrobertp

Copy link
Copy Markdown
Contributor Author

A "Restore to Default" UX is not quite that simple since there are a lot of players who use Legacy still, or one of the 60% layouts; and to those players, "default" might mean something very different. When you install BAR fresh today, we do set Grid as the default keys, but before I go that route I'd want confirmation from @PtaQQ or some other admin that this is an intentional decision made and supported from the top.

@burnhamrobertp
burnhamrobertp force-pushed the feature/shared-keybind-catalog branch from a6bd28d to 37f5a18 Compare July 27, 2026 21:11
@burnhamrobertp
burnhamrobertp force-pushed the feature/shared-keybind-catalog branch from 37f5a18 to 79f351b Compare July 29, 2026 00:25
@burnhamrobertp
burnhamrobertp force-pushed the feature/shared-keybind-catalog branch from 79f351b to 59d0159 Compare August 3, 2026 04:35
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.

2 participants