Fix agent permission row flicker when scrolled away from a tall plan - #58689
Merged
miguelraz merged 1 commit intoJun 5, 2026
Merged
Conversation
The floating awaiting-permission row embeds the pending tool call, so a tall plan awaiting approval could consume the entire panel and squeeze the conversation list to zero height. ListState's viewport queries returned None for a zero-height viewport, making the row's visibility oscillate between frames. Make item_is_above/below_viewport answer definitively for a zero-height viewport, and cap the floating row's content with a scrollable max height so it can never crowd out the conversation list.
MartinYe1234
marked this pull request as ready for review
June 5, 2026 18:20
Contributor
|
Ran this PR locally and confirmed the bug is no longer reproducible on this branch. Ship it! |
Contributor
|
@zed-industries/approved |
miguelraz
deleted the
martin/ai-372-scrolling-to-top-breaks-claude-acp-thread-in-plan-mode
branch
June 5, 2026 18:54
|
Thank you! |
TomPlanche
pushed a commit
to TomPlanche/zed
that referenced
this pull request
Jun 8, 2026
…ed-industries#58689) When a pending tool call awaiting permission contains tall content (e.g. a full plan in Claude Code plan mode) and the inline prompt is scrolled out of view, the floating awaiting-permission row embeds that content and can grow to consume the entire panel, squeezing the conversation list to zero height. `ListState::item_is_above_viewport` / `item_is_below_viewport` returned `None` for a zero-height viewport, so the row's visibility decision oscillated from frame to frame, flickering between the conversation and the permission prompt and making the thread unusable. This PR fixes the root cause and hardens the UI: - `gpui`: `item_is_above_viewport` / `item_is_below_viewport` now answer definitively from the last layout bounds even when the viewport is zero-height, so callers that size sibling UI based on these queries can't oscillate. Adds a regression test. - `agent_ui`: adds a `Floating` tool call layout used by the awaiting-permission row that caps the embedded tool call content with a scrollable max height, so the row can never crowd the conversation list out of view while keeping the permission buttons visible. Adds an integration test that drives real window draws and asserts the row's visibility is stable across frames. Closes AI-372 Closes zed-industries#58564 Release Notes: - Fixed the agent panel flickering and becoming unusable when a permission prompt with tall content (such as a plan awaiting approval) was scrolled out of view.
This was referenced Jun 10, 2026
This was referenced Jun 18, 2026
Closed
This was referenced Jul 1, 2026
This was referenced Jul 10, 2026
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
…ed-industries#58689) When a pending tool call awaiting permission contains tall content (e.g. a full plan in Claude Code plan mode) and the inline prompt is scrolled out of view, the floating awaiting-permission row embeds that content and can grow to consume the entire panel, squeezing the conversation list to zero height. `ListState::item_is_above_viewport` / `item_is_below_viewport` returned `None` for a zero-height viewport, so the row's visibility decision oscillated from frame to frame, flickering between the conversation and the permission prompt and making the thread unusable. This PR fixes the root cause and hardens the UI: - `gpui`: `item_is_above_viewport` / `item_is_below_viewport` now answer definitively from the last layout bounds even when the viewport is zero-height, so callers that size sibling UI based on these queries can't oscillate. Adds a regression test. - `agent_ui`: adds a `Floating` tool call layout used by the awaiting-permission row that caps the embedded tool call content with a scrollable max height, so the row can never crowd the conversation list out of view while keeping the permission buttons visible. Adds an integration test that drives real window draws and asserts the row's visibility is stable across frames. Closes AI-372 Closes zed-industries#58564 Release Notes: - Fixed the agent panel flickering and becoming unusable when a permission prompt with tall content (such as a plan awaiting approval) was scrolled out of view.
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…ed-industries#58689) When a pending tool call awaiting permission contains tall content (e.g. a full plan in Claude Code plan mode) and the inline prompt is scrolled out of view, the floating awaiting-permission row embeds that content and can grow to consume the entire panel, squeezing the conversation list to zero height. `ListState::item_is_above_viewport` / `item_is_below_viewport` returned `None` for a zero-height viewport, so the row's visibility decision oscillated from frame to frame, flickering between the conversation and the permission prompt and making the thread unusable. This PR fixes the root cause and hardens the UI: - `gpui`: `item_is_above_viewport` / `item_is_below_viewport` now answer definitively from the last layout bounds even when the viewport is zero-height, so callers that size sibling UI based on these queries can't oscillate. Adds a regression test. - `agent_ui`: adds a `Floating` tool call layout used by the awaiting-permission row that caps the embedded tool call content with a scrollable max height, so the row can never crowd the conversation list out of view while keeping the permission buttons visible. Adds an integration test that drives real window draws and asserts the row's visibility is stable across frames. Closes AI-372 Closes zed-industries#58564 Release Notes: - Fixed the agent panel flickering and becoming unusable when a permission prompt with tall content (such as a plan awaiting approval) was scrolled out of view.
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.
When a pending tool call awaiting permission contains tall content (e.g. a full plan in Claude Code plan mode) and the inline prompt is scrolled out of view, the floating awaiting-permission row embeds that content and can grow to consume the entire panel, squeezing the conversation list to zero height.
ListState::item_is_above_viewport/item_is_below_viewportreturnedNonefor a zero-height viewport, so the row's visibility decision oscillated from frame to frame, flickering between the conversation and the permission prompt and making the thread unusable.This PR fixes the root cause and hardens the UI:
gpui:item_is_above_viewport/item_is_below_viewportnow answer definitively from the last layout bounds even when the viewport is zero-height, so callers that size sibling UI based on these queries can't oscillate. Adds a regression test.agent_ui: adds aFloatingtool call layout used by the awaiting-permission row that caps the embedded tool call content with a scrollable max height, so the row can never crowd the conversation list out of view while keeping the permission buttons visible. Adds an integration test that drives real window draws and asserts the row's visibility is stable across frames.Closes AI-372
Closes #58564
Release Notes: