feat(ui): redesign header to be compact with ASCII icon

fix(ui): move sync file I/O out of render loop in AppHeader

test(ui): update AppHeader snapshots

test(ui): fix Tips test and update all snapshots for compact header
This commit is contained in:
Keith Guerin
2026-02-09 23:05:54 -08:00
parent a1367e9cdd
commit f307ff00ac
7 changed files with 321 additions and 274 deletions
@@ -8,20 +8,57 @@ import type React from 'react';
import { Box } from 'ink';
import { theme } from '../../semantic-colors.js';
export type LinePosition = 'top' | 'center' | 'bottom';
interface HorizontalLineProps {
color?: string;
width?: number | string;
position?: LinePosition;
}
const overlineStyle = {
top: '‾',
bottom: '',
left: '',
right: '',
topLeft: '',
topRight: '',
bottomLeft: '',
bottomRight: '',
};
const underlineStyle = {
top: '_',
bottom: '',
left: '',
right: '',
topLeft: '',
topRight: '',
bottomLeft: '',
bottomRight: '',
};
export const HorizontalLine: React.FC<HorizontalLineProps> = ({
color = theme.border.default,
}) => (
<Box
width="100%"
borderStyle="single"
borderTop
borderBottom={false}
borderLeft={false}
borderRight={false}
borderColor={color}
/>
);
width = '100%',
position = 'center',
}) => {
const borderStyle =
position === 'top'
? overlineStyle
: position === 'bottom'
? underlineStyle
: 'single';
return (
<Box
width={width}
borderStyle={borderStyle}
borderTop
borderBottom={false}
borderLeft={false}
borderRight={false}
borderColor={color}
/>
);
};