fix(fileicon): add missing material generic-folder and folder-symlink icons #42
No reviewers
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
codefloe/forgejo-codefloe!42
Loading…
Reference in a new issue
No description provided.
Delete branch "t3code/review-material-design-icon-lib"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #33.
Problem
Folders that don't match a specific rule in
material-icon-rules.json(e.g..semgrep,contribin the issue screenshot) render with no icon at all when the material file-icon set is active.Root cause
modules/fileicon/material.gorenders the generic-folder fallback viasvg.RenderHTML("material-folder-generic", …)and symlinked directories viasvg.RenderHTML("material-folder-symlink", …).When the material icon set was ported from Gitea, the two source SVGs were never brought over, so
svg.RenderHTMLresolved them to an empty string (modules/svg/svg.go) and the folders rendered blank.Only folders hitting the generic/symlink path were affected, which is why most folders looked fine.
Fix
web_src/svg/material-folder-generic.svgandmaterial-folder-symlink.svg(canonical sources).public/assets/img/svg/, produced bymake svg(the generator touches only these two files, somake svg-checkstays green).modules/fileicon/material_assets_test.go: a regression test asserting the icon names hardcoded inmaterial.gohave both a source and a generated asset, so a future port can't silently drop them again.