Skip to content

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.

TypeScript

mods/diff: seated inline, the pane shows only the built-in's resize line

poteatd03baa078ef3
diff --git a/mods/diff/README.md b/mods/diff/README.md
index 37b6e8d7..4db989fb 100644
--- a/mods/diff/README.md
+++ b/mods/diff/README.md
@@ -7,7 +7,10 @@ runs shell commands and finishes turns, and while it is open it polls the
repository's HEAD so a commit or checkout made elsewhere shows too. The
first successful edit of a session opens the pane by itself where the
terminal is wide enough (144 columns when the person never chose, 110 when
-they kept it open before; a person who closed it is left alone). A file's
+they kept it open before; a person who closed it is left alone). Where the
+surface seats the pane inline instead of beside the transcript (a terminal
+under 110 columns), it shows only the built-in's line asking for a wider
+terminal. A file's
ask button arms that file: its hunks ride the next prompt as context, once.
The pane compares the working tree against HEAD, split at the session's
diff --git a/mods/diff/hooks/names/texts/index.ts b/mods/diff/hooks/names/texts/index.ts
index 20299567..d98e2dc1 100644
--- a/mods/diff/hooks/names/texts/index.ts
+++ b/mods/diff/hooks/names/texts/index.ts
@@ -2,6 +2,7 @@ export * from './builtin-holds-pattern.js'
export * from './git-unanswered-text.js'
export * from './not-in-repository-text.js'
export * from './register-failed-text-of.js'
+export * from './resize-terminal-text.js'
export * from './untracked-withheld-text.js'
export * as default from '.'
diff --git a/mods/diff/hooks/names/texts/resize-terminal-text.ts b/mods/diff/hooks/names/texts/resize-terminal-text.ts
new file mode 100644
index 00000000..adb93a5a
--- /dev/null
+++ b/mods/diff/hooks/names/texts/resize-terminal-text.ts
@@ -0,0 +1,6 @@
+/**
+ * The pane's one line where the surface seats it inline (no room beside the
+ * transcript), worded as the built-in words its refusal below that width.
+ */
+export const RESIZE_TERMINAL_TEXT =
+ 'Resize your terminal to at least 110 columns to show the diff panel'
diff --git a/mods/diff/hooks/register.ts b/mods/diff/hooks/register.ts
index e5ee7e18..18c90f0e 100644
--- a/mods/diff/hooks/register.ts
+++ b/mods/diff/hooks/register.ts
@@ -488,6 +488,7 @@ export function register(on: On) {
columns: e.props.bodyColumns,
},
model,
+ e.props.placement,
)
})
diff --git a/mods/diff/hooks/views/pane-view.tsx b/mods/diff/hooks/views/pane-view.tsx
index 813d44f3..0cd22f0f 100644
--- a/mods/diff/hooks/views/pane-view.tsx
+++ b/mods/diff/hooks/views/pane-view.tsx
@@ -3,22 +3,37 @@
/* @jsxFrag Fragment */
import type { RenderElement } from 'claude-code'
+import Names from '../names'
import PaneState from '../pane-state'
import { currentPane } from './current-pane'
import type { Kit } from './kit'
+import Sections from './sections'
import { turnPane } from './turn-pane'
/**
* The diff pane's body for one `ui.render`: the repository's diff now, or
* the picked turn's edits while that turn still exists (a rewind drops it).
*
+ * Seated inline (no room beside the transcript), only the built-in's line
+ * asking for a wider terminal, as the built-in shows no panel there.
+ *
* @param kit the elements, the handlers, the width
* @param model the pane's state
+ * @param placement where the surface seated the pane (`props.placement`)
* @returns the tree
*/
-export function paneView(kit: Kit, model: PaneState.PaneModel): RenderElement {
+export function paneView(
+ kit: Kit,
+ model: PaneState.PaneModel,
+ placement: 'dock' | 'inline',
+): RenderElement {
+ const { Box } = kit.ui
const turn = PaneState.pickedTurnOf(model)
const isCurrent = turn === undefined
+ if (placement === 'inline') {
+ return <Box>{Sections.dimNote(kit, Names.RESIZE_TERMINAL_TEXT)}</Box>
+ }
+
return isCurrent ? currentPane(kit, model) : turnPane(kit, model, turn)
}