refactor(runtime): migrate detail-panel surfaces to context components (#1237)#1296
Merged
Conversation
#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).
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.
What
Fourth surface-migration batch (after #1295) — the detail/inspector cluster. The ten per-view detail surfaces now mount as context-reading components:
renderDetailPanelreturnsh(<Surface>Component, props)instead of calling the positional renderer inline.detail/loading; +filePreview/filePreviewLoading/tabbedfor the inspector).Behavior-preserving
The detail renderers keep their positional signatures and colocated render-snapshot suites unchanged —
focusedis derived inside each wrapper fromstate.focus === 'detail', exactly as the dispatcher did, so output is identical.renderDetailPanelgains a leadingReactparam and no longer destructurescontext/contextStatus(the components self-serve those). The transient overlays (help/palette/pickers/confirmation/chord) stay positional — a separate concern.Tests
detailPanel.test.tspins view→component routing + prop threading (without a renderer).singlePane.test.tsupdated to render the inspector through the context shim (theheader.test.tsProxy pattern), still asserting full-width (80) in single-pane.overlays.test.tsgets the newReactarg — its overlay branch returns before any component, so it's otherwise unaffected.Validation
tscclean · full jest green (3611 passed, 68 snapshots; 4tsTreeSitterParser.wasm-backedfailures = known worktree gotcha, pass in CI) · eslint 0 errors ·rollup -cbuilds.Next
PR 6 (final): per-surface memoization + prune the now-dead threading in
app.ts(SurfaceRenderContext/MainPanelExtrasshrink to true per-surface slices), then close #1237. Ladder inspecs/surface-context-migration-plan.md.