Skip to content

Conversation

@Patel230
Copy link
Member

@Patel230 Patel230 commented Nov 13, 2025

Summary

This PR adds automatic Welcome graph creation for new users and fixes critical synchronization issues between the NodeDetailsModal and graph visualization.

Key Features

🎉 Welcome Graph Creation

  • Automatic creation of Welcome graphs on user signup with sample work items
  • Fixed duplicate Welcome graph creation on logout/login
  • Added onboarding service for new user experience
  • Improved seed script with better data structure

🔄 Graph Visualization Synchronization

  • Fixed stale closure in handleSave using useCallback with proper dependencies
  • Added dual protection (isSaving state + isSavingRef) to prevent multiple saves
  • Enhanced updateVisualizationData to update both simulation physics AND DOM elements
  • Extracted getNodeDimensions as shared useCallback function for proper scoping
  • Added fresh node lookup by ID before passing to modal (synced with Apollo cache)
  • Track node property changes in useEffect dependencies for immediate updates

🎨 UI Improvements

  • Streamlined CreateGraphModal with improved UX
  • Enhanced UpdateGraphModal with better form layout
  • Updated CodeCaptcha component styling
  • Standardized terminology from 'Node' to 'Work Item'
  • Fixed Save button state management (now disables properly after Ctrl+S)

🔧 Comprehensive Node → Work Item Terminology Refactoring

Component Files Renamed (7 files):

  • CreateNodeModalCreateWorkItemModal
  • EditNodeModalEditWorkItemModal
  • DeleteNodeModalDeleteWorkItemModal
  • ConnectNodeModalConnectWorkItemModal
  • DisconnectNodeModalDisconnectWorkItemModal
  • NodeDetailsModalWorkItemDetailsModal
  • NodeCategorySelectorWorkItemTypeSelector

Code Updates:

  • ✅ All TypeScript interfaces renamed (e.g., CreateNodeModalPropsCreateWorkItemModalProps)
  • ✅ All function exports, imports, and JSX component usage updated
  • ✅ Variable names updated (parentNodeIdparentWorkItemId, etc.)

User-Facing Text Updates:

  • ✅ "Create a standalone node" → "Create a standalone work item"
  • ✅ "Connect to Existing Nodes" → "Connect to Existing Work Items"
  • ✅ "Search node types" → "Search work item types"
  • ✅ "Node Templates" → "Work Item Templates"
  • ✅ Updated all UI labels, placeholders, and descriptions

Files Modified: 39 files changed with 481 insertions(+), 296 deletions(-)

🖱️ Mouse Right Click Context Menu

  • ✅ Right-click context menu on work items fully implemented
  • ✅ Contextual actions: Add New Work Item, Create New & Connect, Connect to Existing Work Items, Disconnect Work Items
  • ✅ Updated all menu labels to use "Work Item" terminology

Changes

  • Total: 70 files changed with significant improvements across UI, backend, and terminology
  • Server: Added onboarding service and graph protection
  • Web: Fixed critical synchronization bugs and improved UI consistency
  • Codebase: Complete terminology standardization for better clarity

Test Plan

  • Verify Welcome graph creation on signup
  • Test graph visualization updates after modal saves
  • Confirm Save button disables correctly after Ctrl+S
  • Check that title, type, description, and status all update immediately
  • Verify no duplicate Welcome graphs on logout/login
  • Test that duplicate Welcome graphs are prevented
  • Verify TypeScript compilation passes
  • Verify ESLint checks pass
  • Test right-click context menu on work items

Related Issues

Addresses #27 - No node shown when doing first time graph setup
Addresses #28 - Default node edit dialog is too large on standard laptop
Resolves #31 - Node → Work Item terminology standardization (mouse right click on node is done)

Fixes graph visualization not updating after NodeDetailsModal saves
Fixes duplicate Welcome graph creation

Patel230 and others added 6 commits November 13, 2025 14:52
This commit implements automatic Welcome graph creation for new users
and standardizes UI terminology from "Node" to "Work Item" across
all user-facing components.

