agent_ui: Remeasure changed entries in the thread view list#53017
Merged
Conversation
Co-authored-by: Eric Holk <eric@zed.dev>
eholk
approved these changes
Apr 2, 2026
mikayla-maki
added a commit
that referenced
this pull request
Apr 3, 2026
…#53101) Follow up to #53017 This PR does some significant refactoring of the `follow_tail` feature in the GPUI list. That's only used by the agent panel's thread view and given to the height-changing nature of streaming agent responses, we were seeing some scroll snapping bugs upon scrolling while the thread is generating. In the process of fixing it, we introduced a `remeasure_items` method as an alternative to `splice` so that we could get the remeasurement fix without scroll position changes. We already had a `remeasure` method that did that for all of the indexes, but we needed something more scoped out for the agent panel case, so as to not remeasure the entire list's content on every new streamed token. Effectively, this ends up reverting what the PR linked above introduced, but it improved the API in the process. Release Notes: - N/A Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
rtfeldman
pushed a commit
that referenced
this pull request
Apr 4, 2026
…#53101) Follow up to #53017 This PR does some significant refactoring of the `follow_tail` feature in the GPUI list. That's only used by the agent panel's thread view and given to the height-changing nature of streaming agent responses, we were seeing some scroll snapping bugs upon scrolling while the thread is generating. In the process of fixing it, we introduced a `remeasure_items` method as an alternative to `splice` so that we could get the remeasurement fix without scroll position changes. We already had a `remeasure` method that did that for all of the indexes, but we needed something more scoped out for the agent panel case, so as to not remeasure the entire list's content on every new streamed token. Effectively, this ends up reverting what the PR linked above introduced, but it improved the API in the process. Release Notes: - N/A Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.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.
This PR fixes an issue where, sometimes, you couldn't scroll all the way to the bottom of the thread's content. The scrollbar would show up at the bottom of the scrollable container but the content was visibly cut off. Turns out that's a consequence of the top-down thread generation introduced in #52440, where changing the list alignment to
Topmade it visible that sometimes, the maximum scroll area would get underestimated because the items in the thread view's list would have a stale height measurement. So, the way this PR fixes the issue is by callingsplice_focusablein theEntryUpdatedevent, too, so that the height of the items in the overdraw area get marked as unmeasured, triggering a list re-render and re-measuring.We started by writing a test at the list level that would reproduce the regression but then later figured out that this is not an inherent list problem; it was rather a problem with its use within the thread view layer. Then, we explored writing a test that documented the regression, but it turned out to be very hard to simulate this sort of set up in which certain elements would have its height changed during streaming, which would be how you'd get to a mismatched height situation.
Therefore, given
AcpThreadEvent::NewEntryalready calledsplice_focusableand don't have a test for it, we figure it'd be safe to move forward without one, too. We then introduced a helper that's now shared betweenAcpThreadEvent::NewEntryandAcpThreadEvent::EntryUpdated.Release Notes: