paseo-follow-up 2.7.0-beta.1 → 2.7.0-beta.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/client/home-list.tsx +17 -9
- package/package.json +1 -1
- package/shared/home.ts +8 -0
- package/shared/inbox.ts +6 -2
- package/shared/row-chips.ts +8 -3
package/client/home-list.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { NEW_NAME } from "../shared/new-name";
|
|
|
3
3
|
import { Platform, View, type FlatList as NativeFlatList } from "react-native";
|
|
4
4
|
import { Pressable, Text } from "./text";
|
|
5
5
|
import { Icon, FlatList } from "@getpaseo/plugin/client/ui";
|
|
6
|
-
import { type Badge, type HomeGroupId, type HomeModel, type Workstream, blocksOn, hiddenChips, lineBasis, lineFloor, lineFloorCss, markFloorCss, titleMaxCss, lineWidth, rowReserve, titleFloor, prChipSpoken, railChips, railKeeps, runningMark } from "../shared/home";
|
|
6
|
+
import { type Badge, type HomeGroupId, type HomeModel, type Workstream, blocksOn, hiddenChips, lineBasis, LINE_SHOWS, lineFloor, lineFloorCss, markFloorCss, titleMaxCss, lineWidth, rowReserve, titleFloor, prChipSpoken, prLabelText, railChips, railKeeps, runningMark } from "../shared/home";
|
|
7
7
|
import { ASK_KEY, excerpt, FIELD_LABEL, type OmniboxItem, type Range, type RowHit, type SearchHit, sameHit } from "../shared/search";
|
|
8
8
|
import { AskRow, PriorityLine } from "./home-chrome";
|
|
9
9
|
import { age, wakeLabel, wakeShort } from "../shared/inbox";
|
|
@@ -347,7 +347,7 @@ export function PrChipView({ s, c }: { s: Workstream; c: Colors }) {
|
|
|
347
347
|
const checks = s.pr.checks;
|
|
348
348
|
return <View testID="follow-up-row-chip" role="img" aria-label={prChipSpoken(s.pr)} style={{ flexShrink: 0, flexDirection: "row", alignItems: "center", gap: 4, paddingHorizontal: 6, height: 20, borderRadius: 4, borderWidth: 1, borderColor: c.border }}>
|
|
349
349
|
<Icon name="GitPullRequest" size={11} color={toneColor(c, s.pr.tone)} />
|
|
350
|
-
<Text numberOfLines={1} style={{ flexShrink: 0, color: c.foreground, fontSize: 11, lineHeight: 14, fontVariant: ["tabular-nums"] }}>{s.pr.label}</Text>
|
|
350
|
+
<Text numberOfLines={1} style={{ flexShrink: 0, color: c.foreground, fontSize: 11, lineHeight: 14, fontVariant: ["tabular-nums"] }}>{prLabelText(s.pr.label)}</Text>
|
|
351
351
|
{checks && <Text numberOfLines={1} style={{ flexShrink: 1, minWidth: 0, color: checks.tone === "muted" ? c.foregroundMuted : badgeColor({ text: "", tone: checks.tone }, c), fontSize: 11, lineHeight: 14 }}>{checks.text}</Text>}
|
|
352
352
|
</View>;
|
|
353
353
|
}
|
|
@@ -356,7 +356,7 @@ export function PrChipView({ s, c }: { s: Workstream; c: Colors }) {
|
|
|
356
356
|
export function PrSummaryText({ s, c, lead = "" }: { s: Workstream; c: Colors; lead?: string }) {
|
|
357
357
|
if (!s.pr) return null;
|
|
358
358
|
const checks = s.pr.checks;
|
|
359
|
-
return <Text>{lead}<Text style={{ color: c.foreground }}>{s.pr.label
|
|
359
|
+
return <Text>{lead}<Text style={{ color: c.foreground }}>{prLabelText(s.pr.label)}</Text>
|
|
360
360
|
{checks && <Text style={{ color: checks.tone === "muted" ? c.foregroundMuted : badgeColor({ text: "", tone: checks.tone }, c) }}>{` ${checks.text}`}</Text>}</Text>;
|
|
361
361
|
}
|
|
362
362
|
|
|
@@ -563,9 +563,15 @@ const Row = memo(function Row({ s: raw, theme, dense, touch, selected, onSelect,
|
|
|
563
563
|
from the line, which shrinks first, down to LINE_FLOOR; below that the first chip drops into "+N" too. With
|
|
564
564
|
room the line grows, never past its own text: the rest goes to the rail (flexGrow 1), so a chip never drops
|
|
565
565
|
beside blank line; spare room goes to the line first (flexGrow 1000). */}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
566
|
+
{/* Squeezed below LINE_SHOWS, the line shows nothing rather than a lone "·" or "· …": its words sit after a
|
|
567
|
+
zero-width spacer in a one-line-high wrapping box, so they wrap onto the hidden second line instead. */}
|
|
568
|
+
<View testID="follow-up-row-line" style={{ flexGrow: 1000, flexShrink: 100000, flexBasis: lineBasis(lineText(s, hit)), maxWidth: lineWidth(lineText(s, hit)), minWidth: Platform.OS === "web" ? lineFloorCss(lineText(s, hit), rowReserve({ title: titleText, word: !via && s.group === "needs" ? s.word : null, mark: via ? null : runningMark(s), rail: railChips(rail).length > 0, sendNow: !!sendNow })) as unknown as number : lineFloor(lineText(s, hit)), marginLeft: !via && s.word && s.group === "needs" ? -10 : 0,
|
|
569
|
+
flexDirection: "row", flexWrap: "wrap", alignContent: "flex-start", height: 16, overflow: "hidden" }}>
|
|
570
|
+
<View style={{ width: 0, height: 16 }} />
|
|
571
|
+
<Text numberOfLines={1} style={{ flexGrow: 1, flexShrink: 1, flexBasis: LINE_SHOWS, minWidth: LINE_SHOWS, lineHeight: 16, color: c.foregroundMuted, fontSize: 12 }}>
|
|
572
|
+
{via ?? <>{s.word && s.group === "needs" && s.line ? "\u00a0· " : ""}{line}</>}
|
|
573
|
+
</Text>
|
|
574
|
+
</View>
|
|
569
575
|
{!via && <RunningMark s={s} c={c} size={12} lineHeight={16} tight reserve={rowReserve({ title: titleText, word: s.group === "needs" ? s.word : null, mark: null, rail: railChips(rail).length > 0, sendNow: !!sendNow })} />}
|
|
570
576
|
<ChipRail s={rail} c={c} dim={older} />
|
|
571
577
|
{sendNow}
|
|
@@ -591,11 +597,13 @@ function RunningMark({ s, c, size, lineHeight, tight = false, reserve = 0 }: { s
|
|
|
591
597
|
// Wide rows: the mark stays whole while the row has its `reserve`; in a list too narrow for the word, the mark and
|
|
592
598
|
// "+N" (320 px) its words give way, down to its spinner ("· ◌"; the row's label still says "N running"), so nothing
|
|
593
599
|
// runs onto the time (invariant 34). Off the web the mark never shrinks.
|
|
600
|
+
// Its words show whole or not at all ("· ◌ 1." read as a typo): they wrap onto a hidden second line, never cut.
|
|
594
601
|
const web = tight && Platform.OS === "web";
|
|
595
|
-
return <View style={{ flexShrink: web ? 1 : 0, minWidth: web ? markFloorCss(text, size, reserve) as unknown as number : undefined, flexDirection: "row", alignItems: "center", gap: 4, height: lineHeight, marginLeft: tight ? -6 : 0
|
|
602
|
+
return <View style={{ flexShrink: web ? 1 : 0, minWidth: web ? markFloorCss(text, size, reserve) as unknown as number : undefined, flexDirection: "row", alignItems: "center", gap: 4, height: lineHeight, marginLeft: tight ? -6 : 0,
|
|
603
|
+
...(web ? { flexWrap: "wrap" as const, alignContent: "flex-start" as const, overflow: "hidden" as const } : {}) }}>
|
|
596
604
|
<Text style={{ flexShrink: 0, color: c.foregroundMuted, fontSize: size, lineHeight }}>{"\u00a0·"}</Text>
|
|
597
605
|
<Spinner color={runningColor(c)} size={size - 1} label="Working" />
|
|
598
|
-
<Text numberOfLines={1} style={{ flexShrink: 1, minWidth: 0, color: c.foregroundMuted, fontSize: size, lineHeight, fontVariant: ["tabular-nums"] }}>{text}</Text>
|
|
606
|
+
<Text testID="follow-up-row-running-text" numberOfLines={1} style={{ flexShrink: web ? 0 : 1, minWidth: 0, color: c.foregroundMuted, fontSize: size, lineHeight, fontVariant: ["tabular-nums"] }}>{text}</Text>
|
|
599
607
|
</View>;
|
|
600
608
|
}
|
|
601
609
|
|
|
@@ -611,7 +619,7 @@ function MetaLine({ s, d, c, touch, dim }: { s: Workstream; d: RowDetail; c: Col
|
|
|
611
619
|
if (d.project) parts.push(<View key="p" style={{ flexDirection: "row", alignItems: "center", gap: 3, flexShrink: 1, minWidth: 0 }}><Icon name="Folder" size={glyph} color={c.foregroundMuted} /><Text numberOfLines={1} style={{ flexShrink: 1, color: c.foregroundMuted, fontSize: size }}>{d.project}</Text></View>);
|
|
612
620
|
if (d.pr && s.pr) parts.push(<View key="r" style={{ flexDirection: "row", alignItems: "center", gap: 3, flexShrink: 0 }}>
|
|
613
621
|
<Icon name="GitPullRequest" size={glyph} color={toneColor(c, s.pr.tone)} />
|
|
614
|
-
<Text numberOfLines={1} style={{ color: c.foregroundMuted, fontSize: size, fontVariant: ["tabular-nums"] }}>{s.pr.label}</Text>
|
|
622
|
+
<Text numberOfLines={1} style={{ color: c.foregroundMuted, fontSize: size, fontVariant: ["tabular-nums"] }}>{prLabelText(s.pr.label)}</Text>
|
|
615
623
|
{checks && <Text numberOfLines={1} style={{ color: checks.tone === "muted" ? c.foregroundMuted : badgeColor({ text: "", tone: checks.tone }, c), fontSize: size }}>{checks.text}</Text>}
|
|
616
624
|
</View>);
|
|
617
625
|
for (const l of d.labels) parts.push(<View key={`l:${l}`} style={{ flexDirection: "row", alignItems: "center", gap: 4, flexShrink: 1, minWidth: 0 }}><View style={{ width: 6, height: 6, borderRadius: 3, backgroundColor: c.foregroundMuted }} /><Text numberOfLines={1} style={{ flexShrink: 1, color: c.foregroundMuted, fontSize: size }}>{l}</Text></View>);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "paseo-follow-up",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.7.0-beta.
|
|
4
|
+
"version": "2.7.0-beta.2",
|
|
5
5
|
"description": "Every agent, one inbox. Follow-up brings what all your coding agents need from you into one ranked list, and follows their work through merge, deploy and after.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
package/shared/home.ts
CHANGED
|
@@ -207,6 +207,9 @@ function chipRank(s: Pr["snapshot"]): number {
|
|
|
207
207
|
if (!s?.complete) return 2;
|
|
208
208
|
return s.threads?.length ? 1 : s.checksPending ? 3 : s.draft ? 4 : 5;
|
|
209
209
|
}
|
|
210
|
+
/** A PR summary as a row draws it: "#2143 +5", the count apart from the number (the label keeps "#2143+5"). */
|
|
211
|
+
export const prLabelText = (label: string): string => label.replace(/\+(\d)/, " +$1");
|
|
212
|
+
|
|
210
213
|
/**
|
|
211
214
|
* The PR chip (`a-pr-summary-says-the-worst`): the workspace's PRs in one chip, so it says the worst of its open PRs,
|
|
212
215
|
* never the first one's. It names the first open PR in stack order with the worst state ("#1058+125"), else the first
|
|
@@ -262,6 +265,11 @@ export function railKeeps(s: Pick<Workstream, "badges" | "pr">): number {
|
|
|
262
265
|
*/
|
|
263
266
|
export const LINE_FLOOR = 160;
|
|
264
267
|
export const lineFloor = (text: string): number => Math.min(LINE_FLOOR, Math.ceil(text.length * CHAR_PX));
|
|
268
|
+
/**
|
|
269
|
+
* Below this a squeezed line shows nothing, not a lone separator or "· …": its words wrap onto a hidden second line.
|
|
270
|
+
* About "· " and three characters with the ellipsis at 12 px.
|
|
271
|
+
*/
|
|
272
|
+
export const LINE_SHOWS = 40;
|
|
265
273
|
/** A wide row's title keeps this much (or its own width) when the list is too narrow for everything else. */
|
|
266
274
|
export const TITLE_KEEPS = 80;
|
|
267
275
|
export const titleFloor = (title: string): number => Math.min(TITLE_KEEPS, Math.ceil(title.length * 7));
|
package/shared/inbox.ts
CHANGED
|
@@ -698,9 +698,13 @@ export function nextAfter(rows: InboxRow[], currentAgentId: string | null, now:
|
|
|
698
698
|
return sectionRows(rows, "needs", now).find(r => r.agentId !== currentAgentId && flagFate(r, now, !!r.workspaceId && archived.has(r.workspaceId)) === "show") ?? null;
|
|
699
699
|
}
|
|
700
700
|
|
|
701
|
-
/**
|
|
701
|
+
/**
|
|
702
|
+
* Title for a row: "Workspace › Agent" only when the workspace has more than one root agent, and only when the agent's
|
|
703
|
+
* name says something the workspace's doesn't ("Retry failed card payments › Retry failed card payments" said it twice).
|
|
704
|
+
*/
|
|
702
705
|
export function rowTitle(row: Pick<InboxRow, "title" | "workspaceTitle" | "multiRoot">): { primary: string; agent: string | null } {
|
|
703
|
-
|
|
706
|
+
const same = (a: string, b: string) => a.trim().toLowerCase() === b.trim().toLowerCase();
|
|
707
|
+
if (row.multiRoot && row.workspaceTitle) return { primary: row.workspaceTitle, agent: same(row.title, row.workspaceTitle) ? null : row.title };
|
|
704
708
|
return { primary: row.workspaceTitle || row.title, agent: null };
|
|
705
709
|
}
|
|
706
710
|
|
package/shared/row-chips.ts
CHANGED
|
@@ -82,13 +82,18 @@ export function rowChips(i: Input): RowChips | null {
|
|
|
82
82
|
*/
|
|
83
83
|
export type FitOpts = { charPx: number; chrome: number; recChrome: number; gap: number; maxLabel: number; floorChars: number; readPx: number; readMorePx: number; /** Lines the chips may wrap onto when every option then fits whole (2 on every surface). */ lines?: number };
|
|
84
84
|
type Pick = Extract<RowChip, { kind: "pick" }>;
|
|
85
|
+
/**
|
|
86
|
+
* A label's width at the average glyph (charPx), plus what wide glyphs ("%", "@", "M", "W", about 0.9 em) add: the
|
|
87
|
+
* average alone suits long labels, but a short one with a "%" ran past it ("4%" drew as "4..").
|
|
88
|
+
*/
|
|
89
|
+
export const labelPx = (label: string, charPx: number): number => (label.length + 0.6 * (label.match(/[%@MW]/g)?.length ?? 0)) * charPx;
|
|
85
90
|
/** Each chip with its max width; brk marks the first chip of a wrapped second line. */
|
|
86
91
|
export function fitChips(chips: readonly RowChip[], width: number, o: FitOpts): { chip: RowChip; max: number | null; brk?: boolean }[] {
|
|
87
92
|
const picks = chips.filter((c): c is Pick => c.kind === "pick");
|
|
88
93
|
const hasRead = chips.some(c => c.kind === "read");
|
|
89
94
|
if (!picks.length) return chips.map(chip => ({ chip, max: null }));
|
|
90
95
|
const chromeOf = (p: Pick) => p.recommended ? o.recChrome : o.chrome;
|
|
91
|
-
const natural = (p: Pick) => chromeOf(p) + Math.min(o.maxLabel, p.label
|
|
96
|
+
const natural = (p: Pick) => chromeOf(p) + Math.min(o.maxLabel, labelPx(p.label, o.charPx));
|
|
92
97
|
const floor = (p: Pick) => Math.min(natural(p), chromeOf(p) + o.floorChars * o.charPx);
|
|
93
98
|
const rec = picks.find(p => p.recommended) ?? null;
|
|
94
99
|
const rest = picks.filter(p => p !== rec);
|
|
@@ -97,7 +102,7 @@ export function fitChips(chips: readonly RowChip[], width: number, o: FitOpts):
|
|
|
97
102
|
// whole, so a phone or sidebar row with two short options offers both instead of the recommended one alone.
|
|
98
103
|
if ((o.lines ?? 1) > 1) {
|
|
99
104
|
// Whole labels here, past the one-line cap: wrapping is only worth a second line when nothing on it is cut.
|
|
100
|
-
const whole = (p: Pick) => chromeOf(p) + p.label
|
|
105
|
+
const whole = (p: Pick) => chromeOf(p) + labelPx(p.label, o.charPx);
|
|
101
106
|
if (picks.every(p => whole(p) <= width)) {
|
|
102
107
|
const items = [...picks.map(p => ({ chip: p as RowChip, w: whole(p) })), ...(hasRead ? [{ chip: { kind: "read", hidden: 0 } as RowChip, w: o.readPx }] : [])];
|
|
103
108
|
const brk: boolean[] = []; let lines = 1, x = 0;
|
|
@@ -132,7 +137,7 @@ export function fitChips(chips: readonly RowChip[], width: number, o: FitOpts):
|
|
|
132
137
|
for (const p of [...(rec && shown.includes(rec) ? [rec] : []), ...shown.filter(p => p !== rec)]) {
|
|
133
138
|
const add = Math.max(0, Math.min(natural(p) - max.get(p)!, spare)); max.set(p, max.get(p)! + add); spare -= add;
|
|
134
139
|
}
|
|
135
|
-
const out: { chip: RowChip; max: number | null }[] = shown.map(p => ({ chip: p, max: Math.
|
|
140
|
+
const out: { chip: RowChip; max: number | null }[] = shown.map(p => ({ chip: p, max: Math.ceil(max.get(p)!) }));
|
|
136
141
|
if (hasRead) out.push({ chip: { kind: "read", hidden: picks.length - shown.length }, max: null });
|
|
137
142
|
return out;
|
|
138
143
|
}
|