Multi-Agent Collaboration for Team and Friends
TypeScript agent-automationagent-orchestrationagent-workflowai-agentsai-collaborationai-memoryai-workforceautonomous-agentsclaude-codeclaude-code-skillscodexcoding-agentmulti-agentmultiple-agentone-person-businessone-person-companyone-person-teamopencodesolopreneur
fix(community): keep message images stable on hover (#985)
Gener833b77b78783
diff --git a/src/web/src/components/community/messages/message.render.dom.test.ts b/src/web/src/components/community/messages/message.render.dom.test.tsindex a35fd39b1..c0ca91a7d 100644--- a/src/web/src/components/community/messages/message.render.dom.test.ts+++ b/src/web/src/components/community/messages/message.render.dom.test.ts@@ -88,6 +88,7 @@ vi.mock("@/components/ui/context-menu", async () => {}) => ReactModule.cloneElement(render, {...props,className: [render.props.className, props.className].filter(Boolean).join(" "),+ style: { ...props.style, ...render.props.style },"data-slot": "context-menu-trigger",} as React.HTMLAttributes<HTMLElement>),ContextMenuContent: ({ children }: { children: React.ReactNode }) =>@@ -384,11 +385,13 @@ describe("Message memo comparator", () => {expect(view.container.querySelector("[data-avatar-kind]")).toBe(avatar)})- it("keeps an inactive desktop row bare while selecting and restores ordinary activation afterward", () => {+ it("keeps an inactive desktop row stable with disabled menus while selecting", () => {const props = { m: baseMsg(), onOpenThread: vi.fn(), onEnterSelect: vi.fn(), hoverCapable: true }const view = rtlRender(makeTree(props))const avatar = view.container.querySelector("[data-avatar-kind]")- expect(view.container.querySelector("mock-context-menu")).toBeNull()+ const menu = view.container.querySelector("mock-context-menu")!+ expect(menu).toHaveAttribute("disabled")+ expect(view.container.querySelector("mock-context-menu-content")).toBeNull()view.rerender(makeTree({ ...props, selectMode: true }))const row = view.container.querySelector(".group.relative")!fireEvent.pointerEnter(row, { pointerType: "mouse" })@@ -396,11 +399,15 @@ describe("Message memo comparator", () => {fireEvent.focus(row)fireEvent.keyDown(row, { key: "F10", shiftKey: true })expect(view.container.querySelector("[data-avatar-kind]")).toBe(avatar)- expect(view.container.querySelector("mock-context-menu")).toBeNull()+ expect(view.container.querySelector("mock-context-menu")).toBe(menu)+ expect(menu).toHaveAttribute("disabled")+ expect(view.container.querySelector("mock-context-menu-content")).toBeNull()view.rerender(makeTree(props))expect(view.container.querySelector("[data-avatar-kind]")).toBe(avatar)fireEvent.pointerEnter(view.container.querySelector(".group.relative")!, { pointerType: "mouse" })- expect(view.container.querySelector("mock-context-menu")).not.toBeNull()+ expect(view.container.querySelector("mock-context-menu")).toBe(menu)+ expect(menu).not.toHaveAttribute("disabled")+ expect(view.container.querySelector("mock-context-menu-content")).not.toBeNull()})it("keeps selection controls out of the message row layout", () => {@@ -1225,7 +1232,7 @@ describe("Message touch action menu", () => {currentTarget,nativeEvent: { type: "click" },}))- expect(findControlledTouchMenu(renderer!)).toBeUndefined()+ expect(findControlledTouchMenu(renderer!)?.props.open).toBe(false)row = findMenuRow(renderer!)act(() => row.props.onPointerDownCapture({@@ -1235,12 +1242,14 @@ describe("Message touch action menu", () => {nativeEvent: { type: "pointerdown", pointerType: "touch" },}))row = findMenuRow(renderer!)- expect(row.props["data-slot"]).toBeUndefined()+ expect(row.props["data-slot"]).toBe("context-menu-trigger")expect(row.props.onClick).toBeTypeOf("function")expect(renderer!.root.findAllByProps({ "data-slot": "dropdown-menu-trigger" }).filter((node) => node.props["aria-hidden"] === true)).toHaveLength(1)expect(renderer!.root.findAllByProps({ "data-slot": "context-menu-trigger" }))- .toHaveLength(0)+ .toHaveLength(1)+ expect(renderer!.root.findByType("mock-context-menu").props.disabled).toBe(true)+ expect(row.props.style.WebkitTouchCallout).toBe("default")act(() => row.props.onTouchStart({ target: ownedTarget, currentTarget }))act(() => row.props.onTouchEnd({ target: ownedTarget, currentTarget }))@@ -1350,7 +1359,7 @@ describe("Message touch action menu", () => {expect(onReply).toHaveBeenCalledOnce()expect(vibrate).toHaveBeenCalledOnce()expect(currentTarget.setPointerCapture).toHaveBeenCalledWith(1)- expect(row.props.style).toBeUndefined()+ expect(row.props.style.transform).toBeUndefined()})it("rejects vertical movement without replying or vibrating", async () => {@@ -1528,7 +1537,8 @@ describe("Message touch action menu", () => {expect(trigger?.findAll((node) => node.type === "svg")).toHaveLength(0)expect(renderer!.root.findAll((node) => node.props["data-slot"] === "context-menu-trigger",- )).toHaveLength(0)+ )).toHaveLength(1)+ expect(renderer!.root.findByType("mock-context-menu").props.disabled).toBe(true)const row = renderer!.root.find((node) => typeof node.props.className === "string"@@ -1702,6 +1712,79 @@ describe("Message desktop text selection", () => {})describe("Message image attachment layout", () => {+ it.each([+ { name: "attachment", fields: { attachments: [{ kind: "image" as const, name: "same.png", url: "/same.png" }] } },+ { name: "embed", fields: { embeds: [{ image: { url: "/same.png", width: 320, height: 200 } }] } },+ { name: "Markdown", fields: { content: "" } },+ ])("retains a loaded $name image through activation, input menus and selection", async ({ fields }) => {+ const onImageLoad = vi.fn()+ const props = {+ m: baseMsg(fields),+ onOpenThread: vi.fn(),+ onCopy: vi.fn(),+ onImageLoad,+ onReply: vi.fn(),+ }+ const renderer = render(makeTree(props))+ const image = renderer.root.element.querySelector<HTMLImageElement>('[data-remote-image-kind="content"]')!+ Object.defineProperties(image, {+ decode: { configurable: true, value: () => Promise.resolve() },+ naturalWidth: { configurable: true, value: 320 },+ naturalHeight: { configurable: true, value: 200 },+ })+ fireEvent.load(image)+ await act(async () => { await Promise.resolve() })+ expect(image).toHaveAttribute("data-remote-image-state", "ready")+ const row = () => renderer.root.find((node) => node.type === "div" && typeof node.props.onPointerEnter === "function")+ const originalRow = row().element+ const target = { closest: () => null }+ const assertRetained = () => {+ expect(row().element).toBe(originalRow)+ expect(renderer.root.element.querySelector('[data-remote-image-kind="content"]')).toBe(image)+ expect(image.isConnected).toBe(true)+ expect(image).toHaveAttribute("src", "/same.png")+ expect(image).toHaveAttribute("data-remote-image-state", "ready")+ expect(image).toHaveClass("opacity-100")+ expect(onImageLoad).toHaveBeenCalledTimes("content" in fields ? 0 : 1)+ }+ for (let cycle = 0; cycle < 3; cycle++) {+ act(() => row().props.onPointerEnter({+ target,+ nativeEvent: { type: "pointerenter", pointerType: "mouse" },+ }))+ assertRetained()+ }+ act(() => renderer.root.findByType("mock-context-menu").props.onOpenChange(true))+ assertRetained()+ act(() => renderer.root.findByType("mock-context-menu").props.onOpenChange(false))+ act(() => row().props.onPointerDownCapture({+ target,+ button: 0,+ nativeEvent: { type: "pointerdown", pointerType: "touch" },+ }))+ assertRetained()+ const touchMenu = () => renderer.root.findAllByType("mock-dropdown-menu")+ .find((node) => typeof node.props.open === "boolean")!+ act(() => touchMenu().props.onOpenChange(true))+ expect(renderer.root.findByType("mock-context-menu").props.disabled).toBe(true)+ assertRetained()+ act(() => touchMenu().props.onOpenChange(false))+ act(() => row().props.onPointerEnter({+ target,+ nativeEvent: { type: "pointerenter", pointerType: "mouse" },+ }))+ assertRetained()+ renderer.rerender(makeTree({ ...props, selectMode: true }))+ expect(renderer.root.findByType("mock-context-menu").props.disabled).toBe(true)+ expect(renderer.root.element.querySelector('[data-remote-image-kind="content"]')).toBe(image)+ renderer.rerender(makeTree(props))+ assertRetained()+ renderer.rerender(makeTree({ ...props, hoverCapable: false }))+ assertRetained()+ renderer.rerender(makeTree(props))+ assertRetained()+ })+it.each([{ name: "attachment", fields: { attachments: [{ kind: "image" as const, name: "same.png", url: "/same.png" }] } },{ name: "embed", fields: { embeds: [{ image: { url: "/same.png", width: 320, height: 200 } }] } },@@ -1929,7 +2012,8 @@ describe("Message lazy overlays", () => {const target = { closest: () => authorButton }act(() => row.props.onPointerEnter({ target }))- expect(renderer!.root.findAllByType("mock-context-menu")).toHaveLength(0)+ expect(renderer!.root.findByType("mock-context-menu").props.disabled).toBe(true)+ expect(renderer!.root.findAllByType("mock-context-menu-content")).toHaveLength(0)const event = { clientX: 10, clientY: 20 }act(() => authorButton!.props.onClick(event))@@ -1937,7 +2021,7 @@ describe("Message lazy overlays", () => {expect(onOpenProfile).toHaveBeenCalledWith("Alice", event, undefined, "u1")})- it("keeps the context-menu root and toolbar lazy until activation", () => {+ it("keeps menu contents and toolbar lazy with a stable disabled root until activation", () => {const onOpenThread = vi.fn()let renderer: DomRendereract(() => {@@ -1949,7 +2033,8 @@ describe("Message lazy overlays", () => {})const json = renderer!.toJSON()const tree = JSON.stringify(json)- expect(tree).not.toContain("mock-context-menu")+ expect(renderer!.root.findByType("mock-context-menu").props.disabled).toBe(true)+ expect(tree).not.toContain("mock-context-menu-content")expect(tree).not.toContain("reaction-add")})diff --git a/src/web/src/components/community/messages/message.tsx b/src/web/src/components/community/messages/message.tsxindex 8e99b8967..b4835dcd9 100644--- a/src/web/src/components/community/messages/message.tsx+++ b/src/web/src/components/community/messages/message.tsx@@ -895,31 +895,48 @@ function MessageImpl({if (!interactive) return row- // Coarse/touch input: tap opens the existing dropdown menu. Deliberately do- // not mount ContextMenuTrigger here — its long-press gesture competes with- // native message-text selection on iOS/Android.- if (touchFallbackActive || touchMenuOpen) {- return (- <DropdownMenu- open={touchMenuOpen && !selectMode}- onOpenChange={(open) => {- setTouchMenuOpen(open && !selectMode)- if (!open) setLinkTarget(null)- }}- >- <div className="relative">- {swipeReplyEnabled && (- <div- aria-hidden- data-mobile-reply-affordance- data-threshold-crossed={swipeVisual.crossed || undefined}- className="absolute inset-y-0 left-0 z-0 flex w-14 items-center justify-center text-muted-foreground"- style={{ opacity: Math.min(1, swipeVisual.offset / 48) }}- >- <Reply className="size-5" />- </div>+ const touchMenuActive = touchFallbackActive || touchMenuOpen+ const contextMenuEnabled = activated && !selectMode && !touchMenuActive+ return (+ <DropdownMenu+ open={touchMenuOpen && !selectMode}+ onOpenChange={(open) => {+ setTouchMenuOpen(open && !selectMode)+ if (!open) setLinkTarget(null)+ }}+ >+ <div className="relative">+ {swipeReplyEnabled && (+ <div+ aria-hidden+ data-mobile-reply-affordance+ data-threshold-crossed={swipeVisual.crossed || undefined}+ className="absolute inset-y-0 left-0 z-0 flex w-14 items-center justify-center text-muted-foreground"+ style={{ opacity: Math.min(1, swipeVisual.offset / 48) }}+ >+ <Reply className="size-5" />+ </div>+ )}+ <ContextMenu+ disabled={!contextMenuEnabled}+ open={contextOpen && contextMenuEnabled}+ onOpenChange={(open) => {+ setContextOpen(open && contextMenuEnabled)+ if (!open) setLinkTarget(null)+ }}+ >+ <ContextMenuTrigger+ className="select-text"+ style={{ WebkitTouchCallout: "default" }}+ render={row}+ />+ {activated && !touchMenuActive && (+ <ContextMenuContent className="w-48">+ <MessageContextItems {...menuHandlers} {...linkMenuHandlers} />+ </ContextMenuContent>)}- {row}+ </ContextMenu>+ {touchMenuActive && (<DropdownMenuTriggerdisabled={selectMode}render={(@@ -931,7 +948,9 @@ function MessageImpl({/>)}/>- </div>+ )}+ </div>+ {touchMenuActive && (<DropdownMenuContentanchor={touchMenuAnchor ?? undefined}positionMethod="fixed"@@ -943,25 +962,8 @@ function MessageImpl({><MessageDropdownItems {...menuHandlers} {...linkMenuHandlers} touch /></DropdownMenuContent>- </DropdownMenu>- )- }-- if (!activated) return row- return (- <ContextMenu- disabled={selectMode}- open={contextOpen && !selectMode}- onOpenChange={(open) => {- setContextOpen(open && !selectMode)- if (!open) setLinkTarget(null)- }}- >- <ContextMenuTrigger className="select-text" render={row} />- <ContextMenuContent className="w-48">- <MessageContextItems {...menuHandlers} {...linkMenuHandlers} />- </ContextMenuContent>- </ContextMenu>+ )}+ </DropdownMenu>)}diff --git a/src/web/src/test/e2e-ui/23-message-selection-context-menu.spec.ts b/src/web/src/test/e2e-ui/23-message-selection-context-menu.spec.tsindex 08834d6ba..3df6560f8 100644--- a/src/web/src/test/e2e-ui/23-message-selection-context-menu.spec.ts+++ b/src/web/src/test/e2e-ui/23-message-selection-context-menu.spec.ts@@ -46,8 +46,6 @@ test("selected message text keeps the native context menu", async ({ caseActorsconst messageBody = row.locator("[data-community-message-body]")await expect(messageBody).toContainText(body)- // Message action overlays (including Base UI's context-menu trigger) mount- // lazily after hover. Reproduce the real pointer path before selecting text.await row.hover()const trigger = row.locator('[data-slot="context-menu-trigger"]')await expect(trigger).toHaveCount(1)diff --git a/src/web/src/test/e2e-ui/39-mobile-message-interactions.spec.ts b/src/web/src/test/e2e-ui/39-mobile-message-interactions.spec.tsindex ab909b580..6e134c014 100644--- a/src/web/src/test/e2e-ui/39-mobile-message-interactions.spec.ts+++ b/src/web/src/test/e2e-ui/39-mobile-message-interactions.spec.ts@@ -1,4 +1,5 @@import type { Locator, Page, Request, Route } from "@playwright/test"+import type { TiptapEditorHTMLElement } from "@tiptap/react"import { test, expect } from "./_fixtures/case-fixture"import {composerEditable,@@ -205,11 +206,55 @@ async function expectTouchActionMenu(}).toEqual({menuVisible: true,touchTriggerCount: 1,- contextTriggerCount: 0,+ contextTriggerCount: 1,})return action}+async function typeReplyAfterAuthorMention(+ page: Page,+ authorId: string,+ author: { name: string; discriminator: string },+ body: string,+) {+ const editable = composerEditable(page)+ const mention = editable.locator(`[data-type="mention"][data-id="${authorId}"]`)+ await expect(mention).toHaveCount(1)+ await expect(mention).toHaveAttribute("data-label", `${author.name}#${author.discriminator}`)+ await expect(editable).toHaveText(`@${author.name}`)+ await expect(editable).toBeFocused()+ const box = await editable.boundingBox()+ if (!box) throw new Error("reply editor has no box")+ await editable.tap({ position: { x: box.width - 1, y: box.height - 1 } })+ await expect.poll(() => editable.evaluate((element) => {+ const editor = (element as TiptapEditorHTMLElement).editor+ const selection = element.ownerDocument.getSelection()+ if (+ !editor+ || !selection?.isCollapsed+ || !selection.focusNode+ || !element.contains(selection.focusNode)+ ) return null+ const remaining = element.ownerDocument.createRange()+ remaining.selectNodeContents(element)+ remaining.setStart(selection.focusNode, selection.focusOffset)+ const nativePosition = editor.view.posAtDOM(selection.focusNode, selection.focusOffset, 1)+ const model = editor.state.selection+ return {+ ownsFocus: editor.view.dom === element && editor.view.hasFocus(),+ modelCollapsed: model.empty,+ nativePosition,+ modelPosition: model.head,+ positionsMatch: nativePosition === model.head,+ atEnd: remaining.toString() === "" && nativePosition === editor.state.doc.content.size - 1,+ }+ }), { message: "reply typing starts with native and editor carets after the author mention" })+ .toMatchObject({ ownsFocus: true, modelCollapsed: true, positionsMatch: true, atEnd: true })+ await page.keyboard.type(body)+ await expect(mention).toHaveCount(1)+ await expect(editable).toHaveText(`@${author.name} ${body}`)+}+async function latestSeq(page: Page, channelId: string): Promise<number> {const response = await page.request.get(`/api/community/channels/${channelId}/messages`)expect(response.ok()).toBe(true)@@ -359,6 +404,8 @@ test("same message row recovers its action menu from mouse to touch", async ({ cconst message = alice.page.getByTestId(tid.message(messageId))const body = message.getByText(`pointer modality ${stamp}`, { exact: true })await expect(body).toBeVisible()+ const originalBody = await body.elementHandle()+ expect(originalBody).not.toBeNull()const beforeSeq = await latestSeq(alice.page, channelId)const messageCreatesBefore = aliceProxy.frames.filter((frame) => (communityFrameEvents(frame).some((event) => event.type === "community:message.create")@@ -366,10 +413,13 @@ test("same message row recovers its action menu from mouse to touch", async ({ cawait body.click()await expect(alice.page.getByRole("menuitem")).toHaveCount(0, { timeout: 3_000 })+ expect(await body.evaluate((element, original) => element === original, originalBody)).toBe(true)await body.tap()const copyAction = await expectTouchActionMenu(alice.page, message, "Copy")+ expect(await body.evaluate((element, original) => element === original, originalBody)).toBe(true)await alice.page.keyboard.press("Escape")await expect(copyAction).toBeHidden({ timeout: 3_000 })+ expect(await body.evaluate((element, original) => element === original, originalBody)).toBe(true)expect(await latestSeq(alice.page, channelId)).toBe(beforeSeq)expect(aliceProxy.frames.filter((frame) => (@@ -407,6 +457,7 @@ test("mobile reply, avatar mention, and typing rail keep exact backend and WS id).join("\n\n"))const bobInfo = await memberInfo("alice", serverId, userId("bob"))const aliceInfo = await memberInfo("alice", serverId, userId("alice"))+ const replyAuthorMention = `@${bobInfo.name}#${bobInfo.discriminator}`const alice = await asUser("alice", { hasTouch: true })const bob = await asUser("bob")@@ -481,11 +532,12 @@ test("mobile reply, avatar mention, and typing rail keep exact backend and WS idawait expect(replyPreview).toHaveText(`Replying to ${bobInfo.name} · channel alternate ${stamp}`)await expect(composerEditable(alice.page).locator(`[data-type="mention"][data-id="${userId("bob")}"]`)).toHaveCount(1)const replyBody = `swipe reply ${stamp}`+ const replyContent = `${replyAuthorMention} ${replyBody}`const replyResponsePromise = alice.page.waitForResponse((response) => (response.request().method() === "POST"&& new URL(response.url()).pathname === `/api/community/channels/${channelId}/messages`))- await composerEditable(alice.page).fill(replyBody)+ await typeReplyAfterAuthorMention(alice.page, userId("bob"), bobInfo, replyBody)await alice.page.getByTestId(tid.composerSend).click()const replyResponse = await replyResponsePromiseexpect(replyResponse.status()).toBe(201)@@ -493,14 +545,18 @@ test("mobile reply, avatar mention, and typing rail keep exact backend and WS idmessage: { id: string; content: string; replyToId: string | null }}expect(replyPayload.message.replyToId).toBe(channelBobSecondMessageId)- expect(replyPayload.message.content).toBe(replyBody)+ expect(replyPayload.message.content).toBe(replyContent)await expect.poll(() => bobProxy.frames.some((frame) => (- frameHasMessage(frame, channelId, replyPayload.message.id)- && communityFrameEvents(frame).some((event) => (- (event.message as { replyTo?: { id: string } } | undefined)?.replyTo?.id === channelBobSecondMessageId+ communityFrameEvents(frame).some((event) => (+ event.type === "community:message.create"+ && event.channelId === channelId+ && event.message?.id === replyPayload.message.id+ && event.message.content === replyContent+ && (event.message as { replyTo?: { id: string } }).replyTo?.id === channelBobSecondMessageId)))), { timeout: 20_000 }).toBe(true)await expectMessageVisible(bob.page, replyBody)+ await expect(bob.page.getByTestId(tid.message(replyPayload.message.id))).toContainText(`@${bobInfo.name}`)await alice.page.goto(`/c/channels/${serverId}/${threadId}`, { waitUntil: "commit" })await bob.page.goto(`/c/channels/${serverId}/${threadId}`, { waitUntil: "commit" })@@ -576,11 +632,12 @@ test("mobile reply, avatar mention, and typing rail keep exact backend and WS idawait expect(replyPreview).toHaveText(`Replying to ${bobInfo.name} · thread target ${stamp}`)await expect(composerEditable(alice.page).locator(`[data-type="mention"][data-id="${userId("bob")}"]`)).toHaveCount(1)const threadReplyBody = `thread swipe reply ${stamp}`+ const threadReplyContent = `${replyAuthorMention} ${threadReplyBody}`const threadReplyResponsePromise = alice.page.waitForResponse((response) => (response.request().method() === "POST"&& new URL(response.url()).pathname === `/api/community/channels/${threadId}/messages`))- await composerEditable(alice.page).fill(threadReplyBody)+ await typeReplyAfterAuthorMention(alice.page, userId("bob"), bobInfo, threadReplyBody)await alice.page.getByTestId(tid.composerSend).click()const threadReplyResponse = await threadReplyResponsePromiseexpect(threadReplyResponse.status()).toBe(201)@@ -588,13 +645,19 @@ test("mobile reply, avatar mention, and typing rail keep exact backend and WS idmessage: { id: string; content: string; replyToId: string | null }}expect(threadReplyPayload.message.replyToId).toBe(threadBobMessageId)- expect(threadReplyPayload.message.content).toBe(threadReplyBody)+ expect(threadReplyPayload.message.content).toBe(threadReplyContent)await expect.poll(() => bobProxy.frames.some((frame) => (- frameHasMessage(frame, threadId, threadReplyPayload.message.id)- && communityFrameEvents(frame).some((event) => (- (event.message as { replyTo?: { id: string } } | undefined)?.replyTo?.id === threadBobMessageId+ communityFrameEvents(frame).some((event) => (+ event.type === "community:message.create"+ && event.channelId === threadId+ && event.message?.id === threadReplyPayload.message.id+ && event.message.content === threadReplyContent+ && (event.message as { replyTo?: { id: string } }).replyTo?.id === threadBobMessageId)))), { timeout: 20_000 }).toBe(true)+ const receivedThreadReply = bob.page.getByTestId(tid.message(threadReplyPayload.message.id))+ await expect(receivedThreadReply).toContainText(threadReplyBody)+ await expect(receivedThreadReply).toContainText(`@${bobInfo.name}`)await alice.page.goto(`/c/channels/${serverId}/${channelId}`, { waitUntil: "commit" })await bob.page.goto(`/c/channels/${serverId}/${channelId}`, { waitUntil: "commit" })@@ -794,11 +857,12 @@ test("mobile reply, avatar mention, and typing rail keep exact backend and WS idawait expect(composerEditable(alice.page).locator(`[data-type="mention"][data-id="${userId("bob")}"]`)).toHaveCount(1)await expect(composerEditable(alice.page)).toBeFocused()const dmReplyBody = `dm swipe reply ${stamp}`+ const dmReplyContent = `${replyAuthorMention} ${dmReplyBody}`const dmReplyResponsePromise = alice.page.waitForResponse((response) => (response.request().method() === "POST"&& new URL(response.url()).pathname === `/api/community/channels/${dmId}/messages`))- await composerEditable(alice.page).fill(dmReplyBody)+ await typeReplyAfterAuthorMention(alice.page, userId("bob"), bobInfo, dmReplyBody)await alice.page.getByTestId(tid.composerSend).click()const dmReplyResponse = await dmReplyResponsePromiseexpect(dmReplyResponse.status()).toBe(201)@@ -806,13 +870,19 @@ test("mobile reply, avatar mention, and typing rail keep exact backend and WS idmessage: { id: string; content: string; replyToId: string | null }}expect(dmReplyPayload.message.replyToId).toBe(dmWsReadyId)- expect(dmReplyPayload.message.content).toBe(dmReplyBody)+ expect(dmReplyPayload.message.content).toBe(dmReplyContent)await expect.poll(() => bobProxy.frames.some((frame) => (- frameHasMessage(frame, dmId, dmReplyPayload.message.id)- && communityFrameEvents(frame).some((event) => (- (event.message as { replyTo?: { id: string } } | undefined)?.replyTo?.id === dmWsReadyId+ communityFrameEvents(frame).some((event) => (+ event.type === "community:message.create"+ && event.channelId === dmId+ && event.message?.id === dmReplyPayload.message.id+ && event.message.content === dmReplyContent+ && (event.message as { replyTo?: { id: string } }).replyTo?.id === dmWsReadyId)))), { timeout: 20_000 }).toBe(true)+ const receivedDmReply = bob.page.getByTestId(tid.message(dmReplyPayload.message.id))+ await expect(receivedDmReply).toContainText(dmReplyBody)+ await expect(receivedDmReply).toContainText(`@${bobInfo.name}`)const beforeDmTypingSeq = await latestSeq(alice.page, dmId)const dmScrollerBeforeTyping = await settledScrollerGeometry(alice.page)const bobDmEditable = composerEditable(bob.page)