Skip to content

Commit f7ee88b

Browse files
committed
Refactor: Replace 'Node' terminology with 'Work Item' throughout codebase
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
1 parent 163d575 commit f7ee88b

39 files changed

Lines changed: 481 additions & 296 deletions

docs/agent-planning-scenarios.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ User right-clicks any node and sees:
1616

1717
```
1818
┌─────────────────────────────┐
19-
│ 📋 Edit Node
19+
│ 📋 Edit Work Item
2020
│ 🔗 Add Relationship │
2121
│ 🎯 Set Priority │
2222
│ ───────────────────────── │

docs/features/graph-creation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ GraphDone uses a **graph-first approach** where work items exist as connected no
5151

5252
**Quick Node Creation:**
5353
1. **Right-click** on empty graph space
54-
2. **Select** "Add Node" from context menu
54+
2. **Select** "Add Work Item" from context menu
5555
3. **Choose** node type from comprehensive list
5656
4. **Fill** essential information and save
5757

5858
**Detailed Node Creation:**
59-
1. **Click** primary "Add Node" button
59+
1. **Click** primary "Add Work Item" button
6060
2. **Complete** the node creation form:
6161

6262
**Essential Fields:**

packages/web/src/components/AdminUserManagement.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ export function AdminUserManagement() {
594594
setDeleteConfirmation(null);
595595
setDeleteConfirmText('');
596596
}}
597-
className="flex-1 px-4 py-2 border border-gray-600 rounded-lg text-gray-300 hover:text-gray-100 hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-gray-500"
597+
className="flex-1 px-4 py-2 border border-gray-600 rounded-lg text-gray-300 hover:bg-red-600 hover:text-white hover:border-red-600 focus:outline-none focus:ring-2 focus:ring-red-500 transition-all duration-200"
598598
>
599599
Cancel
600600
</button>
@@ -736,7 +736,7 @@ export function AdminUserManagement() {
736736
role: 'VIEWER'
737737
});
738738
}}
739-
className="flex-1 px-4 py-2 border border-gray-600 rounded-lg text-gray-300 hover:text-gray-100 hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-gray-500"
739+
className="flex-1 px-4 py-2 border border-gray-600 rounded-lg text-gray-300 hover:bg-red-600 hover:text-white hover:border-red-600 focus:outline-none focus:ring-2 focus:ring-red-500 transition-all duration-200"
740740
>
741741
Cancel
742742
</button>

packages/web/src/components/ConnectNodeModal.tsx renamed to packages/web/src/components/ConnectWorkItemModal.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import {
3737
Target
3838
} from '../constants/workItemConstants';
3939

40-
interface ConnectNodeModalProps {
40+
interface ConnectWorkItemModalProps {
4141
isOpen: boolean;
4242
onClose: () => void;
4343
sourceNode: {
@@ -50,7 +50,7 @@ interface ConnectNodeModalProps {
5050
}
5151

5252
// Separate DisconnectNodeModal interface
53-
interface DisconnectNodeModalProps {
53+
interface DisconnectWorkItemModalProps {
5454
isOpen: boolean;
5555
onClose: () => void;
5656
sourceNode: {
@@ -64,7 +64,7 @@ interface DisconnectNodeModalProps {
6464

6565

6666
// Separate DisconnectNodeModal Component
67-
export function DisconnectNodeModal({ isOpen, onClose, sourceNode, onAllConnectionsRemoved }: DisconnectNodeModalProps) {
67+
export function DisconnectWorkItemModal({ isOpen, onClose, sourceNode, onAllConnectionsRemoved }: DisconnectWorkItemModalProps) {
6868
const { currentGraph } = useGraph();
6969
const { showSuccess, showError } = useNotifications();
7070

@@ -545,7 +545,7 @@ export function DisconnectNodeModal({ isOpen, onClose, sourceNode, onAllConnecti
545545
<div className="flex justify-end space-x-4 pt-6 border-t border-gray-600/50">
546546
<button
547547
onClick={onClose}
548-
className="px-6 py-3 text-gray-300 bg-gradient-to-r from-gray-700/50 to-gray-800/50 border border-gray-600/50 rounded-xl hover:from-gray-600/60 hover:to-gray-700/60 hover:border-gray-500/60 transition-all duration-200 font-medium"
548+
className="px-6 py-3 text-gray-300 bg-gray-700/50 border border-gray-600/50 rounded-xl hover:bg-red-600 hover:text-white hover:border-red-500/50 transition-all duration-200 font-medium hover:scale-105"
549549
>
550550
Cancel
551551
</button>
@@ -621,7 +621,7 @@ export function DisconnectNodeModal({ isOpen, onClose, sourceNode, onAllConnecti
621621
<div className="flex justify-end space-x-3">
622622
<button
623623
onClick={() => setShowDisconnectConfirmation(false)}
624-
className="px-4 py-2 text-gray-300 bg-gray-700 rounded-lg hover:bg-gray-600 transition-colors"
624+
className="px-4 py-2 text-gray-300 bg-gray-700 rounded-lg hover:bg-red-600 hover:text-white transition-all duration-200"
625625
>
626626
Cancel
627627
</button>
@@ -643,7 +643,7 @@ export function DisconnectNodeModal({ isOpen, onClose, sourceNode, onAllConnecti
643643
);
644644
}
645645

646-
export function ConnectNodeModal({ isOpen, onClose, sourceNode, initialTab = 'connect', onAllConnectionsRemoved: _onAllConnectionsRemoved }: ConnectNodeModalProps) {
646+
export function ConnectWorkItemModal({ isOpen, onClose, sourceNode, initialTab = 'connect', onAllConnectionsRemoved: _onAllConnectionsRemoved }: ConnectWorkItemModalProps) {
647647
const { currentTeam } = useAuth();
648648
const { currentGraph } = useGraph();
649649
const { showSuccess, showError } = useNotifications();
@@ -1761,7 +1761,7 @@ export function ConnectNodeModal({ isOpen, onClose, sourceNode, initialTab = 'co
17611761
type="text"
17621762
value={searchTerm}
17631763
onChange={(e) => setSearchTerm(e.target.value)}
1764-
placeholder="Search nodes by title or type"
1764+
placeholder="Search work items by title or type"
17651765
className="w-full pl-12 pr-4 py-3 bg-gray-800 border border-gray-600/50 rounded-xl text-white placeholder-gray-400 focus:outline-none focus:border-emerald-400/70 focus:ring-2 focus:ring-emerald-500/20 transition-all duration-200"
17661766
/>
17671767
</div>
@@ -2114,7 +2114,7 @@ export function ConnectNodeModal({ isOpen, onClose, sourceNode, initialTab = 'co
21142114
<div className="flex justify-end space-x-4 pt-6 border-t border-gray-600/50 mt-6">
21152115
<button
21162116
onClick={onClose}
2117-
className="px-6 py-3 text-gray-300 bg-gradient-to-r from-gray-700/50 to-gray-800/50 border border-gray-600/50 rounded-xl hover:from-gray-600/60 hover:to-gray-700/60 hover:border-gray-500/60 transition-all duration-200 font-medium"
2117+
className="px-6 py-3 text-gray-300 bg-gray-700/50 border border-gray-600/50 rounded-xl hover:bg-red-600 hover:text-white hover:border-red-500/50 transition-all duration-200 font-medium hover:scale-105"
21182118
>
21192119
Cancel
21202120
</button>
@@ -2378,7 +2378,7 @@ export function ConnectNodeModal({ isOpen, onClose, sourceNode, initialTab = 'co
23782378
<div className="flex justify-end space-x-3">
23792379
<button
23802380
onClick={() => setShowDisconnectConfirmation(false)}
2381-
className="px-4 py-2 text-gray-300 bg-gray-700 rounded-lg hover:bg-gray-600 transition-colors"
2381+
className="px-4 py-2 text-gray-300 bg-gray-700 rounded-lg hover:bg-red-600 hover:text-white transition-all duration-200"
23822382
>
23832383
Cancel
23842384
</button>

packages/web/src/components/CreateGraphModal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ export function CreateGraphModal({ isOpen, onClose, parentGraphId }: CreateGraph
242242
</div>
243243
<button
244244
onClick={handleClose}
245-
className="p-2 text-gray-400 hover:text-white hover:bg-gray-700/50 rounded-xl transition-all duration-200 hover:scale-110 hover:rotate-90"
245+
className="p-2 text-gray-400 hover:text-white hover:bg-red-600 rounded-lg transition-all duration-200 hover:scale-110"
246246
>
247247
<X className="h-5 w-5" />
248248
</button>
@@ -325,7 +325,7 @@ export function CreateGraphModal({ isOpen, onClose, parentGraphId }: CreateGraph
325325
<div className="flex justify-end space-x-3 pt-5 border-t border-gray-700/30">
326326
<button
327327
onClick={handleClose}
328-
className="px-5 py-2.5 text-sm text-gray-300 bg-gray-700/50 rounded-xl hover:bg-gray-600/60 transition-all duration-200 font-medium hover:scale-105 border border-gray-600/30 hover:border-gray-500/50"
328+
className="px-5 py-2.5 text-sm text-gray-300 bg-gray-700/50 rounded-xl hover:bg-red-600 hover:text-white transition-all duration-200 font-medium hover:scale-105 border border-gray-600/30 hover:border-red-500/50"
329329
>
330330
Cancel
331331
</button>
@@ -710,7 +710,7 @@ export function CreateGraphModal({ isOpen, onClose, parentGraphId }: CreateGraph
710710
<div className="flex space-x-4">
711711
<button
712712
onClick={handleClose}
713-
className="px-6 py-3 text-gray-300 bg-gradient-to-r from-gray-700/80 to-gray-600/80 rounded-xl hover:from-gray-600/80 hover:to-gray-500/80 transition-all duration-300 hover:scale-105 shadow-lg backdrop-blur-sm border border-gray-500/30 hover:border-gray-400/50 hover:text-white font-medium"
713+
className="px-6 py-3 text-gray-300 bg-gray-700/50 rounded-xl hover:bg-red-600 hover:text-white transition-all duration-300 hover:scale-105 shadow-lg backdrop-blur-sm border border-gray-500/30 hover:border-red-500/50 font-medium"
714714
>
715715
Cancel
716716
</button>

packages/web/src/components/CreateNodeModal.tsx renamed to packages/web/src/components/CreateWorkItemModal.tsx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { CREATE_WORK_ITEM, GET_WORK_ITEMS, GET_EDGES, CREATE_EDGE } from '../lib
55
import { useAuth } from '../contexts/AuthContext';
66
import { useGraph } from '../contexts/GraphContext';
77
import { useNotifications } from '../contexts/NotificationContext';
8-
import { NodeTypeSelector } from './NodeCategorySelector';
8+
import { WorkItemTypeSelector } from './WorkItemTypeSelector';
99
import { TagInput } from './TagInput';
1010
import {
1111
RELATIONSHIP_OPTIONS,
@@ -37,21 +37,21 @@ interface WorkItem {
3737
contributors?: Array<{ id: string; name: string; type: string; }>;
3838
}
3939

40-
interface CreateNodeModalProps {
40+
interface CreateWorkItemModalProps {
4141
isOpen: boolean;
4242
onClose: () => void;
43-
parentNodeId?: string; // If provided, creates a connection to this node
44-
position?: { x: number; y: number; z: number }; // Position for floating nodes
45-
onSubmit?: (nodeData: any) => Promise<void>; // Optional callback after node creation
43+
parentWorkItemId?: string; // If provided, creates a connection to this work item
44+
position?: { x: number; y: number; z: number }; // Position for floating work items
45+
onSubmit?: (nodeData: any) => Promise<void>; // Optional callback after work item creation
4646
}
4747

4848

49-
export function CreateNodeModal({ isOpen, onClose, parentNodeId, position, onSubmit }: CreateNodeModalProps) {
49+
export function CreateWorkItemModal({ isOpen, onClose, parentWorkItemId, position, onSubmit }: CreateWorkItemModalProps) {
5050
const { currentUser, currentTeam } = useAuth();
5151
const { currentGraph } = useGraph();
5252
const { showSuccess, showError } = useNotifications();
5353

54-
// Query to get existing nodes count for dynamic messaging
54+
// Query to get existing work items count for dynamic messaging
5555
const { data: existingNodesData } = useQuery(GET_WORK_ITEMS, {
5656
variables: currentGraph ? {
5757
where: {
@@ -129,20 +129,20 @@ export function CreateNodeModal({ isOpen, onClose, parentNodeId, position, onSub
129129
}
130130
}
131131
},
132-
// Refetch all edges if creating a connected node
133-
...(parentNodeId ? [
132+
// Refetch all edges if creating a connected work item
133+
...(parentWorkItemId ? [
134134
{
135135
query: GET_EDGES,
136136
variables: {}
137137
},
138-
// Also refetch edges for the parent node specifically
138+
// Also refetch edges for the parent work item specifically
139139
{
140140
query: GET_EDGES,
141141
variables: {
142142
where: {
143143
OR: [
144-
{ source: { id: parentNodeId } },
145-
{ target: { id: parentNodeId } }
144+
{ source: { id: parentWorkItemId } },
145+
{ target: { id: parentWorkItemId } }
146146
]
147147
}
148148
}
@@ -210,7 +210,7 @@ export function CreateNodeModal({ isOpen, onClose, parentNodeId, position, onSub
210210
}
211211
});
212212

213-
// Edge creation mutation for connected nodes
213+
// Edge creation mutation for connected work items
214214
const [createEdge] = useMutation(CREATE_EDGE, {
215215
refetchQueries: [
216216
{ query: GET_EDGES, variables: {} },
@@ -280,11 +280,11 @@ export function CreateNodeModal({ isOpen, onClose, parentNodeId, position, onSub
280280
if (result.data?.createWorkItems?.workItems?.[0]) {
281281
const createdNode = result.data.createWorkItems.workItems[0];
282282

283-
// If parentNodeId is provided, create the edge with the correct relationship type
284-
if (parentNodeId) {
283+
// If parentWorkItemId is provided, create the edge with the correct relationship type
284+
if (parentWorkItemId) {
285285
const edgeInput = {
286286
type: selectedRelationType,
287-
source: { connect: { where: { node: { id: parentNodeId } } } },
287+
source: { connect: { where: { node: { id: parentWorkItemId } } } },
288288
target: { connect: { where: { node: { id: createdNode.id } } } }
289289
};
290290

@@ -350,14 +350,14 @@ export function CreateNodeModal({ isOpen, onClose, parentNodeId, position, onSub
350350
<div className="flex items-center space-x-3">
351351
<div className="w-10 h-10 bg-gradient-to-br from-green-500 via-emerald-500 to-teal-500 rounded-xl flex items-center justify-center shadow-lg shadow-green-500/30 relative">
352352
<div className="absolute inset-0 bg-gradient-to-br from-green-400 to-emerald-600 rounded-xl blur opacity-50 animate-pulse"></div>
353-
{parentNodeId ? <Link className="h-5 w-5 text-white relative z-10" /> : <Plus className="h-5 w-5 text-white relative z-10" />}
353+
{parentWorkItemId ? <Link className="h-5 w-5 text-white relative z-10" /> : <Plus className="h-5 w-5 text-white relative z-10" />}
354354
</div>
355355
<div>
356356
<h3 className="text-lg font-bold bg-gradient-to-r from-white via-green-100 to-emerald-100 bg-clip-text text-transparent">
357-
{parentNodeId ? 'Create & Connect Work Item' : 'Create New Work Item'}
357+
{parentWorkItemId ? 'Create & Connect Work Item' : 'Create New Work Item'}
358358
</h3>
359359
<p className="text-xs text-gray-400">
360-
{parentNodeId
360+
{parentWorkItemId
361361
? 'Add a new work item with automatic connection'
362362
: existingNodesData?.workItems?.length > 0
363363
? 'Add another work item to expand your graph'
@@ -368,15 +368,15 @@ export function CreateNodeModal({ isOpen, onClose, parentNodeId, position, onSub
368368
</div>
369369
<button
370370
onClick={onClose}
371-
className="p-2 text-gray-400 hover:text-white hover:bg-gray-700/50 rounded-xl transition-all duration-200 hover:scale-110 hover:rotate-90"
371+
className="p-2 text-gray-400 hover:text-white hover:bg-red-600 rounded-lg transition-all duration-200 hover:scale-110"
372372
>
373373
<X className="h-5 w-5" />
374374
</button>
375375
</div>
376376

377377
<div className="max-h-[70vh] overflow-y-auto scrollbar-thin scrollbar-thumb-gray-600 scrollbar-track-gray-800 hover:scrollbar-thumb-gray-500">
378378
<form onSubmit={handleSubmit} className="px-3 py-2 space-y-2 relative">
379-
{parentNodeId && (
379+
{parentWorkItemId && (
380380
<div className="space-y-2 mb-2">
381381
<div className="bg-gradient-to-br from-gray-800/30 to-gray-700/20 border border-gray-600/30 rounded-lg p-2 shadow-lg backdrop-blur-sm">
382382
<div className="flex items-center space-x-2 mb-1">
@@ -489,7 +489,7 @@ export function CreateNodeModal({ isOpen, onClose, parentNodeId, position, onSub
489489
Work Item Type
490490
</label>
491491

492-
<NodeTypeSelector
492+
<WorkItemTypeSelector
493493
selectedType={formData.type}
494494
onTypeChange={(type) => setFormData(prev => ({ ...prev, type }))}
495495
placeholder="Select work item type"
@@ -754,7 +754,7 @@ export function CreateNodeModal({ isOpen, onClose, parentNodeId, position, onSub
754754
<button
755755
type="button"
756756
onClick={onClose}
757-
className="px-4 py-2 text-xs text-gray-300 bg-gray-700/50 rounded-lg hover:bg-gray-600/60 transition-all duration-200 font-medium hover:scale-105 border border-gray-600/30 hover:border-gray-500/50"
757+
className="px-4 py-2 text-xs text-gray-300 bg-gray-700/50 rounded-lg hover:bg-red-600 hover:text-white transition-all duration-200 font-medium hover:scale-105 border border-gray-600/30 hover:border-red-600"
758758
>
759759
Cancel
760760
</button>
@@ -774,7 +774,7 @@ export function CreateNodeModal({ isOpen, onClose, parentNodeId, position, onSub
774774
</>
775775
) : (
776776
<>
777-
<span>{parentNodeId ? 'Create & Connect' : 'Create Work Item'}</span>
777+
<span>{parentWorkItemId ? 'Create & Connect' : 'Create Work Item'}</span>
778778
<Plus className="w-3 h-3" />
779779
</>
780780
)}

0 commit comments

Comments
 (0)