Key Features:
- Automatic Welcome graph creation when user has no graphs
- Creates 4 tutorial work items with dependency connections
- Graph name: "Welcome" (simplified from "Welcome to GraphDone")
- Tutorial covers: introduction, creating items, connections, views

Terminology Standardization:
- Updated all modals to use "Work Item" instead of "Node"
- Components updated:
  - DeleteNodeModal: "Delete Work Item"
  - EditNodeModal: "Edit Work Item"
  - CreateNodeModal: "Create Work Item"
  - DeleteGraphModal: "Work Item Deleted Successfully"
  - InteractiveGraphVisualization: Context menu items

Technical Implementation:
- Added useRef hook to prevent infinite loops
- Integrated with GraphQL mutations for graph/work item creation
- Added comprehensive debug logging for troubleshooting
- Uses GET_GRAPHS_BY_USER query for proper user isolation
- Graph protection resolver to prevent Welcome graph deletion

Files Modified:
- packages/web/src/contexts/GraphContext.tsx
- packages/web/src/components/DeleteNodeModal.tsx
- packages/web/src/components/EditNodeModal.tsx
- packages/web/src/components/CreateNodeModal.tsx
- packages/web/src/components/DeleteGraphModal.tsx
- packages/web/src/components/InteractiveGraphVisualization.tsx
- packages/web/src/graphql/graph.ts
- packages/server/src/resolvers/graph-protection.ts (new)
Replace useRef flag with state-based flag to prevent duplicate Welcome
graph creation across logout/login cycles. The useRef flag was being
reset when the component unmounted during logout, causing duplicate
graphs to be created on each login.

Changes:
- Remove useRef(welcomeGraphCreated) dependency
- Add isCreatingWelcomeGraph state flag
- Flag persists during session to prevent duplicate creation
- Resets on error to allow retry
- Works consistently across logout/login cycles
Complete UI terminology standardization to align with WorkItem backend model.
All user-visible references to "Node" have been replaced with "Work Item"
throughout the application for consistency and clarity.

Changes:
- Landing page: "Create your first work item" messaging
- All modals: Create, Edit, Delete, Connect, Disconnect
- Form labels: "Work Item Type" instead of "Node Type"
- Success/error notifications
- Context menu tooltips
- Empty states and placeholders
- ID labels: "Work Item ID" instead of "Node ID"
- Graph selector: "Total: X Graphs" format
- Welcome graph: Removed emoji, updated statuses

Technical notes:
- Backend model already uses WorkItem
- Internal code comments and utilities still use "node" (developer-facing)
- No breaking changes to API or data model
Added internal state tracking to properly detect changes after save:
- Added savedNode state to track baseline independently of parent prop
- Update both editedNode and savedNode after successful mutation
- Compare editedNode with savedNode instead of stale node prop
- Added awaitRefetchQueries to ensure mutation completes before state update
- Added keyboard shortcuts (ESC to close, Ctrl+S to save)
- Integrated with dialog manager for proper cleanup

This fixes the issue where the Save button remained enabled after
pressing Ctrl+S because the parent component's node prop wasn't
updating after the GraphQL refetch.
- Fixed stale closure in handleSave using useCallback with proper dependencies
- Added dual protection (isSaving state + isSavingRef) to prevent multiple saves
- Enhanced updateVisualizationData to update DOM elements (titles, types, descriptions)
- Extracted getNodeDimensions as shared useCallback function for proper scoping
- Added fresh node lookup by ID before passing to modal (synced with Apollo cache)
- Track node property changes in useEffect dependencies for immediate updates
- Resolves issues with graph not updating after modal saves

Co-Authored-By: Claude <[email protected]>
Server changes:
- Add onboarding service for automatic Welcome graph creation
- Create Welcome graphs on user signup with sample work items
- Fix duplicate Welcome graph creation on logout/login
- Improve seed script with better data structure

Web changes:
- Streamline CreateGraphModal with improved UX
- Enhance UpdateGraphModal with better form layout
- Update CodeCaptcha component styling
- Standardize terminology from 'Node' to 'Work Item'
@Patel230 Patel230 self-assigned this Nov 13, 2025
@Patel230 Patel230 added the enhancement New feature or request label Nov 13, 2025
@github-actions
Copy link

🧪 Test Results

Summary

  • Total Tests: 5
  • Passed: 5 ✅
  • Failed: 0 ❌
  • Duration: 1s

Test Suites

Suite Status Passed Failed Duration
Installation Script Validation 1 0 0.10s
Docker Compose Configuration 1 0 0.05s
Node.js Dependencies 1 0 0.20s
Certificate Generation Script 1 0 0.15s
Environment Setup 1 0 0.10s

Installation Script Validation

  • Script Location: ✅ public/install.sh
  • Docker Config: ✅ Valid
  • Dependencies: ✅ Installed
  • Environment: ✅ Configured

1 similar comment
@github-actions
Copy link

🧪 Test Results

Summary

  • Total Tests: 5
  • Passed: 5 ✅
  • Failed: 0 ❌
  • Duration: 1s

Test Suites

Suite Status Passed Failed Duration
Installation Script Validation 1 0 0.10s
Docker Compose Configuration 1 0 0.05s
Node.js Dependencies 1 0 0.20s
Certificate Generation Script 1 0 0.15s
Environment Setup 1 0 0.10s

Installation Script Validation

  • Script Location: ✅ public/install.sh
  • Docker Config: ✅ Valid
  • Dependencies: ✅ Installed
  • Environment: ✅ Configured

@Patel230 Patel230 requested a review from mvalancy November 13, 2025 16:13
- Add check for existing shared/system Welcome graph before creating new one
- Frontend now detects server-created shared Welcome graph
- Prevents duplicate Welcome graphs when user logs in
- Maintains fallback creation if no Welcome graph exists at all
@github-actions
Copy link

🧪 Test Results

Summary

  • Total Tests: 5
  • Passed: 5 ✅
  • Failed: 0 ❌
  • Duration: 1s

Test Suites

Suite Status Passed Failed Duration
Installation Script Validation 1 0 0.10s
Docker Compose Configuration 1 0 0.05s
Node.js Dependencies 1 0 0.20s
Certificate Generation Script 1 0 0.15s
Environment Setup 1 0 0.10s

Installation Script Validation

  • Script Location: ✅ public/install.sh
  • Docker Config: ✅ Valid
  • Dependencies: ✅ Installed
  • Environment: ✅ Configured

1 similar comment
@github-actions
Copy link

🧪 Test Results

Summary

  • Total Tests: 5
  • Passed: 5 ✅
  • Failed: 0 ❌
  • Duration: 1s

Test Suites

Suite Status Passed Failed Duration
Installation Script Validation 1 0 0.10s
Docker Compose Configuration 1 0 0.05s
Node.js Dependencies 1 0 0.20s
Certificate Generation Script 1 0 0.15s
Environment Setup 1 0 0.10s

Installation Script Validation

  • Script Location: ✅ public/install.sh
  • Docker Config: ✅ Valid
  • Dependencies: ✅ Installed
  • Environment: ✅ Configured

- Update NodeDetailsModal Eye icon with teal-magenta gradient
- Add blue focus ring to CreateNodeModal when inputs are focused
- Add onSubmit prop to CreateNodeModal interface for extensibility
- Fix TypeScript errors in InteractiveGraphVisualization
- Move Welcome graph creation from server to frontend (per-user instead of shared)
- Add comprehensive guards to prevent duplicate Welcome graph creation
- Use ref instead of state to prevent race conditions during graph creation
- Enhance NodeTypeSelector with emerald/green theme and better visual feedback
- Update TagInput with improved focus indicators and consistent border styling
- Add detailed logging for debugging graph loading and creation flow
@github-actions
Copy link

🧪 Test Results

Summary

  • Total Tests: 5
  • Passed: 5 ✅
  • Failed: 0 ❌
  • Duration: 1s

Test Suites

Suite Status Passed Failed Duration
Installation Script Validation 1 0 0.10s
Docker Compose Configuration 1 0 0.05s
Node.js Dependencies 1 0 0.20s
Certificate Generation Script 1 0 0.15s
Environment Setup 1 0 0.10s

Installation Script Validation

  • Script Location: ✅ public/install.sh
  • Docker Config: ✅ Valid
  • Dependencies: ✅ Installed
  • Environment: ✅ Configured

