mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 01:21:43 +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
|
|
@ -216,13 +216,7 @@ const ComposerPane = memo(function ComposerPane({
|
|||
</Box>
|
||||
|
||||
<Box flexGrow={1} position="relative">
|
||||
{/*
|
||||
Subtract the NoSelect paddingX={1} (2 cols total) and the
|
||||
prompt-glyph column (pw) so cursorLayout agrees with the
|
||||
width wrap-ansi actually uses at render time. Off-by-one/
|
||||
two here manifests as the final letter flickering
|
||||
in/out when a sentence crosses the wrap boundary.
|
||||
*/}
|
||||
{/* subtract NoSelect paddingX={1} (2 cols) + pw so wrap-ansi and cursorLayout agree */}
|
||||
<TextInput
|
||||
columns={Math.max(20, composer.cols - pw - 2)}
|
||||
onChange={composer.updateInput}
|
||||
|
|
@ -271,12 +265,8 @@ const StatusRulePane = memo(function StatusRulePane({
|
|||
return null
|
||||
}
|
||||
|
||||
// 'top' sits inline above the input; give it one row of breathing
|
||||
// space above so the transcript (or queue) doesn't butt directly
|
||||
// against the status row. 'bottom' lives at the last row of the
|
||||
// viewport so it needs no margin.
|
||||
return (
|
||||
<Box flexShrink={0} marginTop={at === 'top' ? 1 : 0}>
|
||||
<Box marginTop={at === 'top' ? 1 : 0}>
|
||||
<StatusRule
|
||||
bgCount={ui.bgTasks.size}
|
||||
busy={ui.busy}
|
||||
|
|
@ -318,18 +308,20 @@ export const AppLayout = memo(function AppLayout({
|
|||
</Box>
|
||||
|
||||
{!overlay.agents && (
|
||||
<PromptZone
|
||||
cols={composer.cols}
|
||||
onApprovalChoice={actions.answerApproval}
|
||||
onClarifyAnswer={actions.answerClarify}
|
||||
onSecretSubmit={actions.answerSecret}
|
||||
onSudoSubmit={actions.answerSudo}
|
||||
/>
|
||||
<>
|
||||
<PromptZone
|
||||
cols={composer.cols}
|
||||
onApprovalChoice={actions.answerApproval}
|
||||
onClarifyAnswer={actions.answerClarify}
|
||||
onSecretSubmit={actions.answerSecret}
|
||||
onSudoSubmit={actions.answerSudo}
|
||||
/>
|
||||
|
||||
<ComposerPane actions={actions} composer={composer} status={status} />
|
||||
|
||||
<StatusRulePane at="bottom" composer={composer} status={status} />
|
||||
</>
|
||||
)}
|
||||
|
||||
{!overlay.agents && <ComposerPane actions={actions} composer={composer} status={status} />}
|
||||
|
||||
{!overlay.agents && <StatusRulePane at="bottom" composer={composer} status={status} />}
|
||||
</Box>
|
||||
</AlternateScreen>
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue