Remove the read-only "Originaltext" date field that confuses editors #710
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?
Problem
The document edit form and detail views show an "Originaltext:" field — the verbatim date cell as it came in from the Excel/ODS import (e.g.
Sommer 1916), stored in the backend asmetaDateRaw.It confuses people for two reasons:
We want to remove this field everywhere it is visible in the frontend. The data stays in the backend untouched — we only stop showing and re-submitting it in the UI.
Key facts established during scoping
DocumentService(update) only overwritesmetaDateRawwhen the field is present in the request (if (dto.getMetaDateRaw() != null) { ... },DocumentService.java:464). The edit form currently re-submits the value via a hidden<input name="metaDateRaw">. Removing that hidden input means edits simply omit the field, and the backend preserves the stored value. No data loss, no backend change required.metaDateRawhas two roles in the frontend:SEASON-precision dates,formatDocumentDatereads the raw cell (seasonFromRaw) to pick the correct season word ("Sommer") instead of deriving it from the anchor month. This is not a user-facing field — it just keeps season labels accurate, andseasonFromRawonly matches a fixed allowlist (never emits the raw text).Decision: remove all visible "Originaltext" rendering, but keep
metaDateRawflowing internally into the season formatter. This way no date label silently changes; we only remove the confusing field and nothing else.Change inventory
frontend/src/lib/document/WhoWhenSection.svelte{#if rawDate && rawDate.trim().length > 0}block (visible text + the hiddenmetaDateRawinput that re-submits it). Remove therawDateprop (declaration + type).frontend/src/lib/document/DocumentEditLayout.svelte(~line 211)rawDate={doc.metaDateRaw ?? ''}passed intoWhoWhenSection.frontend/src/lib/document/DocumentDate.svelteshowRawprop andshowRawLinederived. Keep therawprop — it still feedsformatDocumentDatefor the season word. Also remove the now-stale CWE-79 / WCAG 1.4.13 "visible secondary line" comment block (the DOM sink it documents is being deleted).frontend/src/lib/document/DocumentRow.svelte(lines ~169–197)showRaw={false}props passed to<DocumentDate>(the prop no longer exists — leaving them in failssvelte-check). Trim the explanatory comment at ~169–170 that justifiesshowRaw={false}, since the raw line is now gone for every caller.frontend/src/lib/document/DocumentMetadataDrawer.svelteraw={metaDateRaw}passed intoDocumentDate(for the season word). Tighten the date-cell condition from `{#if documentDatefrontend/src/lib/document/DocumentTopBarTitle.sveltemetaDateRawinternally viaformatDocumentDate, with no visible "Originaltext" label.frontend/src/lib/shared/utils/documentDate.tsseasonLabel). The internalseasonFromRawuse stays.frontend/messages/{de,en,es}.jsondate_original_labelkey ("Originaltext:"/"Original:"/"Texto original:"). Confirm no other references remain.Tests
frontend/src/lib/document/WhoWhenSection.svelte.test.ts(~line 97)rawDateand asserts thewho-when-rawblock + HTML-escaping. Flip it to assert the field is no longer rendered, and add an assertion that no hiddeninput[name="metaDateRaw"]is present — this is the test that guards the core "no round-trip" acceptance criterion.frontend/src/lib/document/DocumentDate.svelte.test.ts(lines 21, 28)rawconsumer isseasonFromRaw, which matches a fixed allowlist and never emits raw text.)frontend/src/lib/document/DocumentMetadataDrawer.svelte.test.tsdocumentDatenull,metaDateRawset) renders "—" and does not surface the raw text.Acceptance criteria
WhoWhenSection).DocumentMetadataDrawer) and the date component (DocumentDate).metaDateRaw— asserted by aWhoWhenSectiontest confirming the hiddenmetaDateRawinput is absent; the stored value is preserved by the backend's partial update.SEASON-precision date labels are unchanged (season word still derived from the raw cell internally).date_original_labelis removed from all three message files and has no remaining references.metaDateRaw/raw-line comments inDocumentDate.svelte,DocumentRow.svelte, anddocumentDate.tsare removed.npm run lint,npm run check, and the affected unit tests pass.Out of scope
metaDateRawcolumn / field from the backend or API.metaDateRaw.Scoped via brainstorming; reviewed by the
review-issuepersona panel (findings folded in: DocumentRowshowRawremoval, the two named DocumentDate tests, the no-round-trip assertion, drawer-condition test, and stale-comment cleanup).Implemented in PR #712 (branch
feat/issue-710-remove-originaltext, worktree-based onmain, TDD).Commits
914eadf3feat(document): drop the read-only Originaltext field from the edit formbd54ea80feat(document): remove the visible Originaltext line from DocumentDatecf922100feat(document): stop surfacing the raw cell in the detail drawer73712d11chore(i18n): drop the unused date_original_label key and stale commentsAcceptance criteria
WhoWhenSection)DocumentMetadataDrawer) andDocumentDatemetaDateRaw— asserted by aWhoWhenSectiontest confirming the hidden input is absentSEASON-precision labels unchanged (season word still derived from the raw cell internally)date_original_labelremoved from all three message files; no remaining referencesmetaDateRaw/raw-line comments removed inDocumentDate.svelte,DocumentRow.svelte,documentDate.tsnpm run lintandnpm run checkpass (no new errors vs.mainbaseline); browser-project tests run in CINext: multi-persona review running on PR #712.