An interactive family-tree builder for macOS that lets you create profiles, connect relatives (and pets), and arrange a visual graph with drag-and-drop, zoom/pan, and inline editing. State is persisted locally so members, connections, and layout survive app restarts.
- Main menu with story/onboarding, profile setup, add/edit member flows, and dual “My Tree” views (list vs. graph).
- Member profiles: emoji/avatar picker, age/relationship fields, validation, and inline success feedback.
- Graph editing: drag from the member list onto the canvas, reposition nodes, pinch/scroll zoom, pan, draw/delete connections (double-tap a line), and hide members without losing data.
- Relationship logic: bidirectional edges with per-edge counts (capped at 5) and role-aware mapping for pets, spouses, and multi-generation ties to keep labels sensible.
- Persistence: members, user profile, and node positions are JSON-encoded to
UserDefaultsfor instant, offline storage. - UX helpers: movable “💡” tip button with contextual guidance on each screen.
Member(Data): Codable, Identifiable node with connections and connection counts; initialization backfills counts for legacy data.TreeDataManager(State):ObservableObjectholding members, user profile, positions, and view flags; centralizes add/update/delete, drag position updates, and relationship cleanup when hiding/removing nodes.- Views:
MainMenuViewhosts navigation and landing.ProfileSetupView,AddMemberView,EditMemberView/EditMemberFormViewhandle profile CRUD with emoji picker.TreeViewoffers list vs. graph modes; list shows connection summaries, graph renders nodes/edges with hide/delete controls.CombinedTreeView+FamilyTreeViewWithDroppower the editable canvas with drag-and-drop, zoom/pan, and connection drawing/deletion.- Shared components:
MemberNode,ConnectionLine,TipButton,TipBoxView,EmojiPickerView.
- Requirements: macOS 13+ and Xcode 15+ (SwiftUI + AppKit).
- Open
FM_test.xcodeprojin Xcode. - Select the
FM_testAppscheme and run (⌘R). - In the app: open the menu (tree icon), set up “My Profile,” then add members, connect them on “Edit Tree,” and explore “My Tree.”
FM_testApp.swift– app entry.ContentView.swift– root view wiringTreeDataManagerintoMainMenuView.Member.swift– data model with connection counts.TreeDataManager.swift– state/persistence layer.MainMenuView.swift,MenuTab.swift– navigation shell.ProfileSetupView.swift,AddMemberView.swift,EditMemberView.swift,EditMemberFormView.swift– profile/member CRUD.TreeView.swift– list + read-only graph view with hide/delete.CombinedTreeView.swift,FamilyTreeViewWithDrop.swift– editable graph canvas with drag/drop, zoom/pan, connection logic.SharedComponents.swift,EmojiPickerView.swift,StoryView.swift– reusable UI and onboarding.
- Persistence is local to the device (UserDefaults); consider CloudKit/Core Data for sync.
- Connection roles are heuristic; extending them with explicit relation metadata could improve clarity for complex trees.
- No automated tests are included; snapshot/UI tests would help guard gesture-heavy flows.