@stevecastaneda/paseo-progress 0.1.6 → 0.1.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/client/panel.tsx +6 -7
- package/dist/shared/dashboard.js +11 -9
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/shared/dashboard.ts +12 -9
package/client/panel.tsx
CHANGED
|
@@ -10,7 +10,7 @@ import { raised } from "./surfaces";
|
|
|
10
10
|
import { When } from "./when";
|
|
11
11
|
import React, { useEffect, useRef, useState } from "react";
|
|
12
12
|
import { ActivityIndicator, Animated, Platform, Pressable, ScrollView, Text, View } from "react-native";
|
|
13
|
-
import {
|
|
13
|
+
import { finishedToFold, isFinished, shortTitle, type Activity, type Dashboard, type FileIssue, type ProgressSegment, type StuckItem, type Ticket } from "../shared/dashboard";
|
|
14
14
|
import { PROGRESS_FILE, type TicketStatus } from "../shared/events";
|
|
15
15
|
import { formatEstimate, formatMinutes, formatWorkDone, minutesSince } from "../shared/format";
|
|
16
16
|
import { markPanelOpened } from "../shared/rpc";
|
|
@@ -416,26 +416,25 @@ function StuckSection({ colors, items, now }: { colors: Colors; items: StuckItem
|
|
|
416
416
|
// the app session like the history tab.
|
|
417
417
|
const finishedShown = new Map<string, boolean>();
|
|
418
418
|
|
|
419
|
-
// Finished tickets
|
|
420
|
-
// near the top without scrolling (see
|
|
419
|
+
// Finished tickets fold into one row at the top, so the work still ahead is
|
|
420
|
+
// near the top without scrolling (see finishedToFold).
|
|
421
421
|
function TicketList({ colors, dashboard, live, now, workspaceId, onOpen }: { colors: Colors; dashboard: Dashboard; live: boolean; now: number; workspaceId: string; onOpen(id: string): void }) {
|
|
422
422
|
const [shown, setShown] = useState(() => finishedShown.get(workspaceId) ?? false);
|
|
423
423
|
const toggle = () => {
|
|
424
424
|
finishedShown.set(workspaceId, !shown);
|
|
425
425
|
setShown(!shown);
|
|
426
426
|
};
|
|
427
|
-
const
|
|
427
|
+
const finished = finishedToFold(dashboard.tickets);
|
|
428
428
|
const row = (ticket: Ticket) => (
|
|
429
429
|
<TicketRow key={ticket.id} colors={colors} ticket={ticket} live={live} now={now} onOpen={() => onOpen(ticket.id)}
|
|
430
430
|
deliverables={dashboard.deliverables.filter((deliverable) => deliverable.ticketId === ticket.id).length} />
|
|
431
431
|
);
|
|
432
|
-
if (!
|
|
433
|
-
const finished = dashboard.tickets.slice(0, folded);
|
|
432
|
+
if (!finished.length) return <>{dashboard.tickets.map(row)}</>;
|
|
434
433
|
return (
|
|
435
434
|
<>
|
|
436
435
|
<FinishedRow colors={colors} tickets={finished} shown={shown} onPress={toggle} />
|
|
437
436
|
{shown ? finished.map(row) : null}
|
|
438
|
-
{dashboard.tickets.
|
|
437
|
+
{dashboard.tickets.filter((ticket) => !isFinished(ticket)).map(row)}
|
|
439
438
|
</>
|
|
440
439
|
);
|
|
441
440
|
}
|
package/dist/shared/dashboard.js
CHANGED
|
@@ -328,15 +328,17 @@ export function shortTitle(title) {
|
|
|
328
328
|
const index = title.indexOf(":");
|
|
329
329
|
return index > 0 && index <= 24 ? title.slice(0, index) : title;
|
|
330
330
|
}
|
|
331
|
-
//
|
|
332
|
-
//
|
|
333
|
-
//
|
|
334
|
-
//
|
|
335
|
-
//
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
331
|
+
// The finished tickets (done or skipped) the panel folds into one row at the
|
|
332
|
+
// top, in plan order, so the work still ahead sits near the top. A ticket
|
|
333
|
+
// finished out of order folds too. A single one isn't worth a fold row. Once
|
|
334
|
+
// every ticket is finished nothing is ahead, and the whole list is the record
|
|
335
|
+
// of the run, so nothing folds.
|
|
336
|
+
export function finishedToFold(tickets) {
|
|
337
|
+
const finished = tickets.filter(isFinished);
|
|
338
|
+
return finished.length >= 2 && finished.length < tickets.length ? finished : [];
|
|
339
|
+
}
|
|
340
|
+
export function isFinished(ticket) {
|
|
341
|
+
return ticket.status === "done" || ticket.status === "skipped";
|
|
340
342
|
}
|
|
341
343
|
function plural(count, noun) {
|
|
342
344
|
return `${count} ${count === 1 ? noun : `${noun}s`}`;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stevecastaneda/paseo-progress",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@stevecastaneda/paseo-progress",
|
|
9
|
-
"version": "0.1.
|
|
9
|
+
"version": "0.1.7",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@getpaseo/client": "^0.9.2",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stevecastaneda/paseo-progress",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "A live progress dashboard per worktree for Paseo, drawn from a file agents write with the paseo-progress command.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Steve Castaneda",
|
package/shared/dashboard.ts
CHANGED
|
@@ -449,15 +449,18 @@ export function shortTitle(title: string): string {
|
|
|
449
449
|
return index > 0 && index <= 24 ? title.slice(0, index) : title;
|
|
450
450
|
}
|
|
451
451
|
|
|
452
|
-
//
|
|
453
|
-
//
|
|
454
|
-
//
|
|
455
|
-
//
|
|
456
|
-
//
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
452
|
+
// The finished tickets (done or skipped) the panel folds into one row at the
|
|
453
|
+
// top, in plan order, so the work still ahead sits near the top. A ticket
|
|
454
|
+
// finished out of order folds too. A single one isn't worth a fold row. Once
|
|
455
|
+
// every ticket is finished nothing is ahead, and the whole list is the record
|
|
456
|
+
// of the run, so nothing folds.
|
|
457
|
+
export function finishedToFold(tickets: Ticket[]): Ticket[] {
|
|
458
|
+
const finished = tickets.filter(isFinished);
|
|
459
|
+
return finished.length >= 2 && finished.length < tickets.length ? finished : [];
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export function isFinished(ticket: Ticket): boolean {
|
|
463
|
+
return ticket.status === "done" || ticket.status === "skipped";
|
|
461
464
|
}
|
|
462
465
|
|
|
463
466
|
function plural(count: number, noun: string): string {
|