fix: address review — stale progress, cross-platform prepare, DEV log

- 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) <noreply@anthropic.com>
This commit is contained in:
jreakin 2026-03-23 03:26:32 -05:00
parent cb4dcf167f
commit 4e398cb566
4 changed files with 22 additions and 3 deletions

View file

@ -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);

View file

@ -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);
}

View file

@ -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"
},

View file

@ -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
}