Skip to content

Bridge 2a: player modules registry and open slots - #116

Merged
KodeStar merged 3 commits into
mainfrom
feat/bridge-2a
Oct 19, 2026
Merged

KodeStar merged 3 commits into
mainfrom
feat/bridge-2a

Conversation

@KodeStar

Copy link
Copy Markdown
Owner

Bridge Phase 2a, player side: opens the closed lists into "core plus registered" for managed modules. The registry ships empty, so nothing changes for listeners.

What

  • contributions?: boolean in Capabilities, mirroring the server's new module flag.
  • src/modules/registry.ts: PlayerModule (homeRails, youSections, bookActions), an empty PLAYER_MODULES, useActiveModules (any of the profile's servers) and useModulesOn (one server). A module's id is a typed ModuleFlag, and the capability hooks keep keyof Capabilities, so a typo in a core flag is still a type error.
  • WithActiveModules: with an empty list it calls no hooks and asks no server anything.
  • Slots: Home (ModuleRails after Next in your series), the You hub (module sections after the core ones, parseYouSection/youSectionsFor take module keys, and a key that collides with a core section is ignored), and the book menu (module actions for the book's own server, keyed <id>:<key>). Each slot renders behind its own keyed component, so hooks inside a module are safe as the active list changes.
  • BookTab, BookActionKey and the Settings sections stay closed until Phase 2d needs them.

Tests: registry (multi-server, per-connection, empty), fake-module tests for each slot, a test that the empty registry renders as before and asks nothing, a test that a second module turning on does not break hook order, you-model key rules.

Reviews: /simplify and /code-review xhigh --fix, applied (a hook-order crash in slots, core-key type safety restored, duplicate React keys).

Verified live: web player at 1280 and 390 px (Home, all You sections, a book page) with the module off, on, and on with a ready Bridge: no page errors, pixel-identical to main's web export. Native builds not run (the registry is empty, so the slots render nothing).

Pairs with KodeStar/audiosilo-server#155.

Capabilities gains contributions (the server's first module flag, false
while off). src/modules/registry.ts holds PLAYER_MODULES, empty in 2a,
with useActiveModules (any of the profile's servers) and useModulesOn (one
server). Capability keys are open (CapabilityKey, hasCapability) so a
module's id is its flag.

Home (ModuleRails after Next in your series), the You hub (module sections
after the hub's own; parseYouSection takes active module keys) and the
book page's HeroActions (bookActions in the book menu) take an injectable
modules list. WithActiveModules asks nothing for an empty list, so the
player renders exactly as before.
Keep capability keys closed: a module's id is keyof Capabilities, so the hooks keep typo safety. One owner for the You hub's module-section rule (youModuleSections in you-model); the hub memoises its keys.
Module rails and You sections render behind their own components so a module's hooks never join the slot's; a module id is a ModuleFlag, never a core flag; links take CoreYouSection; module book actions are keyed <id>:<key>; a module section label is a function of t; blank section keys are ignored; one ServerBridge doc comment.
@KodeStar
KodeStar merged commit 40032c5 into main Oct 19, 2026
1 check passed
@KodeStar
KodeStar deleted the feat/bridge-2a branch October 19, 2026 21:38
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