Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
fix(web): show bot and group message actions on touch (#238)
Leobccff9a36478
diff --git a/apps/web/src/components/roster/BotThreadLanding.markdown.test.ts b/apps/web/src/components/roster/BotThreadLanding.markdown.test.tsindex f08044de6..4cd7fca83 100644--- a/apps/web/src/components/roster/BotThreadLanding.markdown.test.ts+++ b/apps/web/src/components/roster/BotThreadLanding.markdown.test.ts@@ -3,6 +3,20 @@ import * as NodeFS from "node:fs";import { describe, expect, it } from "vite-plus/test";+function messageBlocks(source: string, testId: string): string[] {+ const marker = `data-testid="${testId}"`;+ const blocks: string[] = [];+ let from = 0;+ while (true) {+ const start = source.indexOf(marker, from);+ if (start < 0) break;+ const nextTestId = source.indexOf('data-testid="', start + marker.length);+ blocks.push(source.slice(start, nextTestId < 0 ? source.length : nextTestId));+ from = start + marker.length;+ }+ return blocks;+}+describe("BotThreadLanding message formatting", () => {it("renders assistant messages with the shared rich markdown component", () => {const entries = [@@ -63,6 +77,33 @@ describe("BotThreadLanding message formatting", () => {}});+ it("keeps message actions visible for coarse pointers without dropping reply controls", () => {+ const cases = [+ ["BotThreadLanding.tsx", "bot-provider-message"],+ ["BotThreadLanding.tsx", "bot-user-message"],+ ["GroupThreadLanding.tsx", "group-provider-message"],+ ["GroupThreadLanding.tsx", "group-user-message"],+ ] as const;++ for (const [file, testId] of cases) {+ const source = NodeFS.readFileSync(new URL(`./${file}`, import.meta.url), "utf8");+ const blocks = messageBlocks(source, testId);+ expect(blocks.length).toBeGreaterThan(0);++ for (const block of blocks) {+ expect(block).toContain("<MessageControls");+ expect(block).toContain("pointer-coarse:opacity-100");+ expect(block).toContain("onReply=");+ if (testId.endsWith("-provider-message")) {+ expect(block).toContain("readAloud");+ }+ if (!block.includes("Unavailable bot")) {+ expect(block).toContain("onReactionChange=");+ }+ }+ }+ });+it("mounts the voice action in the live bot chat header", () => {const source = NodeFS.readFileSync(new URL("./BotThreadLanding.tsx", import.meta.url), "utf8");diff --git a/apps/web/src/components/roster/BotThreadLanding.tsx b/apps/web/src/components/roster/BotThreadLanding.tsxindex 79e11234e..51f1e9483 100644--- a/apps/web/src/components/roster/BotThreadLanding.tsx+++ b/apps/web/src/components/roster/BotThreadLanding.tsx@@ -322,7 +322,7 @@ export function BotThreadLanding({ botId }: { readonly botId: string }) {?.map(({ id, result }) => (<PluginSearchResultCard className="mt-3" key={id} result={result} />))}- <div className="mt-1 flex opacity-0 transition-opacity focus-within:opacity-100 group-hover/message:opacity-100 max-md:opacity-100">+ <div className="mt-1 flex opacity-0 transition-opacity pointer-coarse:opacity-100 focus-within:opacity-100 group-hover/message:opacity-100 max-md:opacity-100"><MessageControlscopyText={message.text || "Attachment"}{...(() => {@@ -376,7 +376,7 @@ export function BotThreadLanding({ botId }: { readonly botId: string }) {className="group/message flex items-end justify-end gap-1"data-testid="bot-user-message">- <div className="opacity-0 transition-opacity focus-within:opacity-100 group-hover/message:opacity-100 max-md:opacity-100">+ <div className="opacity-0 transition-opacity pointer-coarse:opacity-100 focus-within:opacity-100 group-hover/message:opacity-100 max-md:opacity-100"><MessageControlsalign="end"copyText={diff --git a/apps/web/src/components/roster/GroupThreadLanding.tsx b/apps/web/src/components/roster/GroupThreadLanding.tsxindex a2c27563b..7538d59dd 100644--- a/apps/web/src/components/roster/GroupThreadLanding.tsx+++ b/apps/web/src/components/roster/GroupThreadLanding.tsx@@ -183,7 +183,7 @@ export function GroupThreadLanding({ groupId }: { readonly groupId: string }) {return (<divkey={message.id}- className="max-w-[85%]"+ className="group/message max-w-[85%]"data-testid="group-provider-message"><div className="text-sm font-medium">Unavailable bot</div>@@ -193,7 +193,7 @@ export function GroupThreadLanding({ groupId }: { readonly groupId: string }) {text={message.text}threadRef={runtime.linkedThreadRef ?? undefined}/>- <div className="mt-1">+ <div className="mt-1 flex opacity-0 transition-opacity pointer-coarse:opacity-100 focus-within:opacity-100 group-hover/message:opacity-100 max-md:opacity-100"><MessageControlscopyText={message.text || "Attachment"}{...(() => {@@ -234,7 +234,7 @@ export function GroupThreadLanding({ groupId }: { readonly groupId: string }) {text={message.text}threadRef={runtime.linkedThreadRef ?? undefined}/>- <div className="mt-1 flex opacity-0 transition-opacity focus-within:opacity-100 group-hover/message:opacity-100 max-md:opacity-100">+ <div className="mt-1 flex opacity-0 transition-opacity pointer-coarse:opacity-100 focus-within:opacity-100 group-hover/message:opacity-100 max-md:opacity-100"><MessageControlscopyText={message.text || "Attachment"}{...(() => {@@ -280,7 +280,7 @@ export function GroupThreadLanding({ groupId }: { readonly groupId: string }) {className="group/message flex items-end justify-end gap-1"data-testid="group-user-message">- <div className="opacity-0 transition-opacity focus-within:opacity-100 group-hover/message:opacity-100 max-md:opacity-100">+ <div className="opacity-0 transition-opacity pointer-coarse:opacity-100 focus-within:opacity-100 group-hover/message:opacity-100 max-md:opacity-100"><MessageControlsalign="end"copyText={