project-compass 3.5.5 → 3.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli.js +21 -14
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -358,19 +358,27 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
358
358
|
|
|
359
359
|
const normalizedInput = input?.toLowerCase();
|
|
360
360
|
const shiftCombo = (char) => key.shift && normalizedInput === char;
|
|
361
|
+
|
|
362
|
+
const clearAndSwitch = (view) => {
|
|
363
|
+
console.clear();
|
|
364
|
+
setMainView(view);
|
|
365
|
+
setViewMode('list');
|
|
366
|
+
setShowHelp(false);
|
|
367
|
+
};
|
|
361
368
|
|
|
362
|
-
if (shiftCombo('h')) { setConfig(prev => { const next = {...prev, showHelpCards: !prev.showHelpCards}; saveConfig(next); return next; }); return; }
|
|
363
|
-
if (shiftCombo('s')) { setConfig(prev => { const next = {...prev, showStructureGuide: !prev.showStructureGuide}; saveConfig(next); return next; }); return; }
|
|
364
|
-
if (shiftCombo('a')) {
|
|
365
|
-
if (shiftCombo('p')) {
|
|
366
|
-
if (shiftCombo('n')) {
|
|
367
|
-
if (shiftCombo('x')) { setTasks(prev => prev.map(t => t.id === activeTaskId ? {...t, logs: []} : t)); setLogOffset(0); return; }
|
|
369
|
+
if (shiftCombo('h')) { console.clear(); setConfig(prev => { const next = {...prev, showHelpCards: !prev.showHelpCards}; saveConfig(next); return next; }); return; }
|
|
370
|
+
if (shiftCombo('s')) { console.clear(); setConfig(prev => { const next = {...prev, showStructureGuide: !prev.showStructureGuide}; saveConfig(next); return next; }); return; }
|
|
371
|
+
if (shiftCombo('a')) { clearAndSwitch(mainView === 'navigator' ? 'studio' : 'navigator'); return; }
|
|
372
|
+
if (shiftCombo('p')) { clearAndSwitch(mainView === 'navigator' ? 'registry' : 'navigator'); return; }
|
|
373
|
+
if (shiftCombo('n')) { clearAndSwitch(mainView === 'navigator' ? 'architect' : 'navigator'); return; }
|
|
374
|
+
if (shiftCombo('x')) { console.clear(); setTasks(prev => prev.map(t => t.id === activeTaskId ? {...t, logs: []} : t)); setLogOffset(0); return; }
|
|
368
375
|
if (shiftCombo('e')) { exportLogs(); return; }
|
|
369
|
-
if (shiftCombo('d')) { setActiveTaskId(null); return; }
|
|
370
|
-
if (shiftCombo('b')) { setConfig(prev => { const next = {...prev, showArtBoard: !prev.showArtBoard}; saveConfig(next); return next; }); return; }
|
|
376
|
+
if (shiftCombo('d')) { console.clear(); setActiveTaskId(null); return; }
|
|
377
|
+
if (shiftCombo('b')) { console.clear(); setConfig(prev => { const next = {...prev, showArtBoard: !prev.showArtBoard}; saveConfig(next); return next; }); return; }
|
|
371
378
|
|
|
372
379
|
if (shiftCombo('t')) {
|
|
373
380
|
setMainView((prev) => {
|
|
381
|
+
console.clear();
|
|
374
382
|
if (prev === 'tasks') return 'navigator';
|
|
375
383
|
if (tasks.length > 0 && !activeTaskId) setActiveTaskId(tasks[0].id);
|
|
376
384
|
return 'tasks';
|
|
@@ -382,9 +390,7 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
382
390
|
|
|
383
391
|
if (key.escape) {
|
|
384
392
|
if (mainView !== 'navigator') {
|
|
385
|
-
|
|
386
|
-
setViewMode('list');
|
|
387
|
-
setShowHelp(false);
|
|
393
|
+
clearAndSwitch('navigator');
|
|
388
394
|
return;
|
|
389
395
|
}
|
|
390
396
|
}
|
|
@@ -438,13 +444,14 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
438
444
|
if (key.shift && key.upArrow) { scrollLogs(1); return; }
|
|
439
445
|
if (key.shift && key.downArrow) { scrollLogs(-1); return; }
|
|
440
446
|
|
|
441
|
-
if (normalizedInput === '?') { setShowHelp((prev) => !prev); return; }
|
|
447
|
+
if (normalizedInput === '?') { console.clear(); setShowHelp((prev) => !prev); return; }
|
|
442
448
|
if (shiftCombo('l') && lastCommandRef.current) { runProjectCommand(lastCommandRef.current.commandMeta, lastCommandRef.current.project); return; }
|
|
443
449
|
|
|
444
|
-
if (key.upArrow && !key.shift && projects.length > 0) { setSelectedIndex((prev) => (prev - 1 + projects.length) % projects.length); return; }
|
|
445
|
-
if (key.downArrow && !key.shift && projects.length > 0) { setSelectedIndex((prev) => (prev + 1) % projects.length); return; }
|
|
450
|
+
if (key.upArrow && !key.shift && projects.length > 0) { console.clear(); setSelectedIndex((prev) => (prev - 1 + projects.length) % projects.length); return; }
|
|
451
|
+
if (key.downArrow && !key.shift && projects.length > 0) { console.clear(); setSelectedIndex((prev) => (prev + 1) % projects.length); return; }
|
|
446
452
|
if (key.return) {
|
|
447
453
|
if (!selectedProject) return;
|
|
454
|
+
console.clear();
|
|
448
455
|
setViewMode((prev) => (prev === 'detail' ? 'list' : 'detail'));
|
|
449
456
|
return;
|
|
450
457
|
}
|