From 4553af41dc32ba52bee106d31323dbfcea9ea472 Mon Sep 17 00:00:00 2001 From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com> Date: Wed, 7 Oct 2026 22:01:53 -0400 Subject: [PATCH] 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. --- .../components/message/PromptInput.command.test.tsx | 13 +++++++++++++ frontend/src/components/message/PromptInput.tsx | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/message/PromptInput.command.test.tsx b/frontend/src/components/message/PromptInput.command.test.tsx index f52f3c36..3c49ba58 100644 --- a/frontend/src/components/message/PromptInput.command.test.tsx +++ b/frontend/src/components/message/PromptInput.command.test.tsx @@ -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) diff --git a/frontend/src/components/message/PromptInput.tsx b/frontend/src/components/message/PromptInput.tsx index fb521dd6..a914e01b 100644 --- a/frontend/src/components/message/PromptInput.tsx +++ b/frontend/src/components/message/PromptInput.tsx @@ -1472,7 +1472,7 @@ if (isIOS && isSecureContext && navigator.clipboard && navigator.clipboard.read) return ( -