From 4e398cb566a5cf26d39bee63d0a4ef2d5dee3e3b Mon Sep 17 00:00:00 2001 From: jreakin Date: Mon, 23 Mar 2026 03:26:32 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20address=20review=20=E2=80=94=20stale=20p?= =?UTF-8?q?rogress,=20cross-platform=20prepare,=20DEV=20log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Clear progress after handleServerConnect in both auto-connect and DropZone paths (fixes frozen progress bar on StatusBar) - Replace shell-based prepare script with Node scripts/prepare.cjs for Windows cmd.exe compatibility - Gate LadybugDB load warning behind import.meta.env.DEV (consistent with finalizePipeline's silent catch) - Remove misleading "parallel" comment (fetch is sequential after connect) Co-Authored-By: Claude Opus 4.6 (1M context) --- gitnexus-web/src/App.tsx | 3 ++- gitnexus-web/src/workers/ingestion.worker.ts | 4 +++- gitnexus/package.json | 2 +- gitnexus/scripts/prepare.cjs | 16 ++++++++++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 gitnexus/scripts/prepare.cjs diff --git a/gitnexus-web/src/App.tsx b/gitnexus-web/src/App.tsx index 59fa83159..553a4c7cd 100644 --- a/gitnexus-web/src/App.tsx +++ b/gitnexus-web/src/App.tsx @@ -218,8 +218,8 @@ const AppContent = () => { setProgress({ phase: 'extracting', percent: 97, message: 'Processing...', detail: 'Extracting file contents' }); } }).then(async (result) => { - // Run connect and repo list in parallel (avoid waterfall) await handleServerConnect(result); + setProgress(null); setServerBaseUrl(baseUrl); fetchRepos(baseUrl) .then((repos) => setAvailableRepos(repos)) @@ -258,6 +258,7 @@ const AppContent = () => { onGitClone={handleGitClone} onServerConnect={async (result, serverUrl) => { await handleServerConnect(result); + setProgress(null); if (serverUrl) { const baseUrl = normalizeServerUrl(serverUrl); setServerBaseUrl(baseUrl); diff --git a/gitnexus-web/src/workers/ingestion.worker.ts b/gitnexus-web/src/workers/ingestion.worker.ts index 1063eff6d..240864bec 100644 --- a/gitnexus-web/src/workers/ingestion.worker.ts +++ b/gitnexus-web/src/workers/ingestion.worker.ts @@ -259,7 +259,9 @@ const workerApi = { console.log('📁 Stored', storedFileContents.size, 'files for grep/read tools'); } } catch (err) { - console.warn('LadybugDB load failed (non-fatal, continuing without it):', err); + if (import.meta.env.DEV) { + console.warn('LadybugDB load failed (non-fatal, continuing without it):', err); + } // Still build BM25 index even if LadybugDB fails buildBM25Index(fileMap); } diff --git a/gitnexus/package.json b/gitnexus/package.json index cba150460..76f6a368f 100644 --- a/gitnexus/package.json +++ b/gitnexus/package.json @@ -45,7 +45,7 @@ "test:integration": "vitest run test/integration", "test:watch": "vitest", "test:coverage": "vitest run --coverage", - "prepare": "npm run build && cd .. && husky", + "prepare": "node scripts/prepare.cjs", "postinstall": "node scripts/patch-tree-sitter-swift.cjs", "prepack": "npm run build && chmod +x dist/cli/index.js" }, diff --git a/gitnexus/scripts/prepare.cjs b/gitnexus/scripts/prepare.cjs new file mode 100644 index 000000000..73c3568d4 --- /dev/null +++ b/gitnexus/scripts/prepare.cjs @@ -0,0 +1,16 @@ +/** + * Prepare script: build TypeScript and install husky hooks. + * Uses Node child_process so it works on Windows (cmd.exe) and POSIX. + */ +const { execSync } = require('child_process'); +const path = require('path'); + +// 1. Build +execSync('npm run build', { stdio: 'inherit', cwd: __dirname + '/..' }); + +// 2. Install husky (from repo root — one level up from gitnexus/) +try { + execSync('npx husky', { stdio: 'inherit', cwd: path.resolve(__dirname, '../..') }); +} catch { + // Husky install is optional — may fail in CI or tarball installs +}