refactor(web): route all icon imports through one barrel - #7963
Conversation
|
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:
Comment |
|
UI consistency: one web file still bypasses the new
import {
BotIcon,
CircleAlertIcon,
PencilRulerIcon,
type LucideIcon,
LockIcon,
LockOpenIcon,
PenLineIcon,
SparklesIcon,
XIcon,
} from "lucide-react";Two consequences that come from lines changed in this PR:
Smallest fix: change that one specifier to } from "~/icons";(Posted as a conversation comment rather than inline because the file is not part of this diff.) Posted via Macroscope — UI Consistency |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This is a broad web import-graph refactor that introduces a generated icon abstraction and changes imports across the production UI, including authentication-related components. It also adds explicit lint and diagnostic suppressions, so the change warrants human review despite the intended reference-preserving behavior. You can add or adjust custom eligibility rules. Learn more. |
|
Good catch — fixed in c67ca0c50. The codemod's grep had skipped ChatComposer.tsx because the file contains literal NUL bytes in a template string (grep binary detection); the sweep now reads file bytes instead, and a re-scan confirms zero direct lucide-react imports remain outside the barrel. Macroscope's UI Consistency check passes on the latest commit. |
|
Factual check on the Macroscope UI-consistency comment against current head The separate unresolved generator finding is still valid: declaration-level |
4e958a7 to
7e8c6c1
Compare
c0fb01a to
d0a4c9c
Compare
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 6b9f440097c0b914454b0ad74679020408d85e52. Configure here.
6b9f440 to
7fae5ca
Compare
7fae5ca to
3978288
Compare
|
can we not fix this with a vite plugin or smth?? |

Web icon imports now go through one generated static module, while project-selected icons use a separate dynamic lookup. This gives the web app one checked import surface and catches direct or misspelled Lucide imports before they drift into the codebase.
The generator uses the workspace TypeScript parser, validates names against
lucide-react, and verifies that the checked-in module is current. The integration also preserves the latest environment-filter and model-price controls while routing their icons through the same module.Verification
Current head
ce70ae4f6c5afe13ca4295d6a3e300e852783414includes upstream main82c2b7ffb4d450572f5baf9a70693f1e25cfdfed. The merge keeps upstream's menu radio indicator and obsolete composer-test deletion.vp test run apps/web/src/icons/icon-imports.test.ts apps/web/src/icons/index.test.ts: 6 tests passed.vp test run apps/web/src/components/ProjectFavicon.test.tsx apps/web/src/components/ThreadStatusIndicators.test.ts apps/web/src/components/pullRequest/PullRequestListFilters.test.tsx: 53 tests passed across 4 files.icons:generate,icons:check, and typecheck passed; all 226 generated exports are current.A fresh read-only review of the merge resolution found no actionable issues. Current integrated Settings navigation shows the same icons and labels before and after the import refactor.
Annotated before · Annotated after.
Capture conditions: baseline main
39802c061, candidate integration0d60fe9be45bec12356ab116796008d44c3d2a7bcontaining exact PR headce70ae4f6c5afe13ca4295d6a3e300e852783414; same dark Settings General navigation. Matching crops x0,y60,width256,height740 omit the header and settings content changed by other integrated PRs. This is representative icon-rendering evidence, not a standalone build or a performance measurement. Reference-identity tests cover all generated icon exports. Images were inspected and all uploaded bytes were retrieved and hash-verified. No new interaction is introduced by changing icon imports.Implemented and reviewed with GPT-6 and GPT-5.6 Sol in the Codex harness. A direct Claude Opus 5 high review availability attempt exited 1 because OAuth had expired; no Opus review occurred.
Note
Route all web Lucide icon imports through single
~/iconsbarrellucide-reactexports, and writes or checks the generated barrel at index.tsDynamicIcon,IconName, andiconNamesfromlucide-react/dynamic~/iconsinstead oflucide-reactdirectlyno-restricted-importsrule in vite.config.ts that flags directlucide-reactimports and directs developers to~/iconsicons:checkandicons:generatescripts to package.json, plus identity and parser tests underapps/web/src/icons/lucide-reactimport will fail lint; the barrel must be regenerated viaicons:generatewhen new icons are used or CI'sicons:checkwill failMacroscope summarized ce70ae4.