Skip to content

fix(web): keep Agents panel scroll position per thread - #14512

Closed
f4llenz wants to merge 2 commits into
pingdotgg:mainfrom
f4llenz:fix/agents-panel-scroll-memory
Closed

f4llenz wants to merge 2 commits into
pingdotgg:mainfrom
f4llenz:fix/agents-panel-scroll-memory

Conversation

@f4llenz

@f4llenz f4llenz commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

What Changed

The Agents panel now keeps each thread's scroll position when switching panel tabs, hiding and showing the panel, or returning to a thread. Previously, panel remounts reset a long roster to the top, and thread switches could reuse another thread's position.

ChatView gives each environment-qualified thread its own AgentsPanel lifetime. The panel restores its offset before paint and captures scrolling with a passive listener. Renderer memory is limited to 100 threads. A clamped viewport preserves the deeper saved offset for a later layout change.

Why

This is a focused fix for losing your place in an existing Agents roster. It adds no settings, server state, persistence, or wire changes. It qualifies for the small, obvious bug-fix exception in CONTRIBUTING.md.

This replaces #9637 and addresses its cache-bound and fractional-clamping review findings. #14512 was closed because its evidence was still represented by upload placeholders; the matching screenshots and recordings are now uploaded and linked below.

UI Changes

Both recordings use the same synthetic showcase database, with 22 agents in thread A and 36 in thread B, in headless Chrome at 1536 × 960. No live projects, sessions, or conversations are included. The public T3 Code repository name is a fixture label.

Before — main 0cf482b08b

Before: switching Files → Agents resets the roster to the top

Watch the before video (21 seconds)

After — PR head 8d278e2a7b

After: switching Files → Agents preserves the scrolled roster

Watch the after video (18 seconds)

The still frames are taken six seconds into each recording, after Files → Agents. The complete videos demonstrate tab switches, panel hide/show, and switching threads.

Verification

Reproduction: open thread A's long Agents roster, scroll to 500, switch Files → Agents, then hide and show the right panel. Scroll A back to 500 on the baseline before opening unscrolled thread B, then return to A.

The original recorded runs logged these offsets:

Step Before After
Scroll A 500 500
Files → Agents 0 500
Hide/show panel 0 500
Open unscrolled B 500 0
Return to A 500 500

A separate pass through the T3 collaborative browser reproduced the baseline's tab and panel reset to 0, verified that the fix retains 500 through both remounts, and verified that B opens at 0 while returning to A restores 500. That browser's baseline thread switch opened B at 0; the cross-thread leakage is shown in the original headless recording above.

Checks rerun at the unchanged PR head:

  • From apps/web: vp test run src/components/AgentsPanel.test.tsx — 4/4 passed. Covers remount restoration, the 100-thread bound, clamped layouts, and delayed roster appearance.
  • From apps/web: vp run typecheck — passed.
  • vp lint on the four changed files — exited successfully; existing non-blocking ChatView.tsx warnings remain.
  • vp fmt --check on those files and git diff --check — passed.

Claude's earlier regression run had 3/4 tests fail on the baseline and checked that removing eviction, the clamp guard, or the delayed-roster dependency fails the corresponding test.

Entry points share ChatView's Agents panel, including panel tabs and visibility controls. Desktop renders the same web component; mobile has no corresponding Agents roster. This change is provider-independent and uses environment-qualified keys. Electron, narrow sheet layout, and remote/relay/tunnel connections were not directly exercised. Existing user guidance remains accurate.

Implemented by Claude Opus 5.5 through Claude Code in T3 Code. Browser verification and GitHub evidence publication completed by GPT-6.1-Sol (high) through the Codex harness in T3 Code.

The Agents roster returned to the top whenever the panel remounted, such as
after a tab switch or after hiding and showing the right panel. Switching
threads reused one viewport, so a thread opened at the previous thread's
offset.

Key AgentsPanel by the scoped thread key and remember each thread's offset
in a renderer-memory map, restored before paint. The map keeps the 100 most
recently used threads, like the timeline position cache. ScrollArea exposes
its scrolling viewport through an optional viewportRef.
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 1, 2026

Copy link
Copy Markdown
Member

Note

This comment is posted by Julius' dot

Closing for missing UI verification. The Before and After sections still contain upload placeholders, so the claimed recordings are not attached. The offset table and tests do not show the scrolling and remount behavior.

Please attach matching before/after captures and the recordings of tab, panel and thread switches, then request reconsideration. Drafts have the same evidence requirements.

@f4llenz

f4llenz commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor Author

The missing UI evidence is now uploaded to GitHub and linked directly in the PR body: matching before/after screenshots and 21-second/18-second videos showing Files → Agents, panel hide/show, and thread switches. All captures use synthetic showcase data. The body identifies the baseline and PR commits, reproduction steps, focused test results, and verification limits.

Please reconsider the evidence-based closure under CONTRIBUTING.md. The code is unchanged.

GitHub refused reopening through both GraphQL and REST. The focused replacement is #14525, with all evidence included at creation, as permitted by the closure-and-reconsideration guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants