feat(stammbaum): show inferred relationship in the document drawer
- New presentational RelationshipBadge component (labelFromA → arrow → labelFromB) wired into DocumentMetadataDrawer's Personen column, rendered after the receivers block when both endpoints are family members. - DocumentTopBar gains an optional inferredRelationship prop and passes it through. - documents/[id]/+page.server.ts loads the badge: only when sender is a family member, exactly one receiver, and that receiver is also a family member; 404 (no path) → null. - relationshipLabels.ts maps the backend label keys (parent/child/...) to localised strings, so the server load returns badge-ready strings. Refs #358. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,9 +30,16 @@ type Props = {
|
||||
canWrite: boolean;
|
||||
fileUrl: string;
|
||||
transcribeMode: boolean;
|
||||
inferredRelationship?: { labelFromA: string; labelFromB: string } | null;
|
||||
};
|
||||
|
||||
let { doc, canWrite, fileUrl, transcribeMode = $bindable() }: Props = $props();
|
||||
let {
|
||||
doc,
|
||||
canWrite,
|
||||
fileUrl,
|
||||
transcribeMode = $bindable(),
|
||||
inferredRelationship = null
|
||||
}: Props = $props();
|
||||
|
||||
let detailsOpen = $state(false);
|
||||
|
||||
@@ -275,6 +282,7 @@ let mobileMenuOpen = $state(false);
|
||||
sender={doc.sender ?? null}
|
||||
receivers={doc.receivers ? [...doc.receivers] : []}
|
||||
tags={doc.tags ? [...doc.tags] : []}
|
||||
inferredRelationship={inferredRelationship}
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user