Skip to content

fix(sidebar): fold from the row menu what the row folds, and skip the prefetch on a fold press - #4962

Merged
devswha merged 5 commits into
mainfrom
fix/sidebar-agent-fold-followups
Nov 28, 2026
Merged

devswha merged 5 commits into
mainfrom
fix/sidebar-agent-fold-followups

Conversation

@devswha

@devswha devswha commented Nov 28, 2026

Copy link
Copy Markdown
Owner

What changed

Part of #3884 (sidebar agent fold follow-ups from #3845's review). Each case below was reproduced on main by a test that fails there and passes here.

  • Item 2: a press on a row that only folds its agents no longer starts that pane's conversation prefetch (pressPane is skipped for foldable rows).
  • Item 3: a repository row's aria-expanded follows whether its agents are shown, so under a filter that shows the row's own agents while its worktrees stay folded it reads true, not false.
  • Comment items (pinned repository, only the worktree pinned, a filter that keeps the main row without its worktrees): the row menu decided its fold from every worktree in the snapshot, while the row decides from the worktrees it actually draws. When those are drawn apart (pinned) or filtered out, the row folds its agents but the menu's Collapse/Expand and New tab with agent... worked the worktree fold, so a new agent stayed hidden. The menu now uses the worktrees of the row's drawn group, the same as the row.

No new control, setting or contract; the menu items keep their labels and only act on the fold the row itself works.

How it was checked

  • New tests in Sidebar.agentTree.test.tsx and Sidebar.appLayout.test.tsx: 5 fail on main, all pass with the fix.
  • bun test of Sidebar., MachineSidebar, AgentSidebar and RowMenu tests: 100 pass, 0 fail.
  • bun run check fast: typecheck and build pass; the unit step failed only in scripts/winvm-runner.test.ts, scripts/self-hosted-runner.test.ts, server/prompt.test.ts and scripts/plugin.test.ts (timeouts under local load, files this change does not touch); CI runs them clean.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Workspace menus now fold or unfold the agents shown for pinned or filtered repositories, consistent with clicking the repository row.
    • Creating a new tab keeps its agent visible without changing the repository’s saved worktree-group fold state.
    • Under filters, repository rows and left/right arrow keys now reflect the expansion state of the agents that are visible.
    • Folding agents no longer starts a conversation load, and workspace-row presses do not select an agent pane.

Repository-row fold actions and new-tab behavior now use visible worktree groups. Row expansion, pointer presses, and arrow keys reflect agent visibility.

Changes: Sidebar agent folding

Layer / File(s) Summary
Visible worktree group actions
src/components/Sidebar.tsx, src/components/Sidebar.appLayout.test.tsx
The menu offers worktree folding when a visible worktree group has children. Otherwise, it can offer agent folding. New-tab creation unfolds worktrees only when a visible worktree group is folded or persisted as collapsed. Tests cover pinned and filtered repository rows.
Repository-row agent state
src/components/Sidebar.tsx, src/components/Sidebar.agentTree.test.tsx, src/components/Sidebar.appLayout.test.tsx, changelog.d/sidebar-agent-fold-menu.md
aria-expanded reflects whether agents are hidden. Pointer presses do not start a conversation load when agent folding is available. Arrow keys change agent visibility, and tests cover these interactions and filtered rows.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • Issue 3884: The changes address fold-triggered conversation loading and filtered-row expansion state. The new-tab behavior changes for visible worktree groups, but the summary does not show that it handles every saved fold when no agents remain.

Possibly related PRs

  • devswha/ovis#3845: This PR changes the repository-row agent folding and new-tab behavior introduced by that PR.
  • devswha/ovis#3069: This PR adjusts row behavior for the workspace agent tree and setting introduced by that PR.

Suggested reviewers: jpcarranza94

Merge Risk: Minimal · previous review 12f47

This change fixes sidebar folding behavior and avoids unnecessary conversation loads. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the sidebar row menu now folds the same things the row folds, and a fold press skips the conversation prefetch. It is specific and matches the changeset (Sidebar.tsx f…
Description check Passed The description follows the template's Change and Validation sections. Change describes the problem (menu decided fold from all snapshot worktrees, row uses drawn worktrees), the three behavior fixes,…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the sidebar row menu now folds the same things the row folds, and a fold press skips the conversation prefetch. It is specific and matches the changeset (Sidebar.tsx fold/arrow logic, pane-press suppression, and tests).

Full details: Description check

Explanation

The description follows the template's Change and Validation sections. Change describes the problem (menu decided fold from all snapshot worktrees, row uses drawn worktrees), the three behavior fixes, and the absence of new controls or contracts. Validation lists the test runs, their results, and the failing unrelated checks. It does not link an issue for a feature, but this is a fix, and it references #3884 and #3845 for context. The template's HTTP/WS contract-test note does not apply, since no HTTP/WS changes are described.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between bcfc30b and 12f4739.

Files selected for processing: 4

  • changelog.d/sidebar-agent-fold-menu.md
  • src/components/Sidebar.agentTree.test.tsx
  • src/components/Sidebar.appLayout.test.tsx
  • src/components/Sidebar.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

@devswha
devswha merged commit a2897b2 into main Nov 28, 2026
15 checks passed
@devswha

devswha commented Nov 28, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head baaca6cca. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit said it did not review (a limit or a skip) since this head.

main moved but untouched: merged without update. Its new commits up to 01ebb402b change no file of this pull request, none imported by one, nothing that decides which checks run, and no core path.

Reviews: omo gate (BLOCK only for the missing changelog fragment, added at 12f4739), omo-native-code-reviewer CLEAR with one MEDIUM (arrow keys vs aria-expanded under a filter) fixed in the same round with a test that fails on the previous head. Codex via axwith did not finish in 35 min.

@devswha
devswha deleted the fix/sidebar-agent-fold-followups branch November 28, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant