feat(stammbaum): person detail Beziehungen card

- persons/[id]/+page.server.ts loads relationships and
  inferred-relationships in the existing parallel fetch.
- New PersonRelationshipsCard renders direct chips (mint) and the
  top-5 derived chips (grey) on /persons/{id}, both linked to the
  other person's page. Empty state shows
  "Noch keine Beziehungen bekannt." in muted serif.
- Card sits in the right column above the document lists.

Refs #358.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-27 14:58:43 +02:00
committed by marcel
parent 242e10179d
commit d7f4f6f163
3 changed files with 123 additions and 3 deletions

View File

@@ -11,11 +11,20 @@ export async function load({ params, fetch, locals }) {
g.permissions.includes('WRITE_ALL')
) ?? false;
const [personResult, sentDocsResult, receivedDocsResult, aliasesResult] = await Promise.all([
const [
personResult,
sentDocsResult,
receivedDocsResult,
aliasesResult,
relsResult,
inferredResult
] = await Promise.all([
api.GET('/api/persons/{id}', { params: { path: { id } } }),
api.GET('/api/persons/{id}/documents', { params: { path: { id } } }),
api.GET('/api/persons/{id}/received-documents', { params: { path: { id } } }),
api.GET('/api/persons/{id}/aliases', { params: { path: { id } } })
api.GET('/api/persons/{id}/aliases', { params: { path: { id } } }),
api.GET('/api/persons/{id}/relationships', { params: { path: { id } } }),
api.GET('/api/persons/{id}/inferred-relationships', { params: { path: { id } } })
]);
if (!personResult.response.ok) {
@@ -28,6 +37,8 @@ export async function load({ params, fetch, locals }) {
sentDocuments: sentDocsResult.data ?? [],
receivedDocuments: receivedDocsResult.data ?? [],
aliases: aliasesResult.data ?? [],
relationships: relsResult.data ?? [],
inferredRelationships: inferredResult.data ?? [],
canWrite
};
}