Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
fix(ok): show registry agent icons in dark mode (#3058)
sarah3b465803d245
diff --git a/.changeset/agent-icons-dark-mode.md b/.changeset/agent-icons-dark-mode.mdnew file mode 100644index 000000000..e30ac5784--- /dev/null+++ b/.changeset/agent-icons-dark-mode.md@@ -0,0 +1,25 @@+---+'@inkeep/open-knowledge': patch+---++Show agent icons in dark mode instead of near-invisible black marks.++Most of the agents in the catalog rendered as a black smudge on a dark+background: Devin, DeepAgents, Factory Droid, Cortex Code, Dirac, fast-agent and+every other agent whose icon comes from the ACP registry. Only Claude, Codex and+Cursor looked right, because those three are the ones the app draws itself.++The registry requires every icon to be a monochrome SVG painted with+`currentColor`, so it can take the color of whatever surface it sits on. Loading+one through an `<img>` tag defeats that: the SVG becomes its own document, and+`currentColor` there falls back to black no matter what the app's theme is. The+icons now lift to white on dark themes. Light themes are unchanged.++This covers every place these icons appear, not just the settings list: the+agent launcher menus, the composer, the terminal's new-chat picker, thread+history, and the thread empty state.++The bug report dialog also got a pass. It is wider, its "Previous reports"+disclosure has room around the label on hover rather than a background flush+against the text, and expanding it no longer leaves that background stuck on+while the list is open.diff --git a/packages/app/src/components/BugReportHistory.tsx b/packages/app/src/components/BugReportHistory.tsxindex 518e40b6e..d6e7fc10c 100644--- a/packages/app/src/components/BugReportHistory.tsx+++ b/packages/app/src/components/BugReportHistory.tsx@@ -318,7 +318,28 @@ export function BugReportPreviousReports() {return (<Collapsible open={open} onOpenChange={setOpen}><CollapsibleTrigger asChild>- <Button variant="ghost" size="sm" className="h-auto w-full justify-between px-0 py-1">+ {/* The hover surface needs breathing room around the label, but the+ label has to stay flush with the report rows below. Padding paired+ with an equal negative margin buys the padding without moving the+ text. The width has to grow by the same 1rem explicitly: a `<button>`+ resolves `width: auto` to fit-content even at `display: flex`, so+ plain `w-full` would leave the surface 8px short on the right while+ the negative margin pulled it 8px left. The vertical pair nets out to+ the original `py-1`, leaving the row's own height unchanged.++ The ghost variant's `data-[state=open]:bg-muted` would leave the+ surface filled for as long as the disclosure stays expanded, which+ reads as a stuck hover next to the rows it just revealed. Dropping+ it back to transparent keeps the fill a hover/focus affordance;+ the rotated chevron already carries the open state. The paired+ `data-[state=open]:hover:` is required, not belt-and-braces: the+ open-state rule otherwise outranks the variant's plain `hover:` and+ hovering an expanded row goes dead. */}+ <Button+ variant="ghost"+ size="sm"+ className="-mx-2 -my-0.5 h-auto w-[calc(100%+1rem)] justify-between px-2 py-1.5 data-[state=open]:bg-transparent data-[state=open]:hover:bg-muted"+ ><span className="text-sm font-medium"><Trans>Previous reports</Trans>{' '}<span className="font-normal text-muted-foreground">({history.reports.length})</span>diff --git a/packages/app/src/components/DocumentErrorBoundary.tsx b/packages/app/src/components/DocumentErrorBoundary.tsxindex d8b214ebe..8c377e4bc 100644--- a/packages/app/src/components/DocumentErrorBoundary.tsx+++ b/packages/app/src/components/DocumentErrorBoundary.tsx@@ -215,7 +215,7 @@ function DocumentErrorFallback({</Button>{restartBridge ? (<Button- variant="secondary"+ variant="outline-mono"onClick={() => {restartCollabServer(restartBridge).then((result) => {diff --git a/packages/app/src/components/ReportBugDialogBody.tsx b/packages/app/src/components/ReportBugDialogBody.tsxindex 13c30b64e..05ccb031b 100644--- a/packages/app/src/components/ReportBugDialogBody.tsx+++ b/packages/app/src/components/ReportBugDialogBody.tsx@@ -418,7 +418,7 @@ function ReportBugDialog({return (<Dialog open={open} onOpenChange={handleOpenChange}>- <DialogContent className="sm:max-w-xl" showCloseButton={!sending}>+ <DialogContent className="sm:max-w-2xl" showCloseButton={!sending}>{phase.step === 'compose' && (<><DialogHeader>diff --git a/packages/app/src/components/acp/RegisteredAgentIcon.dom.test.tsx b/packages/app/src/components/acp/RegisteredAgentIcon.dom.test.tsxindex 0e73a0921..df89c01ee 100644--- a/packages/app/src/components/acp/RegisteredAgentIcon.dom.test.tsx+++ b/packages/app/src/components/acp/RegisteredAgentIcon.dom.test.tsx@@ -1,4 +1,4 @@-import { cleanup, render } from '@testing-library/react';+import { cleanup, fireEvent, render } from '@testing-library/react';import { afterEach, describe, expect, test } from 'vitest';import { RegisteredAgentIcon } from './RegisteredAgentIcon';@@ -65,4 +65,34 @@ describe('RegisteredAgentIcon', () => {'https://example.com/gemini.svg',);});++ test('inverts the registry image on dark themes so black marks stay visible', () => {+ // A registry SVG loaded as an image is its own document, so its+ // `currentColor` marks resolve to black — invisible on a dark background+ // unless the dark theme lifts them.+ const { container } = render(+ <RegisteredAgentIcon+ agentId="gemini"+ iconUrl="https://example.com/gemini.svg"+ className="size-4"+ />,+ );++ expect(container.querySelector('img')?.getAttribute('class')).toContain('dark:invert');+ });++ test('falls back to the neutral glyph when the registry image fails to load', () => {+ const { container } = render(+ <RegisteredAgentIcon+ agentId="gemini"+ iconUrl="https://example.com/gone.svg"+ className="size-4"+ />,+ );++ fireEvent.error(container.querySelector('img') as HTMLImageElement);++ expect(container.querySelector('img')).toBeNull();+ expect(container.querySelector('svg')).not.toBeNull();+ });});diff --git a/packages/app/src/components/acp/RegisteredAgentIcon.tsx b/packages/app/src/components/acp/RegisteredAgentIcon.tsxindex 7da4dab1a..4d5dac5d9 100644--- a/packages/app/src/components/acp/RegisteredAgentIcon.tsx+++ b/packages/app/src/components/acp/RegisteredAgentIcon.tsx@@ -2,6 +2,21 @@* Registered-agent brand icon shared by every ACP surface. First-party agents* use the app's local brand treatment; every other registry/custom agent keeps* its manifest SVG with a neutral-glyph fallback on load failure.+ *+ * The registry's manifest SVGs are monochrome `currentColor` marks by contract+ * — the registry's own CI rejects an icon carrying any hardcoded color. Loaded+ * through `<img src>` an SVG is an isolated document, so `currentColor`+ * resolves against that document's initial `color: black`: every mark paints+ * black and all but disappears on a dark background. `dark:invert` lifts those+ * black marks to white, which is what the contract asks for on a dark theme.+ *+ * Inverting is the crude form of the fix; painting the SVG as an alpha mask+ * over `bg-current` would give the glyph the row's own text color and track+ * muted/hover states too. That needs same-origin bytes — the registry CDN+ * serves these icons with no `Access-Control-Allow-Origin`, and a mask image+ * load is CORS-checked where an `<img>` load is not — so it would have to wait+ * on the server proxying or inlining the icon (as `link-preview` already does+ * for favicons).*/import { Bot } from 'lucide-react';@@ -55,7 +70,7 @@ export function RegisteredAgentIcon({src={iconUrl}alt=""aria-hidden="true"- className={cn('shrink-0 rounded', className)}+ className={cn('shrink-0 rounded dark:invert', className)}onError={() => setFailed(true)}/>);