fix(mcp): align mcp server icons#2539
Conversation
Let card grids grow and wrap naturally instead of staying locked to fixed two-column breakpoints. This keeps card layouts usable across a wider range of window sizes and content widths.
Keep MCP cards compact by showing only the first few synced provider icons and summarizing the remainder with a count. The card header also gets stricter min-width handling so titles and actions align cleanly.
Greptile SummaryThis PR fixes visual alignment of icons in MCP server cards and improves grid responsiveness. It replaces fixed padding-based icon centering with
Confidence Score: 5/5Safe to merge — all changes are purely visual layout fixes with no data-flow or logic changes. The diff is limited to Tailwind class adjustments: replacing padding-based centering with flexbox, adding min-w-0 for text truncation, capping provider icon overflow, and upgrading the grid to auto-fit. The SVG rendering path is unaffected because prepareInlineSvgMarkup already injects h-full w-full on the inner SVG, so the new size-5 wrapper works correctly. The bg-linear-to-r gradient is the established Tailwind v4 syntax already used elsewhere in the codebase. No files require special attention.
|
| Filename | Overview |
|---|---|
| apps/emdash-desktop/src/renderer/utils/mcpIcons.tsx | Fixes icon centering by replacing p-3 padding with flex layout; adds size-5 to SVG wrapper (safe because prepareInlineSvgMarkup injects h-full w-full on the SVG); adds shrink-0 to prevent icon squishing. |
| apps/emdash-desktop/src/renderer/features/mcp/components/McpCard.tsx | Adds MAX_VISIBLE_PROVIDERS cap (5) with +N overflow indicator, fixes text truncation via min-w-0 on flex container and h3, upgrades hover overlay to full-height gradient approach. |
| apps/emdash-desktop/src/renderer/lib/components/card-grid.tsx | Replaces fixed sm:grid-cols-2 breakpoint with fluid auto-fit grid using minmax(min(100%, 16rem), 1fr); affects both MCP and Skills views which share this component. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[McpServerIcon] --> B{iconKey provided?}
B -- No --> F[Server fallback\nsize-5 text-foreground-muted]
B -- Yes --> C{getIcon lookup}
C -- svg --> D[prepareInlineSvgMarkup\nstrips width/height attrs\nadds h-full w-full]
C -- png --> E[img size-5\nobject-contain]
C -- not found --> F
D --> G[div.size-5\ndangerouslySetInnerHTML]
E --> H[img element]
G --> I[Container\nflex size-10 shrink-0\nitems-center justify-center\nrounded-lg bg-background-2]
H --> I
F --> I
I --> J[McpCard renders icon\nalongside name + transport badge\n+ provider icons capped at 5]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[McpServerIcon] --> B{iconKey provided?}
B -- No --> F[Server fallback\nsize-5 text-foreground-muted]
B -- Yes --> C{getIcon lookup}
C -- svg --> D[prepareInlineSvgMarkup\nstrips width/height attrs\nadds h-full w-full]
C -- png --> E[img size-5\nobject-contain]
C -- not found --> F
D --> G[div.size-5\ndangerouslySetInnerHTML]
E --> H[img element]
G --> I[Container\nflex size-10 shrink-0\nitems-center justify-center\nrounded-lg bg-background-2]
H --> I
F --> I
I --> J[McpCard renders icon\nalongside name + transport badge\n+ provider icons capped at 5]
Reviews (1): Last reviewed commit: "feat(mcp): improve MCP card provider ove..." | Re-trigger Greptile
Description
Screenshot/Recording (if applicable)
https://streamable.com/0z80w8
Checklist
messages and, when possible, the PR title