fix(web): update URL with ?project= on initial connect too

The previous commit only updated the URL in switchRepo, not in
handleServerConnect. This meant F5 after the initial connection
would not preserve which repo was open.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Abhigyan Patwari 2026-04-04 07:53:16 +05:30
parent a6c66f9777
commit f9f074b67d

View file

@ -61,6 +61,11 @@ const AppContent = () => {
setProjectName(projectName);
setCurrentRepo(projectName);
// Update URL so F5 / bookmarks preserve which repo is open
const url = new URL(window.location.href);
url.searchParams.set('project', projectName);
window.history.replaceState(null, '', url.toString());
// Build KnowledgeGraph from server data for visualization
const graph = createKnowledgeGraph();
for (const node of result.nodes) {