feat(web): add Stack-chan icons#405
Conversation
📝 WalkthroughWalkthroughThe pull request adds Stack-chan icon assets to the web UI by wiring favicon and Apple touch icon metadata across HTML pages, introducing CSS styling for responsive icon display, restructuring the main index page layout to showcase an icon, implementing a validation test module to ensure icon file references are correct, and adding a corresponding npm test script. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7af464f91
ℹ️ 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".
| <link rel="icon" href="assets/stackchan-symbol.png" type="image/png"> | ||
| <link rel="apple-touch-icon" href="assets/stackchan-symbol.png"> |
There was a problem hiding this comment.
Use optimized favicon assets for page icon links
The new icon links point to assets/stackchan-symbol.png, which is a full-size 1254×1254 PNG (~800 KB) and will be fetched as the tab/app icon on every page load. In environments where this web UI is served over a network (not just localhost), this adds avoidable transfer and latency for a non-critical resource. Please reference a small optimized favicon/touch-icon variant (for example 32×32 and 180×180 outputs) instead of the original source image.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
web/icon-assets.test.mjs (1)
12-17: ⚡ Quick winAlso validate
apple-touch-iconlinks in this test.Right now this loop only guards
rel="icon". Since Line 8-9 were added in each page head, a missingrel="apple-touch-icon"would slip through.Proposed diff
for (const [page, iconPath] of pages) { const html = await readFile(new URL(`./${page}`, import.meta.url), 'utf8') if (!html.includes(`rel="icon" href="${iconPath}"`)) { throw new Error(`${page} should reference ${iconPath} as favicon`) } + if (!html.includes(`rel="apple-touch-icon" href="${iconPath}"`)) { + throw new Error(`${page} should reference ${iconPath} as apple-touch-icon`) + } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@web/icon-assets.test.mjs` around lines 12 - 17, The test loop that iterates over pages and iconPath currently only checks for rel="icon"; update the check inside the for-loop (the code using pages, iconPath and html from readFile) to also assert that the page includes the apple-touch-icon link—for example require html.includes(`rel="icon" href="${iconPath}"`) AND html.includes(`rel="apple-touch-icon" href="${iconPath}"`) (or the appropriate apple-specific path if you have a separate mapping); throw the same Error if either check fails so missing rel="apple-touch-icon" links are caught.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@web/icon-assets.test.mjs`:
- Around line 12-17: The test loop that iterates over pages and iconPath
currently only checks for rel="icon"; update the check inside the for-loop (the
code using pages, iconPath and html from readFile) to also assert that the page
includes the apple-touch-icon link—for example require html.includes(`rel="icon"
href="${iconPath}"`) AND html.includes(`rel="apple-touch-icon"
href="${iconPath}"`) (or the appropriate apple-specific path if you have a
separate mapping); throw the same Error if either check fails so missing
rel="apple-touch-icon" links are caught.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8e768a38-d022-4b3c-8524-c98ba6e1c605
⛔ Files ignored due to path filters (2)
web/assets/stackchan-icon.pngis excluded by!**/*.pngweb/assets/stackchan-symbol.pngis excluded by!**/*.png
📒 Files selected for processing (6)
web/flash/index.htmlweb/global.cssweb/icon-assets.test.mjsweb/index.htmlweb/package.jsonweb/preference/index.html
Summary
web/assets/Closes #404
Test Plan
npm testfromweb/npx prettier --check package.json icon-assets.test.mjsfromweb//viapython3 -m http.server 4173Summary by CodeRabbit
New Features
Tests