chore(tui): strip noise comments

This commit is contained in:
Brooklyn Nicholson
2026-04-16 19:14:05 -05:00
parent 7f1204840d
commit ca30803d89
9 changed files with 2 additions and 60 deletions

View File

@@ -167,13 +167,10 @@ export function createGatewayEventHandler(ctx: GatewayEventHandlerContext): (ev:
patchUiState(state => ({
...state,
info,
// agent just came online → flip the 'starting agent…' placeholder.
// leave running/interrupted/error statuses alone.
status: state.status === 'starting agent…' ? 'ready' : state.status,
usage: info.usage ? { ...state.usage, ...info.usage } : state.usage
}))
// upgrade the seeded/partial intro row in-place with the real info
setHistoryItems(prev => prev.map(m => (m.kind === 'intro' ? { ...m, info } : m)))
return

View File

@@ -93,9 +93,6 @@ export function useMainApp(gw: GatewayClient) {
}
}, [stdout])
// Seed with an info-less intro so the banner paints on the first frame,
// before gateway.ready / session.create resolve. Replaced by
// `introMsg(info)` as soon as session.info arrives.
const [historyItems, setHistoryItems] = useState<Msg[]>(() => [{ kind: 'intro', role: 'system', text: '' }])
const [lastUserMsg, setLastUserMsg] = useState('')
const [stickyPrompt, setStickyPrompt] = useState('')
@@ -130,9 +127,6 @@ export function useMainApp(gw: GatewayClient) {
const hasSelection = useHasSelection()
const selection = useSelection()
// Bind a uniform selection bg so drag-to-select shows one solid color
// across the whole range instead of SGR-inverse (which swaps each cell's
// fg → bg and fragments over amber/gold/dim text). Re-fires on skin swap.
useEffect(() => {
selection.setSelectionBgColor(ui.theme.color.selectionBg)
}, [selection, ui.theme.color.selectionBg])
@@ -379,8 +373,6 @@ export function useMainApp(gw: GatewayClient) {
sys
})
// Flush any pre-session queued input the moment the session lands.
// `message.complete` drains the rest; this just kicks off the first send.
const prevSidRef = useRef<null | string>(null)
useEffect(() => {
const prev = prevSidRef.current

View File

@@ -107,8 +107,6 @@ export function useSessionLifecycle(opts: UseSessionLifecycleOptions) {
resetSession()
setSessionStartedAt(Date.now())
// session.create returns instantly with partial info (no `version`);
// the `session.info` event flips status to 'ready' once the agent is live.
patchUiState({
info,
sid: r.session_id,

View File

@@ -1,8 +1,3 @@
// Raw-ANSI banner painted to stdout before React/Ink load, giving the user
// instant visual feedback during the ~170ms dynamic-import window.
// `<AlternateScreen>` wipes the normal-screen buffer when Ink mounts, so
// there's no double-banner and palette drift vs. DEFAULT_THEME is harmless.
const GOLD = '\x1b[38;2;255;215;0m'
const AMBER = '\x1b[38;2;255;191;0m'
const BRONZE = '\x1b[38;2;205;127;50m'

View File

@@ -1,9 +1,5 @@
#!/usr/bin/env node
// Import order matters for cold start: `GatewayClient` + `bootBanner` have
// only node-builtin deps (<20ms), so we can paint the banner and spawn the
// python gateway before loading @hermes/ink + App (~170ms combined).
// `<AlternateScreen>` wipes the normal-screen buffer on Ink mount, so the
// boot banner is replaced seamlessly by the real React render.
// Order matters: paint banner + spawn python before loading @hermes/ink.
import { bootBanner } from './bootBanner.js'
import { GatewayClient } from './gatewayClient.js'

View File

@@ -94,8 +94,6 @@ export const DEFAULT_THEME: Theme = {
statusWarn: '#FFD700',
statusBad: '#FF8C00',
statusCritical: '#FF6B6B',
// muted navy — sits under gold/amber fg without fighting it, swaps
// cleanly with SGR-inverse that fragmented per fg color
selectionBg: '#3a3a55',
diffAdded: 'rgb(220,255,220)',