mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
LiveDuration returned a bare string with proportional digits, so the statusbar reflowed every second as the timer ticked. Extract a shared StableText component that renders each character in its own 1ch-wide cell, preventing any digit from shifting the layout — works with the proportional sans font, no need for font-mono. Both LiveDuration (statusbar session/running timers) and ActivityTimerText (tool activity timers) now use StableText, dropping the font-mono + tabular-nums workaround from the latter. Also renames statusbar.ts → statusbar.tsx since LiveDuration now returns JSX.
25 lines
735 B
TypeScript
25 lines
735 B
TypeScript
import { cn } from '@/lib/utils'
|
|
|
|
import { formatElapsed } from './activity-timer'
|
|
import { StableText } from './stable-text'
|
|
|
|
interface ActivityTimerTextProps {
|
|
seconds: number
|
|
className?: string
|
|
}
|
|
|
|
export function ActivityTimerText({ seconds, className }: ActivityTimerTextProps) {
|
|
return (
|
|
<StableText
|
|
className={cn(
|
|
// Tinted with --dt-midground (very low alpha) so the timer reads
|
|
// as part of the same "live signal" cluster as the dither block /
|
|
// arc-border / working-session dot, instead of being neutral chrome.
|
|
'shrink-0 text-[0.56rem] leading-none tracking-[0.02em] text-midground/55',
|
|
className
|
|
)}
|
|
>
|
|
{formatElapsed(seconds)}
|
|
</StableText>
|
|
)
|
|
}
|