Skip to content

fix(desktop): a long send queue scrolls inside its own panel - #1583

Merged
huichen merged 1 commit into
mainfrom
fix/queue-panel-main
Nov 10, 2026
Merged

huichen merged 1 commit into
mainfrom
fix/queue-panel-main

Conversation

@huichen

@huichen huichen commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

Cherry-pick of 440943a0b from dev-huichen (that branch cannot be pushed: 4c24677d2 touches .github/workflows/ci.yml and the local PAT lacks workflow scope).

问题

桌面端队列面板浮在对话区上、父容器 overflow-hidden,而面板给每条待发行都按全高绘制 ⇒ 队列长过窗口时顶部几行被切在 frame 之外:不只是读不到,是任何指针都点不到上面的「修改/删除」(DEFAULT_SESSION_QUEUE_CAPACITY = 128,真实队列能到)。同时 footer 的占位比它所在的 frame 还高,把对话区挤成空白。

改法

  • SendQueuePanel 的列表变成自己的滚动容器,封顶 min(45vh, 26rem),同样的行滚动可达。
  • useComposerInset 仍按 footer 实测高度占位,但封顶在「frame 减去 120px 对话带」,并在 frame 尺寸变化时重测,占位不再能超过 frame。
  • 无颜色/字号/间距/圆角改动。

验证

  • vitest run SendQueuePanel.test.tsx useComposerInset.test.tsx:15/15 通过。
  • npm run lint(含 tsc --noEmit):0 error(1 条既存 warning 在 liveRunProjection.ts,与本改动无关)。
  • 几何断言:把面板改回无上限列表,queue-many 场景红在 the panel starts 6530px above the frame: its top rows are clipped;改后第一行「删除」可命中(top 295)、列表 387/7164 可滚、输入框 56px 可点、对话区可揭 247px。占位封顶由单元测试 stops the reservation at the frame(550→480、900→480、420→420)保证。

The queue panel floats over the transcript inside a frame that clips
(`overflow-hidden`), and it drew every waiting row at full height. A queue long
enough to outgrow the window therefore had its first rows clipped away above the
frame — not merely unreadable but unreachable: the edit and delete buttons on
those rows could not be hit by any pointer, and the footer's reservation, taller
than the frame it lives in, turned the transcript into blank space. The Agent
holds up to `DEFAULT_SESSION_QUEUE_CAPACITY` = 128 rows for one conversation, so
this is a state a real queue reaches.

The list is now its own scroll container, capped at `min(45vh, 26rem)`, so the
same rows are reachable by scrolling the panel. `useComposerInset` still reserves
the footer's measured height but stops at the frame minus a 120px band of
transcript, and re-measures when the frame itself resizes — the reservation can no
longer outrun the frame. No colours, type, spacing or radii change; the only new
pixels are the list's own scrollbar once it overflows.

Measured in the screenshot harness at the ceiling (`?queue=128`, the new
`queue-many` scenario, 1280×860). Every claim is a rect or a hit test:

  before: panel top −6482 (6530px above the frame), list 7164px with no scroll,
          first row's delete button behind "nothing", transcript −6530px
  after:  panel top 295, list 387px of 7164px, first and last rows' delete
          buttons both hit, composer 56px and hit, transcript 247px painted

Reverting the panel to an unbounded list turns that scenario red on its first
check; reverting the inset clamp is covered by the new
"stops the reservation at the frame" unit test.

(cherry picked from commit 440943a)
@huichen
huichen enabled auto-merge (squash) November 10, 2026 10:30
@huichen
huichen merged commit 2e0f1ae into main Nov 10, 2026
10 checks passed
@huichen
huichen deleted the fix/queue-panel-main branch November 10, 2026 11:40
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