feat(FN-2694): merge fusion/fn-2694

This commit is contained in:
Fusion
2026-04-27 08:37:47 -07:00
committed by gsxdsm
parent b2f71a2136
commit 1ded15a40a
9 changed files with 160 additions and 233 deletions

View File

@@ -756,24 +756,50 @@ function StatusModeGrid({
controller: DashboardTUI;
}) {
const focused = state.activeSection;
const { stdout } = useStdout();
// Pin every row to an explicit height with overflow:hidden — same reasoning
// as StatusModeSingle. Without this, a panel whose intrinsic content (e.g.
// wrapped Text or many StatRows in a narrow column) outgrows its slot
// pushes the frame past terminal rows; Ink then scrolls the top off and
// panel headers (Logs especially, top of the right column) disappear.
const rows = stdout?.rows ?? 24;
const cols = stdout?.columns ?? 80;
const middleHeight = Math.max(1, rows - 2);
// Right column splits vertically: Logs on top, Utilities+Settings beneath.
// Reserve a fixed slot for the bottom row so Logs gets a stable, knowable
// height we can hand to its rowBudget calculation.
const bottomRowHeight = Math.min(10, Math.max(6, Math.floor(middleHeight * 0.35)));
const logsHeight = Math.max(1, middleHeight - bottomRowHeight);
// Logs Panel chrome: border(2) + title(1) + filter row(1) = 4.
const logsAvailableRows = Math.max(1, logsHeight - 4);
// Left column splits 50/50 between System and Stats.
const leftTopHeight = Math.floor(middleHeight / 2);
const leftBottomHeight = middleHeight - leftTopHeight;
return (
<Box flexDirection="column" flexGrow={1}>
<Box flexShrink={0}>
<Box flexDirection="column" height={rows} width={cols} overflow="hidden">
<Box height={1} flexShrink={0} overflow="hidden">
<MainHeader state={state} />
</Box>
<Box flexDirection="row" flexGrow={1} overflow="hidden">
<Box flexDirection="column" width="45%" flexGrow={0} flexShrink={1} overflow="hidden">
<SystemPanel state={state} isFocused={focused === "system"} />
<StatsPanel state={state} isFocused={focused === "stats"} />
<Box height={middleHeight} flexShrink={0} flexDirection="row" overflow="hidden">
<Box flexDirection="column" width="45%" flexShrink={0} overflow="hidden">
<Box height={leftTopHeight} flexShrink={0} flexDirection="column" overflow="hidden">
<SystemPanel state={state} isFocused={focused === "system"} />
</Box>
<Box height={leftBottomHeight} flexShrink={0} flexDirection="column" overflow="hidden">
<StatsPanel state={state} isFocused={focused === "stats"} />
</Box>
</Box>
<Box flexDirection="column" width="55%" flexGrow={0} flexShrink={1} overflow="hidden">
<LogsPanel
state={state}
isFocused={focused === "logs"}
/>
<Box flexDirection="row" overflow="hidden">
<Box flexDirection="column" width="55%" flexShrink={0} overflow="hidden">
<Box height={logsHeight} flexShrink={0} flexDirection="column" overflow="hidden">
<LogsPanel
state={state}
isFocused={focused === "logs"}
availableRows={logsAvailableRows}
/>
</Box>
<Box height={bottomRowHeight} flexShrink={0} flexDirection="row" overflow="hidden">
<Box flexDirection="column" flexGrow={1} overflow="hidden">
<UtilitiesPanel state={state} isFocused={focused === "utilities"} />
</Box>
@@ -784,7 +810,7 @@ function StatusModeGrid({
</Box>
</Box>
<Box flexShrink={0}>
<Box height={1} flexShrink={0} overflow="hidden">
<StatusBar state={state} controller={controller} />
</Box>
</Box>
@@ -838,7 +864,7 @@ function StatusBar({ state, controller: _controller }: { state: DashboardState;
const hotkeys: string[] = [];
if (activeSection === "logs") {
hotkeys.push("↑↓ navigate", "w wrap", "f filter", "Enter expand");
hotkeys.push("↑↓ navigate", "w wrap", "f filter");
} else if (activeSection === "utilities") {
hotkeys.push("r refresh", "c clear logs", "t toggle pause", "k kill vitest", "v auto-kill", "+/- threshold");
} else {