Skip to content

fix(web): filled icons match Hugeicons' solid look - #522

Merged
NoahHendrickson merged 3 commits into
customfrom
t3/fix-filled-folder-server-icons
Nov 26, 2026
Merged

NoahHendrickson merged 3 commits into
customfrom
t3/fix-filled-folder-server-icons

Conversation

@NoahHendrickson

@NoahHendrickson NoahHendrickson commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

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

  • fillDrawing returns 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 direct HugeGlyph callers therefore all see the same drawing, and icon()/HugeGlyph are 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.
  • The derived and hand-drawn weights share their widths and cut/body builders (custom/icons/glyphCuts.ts).
  • The fill derivation's cutsThroughEdge predicate 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.
  • copy now 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:changed passes. hugeiconsFill.test.ts covers 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

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>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L labels Nov 26, 2026
…r-server-icons

# Conflicts:
#	apps/web/src/custom/icons/lucide-hugeicons.tsx

@NoahHendrickson NoahHendrickson left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
  • HugeGlyph callers that pass data directly (design-mode PanelIcons, 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 NoahHendrickson left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 spans rule. I ran base and head deriveFill on every glyph that a themed/fill row uses (132 glyphs, @hugeicons/core-free-icons 4.4.0) and compared the bodies/knockouts/holes/plain counts. Exactly 8 glyphs changed: FileIcon, FilesIcon, FileTextIcon, FileCodeIcon, FileSearchIcon, FileSpreadsheetIcon, Globe02Icon and MailIcon. That matches the PR description, so no other filled icon changes.
  • The hand-drawn solids build and render. Every pathOf index resolves against 4.4.0. The regex rewrites in UsersSolid and FoldersSolid match. PencilRuler splits into two subpaths. Mask element keys are unique within each array. I rendered all 12 solids next to their outlines (WebKit, same mask markup as HugeGlyph), 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. Direct HugeGlyph callers (PanelIcons, LayerTypeIcon, SidebarV2SubagentCount, BackgroundWorkLayersMark) all pass filled={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>
@NoahHendrickson

Copy link
Copy Markdown
Owner Author

Addressed the quality review in 152c881:

  1. Override layer: the hand-drawn solids now come out of fillDrawing, keyed by glyph (HAND_DRAWN in handDrawnSolids.ts). icon(), HugeGlyph and the table rows are back to custom's shape, and the guard regex tweak is reverted.
  2. Duplicated constants and builders: they now live in glyphCuts.ts, shared by both weights. It's a separate module rather than exports from hugeiconsFill.ts, because that module now imports the solids and a value import back would be a load-order cycle.
  3. Vendor path surgery: replaced with literal path data throughout.
  4. cutsThroughEdge: a single predicate requiring both ends on the same body. The derived drawings for every themed/fill row outside the hand-drawn set are byte-identical to the previous head.

Declined: splitting out copy → Copy01. The maintainer asked for that swap in the same session as these filled-weight fixes, so it stays here. It's a single row.

The scroll-text seam nit is fixed too (curl and roll drawn in front of the page). vp run check:changed and the fork lint ratchet pass, and the Figma kit's scroll-text variants are re-synced.


🤖 Signed: Claude Opus 5.5 (claude-opus-5-5) via Claude Code

@NoahHendrickson
NoahHendrickson merged commit 816b331 into custom Nov 26, 2026
33 checks passed
@NoahHendrickson
NoahHendrickson deleted the t3/fix-filled-folder-server-icons branch November 26, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants