Repository navigation
fix(agent): keep sidebar rows still during background refresh - #1462
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Loading tasks…row appears under each computer in a single frame, pushing everything below it down.Root cause
A background refresh was treated like a first load:
computer_more_entrydrew 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
ComputerHostPagetracks 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.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.open_taskreturned, 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 leaveloading_sessionset.Testing
cargo test -p maple-agent-app: 1219 passed, 0 failed, 2 ignored.just ci-lint: clean.Not run:
MAPLE_HOOK_SKIP=1. Its workspace tests includereads_native_release_tar_format_and_preserves_bundle_modes, which fails on this macOSbsdtar, 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
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.