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
| @@ -1,0 +1,5 @@ | ||
| 1 | +/** | |
| 2 | + * The cells an inline file row keeps off its path (DiffFileList's 16 for | |
| 3 | + * the counts, 3 for the pointer, 4 for the frame). | |
| 4 | + */ | |
| 5 | +export const DIALOG_PATH_RESERVE = 23 |
| @@ -1,6 +1,9 @@ | ||
| 1 | 1 | export * from './auto-open-min-columns.js' |
| 2 | +export * from './dialog-path-reserve.js' | |
| 2 | 3 | export * from './open-min-columns.js' |
| 3 | 4 | export * from './pane-right-pad-columns.js' |
| 5 | +export * from './path-floor.js' | |
| 6 | +export * from './stat-cells.js' | |
| 4 | 7 | export * from './widest-bucket-columns.js' |
| 5 | 8 | |
| 6 | 9 | export * as default from '.' |
| @@ -1,0 +1,5 @@ | ||
| 1 | +/** | |
| 2 | + * The fewest cells a docked file row gives its path, however narrow the | |
| 3 | + * pane (ReplDiffSidebar's 8). | |
| 4 | + */ | |
| 5 | +export const PATH_FLOOR = 8 |
| @@ -1,0 +1,5 @@ | ||
| 1 | +/** | |
| 2 | + * The cells a docked file row keeps for its `+N -M` (ReplDiffSidebar's 12): | |
| 3 | + * the path is cut from its start to the rest. | |
| 4 | + */ | |
| 5 | +export const STAT_CELLS = 12 |
| @@ -1,0 +1,5 @@ | ||
| 1 | +/** | |
| 2 | + * The fewest cells an inline file row gives its path, however narrow the | |
| 3 | + * pane (DiffFileList's 20). | |
| 4 | + */ | |
| 5 | +export const DIALOG_PATH_FLOOR = 20 |
| @@ -1,5 +1,8 @@ | ||
| 1 | 1 | export * from './columns' |
| 2 | +export * from './dialog-path-floor.js' | |
| 2 | 3 | export * from './sizes' |
| 3 | 4 | export * from './timing' |
| 5 | +export * from './todo-bar-cells.js' | |
| 6 | +export * from './todo-bar-reserve.js' | |
| 4 | 7 | |
| 5 | 8 | export * as default from '.' |
| @@ -1,0 +1,4 @@ | ||
| 1 | +/** | |
| 2 | + * The widest the todo progress bar draws (ReplDiffSidebar's 20). | |
| 3 | + */ | |
| 4 | +export const TODO_BAR_CELLS = 20 |
| @@ -1,0 +1,4 @@ | ||
| 1 | +/** | |
| 2 | + * The cells kept beside the todo bar for its `done/total` count. | |
| 3 | + */ | |
| 4 | +export const TODO_BAR_RESERVE = 12 |
| @@ -3,10 +3,9 @@ | ||
| 3 | 3 | /* @jsxFrag Fragment */ |
| 4 | 4 | import type { RenderElement } from 'claude-code' |
| 5 | 5 | |
| 6 | +import Limits from '../../../limits' | |
| 6 | 7 | import type { Kit } from '../../kit' |
| 7 | 8 | import Layout from '../../layout' |
| 8 | -import { DIALOG_PATH_FLOOR } from '../dialog-path-floor' | |
| 9 | -import { DIALOG_PATH_RESERVE } from '../dialog-path-reserve' | |
| 10 | 9 | import { diffStat } from '../diff-stat' |
| 11 | 10 | import type { FileRowModel } from '../file-row-model' |
| 12 | 11 | import { listRow } from '../list-row' |
| @@ -27,7 +26,12 @@ | ||
| 27 | 26 | onPress: () => void, |
| 28 | 27 | ): RenderElement { |
| 29 | 28 | const { Text } = kit.ui |
| 30 | - const room = Math.max(DIALOG_PATH_FLOOR, kit.columns - DIALOG_PATH_RESERVE) | |
| 29 | + | |
| 30 | + const room = Math.max( | |
| 31 | + Limits.DIALOG_PATH_FLOOR, | |
| 32 | + kit.columns - Limits.DIALOG_PATH_RESERVE, | |
| 33 | + ) | |
| 34 | + | |
| 31 | 35 | const mark = row.isSelected ? POINTER : ' ' |
| 32 | 36 | const name = Layout.truncateStart(Layout.sanitizeName(row.displayPath), room) |
| 33 | 37 |
| @@ -1,5 +1,0 @@ | ||
| 1 | -/** | |
| 2 | - * The fewest cells an inline file row gives its path, however narrow the | |
| 3 | - * pane (DiffFileList's 20). | |
| 4 | - */ | |
| 5 | -export const DIALOG_PATH_FLOOR = 20 |
| @@ -1,3 +1,0 @@ | ||
| 1 | -export * from './dialog-path-floor.js' | |
| 2 | - | |
| 3 | -export * as default from '.' |
| @@ -1,5 +1,0 @@ | ||
| 1 | -/** | |
| 2 | - * The cells an inline file row keeps off its path (DiffFileList's 16 for | |
| 3 | - * the counts, 3 for the pointer, 4 for the frame). | |
| 4 | - */ | |
| 5 | -export const DIALOG_PATH_RESERVE = 23 |
| @@ -1,3 +1,0 @@ | ||
| 1 | -export * from './dialog-path-reserve.js' | |
| 2 | - | |
| 3 | -export * as default from '.' |
| @@ -1,12 +1,11 @@ | ||
| 1 | 1 | import type { RenderElement } from 'claude-code' |
| 2 | 2 | |
| 3 | +import Limits from '../../../limits' | |
| 3 | 4 | import type { Kit } from '../../kit' |
| 4 | 5 | import Layout from '../../layout' |
| 5 | 6 | import { diffStat } from '../diff-stat' |
| 6 | 7 | import type { FileRowModel } from '../file-row-model' |
| 7 | 8 | import { listRow } from '../list-row' |
| 8 | -import { PATH_FLOOR } from '../path-floor' | |
| 9 | -import { STAT_CELLS } from '../stat-cells' | |
| 10 | 9 | import { statTextOf } from '../stat-text-of' |
| 11 | 10 | |
| 12 | 11 | /** |
| @@ -29,7 +28,7 @@ | ||
| 29 | 28 | const label = Layout.padEnd( |
| 30 | 29 | Layout.truncateStart( |
| 31 | 30 | Layout.sanitizeName(row.displayPath), |
| 32 | - Math.max(kit.columns - STAT_CELLS, PATH_FLOOR), | |
| 31 | + Math.max(kit.columns - Limits.STAT_CELLS, Limits.PATH_FLOOR), | |
| 33 | 32 | ), |
| 34 | 33 | kit.columns - statTextOf(row.added, row.removed).length, |
| 35 | 34 | ) |
| @@ -1,7 +1,5 @@ | ||
| 1 | 1 | export * from './ask-key-of' |
| 2 | 2 | export * from './dialog-file-row' |
| 3 | -export * from './dialog-path-floor' | |
| 4 | -export * from './dialog-path-reserve' | |
| 5 | 3 | export * from './diff-stat' |
| 6 | 4 | export * from './dim-note' |
| 7 | 5 | export * from './divider.jsx' |
| @@ -14,17 +12,13 @@ | ||
| 14 | 12 | export * from './list-edge-button' |
| 15 | 13 | export * from './list-row' |
| 16 | 14 | export * from './name-row' |
| 17 | -export * from './path-floor' | |
| 18 | 15 | export * from './pointer' |
| 19 | 16 | export * from './present' |
| 20 | 17 | export * from './pressable' |
| 21 | 18 | export * from './source-picker.jsx' |
| 22 | -export * from './stat-cells' | |
| 23 | 19 | export * from './stat-text-of' |
| 24 | 20 | export * from './title-row.jsx' |
| 25 | 21 | export * from './todo-bar.jsx' |
| 26 | -export * from './todo-bar-cells' | |
| 27 | -export * from './todo-bar-reserve' | |
| 28 | 22 | export * from './toggle-row.jsx' |
| 29 | 23 | |
| 30 | 24 | export * as default from '.' |
| @@ -3,12 +3,11 @@ | ||
| 3 | 3 | /* @jsxFrag Fragment */ |
| 4 | 4 | import type { RenderElement } from 'claude-code' |
| 5 | 5 | |
| 6 | +import Limits from '../../limits' | |
| 6 | 7 | import type Entries from '../entries' |
| 7 | 8 | import type { Kit } from '../kit' |
| 8 | 9 | import Layout from '../layout' |
| 9 | 10 | import { diffStat } from './diff-stat' |
| 10 | -import { PATH_FLOOR } from './path-floor' | |
| 11 | -import { STAT_CELLS } from './stat-cells' | |
| 12 | 11 | |
| 13 | 12 | /** |
| 14 | 13 | * One row of the open pre-session section's legend (PreSessionSection): the |
| @@ -27,7 +26,7 @@ | ||
| 27 | 26 | <Text dimColor wrap="truncate-end"> |
| 28 | 27 | {Layout.truncateStart( |
| 29 | 28 | Layout.sanitizeName(entry.displayPath), |
| 30 | - Math.max(kit.columns - STAT_CELLS, PATH_FLOOR), | |
| 29 | + Math.max(kit.columns - Limits.STAT_CELLS, Limits.PATH_FLOOR), | |
| 31 | 30 | )} |
| 32 | 31 | </Text>, |
| 33 | 32 | <Box flexGrow={1} />, |
| @@ -1,3 +1,0 @@ | ||
| 1 | -export * from './path-floor.js' | |
| 2 | - | |
| 3 | -export * as default from '.' |
| @@ -1,5 +1,0 @@ | ||
| 1 | -/** | |
| 2 | - * The fewest cells a docked file row gives its path, however narrow the | |
| 3 | - * pane (ReplDiffSidebar's 8). | |
| 4 | - */ | |
| 5 | -export const PATH_FLOOR = 8 |
| @@ -1,3 +1,0 @@ | ||
| 1 | -export * from './stat-cells.js' | |
| 2 | - | |
| 3 | -export * as default from '.' |
| @@ -1,5 +1,0 @@ | ||
| 1 | -/** | |
| 2 | - * The cells a docked file row keeps for its `+N -M` (ReplDiffSidebar's 12): | |
| 3 | - * the path is cut from its start to the rest. | |
| 4 | - */ | |
| 5 | -export const STAT_CELLS = 12 |
| @@ -1,3 +1,0 @@ | ||
| 1 | -export * from './todo-bar-cells.js' | |
| 2 | - | |
| 3 | -export * as default from '.' |
| @@ -1,4 +1,0 @@ | ||
| 1 | -/** | |
| 2 | - * The widest the todo progress bar draws (ReplDiffSidebar's 20). | |
| 3 | - */ | |
| 4 | -export const TODO_BAR_CELLS = 20 |
| @@ -1,3 +1,0 @@ | ||
| 1 | -export * from './todo-bar-reserve.js' | |
| 2 | - | |
| 3 | -export * as default from '.' |
| @@ -1,4 +1,0 @@ | ||
| 1 | -/** | |
| 2 | - * The cells kept beside the todo bar for its `done/total` count. | |
| 3 | - */ | |
| 4 | -export const TODO_BAR_RESERVE = 12 |
| @@ -3,10 +3,9 @@ | ||
| 3 | 3 | /* @jsxFrag Fragment */ |
| 4 | 4 | import type { RenderElement } from 'claude-code' |
| 5 | 5 | |
| 6 | +import Limits from '../../limits' | |
| 6 | 7 | import type PaneState from '../../pane-state' |
| 7 | 8 | import type { Kit } from '../kit' |
| 8 | -import { TODO_BAR_CELLS } from './todo-bar-cells' | |
| 9 | -import { TODO_BAR_RESERVE } from './todo-bar-reserve' | |
| 10 | 9 | |
| 11 | 10 | /** |
| 12 | 11 | * The session's todo progress as a bar and `done/total`, drawn only while |
| @@ -30,7 +29,7 @@ | ||
| 30 | 29 | |
| 31 | 30 | const cells = Math.max( |
| 32 | 31 | 1, |
| 33 | - Math.min(TODO_BAR_CELLS, kit.columns - TODO_BAR_RESERVE), | |
| 32 | + Math.min(Limits.TODO_BAR_CELLS, kit.columns - Limits.TODO_BAR_RESERVE), | |
| 34 | 33 | ) |
| 35 | 34 | |
| 36 | 35 | const filled = Math.round((todos.done / todos.total) * cells) |