fix(tui): chevrons re-toggle even when section default is expanded - #15266
Merged
Conversation
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.
Contributor
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Recovers manual click on the details accordion. After #14968 introduced
SECTION_DEFAULTS(thinking + tools default toexpanded), every panel render OR-ed the local toggle against the resolved visibility:That pinned
open=truefor any default-expanded section, so clicking the chevron flippedopenThinkingbut the panel never collapsed. Default config = chevrons effectively decorative.Fix
Local toggle is the sole source of truth at render time. The
useStateinit still seeds from the resolved visibility (so first paint matches the configured default), and the existinguseEffectstill re-syncs when the user mutates visibility at runtime via/details.Same OR-lock cleared inside
SubagentAccordion(showChildren || openX→openX) — 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 inToolTrail+ 1 inline thinking arrow + 4 inner sections inSubagentAccordion. Anchor comment near theuseStateblock 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 indetails.ts)tsc --noEmit -p tsconfig.json— clean for my edits (pre-existingdom.tswarning untouched, same as feat(tui): per-section visibility for the details accordion #14968)npm run lint— same 23 problems asmain(none in my diff)/details thinking collapsedthen/details thinking expandedstill routes to the local toggle correctly (initial paint matches config, subsequent clicks toggle).