@humanbased/crosscheck 1.5.0 → 1.6.0-beta.8
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/dist/__tests__/board.test.js +510 -20
- package/dist/__tests__/board.test.js.map +1 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +18 -5
- package/dist/commands/watch.js.map +1 -1
- package/dist/lib/board.d.ts +59 -4
- package/dist/lib/board.d.ts.map +1 -1
- package/dist/lib/board.js +356 -64
- package/dist/lib/board.js.map +1 -1
- package/dist/lib/tips.d.ts.map +1 -1
- package/dist/lib/tips.js +1 -0
- package/dist/lib/tips.js.map +1 -1
- package/get-started.md +16 -0
- package/package.json +1 -1
package/dist/lib/board.d.ts
CHANGED
|
@@ -24,10 +24,31 @@ export interface PRCompletionData {
|
|
|
24
24
|
* run, such as one the review strategy short-circuited. */
|
|
25
25
|
label?: string;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* The terminal state of one settled slot, for the session outcome distribution.
|
|
29
|
+
* `skipped` is a PR that settled without any verdict at all — the review
|
|
30
|
+
* strategy short-circuited it (lockfile-only, doc-only) — as distinct from
|
|
31
|
+
* `no verdict`, where a reviewer ran and returned nothing parseable.
|
|
32
|
+
*/
|
|
33
|
+
export type Outcome = 'APPROVE' | 'NEEDS WORK' | 'BLOCK' | 'no verdict' | 'skipped' | 'error';
|
|
27
34
|
export declare function fmtTime(d?: Date): string;
|
|
28
35
|
export declare const FMT_TIME_WIDTH = 11;
|
|
36
|
+
export declare function fmtUptime(ms: number): string;
|
|
37
|
+
/**
|
|
38
|
+
* Whole percentages summing to exactly 100, by the largest-remainder method.
|
|
39
|
+
* Plain rounding drifts — three equal shares render as 33/33/33 — and a
|
|
40
|
+
* distribution that visibly fails to add up reads as a bug in the numbers.
|
|
41
|
+
*
|
|
42
|
+
* A non-zero count too small to earn a point comes back as 0; the caller
|
|
43
|
+
* renders those as "<1%" rather than claiming the outcome never happened.
|
|
44
|
+
*/
|
|
45
|
+
export declare function distribute(counts: readonly number[]): number[];
|
|
29
46
|
export declare function fmtTokens(n?: number): string;
|
|
30
47
|
export declare function fmtTokensRaw(n?: number): string;
|
|
48
|
+
export declare function isNoticeLine(msg: string): boolean;
|
|
49
|
+
export type PageKey = 'older' | 'newer' | null;
|
|
50
|
+
/** Map a raw stdin key sequence to a page direction, or null when it is not a page key. */
|
|
51
|
+
export declare function pageKeyAction(seq: string): PageKey;
|
|
31
52
|
export declare class PRBoard {
|
|
32
53
|
private slots;
|
|
33
54
|
private frameIdx;
|
|
@@ -36,6 +57,10 @@ export declare class PRBoard {
|
|
|
36
57
|
private liveContent;
|
|
37
58
|
private readonly isTTY;
|
|
38
59
|
private connLog;
|
|
60
|
+
private page;
|
|
61
|
+
private pageCount;
|
|
62
|
+
private keyHandler;
|
|
63
|
+
private stdinWasRaw;
|
|
39
64
|
private stats;
|
|
40
65
|
private tunnel;
|
|
41
66
|
private config;
|
|
@@ -45,9 +70,20 @@ export declare class PRBoard {
|
|
|
45
70
|
setTunnel(type: string, url: string | null, alive: boolean): void;
|
|
46
71
|
start(): void;
|
|
47
72
|
stop(): void;
|
|
73
|
+
/** Flip one page toward older history. No-op when already at the oldest page. */
|
|
74
|
+
pageOlder(): void;
|
|
75
|
+
/** Flip one page toward the live page. No-op when already on it. */
|
|
76
|
+
pageNewer(): void;
|
|
48
77
|
addPR(key: string, prNumber: number, repo: string, branch: string, round?: number): void;
|
|
49
78
|
updatePR(key: string, updates: PRUpdate): void;
|
|
50
79
|
completePR(key: string, data: PRCompletionData): void;
|
|
80
|
+
/**
|
|
81
|
+
* Settle a slot that ended in an error. The slot stays in the workspace as a
|
|
82
|
+
* settled row, the same as a completed one: a failed run is a session record,
|
|
83
|
+
* and deleting it here was what pushed reviewer timeouts out of the table and
|
|
84
|
+
* into raw scrollback, where a long watch session showed 43 errors above an
|
|
85
|
+
* empty workspace reading "no PRs yet".
|
|
86
|
+
*/
|
|
51
87
|
failPR(key: string, error: string): void;
|
|
52
88
|
/** Print 1–2 static lines to scrollback (above the live block). */
|
|
53
89
|
log(line1: string, line2?: string): void;
|
|
@@ -60,7 +96,13 @@ export declare class PRBoard {
|
|
|
60
96
|
private verdictBadge;
|
|
61
97
|
private crFillFn;
|
|
62
98
|
private crLabelFn;
|
|
63
|
-
|
|
99
|
+
/** "since 08:25 PM · up 3h32m" — when watch started, and how long it has run. */
|
|
100
|
+
private sessionRow;
|
|
101
|
+
/**
|
|
102
|
+
* Outcome shares across every PR that settled this session, e.g.
|
|
103
|
+
* "APPROVE 45% · BLOCK 30% · error 25%". Empty when nothing has settled yet.
|
|
104
|
+
*/
|
|
105
|
+
private outcomeRow;
|
|
64
106
|
private statsRow;
|
|
65
107
|
private renderPRSlot;
|
|
66
108
|
private phaseLine1Label;
|
|
@@ -68,17 +110,30 @@ export declare class PRBoard {
|
|
|
68
110
|
private renderFixSection;
|
|
69
111
|
private renderRecheckSection;
|
|
70
112
|
private render;
|
|
113
|
+
/**
|
|
114
|
+
* Pick the slots the live page shows: the expanded layout when it fits, then
|
|
115
|
+
* the compact one, then compact with the oldest settled slots handed over to
|
|
116
|
+
* history until the block fits the viewport. Active slots are never handed
|
|
117
|
+
* over — a running review must stay on screen.
|
|
118
|
+
*/
|
|
119
|
+
private fitLivePage;
|
|
120
|
+
/** Rows the panels and footer cost, i.e. everything but the PR rows. */
|
|
121
|
+
private chromeRows;
|
|
122
|
+
private fitToBudget;
|
|
71
123
|
private renderLayout;
|
|
72
|
-
/**
|
|
73
|
-
private
|
|
124
|
+
/** Drop the oldest settled slots once the session history outgrows the cap. */
|
|
125
|
+
private trimHistory;
|
|
74
126
|
/** Drop rows from the top until the content (plus an indicator line) fits the budget. */
|
|
75
127
|
private truncateTop;
|
|
76
128
|
private renderConfigPanel;
|
|
77
129
|
private renderStatsPanel;
|
|
78
130
|
private renderTipLine;
|
|
79
131
|
private renderPRWorkspace;
|
|
132
|
+
/** Footer: where in the retained history this page sits, and how to move. */
|
|
133
|
+
private renderFooter;
|
|
80
134
|
private renderPRSlotFolded;
|
|
81
|
-
private evictOverflow;
|
|
82
135
|
private redraw;
|
|
136
|
+
private attachKeys;
|
|
137
|
+
private detachKeys;
|
|
83
138
|
}
|
|
84
139
|
//# sourceMappingURL=board.d.ts.map
|
package/dist/lib/board.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board.d.ts","sourceRoot":"","sources":["../../src/lib/board.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAgB,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAKjD,MAAM,MAAM,OAAO,GACf,QAAQ,GACR,WAAW,GACX,UAAU,GACV,QAAQ,GACR,OAAO,GACP,YAAY,GACZ,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"board.d.ts","sourceRoot":"","sources":["../../src/lib/board.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAgB,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAKjD,MAAM,MAAM,OAAO,GACf,QAAQ,GACR,WAAW,GACX,UAAU,GACV,QAAQ,GACR,OAAO,GACP,YAAY,GACZ,WAAW,CAAA;AAgDf,MAAM,WAAW,QAAQ;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,E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