Repository navigation
Bridge 2a: player modules registry and open slots - #116
Merged
Merged
Conversation
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.
This was referenced Oct 19, 2026
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.
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?: booleaninCapabilities, mirroring the server's new module flag.src/modules/registry.ts:PlayerModule(homeRails,youSections,bookActions), an emptyPLAYER_MODULES,useActiveModules(any of the profile's servers) anduseModulesOn(one server). A module'sidis a typedModuleFlag, and the capability hooks keepkeyof 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.ModuleRailsafter Next in your series), the You hub (module sections after the core ones,parseYouSection/youSectionsFortake 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,BookActionKeyand 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-modelkey 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.