create-pmos 0.632.0 → 0.633.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.
Files changed (59) hide show
  1. package/package.json +14 -50
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-adddoc-test.js +3 -0
  7. package/workspace/briefing-premium-board-test.js +4 -2
  8. package/workspace/briefing-premium-doc-edit-test.js +3 -0
  9. package/workspace/briefing-premium-initiative-test.js +4 -0
  10. package/workspace/briefing-premium-insights-test.js +1 -1
  11. package/workspace/briefing-premium-sources-test.js +2 -2
  12. package/workspace/changelog.json +13 -0
  13. package/workspace/core-docs-workflow-test.js +3 -0
  14. package/workspace/ev-everywhere-test.js +7 -17
  15. package/workspace/guide/layout.md +12 -5
  16. package/workspace/ini-workflow-test.js +3 -0
  17. package/workspace/lib/meeting-focus.js +5 -3
  18. package/workspace/lib/routes-meeting-focus.js +2 -2
  19. package/workspace/live-pill-round-test.js +7 -2
  20. package/workspace/package-lock.json +2 -2
  21. package/workspace/package.json +1 -1
  22. package/workspace/premium-board-actions-test.js +3 -1
  23. package/workspace/premium-vw-backlog-test.js +2 -2
  24. package/workspace/premium-vw-doc-test.js +3 -0
  25. package/workspace/premium-vw-item-test.js +1 -1
  26. package/workspace/premium-vw-jira-test.js +4 -3
  27. package/workspace/public/pm/bd-ini-panel.js +4 -1
  28. package/workspace/public/pm/bd-prog-panel.js +3 -3
  29. package/workspace/public/pm/bd-views.js +8 -2
  30. package/workspace/public/pm/buddy-core.js +2 -2
  31. package/workspace/public/pm/cozy-board.css +15 -0
  32. package/workspace/public/pm/cozy-ev.css +25 -0
  33. package/workspace/public/pm/cozy-home.css +38 -2
  34. package/workspace/public/pm/cozy-nav.js +72 -6
  35. package/workspace/public/pm/cozy-phone-rec.css +68 -0
  36. package/workspace/public/pm/cozy-phone-rec.js +105 -0
  37. package/workspace/public/pm/cozy-phone-settings.css +18 -0
  38. package/workspace/public/pm/cozy-phone-settings.js +73 -0
  39. package/workspace/public/pm/cozy-phone-swipe.js +51 -0
  40. package/workspace/public/pm/cozy-pop-work.css +56 -0
  41. package/workspace/public/pm/cozy-pop-work.js +72 -4
  42. package/workspace/public/pm/cozy-rec-tab.js +10 -0
  43. package/workspace/public/pm/cozy-today-app.js +56 -5
  44. package/workspace/public/pm/cozy-today-page.css +75 -1
  45. package/workspace/public/pm/cozy-today-view.js +87 -0
  46. package/workspace/public/pm/cozy-viewer.js +27 -7
  47. package/workspace/public/pm/home-app.js +31 -2
  48. package/workspace/public/pm/home-chat.js +8 -0
  49. package/workspace/public/pm/home-ini.js +7 -3
  50. package/workspace/public/pm/phone-ask.js +57 -0
  51. package/workspace/split-merge-ui-test.js +3 -1
  52. package/workspace/stage-card-tasks-test.js +6 -0
  53. package/workspace/stage-card-test.js +3 -0
  54. package/workspace/task-delete-test.js +3 -0
  55. package/workspace/task-links-test.js +3 -0
  56. package/workspace/task-plans-test.js +3 -0
  57. package/workspace/task-views-test.js +3 -0
  58. package/workspace/test-lists/phone-design-v2.json +9 -0
  59. package/workspace/tk-tasks-test.js +4 -0
