Skip to content

fix(agent): keep sidebar rows still during background refresh - #1462

Merged
AnthonyRonning merged 1 commit into
masterfrom
codex-sidebarjitter-maple
Nov 5, 2026
Merged

AnthonyRonning merged 1 commit into
masterfrom
codex-sidebarjitter-maple

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem

With other computers paired, clicking a task on another computer could make the whole sidebar jump. A frame-by-frame look at a screen recording showed why:

  • A Loading tasks… row appears under each computer in a single frame, pushing everything below it down.
  • The rows then leave one computer at a time as replies arrive, so one click causes 3–4 separate jumps in roughly 100 ms.
  • The tasks never left the screen, so the rows reported nothing useful.
  • The pointer doesn't move, but the row under it changes several times, so a quick second click can land on the wrong row.

Root cause

A background refresh was treated like a first load: computer_more_entry drew a row for any first page in flight. #1254 made refreshes keep the task rows, but this check was never updated.

Hidden sidebars don't receive computer updates, so each keeps an old snapshot. Switching to one compares that snapshot with the latest, and any difference refreshes every computer. That also explains why only some clicks jumped. A visible sidebar does the same thing with no click at all when any computer's newest task changes.

Changes

  • No progress row for a refresh. ComputerHostPage tracks first pages being replaced, so a read only reports progress when it has nothing on screen yet or when its row asked for it. First loads, retries and errors are unchanged.
  • "More" rows hold their place. invalidate() still clears cursors, so stale ones can never be used. The rows stay visible and inert until the fresh first page arrives, and the prefix filters keep their pre-refresh shape, so long lists don't shift either.
  • Reconnects are covered. A recovered computer rebuilds its page from a snapshot, and tasks in that snapshot now count as already on screen.
  • The highlight moves on click. The sidebar used to update only after open_task returned, which briefly lit the computer's previously open task. A failed or superseded open gives the highlight back. The open's generation is recorded because a superseded open can leave loading_session set.

Testing

  • cargo test -p maple-agent-app: 1219 passed, 0 failed, 2 ignored.
  • just ci-lint: clean.
  • New regression tests cover a refresh with and without "more" rows, switching to stale and never-visible sidebars, reconnect snapshots, first-load and retry progress, held-row cleanup, and the highlight.

Not run:

  • The change has not been checked in the running app.
  • The pre-commit hook was skipped with MAPLE_HOOK_SKIP=1. Its workspace tests include reads_native_release_tar_format_and_preserves_bundle_modes, which fails on this macOS bsdtar, in a crate this change doesn't touch. I confirmed that failure on this branch. The rest of the workspace test suite was not run locally.

Not changed

  • A refresh still refetches every computer. It's invisible now, but scoping it to the computer that changed would save requests.
  • Revalidation still replaces first pages, so tasks loaded through "more" drop back to the first page.
  • A group that spends its first page on active tasks can briefly lose settled rows until the follow-up read returns.
  • In Status and List views, a first read from a snapshot still shows its row.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

A sidebar with other computers drew a "Loading tasks…" row under each
computer whenever a background refresh ran, even though the tasks stayed
on screen. Each row pushed everything below it down, and the rows left
one computer at a time as replies arrived, so one click caused several
layout jumps in about 100 ms. Hidden sidebars hold an old computer
snapshot, so switching computers set this off, and any change on one
computer refreshed all of them.

Rows on screen now wait for their replacement in place. A refresh draws
no progress row, and "more" rows hold their position, inert, because
their cursors are gone. Prefix filters keep their pre-refresh shape, so
long lists do not shift either. First loads, retries and errors still
report themselves.

The clicked task also takes the sidebar highlight at once instead of
after its snapshot lands, which briefly lit the computer's previous
task. A failed or superseded open gives the highlight back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AnthonyRonning
AnthonyRonning merged commit 568f790 into master Nov 5, 2026
41 of 43 checks passed
@AnthonyRonning
AnthonyRonning deleted the codex-sidebarjitter-maple branch November 5, 2026 08:24
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