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 / views / dialog-pane / dialog-entries-of / dialog-entries-of.ts
24 lines · 720 BRaw
1import Git from '../../../git'
2import PaneState from '../../../pane-state'
3import Entries from '../../entries'
4
5/**
6 * The files the dialog lists, in its order: the picked turn's, or every
7 * file of the fetch, pre-session or not, sorted by its displayed name.
8 *
9 * @param model the pane's state
10 * @returns the entries
11 */
12export function dialogEntriesOf(
13 model: PaneState.PaneModel,
14): readonly Entries.BodyEntry[] {
15 const turn = PaneState.pickedTurnOf(model)
16
17 return turn
18 ? turn.files.map(Entries.turnEntryOf)
19 : [...(model.data?.files ?? [])]
20 .sort((a, b) =>
21 Git.displayPathOf(a).localeCompare(Git.displayPathOf(b)),
22 )
23 .map(file => Entries.bodyEntryOf(file, model))
24}