Repository navigation
fix(web): filled icons match Hugeicons' solid look - #522
Conversation
Several filled icons came out wrong: folder dividers notched the edges, back panels and handles stayed outlines, the server's racks were cut apart with flat inner corners, and every file icon's dog-ear left a nub. Rows can now pass a hand-drawn filled weight (handDrawnSolids.ts) for folder-closed, folder-open, folders, server, users, package, scroll-text, archive-x, pipette, hammer, pencil-ruler and smartphone. The derivation also treats an open stroke ending at a body's outline at both ends as a cut through the edge, which fixes the file dog-ears. copy now uses Copy01. The shim guard also sees icon() calls that wrap lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r-server-icons # Conflicts: # apps/web/src/custom/icons/lucide-hugeicons.tsx
NoahHendrickson
left a comment
There was a problem hiding this comment.
Code quality review of 1dd381453ef07ed9ac06c93e9555f18bf992cee1 (base 46fed8d26c). This is a static read. The worktree had no install, so I didn't run the tests here.
The art direction is fine. The plumbing isn't, and I wouldn't merge it in this shape. Ranked:
1. The override sits in the wrong layer. Moving it would remove most of this diff.
A hand-drawn solid is just another way of answering "what is this glyph's filled drawing?", and hugeiconsFill.ts already answers that question (fillDrawing / glyphDrawing, behind a cache keyed by glyph). Instead, the PR passes the answer through three layers: a 4th optional positional argument on icon(), an optional solid prop on the exported HugeGlyph, and a filled && solid ? solid : glyphDrawing(...) ternary at render time. It also adds a 12-name import list, 12 table rows the formatter now wraps, and a guard regex patched to cope with that wrapping.
That has real consequences, not just looks:
canFill()can't see the solids. The guard "fills every themed and fill row… the table, not the heuristic, says which glyphs fill" now checks the derived drawing for 12 rows that never render it. A solid whose derivation returns null would fail the guard. A solid that is broken would pass it.HugeGlyphcallers that passdatadirectly (design-modePanelIcons,LayerTypeIcon, etc.) get the derived fill for the same glyph. The shim promises "a glyph can't drift between names", and this lets the same glyph draw two ways.
The simpler move: handDrawnSolids.ts exports a ReadonlyMap<IconSvgElement, GlyphDrawing> keyed by the Hg.* glyph (each of the 12 glyphs is used by exactly one row), and fillDrawing checks it before deriving. Then icon(), HugeGlyph and every table row stay as they were, the guard regex tweak becomes unnecessary, canFill tells the truth, and the guard covers the solids for free. handDrawnSolids.ts only imports types from hugeiconsFill.ts, so the value import back creates no runtime cycle.
2. The new file redefines constants and builders hugeiconsFill.ts already owns.
SEAM = 1.5 is SEAM_WIDTH, and DETAIL = 2 is KNOCKOUT_WIDTH, down to near-identical doc comments. cut() and body() rebuild the knockout and filled-body element shapes that deriveFill builds inline. Export the constants and one pair of builders from hugeiconsFill.ts so the derived and hand-drawn weights can't drift when someone retunes a width. Inside the new file, FolderClosedSolid writes its divider by hand instead of calling cut() (only to get butt caps), and FolderOpenSolid copies by hand the second half of around(). Give cut an extra attributes argument and let around take the gap path, and both special cases go away.
3. Fragile edits to the vendor's path data.
The file positions itself as "each reuses the outline glyph's own geometry", but it mixes three models: index-based pathOf(glyph, n), regex surgery on vendor d strings (.replace(/^M[\d.]+ [\d.]+/…), /^M16\.5 20V/, /V20$/, .split(/(?=M)/), appending Z), and full literal copies of vendor paths (FOLDER_OPEN_FLAP, the folder-open back panel, package sides, scroll page). When String.replace finds no match, it returns its input unchanged. So the day someone bumps @hugeicons/core-free-icons, these solids silently ship wrong shapes and no test fails. The exact pin protects today, but it doesn't warn the person who bumps it. Pick one model:
- Preferred: literal path data throughout. The art is frozen and checked against Figma anyway, so plain literals are the most direct form.
- If you keep deriving from the vendor glyphs: a
rewrite(d, pattern, replacement)that throws when nothing matches, plus a test that builds every solid.
4. The spans rule is an extra branch pushed into an already busy loop.
It recomputes ends with ! assertions on every shape, even when reach already qualifies, and it borrows RIM_WIDTH, whose doc describes something else. Pull both rules into one predicate, e.g. cutsThroughEdge(shape, parts), so the loop reads (cutsThroughEdge(shape, parts) ? knockouts : holes).push(cut). Inside it, parts.some((body) => ends.every(…)) (both ends on the same body) closes the multi-body case Sol raised, at no extra cost, instead of leaving it to "doesn't occur today". Check that the shipped set (file*, globe-2, mail) still splits the same way.
Smaller: the copy → Copy01 swap changes an outline weight and is unrelated to filled-weight fidelity. It belongs in its own change.
No file crosses 1k lines (665 / 519 / 218). The new test case for the endpoint rule is the right layer.
Not approving. #1 is the blocker: it removes the prop, the parameter, the ternary and the guard workaround, and it fixes canFill. #2 and #3 should land with it.
NoahHendrickson
left a comment
There was a problem hiding this comment.
Correctness review of 1dd381453ef07ed9ac06c93e9555f18bf992cee1 (base 46fed8d26c). The existing quality review already covers the structure: where the override lives, the duplicated constants, and the regex surgery on vendor paths. I don't repeat those points here.
What I checked
- Blast radius of the
spansrule. I ran base and headderiveFillon every glyph that athemed/fillrow uses (132 glyphs,@hugeicons/core-free-icons4.4.0) and compared the bodies/knockouts/holes/plain counts. Exactly 8 glyphs changed:FileIcon,FilesIcon,FileTextIcon,FileCodeIcon,FileSearchIcon,FileSpreadsheetIcon,Globe02IconandMailIcon. That matches the PR description, so no other filled icon changes. - The hand-drawn solids build and render. Every
pathOfindex resolves against 4.4.0. The regex rewrites inUsersSolidandFoldersSolidmatch.PencilRulersplits into two subpaths. Mask element keys are unique within each array. I rendered all 12 solids next to their outlines (WebKit, same mask markup asHugeGlyph), and the shapes read as intended: server racks 4–11 and 13–20 with the dots at 7.5/16.5, the users' back figure parted by the 1.25 gap, the folder-open gap stopping at the hinge. - Render path.
filled && solid ? solid : glyphDrawing(data, filled)only swaps in the solid for filled rows. Outline weights are untouched. DirectHugeGlyphcallers (PanelIcons,LayerTypeIcon,SidebarV2SubagentCount,BackgroundWorkLayersMark) all passfilled={false}, so none of them hits a derived/hand-drawn mismatch today.
Finding (nit, visual): one inline comment on ScrollTextSolid's seams. Their round-capped ends sit on the outer outline and bite the shapes they separate.
I found no correctness bugs. I didn't run the test suite here because this worktree has no install. CI was still pending when I posted this.
🤖 Signed: Claude Opus 5.5 (claude-opus-5-5) via Claude Code
The hand-drawn filled weights were passed through icon(), HugeGlyph and a render-time ternary, so canFill, the shim guard and direct HugeGlyph callers never saw them. fillDrawing now returns them, keyed by glyph, and icon() is back to custom's shape (split-agent keeps filledData). The derived and hand-drawn weights share their widths and cut/body builders (glyphCuts.ts). The solids use literal path data instead of rewriting vendor paths. The fold rule lives in cutsThroughEdge and needs both ends on the same body. Scroll-text's curl and roll sit in front of the page, so their gaps no longer notch their own edges. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed the quality review in 152c881:
Declined: splitting out The scroll-text seam nit is fixed too (curl and roll drawn in front of the page). 🤖 Signed: Claude Opus 5.5 ( |
Several icons looked wrong in their filled weight (what every fork palette draws). The closed folder's divider notched the edges. The open folder, stacked folders, users, pipette, hammer and pencil-ruler left a back panel or handle as an outline. The server's racks were cut apart with flat inner corners. Every file icon's folded corner left a stray nub.
How it's fixed
fillDrawingreturns a hand-drawn filled weight for twelve glyphs, keyed by glyph (custom/icons/handDrawnSolids.ts): folder-closed, folder-open, folders, server, users, package, scroll-text, archive-x, pipette, hammer, pencil-ruler and smartphone.canFill, the shim guard and directHugeGlyphcallers therefore all see the same drawing, andicon()/HugeGlyphare unchanged. The solids use literal path data and draw through the existing mask renderer. Gaps behind a front shape are a black stroke around it, then the shape restored in white.custom/icons/glyphCuts.ts).cutsThroughEdgepredicate adds one case: an open stroke whose two ends sit on the same body's outline cuts through the edge instead of being treated as an interior hole. That fixes the dog-ear on file, files, file-text, file-json, file-code-2, file-search and file-spreadsheet. It also makes globe-2's lines and mail's flap cut cleanly to the edge. No other derived icon changes.copynow uses Hugeicons'Copy01, as the maintainer asked.Outline weights are unchanged except
copy. The Figma Basic UI kit's icon variants were updated to match, and Storybook's Icons page picks this up from the shim.Checks:
vp run check:changedpasses.hugeiconsFill.test.tscovers the fold rule, the seam rule (synthetic racks) and the hand-drawn override, and the fork lint ratchet passes.Reviewed with sol-loop: 1 round with GPT-6.2 Sol. Sol verdict: approved. A later code-quality review moved the override into the fill derivation (see the PR conversation).
🤖 Signed: Claude Opus 5.5 (
claude-opus-5-5) via Claude Code🔎 Review: GPT-6.2 Sol (
gpt-6.2-sol, high effort) via Codex in T3 Code, one sol-loop round whose two nit fixes were applied🤖 Generated with Claude Code