fix(composer): stop the mobile caret misplacing on command mode toggles

The composer frame kept `opacity-95` and `backdrop-blur-md`, so it stayed a
composited layer with the textarea inside it. Repainting that layer whenever
command or mention mode toggled (frame class change, mode badge mount, takeover
list mount, z-index change) still made iOS draw the caret at a stale position
below the typed text, even after the transition was removed.

Render the frosted background as a `before:` pseudo-element and drop the
compositing from the frame, so the textarea's ancestor is never a layer that
repaints on mode changes. Add a regression test pinning the invariant.
This commit is contained in:
Chris Scott committed 2026-10-07 22:01:53 -04:00
1 parent e42ce1bd56
commit 4553af41dc
2 files changed
+14 -1

No files matched your search

@@ -495,6 +495,19 @@ describe('PromptInput command submission', () => {
await waitFor(() => expect(suggestionProps.selectedIndex).toBe(0))
})
it('keeps the composer frame out of a compositing layer so the iOS caret stays aligned', async () => {
renderComponent()
const input = await screen.findByPlaceholderText('Send a message...')
const frame = input.parentElement as HTMLElement
const tokens = frame.className.split(/\s+/)
expect(tokens).not.toContain('transition-all')
expect(tokens.some((token) => token.startsWith('backdrop-blur'))).toBe(false)
expect(tokens.some((token) => token.startsWith('opacity-'))).toBe(false)
expect(tokens).toContain('before:backdrop-blur-md')
})
describe('mobile keybar', () => {
beforeEach(() => {
mocks.useMobile.mockReturnValue(true)