create-pmos 0.358.0 → 0.360.0
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 +25 -25
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-work-test.js +15 -11
- package/workspace/changelog.json +24 -0
- package/workspace/guide/briefing-premium.md +3 -3
- package/workspace/lib/agent-inbox.js +30 -7
- package/workspace/lib/my-work-premium.js +4 -5
- package/workspace/lib/routes-inbox.js +5 -1
- package/workspace/lib/routes-my-work-premium.js +1 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/premium-shell.js +23 -7
- package/workspace/public/pm/premium-work.js +11 -21
- package/workspace/public/pm/premium.css +15 -9
- package/workspace/public/premium-work.html +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.360.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -32,6 +32,30 @@
|
|
|
32
32
|
"audit"
|
|
33
33
|
],
|
|
34
34
|
"pmosChanges": [
|
|
35
|
+
{
|
|
36
|
+
"v": "0.360.0",
|
|
37
|
+
"at": "2026-10-20T13:51:06.028Z",
|
|
38
|
+
"f": 2,
|
|
39
|
+
"prs": [
|
|
40
|
+
{
|
|
41
|
+
"n": 959,
|
|
42
|
+
"t": "The Work queue has no Agents tab; agent state is a chip on the row and drafts wait in the bell",
|
|
43
|
+
"s": "There is no Agents tab."
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"v": "0.359.0",
|
|
49
|
+
"at": "2026-10-20T13:30:13.743Z",
|
|
50
|
+
"f": 2,
|
|
51
|
+
"prs": [
|
|
52
|
+
{
|
|
53
|
+
"n": 958,
|
|
54
|
+
"t": "The phone rail returns to the bottom after the keyboard closes",
|
|
55
|
+
"s": "When a field loses focus or the keyboard closes, the bar goes back to the bottom of the screen and the dock back to the top."
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
35
59
|
{
|
|
36
60
|
"v": "0.358.0",
|
|
37
61
|
"at": "2026-10-20T11:00:48.565Z",
|
|
@@ -267,30 +291,6 @@
|
|
|
267
291
|
"s": "Claude's turns render as markdown, the way Claude Code shows them."
|
|
268
292
|
}
|
|
269
293
|
]
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
"v": "0.340.0",
|
|
273
|
-
"at": "2026-10-20T03:15:05.728Z",
|
|
274
|
-
"f": 2,
|
|
275
|
-
"prs": [
|
|
276
|
-
{
|
|
277
|
-
"n": 935,
|
|
278
|
-
"t": "A Briefing row when a /goal ends or needs the PM",
|
|
279
|
-
"s": "Each such goal adds one row to the Briefing list, built in the existing row pattern."
|
|
280
|
-
}
|
|
281
|
-
]
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
"v": "0.339.0",
|
|
285
|
-
"at": "2026-10-20T03:01:53.405Z",
|
|
286
|
-
"f": 2,
|
|
287
|
-
"prs": [
|
|
288
|
-
{
|
|
289
|
-
"n": 934,
|
|
290
|
-
"t": "A started /goal keeps working until it is done",
|
|
291
|
-
"s": "Every chat panel session starts with a Claude Code Stop hook."
|
|
292
|
-
}
|
|
293
|
-
]
|
|
294
294
|
}
|
|
295
295
|
]
|
|
296
296
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Eval calibration log"
|
|
4
4
|
description: "Append-only record of every PM override of an evaluator verdict."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-20T13:51:03Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Health budgets"
|
|
4
4
|
description: "Closed registry of health-budget anchors (D59), edited only by the PM."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-20T13:51:03Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Discoveries and friction log"
|
|
4
4
|
description: "Append-only record of what runs discovered and where the process rubbed."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-20T13:51:03Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -94,7 +94,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
94
94
|
const qtab = (k) => p.click(`#qTabs [data-tab="${k}"]`);
|
|
95
95
|
const q = await p.evaluate(() => ({ tabs: [...document.querySelectorAll('#qTabs .qtb')].map((b) => b.textContent), sel: [...document.querySelectorAll('#qTabs [aria-selected="true"]')].map((b) => b.dataset.tab), tops: new Set([...document.querySelectorAll('#qTabs .qtb')].map((b) => Math.round(b.getBoundingClientRect().top))).size, cap: document.querySelector('#qCap').textContent, first: [...document.querySelectorAll('.tgf')].map((x) => x.closest('.wrow').dataset.key), titles: [...document.querySelectorAll('#qBody .wtit')].map((x) => x.textContent.replace('Do this first', '')), chips: [...document.querySelectorAll('#qBody .due')].map((x) => x.textContent), od: [...document.querySelectorAll('#qBody .due.od')].length, ck: [...document.querySelectorAll('#qBody .wck')].map((b) => Math.round(b.getBoundingClientRect().height)), cols: getComputedStyle(document.querySelector('#qBody')).gridTemplateColumns.split(' ').length, old: ['#plate', '#agCard', '#trayCard'].filter((x) => document.querySelector(x)), title: document.querySelector('#hQueue').textContent }));
|
|
96
96
|
ok('M4 one Work queue card replaces On your plate, With agents and the tray', q.title === 'Work queue' && q.old.length === 0, JSON.stringify(q));
|
|
97
|
-
ok('M4
|
|
97
|
+
ok('M4 six tabs in one pill row with their counts (no Agents tab), and the card opens on Today', q.tabs.join() === 'Today3,Inbox4,Upcoming2,Someday1,Kept0,Done0' && q.sel.join() === 'today' && q.tops === 1, JSON.stringify(q));
|
|
98
98
|
ok('M4 Today holds its rows in two columns, with a due chip only where a date was set; the overdue one says so', q.cols === 2 && q.titles.length === 3 && q.titles[0] === 'Sign off the fit-out contractor shortlist' && q.chips.join() === 'Overdue · 15 Oct,Today' && q.od === 1, JSON.stringify(q));
|
|
99
99
|
ok('M4 "Do this first" tags the overdue item only, and a check circle is 44 px', q.first.length === 1 && q.first[0] === 'work:wbs:alpha:4.2' && q.ck.length === 3 && q.ck.every((h) => h >= 44), JSON.stringify([q.first, q.ck]));
|
|
100
100
|
const dec = await p.evaluate(() => { const b = document.querySelector('#qBody .wrow[data-key="work:wbs:alpha:4.2"] .wck'); const r = b.closest('.wrow'); return { dec: b.classList.contains('dec'), eye: !!b.querySelector('circle'), label: b.getAttribute('aria-label'), first: r.classList.contains('first'), tagBlock: getComputedStyle(r.querySelector('.tgf')).display, bar: getComputedStyle(r).boxShadow !== 'none', others: [...document.querySelectorAll('#qBody .wck')].filter((x) => x !== b).every((x) => !x.classList.contains('dec')) }; });
|
|
@@ -103,19 +103,15 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
103
103
|
const ib = await p.evaluate(() => ({ labels: [...document.querySelectorAll('#qBody .wsec .label')].map((x) => x.textContent), counts: [...document.querySelectorAll('#qBody .wsec em')].map((x) => x.textContent), glyphs: [...document.querySelectorAll('#qBody .inb .wgl')].map((x) => x.title), titles: [...document.querySelectorAll('#qBody .wtit')].map((x) => x.textContent), checks: document.querySelectorAll('#qBody .wck').length, note: document.querySelector('#qNote').textContent, focus: document.activeElement && document.activeElement.dataset.tab }));
|
|
104
104
|
ok('M4 Inbox holds what is new from Jira and Slack, then what you added, each with its source; nothing there has a check', ib.labels.join() === 'New from Jira and Slack,Added by you' && /^3 · counts to clear/.test(ib.counts[0]) && /^1 · not counted/.test(ib.counts[1]) && ib.glyphs.join() === 'Jira,Jira,Slack,Yours' && ib.titles[3] === 'Is the payment-step experiment worth another week?' && ib.checks === 0 && /counts to clear only once you place it/.test(ib.note) && ib.focus === 'inbox', JSON.stringify(ib));
|
|
105
105
|
await p.focus('#qTabs [data-tab="inbox"]'); await p.keyboard.press('ArrowRight');
|
|
106
|
-
ok('M4 the arrow keys move between tabs', await p.evaluate(() => document.activeElement.dataset.tab === '
|
|
106
|
+
ok('M4 the arrow keys move between tabs', await p.evaluate(() => document.activeElement.dataset.tab === 'upcoming' && document.querySelector('#qTabs [aria-selected="true"]').dataset.tab === 'upcoming'));
|
|
107
107
|
ok('M4 the add box has no Enter label', !(await p.evaluate(() => !!document.querySelector('#cap kbd'))));
|
|
108
108
|
ok('M4 no suggestion, no estimate and no demo label is drawn', !(await p.evaluate(() => /Accept all|~\d+ min|demo|fold the laundry|on the shelf|composts/i.test(document.querySelector('#queue').textContent))));
|
|
109
109
|
|
|
110
|
-
/* M5
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const tf = await tile('failed'), tr = await tile('ready'), tc = await tile('ready');
|
|
116
|
-
ok('M5 a count filters the list to that state, a second press shows every item again, and focus stays on the tile', tf.pressed.join() === 'failed' && tf.rows.length === 1 && /the run failed/.test(tf.rows[0]) && tr.pressed.join() === 'ready' && tr.rows.length === 1 && /draft ready to review/.test(tr.rows[0]) && tc.pressed.length === 0 && tc.rows.length === 3 && tc.focus === 'ready', JSON.stringify({ tf, tr, tc }));
|
|
117
|
-
await qtab('upcoming');
|
|
118
|
-
ok('M5 the counts show only on the Agents tab', await p.evaluate(() => document.querySelector('#qPipe').hidden && document.querySelectorAll('#qBody .wrow').length === 2));
|
|
110
|
+
/* M5 no Agents tab: the agent's state is a chip on the row, in the tab where the item waits (PM, 2026-10-20) */
|
|
111
|
+
const chips = () => p.evaluate(() => [...document.querySelectorAll('#qBody .wrow')].map((r) => [r.dataset.key, (r.querySelector('.wag') || {}).textContent || ''].join('=')).filter((x) => !/=$/.test(x)));
|
|
112
|
+
const upc = await chips();
|
|
113
|
+
await qtab('today'); const tdc = await chips();
|
|
114
|
+
ok('M5 a failed run shows "Agent stopped" on its Upcoming row; Today shows "Draft ready" and "Agent working"; there are no counts tiles', upc.join() === 'work:item-ccccccccccc2=Agent stopped' && tdc.sort().join() === 'work:item-bbbbbbbbbbb3=Agent working,work:wbs:alpha:4.2=Draft ready' && !(await p.evaluate(() => !!document.querySelector('#qPipe'))), JSON.stringify({ upc, tdc }));
|
|
119
115
|
await qtab('today');
|
|
120
116
|
|
|
121
117
|
/* M6 */
|
|
@@ -245,6 +241,14 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
245
241
|
await q.keyboard.press('Escape'); await sleep(300);
|
|
246
242
|
const pg = await q.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('.wck, .capb, .wrh, #revBtn, .fchip, .qtb')].filter((b) => !b.closest('[hidden]') && b.getBoundingClientRect().height < 44 && b.getBoundingClientRect().height > 0).map((b) => b.className + ':' + Math.round(b.getBoundingClientRect().height)) }));
|
|
247
243
|
ok(`M12 at 390 px (${theme}) the page has no sideways scroll and every control is 44 px`, !pg.over && pg.small.length === 0, JSON.stringify(pg));
|
|
244
|
+
const tb = await q.evaluate(() => ({ rows: new Set([...document.querySelectorAll('#qTabs .qtb')].map((b) => Math.round(b.getBoundingClientRect().top))).size, scrolls: getComputedStyle(document.querySelector('#qTabs')).overflowX }));
|
|
245
|
+
ok(`M12 at 390 px (${theme}) the Work queue tabs are one row that scrolls sideways, never two`, tb.rows === 1 && tb.scrolls === 'auto', JSON.stringify(tb));
|
|
246
|
+
/* the rail after the keyboard (Wawan's phone, 2026-10-20): leaving a field nudges the scroll by a pixel and back, so iOS places the fixed rail at the bottom again */
|
|
247
|
+
await q.evaluate(() => { const y = document.querySelector('#qBody').getBoundingClientRect().top + scrollY - 250; scrollTo(0, y); window.__ys = []; addEventListener('scroll', () => window.__ys.push(scrollY)); });
|
|
248
|
+
await sleep(200); const y0 = await q.evaluate(() => scrollY);
|
|
249
|
+
await q.evaluate(() => { const i = document.querySelector('#capIn'); i.focus({ preventScroll: true }); i.blur(); }); await sleep(600);
|
|
250
|
+
const kb = await q.evaluate(() => { const r = document.querySelector('.rail').getBoundingClientRect(); return { ys: window.__ys, y: scrollY, bottom: Math.round(innerHeight - r.bottom) }; });
|
|
251
|
+
ok(`M12 at 390 px (${theme}) leaving a field settles the fixed layer: a one-pixel scroll and back, and the rail stays 12 px off the bottom`, kb.ys.length >= 2 && kb.y === y0 && kb.bottom === 12, JSON.stringify({ y0, ...kb }));
|
|
248
252
|
await R.ctx.close();
|
|
249
253
|
}
|
|
250
254
|
{
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.360.0",
|
|
4
|
+
"at": "2026-10-20T13:51:06.028Z",
|
|
5
|
+
"f": 2,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 959,
|
|
9
|
+
"t": "The Work queue has no Agents tab; agent state is a chip on the row and drafts wait in the bell",
|
|
10
|
+
"s": "There is no Agents tab."
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"v": "0.359.0",
|
|
16
|
+
"at": "2026-10-20T13:30:13.743Z",
|
|
17
|
+
"f": 2,
|
|
18
|
+
"prs": [
|
|
19
|
+
{
|
|
20
|
+
"n": 958,
|
|
21
|
+
"t": "The phone rail returns to the bottom after the keyboard closes",
|
|
22
|
+
"s": "When a field loses focus or the keyboard closes, the bar goes back to the bottom of the screen and the dock back to the top."
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
2
26
|
{
|
|
3
27
|
"v": "0.358.0",
|
|
4
28
|
"at": "2026-10-20T11:00:48.565Z",
|
|
@@ -11,7 +11,7 @@ The premium Briefing is a page of its own at `/premium.html`. The console at `/`
|
|
|
11
11
|
|
|
12
12
|
Every premium page uses the console's type: Space Grotesk for text, IBM Plex Mono for times and labels, and the same sizes and weights as the console. A premium page and the console at the same place read at the same size.
|
|
13
13
|
|
|
14
|
-
A rail on the left names four places: Briefing, My work, Board and Insights. Each is a premium page.
|
|
14
|
+
A rail on the left names four places: Briefing, My work, Board and Insights. Each is a premium page. On a phone the rail is a bar at the bottom of the screen. It stays at the bottom after you type in a field and the keyboard closes.
|
|
15
15
|
|
|
16
16
|
Every premium page has the same top bar. On the left is where you are, then a round **Chat** button. On the right are the **Sources** chip, the bell and one **⋯** menu.
|
|
17
17
|
|
|
@@ -267,7 +267,7 @@ My work is the second place on the rail, at `/premium-work.html`. It reads the l
|
|
|
267
267
|
|
|
268
268
|
**Decide.** An inbox row shows a **Decide** button that opens the item, where you give it a day, put it in Someday or drop it.
|
|
269
269
|
|
|
270
|
-
**Work queue.** One full-width card holds everything you sort, as tabs in one row: **Today**, **Inbox**, **
|
|
270
|
+
**Work queue.** One full-width card holds everything you sort, as tabs in one row: **Today**, **Inbox**, **Upcoming**, **Someday**, **Kept** and **Done**. Each tab shows its count, and the card opens on Today (or on the first tab that has something). On a phone the tabs stay in one row: swipe the row sideways to see the rest. Rows sit in two columns, one column on a narrow screen. The left and right arrow keys move between tabs. **Inbox** shows what is new from Jira and Slack first, then what you added. **Kept** gathers items you pressed Keep on, and **Done** shows what you added and marked done in the last 7 days. An item shows in one place tab only. Kept is a mark on an item, not a place, so a kept item also shows where it was placed. The card replaces the earlier On your plate, With agents and tray cards.
|
|
271
271
|
|
|
272
272
|
**The item dialog.** The dialog shows one labelled field for each choice. Each field shows its value from the record and opens when you press it: **When** (Today, Later today, Tomorrow, Next week, Not before a date, Someday), **Waiting on**, **Who does it** (the steps) and **Priority · Due** (the edit panel). One bar at the bottom holds **Done**, with **Keep it** and **Drop it** beside it. Every action stays reachable.
|
|
273
273
|
|
|
@@ -280,7 +280,7 @@ My work is the second place on the rail, at `/premium-work.html`. It reads the l
|
|
|
280
280
|
- **Add** takes one line, read by the Work page's own parser (`Reply to Rina about SSO by Friday !p1`). A new item with no date waits in the **Inbox** tab, under Added by you. The card opens on that tab and the item's dialog opens at once, so you can place it. An item with a date goes where its date says.
|
|
281
281
|
- **What you added** and have not placed is not counted to clear until you place it (Do today, Later, Not yet, Waiting, Done or Drop).
|
|
282
282
|
- **The Work queue's place tabs** are Today, Inbox, Upcoming and Someday. A row shows where it came from (Yours, Jira, Slack, Board) and a due chip only when a date was set. The round check marks it done, with Undo for a few seconds. "Do this first" appears only on an overdue item.
|
|
283
|
-
- **
|
|
283
|
+
- **Agent state on a row.** There is no Agents tab. An item that an agent works on stays in the tab where it waits, and a chip on its row shows the agent's state: **Draft ready**, **Agent working** or **Agent stopped**. A draft that is ready and a run that stopped also wait in the bell (top right), so you see them even when the item is in Someday. A press in the bell opens that item on My work. A draft is labelled "Agent draft, not checked" and is never counted as done. The agent itself is started, stopped, edited, sent back or approved in the item's dialog (see below).
|
|
284
284
|
- **Waiting on others** lists who you wait for and for how long. There is no nudge.
|
|
285
285
|
- **An item's dialog** offers Done, Drop (with Undo), and Keep for an item untouched for seven days, in the bar at the bottom. Its fields hold the rest, each through the Work page's own route:
|
|
286
286
|
- **When** shows where the item is (Today, Inbox, Upcoming, Waiting, Someday, or Not before a day). It offers Today, Not yet (later today, tomorrow, next week), Not before a date and Someday.
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/* agent-inbox.js — the bell's inbox of agent results that wait on the PM (initiative premium-agent-inbox).
|
|
3
3
|
*
|
|
4
|
-
* build({ proposals, goals, seen, now }) → { count, newCount, items, bundles, seenAt } PURE
|
|
4
|
+
* build({ proposals, goals, work, seen, now }) → { count, newCount, items, bundles, seenAt } PURE
|
|
5
|
+
* workOf(v) → the My work items whose agent has a draft ready or stopped, from GET /api/pm-items' answer
|
|
5
6
|
* readProposals(available) → [{ p, ws, product, targetTitle }] the open proposals the Agent proposals dialog shows
|
|
6
7
|
* readSeen(runtimeDir) · appendSeen(runtimeDir, { ids } | { all: true }, now)
|
|
7
8
|
* split(model, goals) → the Briefing model with its agent and goal rows moved to model.agent (N6)
|
|
8
9
|
*
|
|
9
|
-
* An item is one open Driver proposal (a board in Approve mode only, as the dialog reads it)
|
|
10
|
+
* An item is one open Driver proposal (a board in Approve mode only, as the dialog reads it), one goal row of goal-chat, or one My work item
|
|
11
|
+
* whose agent has a draft ready or stopped (PM, 2026-10-20: the Work queue has no Agents tab, so these wait here). Every word
|
|
10
12
|
* comes from the record. NEW is filed after the PM's last "Mark all seen" and not opened since; seen is not done: an item goes only
|
|
11
13
|
* when its record changes. The only write is the seen line, <runtime>/inbox-seen.jsonl. Nothing here decides or sends anything. */
|
|
12
14
|
const fs = require('fs');
|
|
@@ -17,6 +19,7 @@ const MAX_NEW = 30;
|
|
|
17
19
|
const clip = (s, n) => { s = String(s == null ? '' : s).replace(/\s+/g, ' ').trim(); return s.length > n ? s.slice(0, n - 1).trimEnd() + '…' : s; };
|
|
18
20
|
const plural = (n, one, many) => `${n} ${n === 1 ? one : many}`;
|
|
19
21
|
const WHAT = { problem: 'Problem statement', evidence: 'Evidence', sizing: 'Opportunity sizing', assumption: 'Riskiest assumption', stakeholders: 'Stakeholders', move: 'Move', note: 'Note', 'next-step': 'Next step', 'follow-up': 'Follow-up', doc: 'Document draft' };
|
|
22
|
+
const WORK_KIND = { ready: 'work-draft', failed: 'work-stopped' };
|
|
20
23
|
const GOAL_KIND = { waiting: 'goal-waiting', done: 'goal-done', stopped: 'goal-stopped' };
|
|
21
24
|
|
|
22
25
|
/** The key of a target's drafts row on the Briefing (lib/briefing-premium-drafts.js keyOf of the driver-needs run id): its conversation is the proposal's session. */
|
|
@@ -31,8 +34,24 @@ function proposalTitle(p) {
|
|
|
31
34
|
return clip(text ? word + ': ' + text : word, 160);
|
|
32
35
|
}
|
|
33
36
|
|
|
34
|
-
/**
|
|
35
|
-
|
|
37
|
+
/** The My work items whose agent has a draft ready or stopped, from GET /api/pm-items' answer (v.work's lists and the PM's own items). Pure.
|
|
38
|
+
* The id carries the state and the round, so a new round is new again. at is the agent's last log line, else when it started. */
|
|
39
|
+
function workOf(v) {
|
|
40
|
+
const w = (v && v.work) || {}, seen = new Set(), out = [];
|
|
41
|
+
for (const k of ['inbox', 'today', 'upcoming', 'waiting', 'someday']) for (const it of w[k] || []) {
|
|
42
|
+
const a = it && it.agent, kind = a && WORK_KIND[a.state];
|
|
43
|
+
if (!kind || !it.id || seen.has(it.id)) continue;
|
|
44
|
+
seen.add(it.id);
|
|
45
|
+
const log = Array.isArray(a.log) ? a.log : [], last = log[log.length - 1], at = Date.parse((last && last.at) || a.started_at || '');
|
|
46
|
+
const rounds = log.filter((t) => t && t.body).length;
|
|
47
|
+
out.push({ id: it.id, title: it.title || '', state: a.state, list: k, round: rounds, at: Number.isFinite(at) ? at : null, asks: !!a.asks });
|
|
48
|
+
}
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
const PLACE_WORD = { inbox: 'Inbox', today: 'Today', upcoming: 'Upcoming', waiting: 'Waiting', someday: 'Someday' };
|
|
52
|
+
|
|
53
|
+
/** Pure. proposals: [{ p, ws, product, targetTitle }]; goals: goal-chat goalRowsAt rows; work: workOf(); seen: readSeen(). */
|
|
54
|
+
function build({ proposals = [], goals = [], work = [], seen = { all: 0, ids: new Set() }, now = Date.now() } = {}) {
|
|
36
55
|
const items = [];
|
|
37
56
|
for (const x of proposals) {
|
|
38
57
|
const p = x.p, at = Date.parse(p.at || '');
|
|
@@ -48,6 +67,10 @@ function build({ proposals = [], goals = [], seen = { all: 0, ids: new Set() },
|
|
|
48
67
|
if (!g || !g.chatKey) continue;
|
|
49
68
|
items.push({ id: g.key, kind: GOAL_KIND[g.goalState] || 'goal-done', title: clip(g.title + ': ' + (g.subject || ''), 160), at: Number.isFinite(g.at) ? g.at : null, ws: '', product: 'Chat', target: null, open: 'row:' + g.key, pws: '', session: g.key });
|
|
50
69
|
}
|
|
70
|
+
for (const w of work) {
|
|
71
|
+
if (!w || !w.id || !WORK_KIND[w.state]) continue;
|
|
72
|
+
items.push({ id: 'work:' + w.id + ':' + w.state + ':' + (w.round || 0), kind: WORK_KIND[w.state], title: clip(w.title, 160), at: w.at, ws: '', product: 'My work · ' + (PLACE_WORD[w.list] || 'Inbox'), target: null, open: 'item:' + w.id, pws: '', session: '' });
|
|
73
|
+
}
|
|
51
74
|
for (const it of items) it.isNew = (it.at == null || it.at > seen.all) && !seen.ids.has(it.id);
|
|
52
75
|
const fresh = items.filter((i) => i.isNew).sort((a, b) => (b.at || now) - (a.at || now));
|
|
53
76
|
const rest = items.filter((i) => !i.isNew);
|
|
@@ -60,7 +83,7 @@ function build({ proposals = [], goals = [], seen = { all: 0, ids: new Set() },
|
|
|
60
83
|
}
|
|
61
84
|
const bundles = [...by.values()].sort((a, b) => (a.oldest || now) - (b.oldest || now)).map((b) => ({
|
|
62
85
|
key: b.key, title: b.title, product: b.product, count: b.n, oldest: b.oldest, open: b.open, pws: b.pws,
|
|
63
|
-
sub: b.kind === 'target' ? plural(b.n, 'proposal', 'proposals') : b.kind === 'goal-waiting' ? 'Goal waits on you' : 'Goal to check',
|
|
86
|
+
sub: b.kind === 'target' ? plural(b.n, 'proposal', 'proposals') : b.kind === 'work-draft' ? 'Agent draft to review' : b.kind === 'work-stopped' ? 'Agent stopped' : b.kind === 'goal-waiting' ? 'Goal waits on you' : 'Goal to check',
|
|
64
87
|
}));
|
|
65
88
|
const ages = items.map((i) => i.at).filter((v) => v != null);
|
|
66
89
|
return { count: items.length, newCount: fresh.length, items: fresh.slice(0, MAX_NEW), more: Math.max(0, fresh.length - MAX_NEW), bundles, oldest: ages.length ? Math.min(...ages) : null, seenAt: seen.all || null };
|
|
@@ -99,7 +122,7 @@ function readSeen(runtimeDir) {
|
|
|
99
122
|
}
|
|
100
123
|
return seen;
|
|
101
124
|
}
|
|
102
|
-
const ID_RE = /^(prop:[^\s]{1,200}|goal:[^\s]{1,200})$/;
|
|
125
|
+
const ID_RE = /^(prop:[^\s]{1,200}|goal:[^\s]{1,200}|work:[^\s]{1,200})$/;
|
|
103
126
|
/** The check of a body: null when it is good, else the reason. Pure. */
|
|
104
127
|
function badSeen(b) {
|
|
105
128
|
if (!b || typeof b !== 'object') return 'a body is required';
|
|
@@ -132,4 +155,4 @@ function split(model, goals = []) {
|
|
|
132
155
|
};
|
|
133
156
|
}
|
|
134
157
|
|
|
135
|
-
module.exports = { build, readProposals, readSeen, appendSeen, badSeen, split, draftsRowKey, SEEN, MAX_NEW };
|
|
158
|
+
module.exports = { build, workOf, readProposals, readSeen, appendSeen, badSeen, split, draftsRowKey, SEEN, MAX_NEW };
|
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
* The PM's own unsorted captures (an item the PM added, source local, that no date or flag has placed yet) wait in the inbox beside the items
|
|
10
10
|
* from Jira and Slack. They are not counted as work to clear until the PM places it. The shelf, the capacity figure and the week bars of the mockup
|
|
11
11
|
* have no record behind them and are not built (PRD D15, amended by the PM 2026-10-17 to add the captures).
|
|
12
|
-
* The Work queue (PM, 2026-10-19): one card holds what On your plate
|
|
13
|
-
* Kept, which is a mark on an item and not a place.
|
|
12
|
+
* The Work queue (PM, 2026-10-19): one card holds what On your plate and the tray held, as tabs. No item shows in two tabs except
|
|
13
|
+
* Kept, which is a mark on an item and not a place. There is no Agents tab (PM, 2026-10-20): an item an agent works on stays in the tab where it
|
|
14
|
+
* waits, and its row carries the agent's state (r.agent); a draft ready or a run stopped also waits in the bell (lib/agent-inbox.js).
|
|
14
15
|
* An agent draft is the agent's text: it is shown labelled and is never counted as done. */
|
|
15
16
|
|
|
16
17
|
const WORDS = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve'];
|
|
@@ -203,7 +204,7 @@ function build({ v, now }) {
|
|
|
203
204
|
const queue = queueOf();
|
|
204
205
|
const rowsAll = [...new Set([].concat(...sections.map((s) => s.rows), waitingRows, agentRows, ...Object.values(agentBy).map((g) => g.rows), trayRows, ...queue.tabs.map((t) => [].concat(...t.groups.map((g) => g.rows)))))]; // the queue's tabs reuse the section rows
|
|
205
206
|
/* The Work queue: one card, one tab for each place a thing waits, from the item records alone. Today, Inbox (new from Jira and Slack, then what
|
|
206
|
-
* the PM added),
|
|
207
|
+
* the PM added), Upcoming, Someday, Kept (a Keep press was recorded) and Done (done in the last
|
|
207
208
|
* 7 days). Answers and ideas an agent files on its own have no record, so no tab holds them. */
|
|
208
209
|
function queueOf() {
|
|
209
210
|
const loc = (v.items || all.map((x) => x.it)).filter(isLocal);
|
|
@@ -214,13 +215,11 @@ function build({ v, now }) {
|
|
|
214
215
|
const kept = loc.filter((it) => !it.done && it.kept_at), done = loc.filter((it) => it.done && String(it.done_at || '').slice(0, 10) >= week);
|
|
215
216
|
const placeOf = (it) => (it.done ? 'done' : (all.find((x) => x.it.id === it.id) || { list: 'tray' }).list);
|
|
216
217
|
const recRows = (items) => items.slice(0, MAX_PER).map((it) => rowOf(it, placeOf(it), v, reviewIds.has(it.id), focusIds));
|
|
217
|
-
const agN = ready.length + running.length + failed.filter((x) => !ready.includes(x)).length;
|
|
218
218
|
const inbox = sec('inbox');
|
|
219
219
|
const tabs = [
|
|
220
220
|
listTab('today', 'Today', 'What you placed for today. "Do this first" marks an overdue item only.'),
|
|
221
221
|
{ key: 'inbox', label: 'Inbox', n: inbox.n + tray.length, groups: [grp('new', 'New from Jira and Slack', inbox.n, inbox.rows, inbox.more, 'counts to clear'), grp('mine', 'Added by you', tray.length, trayRows, Math.max(0, tray.length - MAX_PER), 'not counted until you place it')],
|
|
222
222
|
note: 'Everything new or not yet placed. Open one to place it: Today, later, waiting on someone, or drop it. What you added counts to clear only once you place it.' },
|
|
223
|
-
{ key: 'agents', label: 'Agents', n: agN, groups: [grp('agents', '', agN, agentRows, Math.max(0, agN - MAX_PER))], by: agentBy, counts: { running: running.length, failed: failed.length, ready: ready.length }, note: HOLD.agent },
|
|
224
223
|
listTab('upcoming', 'Upcoming', 'Items with a later date.'),
|
|
225
224
|
listTab('someday', 'Someday', 'Items you parked with no date.'),
|
|
226
225
|
{ key: 'kept', label: 'Kept', n: kept.length, groups: [grp('kept', '', kept.length, recRows(kept), Math.max(0, kept.length - MAX_PER))], note: 'Items you pressed Keep on. They stay where they were placed; this tab gathers them.' },
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* GET /api/inbox → { ok, count, newCount, items, more, bundles, oldest, seenAt } lib/agent-inbox.js build()
|
|
5
5
|
* POST /api/inbox/seen { ids } | { all } → { ok } one line in <runtime>/inbox-seen.jsonl, a page press only (pm-guard requirePagePress)
|
|
6
6
|
*
|
|
7
|
-
* The read takes the products the premium Briefing reads (routes-briefing-premium products), their Driver ledgers
|
|
7
|
+
* The read takes the products the premium Briefing reads (routes-briefing-premium products), their Driver ledgers, the goal rows and the
|
|
8
|
+
* My work list (the same answer the My work page reads).
|
|
8
9
|
* Seen is not done: an item goes only when its record changes. Nothing here decides a proposal or sends anything. */
|
|
9
10
|
const guard = require('./pm-guard.js');
|
|
10
11
|
const Inbox = require('./agent-inbox.js');
|
|
@@ -32,8 +33,11 @@ module.exports = {
|
|
|
32
33
|
const { products } = require('./routes-briefing-premium.js');
|
|
33
34
|
let available = [];
|
|
34
35
|
try { available = products(ctx).available; } catch { available = []; }
|
|
36
|
+
let work = [];
|
|
37
|
+
try { work = Inbox.workOf(await require('./routes-my-work-premium.js').listView(req, ctx)); } catch { work = []; } // My work drafts ready or stopped; an unreadable list gives none
|
|
35
38
|
const out = Inbox.build({
|
|
36
39
|
proposals: Inbox.readProposals(available),
|
|
40
|
+
work,
|
|
37
41
|
goals: ctx.runtimeDir ? Goal.goalRowsAt(ctx.runtimeDir) : [],
|
|
38
42
|
seen: ctx.runtimeDir ? Inbox.readSeen(ctx.runtimeDir) : undefined,
|
|
39
43
|
now: Date.now(),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.360.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.360.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -426,6 +426,22 @@ export function onScroll() {
|
|
|
426
426
|
});
|
|
427
427
|
}
|
|
428
428
|
addEventListener('scroll', onScroll, { passive: true }); addEventListener('resize', onScroll);
|
|
429
|
+
/* ── the fixed layer after the phone keyboard (Wawan's phone, 2026-10-20): when the soft keyboard closes, iOS Safari can leave the fixed
|
|
430
|
+
* layer raised by the keyboard's height until the next scroll, so the rail floats over the middle of a card and the dock leaves the top.
|
|
431
|
+
* A one-pixel scroll and back makes WebKit place the layer again; anywhere else it is a no-op. ── */
|
|
432
|
+
const EDITABLE = 'input,textarea,select,[contenteditable="true"],[contenteditable=""]';
|
|
433
|
+
export function settleFixed() {
|
|
434
|
+
const y = scrollY, d = y > 0 ? -1 : 1;
|
|
435
|
+
scrollTo(scrollX, y + d); scrollTo(scrollX, y);
|
|
436
|
+
}
|
|
437
|
+
document.addEventListener('focusout', (e) => {
|
|
438
|
+
if (!(e.target instanceof Element) || !e.target.matches(EDITABLE)) return;
|
|
439
|
+
setTimeout(settleFixed, 60); setTimeout(settleFixed, 400); // the keyboard closes over ~300ms; settle as it starts and once it is gone
|
|
440
|
+
});
|
|
441
|
+
if (window.visualViewport) {
|
|
442
|
+
let kb = false;
|
|
443
|
+
visualViewport.addEventListener('resize', () => { const shut = visualViewport.height >= innerHeight - 1; if (kb && shut) settleFixed(); kb = !shut; });
|
|
444
|
+
}
|
|
429
445
|
|
|
430
446
|
/* ── the rail: Briefing, My work, Board and Insights are premium pages ── */
|
|
431
447
|
const GO = { brief: '/premium.html', work: '/premium-work.html', init: '/premium-board.html', rep: '/premium-insights.html' };
|
|
@@ -615,13 +631,13 @@ export function pvFeed(r) {
|
|
|
615
631
|
if (pvOv.kind === 'bell') pvBellDraw();
|
|
616
632
|
}
|
|
617
633
|
/* ── the bell's inbox (initiative premium-agent-inbox): one item per agent result that waits on the PM, a press opens that exact proposal or goal ── */
|
|
618
|
-
const IB_KIND = { proposal: 'Proposal', draft: 'Draft', 'goal-waiting': 'Goal needs you', 'goal-done': 'Goal finished', 'goal-stopped': 'Goal stopped' };
|
|
619
|
-
const IB_ACT = { proposal: 'Review', draft: 'Read', 'goal-waiting': 'Answer', 'goal-done': 'See result', 'goal-stopped': 'See why' };
|
|
620
|
-
const IB_GL = { proposal: IC('M4 20h4L19 9l-4-4L4 16zM14 6l4 4'), draft: GL.doc, 'goal-waiting': IC('M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8'), 'goal-done': IC('M5 12l5 5L20 7'), 'goal-stopped': IC('M6 6h12v12H6z') };
|
|
634
|
+
const IB_KIND = { 'work-draft': 'Draft ready', 'work-stopped': 'Agent stopped', proposal: 'Proposal', draft: 'Draft', 'goal-waiting': 'Goal needs you', 'goal-done': 'Goal finished', 'goal-stopped': 'Goal stopped' };
|
|
635
|
+
const IB_ACT = { 'work-draft': 'Review', 'work-stopped': 'Open', proposal: 'Review', draft: 'Read', 'goal-waiting': 'Answer', 'goal-done': 'See result', 'goal-stopped': 'See why' };
|
|
636
|
+
const IB_GL = { 'work-draft': IC('M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zM12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6'), 'work-stopped': IC('M12 8v5M12 16.5v.5M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18'), proposal: IC('M4 20h4L19 9l-4-4L4 16zM14 6l4 4'), draft: GL.doc, 'goal-waiting': IC('M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8'), 'goal-done': IC('M5 12l5 5L20 7'), 'goal-stopped': IC('M6 6h12v12H6z') };
|
|
621
637
|
const ibAgo = (ms) => { if (ms == null) return ''; const m = Math.round((Date.now() - ms) / 60000); return m < 1 ? 'just now' : m < 60 ? m + ' min ago' : m < 1440 ? Math.round(m / 60) + ' h ago' : Math.round(m / 1440) + (Math.round(m / 1440) === 1 ? ' day ago' : ' days ago'); };
|
|
622
638
|
const ibOld = (ms) => { if (ms == null) return ''; const d = Math.floor((Date.now() - ms) / 86400000); return d < 1 ? 'oldest is from today' : 'oldest is ' + d + (d === 1 ? ' day old' : ' days old'); };
|
|
623
|
-
/** The deep link of an inbox item or bundle: the Briefing opens it (premium.js openParam). */
|
|
624
|
-
export const ibHref = (open, pws) => '/premium.html?' + ['open=' + encodeURIComponent(open), pws ? 'pws=' + encodeURIComponent(pws) : '', PV_WS ? 'ws=' + encodeURIComponent(PV_WS) : ''].filter(Boolean).join('&');
|
|
639
|
+
/** The deep link of an inbox item or bundle: the Briefing opens it (premium.js openParam); a My work item (item:<id>) opens its dialog on My work. */
|
|
640
|
+
export const ibHref = (open, pws) => /^item:/.test(open) ? '/premium-work.html?' + ['item=' + encodeURIComponent(open.slice(5)), PV_WS ? 'ws=' + encodeURIComponent(PV_WS) : ''].filter(Boolean).join('&') : '/premium.html?' + ['open=' + encodeURIComponent(open), pws ? 'pws=' + encodeURIComponent(pws) : '', PV_WS ? 'ws=' + encodeURIComponent(PV_WS) : ''].filter(Boolean).join('&');
|
|
625
641
|
/** The last inbox answer, for the Briefing's count line: { count, newCount, oldest } or null. */
|
|
626
642
|
export const ibState = () => IB.r;
|
|
627
643
|
async function ibRead() {
|
|
@@ -643,12 +659,12 @@ async function ibRead() {
|
|
|
643
659
|
function ibGo(open, pws, id) {
|
|
644
660
|
if (id) { IB.shown = IB.shown.filter((x) => x !== id); pmPost('/api/inbox/seen', { ids: [id] }); }
|
|
645
661
|
pvClose();
|
|
646
|
-
if (!pvOnBriefing()) { location.assign(ibHref(open, pws)); return; }
|
|
662
|
+
if (!pvOnBriefing() || /^item:/.test(open)) { location.assign(ibHref(open, pws)); return; }
|
|
647
663
|
document.dispatchEvent(new CustomEvent('pmos:open', { detail: { open, pws } }));
|
|
648
664
|
}
|
|
649
665
|
function ibHtml() {
|
|
650
666
|
const j = IB.r; if (!j) return '';
|
|
651
|
-
const item = (it) => `<div class="ib-it"><span class="gl">${IB_GL[it.kind] || GL.need}</span><span class="ib-b"><b><span class="ib-k">${esc(IB_KIND[it.kind] || 'Agent')}</span>${esc(it.title)}</b><small>${esc([it.product, it.target ? it.target.title : '', ibAgo(it.at)].filter(Boolean).join(' · '))}</small><span class="ib-acts"><button type="button" class="cta" data-ibo="${esc(it.open)}" data-ibw="${esc(it.pws || '')}" data-ibi="${esc(it.id)}">${esc(IB_ACT[it.kind] || 'Open')}</button>${/^row:/.test(it.open) ? '' : `<button type="button" class="cta alt" data-ibo="row:${esc(it.session)}" data-ibi="${esc(it.id)}">Session</button>`}</span></span></div>`;
|
|
667
|
+
const item = (it) => `<div class="ib-it"><span class="gl">${IB_GL[it.kind] || GL.need}</span><span class="ib-b"><b><span class="ib-k">${esc(IB_KIND[it.kind] || 'Agent')}</span>${esc(it.title)}</b><small>${esc([it.product, it.target ? it.target.title : '', ibAgo(it.at)].filter(Boolean).join(' · '))}</small><span class="ib-acts"><button type="button" class="cta" data-ibo="${esc(it.open)}" data-ibw="${esc(it.pws || '')}" data-ibi="${esc(it.id)}">${esc(IB_ACT[it.kind] || 'Open')}</button>${/^(row|item):/.test(it.open) ? '' : `<button type="button" class="cta alt" data-ibo="row:${esc(it.session)}" data-ibi="${esc(it.id)}">Session</button>`}</span></span></div>`;
|
|
652
668
|
const bun = (x) => `<button type="button" class="pv-row ib-bun" data-ibo="${esc(x.open)}" data-ibw="${esc(x.pws || '')}"><span class="gl">${GL.ini}</span><span><b>${esc(x.title)}</b><small>${esc([x.product, x.sub, ibOld(x.oldest)].filter(Boolean).join(' · '))}</small></span></button>`;
|
|
653
669
|
IB.shown = j.items.map((i) => i.id);
|
|
654
670
|
return (j.items.length ? `<div class="pv-grp">New from the agent · ${j.newCount}</div>` + j.items.map(item).join('') + (j.more ? `<p class="pv-note">${j.more} more new. Mark all seen to fold them by piece of work.</p>` : '') : '')
|
|
@@ -45,25 +45,22 @@ function rowHtml(r, o = {}) {
|
|
|
45
45
|
const sd = sm ? null : sideOf(r);
|
|
46
46
|
const desc = sd ? ` aria-description="${esc((sd.r ? 'Right arrow: ' + sd.r.label + '. ' : '') + (sd.l ? 'Left arrow: ' + sd.l.label + '. ' : '') + 'J and K move between rows.')}"` : '';
|
|
47
47
|
let lead;
|
|
48
|
-
if (sm === '
|
|
49
|
-
else if (sm === 'wait') lead = `<span class="avp" aria-hidden="true">${esc(((r.sub.match(/waiting on (\S)/) || [])[1] || '·'))}</span>`;
|
|
48
|
+
if (sm === 'wait') lead = `<span class="avp" aria-hidden="true">${esc(((r.sub.match(/waiting on (\S)/) || [])[1] || '·'))}</span>`;
|
|
50
49
|
else if (inbox) lead = `<span class="wgl" title="${esc(r.src)}">${ICO(glyph(r.src))}</span>`;
|
|
51
50
|
else if (r.agent === 'ready') lead = `<button class="wck dec" data-open="${esc(r.key)}" aria-label="Review the agent draft: ${esc(r.title)}" title="An agent draft is ready. Open it to review.">${ICO('<path d="M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/>')}</button>`;
|
|
52
51
|
else lead = `<button class="wck" data-ck="${esc(r.id)}" aria-pressed="false" aria-label="Mark done: ${esc(r.title)}">${CHECK}</button>`;
|
|
53
52
|
const meta = r.chip ? `<span class="wm"><span class="due${r.overdue ? ' od' : ''}">${esc(r.chip)}</span></span>` : '';
|
|
54
|
-
const
|
|
53
|
+
const ag = AG_CHIP[r.agent], chip = ag ? `<em class="wag ${ag[0]}"><i></i>${ag[1]}</em>` : '';
|
|
55
54
|
const sug = !sm && r.sug ? `<span class="wsg">${ICO('<path d="M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z"/>')}<span><b>${esc(r.sug.b)}</b> ${esc(r.sug.t)}</span></span>` : '';
|
|
56
|
-
return `<div class="wrw"><div class="wrow${sm ? ' sm' : ''}${inbox ? ' inb' : ''}${o.first ? ' first' : ''}" data-key="${esc(r.key)}">${lead}<button class="wrh" aria-haspopup="dialog"${desc}><span class="wtx"><span class="wtit">${esc(r.title)}${o.first ? '<em class="tgf">Do this first</em>' : ''}${r.focus ? '<em class="xfc">Focus</em>' : ''}</span><span class="ws">${esc(r.sub)}
|
|
55
|
+
return `<div class="wrw"><div class="wrow${sm ? ' sm' : ''}${inbox ? ' inb' : ''}${o.first ? ' first' : ''}" data-key="${esc(r.key)}">${lead}<button class="wrh" aria-haspopup="dialog"${desc}><span class="wtx"><span class="wtit">${esc(r.title)}${o.first ? '<em class="tgf">Do this first</em>' : ''}${r.focus ? '<em class="xfc">Focus</em>' : ''}</span><span class="ws">${chip}${esc(r.sub)}</span>${sug}</span>${meta}</button></div></div>`;
|
|
57
56
|
}
|
|
58
|
-
/* One card, one tab for each place a thing waits. A tab draws its groups in two columns
|
|
57
|
+
/* One card, one tab for each place a thing waits. A tab draws its groups in two columns. An item an agent works on stays in its own tab with a chip (PM, 2026-10-20). */
|
|
59
58
|
let qTab = null;
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
const Q_EMPTY = { today: 'Nothing is placed for today.', inbox: 'Nothing waits to be sorted. Add a line above and it lands here first.', agents: 'No agent is working on your items.', upcoming: 'Nothing has a later date.', someday: 'Nothing is parked.', kept: 'Nothing kept yet.', done: 'Nothing done this week.' };
|
|
63
|
-
let agTile = null;
|
|
59
|
+
const AG_CHIP = { ready: ['ready', 'Draft ready'], queued: ['run', 'Agent working'], working: ['run', 'Agent working'], sending: ['run', 'Agent working'], failed: ['fail', 'Agent stopped'] };
|
|
60
|
+
const Q_EMPTY = { today: 'Nothing is placed for today.', inbox: 'Nothing waits to be sorted. Add a line above and it lands here first.', upcoming: 'Nothing has a later date.', someday: 'Nothing is parked.', kept: 'Nothing kept yet.', done: 'Nothing done this week.' };
|
|
64
61
|
function groupHtml(g, tab) {
|
|
65
|
-
const
|
|
66
|
-
return g.rows.map((r) => rowHtml(r, {
|
|
62
|
+
const first = tab === 'today' ? g.rows.find((r) => r.overdue) || null : null;
|
|
63
|
+
return g.rows.map((r) => rowHtml(r, { first: first && r.key === first.key })).join('') + (g.more ? `<p class="note">${g.more} more ${g.more === 1 ? 'item is' : 'items are'} not shown here.</p>` : '');
|
|
67
64
|
}
|
|
68
65
|
function drawQueue() {
|
|
69
66
|
const Q = M.queue, tabs = Q.tabs;
|
|
@@ -72,16 +69,8 @@ function drawQueue() {
|
|
|
72
69
|
$('#qCap').innerHTML = `<b>${Q.n}</b> to clear` + Q.cap.map((c) => ' · ' + esc(c)).join('');
|
|
73
70
|
$('#qTabs').innerHTML = tabs.map((t) => `<button type="button" role="tab" class="qtb" id="qt-${t.key}" data-tab="${t.key}" aria-selected="${t.key === qTab}" aria-controls="qBody" tabindex="${t.key === qTab ? 0 : -1}">${esc(t.label)}<em>${t.n}</em></button>`).join('');
|
|
74
71
|
$('#qBody').setAttribute('aria-labelledby', 'qt-' + qTab);
|
|
75
|
-
const pipe = $('#qPipe');
|
|
76
|
-
pipe.hidden = qTab !== 'agents';
|
|
77
72
|
let h = '';
|
|
78
|
-
if (qTab === '
|
|
79
|
-
const c = cur.counts;
|
|
80
|
-
if (agTile && !(cur.by && cur.by[agTile])) agTile = null;
|
|
81
|
-
pipe.innerHTML = AG_TILES.map(([k, label]) => `<button type="button" class="pst${agTile === k ? ' hot' : ''}" data-ag="${k}" aria-pressed="${agTile === k}" aria-controls="qBody" title="${agTile === k ? 'Show every item again' : 'Show only the items that are ' + label.toLowerCase()}"><b>${c[k]}</b><span>${label}</span></button>`).join('');
|
|
82
|
-
const g = agTile ? cur.by[agTile] : cur.groups[0];
|
|
83
|
-
h = g.rows.length ? groupHtml(g, 'agents') : `<p class="empty3 plain">${agTile ? AG_EMPTY[agTile] : Q_EMPTY.agents}</p>`;
|
|
84
|
-
} else if (!cur.n) h = `<p class="empty3${qTab === 'inbox' ? '' : ' plain'}">${qTab === 'inbox' ? CHECK : ''}${Q_EMPTY[qTab]}</p>`;
|
|
73
|
+
if (!cur.n) h = `<p class="empty3${qTab === 'inbox' ? '' : ' plain'}">${qTab === 'inbox' ? CHECK : ''}${Q_EMPTY[qTab]}</p>`;
|
|
85
74
|
else for (const g of cur.groups) {
|
|
86
75
|
if (cur.groups.length > 1) h += `<div class="wsec" data-lane="${g.key}"><span class="label">${esc(g.label)}</span><em>${g.n ? g.n + ' · ' + esc(g.hint) : 'empty'}</em></div>`;
|
|
87
76
|
h += groupHtml(g, qTab);
|
|
@@ -89,6 +78,8 @@ function drawQueue() {
|
|
|
89
78
|
$('#qBody').innerHTML = h;
|
|
90
79
|
$('#qBody').dataset.tab = qTab;
|
|
91
80
|
$('#qNote').textContent = cur.note;
|
|
81
|
+
const sel = $('#qTabs [aria-selected="true"]'), bar = $('#qTabs'); // one row that scrolls sideways on a phone: keep the chosen tab in view
|
|
82
|
+
if (sel && bar.scrollWidth > bar.clientWidth) bar.scrollLeft = Math.max(0, sel.offsetLeft - (bar.clientWidth - sel.offsetWidth) / 2);
|
|
92
83
|
}
|
|
93
84
|
$('#qTabs').addEventListener('click', (e) => { const b = e.target.closest('[data-tab]'); if (!b) return; qTab = b.dataset.tab; drawQueue(); const n = $(`#qTabs [data-tab="${qTab}"]`); if (n) n.focus(); });
|
|
94
85
|
$('#qTabs').addEventListener('keydown', (e) => {
|
|
@@ -98,7 +89,6 @@ $('#qTabs').addEventListener('keydown', (e) => {
|
|
|
98
89
|
qTab = ks[e.key === 'Home' ? 0 : e.key === 'End' ? ks.length - 1 : (i + (e.key === 'ArrowRight' ? 1 : -1) + ks.length) % ks.length];
|
|
99
90
|
drawQueue(); $(`#qTabs [data-tab="${qTab}"]`).focus();
|
|
100
91
|
});
|
|
101
|
-
$('#qPipe').addEventListener('click', (e) => { const b = e.target.closest('[data-ag]'); if (!b) return; agTile = agTile === b.dataset.ag ? null : b.dataset.ag; drawQueue(); const n = $(`#qPipe [data-ag="${b.dataset.ag}"]`); if (n) n.focus(); });
|
|
102
92
|
function drawWaiting() {
|
|
103
93
|
const W = M.waiting;
|
|
104
94
|
$('#waitCap').textContent = W.cap;
|
|
@@ -543,9 +543,6 @@ a.round{color:inherit;text-decoration:none}
|
|
|
543
543
|
button.pst{border:0;font:inherit;color:inherit;text-align:left;cursor:pointer}button.pst:not(.hot):hover{box-shadow:inset 0 0 0 1px var(--hair)}
|
|
544
544
|
.agl{margin-top:8px}
|
|
545
545
|
.wrow.sm .wrh{padding:11px 0}.wrow.sm .wtit{font-size:var(--fs-3)}
|
|
546
|
-
.ags{width:34px;height:34px;border-radius:14px;display:grid;place-items:center;background:var(--well);color:var(--ink-2)}
|
|
547
|
-
.wrow:hover .ags{background:var(--card)}.ags svg{width:17px;height:17px}.ags.ready{background:var(--solid);color:var(--on-solid)}
|
|
548
|
-
.ags .spin{width:16px;height:16px}
|
|
549
546
|
.avp{width:34px;height:34px;border-radius:50%;background:var(--b3);display:grid;place-items:center;font:600 var(--fs-2) var(--mono);color:var(--ink)}
|
|
550
547
|
.nud{font-size:var(--fs-2);font-weight:600;color:var(--ember-ink)}
|
|
551
548
|
.nud.ok{color:var(--ok)}
|
|
@@ -632,7 +629,7 @@ button.pst{border:0;font:inherit;color:inherit;text-align:left;cursor:pointer}bu
|
|
|
632
629
|
|
|
633
630
|
@media (max-width:700px){
|
|
634
631
|
.cap{height:54px}.cap kbd{display:none}
|
|
635
|
-
.wgl,.
|
|
632
|
+
.wgl,.avp{width:30px;height:30px;border-radius:8px}.avp{border-radius:50%}
|
|
636
633
|
.wm .est{display:none}
|
|
637
634
|
.pst{padding:10px 12px}.pst b{font-size:var(--fs-4)}
|
|
638
635
|
.revc{grid-template-columns:1fr}
|
|
@@ -2041,21 +2038,30 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
2041
2038
|
.mhint .lk{display:inline;font-size:var(--fs-2);font-weight:600;color:var(--ink);text-decoration:underline;text-underline-offset:2px;padding:0}
|
|
2042
2039
|
.mhint .lk:hover{color:var(--ember-ink)}
|
|
2043
2040
|
|
|
2044
|
-
/* My work: the Work queue (PM, 2026-10-19) — one card for what On your plate
|
|
2045
|
-
|
|
2041
|
+
/* My work: the Work queue (PM, 2026-10-19) — one card for what On your plate and the tray held. Tabs are one pill row as the mockup's tray,
|
|
2042
|
+
and one row on a phone too: it scrolls sideways and never wraps (PM, 2026-10-20). */
|
|
2043
|
+
.qtabs{position:relative;display:inline-flex;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;gap:2px;padding:4px;margin:14px 0 6px;border-radius:var(--r-chip);background:var(--well);max-width:100%}
|
|
2046
2044
|
.qtb{height:36px;padding:0 14px;border-radius:var(--r-chip);font-size:var(--t-small);font-weight:600;color:var(--ink-2);white-space:nowrap;transition:background .25s,color .25s}
|
|
2047
2045
|
.qtb em{font-style:normal;font-weight:500;margin-left:6px;opacity:.75}
|
|
2048
2046
|
.qtb:hover{color:var(--ink)}
|
|
2049
2047
|
.qtb[aria-selected="true"]{background:var(--solid);color:var(--on-solid)}
|
|
2050
2048
|
.qtb:focus-visible{outline:2px solid var(--ember);outline-offset:2px}
|
|
2051
|
-
.
|
|
2052
|
-
|
|
2049
|
+
.qtabs::-webkit-scrollbar{display:none}
|
|
2050
|
+
/* the agent's state on a row, in the tab where the item waits (PM, 2026-10-20: no Agents tab) */
|
|
2051
|
+
.wag{display:inline-flex;align-items:center;gap:5px;font:600 var(--fs-1) var(--sans);font-style:normal;color:var(--ink-2);background:var(--well);padding:1px 9px 1px 7px;border-radius:999px;margin-right:8px;vertical-align:1px;white-space:nowrap}
|
|
2052
|
+
.wag i{width:7px;height:7px;border-radius:50%;background:var(--ink-3)}
|
|
2053
|
+
.wag.ready{background:var(--spot);color:var(--ember-ink)}.wag.ready i{background:var(--ember)}
|
|
2054
|
+
.wag.fail{color:var(--bad)}.wag.fail i{background:var(--bad)}
|
|
2055
|
+
.wag.run i{background:var(--ok);animation:agp 1.4s ease-in-out infinite}
|
|
2056
|
+
@keyframes agp{50%{opacity:.3}}
|
|
2057
|
+
@media (prefers-reduced-motion:reduce){.wag.run i{animation:none}}
|
|
2058
|
+
.wrow:hover .wag{background:var(--card)}
|
|
2053
2059
|
#qCap b{color:var(--ink)}
|
|
2054
2060
|
.tgrid .wsec{grid-column:1/-1}
|
|
2055
2061
|
.tgrid .wsec+.wrw+.wrw{border-top:0}
|
|
2056
2062
|
#qBody .wsec:first-child{padding-top:8px}
|
|
2057
2063
|
@media (max-width:1000px){.tgrid .wsec+.wrw+.wrw{border-top:1px solid var(--hair)}}
|
|
2058
|
-
@media (max-width:700px){.qtabs{display:flex;
|
|
2064
|
+
@media (max-width:700px){.qtabs{display:flex;width:100%;-webkit-mask-image:linear-gradient(90deg,var(--ink) calc(100% - 28px),transparent);mask-image:linear-gradient(90deg,var(--ink) calc(100% - 28px),transparent)}.qtb{flex:0 0 auto;min-height:44px;padding:0 14px}}
|
|
2059
2065
|
.rdbtns{display:inline-flex;gap:6px;align-items:center}
|
|
2060
2066
|
.wks .wkc{font:400 var(--fs-2) var(--sans);letter-spacing:0;text-transform:none;padding:12px 4px 10px}
|
|
2061
2067
|
.wkc .wkl{font:500 var(--fs-1) var(--mono);letter-spacing:.08em}
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
<section class="card rise" style="--d:5;margin-top:24px" id="queue" aria-labelledby="hQueue">
|
|
49
49
|
<div class="ch"><span class="ic"><svg class="i" viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="16" rx="3"/><path d="M8 9h8M8 13h8M8 17h5"/></svg></span><h2 id="hQueue">Work queue</h2><small id="qCap"></small></div>
|
|
50
50
|
<div class="qtabs" id="qTabs" role="tablist" aria-label="Work queue"></div>
|
|
51
|
-
<div class="qpipe" id="qPipe" hidden></div>
|
|
52
51
|
<div class="tgrid" id="qBody" role="tabpanel" aria-labelledby="hQueue"></div>
|
|
53
52
|
<p class="note" id="qNote" style="margin-top:14px"></p>
|
|
54
53
|
</section>
|