Skip to content

feat: serve stack-specific default project favicons - #3854

Closed
cgiangreco wants to merge 6 commits into
pingdotgg:mainfrom
cgiangreco:project-stack-default-icons
Closed

cgiangreco wants to merge 6 commits into
pingdotgg:mainfrom
cgiangreco:project-stack-default-icons

Conversation

@cgiangreco

@cgiangreco cgiangreco commented Jul 10, 2026 •

Copy link
Copy Markdown

What Changed

When a project has no favicon, detect the project's stack and serve a matching default icon instead of the generic folder icon. Detection is based on package.json dependencies and filesystem markers:

  • Next.js (next) → Next.js logo
  • Angular (@angular/core) → Angular shield
  • Svelte (svelte / @sveltejs/kit) → Svelte logo
  • Vue (vue / nuxt) → Vue chevron
  • React (react) → React logo
  • React Native / Expo (react-native / expo) → Android icon
  • Android/Gradle (settings.gradle / build.gradle present) → Android icon
  • YouTube (project directory name contains yt or youtube) → YouTube icon
  • TikTok (name contains tiktok) → TikTok icon
  • Instagram (name contains instagram / insta) → Instagram icon

Everything else falls back to the existing generic folder icon. Detection failures also degrade gracefully to the generic fallback, so behavior only changes for projects that match a known stack.

Works on both the Web and Desktop apps.

Why

Makes the projects panel a bit more fun, not having the default folder icon everywhere, and makes it easier to distinguish between projects.

UI Changes

Before
image

After
image

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
    ̶-̶ ̶[̶ ̶]̶ ̶I̶ ̶i̶n̶c̶l̶u̶d̶e̶d̶ ̶a̶ ̶v̶i̶d̶e̶o̶ ̶f̶o̶r̶ ̶a̶n̶i̶m̶a̶t̶i̶o̶n̶/̶i̶n̶t̶e̶r̶a̶c̶t̶i̶o̶n̶ ̶c̶h̶a̶n̶g̶e̶s̶ ==> no animation/interaction changes

Note

Low Risk
UI-only asset fallback logic with fail-open behavior; no auth or data-path changes beyond reading workspace metadata for icon selection.

Overview
Projects without a real favicon now get a stack-aware default SVG instead of always showing the generic folder icon.

AssetAccess adds resolveProjectFaviconFallbackSvg, which inspects the workspace root: project name patterns (YouTube/TikTok/Instagram), package.json dependencies (Next, Angular, Svelte, Vue, React, Expo/React Native), and Gradle marker files for native Android. Each match maps to an embedded SVG tagged with data-fallback. The project-favicon-fallback resolved asset now carries that svg string; http.ts serves asset.svg rather than a single constant.

Detection errors fall back to the existing generic folder SVG so asset requests still succeed. Tests cover the generic fallback shape and priority rules (e.g. Next over React).

Reviewed by Cursor Bugbot for commit 2b852b7. Bugbot is set up for automated code reviews on this repo. Configure here.

cgiangreco and others added 5 commits July 10, 2026 11:30
When a project has no favicon, detect the project's stack and serve a
matching default icon instead of the generic folder: React/React Native
projects (react or react-native in package.json dependencies) get a
React icon, Gradle-based Android projects get an Android icon. Detection
failures degrade to the existing generic fallback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…and social platforms

Extends the stack-detection fallback to cover more common project types:
- Next.js (detected before plain React, via 'next' dependency)
- Angular (@angular/core), Svelte (svelte / @sveltejs/kit), Vue (vue / nuxt)
- YouTube, TikTok, Instagram (detected by project directory name pattern)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace the multi-path robot body with a minimal 3-element head:
semicircle dome + rounded-bottom rectangle body, two short angled
antennae, and two eye circles.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Expo projects (mobile-first, no Gradle files at root) now get the Android
icon via the `expo` dependency check. Also shrinks the body section of the
Android SVG so it reads as a head rather than a full robot torso.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Spread the antenna tips further apart and reduce their length so they
read more like the reference Android logo proportions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a71c29b6-4b44-4884-b41f-6a8a79cf4a32

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jul 10, 2026
return SVELTE_PROJECT_FAVICON_SVG;
if (dependencyNames.has("vue") || dependencyNames.has("nuxt")) return VUE_PROJECT_FAVICON_SVG;
if (dependencyNames.has("expo") || dependencyNames.has("react-native"))
return ANDROID_PROJECT_FAVICON_SVG;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

React Native shows Android icon

Medium Severity

Projects with expo or react-native dependencies are incorrectly assigned the Android favicon. The current dependency check order returns the Android icon before the react check, which was intended for React Native projects.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5e7467f. Configure here.

Comment thread apps/server/src/http.ts
return HttpServerResponse.text("Not Found", { status: 404 });
}
if (asset.kind === "project-favicon-fallback") {
return HttpServerResponse.text(FALLBACK_PROJECT_FAVICON_SVG, {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cached fallback hides stack changes

Medium Severity

The fallback favicon SVG is now dynamically generated based on workspace configuration, but the Cache-Control: max-age=3600 header means browsers can serve an outdated icon for up to an hour after configuration changes (e.g., package.json, Gradle files), as the asset URL doesn't change.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5e7467f. Configure here.

@macroscopeapp

macroscopeapp Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

Two unresolved review comments identify bugs: React Native projects incorrectly receive the Android icon, and the caching behavior can serve stale favicons after configuration changes. These substantive issues require resolution before approval.

You can customize Macroscope's approvability policy. Learn more.

@t3dotgg

t3dotgg commented Aug 28, 2026

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.

Current main no longer uses the server SVG fallback path that this branch extends. Its stack-logo response design is based on a replaced asset path, so this implementation is no longer a current review candidate.

If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.

@t3dotgg t3dotgg closed this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants