project-compass 1.0.3 → 1.0.5
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 +26 -14
- package/project-compass-1.0.3.tgz +0 -0
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -772,6 +772,7 @@ const ACTION_MAP = {
|
|
|
772
772
|
const ART_CHARS = ['▁', '▃', '▄', '▅', '▇'];
|
|
773
773
|
const ART_COLORS = ['magenta', 'blue', 'cyan', 'yellow', 'red'];
|
|
774
774
|
const OUTPUT_WINDOW_SIZE = 10;
|
|
775
|
+
const OUTPUT_WINDOW_HEIGHT = OUTPUT_WINDOW_SIZE + 2;
|
|
775
776
|
const RECENT_RUN_LIMIT = 5;
|
|
776
777
|
|
|
777
778
|
function useScanner(rootPath) {
|
|
@@ -972,14 +973,20 @@ function Compass({rootPath}) {
|
|
|
972
973
|
return;
|
|
973
974
|
}
|
|
974
975
|
|
|
976
|
+
const scrollLogs = (delta) => {
|
|
977
|
+
setLogOffset((prev) => {
|
|
978
|
+
const maxScroll = Math.max(0, logLines.length - OUTPUT_WINDOW_SIZE);
|
|
979
|
+
return Math.max(0, Math.min(maxScroll, prev + delta));
|
|
980
|
+
});
|
|
981
|
+
};
|
|
982
|
+
|
|
975
983
|
if (key.mouse) {
|
|
976
984
|
if (key.mouse === 'left' && projects.length > 0) {
|
|
977
985
|
setSelectedIndex((prev) => (prev + 1) % projects.length);
|
|
978
|
-
} else if (key.mouse === 'scrollUp') {
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
setLogOffset((prev) => Math.max(0, prev - 1));
|
|
986
|
+
} else if (key.mouse === 'scrollUp' || key.mouse === 'wheelUp') {
|
|
987
|
+
scrollLogs(1);
|
|
988
|
+
} else if (key.mouse === 'scrollDown' || key.mouse === 'wheelDown') {
|
|
989
|
+
scrollLogs(-1);
|
|
983
990
|
}
|
|
984
991
|
return;
|
|
985
992
|
}
|
|
@@ -1306,17 +1313,18 @@ function Compass({rootPath}) {
|
|
|
1306
1313
|
artBoard,
|
|
1307
1314
|
create(
|
|
1308
1315
|
Box,
|
|
1309
|
-
{marginTop: 1, flexDirection: 'row', alignItems: 'stretch'},
|
|
1316
|
+
{marginTop: 1, flexDirection: 'row', alignItems: 'stretch', width: '100%', flexWrap: 'nowrap'},
|
|
1310
1317
|
create(
|
|
1311
1318
|
Box,
|
|
1312
1319
|
{
|
|
1313
|
-
|
|
1320
|
+
flexGrow: 1,
|
|
1314
1321
|
flexBasis: 0,
|
|
1322
|
+
flexShrink: 1,
|
|
1323
|
+
minWidth: 28,
|
|
1315
1324
|
marginRight: 1,
|
|
1316
1325
|
borderStyle: 'round',
|
|
1317
1326
|
borderColor: 'magenta',
|
|
1318
|
-
padding: 1
|
|
1319
|
-
minWidth: 0
|
|
1327
|
+
padding: 1
|
|
1320
1328
|
},
|
|
1321
1329
|
create(Text, {bold: true, color: 'magenta'}, 'Projects'),
|
|
1322
1330
|
create(Box, {flexDirection: 'column', marginTop: 1}, ...projectRows)
|
|
@@ -1324,12 +1332,13 @@ function Compass({rootPath}) {
|
|
|
1324
1332
|
create(
|
|
1325
1333
|
Box,
|
|
1326
1334
|
{
|
|
1327
|
-
|
|
1335
|
+
flexGrow: 1.3,
|
|
1328
1336
|
flexBasis: 0,
|
|
1337
|
+
flexShrink: 1,
|
|
1338
|
+
minWidth: 36,
|
|
1329
1339
|
borderStyle: 'round',
|
|
1330
1340
|
borderColor: 'cyan',
|
|
1331
|
-
padding: 1
|
|
1332
|
-
minWidth: 0
|
|
1341
|
+
padding: 1
|
|
1333
1342
|
},
|
|
1334
1343
|
create(Text, {bold: true, color: 'cyan'}, 'Details'),
|
|
1335
1344
|
...detailContent
|
|
@@ -1351,8 +1360,11 @@ function Compass({rootPath}) {
|
|
|
1351
1360
|
borderStyle: 'round',
|
|
1352
1361
|
borderColor: 'yellow',
|
|
1353
1362
|
padding: 1,
|
|
1354
|
-
minHeight:
|
|
1355
|
-
|
|
1363
|
+
minHeight: OUTPUT_WINDOW_HEIGHT,
|
|
1364
|
+
maxHeight: OUTPUT_WINDOW_HEIGHT,
|
|
1365
|
+
height: OUTPUT_WINDOW_HEIGHT,
|
|
1366
|
+
overflow: 'hidden',
|
|
1367
|
+
flexShrink: 0
|
|
1356
1368
|
},
|
|
1357
1369
|
...logNodes
|
|
1358
1370
|
),
|
|
Binary file
|