Conversation
- Search conventional apps, packages, and services favicon locations - Extract SVG documents and serve them with secure response headers
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
ApprovabilityVerdict: Needs human review This PR introduces custom SVG sanitization logic to strip potentially dangerous content (like You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9c263ae. Configure here.

What Changed
apps/*,packages/*, andservices/*.<svg>document, excluding XML declarations, doctypes, and trailing content.Why
T3 Code only searched favicon locations relative to the selected project root. Monorepos commonly keep their application favicon under paths such as
apps/web/public/favicon.svg, so those projects fell back to the generic folder icon.Some otherwise valid SVG favicon files also contain XML declarations or doctypes that can prevent them from rendering reliably as sidebar image assets. Extracting the SVG document before serving it keeps the original file untouched while avoiding that failure mode.
UI Changes
No layout or component changes. Projects that previously displayed the fallback folder icon can now display their application favicon when it lives in a supported monorepo workspace.
Verified in an isolated local T3 Code environment with an XML/doctype-prefixed favicon at
apps/dashboard/public/favicon.svg; both sidebar image instances loaded successfully at their intrinsic 150×150 size.Checklist
Note
Medium Risk
Touches signed asset resolution and serves transformed SVG content (mitigates trailing markup) rather than always streaming the on-disk file; favicon precedence behavior changes for monorepos.
Overview
Favicon discovery now walks one-level workspaces under
apps/,packages/, andservices/(sorted entries), reusing the same conventional filenames and HTML/metadata icon href resolution per app. Roott3.json, root candidates, and root source metadata still win before any monorepo path; unreadable monorepo directories are skipped.SVG project favicons are no longer served as raw files when possible:
resolveAssetreads.svgfavicons, runs newextractSvgDocumentto keep only the first root<svg>(drops XML/doctype/comments and trailing junk like extra<script>/second roots), and returns{ kind: "text", contentType: "image/svg+xml" }. Non-SVG favicons and unparseable SVGs still use file paths. The asset route serves thetextvariant with the same private cache andnosniffheaders as file responses.Tests cover SVG extraction edge cases, sanitized favicon resolution, and monorepo precedence/ordering.
Reviewed by Cursor Bugbot for commit 917649a. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix favicon resolution for monorepos and sanitize SVG favicons
ProjectFaviconResolver.resolvePathto search monorepo subdirectories (apps,packages,services) for favicons, checking well-known candidate paths and<link rel="icon">hrefs in source files, in stable sorted order.extractSvgDocumentin AssetAccess.ts to extract and sanitize the first complete<svg>element from raw file content, handling nested SVGs, comments, and CDATA..svgfavicon is resolved, the server now reads the file, extracts the SVG document, and returns it as an inline text asset withcontent-type: image/svg+xmlinstead of serving the raw file.Cache-ControlandX-Content-Type-Optionsheaders..svgfavicons now receive sanitized inline SVG text; non-SVG favicons and failed extractions continue to return file assets.Macroscope summarized 917649a.