spacehub

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

claude-code / mods / diff / hooks / pane-state / unborn-note-of.ts
22 lines · 673 BRaw
1import type { PaneModel } from './pane-model'
2
3/**
4 * The dim line under the header on an unborn HEAD that still lists rows:
5 * what the rows are, since no comparison runs before the first commit.
6 *
7 * ReplDiffSidebar's no-commits qualifier; null with commits or no rows.
8 *
9 * @param model the last good fetch
10 * @param filesCount the header's session file count
11 * @returns the line, or null
12 */
13export function unbornNoteOf(
14 model: Pick<PaneModel, 'data'>,
15 filesCount: number,
16): string | null {
17 const isUnbornListing = model.data?.isUnborn === true && filesCount > 0
18
19 return isUnbornListing
20 ? 'no commits yet — showing staged and new files'
21 : null
22}