Commit
Make Batch Edit "Add to existing" tags actually merge
Commit details
Commit notes
The Tags step in BatchEditModal offered a "Replace all" / "Add to existing" toggle, but "add" still sent the tag list as a replacement — it silently clobbered each sample's existing tags. The comment in the handler even noted the merge was unimplemented.
Thread a `tagsMode` ('replace' | 'add') through the batch update path. The PATCH /samples/batch handler now, in "add" mode, merges the provided tags into each sample's current tags (de-duplicated, existing order preserved) instead of overwriting; "replace" keeps the prior set-or-clear behaviour. The modal no longer clears tags when "add" is selected with an empty input.
Covered by a DB-backed integration test for the add (merge + dedupe), replace, and clear cases.
- Files changed
- 5
- Lines added
- +207
- Lines removed
- −13