Skip to content

fix(site/src/pages/AgentsPage/components/ChatElements/tools): special-case Notion block logo in ToolIcon#26233

Draft
tracyjohnsonux wants to merge 1 commit into
mainfrom
quickfix-notion-icon-rendering
Draft

fix(site/src/pages/AgentsPage/components/ChatElements/tools): special-case Notion block logo in ToolIcon#26233
tracyjohnsonux wants to merge 1 commit into
mainfrom
quickfix-notion-icon-rendering

Conversation

@tracyjohnsonux

Copy link
Copy Markdown
Contributor

What

Minimal fix for the Notion MCP tool icon rendering as a featureless square in the agent chat timeline.

ToolIcon applies a brightness-0 dark:invert filter to every advertised MCP icon so external brand glyphs match the monochrome lucide style of the built-in tools. Notion advertises a "block" logo (notion-logo-block-*.svg) that ships a coloured backdrop with the glyph overlaid in the same SVG, so the silhouette filter collapses both layers into a solid square.

This PR routes URLs matching /notion-logo-block/i through a separate branch that renders the SVG in its natural colours inside a small rounded badge frame. Everything else keeps the existing monochrome path.

Why a comparison PR

This is intentionally the smallest possible change so the team can compare it against the broader architectural fix in #26228 before picking a direction.

This PR #26228
Scope ToolIcon only ToolIcon, ExternalImage defaults, MCP admin form, bundled icons, known-server registry
Files changed 2 11
Notion fix regex special case in ToolIcon bundled notion.svg registered as monochrome + unified ExternalImage pipeline
Linear / Figma washout in dark mode unchanged fixed via bundled icons and defaultParametersForBuiltinIcons
Admin UX unchanged URL prefills displayName, slug, iconURL for known MCP hosts; clearing the icon restores the bundled default
New regression coverage 1 story (MCPToolNotionIcon) 4 stories across Tool.stories.tsx and MCPServerAdminPanel.stories.tsx

The regex approach is brittle (every new vendor that ships a composite block logo needs another entry), but it lands the Notion-only fix immediately without touching the form or shipping new assets. Land whichever direction the team prefers; close the other.

Test plan

  • pnpm exec biome check clean on the changed files.
  • pnpm exec tsc --noEmit -p tsconfig.json clean.
  • pnpm test:storybook run src/pages/AgentsPage/components/ChatElements/tools/Tool.stories.tsx -> 114 / 114 passing, including the new MCPToolNotionIcon story that asserts the rendered <img> keeps the block-logo URL, drops brightness-0 and dark:invert, and sits inside a rounded-sm frame.
Decision log
  • Started with the regex special case but rejected it as the primary fix in fix(site): bundle Notion/Linear/Figma icons and unify tool icon rendering #26228 after pushback ("is special casing it the right solution?"). fix(site): bundle Notion/Linear/Figma icons and unify tool icon rendering #26228 instead bundles notion.svg, linear.svg, and two Figma variants in site/static/icon/, registers the monochrome variants in defaultParametersForBuiltinIcons, drops the class-based filter in ToolIcon, and adds a URL-host knownMcpServers registry that prefills the MCP admin form.
  • Reopened the regex approach in this PR specifically so the team can review both side by side before merging either.
  • The regression story uses findByAltText("notion__fetch icon") rather than getByRole("img") so it survives sibling icons in the row, and asserts on the parent's rounded-sm class to lock in the badge frame.

This PR was generated by Coder Agents.

…-case Notion block logo in ToolIcon

The MCP tool icon pipeline applies a `brightness-0 dark:invert` filter to
every advertised icon so external brand glyphs match the monochrome lucide
style of the built-in tools. Notion's MCP server advertises a "block" logo
(`notion-logo-block-*.svg`) that ships a coloured backdrop with the glyph
overlaid in the same SVG, so the silhouette filter collapses both layers
into a featureless square.

Route URLs matching `/notion-logo-block/i` through a separate branch that
renders the SVG in its natural colours inside a small rounded badge frame.
Everything else keeps the existing monochrome path.

Add a `MCPToolNotionIcon` regression story that asserts the rendered img
keeps the block-logo URL, drops the silhouette classes, and sits inside
the rounded badge frame.

This is a minimal targeted fix. PR #26228 takes the alternative approach
of bundling Notion (plus Linear and Figma) icons in `site/static/icon/`,
routing every tool icon through the single `ExternalImage` pipeline, and
prefilling MCP server form fields from a known-server registry keyed on
URL host. Land whichever direction the team prefers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant