Skip to content

Cap composer editors by the visible shell height - #7061

Merged
ymichael merged 2 commits into
mainfrom
slopcop/issue-7057
Nov 6, 2026
Merged

ymichael merged 2 commits into
mainfrom
slopcop/issue-7057

Conversation

@bb-slop-cop

@bb-slop-cop bb-slop-cop Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What was wrong

The composer editor caps were calc(50dvh - 3rem) (thread) and calc(70dvh - 3rem) (new thread). On iOS, dvh does not shrink when the software keyboard opens, while the app shell does: useMobileVisualViewportHeight resizes it to visualViewport.height and publishes that as --bb-shell-height. The thread composer (and the inline message editor, which uses the same layout) has no host-provided height cap, so a long draft kept a 378 px editor inside a ~516 px visible area and pushed the composer under the header.

What changed

  • The editor caps now read the shell's existing variable: calc(var(--bb-shell-height) * 0.5 - 3rem) and calc(var(--bb-shell-height) * 0.7 - 3rem). --bb-shell-height is 100dvh (100lvh in standalone) by default and the visible height while the keyboard is open, so the editor follows the same source of truth as the shell, including its pinch-zoom and dismissal handling.
  • An earlier revision added a per-composer visualViewport listener; it was replaced by this CSS-only change.
  • Updated the existing cap test for the new expression.

How you verified

393×852 touch viewport, 20-line draft, keyboard simulated by shrinking visualViewport.height to 516 px:

Editor Composer top (header ends at 48)
main, keyboard open 378 px y=22 (under header)
this PR, keyboard open 210 px y=190
this PR, keyboard closed 378 px y=358
this PR, keyboard open while zoomed (scale 2) 378 px y=358 (dvh fallback)

New-thread composer with keyboard open: editor 313 px, composer fully inside the visible area.

pnpm exec turbo run test --filter=@bb/app -- src/components/promptbox/PromptBoxInternal.test.tsx -t "size controls" passes. Native iOS keyboard not exercised.

Fixes #7057

AGENT GENERATED

🤖 Generated with Claude Code

Replace the per-composer visualViewport listener with the shell's
--bb-shell-height variable, which useMobileVisualViewportHeight already
sets to the visible height while the software keyboard is open.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael ymichael changed the title Use the visual viewport to cap composer editors Cap composer editors by the visible shell height Nov 6, 2026
@ymichael
ymichael merged commit 9519ec6 into main Nov 6, 2026
47 checks passed
@ymichael
ymichael deleted the slopcop/issue-7057 branch November 6, 2026 18:45
smsunarto added a commit to smsunarto/bb-plugins that referenced this pull request Nov 18, 2026
…BBP-14) (#184)

* fix(t3-composer): size the empty composer editor to one line

* fix(t3-composer): inset the Project and Environment search field from the sheet's top

Monokai now draws bb's picker search row as a bordered field. T3 Composer's
older rule zeroed its top margin, so the field touched the sheet's edge. Inset
it 4px like the rows, size the field rather than the input so it no longer
overflows the border, and give phones a 44px field with 16px text.

* feat(t3-composer): open the desktop composer two lines tall

The empty editor's minimum grows from one 20px line to two (48px). Touch
screens keep their one-line 32px minimum.

* fix(t3-composer): stop text typed after a mention pill from gluing onto it

Port of get-bb/bb#6581 (38c939c85). Serialization adds a space between a
pill and an adjacent word or pill, so the agent sees /review Also, not
/reviewAlso.

* fix(t3-composer): close a multiword @ query once it settles with no matches

Port of get-bb/bb#7002 (631a62619). Typing on after an unmatched @query
("@see you later") no longer keeps an empty menu over the prose. Shortening
the query back reopens it, shown again only once something matches.
typeahead.test.tsx covers it in the mounted composer, since upstream's
tests live in bb's app.

* fix(t3-composer): cap the editor by the visible shell height

Port of get-bb/bb#7061 (9519ec685). On iOS dvh ignores the software
keyboard, so a long draft pushed the composer under the header. The caps
now read BB's --bb-shell-height (bb 0.49 defines it), including the
plugin's own !important thread-composer rule in app.css, which would
otherwise keep the old 50dvh cap.

* fix(t3-composer): keep slash command names visible when an argument hint is long

Port of get-bb/bb#7565 (dafe34edc). A long argument hint, such as Claude
Code's code-review, collapsed the command name and pushed the / menu
sideways on phones. Description, then hint, now give way before the name.
Uses gap-1, not upstream's gap-1.5, to stay on the plugin's 4px grid; the
Storybook story is skipped since Storybook was removed here.

* feat(t3-composer): run a built-in / command when its row is clicked

Port of the composer part of get-bb/bb#7480 (1983b0dfb): a click on a
built-in command now sends it, as Enter already did. The plugin's own
/handoff stays excluded, so a draft before it is not sent with the
handoff. #7480's host-side /handoff is not in bb 0.49 and the plugin
keeps its own; its pill-delete cancel was already ported (a9aada1).

* perf(t3-composer): share one resize observer and read before writing

Port of get-bb/bb#7635 (2d04779a1). The composer's height tracker, editor
cap and typeahead max-height observe through one shared ResizeObserver
that runs every read before any write. lib/shared-resize-observer.ts is
vendored from packages/shared-ui with its tests, less the case for
useMeasuredValue, which this plugin does not have. bb 0.49's plugin
runtime exposes the full react-dom namespace, so its flushSync resolves.

* docs(t3-composer): record the upstream sync base and held changes

The fork base d4fa9cb is not on get-bb/bb's main; its content matches
21d5db72c. The plugin is now synced through 2d04779a1. Also corrects the
stated BB and SDK requirement to match package.json.

* fix(t3-composer): clear the last 4 frozen lint errors

Bare oxlint on the plugin now exits 0. Each is a reasoned suppression with
precedent elsewhere in the repo: attachment videos carry no captions, the
form delegates its children's keys and presses, the test fake mirrors
BB's role-based picker DOM, and an object URL is created and revoked as
one effect pair. Removes their lint-baseline entries.
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.

Thread composer covers the whole conversation on iPhone with the keyboard open

2 participants