Skip to content

fix: favicon is not displayed when changed in branding settings#1023

Merged
perber merged 2 commits into
mainfrom
fix/favicon-display-issue
May 22, 2026
Merged

fix: favicon is not displayed when changed in branding settings#1023
perber merged 2 commits into
mainfrom
fix/favicon-display-issue

Conversation

@perber
Copy link
Copy Markdown
Owner

@perber perber commented May 22, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 22, 2026 20:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes dynamic favicon updates when branding settings change by ensuring both the SPA and server routes serve the correct, cache-busted favicon asset.

Changes:

  • Update the UI branding store to apply the current favicon (custom or default) after load/update/upload/delete actions.
  • Add a /favicon.ico route that serves the currently configured branding favicon (or falls back to the default SVG) with no-store caching.
  • Centralize the default favicon SVG constant and add HTTP tests covering the new .ico behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
ui/leafwiki-ui/src/stores/branding.ts Applies favicon changes immediately by updating/creating the <link rel="icon"> element and cache-busting URLs.
internal/wiki/branding/routes.go Adds /favicon.ico and refactors branding asset path resolution for favicon/logo serving.
internal/http/router.go Extracts the default favicon SVG into a shared constant.
internal/http/router_test.go Adds helper + tests verifying /favicon.ico serves custom branding favicon and falls back to SVG with no-store caching.
Comments suppressed due to low confidence (1)

ui/leafwiki-ui/src/stores/branding.ts:78

  • updateBranding forces a favicon reload via Date.now(), but the store state doesn’t update faviconVersion. Components that use faviconVersion for cache-busting (e.g. the favicon preview) can keep rendering the old URL even though the document link was updated. Use a single assetVersion value for both applyFavicon and the store state (and keep the version update co-located with the faviconFile update).
  updateBranding: async (config) => {
    set({ isLoading: true, error: null })
    try {
      const updated = await brandingAPI.updateBranding(config)
      applyFavicon(updated.faviconFile, Date.now())
      set({
        siteName: updated.siteName,
        logoFile: updated.logoFile,
        faviconFile: updated.faviconFile,
        isLoading: false,
      })

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@perber perber linked an issue May 22, 2026 that may be closed by this pull request
@perber perber merged commit e9364f3 into main May 22, 2026
7 of 8 checks passed
@perber perber deleted the fix/favicon-display-issue branch May 22, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default favicon displayed when branding set

2 participants