Skip to content

feat: standalone Goal Tree page with 3D tree and list views#81

Merged
atomantic merged 7 commits intomainfrom
feat/goal-tree-page
Mar 6, 2026
Merged

feat: standalone Goal Tree page with 3D tree and list views#81
atomantic merged 7 commits intomainfrom
feat/goal-tree-page

Conversation

@atomantic
Copy link
Owner

Summary

  • Add hierarchical goal system with parentId and tags fields to goal schema, with lazy migration for existing goals
  • New GET /goals/tree endpoint that builds hierarchical tree structure with tag index
  • Cycle detection on parent updates, orphan-on-delete reparenting (children move to grandparent)
  • New /goals standalone page with two URL-driven tabs:
    • Tree view: 3D Three.js visualization with category-colored spheres, urgency-based sizing/glow, parent-child + tag cross-link edges, OrbitControls, category filter bar, search, legend
    • List view: Collapsible indented tree with search, inline add sub-goal, expand/collapse all
  • Shared GoalDetailPanel for editing goals (title, description, category, horizon, parent, tags), managing milestones, complete/delete actions
  • Tiered radial layout: lifetime goals at center, shorter horizons in outer rings, sub-goals clustered near parents

Test plan

  • Server tests pass (1772 tests)
  • Client builds successfully
  • Navigate to /goals/tree — see 3D tree (empty or with migrated root goals)
  • Create root goal, add sub-goals beneath it — verify parent-child edges render
  • Switch to /goals/list — see indented list, edit inline, add sub-goals
  • Add tags to goals, verify cross-link edges appear in tree view
  • Delete a parent goal — verify children reparent to grandparent
  • Verify existing Digital Twin > Goals tab still works unchanged

…nalysis

Reviewed all 3 existing POSThuman repos (CLI, Ionic, Meteor) from 2018.
Drafted complete web feature list and recommends integrating as a
Digital Twin daily check-in tab rather than standalone app due to
strong M42/M49 synergy.
Add hierarchical goal system with parentId/tags fields, lazy migration,
cycle detection, orphan-on-delete reparenting, and a new /goals page
with 3D Three.js tree visualization and collapsible list view.
Copilot AI review requested due to automatic review settings March 6, 2026 20:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds hierarchical goals (parent/child + tags) and a standalone Goals page that can render both a 3D tree visualization and an indented list, backed by a new server endpoint that returns a computed goal tree.

Changes:

  • Server: extend goal schema with parentId + tags, add lazy migration, add cycle detection + orphan-on-delete reparenting, and introduce GET /goals/tree.
  • Client: add /goals/:tab page with Tree/List views and a shared GoalDetailPanel for editing goals, tags, milestones, and actions.
  • Docs: add a research note about POSThuman integration (currently unrelated to the goals feature PR).

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
server/services/identity.js Adds lazy migration for new goal fields, parent validation + cycle detection, reparent-on-delete, and getGoalsTree() for hierarchical output.
server/routes/identity.js Exposes GET /api/digital-twin/identity/goals/tree.
server/lib/identityValidation.js Extends Zod schemas to accept parentId and tags.
client/src/services/api.js Adds getGoalsTree() API wrapper.
client/src/pages/Goals.jsx New standalone Goals page with URL-driven Tree/List tabs and refresh.
client/src/components/goals/goalTreeLayout.js Computes a tiered radial 3D layout + parent/tag edges.
client/src/components/goals/GoalsTreeView.jsx Renders 3D graph via Three/Fiber with filtering, search, legend, and detail panel selection.
client/src/components/goals/GoalsListView.jsx Renders hierarchical list UI with expand/collapse, search, and inline sub-goal creation.
client/src/components/goals/GoalDetailPanel.jsx Shared detail/edit panel including parent selection, tags, milestones, complete/delete actions.
client/src/components/Layout.jsx Adds a top-level “Goals” nav item and treats /goals as full-width.
client/src/App.jsx Adds routes for /goals and /goals/:tab.
docs/research/posthuman-web-feature-review.md Adds POSThuman feature review doc (not directly tied to goal-tree feature).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

… dashed tag edges, deterministic layout, add goal tree tests

- Fix GoalsListView passing boolean instead of expandedIds Set to child rows
- Clear GoalEdges geometry when edges become empty to prevent stale rendering
- Split parent/tag edges into separate line segments with dashed material for tags
- Replace Math.random() with seeded PRNG based on goal id for deterministic layout
- Add tests for parentId, tags, cycle detection, reparenting on delete, getGoalsTree
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

…tances for dashed edges

- Deduplicate tags in tagIndex building and normalize tags on update
- Sort ring buckets numerically so parent nodes position before children
- Call computeLineDistances() on tag LineSegments for proper dashed rendering
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

…timestamps, validate tab param, fix title, remove unused prop

- Normalize tags (trim/dedupe) in createGoal to match updateGoal behavior
- Update updatedAt on reparented children during deleteGoal
- Add min(1) to parentId schema to reject empty strings
- Validate tab route param against known tab ids, default to tree
- Change page title from "Goal Tree" to "Goals"
- Remove unused allGoals prop from GoalRow component
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

…client tag limits, tab redirect, avoid urgency mutation
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

server/services/identity.js:774

  • updateGoal recalculates and persists goal.urgency even when the goal status is changed to non-active (e.g., completed/abandoned). This can leave completed goals showing urgency in the UI and diverges from setBirthDate/getGoalsTree, which only compute urgency for status === 'active'. Consider setting urgency to null when status is not active, and only recomputing urgency when the goal is active (and/or when horizon changes).
  // Recalculate urgency if horizon changed
  const longevity = await loadJSON(LONGEVITY_FILE, DEFAULT_LONGEVITY);
  if (longevity.timeHorizons) {
    goal.urgency = computeGoalUrgency(goal, longevity.timeHorizons);
  }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@atomantic atomantic merged commit 0bba41a into main Mar 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants