Repository navigation
fix(dashboard): show custom apps' own logos - #1508
Open
AsadKhanAb17 wants to merge 1 commit into
Open
AsadKhanAb17 wants to merge 1 commit into
AsadKhanAb17 wants to merge 1 commit into
Conversation
A custom app's template `logo` was only ever treated as a simpleicons slug, so an image URL became a broken simpleicons request, and screens that show apps by id (the project list, project pages) never saw a custom app's logo at all. - AppLogo renders a `logo` that is an https URL or an image data URI, and shows the fallback for any other address instead of a broken request. - The dashboard AppLogo looks up a custom app's logo from the catalog by id (one cached request per page), refreshed after a custom app is added. Refs oblien#1507
Contributor
Author
|
@Hydralerne Please review this PR |
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.
Summary
Custom apps now show their own logo. A template
logocan be anhttps:image URL or an image data URI, and it appears everywhere the app is shown, including the project list.Motivation
#1507: custom apps added with
POST /api/apps/customonly got a placeholder icon.AppLogotreated everylogoas a simpleicons slug, sohttps://…/logo.pngbecame a brokenhttps://cdn.simpleicons.org/https://…request.APP_LOGOmap, so their logo was never even looked up.Related issue
Refs #1507. This implements the first option in the issue: render an https URL or data URI from the template
logo. Uploading icons and a writable projectfaviconare not included.Changes
packages/ui/src/AppLogo.tsx:logoImageSource()accepts only anhttps:URL or adata:image/(png|jpeg|gif|webp|svg+xml)URI. Any other address-like value (http:,javascript:, paths) shows the fallback instead of a broken request.apps/dashboard/src/components/AppLogo.tsx: the dashboard wrapper, previously a re-export, looks up a custom app's logo from the catalog by ID. That's one cached request per page, and only for IDs that aren't built-in. Any failure falls back to the default icon. The ~15 existing call sites need no change.AddCustomAppModal.tsx: refreshes that cache after a custom app is added.Verification
Screenshots
The real dashboard
AppLogorendered frommainand from this branch, with the dashboard's CSS, in a project-list card that passes only the app ID. The two custom apps have anhttpslogo and an image data URI:Before: both show the generic placeholder. After: each shows its own logo.
Checklist