Skip to content

Keep queued mention menus inside the editor workspace - #1866

Merged
brsbl merged 3 commits into
bb/debug-agent-message-pill-bugs-thr_gts7ugydizfrom
bb/fix-queued-mention-typeahead-thr_gts7ugydiz
Aug 19, 2026
Merged

brsbl merged 3 commits into
bb/debug-agent-message-pill-bugs-thr_gts7ugydizfrom
bb/fix-queued-mention-typeahead-thr_gts7ugydiz

Conversation

@brsbl

@brsbl brsbl commented Aug 19, 2026 •

Copy link
Copy Markdown
Collaborator

What was wrong

The queued editor rendered its mention typeahead above the prompt inside an overflow-clipped queue surface. Because the drawer reserved no space for that menu, first and last queued rows could hide it; a higher z-index could not escape the clipping boundary.

What changed

  • Report the queued prompt's open typeahead height to its editor slot and reserve that space below the edit header.
  • Reuse the queue's existing resize measurement to grow and scroll-align the editor neighborhood when the reservation changes.
  • Cover first-row, last-row, and constrained-drawer placement.

How you verified

  • Regression proof: the new queue tests failed before the fix because no typeahead space was reserved.
  • pnpm exec turbo run test --filter=@bb/app --force -- --run src/components/promptbox/banner/QueuedMessagesList.test.tsx src/components/promptbox/PromptBoxInternal.test.tsx — 135 tests passed.
  • pnpm exec turbo run typecheck --filter=@bb/app — passed.
  • pnpm exec turbo run lint --filter=@bb/app — passed with the repository's existing 147 warnings and no errors.
  • Exact final-head dev-app QA: first- and last-row menus remained fully visible inside the constrained drawer at 390×844, 768×900, 1440×900, and 3440×1440; five open/close cycles passed per viewport.

Before / after

Before: parent-branch dev app with the menu top clipped After: PR-head dev app with the full menu visible
Before: desktop dev app clips Threads and Update target above the last queued-row editor After: desktop dev app shows Threads and Update target above the same queued-row editor

Responsive QA

Final-head dev-app captures from 744fa9289951d6b45cdc7e89306fbdd02c8d28ec with the last queued-row mention menu open; the same run also passed the first queued row.

Mobile — 390×844 Small/narrow — 768×900
PR 1866 mobile final-head QA PR 1866 small-window final-head QA
Normal desktop — 1440×900 Very large desktop — 3440×1440
PR 1866 normal-desktop final-head QA PR 1866 ultrawide final-head QA

BB-Thread-ID: thr_gts7ugydiz

AGENT GENERATED: by GPT-5

@bb-slop-cop

bb-slop-cop Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

🚨 SLOP COP 🚨 · review

I am the Slop Cop. I am reviewing this pull request for security, code quality, performance, architecture, and user behavior.

useLayoutEffect(() => {
if (reportQueuedEditorTypeaheadLayout === null) return;
const menu = typeaheadMenuRef.current;
if (!showTypeaheadMenu || menu === null) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 slopcop/review — Clear the queue reservation when zen mode opens

This effect reports every open menu as an external menu. However, zen mode moves the menu inside the form at line 3247. Desktop queued editors can enter zen mode. The queue then adds the menu height plus 8px as blank padding above the form. This can add about 200px of empty space and move nearby rows. Please report an open reservation only when mentionMenuPlacement === "top" && !isZenMode. Add both values to the effect dependencies, and cover the zen-mode transition in a test.

@bb-slop-cop bb-slop-cop Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 SLOP COP 🚨 · review

Plain English summary

This change measures a mention menu inside a queued-message editor. It adds matching space above the editor, so the menu stays within the queue workspace.

Finding

P2: Zen mode keeps unwanted reserved space. Zen mode moves the menu inside the form, but the effect still reports an external menu. The browser test measured 42 pixels of reserved padding and about 50 pixels of blank space. This space moves the editor and nearby rows. I left an inline comment with the fix and test details.

Review details

  • Security: I found no security or privacy issue.
  • Performance: I found no render loop or listener leak. Both resize observers disconnect during cleanup.
  • Architecture: I found no duplicate reservation code. The new context is specific, but its small scope does not require a refactor.
  • Tests: The Turbo app type check passed. The focused Vitest run passed all 134 tests.
  • CI: All current GitHub checks pass.
  • Browser: Normal queued mention placement passed. Zen mode reproduced the issue.

I posted a comment-only review. I did not approve the pull request or request changes.

@brsbl
brsbl force-pushed the bb/fix-queued-mention-typeahead-thr_gts7ugydiz branch from 07067f1 to 744fa92 Compare August 19, 2026 03:09
@brsbl
brsbl merged commit d81fee6 into main Aug 19, 2026
12 checks passed
@brsbl
brsbl deleted the bb/fix-queued-mention-typeahead-thr_gts7ugydiz branch August 19, 2026 03:28
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