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 | /* @jsxRuntime classic */ |
| 2 | /* @jsx h */ |
| 3 | /* @jsxFrag Fragment */ |
| 4 | import type { RenderElement } from 'claude-code' |
| 5 | |
| 6 | import Limits from '../limits' |
| 7 | import Names from '../names' |
| 8 | import PaneState from '../pane-state' |
| 9 | import { currentPane } from './current-pane' |
| 10 | import { insetOf } from './inset-of' |
| 11 | import type { Kit } from './kit' |
| 12 | import Sections from './sections' |
| 13 | import { turnPane } from './turn-pane' |
| 14 | |
| 15 | /** |
| 16 | * The diff pane's body for one `ui.render`: the repository's diff now, or |
| 17 | * the picked turn's edits while that turn still exists (a rewind drops it). |
| 18 | * |
| 19 | * Seated inline, only the built-in's wider-terminal line, as it shows no |
| 20 | * panel there; docked, the built-in's blank row above the header and blank |
| 21 | * last column, so rows sit and wrap where the built-in's do. |
| 22 | * |
| 23 | * @param kit the elements, the handlers, the width |
| 24 | * @param model the pane's state |
| 25 | * @param placement where the surface seated the pane (`props.placement`) |
| 26 | * @returns the tree |
| 27 | */ |
| 28 | export function paneView( |
| 29 | kit: Kit, |
| 30 | model: PaneState.PaneModel, |
| 31 | placement: 'dock' | 'inline', |
| 32 | ): RenderElement { |
| 33 | const { Box } = kit.ui |
| 34 | const turn = PaneState.pickedTurnOf(model) |
| 35 | const isCurrent = turn === undefined |
| 36 | |
| 37 | if (placement === 'inline') { |
| 38 | return <Box>{Sections.dimNote(kit, Names.RESIZE_TERMINAL_TEXT)}</Box> |
| 39 | } |
| 40 | |
| 41 | const inset = insetOf(kit) |
| 42 | |
| 43 | return ( |
| 44 | <Box |
| 45 | flexDirection="column" |
| 46 | paddingTop={Limits.PANE_TOP_PAD_ROWS} |
| 47 | paddingRight={Limits.PANE_RIGHT_PAD_COLUMNS} |
| 48 | > |
| 49 | {isCurrent ? currentPane(inset, model) : turnPane(inset, model, turn)} |
| 50 | </Box> |
| 51 | ) |
| 52 | } |