Frontend bug: LabelEditor silently drops other-language labels when editing #55
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: Medium–High (data loss). From a frontend UX audit.
Problem
web/src/components/label-editor.tsx:23-27readsvalue.find(l => l.lang === default_language)?.label ?? value[0]?.labeland on change emits a single-entry array[{ lang: default_language, label }]. Term/authority edit rows seed the editor from the existing labels (term-row.tsx:64,authority-row.tsx), so editing a term/authority that already has labels in other languages and saving replaces the whole multilingual set with one default-language entry — silently discarding e.g. the English label of a Swedish-edited term. The component comment claims "the multilingual data model is unchanged," but on the edit path it is destructively collapsed.This is a consequence of the single-language authoring decision (instance-locale milestone), but the destructive collapse of pre-existing other-language data on edit is unintended.
Suggested fix
Make the editor's
onChangepreserve non-default-language entries:Optionally surface a hint when other-language labels exist on the entry being edited.
Source: frontend UX/design audit, 2026-06-06.
Fixed — merged to
main(d0e3772).LabelEditor.onChangenow preserves non-default-language entries instead of collapsing the record to a single default-language label:Editing a term/authority/field that already has e.g. an English label now keeps it.
Also fixed a related display flaw surfaced while testing:
currentfell back tovalue[0]?.label(an other-language label) when no default-language entry existed, so after clearing the field it jumped to the English text and a subsequent edit would save English content under the default-languagelang. The editor now shows only the default-language label (?? "").Per the issue's optional suggestion, a muted hint now appears when the edited record has labels in other languages (
labels.otherLanguages, en/sv): "This entry also has labels in other languages, which are kept."Regression tests added (preserve-on-edit, hint shown/hidden) + a
WithOtherLanguagesStorybook story. Gate green: typecheck, lint, 173 tests, build, check:size (183.6 KB gz), check:colors; en/sv parity; no codename.