Make project identifying more robust#2258
Conversation
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
|
Important Review skippedAuto incremental 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 Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughTwo Svelte components are updated to refine project identification: HomeView switches loop keys from derived values to object references, while ProjectDropdown updates selection matching logic to use name, code, and crdt for more precise current project determination. ChangesProject List Loop Keys
Project Selection Matching Logic
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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: 1
🤖 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 `@frontend/viewer/src/project/ProjectDropdown.svelte`:
- Line 114: The Command.Item value currently uses ambiguous concatenation
value={project.name + project.code + project.crdt} which can create collisions;
replace it with a deterministic structured identifier (e.g., use project.id if
available, or a JSON/string-encoded object like JSON.stringify({id: project.id,
code: project.code, crdt: project.crdt})) and update any consumer code that
reads Command.Item value to parse the structured value; locate the
Command.Item(s) in ProjectDropdown.svelte and change the value prop from the
concatenation to the chosen structured token and adjust selection/handler logic
to use the parsed/explicit id fields.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: cf825010-2003-488c-8aed-3334732d6fbf
📒 Files selected for processing (2)
frontend/viewer/src/home/HomeView.sveltefrontend/viewer/src/project/ProjectDropdown.svelte
32ea6c1 to
34d2128
Compare
It turns out that (because we merge fwdata and crdt projects on the backend in some ways) it's trickier than we anticipated to uniquely identify projects.
E.g. given these 3 projects:
CRDT project: name(My project), code (my-proj)
FwData project: name(My project)
FwData project: name(my-proj)
The frontend ends up with 2 FwData projects:
Project 1: name(My project), code(My project)
Project 2: name(My project), code(my-proj)
So, there's a duplicate
nameand onlycodeis unique.Code is probably always unique, but my brain hurts and simply using the project object itself as the each key seems perfectly acceptable.