feat(stammbaum): centre-on-person control in the panel title row (#692)
Add an onCentre control to StammbaumSidePanel (title row, both desktop aside and mobile sheet). The page drives a one-shot centreOnId so StammbaumTree recentres the canvas on the focal node (US-PAN-005). Also tighten the panel spec's deathYear fixture to a valid type. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -10,9 +10,10 @@ interface Props {
|
||||
node: PersonNodeDTO;
|
||||
canWrite: boolean;
|
||||
onClose: () => void;
|
||||
onCentre?: () => void;
|
||||
}
|
||||
|
||||
let { node, canWrite, onClose }: Props = $props();
|
||||
let { node, canWrite, onClose, onCentre }: Props = $props();
|
||||
|
||||
// Swipe the sheet down past this threshold to dismiss it (Leonie).
|
||||
const SWIPE_DISMISS_PX = 80;
|
||||
@@ -70,5 +71,5 @@ function onKeydown(event: KeyboardEvent) {
|
||||
<div class="h-1 w-10 rounded-full bg-line" aria-hidden="true"></div>
|
||||
</div>
|
||||
|
||||
<StammbaumSidePanel node={node} canWrite={canWrite} onClose={onClose} />
|
||||
<StammbaumSidePanel node={node} canWrite={canWrite} onClose={onClose} onCentre={onCentre} />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user