@@ -0,0 +1,73 @@
1
+ /* pm/cozy-phone-settings.js — Settings on a phone (phone design, board Ph2_more on Exploring 2; build brief nav-structure/phone/build-brief-v2.md).
2
+ *
3
+ * One screen, no scrolling: Theme (Light, Dark, Auto: this phone), Version ("PMOS 0.630.0") with Check update, and the note "Connectors,
4
+ * workspaces and updates are on your computer." Nothing else: Product, Your day, Jira writes, Your impact and Signed in stay in the
5
+ * computer's Settings (pm/cozy-settings.js), which a phone no longer opens from the menu. The menu's ⋯ stays at the top right over it.
6
+ *
7
+ * phoneSettingsHtml({ pick, version, said }) → string PURE
8
+ * openPhoneSettings() → the element pm/cozy-nav.js calls it on a phone; Back, Escape or another place closes it
9
+ * closePhoneSettings()
10
+ * Reads GET /api/kit/status (the version) when it opens. Writes only on a press: the theme on this phone (localStorage, cozy-nav.js
11
+ * setTheme) and POST /api/kit/check (Check update; it reads the newest version and changes nothing on the computer). */
12
+ import { pmGet, pmPost } from './http.js';
13
+ import { setTheme, themePick } from './cozy-nav.js';
14
+
15
+ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
16
+ const S = { el: null, version: '', ws: '', said: '', busy: false, back: null };
17
+ const THEMES = [['light', 'Light'], ['dark', 'Dark'], ['auto', 'Auto']];
18
+
19
+ export function phoneSettingsHtml(o = {}) {
20
+ const pick = o.pick || 'auto';
21
+ const sub = pick === 'auto' ? 'Auto follows your phone' : pick === 'dark' ? 'Dark on this phone' : 'Light on this phone';
22
+ return '<h1 class="phs-h" id="phsTitle">Settings</h1>'
23
+ + `<div class="phs-row"><div class="phs-t"><b id="phsTheme">Theme</b><small>${esc(sub)}</small></div><div class="ev-seg phs-seg" role="group" aria-labelledby="phsTheme">`
24
+ + THEMES.map(([k, l]) => `<button type="button" data-phs-theme="${k}" aria-pressed="${pick === k}">${l}</button>`).join('') + '</div></div>'
25
+ + `<div class="phs-row"><div class="phs-t"><b>Version</b><small>${esc(o.version ? 'PMOS ' + o.version : 'PMOS')}</small>${o.said ? `<small class="phs-said" role="status">${esc(o.said)}</small>` : ''}</div>`
26
+ + `<button type="button" class="phs-b" data-phs-check${o.busy ? ' disabled' : ''}>${o.busy ? 'Checking' : 'Check update'}</button></div>`
27
+ + '<p class="phs-note">Connectors, workspaces and updates are on your computer.</p>';
28
+ }
29
+ function draw() { if (S.el) S.el.innerHTML = phoneSettingsHtml({ pick: themePick(), version: S.version, said: S.said, busy: S.busy }); }
30
+ function addCss() {
31
+ const href = new URL('./cozy-phone-settings.css', import.meta.url).href;
32
+ if (!document.querySelector(`link[href="${href}"]`)) { const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = href; document.head.appendChild(l); }
33
+ }
34
+ async function readVersion() {
35
+ const r = await pmGet('/api/kit/status').catch(() => null);
36
+ if (r && r.ok) { S.version = (r.app && r.app.version) || ''; S.ws = r.ws || ''; draw(); }
37
+ }
38
+ async function check() {
39
+ if (S.busy) return;
40
+ S.busy = true; S.said = ''; draw();
41
+ const r = await pmPost('/api/kit/check', { ws: S.ws || undefined }).catch(() => null);
42
+ S.busy = false;
43
+ if (!r || !r.ok) S.said = 'The check did not go through: ' + ((r && r.error) || 'the computer did not answer') + '.';
44
+ else S.said = r.appBehind || r.kitBehind ? 'PMOS ' + r.latest + ' is ready. Update it on your computer.' : 'This is the newest PMOS.';
45
+ draw();
46
+ }
47
+ export function openPhoneSettings() {
48
+ addCss();
49
+ if (!S.el) {
50
+ S.el = document.createElement('section');
51
+ S.el.className = 'phs'; S.el.id = 'phSettings'; S.el.setAttribute('role', 'dialog'); S.el.setAttribute('aria-modal', 'true'); S.el.setAttribute('aria-labelledby', 'phsTitle');
52
+ document.body.appendChild(S.el);
53
+ S.el.addEventListener('click', (e) => {
54
+ const t = e.target.closest('[data-phs-theme]'); if (t) { setTheme(t.dataset.phsTheme, document); draw(); return; }
55
+ if (e.target.closest('[data-phs-check]')) check();
56
+ });
57
+ document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && S.el && !S.el.hidden) { e.stopPropagation(); closePhoneSettings(); } }, true);
58
+ addEventListener('popstate', () => { if (S.el && !S.el.hidden) closePhoneSettings(true); });
59
+ }
60
+ S.said = ''; S.back = document.activeElement;
61
+ S.el.hidden = false; document.body.classList.add('phs-on');
62
+ try { history.pushState({ phs: 1 }, ''); } catch { /* no history */ }
63
+ draw(); readVersion();
64
+ const f = S.el.querySelector('button'); if (f) f.focus();
65
+ return S.el;
66
+ }
67
+ export function closePhoneSettings(fromHistory = false) {
68
+ if (!S.el || S.el.hidden) return;
69
+ S.el.hidden = true; document.body.classList.remove('phs-on');
70
+ if (!fromHistory) { try { if (history.state && history.state.phs) history.back(); } catch { /* no history */ } }
71
+ if (S.back && S.back.isConnected) { try { S.back.focus(); } catch { /* gone */ } }
72
+ }
73
+ export const phoneSettingsOpen = () => !!(S.el && !S.el.hidden);
@@ -0,0 +1,51 @@
1
+ /* pm/cozy-phone-swipe.js — swipe a row on a phone (phone design, build brief nav-structure/phone/build-brief-v2.md: "Proposals and log rows SWIPE:
2
+ * right = accept / do / send, left = drop / put off. No tick and cross buttons, no Do/Send words. Undo line after each swipe.").
3
+ *
4
+ * wireSwipe(root, { on() → boolean, act(row, dir) }) once per root. A row is any element under root with data-sw-right and/or
5
+ * data-sw-left (the act each way). A horizontal drag of 72 px or more one way calls act(row, 'right' | 'left'); a shorter drag, a
6
+ * vertical scroll or a way with no act puts the row back. While the finger moves, the row follows it and its tint says which way
7
+ * (green right, grey left); on release it rests flat again. on() false (a desktop, a pointer that is not touch or pen): nothing.
8
+ * decide(dx, dy, row) → 'right' | 'left' | '' pure: the way a finished drag goes (Node tests it)
9
+ * The keyboard and a screen reader keep the row's own press (the title opens it); the hint line names the swipe. Writes nothing itself. */
10
+ export const SWIPE_PX = 72;
11
+ export function decide(dx, dy, row = {}) {
12
+ if (Math.abs(dx) < SWIPE_PX || Math.abs(dy) > Math.abs(dx) * 0.7) return '';
13
+ const way = dx > 0 ? 'right' : 'left';
14
+ const ds = row.dataset || row;
15
+ return (way === 'right' ? ds.swRight : ds.swLeft) ? way : '';
16
+ }
17
+ export function wireSwipe(root, o = {}) {
18
+ if (!root || root.__sw) return; root.__sw = true;
19
+ let cur = null;
20
+ const reset = (el) => { if (!el) return; el.style.transform = ''; el.classList.remove('sw-r', 'sw-l', 'sw-on'); };
21
+ root.addEventListener('pointerdown', (e) => {
22
+ if (o.on && !o.on()) return;
23
+ if (e.pointerType === 'mouse') return; // a desktop keeps its buttons; a phone swipes
24
+ const row = e.target.closest('[data-sw-right], [data-sw-left]'); if (!row || !root.contains(row)) return;
25
+ cur = { row, x: e.clientX, y: e.clientY, id: e.pointerId, dx: 0, dy: 0, lock: '' };
26
+ });
27
+ root.addEventListener('pointermove', (e) => {
28
+ if (!cur || e.pointerId !== cur.id) return;
29
+ cur.dx = e.clientX - cur.x; cur.dy = e.clientY - cur.y;
30
+ if (!cur.lock) { if (Math.abs(cur.dx) > 10 && Math.abs(cur.dx) > Math.abs(cur.dy)) cur.lock = 'x'; else if (Math.abs(cur.dy) > 10) cur.lock = 'y'; }
31
+ if (cur.lock !== 'x') return;
32
+ const way = cur.dx > 0 ? 'swRight' : 'swLeft';
33
+ const dx = cur.row.dataset[way] ? cur.dx : cur.dx / 4; // a way with no act gives a little, then comes back
34
+ cur.row.classList.add('sw-on'); cur.row.classList.toggle('sw-r', cur.dx > 0 && !!cur.row.dataset.swRight); cur.row.classList.toggle('sw-l', cur.dx < 0 && !!cur.row.dataset.swLeft);
35
+ cur.row.style.transform = `translateX(${Math.max(-140, Math.min(140, dx))}px)`;
36
+ });
37
+ const end = (e) => {
38
+ if (!cur || (e && e.pointerId !== cur.id)) return;
39
+ const c = cur; cur = null;
40
+ const way = c.lock === 'x' ? decide(c.dx, c.dy, c.row) : '';
41
+ reset(c.row);
42
+ if (way) {
43
+ // the press that a swipe ends with is not a press on the row's title
44
+ const stop = (ev) => { if (!ev.isTrusted) return; ev.stopPropagation(); ev.preventDefault(); }; // act's own press (a script's click) goes through
45
+ root.addEventListener('click', stop, { capture: true, once: true }); setTimeout(() => root.removeEventListener('click', stop, { capture: true }), 400);
46
+ if (o.act) o.act(c.row, way);
47
+ }
48
+ };
49
+ root.addEventListener('pointerup', end);
50
+ root.addEventListener('pointercancel', end);
51
+ }
@@ -233,3 +233,59 @@ button.pw-fv .grey { color: var(--cz-ink3); }
233
233
  .pw-loose { margin: 8px 2px 0; }
