@deathbeam/pi-delegate 0.0.3 → 0.0.4
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/index.ts +6 -10
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -355,7 +355,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
355
355
|
const renderJobs = (width: number, items: InspectJob[], selectedIndex: number): string[] => {
|
|
356
356
|
const row = (text: string) =>
|
|
357
357
|
truncateToWidth(text, Math.max(0, width - 1), "…", true) + theme.fg("borderMuted", "│");
|
|
358
|
-
const visible = Math.max(1, Math.floor((bodyHeight() -
|
|
358
|
+
const visible = Math.max(1, Math.floor((bodyHeight() - 1) / 2));
|
|
359
359
|
const start = Math.max(
|
|
360
360
|
0,
|
|
361
361
|
Math.min(selectedIndex - Math.floor(visible / 2), items.length - visible),
|
|
@@ -365,18 +365,15 @@ export default function (pi: ExtensionAPI) {
|
|
|
365
365
|
.flatMap((item, index) => [
|
|
366
366
|
row(
|
|
367
367
|
theme.fg(
|
|
368
|
-
start + index === selectedIndex ? "accent" : "text",
|
|
368
|
+
start + index === selectedIndex && focus === "list" ? "accent" : "text",
|
|
369
369
|
`${start + index === selectedIndex ? "›" : " "} ${statusText(theme, item.status)} ${item.agent} ${item.id}`,
|
|
370
370
|
),
|
|
371
371
|
),
|
|
372
372
|
row(theme.fg("muted", ` ${item.description}`)),
|
|
373
373
|
]);
|
|
374
|
-
const heading = row(theme.fg(focus === "list" ? "accent" : "muted", `Jobs (${items.length})`));
|
|
375
374
|
return [
|
|
376
|
-
heading,
|
|
377
|
-
row(theme.fg("borderMuted", "─".repeat(Math.max(0, width - 1)))),
|
|
378
375
|
...lines,
|
|
379
|
-
...Array(Math.max(0, bodyHeight() -
|
|
376
|
+
...Array(Math.max(0, bodyHeight() - 1 - lines.length)).fill(row("")),
|
|
380
377
|
row(theme.fg("dim", ` ${selectedIndex + 1}/${items.length}`)),
|
|
381
378
|
].slice(0, bodyHeight());
|
|
382
379
|
};
|
|
@@ -447,10 +444,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
447
444
|
);
|
|
448
445
|
const selected = items[selectedIndex];
|
|
449
446
|
const title = truncateToWidth(
|
|
450
|
-
theme.fg(
|
|
451
|
-
"accent",
|
|
452
|
-
theme.
|
|
453
|
-
),
|
|
447
|
+
`${theme.fg(focus === "list" ? "accent" : "muted", focus === "list" ? "[Jobs]" : "Jobs")} ` +
|
|
448
|
+
`${theme.fg(focus === "history" ? "accent" : "muted", focus === "history" ? "[Activity]" : "Activity")}` +
|
|
449
|
+
theme.fg("dim", ` · ${running.size} running · ${items.length} total`),
|
|
454
450
|
width,
|
|
455
451
|
);
|
|
456
452
|
const footer = truncateToWidth(
|