CulverLab / CulverLab/sparcd-exploration
Tagger: two species can end up on the same key with no warning
- Dominant language
- TypeScript
- Stars
- 6
- Forks
- 3
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 106
Description
The tagger builds its key map by walking the species list and setting each key. If two species have the same key, the later one wins and the earlier one silently stops working. Both rows still show the key badge, so the user presses it and gets the wrong species.
The only conflict check runs when the user assigns a key by hand. It does not run when the server's `species.json` gives two species the same default key, or when a second browser tab writes an override that collides with one the first tab already has.
Where:
- `apps/sparcd-tagger/src/sections/Tag.tsx:305-311` the `keyMap` memo, `m.set(key, ...)` with no check for an existing entry
- `apps/sparcd-tagger/src/lib/keys.ts:83` `conflictingKeyOwners`, only called from `captureKey`
What to do:
Decide what should happen when two species share a key, then build that. Options are to show the conflict dialog when the map is built, to mark both rows and disable the key until the user picks, or to let the user's own override win over a server default. This is a product call, so it wants a short discussion before code.
Found in the post-merge review of #140 by the gpt-5.6-sol pass and confirmed in the source.
Serves user story: [H2 Identify species in new uploads](https://github.com/CulverLab/sparcd-requirements/wiki/User-Stories#story-h2--identify-species-in-new-uploads)
Contributor guide
Assessment
This issue has not been assessed yet.