create-pmos 0.710.0 → 0.711.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.710.0",
3
+ "version": "0.711.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.711.0",
38
+ "at": "2026-11-22T14:19:07.603Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1543,
43
+ "t": "Phone Today opens first, Ask PMOS by work, and Work on the phone (job #1540)",
44
+ "s": "Phone Today opens first, Ask PMOS by work, and Work on the phone (job #1540)",
45
+ "k": "new"
46
+ }
47
+ ]
48
+ },
36
49
  {
37
50
  "v": "0.710.0",
38
51
  "at": "2026-11-22T13:35:34.451Z",
@@ -411,19 +424,6 @@
411
424
  "k": "new"
412
425
  }
413
426
  ]
414
- },
415
- {
416
- "v": "0.669.0",
417
- "at": "2026-11-22T04:57:48.469Z",
418
- "f": 4,
419
- "prs": [
420
- {
421
- "n": 1457,
422
- "t": "Create-pmos picks the code profile itself; OKR template the board resolves",
423
- "s": "Create-pmos picks the code profile itself; OKR template the board resolves",
424
- "k": "new"
425
- }
426
- ]
427
427
  }
428
428
  ]
429
429
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@a24ad5a5
1
+ kernel-source: pmos@0e61a622
2
2
  assembled: 2026-11-22
3
3
  mode: vendor
@@ -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-22T13:35:31Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T14:19:04Z"}
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-22T13:35:31Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T14:19:04Z"}
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-22T13:35:31Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T14:19:04Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,17 @@
1
1
  [
2
+ {
3
+ "v": "0.711.0",
4
+ "at": "2026-11-22T14:19:07.603Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1543,
9
+ "t": "Phone Today opens first, Ask PMOS by work, and Work on the phone (job #1540)",
10
+ "s": "Phone Today opens first, Ask PMOS by work, and Work on the phone (job #1540)",
11
+ "k": "new"
12
+ }
13
+ ]
14
+ },
2
15
  {
3
16
  "v": "0.710.0",
4
17
  "at": "2026-11-22T13:35:34.451Z",
@@ -137,7 +137,7 @@ const STEPS = [{ text: 'Calendar', state: 'done' }, { text: 'Mail', state: 'done
137
137
  ask: { question: 'Edit?', options: OPTS }, change: { system: 'File', what: 'planning/prd/a-rather-long-folder-name/descope-feature-parity-review-draft.md', from: 'SSO: in scope', to: 'SSO: out of scope', tool: 'Edit' } };
138
138
  await card(page, 'file');
139
139
  await shot(page, 'ask-file-390-' + scheme);
140
- ok(`A7 ${scheme}: on a phone the card and its icons stay inside the width`, await page.evaluate(() => { const w = innerWidth; const c = document.querySelector('#hmLog .hm-askk'); const r = c.getBoundingClientRect(); return r.left >= 0 && r.right <= w + 1 && [...c.querySelectorAll('.acts > button')].every((b) => { const q = b.getBoundingClientRect(); return q.right <= w + 1 && q.height >= 36; }) && document.documentElement.scrollWidth <= w; }));
140
+ ok(`A7 ${scheme}: on a phone the card stays inside the width; a swipe card answers by swipe with its hint shown (job 1540), others keep 36px icons`, await page.evaluate(() => { const w = innerWidth; const c = document.querySelector('#hmLog .hm-askk'); const r = c.getBoundingClientRect(); return r.left >= 0 && r.right <= w + 1 && (c.hasAttribute('data-sw-right') ? !!c.querySelector('[data-sw-yes]') && !!c.querySelector('[data-sw-no]') && c.querySelector('.hm-swh').getBoundingClientRect().height > 0 : [...c.querySelectorAll('.acts > button')].every((b) => { const q = b.getBoundingClientRect(); return q.right <= w + 1 && q.height >= 36; })) && document.documentElement.scrollWidth <= w; }));
141
141
  ok(`A7 ${scheme}: the primary icon reads against the card`, await page.evaluate(() => { const b = document.querySelector('#hmLog .hm-askk .hm-icb.pri'); const cs = getComputedStyle(b); return cs.backgroundColor !== cs.color; }));
142
142
  ok(`A7 ${scheme}: no page errors`, errors.length === 0, errors.join(' | '));
143
143
  await ctx.close();
@@ -7,7 +7,7 @@ timestamp: 2026-11-22
7
7
 
8
8
  # Layout and first run
9
9
 
10
- PMOS has four places: **Today**, **Work**, **Goals** and **Events**. PMOS opens on Today. Until each place gets its new page, Work is the Board and Goals is Intelligence. Home is still there for the links that open it, and a phone uses Home as Today. **Library** and **Routine** join the navigation when their pages ship. The console and its three columns were removed; their old addresses open Today.
10
+ PMOS has four places: **Today**, **Work**, **Goals** and **Events**. PMOS opens on Today. Until each place gets its new page, Work is the Board and Goals is Intelligence. Home is still there for the links that open it, and a phone opens on Today too. **Library** and **Routine** join the navigation when their pages ship. The console and its three columns were removed; their old addresses open Today.
11
11
 
12
12
  ## The design system
13
13
 
@@ -82,7 +82,7 @@ The agenda lists the day's events in time order, each with its start time, and a
82
82
 
83
83
  Under the agenda, after a meeting PMOS recorded and filed in the last 3 hours, a card says what came of it and where PMOS filed it. ✓ keeps it there and the card goes. ✕ takes the recording out of that work, with Undo.
84
84
 
85
- On a phone, Today is one page with no boxes: the overview, the next event with **Record**, and the log. Swipe a row to the right to do or accept it, and to the left to drop it or put it off. Each swipe has **Undo**.
85
+ On a phone, PMOS opens on Today. It is one page with no boxes: **Where it stands**, the next event with **Record**, the log, and the box to log a line at the bottom. Swipe a row to the right to do or accept it, and to the left to drop it or put it off. Each swipe has **Undo**.
86
86
 
87
87
  ## Work
88
88
 
@@ -271,10 +271,10 @@ A key that you type in a field, or in a terminal, goes to the field or the termi
271
271
  A phone has its own layout. It is not the computer's page made smaller. There is no bottom bar and no round button.
272
272
 
273
273
  - **⋯** is at the top right of every screen. It opens **Waiting on you** with a count (only when something waits), **Live now** (only while something runs), **Today**, **Work**, **Ask PMOS** and **Settings**. A blue dot on ⋯ means that something waits on you. When an item is open, its own menu items are at the top of the same menu.
274
- - **Today** is the log for today. Swipe a row to the right to do, accept or send it, and to the left to drop it or put it off. Each swipe shows **Undo**. A row has no ✓ or ✕ and rests flat. After a recording, the first line says where PMOS filed it, with **Undo**.
275
- - **Work** is the list of initiatives: the product, search and filter, **Initiatives** and **Backlog**, and the groups At risk or late, On track and No signal. A Project also shows its end date.
276
- - **An initiative** shows what the popup on a computer shows, in one column: the stage and its days over, the gate, ✦ Overview, where it stands, the Work breakdown with a dot per stage (grey done, blue in progress, an empty ring to do), the Backlog line, Artefacts and **N documents**. Swipe a ✦ line to the right to say yes and to the left to say no. The box at the bottom asks PMOS about this work.
277
- - **Ask PMOS** lists your chats grouped by the work they are about. "Not in a work yet" is last. A blue dot marks a chat that waits for you. Write in the box at the bottom to start a new chat.
274
+ - **Today** opens first. **Where it stands** says what leads today and why, and which dates are late. Under it is at most one ✦ proposal. Press it to read what changes and why, then press ✓ or ✕. The log has the **All** filter: Reply, Do, Decide or Send. A row has two lines: the title, then the job, the work and how late it is. A dot is before each row: red when it is late, blue for today, grey for Can wait. When PMOS has a fix for a row, the fix is under it with ✦. Swipe a row to the right to do, accept or send it, and to the left to drop it or put it off. Each swipe shows **Undo**. **Can wait** is one folded line. The box at the bottom logs a task, an event or a note; where the browser can listen, the microphone writes what you say into the box. After a recording, the first line says where PMOS filed it, with **Undo**.
275
+ - **Work** is the list of initiatives: the product, search and filter, **Initiatives** and **Backlog**, a short **Where it stands**, and the groups At risk or late, On track and No signal. A row shows its stage, its next milestone and how many milestones are late. A Project also shows its end date.
276
+ - **An initiative** opens full screen: **Where it stands** with one ✦ proposal and the next 3 dates, the **Stages** as one strip with the stage now marked, the **Work breakdown** of the stage now (a red dot when late, blue in progress, an empty ring to do, a tick when done, the Jira key, subtasks under their task), one line that opens the other stages, **The case**, and **Artefacts**. There is no timeline on a phone. Swipe a ✦ line to the right to say yes and to the left to say no; press it to read why. A task, a milestone or an artefact opens full screen with ← back to the initiative. The box at the bottom asks PMOS about this work.
277
+ - **Ask PMOS** lists your chats grouped by the work they are about, with its product. "Not in a work yet" is last. A blue dot after the time marks a chat that waits for you. Write in the box at the bottom to start a new chat. In a chat, when PMOS asks before it changes or sends something, the ask is a blue-lined line: swipe it to the right to allow it, and to the left to say no.
278
278
  - **Settings** has the theme (Light, Dark or Auto) and the version with **Check update**. Connectors, workspaces and updates are on your computer.
279
279
  - **Recording** shows the red dot, the time, the meeting's name and a small red stop at the top. Under it: the shared screen cut to the slide, with the slides (only while a screen is shared); **So far**, newest first, each point with its time; and **PMOS proposes**, the line to tell the call. Swipe it to the right to copy it, and to the left to put it away. When you stop, Today opens.
280
280
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.710.0",
3
+ "version": "0.711.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.710.0",
9
+ "version": "0.711.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.710.0",
3
+ "version": "0.711.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -109,7 +109,7 @@ export function sugHtml(s, data = '', at = 'data-wksug') {
109
109
  }
110
110
  /** The Where it stands block: the sentences, then one Suggestion. Nothing to say and nothing suggested: no block. */
111
111
  export function standsHtml(rows, o = {}) {
112
- const now = o.now || new Date(), S = standsOf(rows, now);
112
+ const now = o.now || new Date(), S = standsOf(rows, now).slice(0, o.max || Infinity); // o.max: a phone says it short (PhoneWorkDS)
113
113
  const pk = o.sug === false ? null : pickProp(rows, now), sug = pk ? sugHtml(sugOf(pk.r, pk.p, now), `data-ini="${esc(pk.r.id)}" data-key="${esc(pk.r.key)}" data-pid="${esc(pk.p.id)}" data-sig="${esc(pk.p.sig || '')}"`) : '';
114
114
  if (!S.length && !sug) return '';
115
115
  return `<section class="pm-block wk-stands" aria-label="Where it stands"><h2 class="pm-h-sm pm-row">${SV(I.star).replace('pm-ic', 'pm-ic pm-star')}Where it stands</h2>`
@@ -269,7 +269,15 @@ function phoneRow(r) {
269
269
  // a Project (Ph2 checks across kinds): the end date leads the late words, "ends 4 Dec"
270
270
  const em = WK.kindOf(r.kind) === 'project' && /^\d{4}-\d{2}-\d{2}/.test(String(r.end || '')) ? String(r.end).slice(0, 10).split('-') : null;
271
271
  const ends = em ? 'ends ' + (+em[2]) + ' ' + ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][+em[1] - 1] : '';
272
- const sub = [st ? esc(st) : '', ends, say ? `<em class="${t.you ? 'you' : esc(s.tone)}">${esc(say)}</em>` : '', r.owner ? esc(r.owner) : ''].filter(Boolean).join(' · ');
272
+ // PhoneWorkDS (job #1540): the next milestone and how many are late, "Plan · go or kill 25 Nov · 2 late"
273
+ const ms = (r.milestones || []).filter((m) => m && !m.done && /^\d{4}-\d{2}-\d{2}/.test(String(m.date || ''))).sort((a, b) => (a.date < b.date ? -1 : 1));
274
+ const td = new Date(), today = td.getFullYear() + '-' + String(td.getMonth() + 1).padStart(2, '0') + '-' + String(td.getDate()).padStart(2, '0');
275
+ const ahead = ms.find((m) => m.date.slice(0, 10) >= today), nLate = ms.filter((m) => m.date.slice(0, 10) < today).length;
276
+ const dmy = (iso) => { const p = iso.slice(0, 10).split('-'); return (+p[2]) + ' ' + ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][+p[1] - 1]; };
277
+ const nx = ahead ? esc(ahead.name || 'Next milestone') + ' ' + dmy(ahead.date) : '';
278
+ const lt = nLate ? `<em class="late">${nLate} late</em>` : '';
279
+ const stIc = st ? '<svg class="bd-stic" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01"/></svg>' : '';
280
+ const sub = [st ? stIc + esc(st) : '', ends, nx, lt, say ? `<em class="${t.you ? 'you' : esc(s.tone)}">${esc(say)}</em>` : '', r.owner ? esc(r.owner) : ''].filter(Boolean).join(' · ');
273
281
  return `<button type="button" class="bd-lrow ini2${A.sel && A.sel() === r.key ? ' sel' : ''}" data-key="${esc(r.key)}" aria-haspopup="dialog"><i class="cz-dot ${s.tone} ${s.mo || ''}"></i><span class="tx"><span class="t">${nameHtml(r)}</span><span class="s q">${sub}</span></span>${t.you && t.days != null ? `<span class="r">${t.days}d</span>` : ''}${many() ? WF.wfIcon(WF.wfOf(r), 18) : ''}</button>`;
274
282
  }
