Skip to content

fix(tui): chevrons re-toggle even when section default is expanded - #15266

Merged
OutThisLife merged 1 commit into
mainfrom
bb/fix-tui-section-toggle
Apr 24, 2026
Merged

fix(tui): chevrons re-toggle even when section default is expanded#15266
OutThisLife merged 1 commit into
mainfrom
bb/fix-tui-section-toggle

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

Summary

Recovers manual click on the details accordion. After #14968 introduced SECTION_DEFAULTS (thinking + tools default to expanded), every panel render OR-ed the local toggle against the resolved visibility:

open: visible.thinking === 'expanded' || openThinking

That pinned open=true for any default-expanded section, so clicking the chevron flipped openThinking but the panel never collapsed. Default config = chevrons effectively decorative.

Fix

Local toggle is the sole source of truth at render time. The useState init still seeds from the resolved visibility (so first paint matches the configured default), and the existing useEffect still re-syncs when the user mutates visibility at runtime via /details.

Same OR-lock cleared inside SubagentAccordion (showChildren || openXopenX) — pre-existing but the same shape, so expand-all on the spawn tree no longer makes inner sections un-collapsible either.

Files

  • ui-tui/src/components/thinking.tsx — drop OR-lock from 4 panels in ToolTrail + 1 inline thinking arrow + 4 inner sections in SubagentAccordion. Anchor comment near the useState block to call out the contract so this doesn't regress again.

Test plan

  • npm test (ui-tui) — 271/271 passing, no test changes needed (the bug was in the consuming component, not the resolver in details.ts)
  • tsc --noEmit -p tsconfig.json — clean for my edits (pre-existing dom.ts warning untouched, same as feat(tui): per-section visibility for the details accordion #14968)
  • npm run lint — same 23 problems as main (none in my diff)
  • Manual: fresh TUI → click ▾ on Thinking → collapses to ▸; click again → expands. Same for Tool calls / Spawn tree / Activity.
  • Manual: /details thinking collapsed then /details thinking expanded still routes to the local toggle correctly (initial paint matches config, subsequent clicks toggle).

Recovers the manual click on the details accordion: with #14968's new
SECTION_DEFAULTS (thinking/tools start `expanded`), every panel render
was OR-ing the local open toggle against `visible.X === 'expanded'`.
That pinned `open=true` for the default-expanded sections, so clicking
the chevron flipped the local state but the panel never collapsed.

Local toggle is now the sole source of truth at render time; the
useState init still seeds from the resolved visibility (so first paint
is correct) and the existing useEffect still re-syncs when the user
mutates visibility at runtime via `/details`.

Same OR-lock cleared inside SubagentAccordion (`showChildren ||
openX`) — pre-existing but the same shape, so expand-all on the
spawn tree no longer makes inner sections un-collapsible either.
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ npm lockfile hash out of date

Checked against commit f5e2a77 (PR head at check time).

The hash = "sha256-..." line in these nix files no longer matches the committed package-lock.json:

Apply the fix

  • Apply lockfile fix — tick to push a commit with the correct hashes to this PR branch
  • Or run the Nix Lockfile Fix workflow manually (pass PR #15266)
  • Or locally: nix run .#fix-lockfiles -- --apply and commit the diff

@OutThisLife
OutThisLife merged commit 7f0f67d into main Apr 24, 2026
7 of 10 checks passed
@OutThisLife
OutThisLife deleted the bb/fix-tui-section-toggle branch April 24, 2026 17:24
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels Apr 24, 2026
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
…ction-toggle

fix(tui): chevrons re-toggle even when section default is expanded
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…ction-toggle

fix(tui): chevrons re-toggle even when section default is expanded
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…ction-toggle

fix(tui): chevrons re-toggle even when section default is expanded
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…ction-toggle

fix(tui): chevrons re-toggle even when section default is expanded
prmartinow pushed a commit to prmartinow/hermes-agent that referenced this pull request Aug 26, 2026
…ction-toggle

fix(tui): chevrons re-toggle even when section default is expanded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants