feat(docs): add provider icons to tools sidebar#4807
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview
Reviewed by Cursor Bugbot for commit 685165c. Configure here. |
Greptile SummaryThis PR adds provider brand icons to the docs sidebar Tools section by introducing a
Confidence Score: 4/5Safe to merge — the feature is correctly scoped and the icon lookup is sound; the only side effect is a display-mode change for all sidebar items on desktop, which is visually benign for text-only entries. The icon resolution logic correctly matches URL slugs to block types (the docs generator writes files as apps/docs/components/docs-layout/sidebar-components.tsx — specifically the Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[SidebarItem renders] --> B[getToolIcon called with item.url]
B --> C[stripLangPrefix strips /en, /fr, etc.]
C --> D{path starts with /tools/?}
D -- No --> E[return null no icon rendered]
D -- Yes --> F[extract slug after /tools/]
F --> G{slug empty or contains /?}
G -- Yes --> E
G -- No --> H[blockTypeToIconMap lookup]
H --> I{key found in map?}
I -- No --> E
I -- Yes --> J[return IconComponent]
J --> K[render ToolIcon at size-14px]
E --> L[render item.name only]
K --> L
Reviews (1): Last reviewed commit: "feat(docs): add provider icons to tools ..." | Re-trigger Greptile |
| const ITEM_DESKTOP = | ||
| 'lg:mb-[0.0625rem] lg:block lg:rounded-lg lg:px-2.5 lg:py-1.5 lg:font-normal lg:text-[13px] lg:leading-tight' | ||
| 'lg:mb-[0.0625rem] lg:rounded-lg lg:px-2.5 lg:py-1.5 lg:font-normal lg:text-[13px] lg:leading-tight' |
There was a problem hiding this comment.
Layout mode change affects all sidebar items, not just tool pages
Removing lg:block from ITEM_DESKTOP causes every SidebarItem and every folder-as-leaf item to keep flex display on desktop, where previously lg:block overrode it. The PR description says Triggers, Blocks, and the Tools overview are unaffected, but their items now use a different display mode too. In practice the visual delta for text-only items is minimal (flex with a single text child is effectively equivalent to block), but items that were relying on block-box overflow behavior (e.g., very long names truncated differently) may render slightly differently across all sections.
Summary
blockTypeToIconMapso icons stay in sync with the auto-generated mapping; resolve the icon from the/tools/<slug>URLType of Change
Testing
Tested manually
Checklist