Skip to content

Commit dfc3183

Browse files
committed
Sync Ontology fields with CreateNodeModal and improve empty state UX
- Update Ontology page to show exact fields from CreateNodeModal in same order - Set both graph panel and legend panel collapsed by default for cleaner startup - Hide Create Node panel when graph is empty to focus on Transform Your Vision message - Add dynamic panel positioning that adjusts when Create Node panel is hidden
1 parent 4afd5a8 commit dfc3183

2 files changed

Lines changed: 19 additions & 9 deletions

File tree

packages/web/src/components/InteractiveGraphVisualization.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ export function InteractiveGraphVisualization() {
140140
const [selectedNode, setSelectedNode] = useState<WorkItem | null>(null);
141141
const [createNodePosition, setCreateNodePosition] = useState<{ x: number; y: number; z: number } | undefined>(undefined);
142142
const [currentTransform, setCurrentTransform] = useState({ x: 0, y: 0, scale: 1 });
143-
const [showLegend, setShowLegend] = useState(true);
144-
const [showGraphPanel, setShowGraphPanel] = useState(true);
143+
const [showLegend, setShowLegend] = useState(false);
144+
const [showGraphPanel, setShowGraphPanel] = useState(false);
145145

146146
// Calculate dynamic positioning for panels and minimized buttons to avoid overlap
147147
const getPanelPosition = (panelType: 'graph' | 'legend' | 'create') => {
@@ -177,8 +177,10 @@ export function InteractiveGraphVisualization() {
177177
topOffset += buttonHeight + compactSpacing;
178178
}
179179

180-
// Add create button height (always a button)
181-
topOffset += buttonHeight + compactSpacing;
180+
// Add create button height (only if not in empty state)
181+
if (!showEmptyStateOverlay) {
182+
topOffset += buttonHeight + compactSpacing;
183+
}
182184

183185
return { top: `${topOffset}px` };
184186
}
@@ -2057,7 +2059,8 @@ export function InteractiveGraphVisualization() {
20572059
</div>
20582060
)}
20592061

2060-
{/* Create Node Button */}
2062+
{/* Create Node Button - Hide when no nodes exist */}
2063+
{!showEmptyStateOverlay && (
20612064
<button
20622065
onClick={() => setShowCreateNodeModal(true)}
20632066
className="absolute left-4 z-40 backdrop-blur-sm border-0 rounded-lg shadow-xl px-4 py-3 text-white font-semibold transition-all duration-300 flex items-center space-x-2 transform hover:scale-105 w-40 h-12"
@@ -2083,6 +2086,7 @@ export function InteractiveGraphVisualization() {
20832086
</div>
20842087
</div>
20852088
</button>
2089+
)}
20862090

20872091
{/* Legend */}
20882092
{showLegend ? (

packages/web/src/pages/Ontology.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,16 @@ export function Ontology() {
5959
createdBy: 'system',
6060
createdAt: '2024-01-01',
6161
fields: [
62-
{ id: 'title', name: 'Title', type: 'text' as const, required: true },
63-
{ id: 'description', name: 'Description', type: 'text' as const, required: false },
64-
{ id: 'dueDate', name: 'Due Date', type: 'date' as const, required: false },
65-
{ id: 'priority', name: 'Priority', type: 'select' as const, required: true, options: ['Critical', 'High', 'Medium', 'Low', 'Minimal'] }
62+
{ id: 'title', name: 'title', type: 'text' as const, required: true },
63+
{ id: 'description', name: 'description', type: 'text' as const, required: false },
64+
{ id: 'type', name: 'type', type: 'text' as const, required: true },
65+
{ id: 'status', name: 'status', type: 'text' as const, required: true },
66+
{ id: 'priorityExec', name: 'priorityExec', type: 'number' as const, required: false },
67+
{ id: 'priorityIndiv', name: 'priorityIndiv', type: 'number' as const, required: false },
68+
{ id: 'priorityComm', name: 'priorityComm', type: 'number' as const, required: false },
69+
{ id: 'assignedTo', name: 'assignedTo', type: 'text' as const, required: false },
70+
{ id: 'dueDate', name: 'dueDate', type: 'text' as const, required: false },
71+
{ id: 'tags', name: 'tags', type: 'text' as const, required: false }
6672
]
6773
}));
6874

0 commit comments

Comments
 (0)