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
| Mmods/diff/README.md |
| Mmods/diff/hooks/names/texts/index.ts |
| Amods/diff/hooks/names/texts/resize-terminal-text.ts |
| Mmods/diff/hooks/register.ts |
| Mmods/diff/hooks/views/pane-view.tsx |
| @@ -7,7 +7,10 @@ | ||
| 7 | 7 | repository's HEAD so a commit or checkout made elsewhere shows too. The |
| 8 | 8 | first successful edit of a session opens the pane by itself where the |
| 9 | 9 | terminal is wide enough (144 columns when the person never chose, 110 when |
| 10 | -they kept it open before; a person who closed it is left alone). A file's | |
| 10 | +they kept it open before; a person who closed it is left alone). Where the | |
| 11 | +surface seats the pane inline instead of beside the transcript (a terminal | |
| 12 | +under 110 columns), it shows only the built-in's line asking for a wider | |
| 13 | +terminal. A file's | |
| 11 | 14 | ask button arms that file: its hunks ride the next prompt as context, once. |
| 12 | 15 | |
| 13 | 16 | The pane compares the working tree against HEAD, split at the session's |
| @@ -2,6 +2,7 @@ | ||
| 2 | 2 | export * from './git-unanswered-text.js' |
| 3 | 3 | export * from './not-in-repository-text.js' |
| 4 | 4 | export * from './register-failed-text-of.js' |
| 5 | +export * from './resize-terminal-text.js' | |
| 5 | 6 | export * from './untracked-withheld-text.js' |
| 6 | 7 | |
| 7 | 8 | export * as default from '.' |
| @@ -1,0 +1,6 @@ | ||
| 1 | +/** | |
| 2 | + * The pane's one line where the surface seats it inline (no room beside the | |
| 3 | + * transcript), worded as the built-in words its refusal below that width. | |
| 4 | + */ | |
| 5 | +export const RESIZE_TERMINAL_TEXT = | |
| 6 | + 'Resize your terminal to at least 110 columns to show the diff panel' |
| @@ -488,6 +488,7 @@ | ||
| 488 | 488 | columns: e.props.bodyColumns, |
| 489 | 489 | }, |
| 490 | 490 | model, |
| 491 | + e.props.placement, | |
| 491 | 492 | ) |
| 492 | 493 | }) |
| 493 | 494 |
| @@ -3,22 +3,37 @@ | ||
| 3 | 3 | /* @jsxFrag Fragment */ |
| 4 | 4 | import type { RenderElement } from 'claude-code' |
| 5 | 5 | |
| 6 | +import Names from '../names' | |
| 6 | 7 | import PaneState from '../pane-state' |
| 7 | 8 | import { currentPane } from './current-pane' |
| 8 | 9 | import type { Kit } from './kit' |
| 10 | +import Sections from './sections' | |
| 9 | 11 | import { turnPane } from './turn-pane' |
| 10 | 12 | |
| 11 | 13 | /** |
| 12 | 14 | * The diff pane's body for one `ui.render`: the repository's diff now, or |
| 13 | 15 | * the picked turn's edits while that turn still exists (a rewind drops it). |
| 14 | 16 | * |
| 17 | + * Seated inline (no room beside the transcript), only the built-in's line | |
| 18 | + * asking for a wider terminal, as the built-in shows no panel there. | |
| 19 | + * | |
| 15 | 20 | * @param kit the elements, the handlers, the width |
| 16 | 21 | * @param model the pane's state |
| 22 | + * @param placement where the surface seated the pane (`props.placement`) | |
| 17 | 23 | * @returns the tree |
| 18 | 24 | */ |
| 19 | -export function paneView(kit: Kit, model: PaneState.PaneModel): RenderElement { | |
| 25 | +export function paneView( | |
| 26 | + kit: Kit, | |
| 27 | + model: PaneState.PaneModel, | |
| 28 | + placement: 'dock' | 'inline', | |
| 29 | +): RenderElement { | |
| 30 | + const { Box } = kit.ui | |
| 20 | 31 | const turn = PaneState.pickedTurnOf(model) |
| 21 | 32 | const isCurrent = turn === undefined |
| 22 | 33 | |
| 34 | + if (placement === 'inline') { | |
| 35 | + return <Box>{Sections.dimNote(kit, Names.RESIZE_TERMINAL_TEXT)}</Box> | |
| 36 | + } | |
| 37 | + | |
| 23 | 38 | return isCurrent ? currentPane(kit, model) : turnPane(kit, model, turn) |
| 24 | 39 | } |