Skip to content

Commit e669b24

Browse files
committed
feat(config): add new owners Maxime, Jeremy, and Florent with custom colors
refactor(sidebar): remove workspace dropdown outside click handler fix(knowledge-graph): auto-select first graph and navigate to entities view on first selection feat(ontology): auto-select and navigate to first ontology if none selected update(uv.lock): bump version of naas-abi and naas-abi-cli to latest These changes improve auto-selection behaviors in sidebar components and update version dependencies.
1 parent d61b84a commit e669b24

5 files changed

Lines changed: 44 additions & 16 deletions

File tree

config.local.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,30 @@ modules:
110110
role: "owner"
111111
- email: "florent@naas.ai"
112112
role: "owner"
113+
- name: "Maxime"
114+
slug: "maxime"
115+
owner_email: "maxime@naas.ai"
116+
primary_color: "#34D399"
117+
accent_color: "#34D399"
118+
members:
119+
- email: "maxime@naas.ai"
120+
role: "owner"
121+
- name: "Jeremy"
122+
slug: "jeremy"
123+
owner_email: "jeremy@naas.ai"
124+
primary_color: "#34D399"
125+
accent_color: "#34D399"
126+
members:
127+
- email: "jeremy@naas.ai"
128+
role: "owner"
129+
- name: "Florent"
130+
slug: "florent"
131+
owner_email: "florent@naas.ai"
132+
primary_color: "#34D399"
133+
accent_color: "#34D399"
134+
members:
135+
- email: "florent@naas.ai"
136+
role: "owner"
113137

114138
- module: naas_abi_marketplace.ai.chatgpt
115139
enabled: true

libs/naas-abi/naas_abi/apps/nexus/apps/web/src/components/shell/sidebar/index.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,6 @@ export function Sidebar() {
6363
if (canKnowledge) { fetchOntology(); }
6464
}, [canFiles, canKnowledge, fetchFiles, fetchLabFiles, fetchOntology]);
6565

66-
// Close workspace dropdown on outside click
67-
useEffect(() => {
68-
if (!workspaceMenuOpen) return;
69-
const handle = (e: MouseEvent) => {
70-
if (workspaceBtnRef.current && !workspaceBtnRef.current.closest('[data-workspace-menu]')?.contains(e.target as Node)) {
71-
setWorkspaceMenuOpen(false);
72-
}
73-
};
74-
document.addEventListener('mousedown', handle);
75-
return () => document.removeEventListener('mousedown', handle);
76-
}, [workspaceMenuOpen]);
77-
7866
const currentWorkspace = mounted ? workspaces.find((w) => w.id === currentWorkspaceId) || null : null;
7967
const displayWorkspaces = mounted ? workspaces : [];
8068

libs/naas-abi/naas_abi/apps/nexus/apps/web/src/components/shell/sidebar/knowledge-graph-section.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,13 @@ export function KnowledgeGraphSection({ collapsed, detailOnly }: { collapsed: bo
317317
}
318318

319319
if (!selectedGraphId || !allowedIds.includes(selectedGraphId)) {
320-
selectGraph(graphs[0]?.id ?? null);
320+
const firstId = graphs[0]?.id ?? null;
321+
selectGraph(firstId);
322+
// Navigate to entities view when auto-selecting for the first time.
323+
if (firstId && !selectedGraphId) {
324+
setVisibleGraphs([firstId]);
325+
router.push(getWorkspacePath(currentWorkspaceId, '/graph?view=entities'));
326+
}
321327
}
322328
} catch (err) {
323329
// Silently handle 403 (permission denied) - user doesn't have access to this workspace
@@ -326,7 +332,7 @@ export function KnowledgeGraphSection({ collapsed, detailOnly }: { collapsed: bo
326332
}
327333
console.error('Failed to fetch graphs:', err);
328334
}
329-
}, [currentWorkspaceId, selectGraph, selectedGraphId, setVisibleGraphs, visibleGraphIds]);
335+
}, [currentWorkspaceId, router, selectGraph, selectedGraphId, setVisibleGraphs, visibleGraphIds]);
330336

331337
useEffect(() => {
332338
void fetchGraphs();

libs/naas-abi/naas_abi/apps/nexus/apps/web/src/components/shell/sidebar/ontology-section.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,16 @@ export function OntologySection({ collapsed, detailOnly }: { collapsed: boolean;
137137
|| a.name.localeCompare(b.name, undefined, { sensitivity: 'base' })
138138
);
139139
setOntologyFiles(normalizedFiles);
140+
141+
// Auto-select and navigate to the first ontology when none is selected.
142+
// Read from getState() so we see the post-hydration value.
143+
if (!useOntologyStore.getState().selectedOntologyPath && normalizedFiles.length > 0) {
144+
const firstPath = normalizedFiles[0].path;
145+
setSelectedOntologyPath(firstPath);
146+
const params = new URLSearchParams({ view: 'network', ontology: firstPath });
147+
router.push(getWorkspacePath(currentWorkspaceId, `/ontology?${params.toString()}`));
148+
}
149+
140150
setExpandedOntologyModules(
141151
Array.from(new Set(normalizedFiles.map((file) => file.moduleName)))
142152
);

uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)