feat(code): session inspector — branches, worktrees, env#3727
Merged
Conversation
Fifth slice of the dedicated Code surface (cave-k0ua): the workbench grows a toggleable right-hand inspector panel. - code-inspector.tsx: session env rows (harness/model/root/updated), local branch list with one-click switch, and fresh-worktree provisioning — the same /api/changes contracts chat's composer git chip uses (?branches=1, action=switch-branch, action=create-worktree), scoped to the session's work root (cave-9q24: worktree sessions mutate their own checkout). - code-workbench.tsx: header toggle (ph:sliders-bold, aria-pressed) shows the inspector as a w-72 border-l column on md+; dynamic() import; keyed by work root; narrow-screen treatment deferred to the mobile layout pass. - code-view.tsx: threads onTasksRefresh into the workbench so branch/worktree mutations re-poll the enriched session list (branch chips stay honest). - code-surface-mode.test.ts: inspector pin section (work-root scoping, ?branches=1 contract, switch/create actions, toggle accessibility, refresh threading). Verified: pin suite, tsc --noEmit, eslint, 892 app + 239 api test files. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a toggleable right-hand Session Inspector to the Code workbench (md+), surfacing session environment details plus branch/worktree controls by reusing the existing /api/changes contracts and threading refresh back into the enriched session list.
Changes:
- Added
CodeInspector(env + branches + create worktree) and mounted it as an optional right-side panel inCodeWorkbench. - Threaded an
onRefreshcallback fromCodeView→CodeWorkbench→CodeInspectorso inspector mutations can trigger a session-list re-poll. - Extended
code-surface-mode.test.tsto pin inspector wiring and/api/changescontract usage.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/components/code-workbench.tsx | Adds inspector toggle + right-side inspector column and refresh threading hook. |
| src/components/code-view.tsx | Passes workspace refresh callback into the workbench. |
| src/components/code-surface-mode.test.ts | Adds pins asserting inspector contract usage, toggle accessibility, and refresh wiring. |
| src/components/code-inspector.tsx | New inspector panel implementing env/branches/worktree UI backed by /api/changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| aria-label="Session inspector" | ||
| className="hidden w-72 shrink-0 border-l border-[var(--border-hairline)] md:block" | ||
| > | ||
| <LazyInspector key={workRoot} row={row} onChanged={onRefresh} /> |
| ); | ||
| assert.match( | ||
| workbench, | ||
| /<LazyInspector key=\{workRoot\} row=\{row\} onChanged=\{onRefresh\} \/>/, |
Comment on lines
+179
to
+184
| <span | ||
| className="shrink-0 text-[length:var(--text-2xs)] text-[var(--text-muted)]" | ||
| title={b.worktreePath ?? undefined} | ||
| > | ||
| ⑂ {b.worktree} | ||
| </span> |
This was referenced Jul 23, 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.
Fifth slice of the dedicated Code surface (cave-k0ua, series: #3716 → #3719 → #3722 → #3724).
What
The workbench grows a toggleable right-hand inspector (ph:sliders-bold in the session header,
aria-pressed, md+ only):How
/api/changescontracts chat's composer git chip speaks:?branches=1,action=switch-branch,action=create-worktree. No API changes.dynamic()import keyed by work root; mutations call through toonTasksRefreshso the enriched session list (branch chips) re-polls.Verification
code-surface-mode.test.tsextended (work-root scoping,?branches=1contract, switch/create action pins, toggle accessibility, refresh threading)tsc --noEmit, eslint cleanpnpm test:app(892 files) +pnpm test:api(239 files) green