234
234
  .pw-loose .pw-lk { display: inline-flex; align-items: center; gap: 2px; color: var(--cz-ink3); }
235
235
  .pw-loose .pw-lk:hover { color: var(--cz-blue); }
236
+
237
+ /* ── a phone (board Ph2_init; cozy-pop-work.js phoneHtml): the popup's content as one page. No cards, no table; 16 px gutter; a proposal is a
238
+ * blue ✦ line that is swiped (right yes, left no). The item's header keeps back and the title only: its ⋯ items are in the page's ⋯. */
239
+ .pw-ph { padding: 4px 16px calc(env(safe-area-inset-bottom, 0px) + 88px); display: flex; flex-direction: column; gap: 0; color: var(--cz-ink); }
240
+ .pw-phd { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
241
+ .pw-phd b { font-size: var(--fs-panel); line-height: var(--lh-panel); font-weight: var(--fw-strong); flex: 1; min-width: 0; }
242
+ .pw-phd > span:last-child:not(.pw-pn) { font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--cz-ink3); flex: none; }
243
+ .pw-phd > span.warn, .pw-ph .warn { color: var(--cz-late); }
244
+ .pw-pn { width: 26px; height: 26px; border-radius: 6px; background: var(--cz-bluebg); color: var(--cz-blueink); display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-meta); font-weight: var(--fw-strong); flex: none; }
245
+ .pw-pgate { margin: 8px 0 0; font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--cz-ink2); }
246
+ .pw-pov { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--cz-hair); }
247
+ .pw-pov h3 { margin: 0 0 8px; display: flex; align-items: center; gap: 6px; font-size: var(--fs-meta); line-height: var(--lh-meta); font-weight: var(--fw-strong); letter-spacing: .08em; text-transform: uppercase; color: var(--cz-ink2); }
248
+ .pw-pov h3 svg { color: var(--cz-blue); }
249
+ .pw-pl { margin: 0 0 6px; font-size: var(--fs-body); line-height: var(--lh-body); }
250
+ .pw-pl b { font-weight: var(--fw-strong); margin-right: 4px; }
251
+ .pw-pl .pw-otx { cursor: text; }
252
+ .pw-pstat { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--cz-hair); }
253
+ .pw-pstat > p { margin: 0 0 6px; font-size: var(--fs-body); line-height: var(--lh-body); }
254
+ .pw-psugs { display: flex; flex-direction: column; }
255
+ .pw-psug { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; color: var(--cz-blue); background: var(--cz-card); transition: transform .18s ease; touch-action: pan-y; }
256
+ .pw-psug.sw-on { transition: none; }
257
+ .pw-psug.sw-r { background: var(--cz-bluebg); }
258
+ .pw-psug.sw-l { background: var(--cz-well); }
259
+ .pw-psug > svg { flex: none; margin-top: 4px; }
260
+ .pw-psay { 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-blue); cursor: pointer; }
261
+ .pw-psb[hidden] { display: none; }
262
+ .pw-psec { margin-top: 20px; }
263
+ .pw-psec h4 { margin: 0 0 4px; font-size: var(--fs-meta); line-height: var(--lh-meta); font-weight: var(--fw-strong); color: var(--cz-ink2); }
264
+ .pw-pwbs, .pw-parts { list-style: none; margin: 0; padding: 0; }
265
+ .pw-pwbs li, .pw-parts li { display: flex; align-items: center; gap: 10px; min-height: 46px; border-bottom: 1px solid var(--cz-hair); }
266
+ .pw-pdot { width: 8px; height: 8px; border-radius: 50%; flex: none; box-sizing: border-box; }
267
+ .pw-pdot.dn { background: color-mix(in srgb, var(--cz-ink3) 60%, transparent); }
268
+ .pw-pdot.now { background: var(--cz-blue); }
269
+ .pw-pdot.todo { border: 1.5px solid var(--cz-ink3); }
270
+ .pw-pstg { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; border: 0; padding: 0; background: none; font: inherit; color: var(--cz-ink); text-align: left; cursor: pointer; }
271
+ .pw-pstg:disabled { cursor: default; color: var(--cz-ink); }
272
+ .pw-pstg .pw-n { font-size: var(--fs-body); color: var(--cz-ink2); }
273
+ .pw-pstg b { font-size: var(--fs-row); font-weight: var(--fw-strong); }
274
+ .pw-pd { flex: none; font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--cz-ink3); }
275
+ .pw-ptk { padding-left: 18px; }
276
+ .pw-ptk .pw-tt, .pw-ptk .pw-dn, .pw-parts .pw-an { flex: 1; min-width: 0; text-align: left; border: 0; padding: 0; background: none; font: inherit; font-size: var(--fs-body); color: var(--cz-ink); cursor: pointer; }
277
+ .pw-ptk .pw-dn { color: var(--cz-ink3); }
278
+ .pw-ptk.done .pw-tt { color: var(--cz-ink3); }
279
+ .pw-ph .pw-loose { margin: 10px 0 0; }
280
+ .pw-ph .pw-loose .pw-lk, .pw-pdocs { font-size: var(--fs-meta); color: var(--cz-ink2); }
281
+ .pw-pdocs { display: inline-flex; align-items: center; gap: 2px; margin-top: 10px; border: 0; padding: 0; background: none; cursor: pointer; font-family: inherit; }
282
+ .pw-pnone { margin: 6px 0 0; font-size: var(--fs-meta); color: var(--cz-ink3); }
283
+ .pw-pask { position: fixed; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); z-index: 4; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 16px; border-radius: 26px; background: var(--cz-well); }
284
+ .pw-pask input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: var(--fs-body); color: var(--cz-ink); height: 36px; }
285
+ .pw-pask input::placeholder { color: var(--cz-ink3); }
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
+ .pw-pask:focus-within { box-shadow: 0 0 0 2px var(--cz-blue); }
288
+ @media (max-width: 760px) {
289
+ /* the item's header on a phone: back and the title; the page's ⋯ (cozy-nav.js) holds the item's own ⋯ items */
290
+ .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; }
291
+ }
@@ -16,6 +16,7 @@
16
16
  * leave, with Undo for a moment. Values read from the work (Gate, Open) and Jira tasks are not edited here.
