Files
familienarchiv/frontend/src/lib/person
Marcel 0c765d8112
Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 3m54s
CI / OCR Service Tests (pull_request) Successful in 33s
CI / Backend Unit Tests (pull_request) Failing after 3m13s
CI / Unit & Component Tests (push) Failing after 3m48s
CI / OCR Service Tests (push) Successful in 39s
CI / Backend Unit Tests (push) Failing after 3m24s
fix(tests): fix 13 pre-existing vitest-browser spec failures
Fixes all remaining failing tests in the browser project. Root cause in
every case: Playwright CDP-based clicks/keyboard events do not reliably
trigger Svelte 5 onclick/onkeydown handlers. Pattern applied throughout:

- Buttons / result items: native `.element().click()` or
  `dispatchEvent(new MouseEvent('click', { bubbles: true }))`
- Keyboard events: `dispatchEvent(new KeyboardEvent('keydown', { key }))`
  on the target DOM element
- TipTap selection: `element.focus()` + Selection API +
  `document.dispatchEvent(new Event('selectionchange'))`
- ProseMirror focus for onFocus: `dispatchEvent(new FocusEvent('focus'))`

Also fixes pre-existing content/logic issues found during analysis:
- ChronikErrorCard, BulkDropZone, CorrespondenzHero: stale i18n strings
  and wrong ARIA role (combobox not textbox)
- RichtlinienRuleCard: beide beispielInput + beispielOutput required for
  arrow to render; querySelectorAll to get last code element
- admin/system/page: vi.unstubAllGlobals() in afterEach; strict-mode
  heading selector; per-call mockResolvedValueOnce for dual-card page
- DocumentList: add total prop + result count paragraph (test relied on it)
- PersonTypeahead keyboard navigation: pressKey() helper with native
  KeyboardEvent dispatch replaces userEvent.keyboard()
- PersonMultiSelect: native element clicks for result selection and
  chip removal; keydown dispatch on result div for Enter key test

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 13:15:54 +02:00
..

person (frontend)

UI for historical family members: typeahead selection, chip display, hover cards, genealogy graph, relationship management.

What this domain owns

Components: PersonTypeahead.svelte, PersonMultiSelect.svelte, PersonChip.svelte, PersonChipRow.svelte, PersonHoverCard.svelte, PersonTypeBadge.svelte, PersonTypeSelector.svelte. Utilities: personFormat.ts (full-name formatting), personLifeDates.ts (birth/death display), person-validation.ts (form validation), personHoverCard.ts (hover-card controller). Sub-folders: genealogy/ (Stammbaum view components), relationship/ (relationship graph components).

What this domain does NOT own

  • Document content — displayed in document/
  • AppUser accounts — managed in user/

Key components

Component Used in Notes
PersonTypeahead.svelte document edit, geschichte, search filters Single-person selector with debounced typeahead. Exported for use by other domains.
PersonMultiSelect.svelte document edit (receivers) Chip-based multi-person selector
PersonChip.svelte document rows, conversation view Compact display chip with link and hover card
PersonHoverCard.svelte person chips Floating card with person summary on hover

Cross-domain imports

  • shared/primitives/ — generic UI primitives
  • shared/hooks/useTypeahead.svelte.ts — typeahead keyboard/focus logic

Accessibility notes

  • PersonChip focus ring: focus-visible:ring-2 focus-visible:ring-brand-navy
  • PersonTypeahead dropdown navigable via keyboard (↑↓ Enter Escape)

Backend counterpart

backend/src/main/java/org/raddatz/familienarchiv/person/README.md