feat(apps): render tool.icons on ToolListItem and ToolDetailPanel (#1264)#1293
feat(apps): render tool.icons on ToolListItem and ToolDetailPanel (#1264)#1293
Conversation
Add icon rendering to ToolListItem so the Tools sidebar matches the Apps sidebar treatment. Falls back gracefully when tool.icons is absent. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@claude review |
|
Claude finished @cliffhall's task in 2m 3s —— View job Claude PR Review
SummaryClean, focused change. The implementation mirrors Nits / minor1. Storybook icon data URL is double-encoded — const ICON_DATA_URL =
"data:image/svg+xml;utf8," +
encodeURIComponent(
'<svg ... fill="%23228be6"><circle .../></svg>',
);The source string already has 2. The test relies on Mantine's Nice-to-haves (not blocking)
Approvals
Nothing blocking here — the data-URL nit is the only tangible issue. |
The source SVG had %23228be6 pre-encoded, but encodeURIComponent then re-escaped the % to %25, leaving fill="%23228be6" in the decoded SVG and making the icon render black instead of Mantine blue. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Thanks for the review! Responses below: 1. Storybook icon data URL is double-encoded — fixed in 624b1aa. Changed the source to 2. Nice-to-haves:
|
|
@claude review |
|
Claude finished @cliffhall's task in 56s —— View job Claude PR Review (follow-up)
SummaryAll prior review feedback is resolved or reasonably dispositioned. Data-URL fix landed correctly; the remaining items (test role selector, cross-file duplication, alignment for single-line rows) are fine as-is with your reasoning. LGTM. Verification of 624b1aa (data URL fix)
const ICON_DATA_URL =
"data:image/svg+xml;utf8," +
encodeURIComponent(
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#228be6"><circle cx="12" cy="12" r="10"/></svg>',
);
Re-checked against repo conventions
Responses to prior nits
Nothing blocking. Ready to merge once the manual visual checks in the PR description are ticked off. |
Show the tool icon next to the title in the detail panel, matching the header icon size used in AppsScreen (24x24, fit: contain). Adds a WithIcon story and tests for icon-present/icon-absent states. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
tool.iconson the Tools sidebar (ToolListItem, 20×20) so it matches the Apps sidebar.tool.iconson the tool detail header (ToolDetailPanel, 24×24) so it matches the Apps screen header.Imagewithfit: "contain"andalt=""(decorative — visible label sits next to it). No icon row is rendered whentool.iconsis absent.WithIconStorybook stories for both groups, plus tests covering icon-present and icon-absent states.Closes #1264.
Implementation note
Going with Option B from the issue (keep
AppListItemseparate).AppListItemis already shipped (#1261) with chevron + description, so the cleaner path is to fold icon support into the existingTool*components without disturbing the Apps row.Sizes match the existing precedent set by Apps (#1261, #1263): list items use 20×20, detail/screen headers use 24×24.
Test plan
npm run validate— all 666 tests pass; format, lint, build cleanToolListItem.tsxandToolDetailPanel.tsxper-file coverage: 100% lines/branches/functionsGroups/ToolListItem/WithIcon,Groups/ToolDetailPanel/WithIconiconsshows the icon in the sidebar list and in the detail panel header🤖 Generated with Claude Code