Preserve focused person across tree/people/detail navigation #35

Merged
justin merged 1 commits from improve-tree-people-navigation into main 2026-06-08 15:07:10 -04:00
Owner

Problem

The Tree view, People (Family) view, and person detail page each tracked the current person in independent local state, so moving between them reset you to the home person. The detail page's "← Back to tree" link also pointed at the People view (not the Tree) and carried no person, so it always landed on the default person.

Fix

Make the focused person a URL-encoded concept that travels across views:

  • Tree and People views read ?focus=<id> on load and mirror the focused person back into the URL via router.replace (no history spam). Leaving and returning keeps you centered where you were; bookmarks/shared links resolve to the right person.
  • "Open person" links carry ?from=tree / ?from=people.
  • The detail page's back link is now origin-aware: "← Back to Tree" → /tree?focus=<id> or "← Back to People" → /?focus=<id> — returns you in place.
  • New "View in tree →" link on the detail page: the previously-missing direct jump from a person to the tree re-rooted on them.
  • person→person relationship links (and create-relative redirect) pass from through so click-chains keep their anchor.
  • gitignore *.tsbuildinfo.

Verification

tsc --noEmit clean; next build passes (all three routes render dynamically, no useSearchParams/Suspense issue). Not yet click-tested in a running app.

🤖 Generated with Claude Code

## Problem The Tree view, People (Family) view, and person detail page each tracked the *current person* in independent local state, so moving between them reset you to the home person. The detail page's **"← Back to tree"** link also pointed at the People view (not the Tree) and carried no person, so it always landed on the default person. ## Fix Make the focused person a URL-encoded concept that travels across views: - **Tree** and **People** views read `?focus=<id>` on load and mirror the focused person back into the URL via `router.replace` (no history spam). Leaving and returning keeps you centered where you were; bookmarks/shared links resolve to the right person. - "Open person" links carry `?from=tree` / `?from=people`. - The detail page's back link is now **origin-aware**: "← Back to Tree" → `/tree?focus=<id>` or "← Back to People" → `/?focus=<id>` — returns you in place. - New **"View in tree →"** link on the detail page: the previously-missing direct jump from a person to the tree re-rooted on them. - person→person relationship links (and create-relative redirect) pass `from` through so click-chains keep their anchor. - gitignore `*.tsbuildinfo`. ## Verification `tsc --noEmit` clean; `next build` passes (all three routes render dynamically, no `useSearchParams`/Suspense issue). Not yet click-tested in a running app. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
justin added 1 commit 2026-06-08 14:49:02 -04:00
The Tree view, People (Family) view, and person detail page each tracked
the "current person" independently, so moving between them reset you to the
home person. The detail page's "← Back to tree" link also pointed at the
People view (not the Tree) and carried no person, so it always landed on the
default person.

Make the focused person a URL-encoded concept that travels across views:

- Tree and People views read ?focus=<id> on load and mirror the focused
  person back into the URL via router.replace (no history spam), so leaving
  and returning keeps you centered where you were. Bookmarks/shared links
  also resolve to the right person.
- "Open person" links carry ?from=tree | ?from=people.
- The detail page's back link is now origin-aware: "← Back to Tree" →
  /tree?focus=<id> or "← Back to People" → /?focus=<id>, returning you in
  place instead of to the home person.
- Add a "View in tree →" link on the detail page — the previously missing
  direct jump from a person to the tree re-rooted on them.
- person→person relationship links (and create-relative redirect) pass
  `from` through so click-chains keep their anchor.

Also gitignore *.tsbuildinfo (Next build artifact).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Justin Paul <justin@jpaul.me>
justin merged commit 9dbdae975a into main 2026-06-08 15:07:10 -04:00
justin deleted branch improve-tree-people-navigation 2026-06-08 15:07:10 -04:00
Sign in to join this conversation.