refactor: move lib-root files to lib/shared/ and finalize domain structure
- Move api.server.ts, errors.ts, types.ts, utils.ts, relativeTime.ts to lib/shared/ - Move person relationship components to lib/person/relationship/ - Move Stammbaum components to lib/person/genealogy/ - Move HelpPopover to lib/shared/primitives/ - Update all import paths across routes, specs, and lib files - Update vi.mock() paths in server-project test files - Remove now-empty legacy directories (components/, hooks/, server/, etc.) - Update vite.config.ts coverage include paths for new structure - Update frontend/CLAUDE.md to reflect domain-based lib/ layout Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -35,24 +35,40 @@ src/
|
||||
│ ├── api/ # Internal API proxies (server-side only)
|
||||
│ ├── login/ logout/ # Auth pages
|
||||
│ └── ...
|
||||
├── lib/
|
||||
│ ├── components/ # Reusable Svelte components
|
||||
│ │ ├── document/ # Document-specific components
|
||||
│ │ ├── chronik/ # Activity feed components
|
||||
│ │ └── user/ # User-related components
|
||||
├── lib/ # Domain-based package structure (mirrors backend)
|
||||
│ ├── document/ # Document domain: components, stores, services, utils
|
||||
│ │ ├── annotation/ # Annotation overlay components
|
||||
│ │ ├── comment/ # Comment thread components
|
||||
│ │ └── transcription/ # Transcription editor + block logic
|
||||
│ ├── person/ # Person domain: chips, typeahead, avatar, format
|
||||
│ │ ├── relationship/ # Relationship form + chip components
|
||||
│ │ └── genealogy/ # Stammbaum (family tree) components
|
||||
│ ├── tag/ # Tag domain: TagInput, TagChipList, TagParentPicker
|
||||
│ ├── geschichte/ # Geschichte (story) domain: editor + card
|
||||
│ ├── notification/ # Notification bell + dropdown + store
|
||||
│ ├── activity/ # Activity feed (Chronik) components
|
||||
│ ├── conversation/ # Bilateral conversation (Briefwechsel) components
|
||||
│ ├── ocr/ # OCR progress, training cards, trigger
|
||||
│ ├── user/ # User profile/password/groups section components
|
||||
│ ├── shared/ # Cross-domain utilities and primitives
|
||||
│ │ ├── actions/ # Svelte actions (clickOutside, etc.)
|
||||
│ │ ├── hooks/ # Reusable Svelte state hooks (useTypeahead, etc.)
|
||||
│ │ ├── server/ # Server-only utilities (locale, session)
|
||||
│ │ ├── services/ # Client-side service helpers
|
||||
│ │ ├── utils/ # Pure utility functions (date, search, etc.)
|
||||
│ │ ├── primitives/ # Generic UI primitives (BackButton, ProgressRing, etc.)
|
||||
│ │ ├── dashboard/ # Dashboard stat components
|
||||
│ │ ├── discussion/ # CommentThread + shared discussion UI
|
||||
│ │ ├── help/ # Help/FAQ page components
|
||||
│ │ ├── api.server.ts # Typed API client factory
|
||||
│ │ ├── errors.ts # Error code mapping (mirrors backend ErrorCode)
|
||||
│ │ ├── types.ts # Shared TypeScript types
|
||||
│ │ ├── relativeTime.ts # Relative time formatting
|
||||
│ │ └── utils.ts # Top-level shared utilities
|
||||
│ ├── generated/ # Auto-generated API types (openapi-typescript)
|
||||
│ ├── server/ # Server-only utilities (db, auth helpers)
|
||||
│ ├── services/ # Client-side service logic
|
||||
│ ├── stores/ # Svelte stores (global state)
|
||||
│ ├── types.ts # Shared TypeScript types
|
||||
│ ├── errors.ts # Error code mapping (mirrors backend ErrorCode)
|
||||
│ ├── api.server.ts # Typed API client factory
|
||||
│ ├── utils.ts # Shared utilities
|
||||
│ ├── relativeTime.ts # Time formatting
|
||||
│ ├── search.ts # Search utilities
|
||||
│ └── paraglide/ # Generated i18n code
|
||||
├── hooks/ # SvelteKit hooks (handle, handleFetch)
|
||||
└── actions/ # Custom Svelte actions (click outside, etc.)
|
||||
└── ... # Other SvelteKit config files
|
||||
```
|
||||
|
||||
## API Client Pattern
|
||||
@@ -130,14 +146,15 @@ Card pattern for content sections:
|
||||
|
||||
## Key UI Components
|
||||
|
||||
| Component | Props | Description |
|
||||
| -------------------- | ---------------------------------------------------- | ------------------------------------- |
|
||||
| `PersonTypeahead` | `name`, `label`, `value`, `initialName`, `on:change` | Single-person selector with typeahead |
|
||||
| `PersonMultiSelect` | `selectedPersons` (bind) | Chip-based multi-person selector |
|
||||
| `TagInput` | `tags` (bind), `allowCreation?`, `on:change` | Tag chip input with typeahead |
|
||||
| `PdfViewer` | `url`, `annotations`, `on:annotation` | PDF rendering with annotation overlay |
|
||||
| `TranscriptionBlock` | `block`, `mode` | Read/edit transcription block |
|
||||
| `DocumentTopBar` | `document` | Responsive document metadata header |
|
||||
| Component | Location | Props | Description |
|
||||
| -------------------- | ------------------------------ | --------------------------------------- | ------------------------------------------ |
|
||||
| `PersonTypeahead` | `$lib/person/` | `name`, `label`, `value`, `initialName` | Single-person selector with typeahead |
|
||||
| `PersonMultiSelect` | `$lib/person/` | `selectedPersons` (bind) | Chip-based multi-person selector |
|
||||
| `TagInput` | `$lib/tag/` | `tags` (bind), `allowCreation?` | Tag chip input with typeahead |
|
||||
| `PdfViewer` | `$lib/document/` | `url`, `annotations` | PDF rendering with annotation overlay |
|
||||
| `TranscriptionBlock` | `$lib/document/transcription/` | `block`, `mode` | Read/edit transcription block |
|
||||
| `DocumentTopBar` | `$lib/document/` | `document` | Responsive document metadata header |
|
||||
| `BackButton` | `$lib/shared/primitives/` | — | Calls `history.back()`; 44 px touch target |
|
||||
|
||||
## How to Run
|
||||
|
||||
|
||||
Reference in New Issue
Block a user