Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds functionality to inject the custom site logo into the HTML favicon tag during server-side rendering, preventing the default logo from flashing when the page loads. The change addresses a user experience issue where the browser would initially load the default /logo.png and then replace it with the custom logo after Vue.js initializes.
Changes:
- Backend: Adds
extractSiteLogo()function to extract logo from settings via reflection, updatesinjectSettings()to replace the favicon tag in HTML before injection - Frontend: Updates Vite development plugin to perform the same favicon replacement for development/production parity
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
| backend/internal/web/embed_on.go | Adds reflection-based logo extraction and favicon HTML replacement in server-side rendering |
| frontend/vite.config.ts | Adds favicon replacement in development mode to match production behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
页面刷新时,浏览器��加载 HTML 中的默认 /logo.png,
等待 Vue 启动后才通过 JS 替换为自定义 logo,导致闪烁。
解决方案
在注入配置脚本前,先替换 \u003clink rel="icon"\u003e 的 href
保持开发和生产行为一致
这样浏览器解析 HTML 时直接拿到正确的 favicon URL,
无需等待 JS 执行,完全消除闪烁。