17
17
  * Reads: GET /api/library-items?ws&initiative (the Library's rows, slice 7) once per initiative; when that route is not there the core documents
18
18
  * the page already reads stand in. The UI says PMOS, never Claude; icon-only buttons carry aria-label. */
19
+ import { wireSwipe } from './cozy-phone-swipe.js';
19
20
  import * as M from './pop-work-model.js';
20
21
  import * as CB from './cozy-bar.js';
21
22
  import { openPop, closePop, undoToast } from './hi-pop.js';
@@ -67,7 +68,11 @@ const RO = typeof window !== 'undefined' && !!window.PMOS_READONLY;
67
68
  const ib = (attr, label, d, cls = '') => `<button type="button" class="pw-ib${cls ? ' ' + cls : ''}" ${attr} aria-label="${esc(label)}" title="${esc(label)}">${SVG(d)}</button>`;
68
69
 
69
70
  /** The body is in the popup, and the PM did not ask for the old page there. */
70
- export function on(body) { return !!(body && body.closest && body.closest('.cz-pop') && !body.closest('[data-pw-all]') && !(body.dataset && body.dataset.pwAll)); }
71
+ /* A phone (Ph2_init): the item's page shows the popup's content in a phone layout , not the old page. Its look is the phone block at the end of cozy-pop-work.css. */
72
+ const phone = () => typeof matchMedia === 'function' && matchMedia('(max-width: 760px)').matches;
73
+ export function on(body) { return inPop(body) || (!!(body && body.closest && phone() && body.closest('.cz-vw')) && !body.closest('[data-pw-all]') && !(body.dataset && body.dataset.pwAll)); }
74
+ /** The body is in the popup itself (a program or a product keeps its own page on a phone: Ph2_init is an initiative's). */
75
+ export function inPop(body) { return !!(body && body.closest && body.closest('.cz-pop') && !body.closest('[data-pw-all]') && !(body.dataset && body.dataset.pwAll)); }
71
76
 
72
77
  /* ── reads ── */
73
78
  function readItems(id, ws, redraw) {
@@ -284,10 +289,58 @@ function model(r, v, o) {
284
289
  }
285
290
  export function html(r, v, o = {}) {
286
291
  const { W, S } = model(r, v, o), C = cols(), mode = store.get(SPAN, 'full');
292
+ if (phone() && !RO) return phoneHtml(W, S, keyOf(v, o), v);
287
293
  if (S.big) return `<div class="pw" data-pw-big-on>${breakdownHtml(W, C, mode, true, S)}</div>`;
288
294
  return `<div class="pw">${overviewHtml(W, S, keyOf(v, o))}${breakdownHtml(W, C, mode, false, S)}${artefactsHtml(W.artefacts, C, true, { scope: keyOf(v, o), recPath: v.prd && (v.prd.path || v.prd) })}</div>`;
289
295
  }
290
296
 
297
+ /* ── 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
298
+ * 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,
299
+ * 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
300
+ * Backlog line, Artefacts with the merge proposal and "N documents", and the box "Ask PMOS about this work". A proposal is swiped: right
301
+ * 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. */
302
+ const PH_ARTS = new Set(); // initiatives whose documents are unfolded on the phone, per page
303
+ 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)}`
304
+ + (open ? `<button type="button" class="pw-psay" ${open}>${esc(say)}</button>` : `<span class="pw-psay">${esc(say)}</span>`)
305
+ + `<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>`;
306
+ function phoneHtml(W, S, oid, v) {
307
+ const st = (v && v.stage) || {}, d = st.dates || {}, dr = dropped();
308
+ 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>` : '';
309
+ const miss = st.gate && (st.gate.parts || []).filter((x) => !x.ok).map((x) => x.text);
310
+ 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>` : '';
311
+ // the Overview: the lines that are written; the ones that are not, as one proposal ("Draft the Problem and Done when from Research notes")
312
+ const ov = W.overview;
313
+ 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('');
314
+ const off = ov.lines.filter((L) => !L.text && L.ask && !dr.has('ov:' + oid + ':' + L.id));
315
+ const from = off.length ? (/ (from .*?)\?$/.exec(off[0].miss || '') || [])[1] || 'with you' : '';
316
+ 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(','))}"`) : '';
317
+ // the status line without what the head and the gate line already say (said once)
318
+ const said = String(ov.status || '').split(/(?<=\.)\s+/).filter((t) => t && !/^In \S/.test(t) && !/cannot pass the gate/i.test(t)).join(' ');
319
+ 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('');
320
+ 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>`
321
+ + (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>` : '');
322
+ // the Work breakdown: one row per stage, the open stage's tasks under it
323
+ 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>`;
324
+ const rows = W.rows.map((x) => {
325
+ if (x.kind === 'stage' && x.loose) return '';
326
+ 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>`;
327
+ 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>`;
328
+ if (x.kind === 'done') return `<li class="pw-ptk"><button type="button" class="pw-dn" data-pw-done="${esc(x.key)}" aria-expanded="${x.open}">${esc(x.label)}</button></li>`;
329
+ 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>`;
330
+ 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>`;
331
+ return '';
332
+ }).join('');
333
+ 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>` : '';
334
+ 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>`;
335
+ // Artefacts: the merge proposal, then "N documents", which unfolds the list
336
+ const arts = W.artefacts.filter((a) => !a.missing), mg = mergeOf(W.artefacts), open = PH_ARTS.has(oid);
337
+ 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>` : '';
338
+ 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>` : ''}`
339
+ + (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>' : '';
340
+ 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>`;
341
+ return `<div class="pw pw-ph">${head}${gate}${ovH}${wbs}${artH}${ask}</div>`;
342
+ }
343
+
291
344
  /* ── the suggestion as its own page (board 22) ── */
292
345
  function sugPageHtml(s, W) {
293
346
  const items = (s.items || []).slice(0, 8);
@@ -306,9 +359,15 @@ function sugPageHtml(s, W) {
306
359
  * does it in a real session; ✕ hides it on this computer */
307
360
  const DROP = 'pw-dropped';
308
361
  const dropped = () => new Set(store.get(DROP, []));
362
+ let ASK_AT = null; // the initiative shown ({ id, ws }): a phone sends the words to Ask PMOS about it
363
+ function askPage(text) {
364
+ if (!ASK_AT || !ASK_AT.id) return false;
365
+ const q = new URLSearchParams({ ask: ASK_AT.id }); if (text) q.set('q', String(text).slice(0, 500)); if (ASK_AT.ws) q.set('ws', ASK_AT.ws);
366
+ location.assign('/premium.html?' + q.toString()); return true;
367
+ }
309
368
  function sendToChat(text) {
310
369
  const ask = document.querySelector('.cz-pop [data-pop="ask"]'); if (ask && !ask.closest('[hidden]')) ask.click();
311
- const ta = document.querySelector('.cz-pop-chat textarea'); if (!ta) return false;
370
+ const ta = document.querySelector('.cz-pop-chat textarea'); if (!ta) return phone() ? askPage(text) : false;
312
371
  ta.value = text; ta.dispatchEvent(new Event('input', { bubbles: true }));
313
372
  const f = ta.closest('form'); if (f && f.requestSubmit) f.requestSubmit(); else ta.focus();
314
373
  return true;
@@ -371,6 +430,7 @@ export function wire(body, h0, x0) {
371
430
  if (!body) return;
372
431
  // the Viewer reuses its body for the next item: the presses read the item shown now from the body, so one set of listeners serves all
373
432
  body.__pwh = ED.writes(h0); body.__pwx = x0;
433
+ { const o = x0 && x0.o ? x0.o() || {} : {}; ASK_AT = o.id ? { id: String(o.id), ws: o.ws || '' } : null; }
374
434
  { const c = cur(); if (c) { readItems(c.id, (x0.o() || {}).ws, () => redraw()); if (c.S.top) body.scrollTop = c.S.top; }
375
435
  const q = OPEN_ON_DRAW;
376
436
  if (c && q && q.id === String(c.id) && Date.now() - q.at < 15000) { OPEN_ON_DRAW = null; setTimeout(() => { const c2 = cur(); if (c2) openSmall(q.uid, c2, body.__pwh, body.__pwx, body); }, 0); } }
@@ -380,6 +440,12 @@ export function wire(body, h0, x0) {
380
440
  function redraw() { if (body.__pwh && body.__pwh.redraw) body.__pwh.redraw(); }
381
441
  goalsRedraw = artRedraw = wsnRedraw = () => { if (body.isConnected && body.querySelector('.pw')) redraw(); };
382
442
  wireGrip(body);
443
+ // a phone: a proposal swiped right says yes, left says no (its own hidden Yes and No presses, so the popup's writes and Undo stay theirs)
444
+ wireSwipe(body, { on: phone, act: (row, way) => { const b = row.querySelector(way === 'right' ? '[data-sw-yes]' : '[data-sw-no]'); if (b) b.click(); } });
445
+ body.addEventListener('submit', (e) => {
446
+ const f = e.target.closest && e.target.closest('[data-pw-pask]'); if (!f) return;
447
+ e.preventDefault(); const t = f.querySelector('input'); askPage(t ? t.value.trim() : '');
448
+ });
383
449
  const live = (e) => !!body.__pwx && !!e.target.closest('.pw') && !e.target.closest('.pw-sp, [data-pw-level]');
384
450
  body.addEventListener('scroll', () => { if (!body.querySelector(':scope > .pw, .pw:not(.pw-sp)')) return; const c = cur(); if (c) c.S.top = body.scrollTop; }, { passive: true });
385
451
  body.addEventListener('click', async (e) => {
@@ -404,8 +470,10 @@ export function wire(body, h0, x0) {
404
470
  if (d.pwSug) { const s = findSug(W, d.pwSug); if (s) openSug(s, c, x, h); return; }
405
471
  if ('pwProps' in d) { if (h.props) h.props(); return; }
406
472
  if (d.pwLine) { const L = W.overview.lines.find((q) => q.id === d.pwLine); if (L && L.edit) editLine(b, L, c, x, h); return; }
407
- if (d.pwLkeep) { const L = W.overview.lines.find((q) => q.id === d.pwLkeep); if (L && L.ask && !sendToChat(L.ask) && h.toast) h.toast('Open Ask PMOS to send this.'); return; }
408
- if (d.pwLdrop) { const dd = dropped(); dd.add(d.pwLdrop); store.set(DROP, [...dd].slice(-200)); redraw(); return; }
473
+ // a phone asks for several lines in one proposal: "problem,done"
474
+ if (d.pwLkeep) { const asks = d.pwLkeep.split(',').map((k) => W.overview.lines.find((q) => q.id === k)).filter((L) => L && L.ask).map((L) => L.ask); if (asks.length && !sendToChat(asks.join('\n\n')) && h.toast) h.toast('Open Ask PMOS to send this.'); return; }
475
+ if (d.pwLdrop) { const dd = dropped(); for (const k of d.pwLdrop.split(',')) dd.add(k); store.set(DROP, [...dd].slice(-200)); redraw(); return; }
476
+ if ('pwPdocs' in d) { if (PH_ARTS.has(c.id)) PH_ARTS.delete(c.id); else PH_ARTS.add(c.id); redraw(); return; }
409
477
  if (d.pwSrc) { if (h.doc) h.doc(d.pwSrc); return; }
410
478
  if (d.pwChoice) { const [sid, k] = d.pwChoice.split('|'), s = findSug(W, sid), ch = s && s.choices && s.choices[+k]; if (ch && !sendToChat(ch.ask) && h.toast) h.toast('Open Ask PMOS to send this.'); return; }
411
479
  if (d.pwMore != null) { S.moreOpen.add(d.pwMore); redraw(); return; }
@@ -21,6 +21,7 @@
21
21
  * Slots: S2 and S3 load here if their files exist (a missing file is ignored):
22
22
  * cozy-rec-now.js mountNow({ stage, side, bar }, ctx) ctx = { ws, note(), mode(), on(evt, fn), focus(), event, rec }
23
23
  * cozy-rec-present.js mountPresent({ stage, side, bar }, ctx) ctx = { ws, note: { id, title }, event, focus() }
24
+ * cozy-phone-rec.js mountPhoneRec(slots, ctx) a phone only (Ph2_record), with the ⋯ menu (cozy-nav.js)
24
25
  * bar holds [data-slot="now"] and [data-slot="present"] for their buttons.
25
26
  * Adler (batch 17 item 4-B, AdH5): his face with headphones sits after the title while the meeting records: glasses on (listening), honest
26
27
  * while the meeting is not heard, resting with the headphones on while paused. Not recording yet, or stopped: no face (no trigger).
@@ -153,6 +154,8 @@ function drawAsk() {
153
154
  function draw() {
154
155
  const m = modeOf(S.row, held(), C.screen());
155
156
  if (m !== S.mode) { S.mode = m; fire('mode', m); }
157
+ // a phone goes back to Today, which says where the recording was filed, with Undo (Ph2_recdone)
158
+ if (S.mode === 'stopped' && !S.ask && typeof matchMedia === 'function' && matchMedia('(max-width: 760px)').matches) { location.replace('/today.html' + (WS ? '?ws=' + encodeURIComponent(WS) : '')); return; }
156
159
  if (S.mode === 'stopped' && !S.ask) { location.replace('/premium-viewer.html?open=meeting&note=' + encodeURIComponent(ID) + (WS ? '&ws=' + encodeURIComponent(WS) : '')); return; }
157
160
  drawHead(); drawStage(); drawBar(); drawLine(); drawAlert();
158
161
  const say = $('rtMsg'); say.textContent = S.msg && S.mode !== 'idle' ? S.msg : ''; say.hidden = !say.textContent;
@@ -227,6 +230,13 @@ function mountSlots() {
227
230
  drawBar();
228
231
  import('./cozy-rec-now.js').then((M) => M.mountNow && M.mountNow(slots(), { ws: WS, note: () => S.one, mode: () => S.mode, on: (k, fn) => { if (S.on[k]) { S.on[k].add(fn); return () => S.on[k].delete(fn); } return () => {}; },
229
232
  focus: () => S.focus, event: eventOf(), rec: C })).catch(() => {});
233
+ // a phone (Ph2_record): one page, the stop in the header, Shared screen cut to the slide, So far, PMOS proposes; the ⋯ menu as on every phone page.
234
+ // On a phone this tab is the only tab, so its links open here and not in another tab.
235
+ if (typeof matchMedia === 'function' && matchMedia('(max-width: 760px)').matches) {
236
+ const base = document.querySelector('base'); if (base) base.target = '_self';
237
+ import('./cozy-nav.js').then((M) => M.mountNav('rec', document)).catch(() => {});
238
+ import('./cozy-phone-rec.js').then((M) => M.mountPhoneRec(slots(), { note: () => S.one, focus: () => S.focus, mode: () => S.mode, on: (k, fn) => { if (S.on[k]) S.on[k].add(fn); } })).catch(() => {});
239
+ }
230
240
  import('./cozy-rec-present.js').then((M) => M.mountPresent && M.mountPresent(slots(), { ws: WS, note: { id: ID, title: title() }, event: eventOf(), focus: () => S.focus })).catch(() => {});
231
241
  }
232
242
 
@@ -18,12 +18,16 @@ import * as TM from './cozy-today-model.js';
18
18
  import { productName, whenNames } from './scope-chip.js';
19
19
  import * as TP from './cozy-today-view.js';
20
20
  import * as OM from './mention-one-model.js'; // the one mention's title and the self check's proof line (Today round 3)
21
+ import { wireSwipe } from './cozy-phone-swipe.js'; // the phone: rows and the proposal swipe (phone design, Ph2_today)
21
22
 
22
23
  const ASK_SEND = new Set(['session']);
23
24
  export function mountToday(ctx) {
24
- const X = { log: { entries: [], marks: {} }, html: '', model: null, agenda: null, read: false, busy: new Set(), type: '', open: false, hide: new Set(), sopen: new Set() };
25
+ const X = { log: { entries: [], marks: {} }, html: '', model: null, agenda: null, read: false, busy: new Set(), type: '', open: false, hide: new Set(), sopen: new Set(), unfiled: new Set() };
25
26
  const el = document.getElementById('tdPage');
26
- const on = () => !!el && !ctx.isPhone();
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
+ // 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).
29
+ const on = () => !!el;
30
+ const phone = () => ctx.isPhone();
27
31
  const day = () => TM.dayKey(ctx.now());
28
32
 
29
33
  async function read() {
@@ -89,6 +93,14 @@ export function mountToday(ctx) {
89
93
  }
90
94
  if (X.type && !(L.types || {})[X.type]) X.type = '';
91
95
  const cap = document.getElementById('tdCap'), draft = cap ? cap.value : '', focus = !!cap && document.activeElement === cap;
96
+ 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
+ if (html === X.html && el.firstChild) return;
99
+ X.html = html; el.classList.add('tdp');
100
+ const sy = scrollY; el.innerHTML = html; scrollTo(0, sy);
101
+ return;
102
+ }
103
+ el.classList.remove('tdp');
92
104
  const html = TP.pageHtml(L, A, { draft, overview: O, type: X.type, open: X.open || !!X.type, handled: X.type && X.type !== 'Ask' ? [] : handled(), hopen: X.hopen, sopen: [...X.sopen] });
93
105
  if (html === X.html && el.firstChild) return;
94
106
  X.html = html;
@@ -97,6 +109,19 @@ export function mountToday(ctx) {
97
109
  if (el.parentNode) el.parentNode.scrollTop = st;
98
110
  const c2 = document.getElementById('tdCap'); if (c2 && focus) { c2.focus(); c2.setSelectionRange(c2.value.length, c2.value.length); }
99
111
  }
112
+ /* After a meeting (board Ph2_recdone): "Recording filed under <work>" with what came of it, and Undo (the note leaves the work). The
113
+ * newest meeting that ended in the last 3 hours and is filed under an initiative; Undo or a later meeting takes the line away. */
114
+ const FILED_MS = 3 * 3600e3;
115
+ function filedLine() {
116
+ const N = (ctx.notes ? ctx.notes() : []).filter((n) => n && n.state === 'ended' && n.initiative && n.initiative.title && !X.unfiled.has(String(n.id)));
117
+ const at = (n) => Date.parse(n.ended_at || n.updated_at || '') || 0;
118
+ const n = N.sort((a, b) => at(b) - at(a))[0];
119
+ if (!n || ctx.now() - at(n) > FILED_MS) return null;
120
+ const ago = ctx.now() - at(n), min = Math.round((Number(n.meeting_ms) || 0) / 60000), t = n.came && n.came.tasks;
121
+ const d = new Date(at(n)), when = ago < 5 * 60000 ? 'Just now' : String(d.getHours()).padStart(2, '0') + ':' + String(d.getMinutes()).padStart(2, '0');
122
+ const what = [n.summary ? 'summary' : '', t ? t + (t === 1 ? ' task' : ' tasks') : ''].filter(Boolean).join(' and ');
123
+ return { id: String(n.id), title: n.initiative.title, ini: n.initiative.id || null, sub: [when, min ? min + ' min' : '', what].filter(Boolean).join(' · ') };
124
+ }
100
125
  const rowOf = (key) => (X.model ? X.model.rows.flatMap((r) => [r, ...(r.members || [])]).find((r) => r.key === key) : null);
101
126
  const snap = (r) => ({ title: r.title, work: r.work, job: r.job, type: r.type });
102
127
  async function mark1(key, act, extra) {
@@ -300,10 +325,35 @@ export function mountToday(ctx) {
300
325
  if (step(e.key === 'j' ? 1 : -1)) e.preventDefault();
301
326
  });
302
327
  if (el) {
303
- el.addEventListener('click', async (e) => {
328
+ el.addEventListener('click', (e) => {
304
329
  const b = e.target.closest('[data-td]'); if (!b || b.disabled) return;
305
- const act = b.dataset.td, key = b.dataset.key || '';
330
+ run(b.dataset.td, b.dataset.key || '', b);
331
+ });
332
+ // the phone's type filter (Today's log · N All ⌄)
333
+ el.addEventListener('change', (e) => { const t = e.target.closest('[data-td-type]'); if (t) { X.type = t.value; draw(); } });
334
+ // 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
335
+ 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 }); } });
336
+ }
337
+ async function run(act, key, b) {
306
338
  if (act === 'cal') { ctx.openCalendar(); return; }
339
+ // the phone (Ph2_today): Record on the next event starts its recording; with no event, a recording of its own (PMOS names it after)
340
+ if (act === 'rec' || act === 'rec-ev') {
341
+ const x = act === 'rec-ev' && X.agenda && X.agenda.items.find((y) => y.key === key);
342
+ const m = x && x.ref;
343
+ const res = m ? await ctx.record({ id: m.id, at: m.start, end: m.end, title: m.title, app: x.app === 'teams' ? 'other' : x.app }) : ctx.fresh ? await ctx.fresh() : null;
344
+ if (!res || !res.ok) ctx.toast((res && res.error) || 'The recording did not start. Nothing changed.');
345
+ return;
346
+ }
347
+ // Ph2_recdone: Undo takes the recording out of the work it was filed under
348
+ if (act === 'filed-undo') {
349
+ const f = filedLine(); if (!f || f.id !== key) return;
350
+ const r = await ctx.pmPost('/api/notes/link', { id: key, initiative: null }).catch(() => null);
351
+ if (!r || !r.ok) return ctx.toast((r && r.error) || 'It is still filed. Nothing changed.');
352
+ X.unfiled.add(key); draw();
353
+ 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 }; });
354
+ return;
355
+ }
356
+ if (act === 'ov-open') return; // the proposal's words: a swipe answers it
307
357
  if (act === 'fold') { X.open = !X.open; draw(); return; }
308
358
  if (act === 'hfold') { X.hopen = !X.hopen; draw(); return; }
309
359
  if (act === 'h-undo') {
@@ -353,7 +403,8 @@ export function mountToday(ctx) {
353
403
  else if (act === 'lk-yes' || act === 'lk-no') await looks(r, act === 'lk-yes');
354
404
  else if (act === 'same-yes' || act === 'same-no') await same(r, act === 'same-yes');
355
405
  } finally { X.busy.delete(key); if (b.isConnected) b.disabled = false; }
356
- });
406
+ }
407
+ if (el) {
357
408
  // the first line: Enter adds the row, and nothing else happens (no popup, no session)
358
409
  el.addEventListener('submit', async (e) => {
359
410
  if (e.target.id !== 'tdCapF') return;
@@ -1,7 +1,8 @@
1
1
  /* pm/cozy-today-page.css — Today, the place (slice 5 of the six-place navigation; board 1 on Exploring 2; pm/cozy-today-view.js draws it).
2
2
  * today.html on a desk: the white page panel (#hmDesk) holds Today only. Home's list and chat column are not drawn; the chat is the
3
3
  * popup's (pm/cozy-popup.js). One container: the log is one card with a thin border, the agenda one grey box on the right.
4
- * Token vars only (cozy.css :root holds every raw value, and its dark block the dark ones). Nothing animates. The phone keeps Home. */
4
+ * Token vars only (cozy.css :root holds every raw value, and its dark block the dark ones). Nothing animates. A phone draws its own one
5
+ * column (.tdp, at the end of this file) in place of Home's list. */
5
6
 
6
7
  @media (min-width: 761px) {
7
8
  body.cz-today #hmDesk > .hm-list, body.cz-today #hmDesk > .hm-chat, body.cz-today #hmDesk > .cz-pn-div, body.cz-today #hmUnfold, body.cz-today .hm-top { display: none !important; }
@@ -171,3 +172,76 @@ button.td-ev:focus-visible { outline: 2px solid var(--cz-blue); outline-offset:
171
172
  .td-r.mem .td-t { font-weight: var(--fw-regular); }
172
173
  .td-ag.quiet { align-self: start; }
173
174
  .td-quiet { margin: 6px 0 0; font-size: var(--fs-row); color: var(--cz-ink2); }
175
+
176
+ /* ── Today on a phone (phone design, boards Ph2_today, Ph2_todayzero, Ph2_recdone; pm/cozy-today-view.js phonePageHtml) ──
177
+ * One column on the white page, a 16 px gutter, no cards and no boxes: hairlines between the parts. Home's list is not drawn on today.html;
178
+ * a conversation or a page opened from a row covers Today as on Home (body:not(.hm-plist)). Rows swipe (pm/cozy-phone-swipe.js): they pan
179
+ * vertically only, and while a finger moves one its tint says the way. The ⋯ of the menu sits at the top right (cozy-ev.css). */
180
+ @media (max-width: 760px) {
181
+ body.cz-today.hm-plist { background: var(--cz-card); }
182
+ body.cz-today.hm-plist #hmDesk > .hm-list, body.cz-today .hm-plist .hm-top, body.cz-today.hm-plist .hm-top { display: none !important; }
183
+ body.cz-today:not(.hm-plist) .td-page { display: none !important; }
184
+ body.cz-today.hm-plist #hmDesk { padding: 0 16px 48px; }
185
+ .td-page.tdp { display: block; font-family: var(--cz-sans); color: var(--cz-ink); padding-top: calc(env(safe-area-inset-top, 0px) + 18px); }
186
+ .tdp h1, .tdp h2, .tdp p, .tdp ul { margin: 0; padding: 0; }
187
+ .tdp ul { list-style: none; }
188
+ .tdp button { font-family: var(--cz-sans); }
189
+ .tdp-top { padding-right: 40px; display: flex; flex-direction: column; gap: 2px; }
190
+ .tdp-top .td-when { font-size: var(--fs-label); letter-spacing: .04em; text-transform: uppercase; color: var(--cz-ink3); line-height: var(--lh-label); }
191
+ .tdp-top h1 { font-size: var(--fs-display); font-weight: var(--fw-strong); line-height: 1.25; color: var(--cz-ink); }
192
+ /* after a meeting: what was filed, with Undo (Ph2_recdone) */
193
+ .tdp-filed { display: flex; align-items: center; gap: 12px; padding: 14px 0; margin-top: 12px; border-bottom: 1px solid var(--cz-hair); }
194
+ .tdp-filed > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
195
+ .tdp-filed b { font-size: var(--fs-row); font-weight: var(--fw-strong); line-height: var(--lh-row); }
196
+ .tdp-filed small { font-size: var(--fs-meta); color: var(--cz-ink3); line-height: var(--lh-meta); }
197
+ .tdp-ib { flex: none; width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--cz-hair); background: var(--cz-card); color: var(--cz-ink2); display: inline-grid; place-items: center; padding: 0; cursor: pointer; }
198
+ /* the Overview: PMOS's words, one ✦ proposal, the hint */
199
+ .tdp-ov { padding: 16px 0 14px; border-bottom: 1px solid var(--cz-hair); display: flex; flex-direction: column; gap: 6px; }
200
+ .tdp-ov h2 { display: flex; align-items: center; gap: 8px; font-size: var(--fs-label); font-weight: var(--fw-strong); letter-spacing: .08em; text-transform: uppercase; color: var(--cz-ink2); line-height: var(--lh-label); }
201
+ .tdp-ov h2 svg { color: var(--cz-blue); }
202
+ .tdp-ov > p { font-size: var(--fs-row); line-height: var(--lh-body); color: var(--cz-ink); }
203
+ .tdp-zero { padding: 12px 0 14px; border-bottom: 1px solid var(--cz-hair); font-size: var(--fs-row); line-height: var(--lh-body); }
204
+ .tdp-sg { touch-action: pan-y; }
205
+ .tdp-sgt { all: unset; display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; color: var(--cz-blueink); font-size: var(--fs-body); line-height: var(--lh-body); cursor: default; }
206
+ .tdp-sgt svg { flex: none; margin-top: 3px; color: var(--cz-blue); }
207
+ .tdp-ov > .tdp-hint { font-size: var(--fs-meta); color: var(--cz-ink3); line-height: var(--lh-meta); }
208
+ /* the next event and ● Record */
209
+ .tdp-ev { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--cz-hair); }
210
+ .tdp-evt { all: unset; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; cursor: pointer; }
211
+ .tdp-evt:disabled { cursor: default; }
212
+ .tdp-evt b { font-size: var(--fs-row); font-weight: var(--fw-strong); line-height: var(--lh-row); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
213
+ .tdp-evt small { font-size: var(--fs-meta); color: var(--cz-ink3); line-height: var(--lh-meta); }
214
+ .tdp-rec { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 14px; border-radius: 999px; border: 1px solid var(--cz-hair); background: var(--cz-card); color: var(--cz-ink); font-size: var(--fs-row); font-weight: var(--fw-strong); cursor: pointer; }
215
+ .tdp-rec i { width: 9px; height: 9px; border-radius: 50%; background: var(--cz-dot-red); }
216
+ /* Today's log */
217
+ .tdp-lh { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 10px; border-bottom: 1px solid var(--cz-hair); }
218
+ .tdp-lh h2 { font-size: var(--fs-label); font-weight: var(--fw-strong); letter-spacing: .08em; text-transform: uppercase; color: var(--cz-ink2); line-height: var(--lh-label); }
219
+ .tdp-f { position: relative; display: inline-flex; align-items: center; gap: 2px; color: var(--cz-ink3); }
220
+ .tdp-f select { appearance: none; -webkit-appearance: none; border: 0; background: none; font: inherit; font-size: var(--fs-row); color: var(--cz-ink3); padding: 6px 18px 6px 6px; min-height: 36px; text-align: right; }
221
+ .tdp-f svg { position: absolute; right: 0; pointer-events: none; }
222
+ .tdp-r { position: relative; display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--cz-hair); background: var(--cz-card); touch-action: pan-y; }
223
+ .tdp-r.sw-on { transition: none; }
224
+ .tdp-r.sw-r { box-shadow: inset 4px 0 0 var(--cz-dot-ok); }
225
+ .tdp-r.sw-l { box-shadow: inset -4px 0 0 var(--cz-dot-q); }
226
+ .tdp-sg.sw-r .tdp-sgt { color: var(--cz-dot-ok); }
227
+ .tdp-sg.sw-l .tdp-sgt { color: var(--cz-ink3); }
228
+ .tdp-b { flex: none; width: 14px; font-style: normal; font-size: var(--fs-panel); line-height: 26px; text-align: center; color: var(--cz-ink); }
229
+ .tdp-x { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
230
+ .tdp-t { all: unset; font-size: var(--fs-row); font-weight: var(--fw-strong); line-height: var(--lh-row); color: var(--cz-ink); overflow-wrap: anywhere; cursor: pointer; }
231
+ span.tdp-t { cursor: default; }
232
+ .tdp-m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: var(--fs-meta); color: var(--cz-ink3); line-height: var(--lh-meta); }
233
+ .tdp-m i { font-style: normal; }
234
+ .tdp-m em { font-style: normal; color: var(--cz-late); }
235
+ .tdp-pro { display: flex; align-items: flex-start; gap: 8px; margin-top: 4px; font-size: var(--fs-body); color: var(--cz-ink2); line-height: var(--lh-body); }
236
+ .tdp-pro svg { flex: none; margin-top: 3px; color: var(--cz-blue); }
237
+ .tdp-r.done .tdp-t, .tdp-r.done .tdp-b { color: var(--cz-ink3); }
238
+ /* Can wait: one line; on a zero day its own short part (Ph2_todayzero) */
239
+ .tdp-cw { all: unset; display: flex; align-items: center; gap: 8px; padding: 14px 0; font-size: var(--fs-body); color: var(--cz-ink3); cursor: pointer; line-height: var(--lh-body); }
240
+ .tdp-cw b { color: var(--cz-ink); font-weight: var(--fw-strong); }
241
+ .tdp-cw[aria-expanded="true"] svg { transform: rotate(180deg); }
242
+ .tdp-cw0 h2 { padding: 22px 0 6px; font-size: var(--fs-label); font-weight: var(--fw-regular); letter-spacing: .08em; text-transform: uppercase; color: var(--cz-ink3); line-height: var(--lh-label); }
243
+ .tdp-cw0 h2 em { font-style: normal; margin-left: 6px; }
244
+ .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; }
245
+ .tdp-cwl svg { color: var(--cz-ink3); }
246
+ .tdp :focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
247
+ }