fix(tui): /statusbar top = inline above input, not row 0 of the screen

'top' and 'bottom' are positions relative to the input row, not the alt
screen viewport:

- top (default) → inline above the input, where the bar originally lived
  (what 'on' used to mean)
- bottom → below the input, pinned to the last row
- off → hidden

Drops the literal top-of-screen placement; 'on' is kept as a backward-
compat alias that resolves to 'top' at both the config layer
(normalizeStatusBar, _coerce_statusbar) and the slash command.
This commit is contained in:
Brooklyn Nicholson 2026-04-22 13:55:40 -05:00
parent d55a17bd82
commit ea32364c96
7 changed files with 60 additions and 41 deletions

View file

@ -14,17 +14,18 @@ import type { StatusBarMode } from './interfaces.js'
import { turnController } from './turnController.js'
import { patchUiState } from './uiStore.js'
const STATUSBAR_MODES = new Set<StatusBarMode>(['bottom', 'off', 'on', 'top'])
const STATUSBAR_MODES = new Set<StatusBarMode>(['bottom', 'off', 'top'])
// Legacy configs stored tui_statusbar as a bool; new configs write a string
// ('on' | 'off' | 'bottom' | 'top'). Coerce both shapes so existing users
// keep their preference without manual migration.
// Legacy configs stored tui_statusbar as a bool; the short-lived 4-mode
// variant wrote 'on'. Both map to 'top' (inline above the input) — the
// original feature's default — so users keep their preference without
// manual migration.
export const normalizeStatusBar = (raw: unknown): StatusBarMode => {
if (raw === false) return 'off'
if (raw === true || raw == null) return 'on'
if (raw === true || raw == null || raw === 'on') return 'top'
if (typeof raw === 'string' && STATUSBAR_MODES.has(raw as StatusBarMode)) return raw as StatusBarMode
return 'on'
return 'top'
}
const MTIME_POLL_MS = 5000