Skip to content

Commit 5a5d92f

Browse files
committed
Simplify title screen
1 parent 2fbc979 commit 5a5d92f

File tree

2 files changed

+37
-66
lines changed

2 files changed

+37
-66
lines changed

cli/src/chat.tsx

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,6 @@ export const App = ({
189189
}
190190

191191
const agentListId = 'loaded-agents-list'
192-
const userCredentials = getUserCredentials()
193-
const greeting = userCredentials?.name?.trim().length
194-
? `Welcome back, ${userCredentials.name.trim()}!`
195-
: null
196-
197192
const baseTextColor = theme.foreground
198193

199194
const homeDir = os.homedir()
@@ -205,7 +200,7 @@ export const App = ({
205200

206201
const agentSectionHeader = agentId
207202
? `**Active agent: ${agentId}**`
208-
: `**Active agent:** *fast default (base2-fast)*`
203+
: undefined
209204

210205
const buildBlocks = (listId: string): ContentBlock[] => {
211206
const blocks: ContentBlock[] = [
@@ -218,29 +213,27 @@ export const App = ({
218213
},
219214
]
220215

221-
if (greeting) {
222-
blocks.push({
223-
type: 'text',
224-
content: greeting,
225-
color: baseTextColor,
226-
})
227-
}
228-
229216
blocks.push({
230217
type: 'html',
231218
render: () => (
232-
<text style={{ wrapMode: 'word' }}>
233-
<span fg={baseTextColor}>
234-
Codebuff can read and write files in{' '}
235-
<TerminalLink
236-
text={displayPath}
237-
inline={true}
238-
underlineOnHover={true}
239-
onActivate={() => openFileAtPath(repoRoot)}
240-
/>
241-
, and run terminal commands to help you build.
242-
</span>
243-
</text>
219+
<>
220+
<text style={{ wrapMode: 'word', marginBottom: 1 }}>
221+
<span fg={baseTextColor}>
222+
Codebuff will run commands on your behalf to help you build.
223+
</span>
224+
</text>
225+
<text style={{ wrapMode: 'word', marginBottom: 1 }}>
226+
<span fg={baseTextColor}>
227+
Directory{' '}
228+
<TerminalLink
229+
text={displayPath}
230+
inline={true}
231+
underlineOnHover={true}
232+
onActivate={() => openFileAtPath(repoRoot)}
233+
/>
234+
</span>
235+
</text>
236+
</>
244237
),
245238
})
246239

@@ -251,13 +244,15 @@ export const App = ({
251244
agentsDir: loadedAgentsData.agentsDir,
252245
})
253246

254-
blocks.push({
255-
type: 'text',
256-
content: agentSectionHeader,
257-
marginTop: 1,
258-
marginBottom: 0,
259-
color: baseTextColor,
260-
})
247+
if (agentSectionHeader) {
248+
blocks.push({
249+
type: 'text',
250+
content: agentSectionHeader,
251+
marginTop: 1,
252+
marginBottom: 0,
253+
color: baseTextColor,
254+
})
255+
}
261256

262257
return blocks
263258
}
@@ -485,8 +480,10 @@ export const App = ({
485480

486481
const abortControllerRef = useRef<AbortController | null>(null)
487482

488-
const { scrollToLatest, scrollboxProps, isAtBottom } =
489-
useChatScrollbox(scrollRef, messages)
483+
const { scrollToLatest, scrollboxProps, isAtBottom } = useChatScrollbox(
484+
scrollRef,
485+
messages,
486+
)
490487

491488
const inertialScrollAcceleration = useMemo(
492489
() => createChatScrollAcceleration(),

cli/src/components/message-block.tsx

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,7 @@ export const MessageBlock = ({
266266
const headerName = displayInfo.name
267267

268268
return (
269-
<box
270-
key={keyPrefix}
271-
>
269+
<box key={keyPrefix}>
272270
{toolRenderConfig.content ? (
273271
toolRenderConfig.content
274272
) : (
@@ -343,10 +341,7 @@ export const MessageBlock = ({
343341
const statusIndicator = isActive ? '●' : '✓'
344342

345343
return (
346-
<box
347-
key={keyPrefix}
348-
style={{ flexDirection: 'column', gap: 0 }}
349-
>
344+
<box key={keyPrefix} style={{ flexDirection: 'column', gap: 0 }}>
350345
<AgentBranchItem
351346
name={agentBlock.agentName}
352347
content={displayContent}
@@ -371,7 +366,6 @@ export const MessageBlock = ({
371366
isLastBranch: boolean,
372367
keyPrefix: string,
373368
): React.ReactNode {
374-
const TRUNCATE_LIMIT = 3
375369
const isCollapsed = collapsedAgents.has(agentListBlock.id)
376370
const { agents } = agentListBlock
377371

@@ -388,9 +382,6 @@ export const MessageBlock = ({
388382
})
389383

390384
const agentCount = sortedAgents.length
391-
const previewAgents = sortedAgents.slice(0, TRUNCATE_LIMIT)
392-
const remainingCount =
393-
agentCount > TRUNCATE_LIMIT ? agentCount - TRUNCATE_LIMIT : 0
394385

395386
const formatIdentifier = (agent: { id: string; displayName: string }) =>
396387
agent.displayName && agent.displayName !== agent.id
@@ -419,33 +410,16 @@ export const MessageBlock = ({
419410
)
420411

421412
const headerText = pluralize(agentCount, 'local agent')
422-
const previewLines = previewAgents.map(
423-
(agent) => ` • ${formatIdentifier(agent)}`,
424-
)
425-
const finishedPreview = isCollapsed
426-
? [
427-
...previewLines,
428-
remainingCount > 0
429-
? ` ... ${pluralize(remainingCount, 'more agent')} available`
430-
: null,
431-
]
432-
.filter(Boolean)
433-
.join('\n')
434-
: ''
435-
436413
return (
437-
<box
438-
key={keyPrefix}
439-
>
440-
<AgentBranchItem
414+
<box key={keyPrefix}>
415+
<ToolCallItem
441416
name={headerText}
442417
content={agentListContent}
443-
agentId={agentListBlock.id}
444418
isCollapsed={isCollapsed}
445419
isStreaming={false}
446420
branchChar=""
447421
streamingPreview=""
448-
finishedPreview={finishedPreview}
422+
finishedPreview=""
449423
onToggle={() => onToggleCollapsed(agentListBlock.id)}
450424
/>
451425
</box>

0 commit comments

Comments
 (0)