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: docked, the pane keeps the built-in's blank top row and last column

poteat9518d8f380dc
diff --git a/mods/diff/hooks/limits/columns/index.ts b/mods/diff/hooks/limits/columns/index.ts
index e98ed0fd..fc8fb2d9 100644
--- a/mods/diff/hooks/limits/columns/index.ts
+++ b/mods/diff/hooks/limits/columns/index.ts
@@ -1,5 +1,6 @@
export * from './auto-open-min-columns.js'
export * from './open-min-columns.js'
+export * from './pane-right-pad-columns.js'
export * from './widest-bucket-columns.js'
export * as default from '.'
diff --git a/mods/diff/hooks/limits/columns/pane-right-pad-columns.ts b/mods/diff/hooks/limits/columns/pane-right-pad-columns.ts
new file mode 100644
index 00000000..9dfef13a
--- /dev/null
+++ b/mods/diff/hooks/limits/columns/pane-right-pad-columns.ts
@@ -0,0 +1,5 @@
+/**
+ * The blank column the docked pane keeps at its right edge, as the built-in
+ * sidebar's body does (its `paddingX`): rows wrap one column short of it.
+ */
+export const PANE_RIGHT_PAD_COLUMNS = 1
diff --git a/mods/diff/hooks/limits/sizes/index.ts b/mods/diff/hooks/limits/sizes/index.ts
index a184760a..3fe50cfb 100644
--- a/mods/diff/hooks/limits/sizes/index.ts
+++ b/mods/diff/hooks/limits/sizes/index.ts
@@ -5,5 +5,6 @@ export * from './max-files-for-details.js'
export * from './max-lines-per-file.js'
export * from './max-listed-directories.js'
export * from './max-untracked-probes.js'
+export * from './pane-top-pad-rows.js'
export * as default from '.'
diff --git a/mods/diff/hooks/limits/sizes/pane-top-pad-rows.ts b/mods/diff/hooks/limits/sizes/pane-top-pad-rows.ts
new file mode 100644
index 00000000..e487c318
--- /dev/null
+++ b/mods/diff/hooks/limits/sizes/pane-top-pad-rows.ts
@@ -0,0 +1,5 @@
+/**
+ * The blank row the docked pane keeps above its header, as the built-in
+ * sidebar's header does (its `paddingY`).
+ */
+export const PANE_TOP_PAD_ROWS = 1
diff --git a/mods/diff/hooks/views/pane-view.tsx b/mods/diff/hooks/views/pane-view.tsx
index 0cd22f0f..1694b208 100644
--- a/mods/diff/hooks/views/pane-view.tsx
+++ b/mods/diff/hooks/views/pane-view.tsx
@@ -3,6 +3,7 @@
/* @jsxFrag Fragment */
import type { RenderElement } from 'claude-code'
+import Limits from '../limits'
import Names from '../names'
import PaneState from '../pane-state'
import { currentPane } from './current-pane'
@@ -15,7 +16,9 @@ import { turnPane } from './turn-pane'
* 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.
+ * asking for a wider terminal, as the built-in shows no panel there. Docked,
+ * the body keeps the built-in's blank row above the header and blank last
+ * column, so its rows sit and wrap where the built-in's do.
*
* @param kit the elements, the handlers, the width
* @param model the pane's state
@@ -35,5 +38,13 @@ export function paneView(
return <Box>{Sections.dimNote(kit, Names.RESIZE_TERMINAL_TEXT)}</Box>
}
- return isCurrent ? currentPane(kit, model) : turnPane(kit, model, turn)
+ const right = Limits.PANE_RIGHT_PAD_COLUMNS
+ const top = Limits.PANE_TOP_PAD_ROWS
+ const inset: Kit = { ...kit, columns: Math.max(1, kit.columns - right) }
+
+ return (
+ <Box flexDirection="column" paddingTop={top} paddingRight={right}>
+ {isCurrent ? currentPane(inset, model) : turnPane(inset, model, turn)}
+ </Box>
+ )
}