Skip to content

Commit 765f236

Browse files
authored
diff: the docked pane starts at its header, under the engine's own head row (#99206)
Docked, the pane no longer pads a blank row of its own above its header: the engine keeps a docked pane's first row for its close mark, and that row is the blank one.
1 parent fbe20e0 commit 765f236

13 files changed

Lines changed: 90 additions & 32 deletions

File tree

‎mods/diff/hooks/limits/sizes/pane/index.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export * from './gutter-chrome.js'
22
export * from './max-summary-rows.js'
3-
export * from './pane-top-pad-rows.js'
43
export * from './pre-session-body-cap.js'
54
export * from './scroll-margin-rows.js'
65
export * from './wheel-rows.js'

‎mods/diff/hooks/limits/sizes/pane/pane-top-pad-rows.ts‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎mods/diff/hooks/views/body/plan/body-layout-of.ts‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import Limits from '../../../limits'
21
import type PaneState from '../../../pane-state'
32
import type { BodyLayout, DockPlan } from '../types'
43
import Segments from './segments'
@@ -39,10 +38,7 @@ export function bodyLayoutOf(
3938

4039
const tops = new Map<string, number>()
4140

42-
const visibleRows = Math.max(
43-
0,
44-
model.place.rows - Limits.PANE_TOP_PAD_ROWS - headRows - listRows,
45-
)
41+
const visibleRows = Math.max(0, model.place.rows - headRows - listRows)
4642

4743
let extent = 0
4844

@@ -54,7 +50,7 @@ export function bodyLayoutOf(
5450
extent += Segments.segmentRowsOf(segment)
5551
}
5652

57-
const listTop = Limits.PANE_TOP_PAD_ROWS + headRows + 1
53+
const listTop = headRows + 1
5854

5955
return {
6056
segments,

‎mods/diff/hooks/views/inset-of/inset-of.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ import type { Kit } from '../kit'
33

44
/**
55
* A drawing's kit inside the docked pane's padding: the built-in's blank
6-
* last column and its blank row above the header taken off.
6+
* last column taken off.
7+
*
8+
* No row comes off: the blank row above the header is the engine's own,
9+
* the one it keeps over a docked pane's body for its close mark.
710
*
811
* @param kit the drawing's kit at the pane's full size
912
* @returns the kit its body draws with
1013
*/
1114
export const insetOf = (kit: Kit): Kit => ({
1215
...kit,
1316
columns: Math.max(1, kit.columns - Limits.PANE_RIGHT_PAD_COLUMNS),
14-
rows: Math.max(0, kit.rows - Limits.PANE_TOP_PAD_ROWS),
1517
})

‎mods/diff/hooks/views/pane-view.tsx‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@ export function paneView(
4040
seat.terminalColumns < Limits.OPEN_MIN_COLUMNS
4141

4242
return isDocked ? (
43-
<Box
44-
flexDirection="column"
45-
paddingTop={Limits.PANE_TOP_PAD_ROWS}
46-
paddingRight={Limits.PANE_RIGHT_PAD_COLUMNS}
47-
>
43+
<Box flexDirection="column" paddingRight={Limits.PANE_RIGHT_PAD_COLUMNS}>
4844
{sidebarPane(insetOf(kit), model)}
4945
</Box>
5046
) : isNarrow ? (

‎mods/diff/tests/fixtures/index.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ export * from './unsaid-hint.js'
6060
export * from './usage-at.js'
6161
export * from './vs-main.js'
6262
export * from './wheel-over-list.js'
63+
export * from './wheel-over-list-margin.js'
64+
export * from './wheel-over-list-top.js'
6365
export * from './wheel-tick.js'
6466
export * from './with-lockfile.js'
6567
export * from './worktree'
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/**
2-
* The pane's body rows in the ordinary cases: docked in a 40-row terminal.
2+
* The pane's body rows in the ordinary cases: docked in a 40-row terminal,
3+
* under the row the engine keeps for its close mark.
34
*/
4-
export const BODY_ROWS = 35
5+
export const BODY_ROWS = 34
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/**
2+
* The rows the engine keeps over a docked pane's body: one, blank but for
3+
* its close mark.
4+
*/
5+
export const ENGINE_HEAD_ROWS = 1

‎mods/diff/tests/fixtures/pane-view/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export * from './dock-seat.js'
99
export * from './docked-pane.js'
1010
export * from './docks-pane.js'
1111
export * from './draws-pane.js'
12+
export * from './engine-head-rows.js'
1213
export * from './long-line-chars.js'
1314
export * from './long-path-segments.js'
1415
export * from './narrow-seat.js'
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import type { UiScrollInput } from 'claude-code'
2+
3+
import { WHEEL_TICK } from './wheel-tick.js'
4+
5+
/**
6+
* The same wheel tick with the pointer over the blank row between the
7+
* docked header and its list.
8+
*/
9+
export const WHEEL_OVER_LIST_MARGIN: UiScrollInput = {
10+
...WHEEL_TICK,
11+
pointer: { column: 10, row: 1 },
12+
}

0 commit comments

Comments
 (0)