feat(mapgen-studio): add collapsible config objects with per-object header anatomy, sticky auto-expand-on-scroll toggle, and useConfigCollapse hook#1634
Merged
Conversation
This was referenced Jun 12, 2026
Merged
refactor(studio): decompose App.tsx non-React corpus into feature modules and shared utilities
#1608
Merged
Merged
|
Railway preview (MapGen Studio): not provisioned for this PR. Policy (Graphite stacks): previews are created only for the top-of-stack PR by default.
Debug: |
This was referenced Jun 12, 2026
This was referenced Jun 12, 2026
Merged
mateicanavra
force-pushed
the
design/game-console-icons
branch
from
June 12, 2026 20:44
69b8c3a to
68fa74c
Compare
mateicanavra
force-pushed
the
design/config-collapse
branch
from
June 12, 2026 20:44
cdbecef to
44a8e66
Compare
Owner
Author
Merge activity
|
mateicanavra
changed the base branch from
design/game-console-icons
to
graphite-base/1634
June 12, 2026 21:48
…nual expand, sticky auto-expand toggle Also closes the Pass-4 goal ledger (console dock + icons, config collapse). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mateicanavra
force-pushed
the
design/config-collapse
branch
from
June 12, 2026 21:50
44a8e66 to
cc5a944
Compare
This was referenced Jun 12, 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.
Adds collapsible config objects to the recipe panel's schema form, with a per-object header anatomy and an optional sticky auto-expand-on-scroll mode.
Collapse behavior
Config objects (stage cards, group wells, array wells, and subgroup headings) now render collapsed by default. Each object gets a chevron + title disclosure button (
aria-expanded/aria-controls) and a trailing action zone for object-local controls. The focused stage root defaults to expanded when a stage is selected. Expansion state is keyed by JSON pointer, so it survives switching between focused and unfocused modes. When no collapse context is provided (template unit tests, bareSchemaFormreuse), templates fall back to the previous always-expanded markup with no chevrons.Array template
The Add button moves from its own flex row into the new header's trailing action zone, so it remains reachable even when the array is collapsed.
useConfigCollapsehookOwns the expansion state as an explicit-choices
Map<pointer, boolean>(absence = default, not false, so a deliberate collapse of the focused root is never overwritten by the default). Exposes aConfigCollapseContextcarryingexpandedPointers: ReadonlySet<string>andtoggle. The resolved set is passed as data rather than a closure because rjsf'sSchemaField.shouldComponentUpdateusesdeepEquals, which treats all functions as equivalent — a context whose only change is a fresh closure identity never triggers a re-render; Set membership changes do.Sticky auto-expand engine
A
ListCollapsetoolbar toggle (default OFF,aria-pressed) enables scroll-driven expansion. When on, a rAF-throttled scroll listener queries[data-config-header][data-config-pointer]elements in DOM order, identifies the last header at or above a 56 px focus line as the candidate, and sets the active chain to that pointer plus all its ancestor pointers (derivable from the string — no tree bookkeeping). A layout effect restores the candidate header's viewport offset after each chain change so collapsing content above the focus line never visibly jumps the reading position.ConfigCollapseContextand template plumbingBrowserConfigFormContextgains an optionalcollapsefield.SchemaConfigFormaccepts acollapseprop and merges it into the form context. Templates readcollapsefromregistry.formContextand stampdata-config-section/data-config-header/data-config-pointerattributes that the sticky engine queries without a ref registry.Tests
New template-level tests cover: collapsed objects render an accessible header with hidden content; expanding a pointer reveals content; nested groups collapse independently; the array Add button appears in the header action zone while collapsed; and templates without a collapse context render no disclosure chrome. A pure unit test covers
pointerPrefixesandcomputeActiveChain(empty input, first-header fallback, candidate selection, ancestor cascade).