Repository navigation
fix: [Agent] The settings page contains inaccessible images. - #7775
Merged
Merged
Conversation
shaohuzhang1
commented
Nov 9, 2026
| <img :src="previewImages.float_icon || '/MaxKB.gif'" alt="" class="size-8 shrink-0 object-contain" /> | ||
| <img :src="previewImages.float_icon || './MaxKB.gif'" alt="" class="size-8 shrink-0 object-contain" /> | ||
| </div> | ||
| </template> |
Contributor
Author
There was a problem hiding this comment.
Review of the diff
Change: /MaxKB.gif → ./MaxKB.gif
Issues / Concerns
-
Semantic change in path resolution (likely a regression risk)
/MaxKB.gifis an absolute path resolved from the site root (e.g.,https://host/MaxKB.gif)../MaxKB.gifis relative to the current route URL, not the app's base. In SPA/Vue Router setups (especially with history mode and nested routes), this can resolve to incorrect URLs such as/some/nested/route/MaxKB.gif, causing 404s.- If the intent was "path relative to the deployed app root," use
import.meta.env.BASE_URL + 'MaxKB.gif'or a static asset import (import MaxKBIcon from '@/assets/MaxKB.gif').
-
No leading slash vs. Vite/base-path handling
- With Vite, public assets are served from
BASE_URL. Hardcoding./bypasses base-path configuration and will break if the app is deployed under a subpath (e.g.,/maxkb/). Prefer:then useconst defaultIcon = `${import.meta.env.BASE_URL}MaxKB.gif`
:src="previewImages.float_icon || defaultIcon".
- With Vite, public assets are served from
-
Hardcoded fallback logic in template
- Better to move the fallback into a computed property for clarity and testability, e.g.:
const floatIconSrc = computed(() => previewImages.value.float_icon || defaultIcon)
- Better to move the fallback into a computed property for clarity and testability, e.g.:
-
Accessibility
- The
<img>uses emptyalt="". Since it's a UI icon (not decorative in the strict sense — it likely conveys meaning), consideralt="MaxKB"or mark itrole="presentation"/aria-hidden="true"explicitly if truly decorative.
- The
-
Minor: filename casing
MaxKB.gifmixes case; confirm the actual file is capitalized exactly this way on case-sensitive servers (Linux), otherwise it works locally (Windows/macOS) but fails in production.
Recommendation
Revert to /MaxKB.gif or, preferably, switch to a base-URL-aware reference or a bundled asset import to make the path robust across environments.
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.
fix: [Agent] The settings page contains inaccessible images.