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: the pre-session rows sit under the built-in's blank rows, and a rule under the file's nameBrowse files
poteat authored on Sep 10, 2026 parent 478b718 · commit dbe663d94840
4 changed files+23 -8compared with 478b718
Mmods/diff/hooks/views/current-pane/current-pane.tsx
Mmods/diff/hooks/views/current-pane/message-pane-of/message-pane-of.tsx
Mmods/diff/hooks/views/detail/detail-view.tsx
Mmods/diff/hooks/views/sections/divider.tsx
@@ -19,7 +19,8 @@
1919 * body at a time): header, base line, todo bar, pickers, rows, detail.
2020 *
2121 * The tests-and-generated toggle sits above the rows; the elision count, the
22- * withheld-untracked note, the pre-session line and rows below them; the
22+ * withheld-untracked note, the pre-session line and rows below them, a blank
23+ * row above that line and above its rows as the built-in leaves; the
2324 * selected file last. With no rows to list, the loading line, the empty
2425 * state or the too-many and only-hidden lines take the body instead
2526 * (messagePaneOf), the header keeping only the close.
@@ -90,7 +91,11 @@
9091 onPress: kit.actions.togglePreSession,
9192 })
9293 : null
93- const earlierRows = model.isPreSessionShown ? partition.preSession : []
94+ const earlierFiles = model.isPreSessionShown ? partition.preSession : []
95+ const earlierRows =
96+ earlierFiles.length === 0
97+ ? []
98+ : [<Box height={1} />, ...earlierFiles.map(rowOf)]
9499 const isUntrackedNoted = data?.isUntrackedWithheld === true && !empty
95100 const listed = listBodyOf(kit, { data, partition, totals, empty })
96101 const notes = listed.filter(line => typeof line === 'string')
@@ -136,7 +141,7 @@
136141 message,
137142 controls: Sections.controlsView(kit, model),
138143 earlier: earlierToggle,
139- rest: [...earlierRows.map(rowOf), ...detail],
144+ rest: [...earlierRows, ...detail],
140145 })
141146 }
142147
@@ -153,8 +158,9 @@
153158 ),
154159 notShownNote,
155160 untrackedNote,
161+ hasEarlier ? <Box height={1} /> : null,
156162 earlierToggle,
157- ...earlierRows.map(rowOf),
163+ ...earlierRows,
158164 ...detail,
159165 ])}
160166 </Box>
@@ -16,7 +16,8 @@
1616 * sit where the built-in centers them (half the spare rows above, rounded
1717 * down; each wrapped line centered on its own), the pickers right under
1818 * them and the pre-session line at the foot; otherwise it all stacks from
19- * the top.
19+ * the top, the pickers on the blank row the built-in leaves above the
20+ * pre-session line (that blank row itself when there are none).
2021 *
2122 * @param kit the elements, the width, the body's rows
2223 * @param pane the header block, the message's lines, the pickers, the
@@ -41,6 +42,10 @@
4142 const drawn = lines.map(line => <Text dimColor>{line}</Text>)
4243 const controlRows = controls === null ? [] : [controls]
4344 const earlierRows = earlier === null ? [] : [earlier]
45+ const aboveEarlier =
46+ controlRows.length > 0 || earlierRows.length === 0
47+ ? controlRows
48+ : [<Box height={1} />]
4449 const middleRows = kit.rows - top.length - 1 - (earlier === null ? 0 : 3)
4550 const above = Math.floor((middleRows - lines.length) / 2)
4651 const isCentered =
@@ -54,7 +59,7 @@
5459 ...top,
5560 <Box height={1} />,
5661 ...drawn,
57- ...controlRows,
62+ ...aboveEarlier,
5863 ...earlierRows,
5964 ...rest,
6065 ]}
@@ -5,6 +5,7 @@
55
66 import type { Kit } from '../kit'
77 import Layout from '../layout'
8+import Sections from '../sections'
89 import { codeBlocksOf } from './code-blocks-of'
910 import type { DetailModel } from './detail-model'
1011 import { HUNK_DIVIDER } from './hunk-divider'
@@ -13,7 +14,8 @@
1314
1415 /**
1516 * The selected file under the list: its bold path and asides, each name
16- * cut from its start to the width, the ask Button, the body.
17+ * cut from its start to the width, the ask Button, the built-in's dim rule
18+ * under them, the body.
1719 *
1820 * The body is a placeholder, or the hunks as the engine's diff `Code` blocks
1921 * (codeBlocksOf) named by the path, a dim divider where two meet at a hunk;
@@ -81,6 +83,7 @@
8183 ...ask,
8284 ]}
8385 </Box>,
86+ Sections.divider(kit),
8487 ...(placeholder ? notes : hunks),
8588 ...footer,
8689 ]}
@@ -6,7 +6,8 @@
66 import type { Kit } from '../kit'
77
88 /**
9- * A dim rule across the body, between the list and the selected file.
9+ * A dim rule across the body: between the list and the selected file, and
10+ * under that file's name.
1011 *
1112 * @param kit the elements and the width
1213 * @returns the rule