1 similar comment
@github-actions
Copy link

🧪 Test Results

Summary

  • Total Tests: 5
  • Passed: 5 ✅
  • Failed: 0 ❌
  • Duration: 1s

Test Suites

Suite Status Passed Failed Duration
Installation Script Validation 1 0 0.10s
Docker Compose Configuration 1 0 0.05s
Node.js Dependencies 1 0 0.20s
Certificate Generation Script 1 0 0.15s
Environment Setup 1 0 0.10s

Installation Script Validation

  • Script Location: ✅ public/install.sh
  • Docker Config: ✅ Valid
  • Dependencies: ✅ Installed
  • Environment: ✅ Configured

…base

Comprehensive rename to align with domain language and improve clarity:

Component Files Renamed:
- CreateNodeModal → CreateWorkItemModal
- EditNodeModal → EditWorkItemModal
- DeleteNodeModal → DeleteWorkItemModal
- ConnectNodeModal → ConnectWorkItemModal
- DisconnectNodeModal → DisconnectWorkItemModal
- NodeDetailsModal → WorkItemDetailsModal
- NodeCategorySelector → WorkItemTypeSelector

Code Updates:
- All interfaces renamed (e.g., CreateNodeModalProps → CreateWorkItemModalProps)
- All function exports updated
- All import statements updated
- All JSX component usage updated
- Variable names updated (parentNodeId → parentWorkItemId, etc.)

User-Facing Text Updates:
- "Create a standalone node" → "Create a standalone work item"
- "Connect to Existing Nodes" → "Connect to Existing Work Items"
- "Search node types" → "Search work item types"
- "Node Templates" → "Work Item Templates"
- "node priorities" → "work item priorities"
- "node dependencies" → "work item dependencies"

Documentation & Tests:
- Updated all test files with new terminology
- Updated documentation files (graph-creation.md, agent-planning-scenarios.md)

Technical Terms Preserved:
- GraphQL syntax (where: { node: { id } }) - Neo4j convention
- D3.js simulation nodes - JavaScript library convention
- DOM nodes - Web API convention

All changes validated:
✅ TypeScript compilation passing
✅ ESLint checks passing
✅ 40 files modified, 7 files renamed
@github-actions
Copy link

🧪 Test Results

Summary

  • Total Tests: 5
  • Passed: 5 ✅
  • Failed: 0 ❌
  • Duration: 1s

Test Suites

Suite Status Passed Failed Duration
Installation Script Validation 1 0 0.10s
Docker Compose Configuration 1 0 0.05s
Node.js Dependencies 1 0 0.20s
Certificate Generation Script 1 0 0.15s
Environment Setup 1 0 0.10s

Installation Script Validation

  • Script Location: ✅ public/install.sh
  • Docker Config: ✅ Valid
  • Dependencies: ✅ Installed
  • Environment: ✅ Configured

1 similar comment
@github-actions
Copy link

🧪 Test Results

Summary

  • Total Tests: 5
  • Passed: 5 ✅
  • Failed: 0 ❌
  • Duration: 1s

Test Suites

Suite Status Passed Failed Duration
Installation Script Validation 1 0 0.10s
Docker Compose Configuration 1 0 0.05s
Node.js Dependencies 1 0 0.20s
Certificate Generation Script 1 0 0.15s
Environment Setup 1 0 0.10s

Installation Script Validation

  • Script Location: ✅ public/install.sh
  • Docker Config: ✅ Valid
  • Dependencies: ✅ Installed
  • Environment: ✅ Configured

Copy link
Member

@mvalancy mvalancy left a comment

Choose a reason for hiding this comment

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

ship it

@mvalancy mvalancy merged commit 02573eb into develop Nov 14, 2025
11 of 13 checks passed
@mvalancy mvalancy deleted the feature/quick-start-graph-creation branch November 14, 2025 08:16
@Patel230
Copy link
Member Author

ship it

Yes, thank you so much!

mvalancy added a commit that referenced this pull request Nov 17, 2025
Quick Start Graph Creation and UI Synchronization Fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants