Skip to content

refactor(runtime): migrate detail-panel surfaces to context components (#1237)#1296

Merged
gfargo merged 1 commit into
mainfrom
feat/surface-context-detail
Jun 17, 2026
Merged

refactor(runtime): migrate detail-panel surfaces to context components (#1237)#1296
gfargo merged 1 commit into
mainfrom
feat/surface-context-detail

Conversation

@gfargo

@gfargo gfargo commented Jun 17, 2026

Copy link
Copy Markdown
Owner

What

Fourth surface-migration batch (after #1295) — the detail/inspector cluster. The ten per-view detail surfaces now mount as context-reading components: renderDetailPanel returns h(<Surface>Component, props) instead of calling the positional renderer inline.

  • Eight preview/context panels (commit, compose-context, branch/tag/stash/submodule previews, issue + PR triage previews) share one positional signature → grouped under a keyed cache.
  • Commit-sourced diff detail and the history inspector take their async slices as component props (detail/loading; +filePreview/filePreviewLoading/tabbed for the inspector).

Behavior-preserving

The detail renderers keep their positional signatures and colocated render-snapshot suites unchangedfocused is derived inside each wrapper from state.focus === 'detail', exactly as the dispatcher did, so output is identical. renderDetailPanel gains a leading React param and no longer destructures context/contextStatus (the components self-serve those). The transient overlays (help/palette/pickers/confirmation/chord) stay positional — a separate concern.

Tests

  • New detailPanel.test.ts pins view→component routing + prop threading (without a renderer).
  • singlePane.test.ts updated to render the inspector through the context shim (the header.test.ts Proxy pattern), still asserting full-width (80) in single-pane.
  • overlays.test.ts gets the new React arg — its overlay branch returns before any component, so it's otherwise unaffected.

Validation

tsc clean · full jest green (3611 passed, 68 snapshots; 4 tsTreeSitterParser .wasm-backed failures = known worktree gotcha, pass in CI) · eslint 0 errors · rollup -c builds.

Next

PR 6 (final): per-surface memoization + prune the now-dead threading in app.ts (SurfaceRenderContext / MainPanelExtras shrink to true per-surface slices), then close #1237. Ladder in specs/surface-context-migration-plan.md.

#1237)

Fourth surface-migration batch — the detail/inspector cluster. The ten
per-view detail surfaces now mount as context-reading components:
`renderDetailPanel` returns `h(<Surface>Component, props)` instead of
calling the positional renderer inline.

- The eight preview/context panels (commit, compose-context, branch/tag/
  stash/submodule previews, issue + PR triage previews) share one
  positional signature, so they group under a keyed cache.
- Commit-sourced diff detail and the history inspector take their async
  slices (detail/loading, +filePreview/tabbed for the inspector) as
  component props.

The detail renderers keep their positional signatures and their colocated
render-snapshot suites unchanged — `focused` is derived inside each
wrapper from `state.focus === 'detail'`, exactly as the dispatcher did, so
output is identical. `renderDetailPanel` gains a leading `React` param and
no longer destructures `context`/`contextStatus` (the components self-
serve those). The transient overlays (help/palette/pickers/confirmation/
chord) stay positional — a separate concern.

Tests: new detailPanel.test.ts pins the view→component routing + prop
threading; singlePane.test.ts updated to render the inspector through the
context shim (header.test.ts pattern); overlays.test.ts gets the new
React arg (its overlay branch is unaffected).
@gfargo gfargo merged commit ac3bc5e into main Jun 17, 2026
16 checks passed
@gfargo gfargo deleted the feat/surface-context-detail branch June 17, 2026 15:05
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.

Finish runtime/app.ts decomposition

1 participant