Skip to content

Comments

My workspace#1784

Draft
shangyian wants to merge 4 commits intoDataJunction:mainfrom
shangyian:my-workspace
Draft

My workspace#1784
shangyian wants to merge 4 commits intoDataJunction:mainfrom
shangyian:my-workspace

Conversation

@shangyian
Copy link
Collaborator

Summary

Test Plan

  • PR has an associated issue: #
  • make check passes
  • make test shows 100% unit test coverage

Deployment Plan

shangyian and others added 3 commits February 23, 2026 03:58
Add GQL support for workspace queries
Add UI support for workspace
Refactor MyWorkspacePage with DashboardCard component
Refactor MyWorkspacePage with custom data hooks

Create reusable hooks for workspace data fetching:
- useCurrentUser() - fetch current user
- useWorkspaceOwnedNodes() - fetch owned nodes
- useWorkspaceRecentlyEdited() - fetch recently edited nodes
- useWorkspaceWatchedNodes() - fetch watched nodes
- useWorkspaceCollections() - fetch collections
- useWorkspaceNotifications() - fetch notifications with enrichment
- useWorkspaceMaterializations() - fetch materialized nodes
- useWorkspaceNeedsAttention() - fetch all actionable items
- usePersonalNamespace() - check if personal namespace exists

Refactor MyWorkspacePage to use hooks:
- Replaced ~170 lines of manual state + useEffect with ~13 lines of hooks
- Much cleaner, more maintainable code
- Consistent error handling across all data fetching
- Hooks are reusable in other components

Also fixed DashboardCard bug:
- Properly handle false/null/undefined children from conditional rendering
- Fixed MaterializationsSection not showing content
- Added safety check for nodes array to prevent crashes

Impact:
- Main component reduced from ~230 lines to ~70 lines
- Data fetching logic now in dedicated hooks file
- Easier to test and maintain
- Consistent patterns across the app

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

Create reusable Node display components

Created NodeComponents.jsx with reusable node display components:
- NodeBadge: Flexible badge with size variants (small/medium/large)
- NodeLink: Reusable node link with ellipsis support
- NodeDisplay: Combined link + badge display
- NodeChip: Compact chip for NeedsAttentionSection

Refactored MyWorkspacePage to use new components:
- NotificationsSection: Use NodeBadge
- NeedsAttentionSection: Use NodeChip (saved ~20 lines)
- MaterializationsSection: Use NodeDisplay (saved ~11 lines)
- NodeList: Use NodeDisplay with ellipsis (saved ~18 lines)

Impact:
- Removed ~80 lines of repetitive node display code
- Consistent node display patterns across all sections
- Easy to modify node display styling in one place
- Components are reusable across the entire app

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@netlify
Copy link

netlify bot commented Feb 23, 2026

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit 1261962
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/699c584219e0b400087c4db1

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.

1 participant