create-pmos 0.613.0 → 0.614.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 +14 -14
- 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/changelog.json +13 -0
- package/workspace/guide/cli.md +2 -1
- package/workspace/guide/layout.md +22 -8
- package/workspace/guide/settings-and-switches.md +1 -0
- package/workspace/lib/events-place.js +2 -2
- package/workspace/lib/mention-cli.js +6 -3
- package/workspace/lib/mention-store.js +49 -10
- package/workspace/lib/routes-events-place.js +2 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/cozy-home-rows.css +55 -0
- package/workspace/public/pm/cozy-nav.js +15 -2
- package/workspace/public/pm/cozy-pop-work.css +3 -0
- package/workspace/public/pm/cozy-pop-work.js +5 -3
- package/workspace/public/pm/cozy-today-app.js +119 -12
- package/workspace/public/pm/cozy-today-model.js +278 -21
- package/workspace/public/pm/cozy-today-page.css +74 -15
- package/workspace/public/pm/cozy-today-view.js +89 -31
- package/workspace/public/pm/home-app.js +14 -6
- package/workspace/public/pm/home-data.js +1 -1
- package/workspace/public/pm/home-ini.js +17 -1
- package/workspace/public/pm/home-mentions.js +121 -6
- package/workspace/public/pm/ini-edit.js +2 -0
- package/workspace/public/pm/ini-view.css +2 -0
- package/workspace/public/pm/mention-one-model.js +115 -0
- package/workspace/public/pm/pop-work-model.js +17 -11
- package/workspace/run-tests.js +11 -4
- package/workspace/server.js +8 -0
- package/workspace/skills/morning-brief.skill +1 -1
- package/workspace/test-run.js +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.614.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": {
|
|
@@ -33,6 +33,19 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.614.0",
|
|
38
|
+
"at": "2026-11-19T02:50:21.667Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1373,
|
|
43
|
+
"t": "Today matches its board, round 2 on real data, round 3 (one item per press, the self check)",
|
|
44
|
+
"s": "Today matches its board, round 2 on real data, round 3 (one item per press, the self check)",
|
|
45
|
+
"k": "fix"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
36
49
|
{
|
|
37
50
|
"v": "0.613.0",
|
|
38
51
|
"at": "2026-11-19T02:36:25.154Z",
|
|
@@ -423,19 +436,6 @@
|
|
|
423
436
|
"k": "new"
|
|
424
437
|
}
|
|
425
438
|
]
|
|
426
|
-
},
|
|
427
|
-
{
|
|
428
|
-
"v": "0.594.0",
|
|
429
|
-
"at": "2026-11-18T02:08:44.140Z",
|
|
430
|
-
"f": 4,
|
|
431
|
-
"prs": [
|
|
432
|
-
{
|
|
433
|
-
"n": 1335,
|
|
434
|
-
"t": "Continue the PM's kept prototype and show it under Prototype & design",
|
|
435
|
-
"s": "Continue the PM's kept prototype and show it under Prototype & design",
|
|
436
|
-
"k": "fix"
|
|
437
|
-
}
|
|
438
|
-
]
|
|
439
439
|
}
|
|
440
440
|
]
|
|
441
441
|
}
|
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-11-19T02:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-19T02:50:19Z"}
|
|
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-11-19T02:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-19T02:50:19Z"}
|
|
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-11-19T02:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-19T02:50:19Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.614.0",
|
|
4
|
+
"at": "2026-11-19T02:50:21.667Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1373,
|
|
9
|
+
"t": "Today matches its board, round 2 on real data, round 3 (one item per press, the self check)",
|
|
10
|
+
"s": "Today matches its board, round 2 on real data, round 3 (one item per press, the self check)",
|
|
11
|
+
"k": "fix"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
2
15
|
{
|
|
3
16
|
"v": "0.613.0",
|
|
4
17
|
"at": "2026-11-19T02:36:25.154Z",
|
package/workspace/guide/cli.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Command reference: every pmos command, by area"
|
|
4
4
|
description: "Every pmos command of the workspace in one page, grouped by area, with its flags, examples and exit codes."
|
|
5
|
-
timestamp: 2026-11-
|
|
5
|
+
timestamp: 2026-11-19
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Command reference
|
|
@@ -83,6 +83,7 @@ These commands post nothing:
|
|
|
83
83
|
- `pmos mention stands <id> --settled "<line>" [--open "<line>"]` saves Where it stands.
|
|
84
84
|
- `pmos mention watch <id> --what "<Samuel’s tag>" --text "<the offer>"` offers to watch for a dated promise.
|
|
85
85
|
- `pmos mention landed <id> --text "<Samuel’s tag landed.>"` says that the promise landed.
|
|
86
|
+
- `pmos mention looks <id> --who "<name>" --text "<their line>" [--on <ISO>]` says that someone else may have answered, with their line quoted. Today shows it under the ask with ✓ ✕; nothing closes until you confirm.
|
|
86
87
|
|
|
87
88
|
### pmos lead: PMOS's leads in popups
|
|
88
89
|
|
|
@@ -14,7 +14,7 @@ PMOS has four places: **Today**, **Work**, **Goals** and **Events**. PMOS opens
|
|
|
14
14
|
On a computer, one thin panel at the left edge of every page holds the places. It is the same on every page. Press a place to go there.
|
|
15
15
|
|
|
16
16
|
- At its foot: the chat icon, **Search**, **Guide** and **Settings**.
|
|
17
|
-
- A number on Today says how many
|
|
17
|
+
- A number on Today says how many lines of Today's log are for today (Do first and what waits today). It shows on every place. A number on the chat icon says how many sessions wait for you.
|
|
18
18
|
- A blue dot on a place means that it has something new to show. An amber dot on Settings means that a source is stale.
|
|
19
19
|
- Settings opens over the page you are on. The navigation stays.
|
|
20
20
|
- The navigation does not count as a panel.
|
|
@@ -26,26 +26,40 @@ On a phone, the round button at the bottom right opens the same places as a menu
|
|
|
26
26
|
|
|
27
27
|
## Today
|
|
28
28
|
|
|
29
|
-
On a computer, Today is one page. Today's log
|
|
29
|
+
On a computer, Today is one page that starts at the left of the panel. At the top are the day and the time, and a greeting. Under them, the Overview and Today's log take the left (at most about 1100 px wide). Today's agenda is in one grey box on the right, about 320 px wide. Today reads every product. Home's old address on a computer (`/premium.html`, and a link that names one item) opens Today.
|
|
30
30
|
|
|
31
|
-
The
|
|
31
|
+
The **Overview** is one grey box written by PMOS (✦). It says how many lines are open, the ones to start with and why, how much free time today has and when your first or next meeting is. It names only what the lines themselves say. Under it, PMOS suggests what to clean up with ✓ ✕, only when it is true, for example "Drop the 2 checks carried more than 60 days". A row of chips counts each type (All, Asks, Decisions, Checks, Milestones, Tasks, Reports, Notes). Press a chip to show only that type; press it again to show all. A type with no lines has no chip.
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
The log is a table, kept the Bullet Journal way, in three groups:
|
|
34
|
+
|
|
35
|
+
- **Do first**: five lines at most, each with the reason PMOS picked it under its title. PMOS picks what you marked first, a date that is late, a date that is today or a send that goes out today, a session that waits on you, and the person who waits longest. A line that PMOS suggests to drop is never in Do first.
|
|
36
|
+
- **Today**: what is new today (dated today, logged today or asked today), then what you did today.
|
|
37
|
+
- **Can wait**: the rest, folded to one line ("66 more · the oldest carried 23 days"). Press it to see them, by type and then the oldest first.
|
|
38
|
+
|
|
39
|
+
Each row is one short line:
|
|
40
|
+
|
|
41
|
+
- The bullet says what it is: **•** a task, **○** an event, **–** a note, **×** done, **✦** something PMOS suggests. **!** marks what you marked first.
|
|
42
|
+
- **What** (the thing to do), **Type**, **Work** (the initiative or program it belongs to; the column is left out when no line names one), **Job** and **When**. The type is **Ask** (a person asked you; the line starts with who, then the ask; an ask with no person behind it can wait), **Decision**, **Check** ("did it work?"), **Milestone**, **Task**, **Report** or **Note**. The same ask from the same people shows once, with every name ("Suhas and Betty: …"). **Decide** is a call you make up your mind on, **Do** is something you do yourself ("Draft the PRD, or let PMOS draft it"), **Reply** is an answer a person waits for, and **Send** is a thing of yours that is ready to go out. PMOS's own note, such as the asks that expired with no answer, closes the log with the Job **Note**.
|
|
35
43
|
- The rows are the calls only you can make, your late tasks, the next steps, your own items for today, the drafts to send, and what you typed yourself.
|
|
36
|
-
-
|
|
44
|
+
- The title line counts the log ("Today's log · 12"), with the jobs at the right, for example "5 to decide · 6 to do · 15 to reply · 1 to send".
|
|
37
45
|
|
|
38
46
|
To use the log:
|
|
39
47
|
|
|
40
48
|
1. Type a task, an event or a note in the first line and press Enter. Start with **o** for an event (add a time, such as 14:00, to put it on the agenda), with **-** for a note, and with **!** for what comes first. Enter only adds the row. It opens nothing and starts no session.
|
|
41
49
|
2. Point at a row to see its three icons: **Done**, **Move to tomorrow** and **Set a date**. Done gives the row the × bullet. Each change shows Undo for a moment.
|
|
42
|
-
3. Press a row, or an event in the agenda, to open
|
|
50
|
+
3. Press a row, or an event in the agenda, to open that one item in the popup. An ask opens that one mention, not the list of mentions. A task opens its initiative at that task, with the task's row lit. A check ("did it work?") opens its initiative. With the popup open, press **j** or **k** (or **↓** and **↑** in an ask) to open the next or the previous row in its place.
|
|
51
|
+
|
|
52
|
+
Every row says why it is on Today, after its title: "Due today", "3 days late", "Chen waits on you 13 days", "Goes out today 16:00", "PMOS finished it, needs your look" or "You said today". A task with none of these reasons is not on Today. A task whose date passed more than 30 days ago is not a row either: the Overview says how many there are in one ✦ line, and ✓ clears them from Today. A small **✦ 1** before the reason says what PMOS did on that row already (point at it to read it).
|
|
53
|
+
|
|
54
|
+
**One ask in the popup.** The title is the ask in one line. Under it: who asked, where (for example "Slack · #product"), how long they wait, and PMOS's check ("Checked 08:10 · still waiting on you"). When PMOS could not read that source, it says so ("Slack not read since 06:50") and claims neither. Then two boxes: **PMOS did** (from the records only, such as "drafted the reply") and **Left for you** (one step, verb first, such as "Read the reply, then send it in Slack"). Then the reply PMOS drafted, or why it could not draft one. Blanks in a reply ("[date]") are fields to fill in before you send. PMOS never posts: send copies the reply and opens the source. The four icons mark it answered, remind you at 09:00, make it a task, or say it is not for you. The messages follow, each with a name and a time; the same words from the same person show once with ×3, and older messages fold under "N earlier". **About: …** opens the work the ask is about, and **‹ All mentions** opens the full list.
|
|
55
|
+
|
|
56
|
+
**PMOS checks that an ask still waits on you.** On every read, when Today opens and again when you open the ask, PMOS checks the source. When you replied after the ask, the ticket it points to is closed, or the person took the ask back, the ask leaves Today by itself and a message says how ("You replied Tue 17 Nov: …"), with Undo. A new message from the person after your reply brings it back. An ask with no move for 21 days asks "Still needed?" once.
|
|
43
57
|
|
|
44
58
|
What you do not finish is carried to the next day, and the When column says for how long ("carried 16 days"). When a row is carried for 30 days, PMOS suggests to drop it from your log. ✓ drops it, ✕ keeps it, and PMOS does not ask again for a month. A task's own date changes only when you set a date on it.
|
|
45
59
|
|
|
46
60
|
Findings that fit no initiative (the Lab) are ✦ rows in the log. ✓ keeps one and starts an initiative from it. ✕ drops it.
|
|
47
61
|
|
|
48
|
-
The
|
|
62
|
+
The agenda is the day by hours, from 08:00 to 18:00, with a red line at the time now. Meetings that overlap sit side by side, so none covers or cuts another. The box is as tall as its hours. It shows your meetings, the reports that go out today at their time, your own events, and focus time: the free time from now until the next meeting, held for the first row of your log, in a dashed box. Press the focus time to open that row. **Events** at the top right opens the Events page. "PMOS did" is not on Today; it moves to Routine.
|
|
49
63
|
|
|
50
64
|
On a phone, Today is Home: the list of your work, and the chat when you open a row.
|
|
51
65
|
|
|
@@ -232,6 +232,7 @@ Do not set these on your own computer. The suites set them to make a run short o
|
|
|
232
232
|
| Variable | What it does | Default | Same in Settings |
|
|
233
233
|
|---|---|---|---|
|
|
234
234
|
| `PMOS_TEST` | `1` allows the test seam of the audit sink. | off | — |
|
|
235
|
+
| `PMOS_DESK_HOME` | `keep` keeps Home at `/premium.html` on a desk. Without it, a bare `/premium.html` (or one with only `?item=`) opens Today. | Today | — |
|
|
235
236
|
| `PMOS_OFFLOOP` | `0` runs the board fold in the server thread, not in a worker. | worker | — |
|
|
236
237
|
| `PMOS_TICK_MS` | The server's tick. | 1 minute | — |
|
|
237
238
|
| `PMOS_LIVENESS_MS` | How often the session list is sent again. | 2 seconds | — |
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* boards [{ ws, id, name, rows }] every product's Board model (lib/board-premium.js): the open rows, each with `milestones` (◇ tasks with a
|
|
10
10
|
* due day, PMOS and Jira), `tasks` (the PMOS tasks), `end` (the plan end), `stage`, `status`, `forecast`
|
|
11
11
|
* meetings [{ id, at, end, title, initiative }] lib/calendar-events.js readAll
|
|
12
|
-
* schedules [{ id, name, cadence, next }]
|
|
12
|
+
* schedules [{ id, name, cadence, next, time? }] the enabled report schedules, with the day each fires next ('YYYY-MM-DD') and its time
|
|
13
13
|
* drafts [{ ws, cadence, slot, title? }] report drafts that wait to be issued (lib/report-needs.js reportsOf: a draft, not issued)
|
|
14
14
|
* own [{ id, title, due, done }] the PM's own items (lib/pm-items.js)
|
|
15
15
|
* jira [{ key, title, url, due, category, initiative }] the Jira tickets assigned to the PM (<runtime>/my-work/read.json), with a due day
|
|
@@ -222,7 +222,7 @@ function build(input = {}) {
|
|
|
222
222
|
const name = clip(s.name || cap(s.cadence) + ' report', 120);
|
|
223
223
|
const d = draftOf.get(s.cadence);
|
|
224
224
|
const waits = d && daysBetween(today, s.next) === 0;
|
|
225
|
-
put({ key: 'rep:' + (s.id || s.cadence) + ':' + day10(s.next), kind: 'report', date: s.next, time: null, until: null, title: name,
|
|
225
|
+
put({ key: 'rep:' + (s.id || s.cadence) + ':' + day10(s.next), kind: 'report', date: s.next, time: /^\d{2}:\d{2}$/.test(String(s.time || '')) ? s.time : null, until: null, title: name,
|
|
226
226
|
line: [s.cadence ? 'Goes out ' + String(s.cadence).replace(/[-_]+/g, ' ') : 'Goes out', waits ? 'the draft waits for you' : ''].filter(Boolean).join(' · '), product: '', work: null, task: null, own: null, jira: false, canFix: false, editable: false,
|
|
227
227
|
scope: [], act: waits ? { label: 'Read the draft', href: '/premium-intelligence.html?tab=library' } : null });
|
|
228
228
|
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* pmos mention stands <id> --settled "<line>"… [--open "<line>"…] "Where it stands": what is settled and what is still open
|
|
8
8
|
* pmos mention watch <id> --what "<Samuel’s tag>" --text "<the offer>" [--due <ISO>] offer to watch for a dated promise (the PM ✓ or ×)
|
|
9
9
|
* pmos mention landed <id> --text "<Samuel’s tag landed.>" the watched promise landed: the opening line says so once
|
|
10
|
+
* pmos mention looks <id> --who "<name>" --text "<their line>" [--on <ISO>] someone else may have answered: the line, quoted
|
|
10
11
|
* <id> is a conversation's id (pmos mention list prints it). Claude runs `draft` from the chat where the PM changes a reply ("Reply to
|
|
11
12
|
* Arif"), and the rest after a source read: the Viewer shows each on its next read. Every mark is one line in
|
|
12
13
|
* <runtime>/mentions/marks.jsonl with by: agent. This command posts nothing: the PM sends the reply where the mention is. */
|
|
@@ -15,9 +16,9 @@ const path = require('path');
|
|
|
15
16
|
const stateRoot = require('./state-root');
|
|
16
17
|
const store = require('./mention-store.js');
|
|
17
18
|
|
|
18
|
-
const COMMANDS = { mention: ['list', 'draft', 'gist', 'nodraft', 'stands', 'watch', 'landed'] };
|
|
19
|
+
const COMMANDS = { mention: ['list', 'draft', 'gist', 'nodraft', 'stands', 'watch', 'landed', 'looks'] };
|
|
19
20
|
const USAGE = [
|
|
20
|
-
'usage: pmos mention list|draft|gist|nodraft|stands|watch|landed — Home\'s Mentions',
|
|
21
|
+
'usage: pmos mention list|draft|gist|nodraft|stands|watch|landed|looks — Home\'s Mentions',
|
|
21
22
|
' pmos mention list the conversations: Your move, To read, Answered this week',
|
|
22
23
|
' pmos mention draft <id> --text "<reply>" change the proposed reply of one conversation (or --file <path|->)',
|
|
23
24
|
' pmos mention gist <id> --text "<one line>" the row\'s line: where the conversation stands',
|
|
@@ -25,6 +26,7 @@ const USAGE = [
|
|
|
25
26
|
' pmos mention stands <id> --settled "<line>" [--settled …] [--open "<line>" …] what is settled and what is open',
|
|
26
27
|
' pmos mention watch <id> --what "<Samuel’s tag>" --text "<the offer>" [--due <ISO>] offer to watch for a dated promise',
|
|
27
28
|
' pmos mention landed <id> --text "<Samuel’s tag landed.>" the watched promise landed',
|
|
29
|
+
' pmos mention looks <id> --who "<name>" --text "<their line>" [--on <ISO>] someone else may have answered: quote the line',
|
|
28
30
|
' every command: [--json]',
|
|
29
31
|
'This command never posts. You send the reply where the mention is.',
|
|
30
32
|
];
|
|
@@ -84,9 +86,10 @@ function run(argv, { say = console.log, env = process.env, stateDir, cwd = proce
|
|
|
84
86
|
const body = { id: conv.id, act: sub === 'watch' ? 'offer' : sub, text };
|
|
85
87
|
if (sub === 'watch') { body.what = a.what; if (a.due) body.due = a.due; }
|
|
86
88
|
if (sub === 'stands') { body.settled = a.settled || []; body.open = a.open || []; }
|
|
89
|
+
if (sub === 'looks') { if (a.who) body.who = a.who; if (a.on) body.on = a.on; }
|
|
87
90
|
const r = store.mark(dir, body, now(), 'agent');
|
|
88
91
|
if (!r.ok) { out(r, `✗ refused: ${r.error}`); return 1; }
|
|
89
|
-
const SAID = { draft: 'the proposed reply', gist: 'the gist', nodraft: 'why there is no draft', stands: 'Where it stands', watch: 'the watch offer', landed: 'that the promise landed' };
|
|
92
|
+
const SAID = { draft: 'the proposed reply', gist: 'the gist', nodraft: 'why there is no draft', stands: 'Where it stands', watch: 'the watch offer', landed: 'that the promise landed', looks: 'the line that may answer it' };
|
|
90
93
|
out({ ok: true, id: conv.id }, `saved ${SAID[sub]} of ${conv.id}. The Mentions Viewer shows it${sub === 'draft' ? '; you send it where the mention is' : ''}.`);
|
|
91
94
|
return 0;
|
|
92
95
|
}
|
|
@@ -44,11 +44,14 @@ const MENTION_SOURCES = Object.freeze(['slack', 'jira', 'confluence', 'mail']);
|
|
|
44
44
|
const VIAS = Object.freeze(['at', 'dm', 'name']);
|
|
45
45
|
const NAME_SOURCES = new Set(['slack', 'mail']); // where a plain name, with no @, counts (Jira and Confluence mention by handle)
|
|
46
46
|
const ACTS = Object.freeze(['answered', 'notask', 'snooze', 'task', 'keep', 'drafted', 'draft', 'read', 'closed', 'undo',
|
|
47
|
-
'gist', 'nodraft', 'stands', 'offer', 'watch', 'nowatch', 'landed']);
|
|
47
|
+
'gist', 'nodraft', 'stands', 'offer', 'watch', 'nowatch', 'landed', 'reopen', 'looks']);
|
|
48
48
|
// what Undo never takes back: opening, a task closed by a reply, and what Claude wrote (the reply, the gist, why no draft, Where it stands,
|
|
49
49
|
// the watch offer and its landing)
|
|
50
|
-
const NOT_UNDONE = new Set(['read', 'draft', 'closed', 'gist', 'nodraft', 'stands', 'offer', 'landed']);
|
|
51
|
-
|
|
50
|
+
const NOT_UNDONE = new Set(['read', 'draft', 'closed', 'gist', 'nodraft', 'stands', 'offer', 'landed', 'looks']);
|
|
51
|
+
// looks: "someone else may have answered" with the quoted line (round 3 point 10d). The morning brief writes it (step 5b, `pmos mention
|
|
52
|
+
// looks`, the PM's yes of 2026-11-19); the row drops to Can wait with ✓ ✕ and nothing closes until the PM says so.
|
|
53
|
+
const AGENT_ACTS = new Set(['draft', 'gist', 'nodraft', 'stands', 'offer', 'landed', 'looks']);
|
|
54
|
+
const STILL_DAYS = 21; // an ask with no move this long asks "Still needed?" once (round 3 point 10g)
|
|
52
55
|
const DAY = 86400000;
|
|
53
56
|
const KEEP_DAYS = 14; // a mention that stopped waiting is kept this long (Last 7 days shows 7 of them)
|
|
54
57
|
const MAX_WAIT_DAYS = 365; // an ask older than this is dropped, waiting or not
|
|
@@ -110,6 +113,11 @@ function entryOf(x, source, ref, o = {}) {
|
|
|
110
113
|
if (/^https:\/\/\S+$/i.test(String(x.link || '')) && String(x.link).length <= 500) e.link = x.link;
|
|
111
114
|
if (typeof x.initiative_id === 'string' && x.initiative_id) e.initiative = x.initiative_id;
|
|
112
115
|
if (x.replied === true) { e.replied = true; e.replied_seen = e.seen; }
|
|
116
|
+
// the self check from records (round 3 point 10b): the ticket or page it points to closed or resolved; the asker took the ask back
|
|
117
|
+
const st = String(x.status || '').trim();
|
|
118
|
+
if (x.closed === true || /^(done|closed|resolved|won'?t do|cancell?ed|complete[d]?)$/i.test(st)) { e.closed = true; e.closed_seen = e.seen; if (st) e.closed_as = clip(st, 40); }
|
|
119
|
+
else if (x.closed === false || st) e.closed = false; // a ticket that opened again
|
|
120
|
+
if (x.withdrawn === true) { e.withdrawn = true; e.withdrawn_seen = e.seen; }
|
|
113
121
|
const via = o.via || (VIAS.includes(x.via) ? x.via : '');
|
|
114
122
|
if (via) e.via = via;
|
|
115
123
|
return e;
|
|
@@ -171,6 +179,7 @@ function merge(old, nu) {
|
|
|
171
179
|
out.thread = th.slice(-8);
|
|
172
180
|
// the read said the PM replied: every ask up to that read is answered (a later ask makes it wait again)
|
|
173
181
|
if (nu.replied) { out.replied = true; out.replied_seen = nu.seen; }
|
|
182
|
+
if (nu.closed === false) { delete out.closed_seen; delete out.closed_as; }
|
|
174
183
|
return out;
|
|
175
184
|
}
|
|
176
185
|
|
|
@@ -248,6 +257,13 @@ function mark(rt, b, now = new Date(), by = 'pm') {
|
|
|
248
257
|
if (Number.isFinite(d)) line.due = new Date(d).toISOString();
|
|
249
258
|
}
|
|
250
259
|
}
|
|
260
|
+
if (b.act === 'looks') { // the quoted line that may answer it, and who wrote it
|
|
261
|
+
if (typeof b.text !== 'string' || !b.text.trim()) return { ok: false, error: 'text is the line that answers it, quoted from the thread' };
|
|
262
|
+
if (b.text.trim().length > 200) return { ok: false, error: 'text is over 200 characters: quote the one line' };
|
|
263
|
+
line.text = b.text.trim();
|
|
264
|
+
if (b.who) line.who = clip(b.who, 80);
|
|
265
|
+
const t = b.on ? Date.parse(b.on) : NaN; if (Number.isFinite(t)) line.on = new Date(t).toISOString();
|
|
266
|
+
}
|
|
251
267
|
if (b.act === 'stands') {
|
|
252
268
|
const list = (v) => (Array.isArray(v) ? v : v == null ? [] : [v]).map((t) => (typeof t === 'string' ? t.replace(/\s+/g, ' ').trim() : '')).filter(Boolean);
|
|
253
269
|
const settled = list(b.settled), open = list(b.open);
|
|
@@ -351,7 +367,7 @@ function marksFor(ids, mks) {
|
|
|
351
367
|
/** One conversation judged: waiting or not, since when, how many asks, what covered them, and whether a message came after the cover. Pure. */
|
|
352
368
|
function judgeConv(list, mk, now, me) {
|
|
353
369
|
const askT = [], meT = [], other = [];
|
|
354
|
-
let repSeen = 0, ask = false;
|
|
370
|
+
let repSeen = 0, closedSeen = 0, wdSeen = 0, ask = false;
|
|
355
371
|
for (const e of list) {
|
|
356
372
|
const th = e.thread || [];
|
|
357
373
|
for (const m of th) { const t = T(m.at); if (!t) continue; (isMe(m.who, me) ? meT : other).push(t); }
|
|
@@ -364,13 +380,18 @@ function judgeConv(list, mk, now, me) {
|
|
|
364
380
|
if (by.length) askT.push(...by); else if (own) askT.push(own);
|
|
365
381
|
}
|
|
366
382
|
if (e.replied) repSeen = Math.max(repSeen, T(e.replied_seen));
|
|
383
|
+
if (e.closed && e.closed_seen) closedSeen = Math.max(closedSeen, T(e.closed_seen));
|
|
384
|
+
if (e.withdrawn && e.withdrawn_seen) wdSeen = Math.max(wdSeen, T(e.withdrawn_seen));
|
|
367
385
|
}
|
|
368
386
|
askT.sort((a, b) => a - b);
|
|
369
387
|
const lastMe = meT.length ? Math.max(...meT) : 0;
|
|
370
388
|
// the read's replied: true covers every ask the store knew when that read came
|
|
371
|
-
const
|
|
372
|
-
|
|
373
|
-
const
|
|
389
|
+
const upTo = (seen) => { const b = seen ? askT.filter((t) => t <= seen + 1) : []; return b.length ? Math.max(...b) : 0; };
|
|
390
|
+
// what the records prove covers the ask (round 3 point 10c); Undo of one (reopen) sets aside every such proof up to that press
|
|
391
|
+
const reopened = mk.reopen ? T(mk.reopen.at) : 0;
|
|
392
|
+
const auto = (t) => (t && t > reopened ? t : 0);
|
|
393
|
+
const cover = [['replied', auto(Math.max(lastMe, upTo(repSeen)))], ['closed', auto(upTo(closedSeen))], ['withdrawn', auto(upTo(wdSeen))],
|
|
394
|
+
['answered', mk.answered ? T(mk.answered.at) : 0], ['notask', mk.notask ? T(mk.notask.at) : 0], ['task', mk.task ? T(mk.task.at) : 0]];
|
|
374
395
|
const upto = Math.max(...cover.map((c) => c[1]));
|
|
375
396
|
const how = upto ? cover.filter((c) => c[1] === upto)[0][0] : '';
|
|
376
397
|
const pending = askT.filter((t) => t > upto);
|
|
@@ -380,7 +401,8 @@ function judgeConv(list, mk, now, me) {
|
|
|
380
401
|
const last = Math.max(lastOther, lastMe, ...['answered', 'notask', 'task'].map((k) => (mk[k] ? T(mk[k].at) : 0)));
|
|
381
402
|
// answered, and someone wrote since without asking again: it comes back to To read, "New since your reply"
|
|
382
403
|
const sinceReply = ask && !pending.length && upto > 0 && lastOther > upto;
|
|
383
|
-
return { ask, waiting, snoozed: !!snoozed, since: pending.length ? pending[0] : 0, count: pending.length, last, lastOther, how: ask && !pending.length ? how : '', sinceReply
|
|
404
|
+
return { ask, waiting, snoozed: !!snoozed, since: pending.length ? pending[0] : 0, count: pending.length, last, lastOther, how: ask && !pending.length ? how : '', sinceReply,
|
|
405
|
+
upto, lastAsk: askT.length ? askT[askT.length - 1] : 0, closedSeen, wdSeen };
|
|
384
406
|
}
|
|
385
407
|
|
|
386
408
|
/** The newest of an entry field and a mark by Claude: { text, at } or null. */
|
|
@@ -425,7 +447,21 @@ function convRow(id, list, j, mk, reads, now, me) {
|
|
|
425
447
|
if (nd) r.nodraft = nd; else if (d) r.draft = d.text;
|
|
426
448
|
for (const k of ['found', 'why', 'send_to']) { const e = [...byT].reverse().find((x) => x[k]); if (e) r[k] = e[k]; }
|
|
427
449
|
if (mk.drafted && T(mk.drafted.at) >= j.since) r.drafted = mk.drafted.to || true;
|
|
428
|
-
|
|
450
|
+
// Still needed? (round 3 point 10g): an ask with no move for STILL_DAYS asks once; ✕ (keep) stops it until the thread moves again
|
|
451
|
+
const kept = mk.keep ? T(mk.keep.at) : 0;
|
|
452
|
+
if (j.waiting && j.since && now - Math.max(j.last, j.since) >= STILL_DAYS * DAY && !(kept && kept >= j.lastOther)) r.check = true;
|
|
453
|
+
// the proof the self check found (round 3 point 10c, 10f): what closed it, from the records only
|
|
454
|
+
if (!j.waiting && ['replied', 'closed', 'withdrawn'].includes(j.how)) {
|
|
455
|
+
const mine = msgs.filter((m) => m.me && T(m.at) && T(m.at) <= j.upto + 1).pop() || msgs.filter((m) => m.me).pop();
|
|
456
|
+
const by = (byT.find((e) => e.closed_as) || {}).closed_as;
|
|
457
|
+
r.proof = j.how === 'replied' ? { how: 'replied', at: mine && mine.at ? mine.at : new Date(j.upto).toISOString(), text: mine ? clip(mine.text, 160) : '' }
|
|
458
|
+
: j.how === 'closed' ? { how: 'closed', at: new Date(j.closedSeen).toISOString(), text: by || 'closed' }
|
|
459
|
+
: { how: 'withdrawn', at: new Date(j.wdSeen).toISOString(), text: latest && !latest.me ? clip(latest.text, 160) : '' };
|
|
460
|
+
r.auto = true;
|
|
461
|
+
}
|
|
462
|
+
// Looks answered (round 3 point 10d): someone else may have answered; the line is quoted. It stands until the asker writes again or ✕ keeps it
|
|
463
|
+
const lk = mk.looks || null;
|
|
464
|
+
if (j.waiting && lk && T(lk.at) >= j.lastAsk && !(kept && kept >= T(lk.at))) r.looks = { text: lk.text, who: lk.who || '', on: lk.on || null, at: lk.at };
|
|
429
465
|
if (mk.stands && mk.stands.settled && mk.stands.settled.length) r.stands = { settled: mk.stands.settled, open: mk.stands.open || [] };
|
|
430
466
|
// the watch: Claude offers it (✓ ×); accepted, the opening line says so until the promise lands, then once that it landed
|
|
431
467
|
const off = mk.offer || null, at = (k) => (mk[k] ? T(mk[k].at) : 0);
|
|
@@ -506,7 +542,10 @@ function view(rt, o = {}) {
|
|
|
506
542
|
if (as_of && T(as_of) < day0.getTime()) gaps.push({ kind: 'stale', upto: as_of });
|
|
507
543
|
// the sources a read reached, so the opening line can say "Nothing waits on you in Slack or Jira" when one is missing (MnA6)
|
|
508
544
|
const sources = Object.values(o.reads || {}).filter((r) => r && MENTION_SOURCES.includes(r.source) && r.state === 'read').map((r) => r.source);
|
|
509
|
-
|
|
545
|
+
// when each source was last read: the self check says "Checked 08:10" per conversation, or that its source was not read (round 3 point 10f)
|
|
546
|
+
const reads_at = {};
|
|
547
|
+
for (const r of Object.values(o.reads || {})) if (r && MENTION_SOURCES.includes(r.source) && r.state === 'read' && T(r.read_at) > T(reads_at[r.source])) reads_at[r.source] = new Date(T(r.read_at)).toISOString();
|
|
548
|
+
return { ok: true, ...B, count: B.waiting.length, gaps, as_of, sources, reads_at, now: new Date(now).toISOString() };
|
|
510
549
|
}
|
|
511
550
|
|
|
512
551
|
module.exports = { MENTION_SOURCES, ACTS, AGENT_ACTS, VIAS, keyOf, convKeyOf, convIdOf, judgeConv, nextNine, isMention, namesMe, timeOf, entryOf, briefExtras, merge, ingestRead, ingestBrief, mark, foldMarks, judge, build, prune, view, nineTomorrow, _files: { storeFile, marksFile } };
|
|
@@ -95,7 +95,8 @@ function readSchedules(now) {
|
|
|
95
95
|
if (!cadence) continue;
|
|
96
96
|
const next = logic.nextRun(s, now);
|
|
97
97
|
if (!next) continue;
|
|
98
|
-
|
|
98
|
+
const at = new Date(next);
|
|
99
|
+
out.push({ id: String(s.id || s.name || cadence), name: s.name || '', cadence, next: localDay(at), time: `${pad(at.getHours())}:${pad(at.getMinutes())}` });
|
|
99
100
|
}
|
|
100
101
|
return out;
|
|
101
102
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.614.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.614.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -124,3 +124,58 @@
|
|
|
124
124
|
.mn-cht { flex: 1; min-width: 0; display: flex; flex-direction: column; }
|
|
125
125
|
.mn-cht b { font-size: var(--fs-body); line-height: var(--lh-body); }
|
|
126
126
|
.mn-cht small { font-size: var(--fs-meta); color: var(--cz-ink3); line-height: var(--lh-meta); }
|
|
127
|
+
|
|
128
|
+
/* ── one mention, as Today opens it (Today round 3): a centred column, nothing about other mentions ── */
|
|
129
|
+
.mn1 { max-width: 760px; margin: 0 auto; padding: 8px 4px 32px; display: flex; flex-direction: column; gap: 16px; color: var(--cz-ink); }
|
|
130
|
+
.mn1-h { display: flex; align-items: flex-start; gap: 12px; }
|
|
131
|
+
.mn1-ht { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
|
|
132
|
+
.mn1-who { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: var(--fs-row); line-height: var(--lh-row); }
|
|
133
|
+
.mn1-who b { font-weight: var(--fw-strong); }
|
|
134
|
+
.mn1-src { font-size: var(--fs-meta); color: var(--cz-ink2); background: var(--cz-well); border-radius: 999px; padding: 1px 9px; }
|
|
135
|
+
.mn1-sub { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--cz-ink2); }
|
|
136
|
+
.mn1-sub .late { color: var(--cz-risk); }
|
|
137
|
+
.mn1-kind { font-size: var(--fs-badge); font-weight: var(--fw-strong); color: var(--cz-blueink); background: var(--cz-bluebg); border-radius: 6px; padding: 0 7px; }
|
|
138
|
+
.mn1-ck { color: var(--cz-ink3); }
|
|
139
|
+
.mn1-ck.answered { color: var(--cz-ink2); }
|
|
140
|
+
.mn1-ck.unknown { color: var(--cz-risk); }
|
|
141
|
+
.mn1-all { flex: none; border: 0; background: none; padding: 4px 2px; font: inherit; font-size: var(--fs-meta); color: var(--cz-ink3); cursor: pointer; }
|
|
142
|
+
.mn1-all:hover, .mn1-all:focus-visible { color: var(--cz-blueink); text-decoration: underline; }
|
|
143
|
+
.mn1-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0; border: 1px solid var(--cz-hair); border-radius: 16px; overflow: hidden; }
|
|
144
|
+
.mn1-did, .mn1-left { padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
|
|
145
|
+
.mn1-did { background: var(--cz-well); }
|
|
146
|
+
.mn1-did ul { margin: 0; padding-left: 18px; font-size: var(--fs-body); line-height: 1.5; color: var(--cz-ink2); }
|
|
147
|
+
.mn1-k { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-label); font-weight: var(--fw-strong); line-height: var(--lh-label); color: var(--cz-ink2); }
|
|
148
|
+
.mn1-did .mn1-k { color: var(--cz-blueink); }
|
|
149
|
+
.mn1-lt { margin: 0; font-size: var(--fs-row); font-weight: var(--fw-strong); line-height: var(--lh-row); }
|
|
150
|
+
.mn1-ask { display: flex; flex-direction: column; gap: 6px; }
|
|
151
|
+
.mn1-aq { margin: 0; font-size: var(--fs-panel); line-height: var(--lh-panel); overflow-wrap: anywhere; }
|
|
152
|
+
.mn1-go, .mn1-about { align-self: flex-start; border: 0; background: none; padding: 2px 0; font: inherit; font-size: var(--fs-meta); color: var(--cz-blueink); cursor: pointer; }
|
|
153
|
+
.mn1-go:hover, .mn1-about:hover { text-decoration: underline; }
|
|
154
|
+
.mn1-about { padding: 8px 12px; border: 1px solid var(--cz-hair); border-radius: 12px; color: var(--cz-ink); }
|
|
155
|
+
.mn1-reply { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border-radius: 16px; background: var(--cz-bluebg); }
|
|
156
|
+
.mn1-reply.no { background: var(--cz-well); }
|
|
157
|
+
.mn1-reply > p { margin: 0; font-size: var(--fs-body); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
158
|
+
.mn1-reply .mn1-k { color: var(--cz-blueink); }
|
|
159
|
+
.mn1-blank { font: inherit; font-size: var(--fs-body); border: 0; border-bottom: 2px solid var(--cz-blue); background: var(--cz-card); border-radius: 6px 6px 0 0; padding: 0 6px; color: var(--cz-ink); }
|
|
160
|
+
.mn1-blank:focus { outline: 2px solid var(--cz-blue); outline-offset: 1px; }
|
|
161
|
+
.mn1-ra, .mn1-acts { display: flex; justify-content: flex-end; gap: 8px; }
|
|
162
|
+
.mn1-acts { justify-content: flex-start; }
|
|
163
|
+
.mn1-proof, .mn1-looks { margin: 0; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--cz-well); font-size: var(--fs-body); line-height: 1.5; }
|
|
164
|
+
.mn1-looks p { margin: 0; flex: 1; }
|
|
165
|
+
/* no draft: one ✦ line, one icon that opens an empty reply field (design check of round 3) */
|
|
166
|
+
.mn1-nod { display: flex; align-items: center; gap: 8px; padding: 2px 0; color: var(--cz-blueink); }
|
|
167
|
+
.mn1-nod p { margin: 0; flex: 1; font-size: var(--fs-body); line-height: 1.5; color: var(--cz-ink2); }
|
|
168
|
+
.mn1-free { font: inherit; font-size: var(--fs-body); line-height: 1.6; border: 1px solid var(--cz-hair); border-radius: 12px; padding: 10px 12px; background: var(--cz-card); color: var(--cz-ink); resize: vertical; }
|
|
169
|
+
.mn1-free:focus { outline: 2px solid var(--cz-blue); outline-offset: 1px; }
|
|
170
|
+
.mn1-left { position: relative; }
|
|
171
|
+
.mn1-clr { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
|
|
172
|
+
.mn1-undo { margin-left: auto; border: 0; background: none; font: inherit; font-size: var(--fs-meta); color: var(--cz-blueink); cursor: pointer; }
|
|
173
|
+
.mn1-sec h3 { margin: 0 0 8px; font-size: var(--fs-section); font-weight: var(--fw-section); line-height: var(--lh-section); }
|
|
174
|
+
.mn1-thr, .mn1-thr ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
|
|
175
|
+
.mn1-m { padding: 8px 12px; border-radius: 12px; background: var(--cz-card); border: 1px solid var(--cz-hair); }
|
|
176
|
+
.mn1-m.me { background: var(--cz-bluebg); border-color: transparent; }
|
|
177
|
+
.mn1-m p { margin: 0; font-size: var(--fs-body); line-height: 1.5; overflow-wrap: anywhere; }
|
|
178
|
+
.mn1-m .mn1-mh { display: flex; align-items: baseline; gap: 8px; font-size: var(--fs-meta); color: var(--cz-ink3); }
|
|
179
|
+
.mn1-m .mn1-mh b { color: var(--cz-ink); font-weight: var(--fw-strong); }
|
|
180
|
+
.mn1-m .mn1-mh em { font-style: normal; color: var(--cz-ink2); background: var(--cz-well); border-radius: 6px; padding: 0 6px; }
|
|
181
|
+
.mn1-early summary { cursor: pointer; font-size: var(--fs-meta); color: var(--cz-ink3); padding: 2px 0 8px; }
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
* Nothing here leads to the console, and nothing here writes.
|
|
18
18
|
* ONE DOT (chief-of-staff C3 and the UI grill's delete list, 2026-11-08). The button carries one dot: amber while a source needs the PM,
|
|
19
19
|
* else blue while a call in Your move is the PM's (the event 'cz:calls', detail { count }: Home sends it from Your move) or a place has
|
|
20
|
-
* something new to show
|
|
20
|
+
* something new to show (on a desk the rail's Today number is Today's lines for today on every place: pm/cozy-today-app.js keeps it in
|
|
21
|
+
* localStorage 'pmos.today.count' with its day, and a page that sends no 'cz:calls' of its own shows it). The "N new for you" count is gone from the button and its name (New for you stays a fold of Your day), and so
|
|
21
22
|
* are Adler's ears over the phone button (AdP6): Your move is the one place that says what is yours.
|
|
22
23
|
* THE CHAT (C5, board CsB): the tray's chat icon opens the one chat over the page you are on (pm/page-chat.js openCos), with a soft
|
|
23
24
|
* "You are on …" chip. A page that has its own chat column (Home) passes opts.chat() and the icon focuses that chat instead.
|
|
@@ -227,6 +228,7 @@ export function mountNav(here, doc = document, opts = {}) {
|
|
|
227
228
|
N.fresh = freshRows(mo.places);
|
|
228
229
|
doc.dispatchEvent(new CustomEvent('cz:moments', { detail: mo }));
|
|
229
230
|
}
|
|
231
|
+
storedCalls();
|
|
230
232
|
if (n && n.ok) { N.news = n.count || 0; doc.dispatchEvent(new CustomEvent('cz:news-for-you', { detail: n })); }
|
|
231
233
|
if (s && s.ok) { N.stale = bannerOf(s.sources); doc.dispatchEvent(new CustomEvent('cz:sources', { detail: s })); } // Your day's failed source (AdP5)
|
|
232
234
|
if (menu.hidden || !menu.contains(doc.activeElement)) draw();
|
|
@@ -235,7 +237,18 @@ export function mountNav(here, doc = document, opts = {}) {
|
|
|
235
237
|
setInterval(read, 120000);
|
|
236
238
|
doc.addEventListener('visibilitychange', () => { if (!doc.hidden) read(); });
|
|
237
239
|
doc.addEventListener('cz:news', (e) => { if (e.detail && Number.isFinite(e.detail.count)) { N.news = e.detail.count; draw(); } else read(); });
|
|
238
|
-
doc.addEventListener('cz:calls', (e) => { const n = e.detail && Number(e.detail.count); N.calls = Number.isFinite(n) && n > 0 ? n : 0; draw(); });
|
|
240
|
+
doc.addEventListener('cz:calls', (e) => { const n = e.detail && Number(e.detail.count); N.calls = Number.isFinite(n) && n > 0 ? n : 0; N.callsHere = true; draw(); });
|
|
241
|
+
// Today's number on every place (round 2 of Today): Today keeps its lines for today with the day (pm/cozy-today-app.js); a page that
|
|
242
|
+
// sends no number of its own shows that one while it is from today
|
|
243
|
+
const storedCalls = () => {
|
|
244
|
+
if (N.callsHere) return;
|
|
245
|
+
let v = null; try { v = JSON.parse(localStorage.getItem('pmos.today.count') || 'null'); } catch { v = null; }
|
|
246
|
+
const d = new Date(), today = d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0');
|
|
247
|
+
const n = v && v.day === today && Number(v.n) > 0 ? Number(v.n) : 0;
|
|
248
|
+
if (n !== N.calls) { N.calls = n; draw(); }
|
|
249
|
+
};
|
|
250
|
+
storedCalls();
|
|
251
|
+
addEventListener('storage', (e) => { if (e.key === 'pmos.today.count') storedCalls(); });
|
|
239
252
|
doc.addEventListener('adler:prefs', () => draw());
|
|
240
253
|
// the chat icon's number: the sessions that wait for you (cozy-live-pill.js counts them)
|
|
241
254
|
doc.addEventListener('cz:live-n', (e) => { const a = e.detail && Number(e.detail.asks); const v = Number.isFinite(a) && a > 0 ? a : 0; if (v !== N.waiting) { N.waiting = v; draw(); } });
|
|
@@ -222,3 +222,6 @@ button.pw-fv .grey { color: var(--cz-ink3); }
|
|
|
222
222
|
@media (hover: hover) { button.pw-fv:hover > span:first-child { text-decoration: underline; text-underline-offset: 2px; } }
|
|
223
223
|
/* When did this happen? under the status list (round 3 point 18) */
|
|
224
224
|
.hi-pop .pw-when { padding: 0 6px 4px; }
|
|
225
|
+
/* round 3 item 11b: the task a Today row opened, lit until another task is opened */
|
|
226
|
+
.pw-kr.lit { background: var(--cz-bluebg); box-shadow: inset 3px 0 0 var(--cz-blue); }
|
|
227
|
+
.pw-kr.lit .pw-tt { font-weight: var(--fw-strong); }
|
|
@@ -50,10 +50,12 @@ const cols = () => ({ status: true, date: true, tl: true, kind: true, when: true
|
|
|
50
50
|
const ST = new Map(); // initiative id → { open, shut, doneOpen, farOpen, details, top }
|
|
51
51
|
const LOOSE = 'pw-loose'; // the initiatives whose Not in a stage row the PM opened (round 3 point 21), remembered on this computer
|
|
52
52
|
const stOf = (id) => {
|
|
53
|
-
if (!ST.has(id)) ST.set(id, { open: new Set((store.get(LOOSE, []) || []).includes(id) ? [''] : []), shut: new Set(), doneOpen: new Set(), moreOpen: new Set(), farOpen: false, details: null, top: 0, msAdd: false });
|
|
53
|
+
if (!ST.has(id)) ST.set(id, { open: new Set((store.get(LOOSE, []) || []).includes(id) ? [''] : []), shut: new Set(), doneOpen: new Set(), moreOpen: new Set(), farOpen: false, details: null, top: 0, msAdd: false, focus: '' });
|
|
54
54
|
return ST.get(id);
|
|
55
55
|
};
|
|
56
56
|
const looseKeep = (id, on) => { const L = (store.get(LOOSE, []) || []).filter((x) => x !== id); if (on) L.push(id); store.set(LOOSE, L.slice(-200)); };
|
|
57
|
+
/** The task a Today row opened (round 3 item 11b): its stage opens and its row is lit until another task is focused. '' clears it. */
|
|
58
|
+
export function focus(id, uid) { stOf(String(id)).focus = uid ? String(uid) : ''; }
|
|
57
59
|
const ITEMS = new Map(); // initiative id → the Library's rows | null while reading | false when the route is not there
|
|
58
60
|
const ib = (attr, label, d, cls = '') => `<button type="button" class="pw-ib${cls ? ' ' + cls : ''}" ${attr} aria-label="${esc(label)}" title="${esc(label)}">${SVG(d)}</button>`;
|
|
59
61
|
|
|
@@ -200,7 +202,7 @@ function rowHtml(x, W, C, sugRows) {
|
|
|
200
202
|
if (x.kind === 'done') return `<div class="pw-tr pw-dr" role="row"><span class="pw-it"><button type="button" class="pw-dn" data-pw-done="${esc(x.key)}" aria-expanded="${x.open}">${esc(x.label)}${SVG(x.open ? P.down : P.right, 14)}</button></span>${C.status ? '<span></span>' : ''}${C.date ? '<span></span>' : ''}${tl}</div>`;
|
|
201
203
|
const s = sugRows.get(x.uid);
|
|
202
204
|
const title = x.jira ? `<span class="pw-tt">${esc(x.title)}</span>` : `<button type="button" class="pw-tt" data-pw-name="${esc(x.uid)}" aria-label="${esc('Rename ' + x.title)}">${esc(x.title)}</button>`;
|
|
203
|
-
return `<div class="pw-tr pw-kr${x.done ? ' done' : ''}" role="row" data-pw-row="${esc(x.uid)}" data-pw-sec="${esc(x.sec)}"><span class="pw-it"><i class="pw-bul${x.ms ? ' ms' : ''}" aria-hidden="true"></i>${title}${ib(`data-pw-open="${esc(x.uid)}"`, 'Open the task', P.open, 'xs hov')}${ib(`data-pw-row-more="${esc(x.uid)}" aria-haspopup="menu"`, 'More for ' + x.title, P.more, 'xs hov')}</span>${stc}${dtc}${tl}</div>`
|
|
205
|
+
return `<div class="pw-tr pw-kr${x.done ? ' done' : ''}${x.lit ? ' lit' : ''}" role="row" data-pw-row="${esc(x.uid)}" data-pw-sec="${esc(x.sec)}"><span class="pw-it"><i class="pw-bul${x.ms ? ' ms' : ''}" aria-hidden="true"></i>${title}${ib(`data-pw-open="${esc(x.uid)}"`, 'Open the task', P.open, 'xs hov')}${ib(`data-pw-row-more="${esc(x.uid)}" aria-haspopup="menu"`, 'More for ' + x.title, P.more, 'xs hov')}</span>${stc}${dtc}${tl}</div>`
|
|
204
206
|
+ (s ? `<div class="pw-tr pw-sugrow" role="row"><span class="pw-it">${sugLine(s, true)}</span></div>` : '');
|
|
205
207
|
}
|
|
206
208
|
function breakdownHtml(W, C, mode, full, S) {
|
|
@@ -252,7 +254,7 @@ const keyOf = (v, o) => String((o && o.id) || (v && (v.id || v.key)) || '');
|
|
|
252
254
|
function model(r, v, o) {
|
|
253
255
|
const id = keyOf(v, o), S = stOf(id), it = ITEMS.get(id);
|
|
254
256
|
const g = o.goal || goalOf(o.ws, o.board, r.anchor || v.anchor);
|
|
255
|
-
const W = M.workOf(r, v, { ...o, goal: M.idShaped(g) ? '' : g, product: productName(o.product, o.ws), art: artOf(id, o.ws), open: S.open, shut: S.shut, doneOpen: S.doneOpen, moreOpen: S.moreOpen, farOpen: S.farOpen, mode: store.get(SPAN, 'full'), items: it || [], dropped: dropped() });
|
|
257
|
+
const W = M.workOf(r, v, { ...o, goal: M.idShaped(g) ? '' : g, product: productName(o.product, o.ws), art: artOf(id, o.ws), open: S.open, shut: S.shut, doneOpen: S.doneOpen, moreOpen: S.moreOpen, farOpen: S.farOpen, focus: S.focus, mode: store.get(SPAN, 'full'), items: it || [], dropped: dropped() });
|
|
256
258
|
const mk = M.marksOf(W.span, W.today); W.tx = mk.today;
|
|
257
259
|
return { W, S, id };
|
|
258
260
|
}
|