Skip to content

Make project identifying more robust#2258

Merged
myieye merged 1 commit into
developfrom
fix-duplicate-project-identification
May 6, 2026
Merged

Make project identifying more robust#2258
myieye merged 1 commit into
developfrom
fix-duplicate-project-identification

Conversation

@myieye
Copy link
Copy Markdown
Collaborator

@myieye myieye commented May 6, 2026

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 name and only code is unique.
Code is probably always unique, but my brain hurts and simply using the project object itself as the each key seems perfectly acceptable.

@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

UI unit Tests

  1 files  ±0   59 suites  ±0   32s ⏱️ +7s
176 tests ±0  176 ✅ ±0  0 💤 ±0  0 ❌ ±0 
245 runs  ±0  245 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 32ea6c1. ± Comparison against base commit 4cc63fc.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

C# Unit Tests

165 tests  ±0   165 ✅ ±0   18s ⏱️ -1s
 23 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 32ea6c1. ± Comparison against base commit 4cc63fc.

@argos-ci
Copy link
Copy Markdown

argos-ci Bot commented May 6, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - May 6, 2026, 1:30 PM

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Important

Review skipped

Auto incremental 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: f46b1016-8c54-416a-9ed5-82c9c1b967d6

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
📝 Walkthrough

Walkthrough

Two 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.

Changes

Project List Loop Keys

Layer / File(s) Summary
Loop Key Updates
frontend/viewer/src/home/HomeView.svelte
Local CRDT projects key changed from project.id ?? project to project; fwdata projects key changed from project.name to project with added comment noting potential duplicate concerns.

Project Selection Matching Logic

Layer / File(s) Summary
Selection Determination
frontend/viewer/src/project/ProjectDropdown.svelte
New isCurrentProject constant introduced to determine highlighting with both crdt match and secondary name/code match. Command.Item value expanded from name+crdt to name+code+crdt; matching logic refined from broader OR condition to more precise AND-based condition.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • hahn-kev
  • rmunn

Poem

🐰 Keys and codes align with grace,
Each project finds its proper place,
Selection logic now precise—
No more ambiguous advice!
Objects keyed, matching refined,
A cleaner sort of UI designed.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: making project identification more robust by using the project object as a key instead of derived identifiers.
Description check ✅ Passed The description is directly related to the changeset, explaining the problem with duplicate project identification and justifying the solution of using the project object itself as the key.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-duplicate-project-identification

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4cc63fc and 32ea6c1.

📒 Files selected for processing (2)
  • frontend/viewer/src/home/HomeView.svelte
  • frontend/viewer/src/project/ProjectDropdown.svelte

Comment thread frontend/viewer/src/project/ProjectDropdown.svelte Outdated
@myieye myieye force-pushed the fix-duplicate-project-identification branch from 32ea6c1 to 34d2128 Compare May 6, 2026 13:26
@myieye myieye merged commit 9470018 into develop May 6, 2026
13 checks passed
@myieye myieye deleted the fix-duplicate-project-identification branch May 6, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant