Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(chat): keep "+ Custom" inverting and drop no-op changes

Manas Raghuwanshif30c856f5dc8
diff --git a/apps/screenpipe-app-tauri/components/chat/standalone/connect-apps-nudge.test.tsx b/apps/screenpipe-app-tauri/components/chat/standalone/connect-apps-nudge.test.tsx
index f859a1846..9cedd80b8 100644
--- a/apps/screenpipe-app-tauri/components/chat/standalone/connect-apps-nudge.test.tsx
+++ b/apps/screenpipe-app-tauri/components/chat/standalone/connect-apps-nudge.test.tsx
@@ -92,7 +92,9 @@ describe("ConnectAppsNudge", () => {
expect(tile).not.toHaveAttribute("title");
act(() => tile.focus());
- expect(await screen.findByRole("tooltip")).toHaveTextContent("Connect Slack");
+ // The name alone: the button's label already says "Connect Slack", and
+ // the tooltip is read again as its description.
+ expect((await screen.findByRole("tooltip")).textContent).toBe("Slack");
});
it("hides logos that wrap off the first line in a narrow pane", () => {
@@ -103,20 +105,23 @@ describe("ConnectAppsNudge", () => {
return this.getAttribute("aria-label") === "Connect Notion" ? 34 : 0;
});
- render(
- <ConnectAppsNudge
- banner={{
- show: true,
- suggestedConnectionTiles: [
- { id: "slack", name: "Slack", icon: "slack" },
- { id: "notion", name: "Notion", icon: "notion" },
- ] as any,
- onOpenConnectionSetup: vi.fn(),
- onDismiss: vi.fn(),
- }}
- />,
- );
- offsetTop.mockRestore();
+ try {
+ render(
+ <ConnectAppsNudge
+ banner={{
+ show: true,
+ suggestedConnectionTiles: [
+ { id: "slack", name: "Slack", icon: "slack" },
+ { id: "notion", name: "Notion", icon: "notion" },
+ ] as any,
+ onOpenConnectionSetup: vi.fn(),
+ onDismiss: vi.fn(),
+ }}
+ />,
+ );
+ } finally {
+ offsetTop.mockRestore();
+ }
expect(screen.getByRole("button", { name: "Connect Slack" })).not.toHaveClass("invisible");
expect(screen.getByRole("button", { name: "Connect Notion" })).toHaveClass("invisible");
diff --git a/apps/screenpipe-app-tauri/components/chat/standalone/connect-apps-nudge.tsx b/apps/screenpipe-app-tauri/components/chat/standalone/connect-apps-nudge.tsx
index 2b8137892..6f2f988d9 100644
--- a/apps/screenpipe-app-tauri/components/chat/standalone/connect-apps-nudge.tsx
+++ b/apps/screenpipe-app-tauri/components/chat/standalone/connect-apps-nudge.tsx
@@ -63,7 +63,7 @@ export function ConnectAppsNudge({
className="group/connect flex min-w-[8.5rem] flex-1 items-center justify-between gap-3 rounded-md px-2.5 py-1.5 text-left text-muted-foreground transition-colors duration-150 ease-out hover:bg-foreground hover:text-background focus-visible:bg-foreground focus-visible:text-background focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-signal focus-visible:ring-offset-1 focus-visible:ring-offset-background motion-reduce:transition-none"
>
<span className="truncate font-mono text-[10px] font-semibold normal-case tracking-[0.12em]">
- {ui("Connect apps for better answers")}
+ Connect apps for better answers
</span>
<ArrowRight className="h-3.5 w-3.5 shrink-0 transition-transform duration-150 group-hover/connect:translate-x-0.5 motion-reduce:transform-none motion-reduce:transition-none" />
</button>
@@ -81,13 +81,12 @@ export function ConnectAppsNudge({
>
{tiles.map((connection, index) => {
const icon = connection.icon || connection.id;
- const label = ui("Connect {value1}", { value1: connection.name });
return (
<Tooltip key={connection.id}>
<TooltipTrigger asChild>
<button
type="button"
- aria-label={label}
+ aria-label={ui("Connect {value1}", { value1: connection.name })}
onClick={() => banner.onOpenConnectionSetup(connection.id)}
className={cn(
"group/tile flex h-[30px] w-[30px] shrink-0 items-center justify-center rounded-md text-foreground transition-colors duration-150 ease-out hover:bg-foreground focus-visible:bg-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-signal focus-visible:ring-offset-1 focus-visible:ring-offset-background motion-reduce:transition-none",
@@ -110,20 +109,22 @@ export function ConnectAppsNudge({
</TooltipTrigger>
{/* Moving to the next logo swaps the label at once.
Fading here showed the old label fading out beside
- the new one; only the first label fades in. */}
+ the new one; only the first label fades in. The name
+ alone, since screen readers already announce the
+ button's "Connect …" label. */}
<TooltipContent
side="top"
sideOffset={6}
className="rounded-md px-2.5 py-1.5 text-[11px] font-normal data-[state=closed]:!animate-none data-[state=instant-open]:!animate-none"
>
- {label}
+ {connection.name}
</TooltipContent>
</Tooltip>
);
})}
</div>
</TooltipProvider>
- {fittingTiles > 0 && divider}
+ {divider}
</>
)}
<button
diff --git a/apps/screenpipe-app-tauri/components/chat/summary-cards.test.tsx b/apps/screenpipe-app-tauri/components/chat/summary-cards.test.tsx
index c961a5368..a32be346b 100644
--- a/apps/screenpipe-app-tauri/components/chat/summary-cards.test.tsx
+++ b/apps/screenpipe-app-tauri/components/chat/summary-cards.test.tsx
@@ -215,7 +215,7 @@ describe("SummaryCards", () => {
}
});
- it("keeps the dashed Custom slot outlined on hover instead of inverting it", () => {
+ it("inverts the dashed Custom slot on hover without hiding its dashes", () => {
render(
<SummaryCards
onSendMessage={vi.fn()}
@@ -227,9 +227,18 @@ describe("SummaryCards", () => {
);
const custom = screen.getByTestId("custom-summary-open");
- expect(custom).toHaveClass("border-dashed", "hover:bg-card", "focus-visible:bg-card");
- // A solid fill would hide the dashes that mark it as an empty slot.
- expect(custom.className).not.toMatch(/(hover|focus-visible):bg-foreground/);
+ // Hover inverts, as for every other chip.
+ expect(custom).toHaveClass(
+ "border-dashed",
+ "hover:bg-foreground",
+ "hover:text-background",
+ "focus-visible:bg-foreground",
+ "focus-visible:text-background",
+ );
+ // Dashes in the fill's colour vanish, leaving a solid block, so they take
+ // the background colour instead.
+ expect(custom).toHaveClass("hover:border-background/50", "focus-visible:border-background/50");
+ expect(custom.className).not.toMatch(/(hover|focus-visible):border-foreground/);
expect(custom.className).toContain("motion-reduce:transition-none");
});
diff --git a/apps/screenpipe-app-tauri/components/chat/summary-cards.tsx b/apps/screenpipe-app-tauri/components/chat/summary-cards.tsx
index 4b5ea7039..cb917ceff 100644
--- a/apps/screenpipe-app-tauri/components/chat/summary-cards.tsx
+++ b/apps/screenpipe-app-tauri/components/chat/summary-cards.tsx
@@ -426,8 +426,9 @@ export function SummaryCards({
/>
</div>
))}
- {/* An empty slot, not a ready action: hover fills it in as a card
- instead of inverting, so the dashed outline still reads as "add". */}
+ {/* An empty slot, not a ready action. Hover inverts like the other
+ chips, but the dashes take the background colour: in the fill's
+ colour they vanish and the slot reads as a solid block. */}
<button
type="button"
onClick={() => {
@@ -435,9 +436,9 @@ export function SummaryCards({
setShowBuilder(true);
}}
data-testid="custom-summary-open"
- className="h-10 min-w-[148px] flex-1 cursor-pointer rounded-md border border-dashed border-foreground/25 px-1 text-[11px] text-muted-foreground transition-colors duration-150 ease-out hover:border-foreground/60 hover:bg-card hover:text-foreground focus-visible:border-foreground/60 focus-visible:bg-card focus-visible:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-foreground focus-visible:ring-offset-1 focus-visible:ring-offset-background active:bg-muted motion-reduce:transition-none"
+ className="h-10 min-w-[148px] flex-1 cursor-pointer rounded-md border border-dashed border-foreground/25 px-1 text-[11px] text-muted-foreground transition-colors duration-150 ease-out hover:border-background/50 hover:bg-foreground hover:text-background focus-visible:border-background/50 focus-visible:bg-foreground focus-visible:text-background focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-foreground focus-visible:ring-offset-1 focus-visible:ring-offset-background motion-reduce:transition-none"
>
- {ui("+ Custom")}
+ + Custom
</button>
</div>
diff --git a/apps/screenpipe-app-tauri/components/rewind/ai-presets-selector.tsx b/apps/screenpipe-app-tauri/components/rewind/ai-presets-selector.tsx
index b36cdfe7c..52f734772 100644
--- a/apps/screenpipe-app-tauri/components/rewind/ai-presets-selector.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/ai-presets-selector.tsx
@@ -1880,7 +1880,7 @@ export const AIPresetsSelector = ({
<div className="flex items-center gap-2 p-2 text-sm bg-muted border border-border rounded-lg">
<AlertTriangle className="h-4 w-4 text-muted-foreground shrink-0" />
<span className="text-foreground flex-1">
- {ui("Login required to use Screenpipe Cloud")}
+ Login required to use Screenpipe Cloud
</span>
{showLoginCta && (
<Button
@@ -1892,7 +1892,7 @@ export const AIPresetsSelector = ({
}}
>
<LogIn className="h-3 w-3 mr-1" />
- {ui("Login")}
+ Login
</Button>
)}
</div>
@@ -1916,6 +1916,7 @@ export const AIPresetsSelector = ({
className={cn(
"w-full justify-between hover:bg-accent hover:text-accent-foreground",
compact && "h-8 text-xs",
+ selectedPresetRequiresLogin && "border-amber-500/50",
triggerClassName
)}
>
@@ -1926,7 +1927,7 @@ export const AIPresetsSelector = ({
providerIconOnly && "justify-center",
)}>
{selectedPresetRequiresLogin && (
- <AlertTriangle className="h-4 w-4 text-muted-foreground shrink-0" />
+ <AlertTriangle className="h-4 w-4 text-amber-500 shrink-0" />
)}
{/* The model name tells people what is selected; the
real colored mark makes the provider scannable when
@@ -2001,7 +2002,7 @@ export const AIPresetsSelector = ({
<div className="flex w-full items-center justify-between gap-2 overflow-hidden min-w-0">
<div className="flex items-center gap-2 min-w-0 flex-shrink overflow-hidden">
{selectedPresetRequiresLogin && (
- <AlertTriangle className="h-4 w-4 text-muted-foreground shrink-0" />
+ <AlertTriangle className="h-4 w-4 text-amber-500 shrink-0" />
)}
<span className="font-medium truncate text-left">
{formatPresetName(selectedPresetData?.id || '')}
@@ -2029,10 +2030,10 @@ export const AIPresetsSelector = ({
</PopoverTrigger>
<TooltipContent>
{providerIconOnly ? (
- <p>{ui("{value1} · switch provider", { value1: selectedProviderName })}</p>
+ <p>{selectedProviderName} · switch provider</p>
) : selectedPresetRequiresLogin ? (
<p className="text-muted-foreground">
- {ui("Login required to use this preset")}
+ Login required to use this preset
</p>
) : (
<p className="flex items-center gap-2">
@@ -2056,7 +2057,7 @@ export const AIPresetsSelector = ({
<Command>
<CommandInput placeholder={ui("Search presets...")} />
<CommandList>
- <CommandEmpty>{ui("No presets found.")}</CommandEmpty>
+ <CommandEmpty>No presets found.</CommandEmpty>
{allowNone && (
<CommandGroup>
<CommandItem
diff --git a/apps/screenpipe-app-tauri/components/settings/__tests__/integration-icon-keys.test.ts b/apps/screenpipe-app-tauri/components/settings/__tests__/integration-icon-keys.test.ts
index 5fc6d0526..11eed03ca 100644
--- a/apps/screenpipe-app-tauri/components/settings/__tests__/integration-icon-keys.test.ts
+++ b/apps/screenpipe-app-tauri/components/settings/__tests__/integration-icon-keys.test.ts
@@ -75,7 +75,7 @@ describe("brand marks in dark mode", () => {
// The dark card, #141414: the lightest surface these logos sit on.
const contrastOnDark = (hex: string) => (luminance(hex) + 0.05) / (luminance("#141414") + 0.05);
- it("keeps every flat-colour logo readable on the dark canvas", () => {
+ it("keeps every inline flat-colour logo readable on the dark canvas", () => {
const unreadable = [...INTEGRATION_ICON_KEYS].filter((icon) => {
const markup = renderToStaticMarkup(createElement(IntegrationIcon, { icon, className: "" }));
const fills = [...markup.matchAll(/fill="(#[0-9a-f]{3}|#[0-9a-f]{6})"/gi)].map((m) => m[1]);
@@ -84,6 +84,13 @@ describe("brand marks in dark mode", () => {
});
expect(unreadable).toEqual([]);
});
+
+ // The scan above can't see inside <img> files, so Odoo's dark ring would
+ // lose its plate unnoticed. Pin the known dark marks directly.
+ it.each(["odoo", "sentry", "zendesk"])("puts %s on a light plate in dark mode", (icon) => {
+ const markup = renderToStaticMarkup(createElement(IntegrationIcon, { icon, className: "" }));
+ expect(markup).toContain("dark:bg-white");
+ });
});
describe("isMcpOAuthProviderTileConnected", () => {