feat(m1): PR3 T3.0 — shell UI, action kinds, story tab #16

Merged
ginnoir merged 26 commits from feat/m1-progression into main 2026-06-11 22:52:29 -05:00
26 Commits
Author SHA1 Message Date
ginnoir f7ad9e7ecd test(engine): guard offline-loop safety and harden purity test
CI / verify (push) Successful in 1m13s
CI / verify (pull_request) Successful in 58s
- save.test.ts: add regression test proving loop actions do NOT start
  or yield during offline catch-up (applyOfflineProgress replays
  tickGame directly; maybeStartLoopAction is never called, so an
  enabled loop with no active action stays idle and yields 0).

- purity.test.ts: extend FORBIDDEN list to catch environment APIs
  (Date.now(), localStorage., indexedDB., idb-keyval import, document.,
  window., requestAnimationFrame()) in addition to the existing
  React/react-dom/zustand import guards. Patterns are scoped to call
  sites and member-access forms so prose comments (e.g. save.ts's
  "Date scheduling" doc comment) do not false-positive. lz-string is
  intentionally omitted — it is a pure compression library.

- NavRail.tsx: add sr-only "New story" span alongside the aria-hidden
  pulse dot so screen readers can perceive the unread-story badge.
2026-06-11 22:40:38 -05:00
ginnoir 977dd8e878 docs: document PR3 shell UI and action kinds 2026-06-11 22:33:48 -05:00
ginnoir 4d508ae77c refactor(ui): link event-log disclosure with aria-controls
Add aria-controls to the right-rail event-log collapse toggle pointing at
the log region, and title-case the settings label for consistency.
2026-06-11 22:31:24 -05:00
ginnoir 10a43729c5 feat(ui): right rail inventory placeholder and optional event log
- RightRail: add Inventory section (placeholder "Items coming soon") between
  Resources and Event Log, matching the existing heading style
- RightRail: gate Event Log section on prefs.showEventLog; add local-state
  collapse toggle with aria-expanded and chevron indicator
- SettingsPanel: add "Show event log" checkbox row bound to prefs.showEventLog
  via setPrefs, matching existing card styling
- PlayPanel: gate mobile EventLog behind prefs.showEventLog for consistency
  with desktop; mobile ResourceBar unchanged
2026-06-11 22:28:42 -05:00
ginnoir 880abe5888 fix(ui): restore boot-intro continue and fix story tree a11y
Finding 1 (critical): atBootIntro was derived from tree.length === 0 in
StoryView.tsx, but buildStoryTree always returns all topology-root nodes,
so tree.length is always > 0 and the Continue button never rendered.
Fix: add atBootIntro: boolean to StoryView (viewModel), computed by
finding the boot-trigger node id without hardcoding the literal string,
then comparing to the current node. StoryView.tsx reads it from the store.
Also add a viewModel test covering both true and false cases.

Finding 2: onSelect in StoryView.tsx called useGameStore.getState()
directly, bypassing the runtime command layer. Fix: add
GameRuntime.selectStoryNode(id) and wire onSelect through gameRuntime.

Finding 3: aria-pressed on story tree nodes wrongly signals toggle-button
semantics. Fix: replace with aria-current={isSelected ? 'true' : undefined}.

Optional: hoist h-[calc(100dvh-6rem)] to SHELL_HEIGHT const in StoryView.tsx.
2026-06-11 22:25:51 -05:00
ginnoir 91348ed42f refactor(ui): finalize review fixes for action cards and view model
- Guard ActionCard click-outside listener behind open state
- Add aria-expanded to ActionGroup collapse toggle
- Use optional chaining and drop non-null assertions in column projection
2026-06-11 22:16:40 -05:00
ginnoir e9f2514308 feat(ui): story tab with tree and prose log 2026-06-11 22:11:01 -05:00
ginnoir 75273a76de refactor(ui): improve action card accessibility, flex layout and scroll styling 2026-06-11 21:34:46 -05:00
ginnoir bbded8a266 feat(ui): action columns with collapsible groups 2026-06-11 21:32:13 -05:00
ginnoir 08d186f42e refactor: clean up unused panel overlay state and methods 2026-06-11 21:29:44 -05:00
ginnoir 232b84299c refactor(ui): resolve mobile layout and HMR findings for app shell and nav rail 2026-06-11 21:27:41 -05:00
ginnoir ee79872d4d feat(ui): app shell with nav rail 2026-06-11 21:24:42 -05:00
ginnoir ed9607e9e8 refactor(state): address HMR and defensive slicing recommendations for runtime 2026-06-11 21:23:18 -05:00
ginnoir b29b17c6cb refactor(state): fix code quality findings for runtime and story log 2026-06-11 21:20:52 -05:00
ginnoir 239b2506ec feat(state): runtime performAction and nav story signals 2026-06-11 21:16:27 -05:00
ginnoir adf730702d refactor(state): address review recommendations for store and prefs 2026-06-11 21:14:04 -05:00
ginnoir 09e2d06b87 refactor(state): fix code quality findings for nav panel store and prefs 2026-06-11 21:12:20 -05:00
ginnoir 9b2793b264 feat(state): nav panel store and expanded prefs 2026-06-11 21:10:07 -05:00
ginnoir 73d836fe96 feat(state): project actions into columns and story tree 2026-06-11 21:01:42 -05:00
ginnoir 163f710f4c feat(engine): add performAction dispatcher by kind 2026-06-11 20:53:55 -05:00
ginnoir 0de61d3e41 feat(engine): loop idle runner with enabledLoopActionIds 2026-06-11 20:44:20 -05:00
ginnoir 8d9484171f feat(engine): execute story actions via storyChoiceId 2026-06-11 20:36:07 -05:00
ginnoir b3940774c4 feat(engine): add instant action execution
Implements executeInstant, which applies an instant action's costs and
yields immediately with no queue slot and no duration requirement.
2026-06-11 20:29:28 -05:00
ginnoir b54805637c feat(content): migrate stub actions to kind/group model 2026-06-11 20:23:49 -05:00
ginnoir c1b38e36aa fix(content): guard optional durationMs and cover loop validation 2026-06-11 20:17:50 -05:00
ginnoir c48e53cc7b feat(content): add action kind and group schema 2026-06-11 20:12:21 -05:00