spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

mods/diff: seated inline, the pane shows only the built-in's resize lineBrowse files
poteat authored on Sep 10, 2026 parent ace6b00 · commit d03baa078ef3
5 changed files+28 -2compared with ace6b00
Mmods/diff/README.md
Mmods/diff/hooks/names/texts/index.ts
Amods/diff/hooks/names/texts/resize-terminal-text.ts
Mmods/diff/hooks/register.ts
Mmods/diff/hooks/views/pane-view.tsx
@@ -7,7 +7,10 @@
77 repository's HEAD so a commit or checkout made elsewhere shows too. The
88 first successful edit of a session opens the pane by itself where the
99 terminal is wide enough (144 columns when the person never chose, 110 when
10-they kept it open before; a person who closed it is left alone). A file's
10+they kept it open before; a person who closed it is left alone). Where the
11+surface seats the pane inline instead of beside the transcript (a terminal
12+under 110 columns), it shows only the built-in's line asking for a wider
13+terminal. A file's
1114 ask button arms that file: its hunks ride the next prompt as context, once.
1215
1316 The pane compares the working tree against HEAD, split at the session's
@@ -2,6 +2,7 @@
22 export * from './git-unanswered-text.js'
33 export * from './not-in-repository-text.js'
44 export * from './register-failed-text-of.js'
5+export * from './resize-terminal-text.js'
56 export * from './untracked-withheld-text.js'
67
78 export * as default from '.'
@@ -1,0 +1,6 @@
1+/**
2+ * The pane's one line where the surface seats it inline (no room beside the
3+ * transcript), worded as the built-in words its refusal below that width.
4+ */
5+export const RESIZE_TERMINAL_TEXT =
6+ 'Resize your terminal to at least 110 columns to show the diff panel'
@@ -488,6 +488,7 @@
488488 columns: e.props.bodyColumns,
489489 },
490490 model,
491+ e.props.placement,
491492 )
492493 })
493494
@@ -3,22 +3,37 @@
33 /* @jsxFrag Fragment */
44 import type { RenderElement } from 'claude-code'
55
6+import Names from '../names'
67 import PaneState from '../pane-state'
78 import { currentPane } from './current-pane'
89 import type { Kit } from './kit'
10+import Sections from './sections'
911 import { turnPane } from './turn-pane'
1012
1113 /**
1214 * The diff pane's body for one `ui.render`: the repository's diff now, or
1315 * the picked turn's edits while that turn still exists (a rewind drops it).
1416 *
17+ * Seated inline (no room beside the transcript), only the built-in's line
18+ * asking for a wider terminal, as the built-in shows no panel there.
19+ *
1520 * @param kit the elements, the handlers, the width
1621 * @param model the pane's state
22+ * @param placement where the surface seated the pane (`props.placement`)
1723 * @returns the tree
1824 */
19-export function paneView(kit: Kit, model: PaneState.PaneModel): RenderElement {
25+export function paneView(
26+ kit: Kit,
27+ model: PaneState.PaneModel,
28+ placement: 'dock' | 'inline',
29+): RenderElement {
30+ const { Box } = kit.ui
2031 const turn = PaneState.pickedTurnOf(model)
2132 const isCurrent = turn === undefined
2233
34+ if (placement === 'inline') {
35+ return <Box>{Sections.dimNote(kit, Names.RESIZE_TERMINAL_TEXT)}</Box>
36+ }
37+
2338 return isCurrent ? currentPane(kit, model) : turnPane(kit, model, turn)
2439 }