diff --git a/backend/src/main/java/org/raddatz/familienarchiv/repository/TranscriptionBlockRepository.java b/backend/src/main/java/org/raddatz/familienarchiv/repository/TranscriptionBlockRepository.java index 8e61e09d..5c2d34e2 100644 --- a/backend/src/main/java/org/raddatz/familienarchiv/repository/TranscriptionBlockRepository.java +++ b/backend/src/main/java/org/raddatz/familienarchiv/repository/TranscriptionBlockRepository.java @@ -60,6 +60,8 @@ public interface TranscriptionBlockRepository extends JpaRepository findSegmentationBlocks(); + // Uses 'KURRENT_RECOGNITION' MEMBER OF d.trainingLabels — aligned with findEligibleKurrentBlocks() + // which already used this form (changed from d.scriptType = 'KURRENT' in the original queries). @Query(""" SELECT COUNT(b) FROM TranscriptionBlock b JOIN Document d ON d.id = b.documentId @@ -69,6 +71,8 @@ public interface TranscriptionBlockRepository extends JpaRepository(Set.of(TrainingLabel.KURRENT_RECOGNITION))) + .trainingLabels(kurrentLabels()) .build()); kurrentDocId = kurrentDoc.getId(); @@ -123,7 +123,7 @@ class TrainingBlockQueryTest { .originalFilename("karl.pdf") .status(DocumentStatus.UPLOADED) .sender(sender) - .trainingLabels(new HashSet<>(Set.of(TrainingLabel.KURRENT_RECOGNITION))) + .trainingLabels(kurrentLabels()) .build()); UUID annId = annotationRepository.save(annotation(doc.getId())).getId(); blockRepository.save(block(doc.getId(), annId, BlockSource.MANUAL, false)); @@ -158,7 +158,7 @@ class TrainingBlockQueryTest { .originalFilename("karl.pdf") .status(DocumentStatus.UPLOADED) .sender(sender) - .trainingLabels(new HashSet<>(Set.of(TrainingLabel.KURRENT_RECOGNITION))) + .trainingLabels(kurrentLabels()) .build()); UUID annId = annotationRepository.save(annotation(doc.getId())).getId(); blockRepository.save(block(doc.getId(), annId, BlockSource.OCR, false)); @@ -177,7 +177,7 @@ class TrainingBlockQueryTest { .originalFilename("karl.pdf") .status(DocumentStatus.UPLOADED) .sender(karl) - .trainingLabels(new HashSet<>(Set.of(TrainingLabel.KURRENT_RECOGNITION))) + .trainingLabels(kurrentLabels()) .build()); UUID annId = annotationRepository.save(annotation(doc.getId())).getId(); blockRepository.save(block(doc.getId(), annId, BlockSource.MANUAL, false)); @@ -195,7 +195,7 @@ class TrainingBlockQueryTest { .originalFilename("karl.pdf") .status(DocumentStatus.UPLOADED) .sender(sender) - .trainingLabels(new HashSet<>(Set.of(TrainingLabel.KURRENT_RECOGNITION))) + .trainingLabels(kurrentLabels()) .build()); UUID annId = annotationRepository.save(annotation(doc.getId())).getId(); blockRepository.save(block(doc.getId(), annId, BlockSource.MANUAL, false)); @@ -218,6 +218,10 @@ class TrainingBlockQueryTest { // ─── helpers ───────────────────────────────────────────────────────────── + private static Set kurrentLabels() { + return new HashSet<>(Set.of(TrainingLabel.KURRENT_RECOGNITION)); + } + private DocumentAnnotation annotation(UUID docId) { return DocumentAnnotation.builder() .documentId(docId) diff --git a/frontend/messages/de.json b/frontend/messages/de.json index 28fb6f67..2ab6edc6 100644 --- a/frontend/messages/de.json +++ b/frontend/messages/de.json @@ -503,7 +503,7 @@ "doc_details_more_receivers": "+{count} weitere", "transcription_mode_label": "Transkribieren", "transcription_mode_stop": "Fertig", - "transcription_block_placeholder": "Text hier eingeben...", + "transcription_block_placeholder": "Text eingeben — mit @Name eine Person aus dem Archiv verknüpfen", "transcription_block_save_saving": "Speichere...", "transcription_block_save_saved": "Gespeichert", "transcription_block_save_error": "Nicht gespeichert", diff --git a/frontend/messages/en.json b/frontend/messages/en.json index 1d811734..0a39a394 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -503,7 +503,7 @@ "doc_details_more_receivers": "+{count} more", "transcription_mode_label": "Transcribe", "transcription_mode_stop": "Done", - "transcription_block_placeholder": "Type text here...", + "transcription_block_placeholder": "Type text — use @name to link a person from the archive", "transcription_block_save_saving": "Saving...", "transcription_block_save_saved": "Saved", "transcription_block_save_error": "Not saved", diff --git a/frontend/messages/es.json b/frontend/messages/es.json index 06b805e8..29e50e9f 100644 --- a/frontend/messages/es.json +++ b/frontend/messages/es.json @@ -503,7 +503,7 @@ "doc_details_more_receivers": "+{count} más", "transcription_mode_label": "Transcribir", "transcription_mode_stop": "Listo", - "transcription_block_placeholder": "Escriba el texto aquí...", + "transcription_block_placeholder": "Escriba el texto — use @nombre para vincular a una persona del archivo", "transcription_block_save_saving": "Guardando...", "transcription_block_save_saved": "Guardado", "transcription_block_save_error": "No guardado", diff --git a/frontend/src/lib/components/PersonMentionEditor.svelte.spec.ts b/frontend/src/lib/components/PersonMentionEditor.svelte.spec.ts index 15f04f7d..be17e100 100644 --- a/frontend/src/lib/components/PersonMentionEditor.svelte.spec.ts +++ b/frontend/src/lib/components/PersonMentionEditor.svelte.spec.ts @@ -10,6 +10,7 @@ import { cleanup, render } from 'vitest-browser-svelte'; import { page, userEvent } from 'vitest/browser'; import PersonMentionEditorHost from './PersonMentionEditor.test-host.svelte'; import type { components } from '$lib/generated/api'; +import { m } from '$lib/paraglide/messages.js'; type Person = components['schemas']['Person']; type PersonMention = components['schemas']['PersonMention']; @@ -395,6 +396,14 @@ describe('PersonMentionEditor — placeholder behavior', () => { }); }); +// ─── i18n message content ───────────────────────────────────────────────────── + +describe('PersonMentionEditor — i18n message content', () => { + it('transcription_block_placeholder contains @ mention trigger for discoverability', () => { + expect(m.transcription_block_placeholder()).toContain('@'); + }); +}); + // ─── Touch target (WCAG 2.2 AA) ────────────────────────────────────────────── describe('PersonMentionEditor — touch target', () => {