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
| @@ -19,7 +19,8 @@ | ||
| 19 | 19 | * body at a time): header, base line, todo bar, pickers, rows, detail. |
| 20 | 20 | * |
| 21 | 21 | * 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 | |
| 23 | 24 | * selected file last. With no rows to list, the loading line, the empty |
| 24 | 25 | * state or the too-many and only-hidden lines take the body instead |
| 25 | 26 | * (messagePaneOf), the header keeping only the close. |
| @@ -90,7 +91,11 @@ | ||
| 90 | 91 | onPress: kit.actions.togglePreSession, |
| 91 | 92 | }) |
| 92 | 93 | : 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)] | |
| 94 | 99 | const isUntrackedNoted = data?.isUntrackedWithheld === true && !empty |
| 95 | 100 | const listed = listBodyOf(kit, { data, partition, totals, empty }) |
| 96 | 101 | const notes = listed.filter(line => typeof line === 'string') |
| @@ -136,7 +141,7 @@ | ||
| 136 | 141 | message, |
| 137 | 142 | controls: Sections.controlsView(kit, model), |
| 138 | 143 | earlier: earlierToggle, |
| 139 | - rest: [...earlierRows.map(rowOf), ...detail], | |
| 144 | + rest: [...earlierRows, ...detail], | |
| 140 | 145 | }) |
| 141 | 146 | } |
| 142 | 147 | |
| @@ -153,8 +158,9 @@ | ||
| 153 | 158 | ), |
| 154 | 159 | notShownNote, |
| 155 | 160 | untrackedNote, |
| 161 | + hasEarlier ? <Box height={1} /> : null, | |
| 156 | 162 | earlierToggle, |
| 157 | - ...earlierRows.map(rowOf), | |
| 163 | + ...earlierRows, | |
| 158 | 164 | ...detail, |
| 159 | 165 | ])} |
| 160 | 166 | </Box> |
| @@ -16,7 +16,8 @@ | ||
| 16 | 16 | * sit where the built-in centers them (half the spare rows above, rounded |
| 17 | 17 | * down; each wrapped line centered on its own), the pickers right under |
| 18 | 18 | * 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). | |
| 20 | 21 | * |
| 21 | 22 | * @param kit the elements, the width, the body's rows |
| 22 | 23 | * @param pane the header block, the message's lines, the pickers, the |
| @@ -41,6 +42,10 @@ | ||
| 41 | 42 | const drawn = lines.map(line => <Text dimColor>{line}</Text>) |
| 42 | 43 | const controlRows = controls === null ? [] : [controls] |
| 43 | 44 | const earlierRows = earlier === null ? [] : [earlier] |
| 45 | + const aboveEarlier = | |
| 46 | + controlRows.length > 0 || earlierRows.length === 0 | |
| 47 | + ? controlRows | |
| 48 | + : [<Box height={1} />] | |
| 44 | 49 | const middleRows = kit.rows - top.length - 1 - (earlier === null ? 0 : 3) |
| 45 | 50 | const above = Math.floor((middleRows - lines.length) / 2) |
| 46 | 51 | const isCentered = |
| @@ -54,7 +59,7 @@ | ||
| 54 | 59 | ...top, |
| 55 | 60 | <Box height={1} />, |
| 56 | 61 | ...drawn, |
| 57 | - ...controlRows, | |
| 62 | + ...aboveEarlier, | |
| 58 | 63 | ...earlierRows, |
| 59 | 64 | ...rest, |
| 60 | 65 | ]} |
| @@ -5,6 +5,7 @@ | ||
| 5 | 5 | |
| 6 | 6 | import type { Kit } from '../kit' |
| 7 | 7 | import Layout from '../layout' |
| 8 | +import Sections from '../sections' | |
| 8 | 9 | import { codeBlocksOf } from './code-blocks-of' |
| 9 | 10 | import type { DetailModel } from './detail-model' |
| 10 | 11 | import { HUNK_DIVIDER } from './hunk-divider' |
| @@ -13,7 +14,8 @@ | ||
| 13 | 14 | |
| 14 | 15 | /** |
| 15 | 16 | * 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. | |
| 17 | 19 | * |
| 18 | 20 | * The body is a placeholder, or the hunks as the engine's diff `Code` blocks |
| 19 | 21 | * (codeBlocksOf) named by the path, a dim divider where two meet at a hunk; |
| @@ -81,6 +83,7 @@ | ||
| 81 | 83 | ...ask, |
| 82 | 84 | ]} |
| 83 | 85 | </Box>, |
| 86 | + Sections.divider(kit), | |
| 84 | 87 | ...(placeholder ? notes : hunks), |
| 85 | 88 | ...footer, |
| 86 | 89 | ]} |
| @@ -6,7 +6,8 @@ | ||
| 6 | 6 | import type { Kit } from '../kit' |
| 7 | 7 | |
| 8 | 8 | /** |
| 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. | |
| 10 | 11 | * |
| 11 | 12 | * @param kit the elements and the width |
| 12 | 13 | * @returns the rule |