codefloe/forgejo-codefloe
Watch
4
12
Fork
You've already forked forgejo-codefloe
0

fix(fileicon): add missing material generic-folder and folder-symlink icons #42

Merged
pat-s merged 2 commits from t3code/review-material-design-icon-lib into v15.0/forgejo-codefloe 2026-06-30 13:06:36 +00:00
Owner

Fixes #33.

Problem

Folders that don't match a specific rule in material-icon-rules.json (e.g. .semgrep, contrib in the issue screenshot) render with no icon at all when the material file-icon set is active.

Root cause

modules/fileicon/material.go renders the generic-folder fallback via svg.RenderHTML("material-folder-generic", …) and symlinked directories via svg.RenderHTML("material-folder-symlink", …).
When the material icon set was ported from Gitea, the two source SVGs were never brought over, so svg.RenderHTML resolved 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

  • Add web_src/svg/material-folder-generic.svg and material-folder-symlink.svg (canonical sources).
  • Add the corresponding generated assets under public/assets/img/svg/, produced by make svg (the generator touches only these two files, so make svg-check stays green).
  • Add modules/fileicon/material_assets_test.go: a regression test asserting the icon names hardcoded in material.go have both a source and a generated asset, so a future port can't silently drop them again.
Fixes #33. ### Problem Folders that don't match a specific rule in `material-icon-rules.json` (e.g. `.semgrep`, `contrib` in the issue screenshot) render with **no icon at all** when the material file-icon set is active. ### Root cause `modules/fileicon/material.go` renders the generic-folder fallback via `svg.RenderHTML("material-folder-generic", …)` and symlinked directories via `svg.RenderHTML("material-folder-symlink", …)`. When the material icon set was ported from Gitea, the two source SVGs were never brought over, so `svg.RenderHTML` resolved 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 - Add `web_src/svg/material-folder-generic.svg` and `material-folder-symlink.svg` (canonical sources). - Add the corresponding generated assets under `public/assets/img/svg/`, produced by `make svg` (the generator touches only these two files, so `make svg-check` stays green). - Add `modules/fileicon/material_assets_test.go`: a regression test asserting the icon names hardcoded in `material.go` have both a source and a generated asset, so a future port can't silently drop them again.
fix(fileicon): add missing material generic-folder and folder-symlink icons
Some checks failed
testing / frontend-checks (pull_request) Successful in 2m7s
testing / backend-checks (pull_request) Successful in 14m59s
testing / test-unit (pull_request) Successful in 19m43s
testing / test-sqlite (pull_request) Has been cancelled
testing / test-remote-cacher (valkey) (pull_request) Has been cancelled
testing / test-remote-cacher (redis) (pull_request) Has been cancelled
testing / test-remote-cacher (garnet) (pull_request) Has been cancelled
testing / test-pgsql (pull_request) Has been cancelled
testing / test-mysql (pull_request) Has been cancelled
testing / test-e2e (pull_request) Failing after 16m55s
5baaab5986
The material file-icon provider renders folders that don't match a specific
folder rule with the built-in `material-folder-generic` icon, and symlinked
directories with `material-folder-symlink` (see modules/fileicon/material.go).
When the material icon set was ported from Gitea, the two source SVGs were
never brought over, so `svg.RenderHTML` resolved them to an empty string and
those folders rendered with no icon at all (issue #33).

Add the two source SVGs under web_src/svg and the corresponding generated
assets under public/assets/img/svg (produced by `make svg`).

Add a regression test asserting the icon names hardcoded in material.go have
both a source and a generated SVG asset, so a future port can't silently drop
them again.

Closes #33
pat-s scheduled this pull request to auto merge when all checks succeed 2026-06-30 07:36:50 +00:00
Merge branch 'v15.0/forgejo-codefloe' into t3code/review-material-design-icon-lib
All checks were successful
testing / frontend-checks (pull_request) Successful in 2m1s
testing / backend-checks (pull_request) Successful in 13m50s
testing / test-unit (pull_request) Successful in 10m59s
testing / test-remote-cacher (garnet) (pull_request) Successful in 3m6s
testing / test-remote-cacher (redis) (pull_request) Successful in 5m15s
testing / test-remote-cacher (valkey) (pull_request) Successful in 5m17s
testing / test-e2e (pull_request) Successful in 26m31s
testing / test-mysql (pull_request) Successful in 29m39s
milestone / set (pull_request_target) Has been skipped
issue-labels / backporting (pull_request_target) Has been skipped
testing / test-pgsql (pull_request) Successful in 44m30s
testing / test-sqlite (pull_request) Successful in 40m24s
1c7c29c960
pat-s merged commit 147e3d9763 into v15.0/forgejo-codefloe 2026-06-30 13:06:36 +00:00
pat-s deleted branch t3code/review-material-design-icon-lib 2026-06-30 13:06:37 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
codefloe/forgejo-codefloe!42
No description provided.