Fix agent permission row flicker when scrolled away from a tall plan (#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 https://github.com/zed-industries/zed/issues/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.
1cecd7d66aMartinYe1234 committed on 6/5/2026, 6:52:11 PM· committed by GitHubparentf1268a1
3 files changedLine totals unavailable