-
Notifications
You must be signed in to change notification settings - Fork 746
Open
Description
Feat: Svelte favicon support
Svelte/SvelteKit projects in the sidebar don’t resolve their real project favicon and fall back to a generic folder icon. The sidebar favicon loading also needs to avoid layout shift and cached-image race conditions.
Implementation Prompt
Implement Svelte/SvelteKit sidebar project favicon support in t3code by extending /api/project-favicon server--side. Resolve icons in this order: real favicon files, parsed icon links (including src/app.html and %sveltekit.assets%/..• → static/... ), then Svelte fallback, then generic fallback. Detect Svelte only from strong root markers in projectIconFallback.ts: svelte.config.*, •svelte-kit/, or package. json deps containing svelte / @sveltejs/kit .
Serve fallback icons from checked-in asset files:
• apps/server/src/assets/project-favicon-default.svg
• apps/server/src/assets/project-favicon-svelte.svg
Add a helper to load those SVGs and update the server build script so they are copied into dist/assets
Update tests in apps/server/src/projectFaviconRoute.test.ts to cover real favicon resolution, SvelteKit %sveltekit. assets% resolution, Svelte fallback detection, precedence rules, and generic fallback, asserting against
asset-backed SVG constants.
Also fix sidebar layout shift in apps/web/src/components/Sidebar.tsx: reserve a fixed icon slot, show nothing while
loading, pop the favicon in immediately on success, and keep showing the folder icon only on error. Validate with bun lint and bun typecheck
| Before | After |
|---|---|
![]() |
![]() |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