275
283
  export function phoneListHtml(L) {
@@ -168,3 +168,18 @@ body.bd-page.bk-on [id="bkBody"] { display: flex; flex-direction: column; gap: v
168
168
  /* This sprint: a picked row (the bulk move, initiative work-subtasks, WorkBulkDS) */
169
169
  .wk-spx tr.wk-sr.sel td { background: var(--blue-tint); }
170
170
  .wk-spx tr.wk-sr.sel td:first-child { box-shadow: inset 2px 0 0 var(--blue); }
171
+
172
+ /* PhoneWorkDS (job 1540): Work on a phone. Where it stands said short over the list, the groups as small labels, each row's meta with its
173
+ stage icon and the late count in the alert colour. Tokens only. */
174
+ @media (max-width: 760px) {
175
+ #ibBody > .wk-stands { margin: var(--space-8) 0 var(--space-4); padding: 0 0 var(--space-12); background: none; box-shadow: none; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); }
176
+ #ibBody > .wk-stands h2 { font-size: var(--fs-label); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
177
+ #ibBody > .wk-stands .wk-say a { color: var(--ink); text-decoration: none; font-weight: var(--fw-strong); }
178
+ .bd-plist .bd-ghd { padding: var(--space-16) 0 var(--space-4); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
179
+ .bd-plist .bd-ghd .n { margin-left: var(--space-4); }
180
+ .bd-plist .bd-ghd .n::before { content: '· '; }
181
+ .bd-plist .bd-lrow { padding-left: 0; padding-right: 0; border-radius: 0; border-bottom: 1px solid var(--line); }
182
+ .bd-plist .bd-lrow .s { color: var(--muted); }
183
+ .bd-plist .bd-lrow .s em.late { font-style: normal; color: var(--alert); }
184
+ .bd-stic { vertical-align: -1px; margin-right: var(--space-4); }
185
+ }
@@ -269,6 +269,16 @@ body.cz-home { min-height: 100vh; overflow: hidden; }
269
269
  .hm-askk .ft { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--fs-body); line-height: var(--lh-body); }
270
270
  .hm-askk .ft b { font-weight: var(--fw-strong); }
271
271
  .hm-askk s { color: var(--cz-ink3); }
272
+ /* PhoneTodayDS (job 1540): on a phone a live Allow · No ask is a blue-lined line that swipes; its icon answers stay for the keyboard */
273
+ .hm-swh { display: none; }
274
+ @media (max-width: 760px) {
275
+ .hm-askk[data-sw-right] { background: none; box-shadow: inset 2px 0 0 var(--cz-blue); border-radius: 0; padding: var(--space-4) 0 var(--space-4) var(--space-16); touch-action: pan-y; }
276
+ .hm-askk[data-sw-right] .q { color: var(--cz-blueink); }
277
+ .hm-askk[data-sw-right] .hm-swh { display: block; margin: 0; font-size: var(--fs-meta); color: var(--cz-ink3); line-height: var(--lh-meta); }
278
+ .hm-askk[data-sw-right] .acts > .hm-icb[data-sw-yes], .hm-askk[data-sw-right] .acts > .hm-icb[data-sw-no] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
279
+ .hm-askk.sw-r { box-shadow: inset 4px 0 0 var(--cz-dot-ok); }
280
+ .hm-askk.sw-l { box-shadow: inset 4px 0 0 var(--cz-dot-q); }
281
+ }
272
282
  .hm-askk .acts, .hm-fix { display: flex; align-items: center; gap: var(--space-8); margin-top: 6px; }
273
283
  .hm-fix { padding-left: 38px; margin-top: 0; }
274
284
  .hm-icb { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--cz-hair); background: var(--cz-card); color: var(--cz-ink2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
@@ -998,17 +1008,15 @@ form.hm-box textarea { min-height: 48px; border: 0; background: none; resize: no
998
1008
  .pa-top h1 { font-size: var(--fs-display); font-weight: var(--fw-strong); line-height: 1.25; }
999
1009
  .pa-none { margin: var(--space-12) 0; font-size: var(--fs-body); color: var(--cz-ink3); line-height: var(--lh-body); }
1000
1010
  .pa-g { padding-top: var(--space-16); }
1001
- .pa-g h2 { display: flex; align-items: center; gap: 10px; padding: var(--space-4) 0 6px; font-size: var(--fs-body); font-weight: var(--fw-strong); line-height: var(--lh-body); color: var(--cz-ink); }
1002
- .pa-gi { flex: none; width: 24px; height: 24px; border-radius: var(--radius-sm, 7px); display: inline-grid; place-items: center; background: var(--cz-bluebg); color: var(--cz-blue); }
1003
- .pa-gi.loose { background: var(--cz-well); color: var(--cz-ink3); }
1004
- .pa-gt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
1005
- .pa-g h2 em { font-style: normal; font-weight: var(--fw-regular); color: var(--cz-ink3); font-size: var(--fs-meta); }
1006
- .pa-r { all: unset; box-sizing: border-box; position: relative; width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 10px 0 10px 18px; border-bottom: 1px solid var(--cz-hair); cursor: pointer; }
1011
+ .pa-g h2 { display: flex; align-items: baseline; gap: 6px; padding: var(--space-4) 0 6px; font-size: var(--fs-label); font-weight: var(--fw-strong); letter-spacing: .08em; text-transform: uppercase; line-height: var(--lh-label); color: var(--cz-ink2); }
1012
+ .pa-gt { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
1013
+ .pa-g h2 em { flex: none; font-style: normal; color: var(--cz-ink3); }
1014
+ .pa-r { all: unset; box-sizing: border-box; position: relative; width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: var(--space-12) 0; border-bottom: 1px solid var(--cz-hair); cursor: pointer; }
1007
1015
  .pa-r:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
1008
- .pa-d { position: absolute; left: 0; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--cz-blue); }
1016
+ .pa-d { flex: none; width: var(--space-8); height: var(--space-8); margin-top: 7px; border-radius: var(--radius-pill); background: var(--cz-blue); } /* PhoneTodayDS: the dot after the time */
1009
1017
  .pa-x { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
1010
1018
  .pa-x b { font-size: var(--fs-row); font-weight: var(--fw-strong); line-height: var(--lh-row); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
1011
- .pa-x small { font-size: var(--fs-meta); color: var(--cz-ink3); line-height: var(--lh-meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
1019
+ .pa-x small { font-size: var(--fs-meta); color: var(--cz-ink3); line-height: var(--lh-meta); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
1012
1020
  .pa-r time { flex: none; font-size: var(--fs-meta); color: var(--cz-ink3); line-height: var(--lh-row); }
1013
1021
  .pa-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: var(--space-8) var(--space-16) calc(var(--space-12) + env(safe-area-inset-bottom, 0px)); background: var(--cz-card); }
1014
1022
  .pa-new { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 6px 0 14px; border-radius: var(--radius-pill, 999px); background: var(--cz-well); color: var(--cz-ink3); cursor: text; }
@@ -35,7 +35,7 @@
35
35
  * and no bottom bar. The same button (#czFab) is a ⋯ at the top right of every page, with one small blue dot while something waits on you
36
36
  * (zero is silence). It opens phoneMenuHtml(): "Waiting on you N" (the lines for today plus the chats that wait for you; it opens Today,
37
37
  * or Ask PMOS when only chats wait), "Live now N" while sessions run, then Today, Work, Ask PMOS and Settings. Goals, Events, Library and
38
- * Routine are not in the phone menu for now (their pages still open from a link). Ask PMOS on a phone is Home's page (premium.html?chats=1), which
38
+ * Routine are not in the phone menu for now (their pages still open from a link). Ask PMOS on a phone is Today's page with ?chats=1 (today.html?chats=1; Home is gone, job #1540), which
39
39
  * lists the chats by work (pm/phone-ask.js). The page's own ⋯ (the phone chat) opens the same menu; its own rows are not added on a phone.
40
40
  */
41
41
  import { esc, svg, ICON, wsQ } from './cozy-evui.js';
@@ -65,18 +65,19 @@ const ALL_PLACES = [
65
65
  ];
66
66
  export const PLACES = ALL_PLACES.filter((p) => p.href);
67
67
  /* The phone's places (Ph2_menu): Today, Work, Ask PMOS; Settings is the last row. 'ask' is Home's page (premium.html) on a phone. */
68
+ const ASK_D = 'M4 5h16v11H9l-5 4z'; // PhoneTodayDS: Ask PMOS is the chat bubble, ✦ is Waiting on you
68
69
  const SPARK = 'M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z';
69
70
  const GEAR = 'M12 9a3 3 0 1 0 0 6a3 3 0 1 0 0-6M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z';
70
71
  export const PHONE_PLACES = [
71
72
  { key: 'home', label: 'Today', href: '/today.html', d: RAIL_ICON.today },
72
73
  { key: 'board', label: 'Work', href: '/premium-board.html', d: RAIL_ICON.work },
73
- { key: 'ask', label: 'Ask PMOS', href: '/premium.html?chats=1', d: SPARK }, // ?chats: a bare /premium.html opens Today (server.js)
74
+ { key: 'ask', label: 'Ask PMOS', href: '/today.html?chats=1', d: ASK_D }, // ?chats: Today's page draws the chats by work (home-app.js drawAsk)
74
75
  ];
75
76
  const PHONE_Q = '(max-width: 760px)';
76
77
  /** A phone: the ⋯ at the top right and the phone menu. */
77
78
  export const phoneOn = () => typeof matchMedia === 'function' && matchMedia(PHONE_Q).matches;
78
79
  /** The place a phone page is: Home's page is Ask PMOS there, Today's page (body[data-today]) is Today. */
79
- export const phoneHere = (here, doc = typeof document !== 'undefined' ? document : null) => (here === 'home' && doc && doc.body && !doc.body.hasAttribute('data-today') ? 'ask' : here);
80
+ export const phoneHere = (here, doc = typeof document !== 'undefined' ? document : null) => (here === 'home' && doc && doc.body && (!doc.body.hasAttribute('data-today') || /[?&]chats=/.test((doc.location && doc.location.search) || '')) ? 'ask' : here);
80
81
  const DESK = '(min-width: 761px)';
81
82
  /** The rail is drawn on a desktop; a phone keeps the floating button. */
82
83
  export const railOn = () => typeof matchMedia === 'function' && matchMedia(DESK).matches;
@@ -131,7 +132,7 @@ export function menuHtml(here, o = {}) {
131
132
  export function phoneMenuHtml(here, o = {}) {
132
133
  const wait = (o.calls > 0 ? o.calls : 0) + (o.waiting > 0 ? o.waiting : 0), live = o.live > 0 ? o.live : 0;
133
134
  const n = (v) => `<span class="ev-k">${esc(v > 99 ? '99+' : v)}</span>`;
134
- const top = (wait ? `<button type="button" class="ev-mi ev-x" data-cz-wait aria-label="${esc('Waiting on you: ' + wait)}">${svg(ICON.chat, 18)}<span>Waiting on you</span>${n(wait)}<i class="ev-md you" aria-hidden="true"></i></button>` : '')
135
+ const top = (wait ? `<button type="button" class="ev-mi ev-x" data-cz-wait aria-label="${esc('Waiting on you: ' + wait)}">${svg(SPARK, 18)}<span>Waiting on you</span>${n(wait)}<i class="ev-md you" aria-hidden="true"></i></button>` : '')
135
136
  + (live ? `<button type="button" class="ev-mi ev-x" data-cz-live aria-label="${esc('Live now: ' + live)}">${svg('M12 9a3 3 0 1 0 0 6a3 3 0 1 0 0-6M6 6a8.5 8.5 0 0 0 0 12M18 6a8.5 8.5 0 0 1 0 12', 18)}<span>Live now</span>${n(live)}</button>` : '');
136
137
  // the shown item's own ⋯ rows lead the menu (cozy-viewer.js phoneMoreRows): the page has one ⋯
137
138
  const own = (o.extra || []).map((x, i) => `<button type="button" class="ev-mi${x.danger ? ' bad' : ''}" data-cz-extra="${i}"><span>${esc(x.label)}</span></button>`).join('');
@@ -275,7 +276,7 @@ export function mountNav(here, doc = document, opts = {}) {
275
276
  if ('czWait' in b.dataset) {
276
277
  const to = N.calls > 0 ? 'home' : 'ask', cur = phoneHere(here, doc);
277
278
  if (to === cur) { if (opts.here) opts.here(); else scrollTo(0, 0); return; }
278
- location.assign(to === 'home' ? '/today.html' + wsQ() : '/premium.html?chats=1' + wsQ('&'));
279
+ location.assign(to === 'home' ? '/today.html' + wsQ() : '/today.html?chats=1' + wsQ('&'));
279
280
  return;
280
281
  }
281
282
  if ('czLive' in b.dataset) { doc.dispatchEvent(new CustomEvent('cz:live-open')); return; }
@@ -285,6 +285,50 @@ button.pw-fv .grey { color: var(--cz-ink3); }
285
285
  .pw-pask input::placeholder { color: var(--cz-ink3); }
286
286
  .pw-pask button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--cz-solid); color: var(--cz-onsolid); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
287
287
  .pw-pask:focus-within { box-shadow: 0 0 0 2px var(--cz-blue); }
288
+ /* PhoneWorkDS (job 1540): Where it stands with the next 3 dates, the Stages strip, the stage now's tasks (dot, tick, Jira chip, nested),
289
+ the other stages' fold line, the case and the Artefacts. Tokens only. */
290
+ .pw-ph > .pw-pov:first-child { margin-top: var(--space-4); border-top: 0; padding-top: var(--space-8); }
291
+ .pw-pov > p { margin: 0 0 6px; font-size: var(--fs-body); line-height: var(--lh-body); }
292
+ .pw-pwhy { color: var(--cz-ink3); }
293
+ .pw-pnext { list-style: none; margin: var(--space-8) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); }
294
+ .pw-pnext li { display: flex; align-items: baseline; gap: var(--space-12); }
295
+ .pw-pnd { flex: none; width: 76px; display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-meta); color: var(--cz-ink2); }
296
+ .pw-pnext .pw-tt { flex: 1; min-width: 0; text-align: left; border: 0; padding: 0; background: none; font: inherit; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--cz-ink); cursor: pointer; }
297
+ .pw-psec h4 { font-size: var(--fs-label); letter-spacing: .08em; text-transform: uppercase; padding-top: var(--space-16); border-top: 1px solid var(--cz-hair); margin-bottom: var(--space-8); }
298
+ .pw-pstrip { list-style: none; margin: 0; padding: 0; display: flex; gap: 3px; }
299
+ .pw-pstrip li { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
300
+ .pw-pstrip i { height: 6px; border-radius: var(--radius-pill); background: var(--cz-well); }
301
+ .pw-pstrip li.dn i { background: var(--leaf); }
302
+ .pw-pstrip li.now i { background: var(--cz-blue); }
303
+ .pw-pstrip b { margin-top: var(--space-4); font-size: var(--fs-meta); font-weight: var(--fw-strong); line-height: var(--lh-meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
304
+ .pw-pstrip small { font-size: var(--fs-meta); color: var(--cz-ink3); line-height: var(--lh-meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
305
+ .pw-pwbs2 { list-style: none; margin: 0; padding: 0; }
306
+ .pw-ptk2 { display: flex; align-items: flex-start; gap: var(--space-12); padding: var(--space-12) 0 var(--space-12) calc(var(--pw-d, 0) * 18px); border-bottom: 1px solid var(--cz-hair); }
307
+ .pw-ptk2 .pw-tt, .pw-ptk2 .pw-dn { text-align: left; border: 0; padding: 0; background: none; font: inherit; font-size: var(--fs-row); font-weight: var(--fw-strong); line-height: var(--lh-row); color: var(--cz-ink); cursor: pointer; overflow-wrap: anywhere; }
308
+ .pw-ptk2 .pw-dn { font-weight: var(--fw-regular); color: var(--cz-ink3); }
309
+ .pw-ptk2.done .pw-tt { color: var(--cz-ink3); font-weight: var(--fw-regular); }
310
+ .pw-ptx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
311
+ .pw-pm { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--cz-ink3); }
312
+ .pw-pm i { font-style: normal; }
313
+ .pw-pm em { font-style: normal; color: var(--alert); }
314
+ .pw-pkey { margin-left: var(--space-4); font-family: var(--cz-mono, monospace); }
315
+ .pw-pdot2 { flex: none; width: var(--space-8); height: var(--space-8); margin: 7px 3px 0; border-radius: var(--radius-pill); box-sizing: border-box; }
316
+ .pw-pdot2.late { background: var(--alert); }
317
+ .pw-pdot2.now { background: var(--cz-blue); }
318
+ .pw-pdot2.todo { border: 1.5px solid var(--cz-ink3); }
319
+ .pw-ptick { flex: none; width: 14px; margin-top: 3px; color: var(--cz-ink3); }
320
+ .pw-pfold { width: 100%; display: flex; align-items: center; gap: var(--space-8); min-height: 48px; border: 0; border-bottom: 1px dashed var(--cz-hair); padding: 0; background: none; font: inherit; font-size: var(--fs-meta); color: var(--cz-ink3); text-align: left; cursor: pointer; }
321
+ .pw-pfold b { color: var(--cz-ink); font-weight: var(--fw-strong); }
322
+ .pw-pcase { display: grid; grid-template-columns: 96px 1fr; gap: var(--space-8) var(--space-12); margin: 0; font-size: var(--fs-body); line-height: var(--lh-body); }
323
+ .pw-pcase dt { color: var(--cz-ink3); }
324
+ .pw-pcase dd { margin: 0; min-width: 0; }
325
+ .pw-parts2 { list-style: none; margin: 0; padding: 0; }
326
+ .pw-an2 { width: 100%; display: flex; align-items: flex-start; gap: var(--space-12); padding: var(--space-12) 0; border: 0; border-bottom: 1px solid var(--cz-hair); background: none; font: inherit; color: var(--cz-ink); text-align: left; cursor: pointer; }
327
+ .pw-an2 svg { flex: none; margin-top: 3px; color: var(--cz-ink2); }
328
+ .pw-an2 span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
329
+ .pw-an2 b { font-size: var(--fs-row); font-weight: var(--fw-strong); line-height: var(--lh-row); }
330
+ .pw-an2 small { font-size: var(--fs-meta); color: var(--cz-ink3); line-height: var(--lh-meta); }
331
+ .pw-ph :focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
288
332
  @media (max-width: 760px) {
289
333
  /* the item's header on a phone: back and the title; the page's ⋯ (cozy-nav.js) holds the item's own ⋯ items */
290
334
  .cz-vw:has(.pw-ph) .cz-vw-hd .cz-vw-tile, .cz-vw:has(.pw-ph) .cz-vw-hd .cz-vw-kind, .cz-vw:has(.pw-ph) .cz-vw-hd [data-cz-vw="discuss"], .cz-vw:has(.pw-ph) .cz-vw-hd [data-cz-vw-p="kind"] { display: none; }
@@ -361,50 +361,95 @@ function jiraUrlOf(rows, key) {
361
361
  const r = (rows || []).find((x) => x && x.jurl && /\/browse\//.test(x.jurl));
362
362
  return r ? r.jurl.replace(/\/browse\/[^/?#]+/, '/browse/' + key) : '';
363
363
  }
364
- /* ── a phone (board Ph2_init; build brief nav-structure/phone/build-brief-v2.md item 8): the popup's content in a phone layout. No cards and
365
- * no table: the stage and its days over, the gate line, ✦ Overview with the lines that are written and one proposal for the ones that are not,
366
- * the status line and PMOS's proposals, the Work breakdown as rows with a status dot (grey done, blue in progress, an empty ring to do), the
367
- * Backlog line, Artefacts with the merge proposal and "N documents", and the box "Ask PMOS about this work". A proposal is swiped: right
368
- * says yes, left says no (pm/cozy-phone-swipe.js); its press opens it, as in the popup. The presses are the popup's own data-pw-* ones. */
369
- const PH_ARTS = new Set(); // initiatives whose documents are unfolded on the phone, per page
364
+ /* ── a phone (PhoneWorkDS on Exploring 3, page "phone"; agreed 2026-11-22, job #1540; was Ph2_init): the initiative full screen. No cards,
365
+ * no table, no Gantt: Where it stands (PMOS's words, at most one ✦ proposal and the next 3 dates), the Stages as a strip with the one now
366
+ * marked, the Work breakdown of the stage now (a dot: late in the alert colour, in progress blue, to do a ring; done muted with a tick; a
367
+ * Jira key chip; subtasks nested), the other stages folded to one line that opens them, then the case and the Artefacts. A proposal is
368
+ * swiped: right says yes, left says no (pm/cozy-phone-swipe.js); its press opens it as its own page (why, what changes). A task, a milestone
369
+ * or an artefact opens full screen with Back. The presses are the popup's own data-pw-* ones. */
370
+ const PH_ARTS = new Set(); // initiatives whose documents are unfolded on the phone, per page (kept for the older press)
371
+ const PH_ALL = new Set(); // initiatives whose other stages are unfolded on the phone, per page
370
372
  const phSug = (id, say, keep, drop, open) => `<div class="pw-psug" role="listitem" data-sw-right="yes" data-sw-left="no">${SVG(P.spark, 13, 2)}`
371
- + (open ? `<button type="button" class="pw-psay" ${open}>${esc(say)}</button>` : `<span class="pw-psay">${esc(say)}</span>`)
373
+ + (open ? `<button type="button" class="pw-psay" ${open}>${esc(say)}<span class="pw-pwhy"> · why</span></button>` : `<span class="pw-psay">${esc(say)}</span>`)
372
374
  + `<span class="pw-psb" hidden><button type="button" data-sw-yes ${keep} tabindex="-1">Yes</button><button type="button" data-sw-no ${drop} tabindex="-1">No</button></span></div>`;
375
+ const ART_IC = { slides: 'M4 5h16v11H4zM12 16v4M8 20h8', deck: 'M4 5h16v11H4zM12 16v4M8 20h8', prototype: 'M4 5h16v11H4zM12 16v4M8 20h8', design: 'M4 5h16v11H4zM12 16v4M8 20h8',
376
+ doc: 'M7 3.5h7l4 4V20.5H7zM14 3.5v4h4M10 12h5M10 16h5' };
377
+ const artIc = (a) => { const k = String(a.kindName || a.kind || '').toLowerCase(); return ART_IC[Object.keys(ART_IC).find((x) => k.indexOf(x) >= 0) || 'doc']; };
378
+ /** The phone's parts of an initiative, pure (pop-work.test.js and phone-today-work.test.js read it): the next 3 dates, the strip, the stage now
379
+ * and its tasks, and the stages that fold. W: model().W. → { next: [{ uid, title, date, done, late }], strip: [{ name, tone, date }],
380
+ * now: stage row | null, tasks: [task rows of the stage now], others: [{ key, name, n }] } */
381
+ export function phoneParts(W) {
382
+ const rows = (W && W.rows) || [], stages = rows.filter((x) => x.kind === 'stage' && !x.loose);
383
+ const marks = stages.flatMap((x) => x.marks || []).concat(rows.filter((x) => x.kind === 'task' && x.ms).map((x) => ({ uid: x.uid, title: x.title, end: x.end, done: x.done, late: x.late })));
384
+ const seen = new Set(), ms = marks.filter((m) => m && m.end && !seen.has(String(m.uid)) && seen.add(String(m.uid))).sort((a, b) => (a.end < b.end ? -1 : a.end > b.end ? 1 : 0));
385
+ const next = ms.filter((m) => !m.done).slice(0, 3).map((m) => ({ uid: m.uid, title: m.title, date: M.dayText(m.end, W.today), done: false, late: !!m.late }));
386
+ const strip = stages.map((x) => ({ key: x.key, name: x.name, tone: x.done || x.tone === 'dn' ? 'dn' : x.now ? 'now' : '', date: x.now ? (x.date ? 'now · ' + x.date : 'now') : x.start && x.end ? M.dayText(x.start, W.today) + (x.end !== x.start ? ' to ' + M.dayText(x.end, W.today) : '') : '' }));
387
+ const now = stages.find((x) => x.now) || stages.find((x) => !x.done) || null;
388
+ const tasks = [];
389
+ let cur = null;
390
+ for (const x of rows) {
391
+ if (x.kind === 'stage') { cur = x; continue; }
392
+ if (x.kind === 'far') { cur = null; continue; }
393
+ if (cur && now && cur.key === now.key && (x.kind === 'task' || x.kind === 'more')) tasks.push(x);
394
+ }
395
+ const others = stages.filter((x) => (!now || x.key !== now.key) && x.can).map((x) => ({ key: x.key, name: x.name, n: (x.count || '').replace(/^\d+ of /, '') }));
396
+ const far = rows.find((x) => x.kind === 'far');
397
+ if (far) others.push({ key: '', name: far.name, n: (far.tasks || 0) + ((far.tasks || 0) === 1 ? ' task' : ' tasks'), far: true });
398
+ return { next, strip, now, tasks, others };
399
+ }
400
+ function phTask(x) {
401
+ if (x.kind === 'more') return `<li class="pw-ptk2 more"><button type="button" class="pw-dn" data-pw-more="${esc(x.key)}" aria-expanded="false">${esc(x.label)}</button></li>`;
402
+ const tone = x.done ? 'dn' : x.late ? 'late' : x.prog ? 'now' : 'todo';
403
+ const lab = x.done ? 'Done' : x.late ? 'Late' : x.prog ? 'In progress' : 'To do';
404
+ const mark = x.done ? `<span class="pw-ptick" role="img" aria-label="Done">${SVG(P.check, 14, 2)}</span>` : `<i class="pw-pdot2 ${tone}" role="img" aria-label="${lab}"></i>`;
405
+ const meta = [x.ms ? `${SVG(P.dia, 12)}<span>Milestone</span>` : `${SVG(P.box, 12)}`, x.who ? esc(x.who) : '', x.date ? (x.late ? `<em>${esc(x.date)}</em>` : esc(x.date)) : '', x.done ? 'done' : '']
406
+ .filter(Boolean).join('<i aria-hidden="true">·</i>').replace(/^(<svg[^]*?<\/svg>)<i aria-hidden="true">·<\/i>/, '$1');
407
+ const chip = x.ckey ? `<span class="pm-chip pw-pkey">${esc(x.ckey)}</span>` : '';
408
+ return `<li class="pw-ptk2${x.done ? ' done' : ''}"${x.depth ? ` style="--pw-d:${Math.min(x.depth, 3)}"` : ''}>${mark}<div class="pw-ptx"><button type="button" class="pw-tt" data-pw-open="${esc(x.uid)}">${esc(x.title)}</button><small class="pw-pm">${meta}${chip}</small></div></li>`;
409
+ }
373
410
  function phoneHtml(W, S, oid, v) {
374
- const st = (v && v.stage) || {}, d = st.dates || {}, dr = dropped();
375
- const head = st.name ? `<div class="pw-phd">${st.n ? `<span class="pw-pn">${esc(st.n)}</span>` : ''}<b>${esc(st.name)}</b>${d.left ? `<span class="${d.over ? 'warn' : ''}">${esc(d.left)}</span>` : ''}</div>` : '';
411
+ const st = (v && v.stage) || {}, dr = dropped(), PT = phoneParts(W);
376
412
  const miss = st.gate && (st.gate.parts || []).filter((x) => !x.ok).map((x) => x.text);
377
413
  const gate = miss && miss.length ? `<p class="pw-pgate">${esc(String(st.gate.label || 'Gate'))}: <span class="warn">${esc(miss.join(' and ').replace(/^./, (c) => c.toUpperCase()))}</span></p>` : '';
378
- // the Overview: the lines that are written; the ones that are not, as one proposal ("Draft the Problem and Done when from Research notes")
414
+ // Where it stands: PMOS's words (the status line, what the gate line says is not said again), one ✦ proposal, the next 3 dates
379
415
  const ov = W.overview;
380
- const lines = ov.lines.filter((L) => L.text).map((L) => `<p class="pw-pl"><b>${esc(L.k)}</b> ${L.edit ? `<span class="pw-otx" data-pw-line="${esc(L.id)}" tabindex="0" role="button" aria-label="${esc('Change the ' + L.k.toLowerCase())}">${esc(L.text)}</span>` : esc(L.text)}${L.serves ? ' ' + esc(L.serves) : ''}</p>`).join('');
381
416
  const off = ov.lines.filter((L) => !L.text && L.ask && !dr.has('ov:' + oid + ':' + L.id));
382
417
  const from = off.length ? (/ (from .*?)\?$/.exec(off[0].miss || '') || [])[1] || 'with you' : '';
383
- const ovSug = off.length ? phSug('', 'Draft the ' + off.map((L) => L.k).join(' and ') + ' ' + from, `data-pw-lkeep="${esc(off.map((L) => L.id).join(','))}"`, `data-pw-ldrop="${esc(off.map((L) => 'ov:' + oid + ':' + L.id).join(','))}"`, `data-pw-lkeep="${esc(off.map((L) => L.id).join(','))}"`) : '';
384
- // the status line without what the head and the gate line already say (said once)
385
- const said = String(ov.status || '').split(/(?<=\.)\s+/).filter((t) => t && !/^In \S/.test(t) && !/cannot pass the gate/i.test(t)).join(' ');
386
- const sugs = W.suggests.map((s) => phSug(s.id, s.say, `data-pw-keep="${esc(s.id)}"`, `data-pw-drop="${esc(s.id)}"`, `data-pw-sug="${esc(s.id)}"`)).join('');
387
- const ovH = `<section class="pw-pov" aria-label="Overview"><h3>${SVG(P.spark, 14, 2)}Overview</h3>${lines}${ovSug ? `<div class="pw-psugs" role="list">${ovSug}</div>` : ''}</section>`
388
- + (said || sugs ? `<section class="pw-pstat" aria-label="Where it stands">${said ? `<p>${esc(said)}</p>` : ''}${sugs ? `<div class="pw-psugs" role="list">${sugs}</div>` : ''}</section>` : '');
389
- // the Work breakdown: one row per stage, the open stage's tasks under it
418
+ const said = String(ov.status || '').split(/(?<=\.)\s+/).filter((t) => t && !/cannot pass the gate/i.test(t)).join(' ');
419
+ const s0 = W.suggests[0];
420
+ const one = s0 ? phSug(s0.id, s0.say, `data-pw-keep="${esc(s0.id)}"`, `data-pw-drop="${esc(s0.id)}"`, `data-pw-sug="${esc(s0.id)}"`)
421
+ : off.length ? phSug('', 'Draft the ' + off.map((L) => L.k).join(' and ') + ' ' + from, `data-pw-lkeep="${esc(off.map((L) => L.id).join(','))}"`, `data-pw-ldrop="${esc(off.map((L) => 'ov:' + oid + ':' + L.id).join(','))}"`, `data-pw-lkeep="${esc(off.map((L) => L.id).join(','))}"`) : '';
422
+ const next = PT.next.length ? `<ul class="pw-pnext" aria-label="Next dates">${PT.next.map((m) => `<li><span class="pw-pnd">${SVG(P.dia, 13)}<time class="${m.late ? 'warn' : ''}">${esc(m.date)}</time></span><button type="button" class="pw-tt" data-pw-open="${esc(m.uid)}">${esc(m.title)}</button></li>`).join('')}</ul>` : '';
423
+ const stands = said || one || next ? `<section class="pw-pov" aria-label="Where it stands"><h3>${SVG(P.spark, 14, 2)}Where it stands</h3>${said ? `<p>${esc(said)}</p>` : ''}${one ? `<div class="pw-psugs" role="list">${one}</div>` : ''}${next}</section>` : '';
424
+ // Stages: one strip, the stage now marked
425
+ const strip = PT.strip.length ? `<section class="pw-psec" aria-label="Stages"><h4>Stages</h4><ol class="pw-pstrip">${PT.strip.map((x) => `<li class="${x.tone}"${x.tone === 'now' ? ' aria-current="step"' : ''}><i aria-hidden="true"></i><b>${esc(x.name)}</b>${x.date ? `<small>${esc(x.date)}</small>` : ''}</li>`).join('')}</ol></section>` : '';
426
+ // the Work breakdown of the stage now; the other stages fold to one line that opens them (they keep the popup's own presses)
427
+ const all = PH_ALL.has(oid);
428
+ const nowList = PT.tasks.length ? `<ul class="pw-pwbs2">${PT.tasks.map(phTask).join('')}</ul>` : '<p class="pw-pnone">No task in this stage yet.</p>';
390
429
  const dot = (x) => `<i class="pw-pdot ${x.tone === 'dn' || x.status === 'Done' ? 'dn' : x.tone === 'now' || x.status === 'In progress' ? 'now' : 'todo'}" aria-hidden="true"></i>`;
391
- const rows = W.rows.map((x) => {
392
- if (x.kind === 'stage' && x.loose) return '';
393
- if (x.kind === 'stage') return `<li class="pw-pst${x.now ? ' now' : ''}">${dot(x)}<button type="button" class="pw-pstg" data-pw-fold="${esc(x.key)}" aria-expanded="${x.open}"${x.can ? '' : ' disabled'}><span class="pw-n">${esc(x.n)}</span><b>${esc(x.name)}</b></button>${x.date ? `<span class="pw-pd${x.late ? ' warn' : ''}">${esc(x.date)}</span>` : x.can ? `<span class="pw-pd">${esc(x.count || '')}</span>` : ''}</li>`;
394
- if (x.kind === 'far') return `<li class="pw-pst">${dot({ status: 'To do' })}<button type="button" class="pw-pstg" data-pw-far aria-expanded="false"><span class="pw-n">${esc(x.n)}</span><b>${esc(x.name)}</b></button><span class="pw-pd">${esc(x.count)}</span></li>`;
395
- if (x.kind === 'more') return `<li class="pw-ptk"><button type="button" class="pw-dn" data-pw-more="${esc(x.key)}" aria-expanded="false">${esc(x.label)}</button></li>`;
396
- if (x.kind === 'task') return `<li class="pw-ptk${x.done ? ' done' : ''}"><i class="pw-bul${x.ms ? ' ms' : ''}" aria-hidden="true"></i><button type="button" class="pw-tt" data-pw-open="${esc(x.uid)}">${esc(x.title)}</button>${x.date ? `<span class="pw-pd${x.late ? ' warn' : ''}">${esc(x.date)}</span>` : ''}</li>`;
397
- return '';
398
- }).join('');
430
+ let rest = '';
431
+ if (all) {
432
+ let cur = null;
433
+ rest = W.rows.map((x) => {
434
+ if (x.kind === 'stage') { cur = x; if (x.loose || (PT.now && x.key === PT.now.key)) return ''; return `<li class="pw-pst">${dot(x)}<button type="button" class="pw-pstg" data-pw-fold="${esc(x.key)}" aria-expanded="${x.open}"${x.can ? '' : ' disabled'}><b>${esc(x.name)}</b></button><span class="pw-pd">${esc(x.date || x.count || '')}</span></li>`; }
435
+ if (x.kind === 'far') { cur = null; return `<li class="pw-pst">${dot({ status: 'To do' })}<button type="button" class="pw-pstg" data-pw-far aria-expanded="false"><b>${esc(x.name)}</b></button><span class="pw-pd">${esc(x.count)}</span></li>`; }
436
+ if (!cur || (PT.now && cur.key === PT.now.key)) return '';
437
+ return x.kind === 'task' || x.kind === 'more' ? phTask(x) : '';
438
+ }).join('');
439
+ }
440
+ const others = PT.others.length ? `<button type="button" class="pw-pfold" data-pw-phall aria-expanded="${all}"><b>${esc(PT.others.map((x) => x.name).join(', '))}</b><span>${esc(all ? 'tap to fold' : 'tap to open')}</span>${SVG(all ? P.down : P.right, 13)}</button>${all ? `<ul class="pw-pwbs2">${rest}</ul>` : ''}` : '';
399
441
  const loose = W.looseN ? `<p class="pw-loose"><button type="button" class="pw-lk" data-pw-backlog>${esc(W.looseN === 1 ? '1 task with no stage is in the Backlog' : W.looseN + ' tasks with no stage are in the Backlog')}${SVG(P.right, 13)}</button></p>` : '';
400
- const wbs = `<section class="pw-psec" aria-label="Work breakdown"><h4>Work breakdown</h4>${rows ? `<ul class="pw-pwbs">${rows}</ul>` : '<p class="pw-pnone">No task yet.</p>'}${loose}</section>`;
401
- // Artefacts: the merge proposal, then "N documents", which unfolds the list
402
- const arts = W.artefacts.filter((a) => !a.missing), mg = mergeOf(W.artefacts), open = PH_ARTS.has(oid);
403
- const list = open ? `<ul class="pw-parts">${W.artefacts.map((a, i) => (a.missing ? '' : `<li><button type="button" class="pw-an" data-pw-art="${i}">${esc(a.title)}</button><span class="pw-pd">${esc(a.kindName || a.kind || '')}</span></li>`)).join('')}</ul>` : '';
404
- const artH = arts.length || mg ? `<section class="pw-psec" aria-label="Artefacts"><h4>Artefacts</h4>${mg ? `<div class="pw-psugs" role="list">${phSug(mg.id, mg.say, `data-pw-keep="${esc(mg.id)}"`, `data-pw-drop="${esc(mg.id)}"`, `data-pw-sug="${esc(mg.id)}"`)}</div>` : ''}`
405
- + (arts.length ? `<button type="button" class="pw-lk pw-pdocs" data-pw-pdocs aria-expanded="${open}">${esc(arts.length === 1 ? '1 document' : arts.length + ' documents')}${SVG(open ? P.down : P.right, 13)}</button>${list}` : '') + '</section>' : '';
442
+ const wbs = `<section class="pw-psec" aria-label="Work breakdown"><h4>Work breakdown${PT.now ? ' · ' + esc(PT.now.name) : ''}</h4>${nowList}${others}${loose}</section>`;
443
+ // the case: the lines that are written (Problem, Solution, Expected, Check …), each changeable where the popup lets it be
444
+ const lines = ov.lines.filter((L) => L.text);
445
+ const kase = lines.length ? `<section class="pw-psec" aria-label="The case"><h4>The case</h4><dl class="pw-pcase">${lines.map((L) => `<dt>${esc(L.k)}</dt><dd>${L.edit ? `<span class="pw-otx" data-pw-line="${esc(L.id)}" tabindex="0" role="button" aria-label="${esc('Change the ' + L.k.toLowerCase())}">${esc(L.text)}</span>` : esc(L.text)}${L.serves ? ' ' + esc(L.serves) : ''}</dd>`).join('')}</dl></section>` : '';
446
+ // Artefacts: the merge proposal, then each one with its kind and day; a press opens it full screen
447
+ const arts = W.artefacts.filter((a) => !a.missing), mg = mergeOf(W.artefacts);
448
+ const artH = arts.length || mg ? `<section class="pw-psec" aria-label="Artefacts"><h4>Artefacts · ${esc(arts.length)}</h4>${mg ? `<div class="pw-psugs" role="list">${phSug(mg.id, mg.say, `data-pw-keep="${esc(mg.id)}"`, `data-pw-drop="${esc(mg.id)}"`, `data-pw-sug="${esc(mg.id)}"`)}</div>` : ''}`
449
+ + `<ul class="pw-parts2">${W.artefacts.map((a, i) => (a.missing ? '' : `<li><button type="button" class="pw-an2" data-pw-art="${i}">${SVG(artIc(a), 16)}<span><b>${esc(a.title)}</b><small>${esc([a.kindName || a.kind || '', a.when || ''].filter(Boolean).join(' · '))}</small></span></button></li>`)).join('')}</ul></section>` : '';
406
450
  const ask = `<form class="pw-pask" data-pw-pask><input type="text" maxlength="500" placeholder="Ask PMOS about this work" aria-label="Ask PMOS about this work" autocomplete="off"><button type="submit" aria-label="Send" title="Send">${SVG('M12 19V5M6 11l6-6 6 6', 16, 2)}</button></form>`;
407
- return `<div class="pw pw-ph">${head}${gate}${ovH}${wbs}${artH}${ask}</div>`;
451
+ void S;
452
+ return `<div class="pw pw-ph">${gate}${stands}${strip}${wbs}${kase}${artH}${ask}</div>`;
408
453
  }
409
454
 
410
455
  /* ── the suggestion as its own page (board 22) ── */
@@ -596,6 +641,7 @@ export function wire(body, h0, x0) {
596
641
  if (d.pwStatus) { statusMenu(b, d.pwStatus, h, c); return; }
597
642
  if (d.pwDate) { dateMenu(b, d.pwDate, c, h); return; }
598
643
  if (d.pwName) { rename(b, d.pwName, h); return; }
644
+ if ('pwPhall' in d) { if (PH_ALL.has(c.id)) PH_ALL.delete(c.id); else PH_ALL.add(c.id); redraw(); return; } // a phone: the other stages unfold (PhoneWorkDS)
599
645
  if (d.pwOpen) { openSmall(d.pwOpen, c, h, x, body); return; }
600
646
  if ('pwBacklog' in d) { const o = x.o() || {}, w = h.where ? h.where() : {}, q = new URLSearchParams({ work: 'backlog' }); if (w.ws || o.ws) q.set('ws', w.ws || o.ws); if (o.id) q.set('ini', o.id); location.href = '/premium-board.html?' + q.toString(); return; }
601
647
  // a milestone ◇ opens its full popup (WorkStatesDS 6); a Jira one and a phone keep the small card
@@ -950,7 +996,7 @@ async function openSmall(uid, c, h, x, body, bt) {
950
996
  onChange: () => { if (h.reload) h.reload(); },
951
997
  // the full popup over the work side (work-ds-quick-edit, WorkStatesDS 4 and 6): ← and the path go back to this initiative, the chat button
952
998
  // shows the popup's chat, × closes the popup; a milestone shows its date, the done test and PMOS's suggestion about it
953
- full: !phone(), path: [o.from || 'Work', o.product || '', ((x && x.v && x.v()) || {}).title || ''].filter(Boolean),
999
+ full: true, path: [o.from || 'Work', o.product || '', ((x && x.v && x.v()) || {}).title || ''].filter(Boolean),
954
1000
  chat: () => { const a = document.querySelector('.cz-pop [data-pop="ask"]'); if (a) a.click(); },
955
1001
  closeAll: () => { const k = document.querySelector('.cz-pop [data-pop="close"]'); if (k) k.click(); },
956
1002
  head: (t) => {
@@ -72,3 +72,9 @@ button.ctp-cr:hover { text-decoration: underline; }
72
72
  .ctp-g { grid-template-columns: minmax(0, 1fr); }
73
73
  .ctp-side { position: static; order: -1; }
74
74
  }
75
+
76
+ /* PhoneWorkDS (job 1540): on a phone a task or a milestone opens full screen, with ← back to the initiative. No margins, one column. */
77
+ @media (max-width: 760px) {
78
+ .ctp.ctp-full, .ctp.ctp-full.ctp-solo { left: 0; top: 0; right: 0; bottom: 0; width: auto; height: auto; max-width: none; border-radius: 0; box-shadow: none; padding: calc(env(safe-area-inset-top, 0px) + var(--space-12)) var(--space-16) calc(env(safe-area-inset-bottom, 0px) + var(--space-24)); overflow: auto; }
79
+ .ctp-full .ctp-hx { max-width: none; }
80
+ }
@@ -22,7 +22,7 @@ import { wireSwipe } from './cozy-phone-swipe.js'; // the phone: rows and the
22
22
 
23
23
  const ASK_SEND = new Set(['session']);
24
24
  export function mountToday(ctx) {
25
- const X = { log: { entries: [], marks: {} }, html: '', model: null, agenda: null, read: false, busy: new Set(), type: '', job: '', open: false, hide: new Set(), sopen: new Set(), unfiled: new Set(), filedOk: new Set() };
25
+ const X = { log: { entries: [], marks: {} }, html: '', model: null, agenda: null, read: false, busy: new Set(), job: '', sheet: '', open: false, hide: new Set(), sopen: new Set(), unfiled: new Set(), filedOk: new Set() };
26
26
  const el = document.getElementById('tdPage');
27
27
  // a desk and a phone both draw Today here; a phone draws its own one column (TP.phonePageHtml, board Ph2_today) while no conversation is
28
28
  // open over it (body.hm-plist: home-app.js's phone list state). On a phone Home's list is not drawn on today.html (cozy-today-page.css).
@@ -91,18 +91,22 @@ export function mountToday(ctx) {
91
91
  document.dispatchEvent(new CustomEvent('cz:calls', { detail: { count: O.today } }));
92
92
  try { localStorage.setItem('pmos.today.count', JSON.stringify({ day: L.today, n: O.today })); } catch { /* a private window */ }
93
93
  }
94
- if (X.type && !(L.types || {})[X.type]) X.type = '';
95
94
  const cap = document.getElementById('tdCap'), draft = cap ? cap.value : '', focus = !!cap && document.activeElement === cap;
95
+ // the log filters by job (All, Reply, Do, Decide, Send) on a desk and a phone; a job whose count went to zero goes back to All
96
+ if (X.job && !(L.counts || {})[X.job.toLowerCase()]) X.job = '';
96
97
  if (phone()) {
97
- const html = TP.phonePageHtml(L, A, O, { head: TM.headModel(ctx.now()), type: X.type, open: X.open, sopen: [...X.sopen], filed: filedLine(), now: ctx.now() });
98
+ // PhoneTodayDS (job #1540): Where it stands, the log with All ⌄, the capture box at the foot, the ✦ proposal's sheet
99
+ if (X.sheet && !(O.suggest || []).some((x) => x.key === X.sheet)) X.sheet = '';
100
+ const html = TP.phonePageHtml(L, A, O, { head: TM.headModel(ctx.now()), job: X.job, open: X.open, sopen: [...X.sopen], filed: filedLine(), now: ctx.now(), draft, mic: !!SPEECH(), sheet: X.sheet });
98
101
  if (html === X.html && el.firstChild) return;
99
102
  X.html = html; el.classList.add('tdp');
103
+ document.body.classList.toggle('tdp-sheeton', !!X.sheet);
100
104
  const sy = scrollY; el.innerHTML = html; scrollTo(0, sy);
105
+ const c2 = document.getElementById('tdCap'); if (c2 && focus) { c2.focus(); c2.setSelectionRange(c2.value.length, c2.value.length); }
106
+ if (X.sheet) { const y = el.querySelector('.tdp-sheet [data-td="ov-yes"]'); if (y) y.focus(); }
101
107
  return;
102
108
  }
103
109
  el.classList.remove('tdp');
104
- // the log's Tabs filter by job (All, Reply, Do, Decide, Send); a tab whose count went to zero goes back to All
105
- if (X.job && !(L.counts || {})[X.job.toLowerCase()]) X.job = '';
106
110
  const html = TP.pageHtml(L, A, { draft, overview: O, job: X.job, open: X.open || !!X.job, handled: X.job && X.job !== 'Reply' ? [] : handled(), hopen: X.hopen, sopen: [...X.sopen], filed: filedLine() });
107
111
  if (html === X.html && el.firstChild) return;
108
112
  X.html = html;
@@ -146,7 +150,7 @@ export function mountToday(ctx) {
146
150
  /** The popup's chat hidden for this open (round 3 point 7), until the popup's own per-item rule does it. */
147
151
  const chatOff = () => setTimeout(() => { const h = document.querySelector('.cz-pop:not([hidden]) [data-pop="hide"]'); if (h && !h.closest('.chat-off')) h.click(); }, 60);
148
152
  /** The rows in the order Today shows them, the ones that open something. */
149
- const order = () => { const L = X.model; if (!L) return []; return [...(L.first || []), ...(L.todayRows || []), ...(X.open || X.type || X.job ? L.wait || [] : [])].filter((r) => r && !r.done && r.src !== 'note' && r.src !== 'own' && (!X.job || r.job === X.job)); };
153
+ const order = () => { const L = X.model; if (!L) return []; return [...(L.first || []), ...(L.todayRows || []), ...(X.open || X.job ? L.wait || [] : [])].filter((r) => r && !r.done && r.src !== 'note' && r.src !== 'own' && (!X.job || r.job === X.job)); };
150
154
  /** ↑ ↓ (j k) in the popup: the previous or next Today row opens in its place. true when it stepped. */
151
155
  function step(d) {
152
156
  const list = order(), i = list.findIndex((r) => r.key === X.last);
@@ -332,7 +336,9 @@ export function mountToday(ctx) {
332
336
  run(b.dataset.td, b.dataset.key || '', b);
333
337
  });
334
338
  // the phone's type filter (Today's log · N All ⌄)
335
- el.addEventListener('change', (e) => { const t = e.target.closest('[data-td-type]'); if (t) { X.type = t.value; draw(); } });
339
+ el.addEventListener('change', (e) => { const t = e.target.closest('[data-td-job]'); if (t) { X.job = t.value; draw(); } });
340
+ // the proposal's sheet closes on Escape, as a dialog does
341
+ document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && X.sheet) { X.sheet = ''; draw(); } });
336
342
  // a phone: a row or the proposal swiped; the act is the one its button had on a desk, said in the toast with Undo
337
343
  wireSwipe(el, { on: phone, act: (row, way) => { const act = row.dataset[way === 'right' ? 'swRight' : 'swLeft']; if (act) run(act, row.dataset.key || '', { dataset: {}, disabled: false, isConnected: false }); } });
338
344
  }
@@ -355,7 +361,10 @@ export function mountToday(ctx) {
355
361
  ctx.toastUndo('Taken out of ' + f.title + '.', async () => { const u = await ctx.pmPost('/api/notes/link', { id: key, initiative: f.ini }).catch(() => null); X.unfiled.delete(key); draw(); return u || { ok: false }; });
356
362
  return;
357
363
  }
358
- if (act === 'ov-open') return; // the proposal's words: a swipe answers it
364
+ // the phone's ✦ proposal: a press opens it as the expanded Suggestion in a sheet (PhoneTodayDS); a swipe still answers it at once
365
+ if (act === 'ov-open') { X.sheet = key; draw(); return; }
366
+ if (act === 'sheet-x') { X.sheet = ''; draw(); return; }
367
+ if (act === 'cap-mic') { listen(b); return; }
359
368
  if (act === 'fold') { X.open = !X.open; draw(); return; }
360
369
  if (act === 'hfold') { X.hopen = !X.hopen; draw(); return; }
361
370
  if (act === 'h-undo') {
@@ -363,13 +372,12 @@ export function mountToday(ctx) {
363
372
  if (!m || !m.ok) { b.disabled = false; return ctx.toast('It did not go through. Nothing changed.'); }
364
373
  await ctx.reloadMentions(); ctx.toast('Back on Today: it still waits on you.'); return;
365
374
  }
366
- if (act === 'type') { X.type = X.type === key ? '' : key; draw(); return; }
367
375
  if (act === 'job') { X.job = key; draw(); return; }
368
376
  // the recorded meeting: ✓ keeps it filed where PMOS put it, and the block leaves Today
369
377
  if (act === 'filed-ok') { X.filedOk.add(key); draw(); return; }
370
378
  if (act === 'ov-yes' || act === 'ov-no') {
371
379
  const sg = X.overview && X.overview.suggest.find((x) => x.key === key); if (!sg || X.busy.has(key)) return;
372
- X.busy.add(key); b.disabled = true;
380
+ X.busy.add(key); b.disabled = true; X.sheet = '';
373
381
  try {
374
382
  if (act === 'ov-no') { for (const k of sg.keys) await mark1(k, 'keep', {}); X.hide.add(key); ctx.toast('Kept. PMOS will not suggest it again for a month.'); return after(false); }
375
383
  const done = []; for (const k of sg.keys) { const m = await mark1(k, 'drop', {}); if (m.ok) done.push(k); }
@@ -425,5 +433,18 @@ export function mountToday(ctx) {
425
433
  const j = document.getElementById('tdCap'); if (j) j.focus();
426
434
  });
427
435
  }
436
+ /* The capture box's mic on a phone (PhoneTodayDS: "type or speak"): the browser's own speech recognition, where it has one, writes the
437
+ * words into the box; the PM reads them and sends. Nothing is sent by itself. */
438
+ function listen(b) {
439
+ const R = SPEECH(); const i = document.getElementById('tdCap'); if (!R || !i) return;
440
+ const rec = new R(); rec.lang = document.documentElement.lang || 'en'; rec.interimResults = false; rec.maxAlternatives = 1;
441
+ b.setAttribute('aria-pressed', 'true');
442
+ rec.onresult = (e) => { const t = e.results && e.results[0] && e.results[0][0] ? e.results[0][0].transcript : ''; const j = document.getElementById('tdCap'); if (j && t) { j.value = (j.value ? j.value + ' ' : '') + t.trim(); j.focus(); } };
443
+ rec.onerror = (e) => { console.info('[phone-today-work] speech', e && e.error); if (e && e.error !== 'aborted' && e.error !== 'no-speech') ctx.toast('PMOS could not hear that. Type the line instead.'); };
444
+ rec.onend = () => { const m = el && el.querySelector('[data-td="cap-mic"]'); if (m) m.setAttribute('aria-pressed', 'false'); };
445
+ try { rec.start(); } catch (e) { console.info('[phone-today-work] speech did not start', e && e.message); }
446
+ }
428
447
  return { on, draw, read };
429
448
  }
449
+ /** The browser's speech recognition, or null where it has none (then the box has no mic: zero is silence). */
450
+ const SPEECH = () => (typeof window !== 'undefined' && (window.SpeechRecognition || window.webkitSpeechRecognition)) || null;
@@ -426,8 +426,10 @@ export function overviewModel(L, A = {}) {
426
426
  if (freeW || nextW) parts.push(cap1([freeW, nextW].filter(Boolean).join('; ')) + '.');
427
427
  const suggest = [];
428
428
  const old = (L.rows || []).filter((r) => !r.done && r.type === 'Check' && !r.kept && (r.carried || 0) > OLD_CHECK_DAYS);
429
- if ((L.old || []).length) suggest.push({ key: 'old-tasks', text: plural(L.old.length, 'old task has', 'old tasks have') + ' passed dates by more than ' + OLD_TASK_DAYS + ' days, so they are not on Today. Clear them from Today', act: 'drop', keys: L.old });
430
- if (old.length) suggest.push({ key: 'drop-old-checks', text: 'Drop the ' + plural(old.length, 'check', 'checks') + ' due more than ' + OLD_CHECK_DAYS + ' days ago', act: 'drop', keys: old.map((r) => r.key) });
429
+ if ((L.old || []).length) suggest.push({ key: 'old-tasks', text: plural(L.old.length, 'old task has', 'old tasks have') + ' passed dates by more than ' + OLD_TASK_DAYS + ' days, so they are not on Today. Clear them from Today', act: 'drop', keys: L.old,
430
+ why: 'Their dates passed more than ' + OLD_TASK_DAYS + ' days ago. They stay in their work; only Today stops listing them.' });
431
+ if (old.length) suggest.push({ key: 'drop-old-checks', text: 'Drop the ' + plural(old.length, 'check', 'checks') + ' due more than ' + OLD_CHECK_DAYS + ' days ago', act: 'drop', keys: old.map((r) => r.key),
432
+ items: old.map((r) => r.title), why: 'Nobody kept them, and their dates passed more than ' + OLD_CHECK_DAYS + ' days ago. Dropping takes them off your log; their work keeps them.' });
431
433
  const chips = TYPES.filter((t) => (L.types || {})[t]).map((t) => ({ type: t, n: L.types[t] }));
432
434
  return { said: parts.join(' '), suggest, chips, refs, today: forToday };
433
435
  }
@@ -145,4 +145,31 @@ button.td-ev:focus-visible { outline: none; box-shadow: var(--glow); }
145
145
  .tdp-cwl { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-size: var(--fs-body); color: var(--cz-ink); cursor: pointer; }
146
146
  .tdp-cwl svg { color: var(--cz-ink3); }
147
147
  .tdp :focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
148
+ /* PhoneTodayDS (job 1540): the row's dot (Komorebi swatches pm-sw-*), "why" after the proposal, the All ⌄ pill, the capture box at the
149
+ foot and the proposal's sheet (the expanded Suggestion, pm-sug x). Tokens only. */
150
+ body.cz-today.hm-plist #hmDesk { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); }
151
+ .tdp-dot { flex: none; width: var(--space-8); height: var(--space-8); margin: 9px 3px 0; border-radius: var(--radius-pill); }
152
+ .tdp-dot.alert { background: var(--alert); } .tdp-dot.blue { background: var(--blue); } .tdp-dot.muted { background: var(--line); }
153
+ .tdp-b svg { margin-top: 5px; color: var(--muted); }
154
+ .tdp-why { color: var(--muted); }
155
+ .tdp-f { border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 0 var(--space-8) 0 var(--space-4); }
156
+ .tdp-f svg { right: var(--space-8); }
157
+ .tdp-f select { color: var(--ink); min-height: 32px; padding: 0 22px 0 var(--space-8); text-align: left; }
158
+ .tdp-none { padding: var(--space-16) 0; font-size: var(--fs-body); color: var(--muted); line-height: var(--lh-body); }
159
+ .tdp-cap { position: fixed; left: var(--space-12); right: var(--space-12); bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-12)); z-index: 30; display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-4) var(--space-4) var(--space-16); border-radius: var(--radius-pill); background: var(--well); box-shadow: var(--raise); }
160
+ .tdp-in { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: var(--fs-field); color: var(--ink); padding: var(--space-8) 0; outline: none; }
161
+ .tdp-in::placeholder { color: var(--muted); }
162
+ .tdp-mic { flex: none; width: 40px; height: 40px; border: 0; border-radius: var(--radius-pill); background: none; color: var(--muted); display: inline-grid; place-items: center; padding: 0; cursor: pointer; }
163
+ .tdp-mic[aria-pressed="true"] { color: var(--alert); }
164
+ .tdp-go { flex: none; width: 40px; height: 40px; padding: 0; border-radius: var(--radius-pill); display: inline-grid; place-items: center; }
165
+ body.tdp-sheeton { overflow: hidden; }
166
+ .tdp-sheet { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; justify-content: flex-end; }
167
+ .tdp-scrim { position: absolute; inset: 0; border: 0; padding: 0; background: var(--ink); opacity: .32; cursor: default; }
168
+ .tdp-sh { position: relative; display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-8) var(--space-16) calc(env(safe-area-inset-bottom, 0px) + var(--space-16)); border-radius: var(--radius-panel) var(--radius-panel) 0 0; background: var(--card); box-shadow: var(--lift); }
169
+ .tdp-grab { align-self: center; width: 36px; height: var(--space-4); border-radius: var(--radius-pill); background: var(--line); }
170
+ .tdp-sh .pm-sug.x { font-size: var(--fs-body); }
171
+ .tdp-sh .pm-sug.x dl { display: flex; flex-direction: column; gap: var(--space-4); }
172
+ .tdp-sh .pm-sug.x dt { margin-top: var(--space-8); font-size: var(--fs-label); }
173
+ .tdp-sh .pm-sug.x .ans { gap: var(--space-12); }
174
+ .tdp-sh .pm-sug.x .ans .pm-btn { width: 44px; height: 44px; padding: 0; border-radius: var(--radius-pill); display: inline-grid; place-items: center; }
148
175
  }
@@ -35,7 +35,6 @@ const TI = {
35
35
  /** The kind icon of a row on a desk: its type, or what the PM typed (an event, a note), a PMOS finding, or done. */
36
36
  const KIND = { event: ['M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16z', 'Event'], note: [TI.Note, 'Note'], lab: [I.spark, 'PMOS suggests'], done: [I.done, 'Done'] };
37
37
  const kindOf = (r) => (r.done ? KIND.done : r.src === 'lab' ? KIND.lab : r.bullet === 'event' ? KIND.event : r.bullet === 'note' || r.src === 'note' ? KIND.note : [TI[r.type] || TI.Task, r.type || 'Task']);
38
- const BULLET = { task: ['•', 'Task'], event: ['○', 'Event'], note: ['–', 'Note'], lab: ['✦', 'PMOS suggests'] };
39
38
  const ib = (act, label, d, key, extra = '', v = '') => `<button type="button" class="td-ib pm-btn${v ? ' ' + v : ''}" data-td="${act}" data-key="${esc(key)}" aria-label="${esc(label)}" title="${esc(label)}"${extra}>${ic(d)}</button>`;
40
39
  const plural = (n, a, b) => n + ' ' + (n === 1 ? a : b);
41
40
  /** A Suggestion (pm-sug): ✦, one sentence, ✓ primary and ✕ outline. */
@@ -104,7 +103,6 @@ export function overviewHtml(O) {
104
103
  const sug = (O.suggest || []).map((x) => sugHtml(x.text, ['ov-yes', x.text], ['ov-no', 'Keep them: ' + x.text], x.key, 'td-ovs')).join('');
105
104
  return `<section class="td-ov pm-block" aria-label="Overview"><h2 class="pm-h-sm pm-row">${ic(I.spark, 16, 'pm-star')}Overview</h2>${said ? `<p>${said}</p>` : ''}${sug}</section>`;
106
105
  }
107
- const PLURAL = { Ask: 'Asks', Decision: 'Decisions', Check: 'Checks', Milestone: 'Milestones', Task: 'Tasks', Report: 'Reports', Note: 'Notes' }; // the phone's type filter
108
106
  /** The jobs the log's Tabs filter by, in order. */
109
107
  export const JOBS = [['Reply', 'reply'], ['Do', 'do'], ['Decide', 'decide'], ['Send', 'send']];
110
108
 
@@ -198,7 +196,7 @@ export function pageHtml(L, A, o = {}) {
198
196
  * (pm/cozy-phone-swipe.js): right does or accepts, left drops or puts off, and the toast says what happened with Undo. A row rests flat.
199
197
  * Pure: Node imports it (today-log.test.js). */
200
198
  export const SWIPE_HINT = 'Swipe any row: right to do or accept, left to drop or put off.';
201
- const PI = { undo: 'M9 14L4 9l5-5M4 9h11a5 5 0 0 1 0 10h-3', chev: 'M9 6l6 6-6 6', down: 'M7 10l5 5 5-5', spark: 'M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z' };
199
+ const PI = { mic: 'M12 3a3 3 0 0 0-3 3v6a3 3 0 0 0 6 0V6a3 3 0 0 0-3-3zM5 11a7 7 0 0 0 14 0M12 18v3', up: 'M12 19V5M6 11l6-6 6 6', undo: 'M9 14L4 9l5-5M4 9h11a5 5 0 0 1 0 10h-3', chev: 'M9 6l6 6-6 6', down: 'M7 10l5 5 5-5', spark: 'M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z' };
202
200
  /** What a swipe does on a row: { right, left } acts of the click handler ('done', 'tomorrow', 'lab-keep', …), '' when that way does nothing. */
203
201
  export function swipeActs(r) {
204
202
  if (!r || r.done || r.src === 'note' || r.src === 'gone') return { right: '', left: '' };
@@ -218,52 +216,120 @@ export function nextEvent(A, now = Date.now()) {
218
216
  }
219
217
  const durPhone = (min) => { const h = Math.floor(min / 60), m = min % 60; return h ? (m >= 30 ? h + '.5 h' : h + ' h') : m + ' min'; };
220
218
 
221
- /** One row of the phone's log: the bullet, the title, then "Task · IDPF · Ready to send"; a ✦ line under it when PMOS proposes. */
222
- export function phoneRowHtml(r) {
223
- const [b, bl] = r.done ? ['×', 'Done'] : BULLET[r.bullet] || BULLET.task;
219
+ /* PhoneTodayDS (Exploring 3, page "phone"; agreed 2026-11-22, job #1540): the job a row asks of you, with its small icon, and its dot:
220
+ * late in the alert colour, a line for today blue, the rest muted. The system's colour tokens (--alert, --blue, --muted), no page colour. */
221
+ const JOB_IC = { Reply: I.reply, Decide: I.decide, Send: I.send, Do: TI.Task };
222
+ /** The dot of a phone row: 'alert' when it is late, 'blue' when it is first or waits today, 'muted' for the rest. */
223
+ export function rowDot(r, o = {}) {
224
+ if (!r || r.done) return 'muted';
225
+ if (r.late) return 'alert';
226
+ return o.wait ? 'muted' : 'blue';
227
+ }
228
+ /** PMOS's fix line under a row: the one thing PMOS proposes on it, '' when it proposes nothing (zero is silence). */
229
+ export function fixLine(r) {
230
+ if (!r || r.done) return '';
231
+ if (r.drop) return 'Drop it from your log: it has waited ' + plural(r.carried || 0, 'day', 'days') + '.';
232
+ if (r.looks) return 'Looks answered: ' + (r.looks.who ? r.looks.who + ' replied' : 'someone replied') + ' “' + r.looks.text + '”. Close it?';
233
+ if (r.members && r.drafts) return 'PMOS drafts them for you to read.';
234
+ if (r.src === 'lab' && r.why) return r.why;
235
+ return '';
236
+ }
237
+ /** One row of the phone's log (PhoneTodayDS): a dot, the title, then the job with its icon and the work (and the late word); PMOS's fix
238
+ * line under it when PMOS proposes something. o.wait: the row is in Can wait. */
239
+ export function phoneRowHtml(r, o = {}) {
224
240
  const sw = swipeActs(r);
225
241
  const opens = !r.done && r.src !== 'own' && r.src !== 'gone' && r.src !== 'note';
226
242
  const title = opens ? `<button type="button" class="tdp-t" data-td="open" data-key="${esc(r.key)}">${esc(r.title)}</button>` : `<span class="tdp-t">${esc(r.title)}</span>`;
227
- const meta = [r.type ? `${svg(TI[r.type] || TI.Task, 13, 1.8)}<span>${esc(r.type)}</span>` : '', r.work ? esc(r.work) : '', r.reason ? esc(r.reason) : '', r.when && r.late && !r.done ? `<em>${esc(r.when)}</em>` : '']
228
- .filter(Boolean).join('<i aria-hidden="true">·</i>');
229
- const pro = (t) => `<span class="tdp-pro">${svg(PI.spark, 13, 1.9)}<span>${esc(t)}</span></span>`;
230
- const sug = r.drop ? pro('PMOS suggests: drop it from your log.')
231
- : r.looks && !r.done ? pro('Looks answered: ' + (r.looks.who ? r.looks.who + ' replied' : 'someone replied') + ' “' + r.looks.text + '”. Close it?')
232
- : r.members && r.drafts && !r.done ? pro('PMOS drafts them for you to read.')
233
- : r.src === 'lab' && r.why ? pro(r.why) : '';
243
+ const jb = r.job || (r.bullet === 'event' ? 'Event' : r.bullet === 'note' || r.src === 'note' ? 'Note' : '');
244
+ const late = lateOf(r);
245
+ const meta = [jb ? `${svg(JOB_IC[jb] || (jb === 'Event' ? KIND.event[0] : TI.Note), 13, 1.8)}<span>${esc(jb)}</span>` : '', r.work ? esc(r.work) : '',
246
+ late ? `<em>${esc(late)}</em>` : r.when && !r.done ? esc(r.when) : ''].filter(Boolean).join('<i aria-hidden="true">·</i>');
247
+ const fx = fixLine(r);
248
+ const fix = fx ? `<span class="tdp-pro">${svg(PI.spark, 13, 1.9)}<span>${esc(fx)}</span></span>` : '';
249
+ const dot = rowDot(r, o), dl = r.done ? 'Done' : dot === 'alert' ? 'Late' : dot === 'blue' ? 'For today' : 'Can wait';
234
250
  const say = sw.right ? ` aria-describedby="tdpHint"` : '';
235
251
  return `<li class="tdp-r${r.done ? ' done' : ''}${r.first && !r.done ? ' first' : ''}" data-key="${esc(r.key)}"${sw.right ? ` data-sw-right="${sw.right}"` : ''}${sw.left ? ` data-sw-left="${sw.left}"` : ''}${say}>`
236
- + `<i class="tdp-b" role="img" aria-label="${esc(bl)}">${b}</i><div class="tdp-x">${title}${meta ? `<small class="tdp-m">${meta}</small>` : ''}${sug}</div></li>`;
252
+ + (r.done ? `<span class="tdp-b" role="img" aria-label="Done">${svg(I.done, 13, 2)}</span>` : `<i class="tdp-dot ${dot}" role="img" aria-label="${dl}"></i>`)
253
+ + `<div class="tdp-x">${title}${meta ? `<small class="tdp-m">${meta}</small>` : ''}${fix}</div></li>`;
254
+ }
255
+
256
+ /** Where it stands on a phone (PhoneTodayDS): the cause, not counts. The lead line and why it leads, then how many dates are late and
257
+ * how many of them PMOS has a fix for, then the free time or the next meeting. '' on a day with nothing open. L: logModel(), O: overviewModel(),
258
+ * A: agendaModel(). PURE. */
259
+ export function phoneStands(L, O = {}, A = {}) {
260
+ const open = [...(L.first || []), ...(L.todayRows || [])].filter((r) => r && !r.done && r.src !== 'note');
261
+ if (!open.length) return '';
262
+ const lead = open.find((r) => r.late) || open[0];
263
+ // why it leads, said once: a reason the title already says ("Weekly update is ready to send" · "Ready to send") is not said again
264
+ const reason = String(lead.reason || '').trim(), inTitle = reason && lead.title.toLowerCase().indexOf(reason.toLowerCase()) >= 0;
265
+ const why = lateOf(lead) ? 'is ' + lateOf(lead) : lead.type === 'Ask' && lead.who && lead.who.length ? 'waits on your answer to ' + lead.who.join(' and ')
266
+ : reason && !inTitle ? reason.replace(/^(Late|Due|Goes|You|A)\b/, (w) => w.toLowerCase()) : lead.job && !inTitle ? 'waits on you to ' + lead.job.toLowerCase() + ' it' : '';
267
+ const parts = [clipT(lead.title, 60) + (lead.work && lead.title.indexOf(lead.work) < 0 ? ' (' + lead.work + ')' : '') + (why ? ' ' + why : '') + '.'];
268
+ if (!why) parts[0] = 'First: ' + parts[0];
269
+ const late = open.filter((r) => r.late && r !== lead), fixes = open.filter((r) => r.late && fixLine(r)).length;
270
+ if (late.length) parts.push(cap(plural(late.length, 'other date is', 'other dates are')) + ' late' + (fixes ? '; PMOS has a fix for ' + (fixes === late.length + (lead.late ? 1 : 0) ? (fixes === 1 ? 'it' : fixes === 2 ? 'both' : 'all ' + fixes) : fixes) : '') + '.');
271
+ const free = A && A.free ? 'You have ' + durPhone(A.free) + ' free' : '';
272
+ const next = A && A.next ? (A.nextFirst ? 'your first meeting is at ' : 'your next meeting is at ') + A.next : '';
273
+ if (free || next) parts.push(cap([free, next].filter(Boolean).join('; ')) + '.');
274
+ return parts.join(' ');
237
275
  }
276
+ const clipT = (s, n) => { const t = String(s || '').replace(/\s+/g, ' ').trim(); return t.length > n ? t.slice(0, n - 1).trimEnd() + '…' : t; };
238
277
 
239
- /** Today on a phone. L: logModel(), A: agendaModel(), O: overviewModel(); o: { head, type, open, filed: { title, sub, id } | null, now } */
278
+ /** The ✦ proposal opened as a sheet (PhoneTodayDS: "tap opens the expanded Suggestion"): the Komorebi expanded Suggestion (pm-sug x)
279
+ * with what changes, why, and Yes or No. sg: overviewModel().suggest[i]. '' with none. */
280
+ export function phoneSheetHtml(sg) {
281
+ if (!sg) return '';
282
+ const items = (sg.items || []).slice(0, 5);
283
+ const more = (sg.keys || []).length - items.length;
284
+ const what = items.length ? `<dt>What changes</dt><dd><ul>${items.map((t) => `<li>${esc(t)}</li>`).join('')}${more > 0 ? `<li>${esc(plural(more, 'more line', 'more lines'))}</li>` : ''}</ul></dd>` : '';
285
+ return `<div class="tdp-sheet" role="dialog" aria-modal="true" aria-label="PMOS suggests"><button type="button" class="tdp-scrim" data-td="sheet-x" aria-label="Close"></button>`
286
+ + `<div class="tdp-sh"><i class="tdp-grab" aria-hidden="true"></i><div class="pm-sug x"><div class="ttl">${ic(I.spark, 16, 'pm-star')}<span>${esc(sg.text)}</span></div>`
287
+ + `<dl>${what}${sg.why ? `<dt>Why</dt><dd>${esc(sg.why)}</dd>` : ''}</dl>`
288
+ + `<div class="ans">${ib('ov-no', 'No, keep them', I.no, sg.key, '', 'outline')}${ib('ov-yes', 'Yes: ' + sg.text, I.yes, sg.key, '', 'primary')}</div></div></div></div>`;
289
+ }
290
+
291
+ /** The capture box at the foot of Today on a phone (PhoneTodayDS): type a line, or speak where the browser can. The same form as the
292
+ * desk's (#tdCapF, #tdCap), so the same press adds the line. o: { draft, mic } */
293
+ export function phoneCapHtml(o = {}) {
294
+ return `<form class="tdp-cap" id="tdCapF" autocomplete="off"><label class="td-vh" for="tdCap">Log a task, an event or a note</label>`
295
+ + `<input id="tdCap" class="tdp-in" name="line" type="text" maxlength="240" enterkeyhint="send" placeholder="Log a task, an event or a note" value="${esc(o.draft || '')}" title="Start with o for an event, a dash for a note, ! for first" />`
296
+ + (o.mic ? `<button type="button" class="tdp-mic" data-td="cap-mic" aria-label="Speak a line" title="Speak">${svg(PI.mic, 18, 1.8)}</button>` : '')
297
+ + `<button type="submit" class="tdp-go pm-btn primary" aria-label="Log it" title="Log it">${svg(PI.up, 18, 2)}</button></form>`;
298
+ }
299
+
300
+ /** Today on a phone (PhoneTodayDS). L: logModel(), A: agendaModel(), O: overviewModel();
301
+ * o: { head, job, open, sopen, filed: { title, sub, id } | null, now, draft, mic } */
240
302
  export function phonePageHtml(L, A, O, o = {}) {
241
303
  const H = o.head ? `<header class="tdp-top"><span class="td-when">${esc(o.head.when)}</span><h1>${esc(o.head.hello)}</h1></header>` : '';
242
304
  const filed = o.filed ? `<section class="tdp-filed" aria-label="The meeting you recorded"><div><b>${esc('Recording filed under ' + o.filed.title)}</b>${o.filed.sub ? `<small>${esc(o.filed.sub)}</small>` : ''}</div>`
243
305
  + `<button type="button" class="tdp-ib pm-btn outline" data-td="filed-undo" data-key="${esc(o.filed.id)}" aria-label="${esc('Undo: take the recording out of ' + o.filed.title)}" title="Undo">${svg(PI.undo, 18, 1.8)}</button></section>` : '';
244
- const pick = (rows) => (o.type ? (rows || []).filter((r) => r.type === o.type) : rows || []);
306
+ const job = o.job || '';
307
+ const pick = (rows) => (job ? (rows || []).filter((r) => r.job === job) : rows || []);
308
+ const all = [...(L.first || []), ...(L.todayRows || [])];
245
309
  const shown = pick(L.first).concat(pick(L.todayRows));
246
310
  const wait = pick(L.wait);
247
311
  const sg = O && O.suggest && O.suggest[0];
248
312
  const anySwipe = !!sg || shown.some((r) => swipeActs(r).right);
249
- // the Overview: PMOS's words, at most one ✦ proposal, and the hint once there is something to swipe. Nothing open: one sentence.
250
- const zero = !shown.length;
313
+ // Where it stands: the cause, at most one ✦ proposal (its "why" opens the sheet), and the hint once there is something to swipe
314
+ const zero = !all.length;
315
+ const said = zero ? '' : phoneStands(L, O, A);
251
316
  const ov = zero
252
317
  ? `<p class="tdp-zero">${esc(o.quiet || 'Nothing is open for today.')}</p>`
253
- : `<section class="tdp-ov" aria-label="Overview"><h2>${svg(PI.spark, 15, 1.9)}<span>Overview</span></h2>${O && O.said ? `<p>${esc(O.said)}</p>` : ''}`
254
- + (sg ? `<ul class="tdp-sgl"><li class="tdp-sg" data-key="${esc(sg.key)}" data-sw-right="ov-yes" data-sw-left="ov-no" aria-describedby="tdpHint"><button type="button" class="tdp-sgt" data-td="ov-open" data-key="${esc(sg.key)}">${svg(PI.spark, 13, 1.9)}<span>${esc(sg.text)}</span></button></li></ul>` : '')
318
+ : `<section class="tdp-ov" aria-label="Where it stands"><h2>${svg(PI.spark, 15, 1.9)}<span>Where it stands</span></h2>${said ? `<p>${esc(said)}</p>` : ''}`
319
+ + (sg ? `<ul class="tdp-sgl"><li class="tdp-sg" data-key="${esc(sg.key)}" data-sw-right="ov-yes" data-sw-left="ov-no" aria-describedby="tdpHint"><button type="button" class="tdp-sgt" data-td="ov-open" data-key="${esc(sg.key)}" aria-haspopup="dialog">${svg(PI.spark, 13, 1.9)}<span>${esc(sg.text)}<span class="tdp-why"> · why</span></span></button></li></ul>` : '')
255
320
  + (anySwipe ? `<p class="tdp-hint" id="tdpHint">${esc(SWIPE_HINT)}</p>` : '') + '</section>';
256
321
  // the next event, with ● Record (a meeting records; with no event, Record starts a recording of its own)
257
322
  const N = nextEvent(A, o.now);
258
323
  const ev = `<section class="tdp-ev" aria-label="Next event"><button type="button" class="tdp-evt"${N.key && !N.own ? ` data-td="ev" data-key="${esc(N.key)}"` : ' tabindex="-1" disabled'}><b>${esc(N.title)}</b>${N.sub ? `<small>${esc(N.sub)}</small>` : ''}</button>`
259
324
  + `<button type="button" class="tdp-rec" data-td="${N.play ? 'rec-ev' : 'rec'}" data-key="${esc(N.key)}" aria-label="${esc(N.play ? 'Record ' + N.title : 'Record a meeting')}"><i aria-hidden="true"></i>Record</button></section>`;
260
- // the log: its count and the type filter, then the rows
261
- const types = O && O.chips ? O.chips : [];
262
- const total = types.reduce((n, c) => n + c.n, 0);
263
- const filter = types.length > 1 ? `<label class="tdp-f"><span class="td-vh">Show</span><select data-td-type aria-label="Show one type"><option value=""${o.type ? '' : ' selected'}>All</option>`
264
- + types.map((c) => `<option value="${esc(c.type)}"${o.type === c.type ? ' selected' : ''}>${esc((PLURAL[c.type] || c.type) + ' ' + c.n)}</option>`).join('') + `</select>${svg(PI.down, 14)}</label>` : '';
265
- const log = zero ? '' : `<section class="tdp-log" aria-label="Today’s log"><div class="tdp-lh"><h2>Today’s log · ${esc(o.type ? shown.length : L.open || total || shown.length)}</h2>${filter}</div>`
266
- + `<ul class="tdp-rows">${shown.map((r) => phoneRowHtml(r) + (r.members && (o.sopen || []).includes(r.key) ? r.members.map((m) => phoneRowHtml(m)).join('') : '')).join('')}</ul></section>`;
325
+ // the log: its count and the job filter (All ⌄: Reply, Do, Decide, Send; a job with no line is left out), then the rows
326
+ const c = L.counts || {};
327
+ const jobs = JOBS.filter(([, k]) => c[k]);
328
+ const filter = jobs.length ? `<label class="tdp-f"><span class="td-vh">Show</span><select data-td-job aria-label="Show one job"><option value=""${job ? '' : ' selected'}>All</option>`
329
+ + jobs.map(([j, k]) => `<option value="${esc(j)}"${job === j ? ' selected' : ''}>${esc(j + ' ' + c[k])}</option>`).join('') + `</select>${svg(PI.down, 14)}</label>` : '';
330
+ const log = zero ? '' : `<section class="tdp-log" aria-label="Today’s log"><div class="tdp-lh"><h2>Today’s log · ${esc(job ? shown.length : L.open || shown.length)}</h2>${filter}</div>`
331
+ + (shown.length ? `<ul class="tdp-rows">${shown.map((r) => phoneRowHtml(r) + (r.members && (o.sopen || []).includes(r.key) ? r.members.map((m) => phoneRowHtml(m)).join('') : '')).join('')}</ul>`
332
+ : `<p class="tdp-none">${esc('Nothing to ' + job.toLowerCase() + ' today.')}</p>`) + '</section>';
267
333
  // Can wait: one line, folded; a zero day says it as its own short section (Ph2_todayzero)
268
334
  let cw = '';
269
335
  if (wait.length) {
@@ -271,9 +337,10 @@ export function phonePageHtml(L, A, O, o = {}) {
271
337
  const old = oldest ? 'the oldest waits ' + oldest + (oldest === 1 ? ' day' : ' days') : '';
272
338
  if (zero) cw = `<section class="tdp-cw0" aria-label="Can wait"><h2>Can wait <em>${esc(wait.length)}</em></h2><button type="button" class="tdp-cwl" data-td="fold" aria-expanded="${!!o.open}"><span>${esc(old ? cap(old) : plural3(wait.length))}</span>${svg(o.open ? PI.down : PI.chev, 16)}</button></section>`;
273
339
  else cw = `<button type="button" class="tdp-cw" data-td="fold" aria-expanded="${!!o.open}"><b>Can wait</b><span>${esc(wait.length + ' more' + (old ? ' · ' + old : ''))}</span>${svg(PI.down, 14)}</button>`;
274
- if (o.open) cw += `<ul class="tdp-rows tdp-waitl">${wait.map((r) => phoneRowHtml(r)).join('')}</ul>`;
340
+ if (o.open) cw += `<ul class="tdp-rows tdp-waitl">${wait.map((r) => phoneRowHtml(r, { wait: true })).join('')}</ul>`;
275
341
  }
276
- return `${H}${filed}${ov}${ev}${log}${cw}`;
342
+ const sheet = o.sheet && sg && o.sheet === sg.key ? phoneSheetHtml(sg) : '';
343
+ return `${H}${filed}${ov}${ev}${log}${cw}${phoneCapHtml(o)}${sheet}`;
277
344
  }
278
345
  const cap = (s) => s.charAt(0).toUpperCase() + s.slice(1);
279
346
  const plural3 = (n) => n + (n === 1 ? ' line' : ' lines');
@@ -949,7 +949,7 @@ function drawAsk() {
949
949
  }
950
950
  el.hidden = false;
951
951
  const R = sessionRows(S.D.sessions || [], { titleOf: (id) => (iniRowOf(id) ? iniTitle(id) : ''), now: NOW() });
952
- const h = askHtml(askGroups(R.all, S.D.sessions || [], { titleOf: (id) => (iniRowOf(id) ? iniTitle(id) : ''), now: NOW() }), { ready: S.ready });
952
+ const h = askHtml(askGroups(R.all, S.D.sessions || [], { titleOf: (id) => (iniRowOf(id) ? iniTitle(id) : ''), productOf: (id) => (H.boardRows(S.D).some((r) => r.id === id) && H.productName(S.D) !== 'This product' ? H.productName(S.D) : ''), now: NOW() }), { ready: S.ready });
953
953
  if (el.__h !== h) { el.__h = h; el.innerHTML = h; }
954
954
  }
955
955
  /* A phone chat has no floating menu, so while a meeting records its pill sits in the top bar (XcbOptions B, case 7): a red dot and the
@@ -27,7 +27,7 @@ export const ICON = {
27
27
  };
28
28
  const svg = (d, w = 2) => `<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${w}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"></path></svg>`;
29
29
  /** One answer as an icon button. a = { icon, label, attr, pri }. */
30
- export const iconBtn = (a) => `<button type="button" class="hm-icb${a.pri ? ' pri' : ''}" ${a.attr} aria-label="${esc(a.label)}" title="${esc(a.label)}"${a.off ? ' disabled' : ''}>${svg(ICON[a.icon] || a.icon, a.icon === 'yes' ? 2.4 : 2)}</button>`;
30
+ export const iconBtn = (a) => `<button type="button" class="hm-icb${a.pri ? ' pri' : ''}" ${a.attr} aria-label="${esc(a.label)}" title="${esc(a.label)}"${a.sw ? ` data-sw-${a.sw}` : ''}${a.off ? ' disabled' : ''}>${svg(ICON[a.icon] || a.icon, a.icon === 'yes' ? 2.4 : 2)}</button>`;
31
31
 
32
32
  // systems where a write leaves PMOS; a read from them still asks as a plain Allow
33
33
  const OUTSIDE = /jira|confluence|atlassian|slack|gmail|mail|calendar|google|drive|notion|linear|asana|teams|figma|wispr/i;
@@ -113,8 +113,13 @@ export function askCardHtml(a, { live = true, role = 'PMOS' } = {}) {
113
113
  const ft = a.from || a.to ? `<p class="ft">${a.from ? `<s>${esc(a.from)}</s> → ` : ''}<b>${esc(a.to)}</b></p>` : '';
114
114
  const more = live && a.more && a.more.length
115
115
  ? `<span class="hm-mw"><button type="button" class="hm-icb hm-dots" data-hm-pmore aria-haspopup="menu" aria-label="More choices: ${esc(a.more.map((o) => o.label).join(', '))}" title="${esc(a.more.map((o) => o.label).join(' · '))}">${svg(ICON.dots, 2.6)}</button><span class="hm-pmenu" role="menu" hidden>${a.more.map((o) => `<button type="button" role="menuitem" ${o.attr}>${esc(o.label)}</button>`).join('')}</span></span>` : '';
116
- return `<div class="hm-askw" role="group" aria-label="${esc(role)} asks before it goes on"><div class="hm-askk" data-ask-kind="${a.kind}"><p class="k">${esc(a.label)}</p><b class="q">${esc(a.title)}</b>${ft}`
117
- + `<div class="acts">${a.answers.map((x) => iconBtn({ ...x, off: !live })).join('')}${more}</div></div></div>`;
116
+ // a phone (PhoneTodayDS, job #1540): a live Allow · No card is a blue-lined line that swipes, right allows, left denies; its icon
117
+ // answers stay for the keyboard and a screen reader (cozy-home.css hides them from sight on a phone only)
118
+ const yes = a.answers.find((x) => x.icon === 'yes'), no = a.answers.find((x) => x.icon === 'no');
119
+ const sw = live && yes && no ? ` data-sw-right="yes" data-sw-left="no"` : '';
120
+ const hint = sw ? `<p class="hm-swh">${esc('Swipe right: ' + yes.label + ' · left: ' + no.label)}</p>` : '';
121
+ return `<div class="hm-askw" role="group" aria-label="${esc(role)} asks before it goes on"><div class="hm-askk" data-ask-kind="${a.kind}"${sw}><p class="k">${esc(a.label)}</p><b class="q">${esc(a.title)}</b>${ft}${hint}`
122
+ + `<div class="acts">${a.answers.map((x) => iconBtn({ ...x, off: !live, sw: x === yes ? 'yes' : x === no ? 'no' : '' })).join('')}${more}</div></div></div>`;
118
123
  }
119
124
 
120
125
  /** True while something in the chat waits on the PM's answer: the permission prompt, a live question card or a live pmos-ask block.
@@ -30,6 +30,7 @@ import { goalUi } from './home-goal.js';
30
30
  import { splitReport, reportChipHtml, blockSig } from './report-chat.js';
31
31
  import { turnsOf } from './chat-context.js';
32
32
  import { askCardHtml, answerText } from './chat-ask.js';
33
+ import { wireSwipe } from './cozy-phone-swipe.js'; // a phone: the ask card swipes (PhoneTodayDS, job #1540)
33
34
  import { permissionAsk, splitAsk, blockAsk, iconBtn, openAsk, askCardHtml as kindCardHtml } from './home-ask.js';
34
35
  import { splitChase, runStop, sweepLine, stopText } from './home-sweep.js';
35
36
  import { splitSrc, srcHtml } from './chat-src.js'; // chief-of-staff C1: where each answer came from
@@ -85,6 +86,9 @@ export function mountChat(el, host) {
85
86
  el.innerHTML = `<button type="button" class="hm-reopen" id="hmReopen" aria-label="Open the Viewer" title="Open the Viewer" hidden>${PANE}</button>`
86
87
  + '<div class="hm-chd" id="hmCh" hidden></div><div class="hm-sug" id="hmSug" hidden></div><div class="hm-plw" id="hmPl" hidden></div><div class="hm-log" id="hmLog" role="log" aria-live="polite"></div><div class="hm-foot" id="hmFoot"></div>';
87
88
  const log = el.querySelector('#hmLog'), foot = el.querySelector('#hmFoot'), reopen = el.querySelector('#hmReopen'), head = el.querySelector('#hmCh'), sug = el.querySelector('#hmSug'), pl = el.querySelector('#hmPl');
89
+ // a phone: a live ask swiped right allows (or sends), left denies; it presses the card's own icon answer (home-ask.js askCardHtml)
90
+ if (log) wireSwipe(log, { on: () => typeof matchMedia === 'function' && matchMedia('(max-width: 760px)').matches,
91
+ act: (row, way) => { const b = row.querySelector(way === 'right' ? '[data-sw-yes]' : '[data-sw-no]'); if (b && !b.disabled) b.click(); } });
88
92
  const GU = goalUi({ C, host, el, draw: () => draw(), send: (t) => send(t), read: () => read(), openGoal: () => openGoal(), live: () => goalLive(), viewBody: () => document.querySelector('.obody.vw[data-vw="goal"]') });
89
93
  GU.wire(el);
90
94
  loadSlash(host.pmGet).then(() => { if (el.querySelector('#hmSlash:not([hidden])')) drawSlash(); });
@@ -1,6 +1,7 @@
1
1
  /* pm/phone-ask.js — Ask PMOS on a phone (phone design, board Ph2_asklist on Exploring 2; build brief nav-structure/phone/build-brief-v2.md).
2
2
  *
3
- * On a phone, Home's page (premium.html) is Ask PMOS: the chats, grouped by the work each is about, "Not in a work yet" last. The header is
3
+ * On a phone, Today's page with ?chats=1 is Ask PMOS (PhoneTodayDS, job #1540: a group heads with its work and product, the blue dot
4
+ * sits after the time): the chats, grouped by the work each is about, "Not in a work yet" last. The header is
4
5
  * the title only (the ⋯ of the menu at its right); no search and no new-chat icon: a new chat starts from the composer at the foot. A chat
5
6
  * that waits for you carries a blue dot. A row: the chat's name and when it was last used, then its last words ("PMOS: …").
6
7
  *
@@ -13,8 +14,7 @@
13
14
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
14
15
  const svg = (d, w = 16, sw = 1.8) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
15
16
  const IC = {
16
- ini: 'M12 4a8 8 0 1 0 0 16a8 8 0 1 0 0-16M12 9a3 3 0 1 0 0 6a3 3 0 1 0 0-6',
17
- loose: 'M4 5h16v11H9l-5 4z', plus: 'M12 5v14M5 12h14', mic: 'M12 3a3 3 0 0 0-3 3v6a3 3 0 0 0 6 0V6a3 3 0 0 0-3-3zM5 11a7 7 0 0 0 14 0M12 18v3', up: 'M12 19V5M6 11l6-6 6 6',
17
+ plus: 'M12 5v14M5 12h14', mic: 'M12 3a3 3 0 0 0-3 3v6a3 3 0 0 0 6 0V6a3 3 0 0 0-3-3zM5 11a7 7 0 0 0 14 0M12 18v3', up: 'M12 19V5M6 11l6-6 6 6',
18
18
  };
19
19
  const clip = (s, n) => { const t = String(s == null ? '' : s).replace(/\s+/g, ' ').trim(); return t.length > n ? t.slice(0, n - 1).trimEnd() + '…' : t; };
20
20
  /** The chat's last words: "PMOS: …" from the session's last output, '' when there is none (zero is silence). */
@@ -24,12 +24,12 @@ export function lastLine(s) {
24
24
  return t ? 'PMOS: ' + clip(t, 120) : '';
25
25
  }
26
26
  export function askGroups(rows, raw = [], o = {}) {
27
- const titleOf = o.titleOf || (() => '');
27
+ const titleOf = o.titleOf || (() => ''), productOf = o.productOf || (() => '');
28
28
  const byId = new Map((raw || []).filter(Boolean).map((s) => [s.id, s]));
29
29
  const G = new Map();
30
30
  for (const r of rows || []) {
31
31
  const k = r.ini || '';
32
- if (!G.has(k)) G.set(k, { ini: r.ini || null, title: r.ini ? titleOf(r.ini) || r.work || r.ini : 'Not in a work yet', rows: [] });
32
+ if (!G.has(k)) G.set(k, { ini: r.ini || null, title: r.ini ? titleOf(r.ini) || r.work || r.ini : 'Not in a work yet', product: r.ini ? productOf(r.ini) || '' : '', rows: [] });
33
33
  G.get(k).rows.push({ id: r.id, name: r.name, word: r.state === 'wait' || r.state === 'work' ? r.at ? timeOnly(r.at, o.now) : '' : r.word, last: lastLine(byId.get(r.id)), wait: r.state === 'wait', work: r.state === 'work' });
34
34
  }
35
35
  const out = [...G.values()].map((g) => ({ ...g, n: g.rows.length }));
@@ -49,9 +49,9 @@ export function askHtml(groups, o = {}) {
49
49
  const head = '<header class="pa-top"><h1>Ask PMOS</h1></header>';
50
50
  const body = !o.ready ? '<p class="pa-none">Reading your chats.</p>'
51
51
  : !groups.length ? '<p class="pa-none">No chats yet. Write to PMOS below to start one.</p>'
52
- : groups.map((g) => `<section class="pa-g" aria-label="${esc(g.title)}"><h2><span class="pa-gi${g.ini ? '' : ' loose'}">${svg(g.ini ? IC.ini : IC.loose, 14)}</span><span class="pa-gt">${esc(g.title)}</span><em>${esc(g.n)}</em></h2>`
52
+ : groups.map((g) => `<section class="pa-g" aria-label="${esc(g.title + (g.product ? ', ' + g.product : ''))}"><h2><span class="pa-gt">${esc(g.title)}</span>${g.product ? `<em>· ${esc(g.product)}</em>` : ''}</h2>`
53
53
  + `<ul>${g.rows.map((r) => `<li><button type="button" class="pa-r${r.wait ? ' wait' : ''}" data-ask-sid="${esc(r.id)}" aria-label="${esc(r.name + (r.wait ? '. Waits for you' : r.work ? '. PMOS is working' : '') + (r.last ? '. ' + r.last : ''))}">`
54
- + `${r.wait ? '<i class="pa-d" aria-hidden="true"></i>' : ''}<span class="pa-x"><b>${esc(r.name)}</b>${r.last ? `<small>${esc(r.last)}</small>` : ''}</span>${r.word ? `<time>${esc(r.word)}</time>` : ''}</button></li>`).join('')}</ul></section>`).join('');
54
+ + `<span class="pa-x"><b>${esc(r.name)}</b>${r.last ? `<small>${esc(r.last)}</small>` : ''}</span>${r.word ? `<time>${esc(r.word)}</time>` : ''}${r.wait ? '<i class="pa-d" aria-hidden="true"></i>' : ''}</button></li>`).join('')}</ul></section>`).join('');
55
55
  const foot = `<div class="pa-foot"><button type="button" class="pa-new" data-ask-new aria-label="Message PMOS: start a new chat"><span class="pa-pl">${svg(IC.plus, 18)}</span><span class="pa-ph">Message PMOS</span><span class="pa-mic">${svg(IC.mic, 18)}</span><span class="pa-go">${svg(IC.up, 18, 2)}</span></button></div>`;
56
56
  return `<div class="pa">${head}${body}</div>${foot}`;
57
57
  }
@@ -862,7 +862,7 @@ function drawInit() {
862
862
  const body = $('#ibBody');
863
863
  body.dataset.view = v; body.dataset.span = v === 'time' ? span : '';
864
864
  document.body.classList.toggle('wk-on', v === 'work');
865
- const html = v === 'work' ? drawWork(L) : v === 'track' ? drawTrack(L) : v === 'time' ? drawTime(L) : v === 'list' ? (phone ? V.phoneListHtml(L) : V.listHtml(L, filtered())) : V.stagesHtml(L, { phone });
865
+ const html = v === 'work' ? drawWork(L) : v === 'track' ? drawTrack(L) : v === 'time' ? drawTime(L) : v === 'list' ? (phone ? ST.standsHtml(L, { sug: false, max: 2 }) + V.phoneListHtml(L) : V.listHtml(L, filtered())) : V.stagesHtml(L, { phone });
866
866
  // a phone has no ⋯ menu: Metrics and Cancelled and archived stay one press away in every view, not only the track
867
867
  const phx = phone && v !== 'track' ? `<div class="bd-whead bd-phx"><span class="bd-phb"><button type="button" class="bd-chip" data-open="metrics" aria-haspopup="dialog">Metrics</button><button type="button" class="bd-chip" data-open="gone" aria-haspopup="dialog">Cancelled and archived</button></span></div>` : '';
868
868
  if (v === 'time') TL.hold(); else TL.forget();
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "The phone Today, Ask PMOS and Work (job #1540, done test planning/done-tests/phone-today-work.md C1-C7, C10): the pure parts of Today's phone page, the menu, Ask PMOS, the Work list row and the initiative on a phone. No browser.",
3
+ "modules": [
4
+ "phone-today-work.test.js"
5
+ ],
6
+ "seconds": {
7
+ "phone-today-work.test.js": 1
8
+ }
9
+ }