mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
refactor(tui): /clean pass on blitz closeout — trim comments, flatten logic
- normalizeStatusBar collapses to one ternary expression
- /statusbar slash hoists the toggle value and flattens the branch tree
- shift-tab yolo comment reduced to one line
- cursorLayout/offsetFromPosition lose paragraph-length comments
- appLayout collapses the three {!overlay.agents && …} into one fragment
- StatusRule drops redundant flexShrink={0} (Yoga default)
- server.py uses a walrus + frozenset and trims the compat helper
Net -43 LoC. 237 vitest + 46 pytest green, layouts unchanged.
This commit is contained in:
parent
1e8cfa9092
commit
48f2ac3352
8 changed files with 40 additions and 83 deletions
|
|
@ -16,17 +16,12 @@ import { patchUiState } from './uiStore.js'
|
|||
|
||||
const STATUSBAR_MODES = new Set<StatusBarMode>(['bottom', 'off', 'top'])
|
||||
|
||||
// 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 || raw === 'on') return 'top'
|
||||
if (typeof raw === 'string' && STATUSBAR_MODES.has(raw as StatusBarMode)) return raw as StatusBarMode
|
||||
|
||||
return 'top'
|
||||
}
|
||||
export const normalizeStatusBar = (raw: unknown): StatusBarMode =>
|
||||
raw === false
|
||||
? 'off'
|
||||
: typeof raw === 'string' && STATUSBAR_MODES.has(raw as StatusBarMode)
|
||||
? (raw as StatusBarMode)
|
||||
: 'top'
|
||||
|
||||
const MTIME_POLL_MS = 5000
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue