refactor(tui): statusbar as 4-mode position (on|off|bottom|top)

Default is back to 'on' (inline, above the input) — bottom was too far
from the input and felt disconnected. Users who want it pinned can
opt in explicitly.

- UiState.statusBar: boolean → 'on' | 'off' | 'bottom' | 'top'
- /statusbar [on|off|bottom|top|toggle]; no-arg still binary-toggles
  between off and on (preserves muscle memory)
- appLayout renders StatusRulePane in three slots (inline inside
  ComposerPane for 'on', above transcript row for 'top', after
  ComposerPane for 'bottom'); only the slot matching ui.statusBar
  actually mounts
- drop the input's marginBottom when 'bottom' so the rule sits tight
  against the input instead of floating a row below
- useConfigSync.normalizeStatusBar coerces legacy bool (true→on,
  false→off) and unknown shapes to 'on' for forward-compat reads
- tui_gateway: split compact from statusbar config handlers; persist
  string enum with _coerce_statusbar helper for legacy bool configs
This commit is contained in:
Brooklyn Nicholson 2026-04-22 13:41:01 -05:00
parent 7027ce42ef
commit d55a17bd82
8 changed files with 118 additions and 25 deletions

View file

@ -184,6 +184,8 @@ const ComposerPane = memo(function ComposerPane({
)}
<Box flexDirection="column" position="relative">
<StatusRulePane at="on" composer={composer} status={status} />
<FloatingOverlays
cols={composer.cols}
compIdx={composer.compIdx}
@ -195,7 +197,7 @@ const ComposerPane = memo(function ComposerPane({
</Box>
{!isBlocked && (
<Box flexDirection="column" marginBottom={1}>
<Box flexDirection="column" marginBottom={ui.statusBar === 'bottom' ? 0 : 1}>
{composer.inputBuf.map((line, i) => (
<Box key={i}>
<Box width={3}>
@ -255,10 +257,14 @@ const AgentsOverlayPane = memo(function AgentsOverlayPane() {
)
})
const StatusRulePane = memo(function StatusRulePane({ composer, status }: Pick<AppLayoutProps, 'composer' | 'status'>) {
const StatusRulePane = memo(function StatusRulePane({
at,
composer,
status
}: Pick<AppLayoutProps, 'composer' | 'status'> & { at: 'bottom' | 'on' | 'top' }) {
const ui = useStore($uiState)
if (!ui.statusBar) {
if (ui.statusBar !== at) {
return null
}
@ -294,6 +300,8 @@ export const AppLayout = memo(function AppLayout({
return (
<AlternateScreen mouseTracking={mouseTracking}>
<Box flexDirection="column" flexGrow={1}>
{!overlay.agents && <StatusRulePane at="top" composer={composer} status={status} />}
<Box flexDirection="row" flexGrow={1}>
{overlay.agents ? (
<AgentsOverlayPane />
@ -314,7 +322,7 @@ export const AppLayout = memo(function AppLayout({
{!overlay.agents && <ComposerPane actions={actions} composer={composer} status={status} />}
{!overlay.agents && <StatusRulePane composer={composer} status={status} />}
{!overlay.agents && <StatusRulePane at="bottom" composer={composer} status={status} />}
</Box>
</AlternateScreen>
)