project-compass 2.8.1 → 2.8.2
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 +20 -10
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -332,7 +332,15 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
332
332
|
if (shiftCombo('x')) { setTasks(prev => prev.map(t => t.id === activeTaskId ? {...t, logs: []} : t)); setLogOffset(0); return; }
|
|
333
333
|
if (shiftCombo('e')) { exportLogs(); return; }
|
|
334
334
|
if (shiftCombo('d')) { setActiveTaskId(null); return; }
|
|
335
|
-
|
|
335
|
+
|
|
336
|
+
if (shiftCombo('t')) {
|
|
337
|
+
setMainView((prev) => {
|
|
338
|
+
if (prev === 'tasks') return 'navigator';
|
|
339
|
+
if (tasks.length > 0 && !activeTaskId) setActiveTaskId(tasks[0].id);
|
|
340
|
+
return 'tasks';
|
|
341
|
+
});
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
336
344
|
|
|
337
345
|
const scrollLogs = (delta) => {
|
|
338
346
|
setLogOffset((prev) => {
|
|
@@ -342,6 +350,15 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
342
350
|
});
|
|
343
351
|
};
|
|
344
352
|
|
|
353
|
+
if (mainView === 'tasks') {
|
|
354
|
+
if (tasks.length > 0) {
|
|
355
|
+
if (key.upArrow) { setActiveTaskId(prev => tasks[(tasks.findIndex(t => t.id === prev) - 1 + tasks.length) % tasks.length]?.id); return; }
|
|
356
|
+
if (key.downArrow) { setActiveTaskId(prev => tasks[(tasks.findIndex(t => t.id === prev) + 1) % tasks.length]?.id); return; }
|
|
357
|
+
}
|
|
358
|
+
if (key.return) { setMainView('navigator'); return; }
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
|
|
345
362
|
if (running && activeTaskId && runningProcessMap.current.has(activeTaskId)) {
|
|
346
363
|
const proc = runningProcessMap.current.get(activeTaskId);
|
|
347
364
|
if (key.ctrl && input === 'c') { proc.kill('SIGINT'); setStdinBuffer(''); setStdinCursor(0); return; }
|
|
@@ -368,13 +385,6 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
368
385
|
if (normalizedInput === '?') { setShowHelp((prev) => !prev); return; }
|
|
369
386
|
if (shiftCombo('l') && lastCommandRef.current) { runProjectCommand(lastCommandRef.current.commandMeta, lastCommandRef.current.project); return; }
|
|
370
387
|
|
|
371
|
-
if (mainView === 'tasks') {
|
|
372
|
-
if (key.upArrow) { setActiveTaskId(prev => tasks[(tasks.findIndex(t => t.id === prev) - 1 + tasks.length) % tasks.length]?.id); return; }
|
|
373
|
-
if (key.downArrow) { setActiveTaskId(prev => tasks[(tasks.findIndex(t => t.id === prev) + 1) % tasks.length]?.id); return; }
|
|
374
|
-
if (key.return || shiftCombo('t')) { setMainView('navigator'); return; }
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
388
|
if (key.upArrow && !key.shift && projects.length > 0) { setSelectedIndex((prev) => (prev - 1 + projects.length) % projects.length); return; }
|
|
379
389
|
if (key.downArrow && !key.shift && projects.length > 0) { setSelectedIndex((prev) => (prev + 1) % projects.length); return; }
|
|
380
390
|
if (key.return) {
|
|
@@ -412,7 +422,7 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
412
422
|
create(Text, {color: t.id === activeTaskId ? 'cyan' : 'white', bold: t.id === activeTaskId}, `${t.id === activeTaskId ? '→' : ' '} [${t.status.toUpperCase()}] ${t.name}`)
|
|
413
423
|
)),
|
|
414
424
|
!tasks.length && create(Text, {dimColor: true}, 'No active or background tasks.'),
|
|
415
|
-
create(Text, {marginTop: 1, dimColor: true}, 'Press Enter
|
|
425
|
+
create(Text, {marginTop: 1, dimColor: true}, 'Press Enter or Shift+T to return to Navigator, Up/Down to switch focus.')
|
|
416
426
|
);
|
|
417
427
|
}
|
|
418
428
|
|
|
@@ -523,7 +533,7 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
523
533
|
create(Box, {flexDirection: 'row', justifyContent: 'space-between'}, create(Text, {bold: true, color: 'yellow'}, `Output: ${activeTask?.name || 'None'}`), create(Text, {dimColor: true}, logOffset ? `Scrolled ${logOffset} lines` : 'Live log view')),
|
|
524
534
|
create(Box, {flexDirection: 'column', borderStyle: 'round', borderColor: 'yellow', padding: 1, minHeight: OUTPUT_WINDOW_HEIGHT, maxHeight: OUTPUT_WINDOW_HEIGHT, height: OUTPUT_WINDOW_HEIGHT, overflow: 'hidden'}, ...logNodes),
|
|
525
535
|
create(Box, {marginTop: 1, flexDirection: 'row', justifyContent: 'space-between'}, create(Text, {dimColor: true}, running ? 'Type to feed stdin; Enter: submit, Ctrl+C: abort.' : 'Run a command or press Shift+T to switch tasks.'), create(Text, {dimColor: true}, `${toggleHint}, Shift+S: Structure Guide`)),
|
|
526
|
-
create(Box, {marginTop: 1, flexDirection: 'row', borderStyle: 'round', borderColor: running ? 'green' : 'gray', paddingX: 1}, create(Text, {bold: true, color:
|
|
536
|
+
create(Box, {marginTop: 1, flexDirection: 'row', borderStyle: 'round', borderColor: running ? 'green' : 'gray', paddingX: 1}, create(Text, {bold: true, color: 'green'}, running ? ' Stdin buffer ' : ' Input ready '), create(Box, {marginLeft: 1}, create(CursorText, {value: stdinBuffer || (running ? '' : 'Start a command to feed stdin'), cursorIndex: stdinCursor, active: running})))
|
|
527
537
|
),
|
|
528
538
|
showHelpCards && create(Box, {marginTop: 1, flexDirection: 'row', justifyContent: 'space-between', flexWrap: 'wrap'}, ...helpCards.map((card, idx) => create(Box, {key: card.label, flexGrow: 1, flexBasis: 0, minWidth: HELP_CARD_MIN_WIDTH, marginRight: idx < 2 ? 1 : 0, marginBottom: 1, borderStyle: 'round', borderColor: card.color, padding: 1, flexDirection: 'column'}, create(Text, {color: card.color, bold: true, marginBottom: 1}, card.label), ...card.body.map((line, lidx) => create(Text, {key: lidx, dimColor: card.color === 'yellow'}, line))))),
|
|
529
539
|
showStructureGuide && create(Box, {flexDirection: 'column', borderStyle: 'round', borderColor: 'blue', marginTop: 1, padding: 1}, create(Text, {color: 'cyan', bold: true}, 'Structure guide · press Shift+S to hide'), ...SCHEMA_GUIDE.map(e => create(Text, {key: e.type, dimColor: true}, `• ${e.icon} ${e.label}: ${e.files.join(', ')}`))),
|