Tree: clicking ×N flies to the person's other copy #249

Merged
justin merged 1 commits from tree-fly-to-duplicate into main 2026-06-11 08:48:00 -04:00
Owner

The tree is too big for an in-place flash to help — the other copy is usually off-screen. Clicking the ×N badge now pans/zooms the view to center the other copy and flashes it on arrival; clicking again cycles through the remaining copies (for someone drawn 3+ times).

Uses family-chart's exported handlers.cardToMiddle (centers a datum) keeping the current zoom via getCurrentZoom. The target coords come from the card's bound x/y (fallback: its transform attr). Verified against the library internals: setupZoom(f3Canvas) puts the zoom object on the svg's parent (so getCurrentZoom(svg) resolves), and .card_cont is positioned by d.x/d.y — the same space cardToMiddle uses. Falls back to an in-place flash if the zoom object isn't ready.

Frontend only, type-checks clean. Supersedes the flash-only behavior from the previous PR.

🤖 Generated with Claude Code

The tree is too big for an in-place flash to help — the other copy is usually off-screen. Clicking the `×N` badge now **pans/zooms the view to center the other copy** and flashes it on arrival; clicking again **cycles** through the remaining copies (for someone drawn 3+ times). Uses family-chart's exported `handlers.cardToMiddle` (centers a datum) keeping the current zoom via `getCurrentZoom`. The target coords come from the card's bound `x/y` (fallback: its `transform` attr). Verified against the library internals: `setupZoom(f3Canvas)` puts the zoom object on the svg's parent (so `getCurrentZoom(svg)` resolves), and `.card_cont` is positioned by `d.x/d.y` — the same space `cardToMiddle` uses. Falls back to an in-place flash if the zoom object isn't ready. Frontend only, type-checks clean. Supersedes the flash-only behavior from the previous PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
justin added 1 commit 2026-06-11 08:47:59 -04:00
On a large tree the duplicate's other copy is usually off-screen, so flashing
in place wasn't enough. Clicking the ×N badge now pans/zooms the view to center
the other copy and flashes it on arrival; clicking again cycles through the
remaining copies (for a person drawn 3+ times).

Uses family-chart's exported handlers: cardToMiddle centers a datum (read from
the target card_cont's bound x/y, falling back to its transform attr), keeping
the current zoom level via getCurrentZoom. Verified against the lib: the svg's
parent (f3Canvas) holds the zoom object, and cards are positioned by datum x/y —
same coordinate space cardToMiddle expects. Falls back to an in-place flash if
the zoom object isn't ready. Frontend only; supersedes the flash-only behavior.

Signed-off-by: Justin Paul <justin@jpaul.me>
justin merged commit 0ed6ba4505 into main 2026-06-11 08:48:00 -04:00
justin deleted branch tree-fly-to-duplicate 2026-06-11 08:48:00 -04:00
Sign in to join this conversation.