fix(tui): thinking fold toggles relative to the expanded baseline - #5857
fix(tui): thinking fold toggles relative to the expanded baseline#5857Hmbown wants to merge 1 commit into
Conversation
The collapse rule was a triple-XOR (folded ^ !verbose ^ default_expanded) whose own doc comment promised verbose-on means expanded, yet verbose-on plus default-expanded rendered collapsed. Rule is now folded ^ !(verbose || default_expanded): Space inverts the expanded baseline, changing exactly one truth-table cell. Adds an 8-cell test. Signed-off-by: CodeWhale Bot <bot@codewhale.net>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_e18cdf55-2877-4544-be79-18ebd5b8eab5) |
|
Claude finished @Hmbown's task in 2m 40s —— View job Code review — thinking fold toggle fix
SummaryThe core fix is correct. The added test Bug found — not fixed by this PR
let folded = (!options.verbose ^ options.thinking_default_expanded)
^ (target.action == ReasoningAction::Collapse);This still uses the old Concretely: with This file isn't part of the diff, so GitHub won't let me leave an inline let expanded_baseline = options.verbose || options.thinking_default_expanded;
let folded = !expanded_baseline ^ (target.action == ReasoningAction::Collapse);Other notes
|
There was a problem hiding this comment.
🟡 Changes recommended
The Space-toggle path still computes the per-cell fold override using the old XOR baseline in handle_transcript_space, so the UI toggle can remain incorrect in the exact (verbose=true, default_expanded=true) case this PR aims to fix.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Fixes the “thinking/reasoning” fold toggle semantics so that per-cell folding (Space) inverts a single expanded baseline rather than XOR-ing verbose and thinking_default_expanded independently, and adds a truth-table unit test to lock the intended behavior.
Changes:
- Update thinking-cell collapsed/expanded computation to use
baseline_expanded = verbose || thinking_default_expanded. - Update renderer documentation to describe the baseline behavior.
- Add an 8-case unit test covering
(folded, verbose, default_expanded) -> expanded.
File summaries
| File | Description |
|---|---|
| crates/tui/src/tui/history.rs | Switch thinking collapse logic to invert a single “expanded baseline” (`verbose |
| crates/tui/src/tui/history/tests.rs | Add an 8-case truth-table test asserting expanded/collapsed outcomes for folded toggle vs baseline flags. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| duration_secs, | ||
| } => { | ||
| let collapsed = folded ^ !options.verbose ^ options.thinking_default_expanded; | ||
| let collapsed = folded ^ !(options.verbose || options.thinking_default_expanded); |
There was a problem hiding this comment.
Codewhale review
The PR fixes the thinking-cell fold baseline calculation by replacing the triple XOR with a single XOR against a combined baseline of verbose OR thinking_default_expanded. A new 8-case test covers the full truth table for folded, verbose, and default_expanded.
Assessment
The change is correct and well-tested. No blocking or non-blocking issues found.
Advisory review by Codewhale (codewhale review --pr 5857 --post, head bbd30ea667ea4f050136da1363383fa2b0c20118). Line-specific findings are also posted as inline review comments; mechanical fixes arrive as committable suggestions you can apply from the Files tab. CODEOWNERS approval still governs merge.
No-Issue: half of #5847 (one-cell truth-table fix + 8-cell test); the keyboard inline-expand half follows separately.
Half of #5847: one-cell truth-table fix plus 8-cell test; old + new fold tests pass. Keyboard inline expand is the other half and follows separately. Full matrix via CI.