Add project language icons - #39
Conversation
|
Warning Review limit reached
More reviews will be available in 5 minutes and 17 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughAdds project language/framework icon support across the full stack. New contract schemas define icon metadata keyed by language ID. A filesystem-based resolver detects Vue and TypeScript projects. Icons persist in the projection layer via schema migration. Orchestration engine schedules icon detection on project creation and performs once-per-process backfill. Web UI renders language glyphs in sidebars when metadata is present, otherwise falls back to folder + favicon. ChangesProject Language Icons
🎯 4 (Complex) | ⏱️ ~60 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/superpowers/plans/2026-06-01-project-language-icons.md (1)
63-63:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winRemove accidental trailing token from the document.
Line 63 contains a bare
63, which appears to be an editing artifact and should be deleted.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/superpowers/plans/2026-06-01-project-language-icons.md` at line 63, Remove the accidental trailing token "63" from the document (the bare numeric artifact currently present on line 63); edit the markdown file to delete that lone token so the document contains only intended content and then save the file (no code changes required).
🧹 Nitpick comments (2)
docs/superpowers/plans/2026-06-01-project-language-icons.md (1)
1-63: ⚡ Quick winAdd the required document metadata table for this new plan doc.
This new document should include/update its metadata table (owner/status/last-updated or repo-standard fields) to comply with docs conventions.
As per coding guidelines, "Keep metadata tables current when adding or substantially changing a document."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/superpowers/plans/2026-06-01-project-language-icons.md` around lines 1 - 63, Add a repo-standard metadata table to the top of the new plan document so it includes owner, status, and last-updated (and any other repo-required fields) to satisfy docs conventions; update the file "Project Language Icons Implementation Plan" by inserting or updating the YAML/Markdown metadata block (owner, status, last-updated) at the document head, ensure values are accurate (set owner to the responsible team/person, status to draft/in-progress/etc., and last-updated to today’s date), and keep the format consistent with other plan docs in the repo so tooling and reviewers pick it up.apps/server/src/project/Layers/ProjectLanguageIconResolver.test.ts (1)
43-58: 💤 Low valueOptional: broaden Vue/parse coverage.
packageHasDependencyalso checksdevDependencies/peerDependencies, andreadRootPackageJsonswallows malformed JSON tonull— none of these branches are exercised. Consider adding cases for adevDependencies.vueproject and a malformedpackage.json(expectingtsconfigfallback ornull).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/server/src/project/Layers/ProjectLanguageIconResolver.test.ts` around lines 43 - 58, Add unit tests for ProjectLanguageIconResolver to exercise packageHasDependency and readRootPackageJson branches: create tests that (1) place "vue" in devDependencies and (2) in peerDependencies and assert resolveMetadata(cwd) still returns { iconId: "vue", label: "Vue" when tsconfig.json exists; and (3) create a malformed package.json (invalid JSON) and assert resolveMetadata(cwd) follows the documented fallback (either returns based on tsconfig.json or null per current implementation). Reference ProjectLanguageIconResolver.resolveMetadata, packageHasDependency and readRootPackageJson when adding these cases so the resolver’s handling of dev/peer deps and malformed package.json is covered.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/server/src/orchestration/Layers/OrchestrationEngine.test.ts`:
- Around line 168-179: The polling loop that repeatedly calls
engine.getReadModel (checking project via asProjectId("project-icon-create"))
only spins 20×10ms (~200ms) which is too short and causes CI flakes; replace
this tight spin with a longer timeout or the existing longer wait-helper
pattern: either increase attempts and sleep (e.g., attempts 50 with
Effect.sleep("100 millis") for ~5s) or call the shared wait-for helper used
elsewhere, and apply the same change to the other similar loop (the second
polling block that also uses engine.getReadModel/asProjectId).
In `@apps/server/src/orchestration/Layers/OrchestrationEngine.ts`:
- Around line 188-189: The scheduled icon backfill is being forked inside
scheduleProjectIconMetadataDetection so Effect.forEach(..., { concurrency: 1 })
only serializes fiber creation rather than the work; change
scheduleProjectIconMetadataDetection to return a plain Effect (do not fork
inside it) and move the fork (Effect.forkIn / .fork) to the post-project.created
call site where the helper is invoked (or alternatively protect the body with a
semaphore) so that the forEach with concurrency: 1 actually serializes the
detection/update work; update references to projectIconDetectionScope and any
callers that currently expect a forked effect accordingly.
- Around line 168-177: The scheduled project.meta.update is enqueued based on a
snapshot and can overwrite newer iconMetadata; modify the scheduling to include
a runtime guard so the actual update only runs if iconMetadata is still missing
at execution time: when calling enqueueInternalCommand (the command with type
"project.meta.update" and CommandId.makeUnsafe(...)), include either an explicit
precondition flag/expected state (e.g., expectedIconMissing: true or
expectedIconMetadata: null) or change the handler for "project.meta.update" to
check current project.iconMetadata and skip applying the iconMetadata if it's no
longer null; ensure this check happens in the command execution path (not only
before enqueueing) so stale detections won't overwrite newer data.
In `@apps/web/src/store.ts`:
- Around line 598-602: The current logic in normalizeProjectFromReadModel and
normalizeProjectFromShell unconditionally treats incoming.iconMetadata as
nullable and may overwrite an existing non-null previous.iconMetadata with a
stale snapshot; change the assignment so you only replace previous.iconMetadata
when the incoming snapshot is fresh (e.g., compare incoming.updatedAt >
previous.updatedAt) or when previous.iconMetadata is null/undefined — i.e., if
previous?.iconMetadata is non-null and previous.updatedAt is newer than
incoming.updatedAt, keep previous.iconMetadata, otherwise use
incoming.iconMetadata (still defaulting to null if absent).
In `@docs/superpowers/plans/2026-06-01-project-language-icons.md`:
- Line 24: Change the event name used in the plan from project.meta.update to
the canonical project.meta-updated so it matches the rest of the document and
the feature summary; search for occurrences of project.meta.update (e.g., the
mention near the decider event) and replace them with project.meta-updated to
keep a single canonical event name throughout the plan and related docs.
---
Outside diff comments:
In `@docs/superpowers/plans/2026-06-01-project-language-icons.md`:
- Line 63: Remove the accidental trailing token "63" from the document (the bare
numeric artifact currently present on line 63); edit the markdown file to delete
that lone token so the document contains only intended content and then save the
file (no code changes required).
---
Nitpick comments:
In `@apps/server/src/project/Layers/ProjectLanguageIconResolver.test.ts`:
- Around line 43-58: Add unit tests for ProjectLanguageIconResolver to exercise
packageHasDependency and readRootPackageJson branches: create tests that (1)
place "vue" in devDependencies and (2) in peerDependencies and assert
resolveMetadata(cwd) still returns { iconId: "vue", label: "Vue" when
tsconfig.json exists; and (3) create a malformed package.json (invalid JSON) and
assert resolveMetadata(cwd) follows the documented fallback (either returns
based on tsconfig.json or null per current implementation). Reference
ProjectLanguageIconResolver.resolveMetadata, packageHasDependency and
readRootPackageJson when adding these cases so the resolver’s handling of
dev/peer deps and malformed package.json is covered.
In `@docs/superpowers/plans/2026-06-01-project-language-icons.md`:
- Around line 1-63: Add a repo-standard metadata table to the top of the new
plan document so it includes owner, status, and last-updated (and any other
repo-required fields) to satisfy docs conventions; update the file "Project
Language Icons Implementation Plan" by inserting or updating the YAML/Markdown
metadata block (owner, status, last-updated) at the document head, ensure values
are accurate (set owner to the responsible team/person, status to
draft/in-progress/etc., and last-updated to today’s date), and keep the format
consistent with other plan docs in the repo so tooling and reviewers pick it up.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8899b5eb-1479-4bf2-9e28-db6cbee50ec0
📒 Files selected for processing (37)
apps/server/integration/OrchestrationEngineHarness.integration.tsapps/server/src/orchestration/Layers/CheckpointReactor.test.tsapps/server/src/orchestration/Layers/OrchestrationEngine.test.tsapps/server/src/orchestration/Layers/OrchestrationEngine.tsapps/server/src/orchestration/Layers/ProjectionPipeline.test.tsapps/server/src/orchestration/Layers/ProjectionSnapshotQuery.test.tsapps/server/src/orchestration/Layers/ProjectionSnapshotQuery.tsapps/server/src/orchestration/Layers/ProviderCommandReactor.test.tsapps/server/src/orchestration/Layers/ProviderRuntimeIngestion.test.tsapps/server/src/orchestration/decider.projectScripts.test.tsapps/server/src/orchestration/decider.tsapps/server/src/orchestration/projectMetadataProjection.tsapps/server/src/orchestration/projector.tsapps/server/src/orchestration/runtimeLayer.tsapps/server/src/persistence/Layers/ProjectionProjects.tsapps/server/src/persistence/Migrations.tsapps/server/src/persistence/Migrations/038_ProjectionProjectsIconMetadata.tsapps/server/src/persistence/Services/ProjectionProjects.tsapps/server/src/project/Layers/ProjectLanguageIconResolver.test.tsapps/server/src/project/Layers/ProjectLanguageIconResolver.tsapps/server/src/project/Services/ProjectLanguageIconResolver.tsapps/web/src/components/ProjectSidebarIcon.browser.tsxapps/web/src/components/ProjectSidebarIcon.test.tsxapps/web/src/components/ProjectSidebarIcon.tsxapps/web/src/components/Sidebar.logic.test.tsapps/web/src/components/Sidebar.tsxapps/web/src/components/SidebarSearchPalette.logic.test.tsapps/web/src/components/SidebarSearchPalette.logic.tsapps/web/src/components/SidebarSearchPalette.tsxapps/web/src/components/chat/ProjectPicker.tsxapps/web/src/focusedChatContext.test.tsapps/web/src/store.test.tsapps/web/src/store.tsapps/web/src/types.tsdocs/superpowers/plans/2026-06-01-project-language-icons.mdpackages/contracts/src/orchestration.test.tspackages/contracts/src/orchestration.ts
Summary
Verification
Summary by CodeRabbit