Dokumenttitel automatisch mit Datum/Ort synchronisieren (Save-time + Backfill) (#726) #727

Merged
marcel merged 9 commits from feat/issue-726-auto-title-sync into main 2026-06-04 17:32:50 +02:00
2 changed files with 6 additions and 3 deletions
Showing only changes of commit 0693cfddd1 - Show all commits

View File

@@ -78,7 +78,7 @@ const titleValue = $derived(titleDirty ? currentTitle : suggestedTitle || curren
class="block w-full rounded border border-line p-2 text-sm shadow-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring"
/>
{#if showTitleHelp}
<p id="title-help" class="mt-1 text-xs text-ink-3">
<p id="title-help" class="mt-1 text-sm text-ink-3">
{m.form_helper_title_autogenerated()}
</p>
{/if}

View File

@@ -1,6 +1,7 @@
import { afterEach, describe, expect, it } from 'vitest';
import { cleanup, render } from 'vitest-browser-svelte';
import DescriptionSection from './DescriptionSection.svelte';
import { m } from '$lib/paraglide/messages.js';
afterEach(() => cleanup());
@@ -57,11 +58,13 @@ describe('DescriptionSection — onMount seeding (Felix B1/B2 fix regression fen
});
describe('DescriptionSection — auto-generated title helper (FR-TITLE-005)', () => {
it('shows the helper and wires aria-describedby when showTitleHelp is set', async () => {
it('shows the helper with the localized text and wires aria-describedby when showTitleHelp is set', async () => {
render(DescriptionSection, { showTitleHelp: true });
const help = document.querySelector('#title-help') as HTMLElement;
expect(help).not.toBeNull();
expect(help.textContent?.trim().length ?? 0).toBeGreaterThan(0);
expect(help.textContent?.trim()).toBe(m.form_helper_title_autogenerated());
// ≥14px for the 60+ audience (FR-005 prefers a larger size than the 12px field hints).
expect(help.classList.contains('text-sm')).toBe(true);
const titleInput = document.querySelector('input#title') as HTMLInputElement;
expect(titleInput.getAttribute('aria-describedby')).toBe('title-help');
});