fix(tui): improve learning ledger scanability

Shrink the details panel share and simplify category row labels so the four learning lists are easier to scan.
This commit is contained in:
Brooklyn Nicholson
2026-04-27 15:08:44 -05:00
parent e12e32c442
commit 7da40dca5f

View File

@@ -28,14 +28,6 @@ const typeIcon: Record<string, string> = {
user: '●'
}
const typeVerb: Record<string, string> = {
integration: 'connected',
memory: 'remembered',
recall: 'recalled',
'skill-use': 'applied skill',
user: 'remembered'
}
const fmtTime = (ts?: null | number) => {
if (!ts) {
return ''
@@ -181,7 +173,7 @@ export function LearningLedger({ borderColor, gw, maxHeight, onClose, t, width:
? [
{
content: <LedgerDetails item={selected} t={t} />,
grow: 3,
grow: 2,
id: 'learning-details',
title: 'Details'
}
@@ -229,14 +221,13 @@ function LedgerRow({ active, index, item, t }: LedgerRowProps) {
const when = fmtTime(item.last_used_at ?? item.learned_at)
const count = item.count ? ` ×${item.count}` : ''
const icon = typeIcon[item.type] ?? '•'
const verb = typeVerb[item.type] ?? item.type
const title = item.type === 'memory' || item.type === 'user' ? item.summary : item.name
const title = compactTitle(item)
return (
<Box flexShrink={0} width="100%">
<Text bold={active} color={active ? t.color.accent : t.color.muted} inverse={active} wrap="truncate-end">
{active ? '▸ ' : ' '}
{index}. {icon} {verb}: {title}
{index}. {icon} {title}
<Text color={active ? t.color.accent : t.color.muted}>
{' '}
{count}
@@ -247,6 +238,14 @@ function LedgerRow({ active, index, item, t }: LedgerRowProps) {
)
}
function compactTitle(item: LearningLedgerItem) {
const raw = item.type === 'memory' || item.type === 'user' ? item.summary : item.name
return raw
.replace(/^User\s+/i, '')
.replace(/^Durable memory updates$/i, 'memory updated')
.replace(/^session_search$/i, 'past sessions')
}
function LedgerDetails({ item, t }: LedgerDetailsProps) {
const memoryLike = item.type === 'memory' || item.type === 'user'