diff --git a/apps/mobile/src/features/threads/ComposerCommandPopover.tsx b/apps/mobile/src/features/threads/ComposerCommandPopover.tsx index ccf6a307122..f95c155c527 100644 --- a/apps/mobile/src/features/threads/ComposerCommandPopover.tsx +++ b/apps/mobile/src/features/threads/ComposerCommandPopover.tsx @@ -7,6 +7,7 @@ import { Pressable, ScrollView, useColorScheme, View, type ViewStyle } from "rea import { AppText as Text } from "../../components/AppText"; import { PierreEntryIcon } from "../../components/PierreEntryIcon"; +import { composerCommandEmptyText } from "./composerCommandPopoverText"; export type ComposerCommandItem = | { readonly id: string; @@ -59,7 +60,7 @@ function PopoverSurface(props: { if (isLiquidGlassSupported) { return ( void; readonly isLast: boolean; + readonly isDarkMode: boolean; }) { const iconName = itemIcon(props.item); const iconColor = "#a1a1aa"; @@ -146,7 +132,7 @@ const CommandRow = memo(function CommandRow(props: { gap: 10, opacity: pressed ? 0.6 : 1, borderBottomWidth: props.isLast ? 0 : 0.5, - borderBottomColor: "rgba(255,255,255,0.1)", + borderBottomColor: props.isDarkMode ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)", })} > {props.item.type === "path" ? ( @@ -193,13 +179,14 @@ export const ComposerCommandPopover = memo(function ComposerCommandPopover( item={item} onPress={() => props.onSelect(item)} isLast={index === props.items.length - 1} + isDarkMode={isDarkMode} /> ))} ) : ( - {emptyText(props.triggerKind, props.isLoading)} + {composerCommandEmptyText(props.triggerKind, props.isLoading)} )} diff --git a/apps/mobile/src/features/threads/composerCommandPopoverText.test.ts b/apps/mobile/src/features/threads/composerCommandPopoverText.test.ts new file mode 100644 index 00000000000..26ec8a45a95 --- /dev/null +++ b/apps/mobile/src/features/threads/composerCommandPopoverText.test.ts @@ -0,0 +1,17 @@ +import { describe, expect, it } from "vite-plus/test"; + +import { composerCommandEmptyText } from "./composerCommandPopoverText"; + +describe("composerCommandEmptyText", () => { + it("uses legible loading copy for path and command searches", () => { + expect(composerCommandEmptyText("path", true)).toBe("Searching files…"); + expect(composerCommandEmptyText("slash-command", true)).toBe("Loading…"); + }); + + it("uses trigger-specific empty copy", () => { + expect(composerCommandEmptyText("path", false)).toBe("No matching files or folders."); + expect(composerCommandEmptyText("skill", false)).toBe("No skills found."); + expect(composerCommandEmptyText("slash-command", false)).toBe("No matching commands."); + expect(composerCommandEmptyText(null, false)).toBe("No results."); + }); +}); diff --git a/apps/mobile/src/features/threads/composerCommandPopoverText.ts b/apps/mobile/src/features/threads/composerCommandPopoverText.ts new file mode 100644 index 00000000000..3a5b5298d86 --- /dev/null +++ b/apps/mobile/src/features/threads/composerCommandPopoverText.ts @@ -0,0 +1,21 @@ +import type { ComposerTriggerKind } from "@t3tools/shared/composerTrigger"; + +export function composerCommandEmptyText( + triggerKind: ComposerTriggerKind | null, + isLoading: boolean, +): string { + if (isLoading) { + return triggerKind === "path" ? "Searching files…" : "Loading…"; + } + + switch (triggerKind) { + case "path": + return "No matching files or folders."; + case "skill": + return "No skills found."; + case "slash-command": + return "No matching commands."; + default: + return "No results."; + } +}