Skip to content

sessions: speed up split chat tab closing - #333014

Merged
Connor Peet (connor4312) merged 3 commits into
mainfrom
connor4312/optimize-split-chat-tab-closing
Aug 27, 2026
Merged

sessions: speed up split chat tab closing#333014
Connor Peet (connor4312) merged 3 commits into
mainfrom
connor4312/optimize-split-chat-tab-closing

Conversation

@connor4312

Copy link
Copy Markdown
Member

sessions: speed up split chat tab closing

Reduce synchronous UI work when a user closes a chat tab in a split Agents window.

  • Remove an orphaned split group before its empty chat assignment creates a temporary new-chat view.
  • Update active-chat, visibility, and session-action state without rebuilding all chat tabs.
  • Cache the observed tab bar height instead of reading layout during each group layout.
  • Preserve active tab ARIA state and atomic split-chat replacement behavior.
  • Add focused regression tests for the optimized paths.

Performance trace comparison:

Measurement Original Updated Improvement
Close 1 click handler 242.1 ms 1.07 ms 99.6%
Close 1 complete input task 243.2 ms 5.12 ms 97.9%
Close 2 click handler 298.1 ms 0.95 ms 99.7%
Close 2 complete input task 298.8 ms 4.54 ms 98.5%

Style recalculations fell from 182/151 to 1/1, and layout passes fell from 188/156 to 0/0.

(Commit message generated by Copilot)

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Reduce synchronous UI work when a user closes a chat tab in a split Agents window.

- Remove an orphaned split group before its empty chat assignment creates a temporary new-chat view.
- Update active-chat, visibility, and session-action state without rebuilding all chat tabs.
- Cache the observed tab bar height instead of reading layout during each group layout.
- Preserve active tab ARIA state and atomic split-chat replacement behavior.
- Add focused regression tests for the optimized paths.

Performance trace comparison:

| Measurement | Original | Updated | Improvement |
| --- | ---: | ---: | ---: |
| Close 1 click handler | 242.1 ms | 1.07 ms | 99.6% |
| Close 1 complete input task | 243.2 ms | 5.12 ms | 97.9% |
| Close 2 click handler | 298.1 ms | 0.95 ms | 99.7% |
| Close 2 complete input task | 298.8 ms | 4.54 ms | 98.5% |

Style recalculations fell from 182/151 to 1/1, and layout passes fell from 188/156 to 0/0.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 27, 2026 18:49
@connor4312
Connor Peet (connor4312) enabled auto-merge (squash) August 27, 2026 18:49
@vs-code-engineering

vs-code-engineering Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Benjamin Christopher Simmonds (@benibenj)

Matched files:

  • src/vs/sessions/browser/parts/chatCompositeBar.ts
  • src/vs/sessions/browser/parts/chatGroupView.ts
  • src/vs/sessions/browser/parts/chatGroupsView.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

Review tier: Balanced
Findings: 1 Medium severity · 1 Low severity

New issues introduced by this change (2)
Severity Finding
Low severity src/​vs/​sessions/​browser/​parts/​chatCompositeBar.ts — This optimized session-action update is not covered by the new DOM-identity regression. The…
Medium severity src/​vs/​sessions/​browser/​parts/​chatCompositeBar.ts — The new cached-height path is not covered by the regression tests. A stale or zero _height now…
What changed in this PR

Optimizes split-chat tab closing in the Agents window.

Changes:

  • Removes orphaned chat groups before reconciliation.
  • Updates tab state without unnecessary rebuilding.
  • Caches tab-bar height and adds regression coverage.
File Description
chatGroupsView.ts Removes orphaned groups efficiently.
chatCompositeBar.ts Optimizes tab updates and height measurement.
chatGroupsView.test.ts Tests split-group removal and replacement.
chatCompositeBar.test.ts Tests tab identity and ARIA state.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/sessions/browser/parts/chatCompositeBar.ts
Comment thread src/vs/sessions/browser/parts/chatCompositeBar.ts
Add focused coverage for the optimized state and height update paths.

- Verify that session-action visibility changes preserve existing chat tab elements.
- Inject a ResizeObserver test seam into the chat composite bar.
- Verify changed and repeated observed heights and border-box observation.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@connor4312
Connor Peet (connor4312) merged commit 1a4a18d into main Aug 27, 2026
37 checks passed
@connor4312
Connor Peet (connor4312) deleted the connor4312/optimize-split-chat-tab-closing branch August 27, 2026 19:59
@vs-code-engineering vs-code-engineering Bot added this to the 1.136.0 milestone Aug 27, 2026
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.

3 participants