feat: add support for custom icons#2497
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f3759a3ad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b9bddeb4d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@claude review |
|
Claude finished @farion1231's task in 2m 18s —— View job Code Review
This is a clean, well-structured feature. The architecture is sound and the fix commit correctly addressed the debounce-loss issue flagged by Codex. Here are my findings: Bug: No error feedback for broken image URLs
When a user pastes a URL that doesn't resolve to an image (404, wrong content type, CORS block, etc.), the // Current — silent failure
<img
src={iconUrl}
...
loading="lazy"
/>Suggested fix — add const [imgError, setImgError] = useState(false);
if (iconUrl && !imgError) {
return (
<img
src={iconUrl}
onError={() => setImgError(true)}
...
/>
);
}
// falls through to the initials fallbackUX: Brief "no results" flash during debounce window
const filteredIcons = useMemo(() => {
if (isImageUrl) return []; // debounced — false for 250ms after paste
if (!searchQuery) return iconList;
return searchIcons(searchQuery); // runs with URL string during those 250ms
}, [isImageUrl, searchQuery]);
// ...
{!isImageUrl && filteredIcons.length === 0 && (
<div>No matching icons found</div> // shown briefly after paste
)}When a valid URL is pasted, for ~250ms: A simple fix is to derive Security / Privacy note
The HTTPS-only constraint in the Zod schema is a good call — it prevents loading mixed-content and avoids There's no validation that the URL actually resolves to an image MIME type. This is expected for a client-only feature (checking MIME type would require a proxy request), but the Minor:
|
|
@claude review (Re-running with the updated review prompt for comparison.) |
|
Claude finished @farion1231's task in 2m 12s —— View job Code Review (re-run, high-signal-only)
No blocking issues. LGTM. I went through the four code files ( A few notes on items that prior reviews raised, just to confirm they're resolved on the current head (
Privacy trade-off (rendering external |
|
All issues have been resolved. |
Summary / 概述
Add support for custom provider icons via image URLs in the icon picker.
Users can now paste an image URL into the existing icon search input. Built-in icon search continues to work as before, while valid HTTPS image URLs are rendered as provider icons with
<img>. URL detection is debounced to avoid updating the icon on every keystroke.Related Issue / 关联 Issue
None
Screenshots / 截图
Checklist / 检查清单
pnpm typecheckpasses / 通过 TypeScript 类型检查pnpm format:checkpasses / 通过代码格式检查cargo clippypasses (if Rust code changed) / 通过 Clippy 检查(如修改了 Rust 代码)