create-pmos 0.746.0 → 0.748.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.746.0",
3
+ "version": "0.748.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,32 @@
33
33
  "audit"
34
34
  ],
35
35
  "pmosChanges": [
36
+ {
37
+ "v": "0.748.0",
38
+ "at": "2026-11-23T14:27:01.777Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1677,
43
+ "t": "The work popup's date press opens the range picker; keep its focus",
44
+ "s": "The work popup's date press opens the range picker; keep its focus",
45
+ "k": "x"
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "v": "0.747.0",
51
+ "at": "2026-11-23T13:39:39.287Z",
52
+ "f": 4,
53
+ "prs": [
54
+ {
55
+ "n": 1676,
56
+ "t": "A guided tour, press Next to walk through a workspace",
57
+ "s": "A guided tour, press Next to walk through a workspace",
58
+ "k": "new"
59
+ }
60
+ ]
61
+ },
36
62
  {
37
63
  "v": "0.746.0",
38
64
  "at": "2026-11-23T11:03:05.465Z",
@@ -598,38 +624,6 @@
598
624
  }
599
625
  }
600
626
  ]
601
- },
602
- {
603
- "v": "0.724.0",
604
- "at": "2026-11-23T02:49:31.191Z",
605
- "f": 4,
606
- "prs": [
607
- {
608
- "n": 1601,
609
- "t": "Jira reads work through the official Atlassian MCP connector",
610
- "s": "Jira reads work through the official Atlassian MCP connector",
611
- "k": "fix"
612
- }
613
- ]
614
- },
615
- {
616
- "v": "0.723.0",
617
- "at": "2026-11-23T01:56:36.110Z",
618
- "f": 4,
619
- "prs": [
620
- {
621
- "n": 1599,
622
- "t": "Pmos why coverage leaves out Closed, Cancelled and Killed records",
623
- "s": "Pmos why coverage leaves out Closed, Cancelled and Killed records",
624
- "k": "fix"
625
- },
626
- {
627
- "n": 1600,
628
- "t": "Pinned views' Unpin is the system's pm-btn (Checker V6, job #1558)",
629
- "s": "Pinned views' Unpin is the system's pm-btn (Checker V6, job #1558)",
630
- "k": "fix"
631
- }
632
- ]
633
627
  }
634
628
  ]
635
629
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@9e1bb9bf
1
+ kernel-source: pmos@d53c1304
2
2
  assembled: 2026-11-23
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-23T11:03:02Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-23T14:26:58Z"}
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-23T11:03:02Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-23T14:26:58Z"}
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-23T11:03:02Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-23T14:26:58Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,30 @@
1
1
  [
2
+ {
3
+ "v": "0.748.0",
4
+ "at": "2026-11-23T14:27:01.777Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1677,
9
+ "t": "The work popup's date press opens the range picker; keep its focus",
10
+ "s": "The work popup's date press opens the range picker; keep its focus",
11
+ "k": "x"
12
+ }
13
+ ]
14
+ },
15
+ {
16
+ "v": "0.747.0",
17
+ "at": "2026-11-23T13:39:39.287Z",
18
+ "f": 4,
19
+ "prs": [
20
+ {
21
+ "n": 1676,
22
+ "t": "A guided tour, press Next to walk through a workspace",
23
+ "s": "A guided tour, press Next to walk through a workspace",
24
+ "k": "new"
25
+ }
26
+ ]
27
+ },
2
28
  {
3
29
  "v": "0.746.0",
4
30
  "at": "2026-11-23T11:03:05.465Z",
@@ -122,7 +122,7 @@ Press an initiative's name in the list, or open `?ini=<id>`. The list stays as i
122
122
  - **Tasks** show one row (one group) for each stage of the workflow, in order. Finished stages and later stages are never merged into one row; they start folded, and the current stage and any stage with a late task start open.
123
123
  - **Change a task where it is.** In the List, press a task's name. The row opens in place: change the name (Enter saves), the status, and the dates. Only one row is open at a time. Esc closes it. The ⋯ after the dates has **Milestone** (or **Make it a plain task**), **Move to a stage**, **Open the task card** and **Delete task**. A milestone has one date: its due day. Each change shows **Undo**.
124
124
  - In the List, a task's full name always shows: a long name wraps onto more lines. A short prefix such as "Bus shelter:" stays in the name, in grey. The dates show at the right. In a narrow panel or on a phone, the dates show under the name. On a computer, the Timeline's name column wraps a long name too, and its row grows; on a phone, each title stays on one line above its bar. On the Timeline, the blue Today line is your own day, from the clock of your device. Each bar starts on its start day and ends on its due day: a task that starts today starts at the Today line, and a bar, its grid line and its date at the top always meet on the same day. A task with no dates shows no date; open the row to set them.
125
- - **Set the dates on one calendar.** Every date press of a task opens the same calendar: in the List, the Timeline, the task card and the work popup. Press the first day for the start and a second day for the due day, as you pick depart and return for a flight. The days between show as one band. A day before the start becomes the new start. Press **Start** or **Due** first to change only that end, or type a day such as "15 Oct" in it and press Enter. A milestone has one **Date**: one press sets it. **No date** clears the dates. Each press saves and shows **Undo**. The arrow keys move a day or a week, and Page Up and Page Down move a month. On a phone the calendar opens from the bottom of the screen.
125
+ - **Set the dates on one calendar.** Every date press of a task opens the same calendar: in the List, the Timeline, the task card and the work popup. Press the first day for the start and a second day for the due day, as you pick depart and return for a flight. The days between show as one band. A day before the start becomes the new start. Press **Start** or **Due** first to change only that end, or type a day such as "15 Oct" in it and press Enter. A milestone has one **Date**: one press sets it. **No date** clears the dates. Each press saves and shows **Undo**. The calendar opens with the focus on a day. The arrow keys move a day or a week, Home and End go to the start and end of the week, and Page Up and Page Down move a month. On a phone the calendar opens from the bottom of the screen.
126
126
  - **Add a task to a stage.** Press **+** on an open stage. The field opens at the top of that stage, with one row of chips under it. **Stage** is the stage you pressed + on; press it to pick another stage of the workflow. **Task** can change to **Milestone**: the box becomes ◇ and **Date** takes one day. **Dates** and **Owner** are optional; with no owner, the task is yours. Enter adds the task and keeps the field open for the next one. Esc closes the field.
127
127
  - **Move a task between stages.** On a computer, drag the grip at the left of a row. On a phone, press and hold the task's name, then drag. Drop it on a stage name to put it last in that stage, or between two rows to put it there. The status and the dates do not change. The message shows **Undo**.
128
128
  - A linked Jira ticket opens in place too. Its name and status stay Jira's ("In Progress in Jira · read 4 min ago"). Its dates can change, and it can be a milestone. It has no **Delete**.
@@ -42,6 +42,7 @@ PMOS has three places: **Home**, **Board** and **Intelligence**. The round menu
42
42
 
43
43
  - [What PMOS does behind the scenes](agent-capabilities.md): every job PMOS runs by itself, when it runs, what it reads, where you see it, how to stop it, and what it fixes by itself; the three classes of change (D106), what is applied at once with Undo, what waits for you, and how a job goes back to propose; long-running goals; the team of role agents; the idle lab; and the PM-only acts, how each is checked and recorded, and how an agent's act is logged under its name (D98).
44
44
  - [Layout and first run](layout.md): the three places, the menu button, the Viewer and its trail, docking panels, the keys and the phone; the first run; why a new PMOS starts quiet and what opens each place; the PMOS app and the login item; and Adler, PMOS's face, with Settings › General › Adler.
45
+ - [A guided tour](tour.md): press Next to walk through a workspace, put a step's words in the chat box, and write a workspace's own tour in pmos/tour.json.
45
46
  - [Run PMOS in the cloud](cloud.md): move PMOS from the Mac to an always-on server with one paste, the one sign-in that is yours, what runs on the server, `pmos-cloud`, and how to go back to the Mac.
46
47
  - [Settings, switches and data freshness](settings-and-switches.md): what each section of Settings holds, every `PMOS_` environment variable with its default and the Settings entry that does the same, and when each source is read again and how old it is.
47
48
 
@@ -0,0 +1,41 @@
1
+ ---
2
+ type: Guide
3
+ title: "A guided tour: press Next to walk through a workspace"
4
+ description: "How a workspace's tour works, how to start, move through and end it, and how to write pmos/tour.json."
5
+ timestamp: 2026-11-23
6
+ ---
7
+
8
+ # A guided tour
9
+
10
+ A workspace can hold a guided tour. Use it to show PMOS to other people, or to learn a sample workspace step by step. The Lendly demo workspace has one.
11
+
12
+ ## Start, move and end
13
+
14
+ 1. When a workspace has a tour, a small **Tour** control shows at the bottom right of every page. Press it to start.
15
+ 2. A card shows the step: its number, its title and a few lines on why it matters.
16
+ 3. Press **Next** (or →) to go on. When the next step names a page, PMOS opens that page and the card follows. Press ← (or the Back arrow) to go one step back.
17
+ 4. Some steps put words in the chat box. The card shows the words. Read them and press send in the chat when you are ready. The tour never sends a message by itself and never runs a command.
18
+ 5. Press **Finish** on the last step, or × on the card, to end the tour. The Tour control shows again, so you can start again.
19
+
20
+ × on the Tour control hides it. To show it again, add `?tour=start` to the address of any page, for example `/today.html?tour=start`. The tour then starts at step 1.
21
+
22
+ The card works on a phone: it spans the width of the screen, above the bottom bar.
23
+
24
+ ## Write a tour
25
+
26
+ A tour is the file `pmos/tour.json` in the workspace's folder:
27
+
28
+ ```json
29
+ {
30
+ "title": "Lendly tour",
31
+ "steps": [
32
+ { "title": "Today", "text": "What needs you today, in one place.", "open": "/today.html" },
33
+ { "title": "Capture an idea", "text": "PMOS writes the PRD draft.", "open": "/premium-board.html", "chat": "Capture this idea: a waitlist for borrowed books." }
34
+ ]
35
+ }
36
+ ```
37
+
38
+ - `title` and `text`: what the card says. A title has at most 80 characters, and the text at most 600.
39
+ - `open` (optional): the page to open, as a path on this PMOS, for example `/premium-goals.html` or `/premium-board.html?focus=<initiative id>`. PMOS adds the workspace to the address. A full web address is ignored.
40
+ - `chat` (optional): words to put in the chat box, at most 600 characters.
41
+ - A tour has at most 40 steps. PMOS reads the file again each time a page opens, so a change shows at the next Next.
@@ -81,6 +81,7 @@ const MODULES = Object.freeze([
81
81
  'routes-inbox', // premium-agent-inbox: the bell's agent results and the PM's seen marks (page press only)
82
82
  'routes-search', // premium-uncovered-features (E1): Search across the repository and every worktree (read-only)
83
83
  'routes-news', // premium-uncovered-features (E2): New for you, the FYI items, and their seen marks (page press only)
84
+ 'routes-tour', // workspace-tour: the guided tours of the registered workspaces, from each pmos/tour.json (read-only)
84
85
  'routes-slash', // testing fixes: the chat box's / menu, every command Claude Code takes plus the workspace's and the PM's own (read-only)
85
86
  'routes-phone-day', // phone companion: the agent's finished drafts, the evening recap and tomorrow at a glance (read-only)
86
87
  'routes-records', // console3 E1a: ideas, hypotheses, decisions, KR metrics, bets (GET list; page-press add/edit/reading)
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+ /* routes-tour.js — GET /api/tour: the guided tours of the registered workspaces (initiative workspace-tour, lib/tour.js).
3
+ *
4
+ * GET /api/tour → { ok: true, tours: [{ ws, name, title, steps }] } a workspace with no pmos/tour.json lists nothing
5
+ *
6
+ * Read-only: it reads each workspace's tour file and writes nothing. public/pm/tour.js draws the Tour control and the step card. */
7
+ const Tour = require('./tour.js');
8
+
9
+ module.exports = {
10
+ prefixes: ['/api/tour'],
11
+ handle: async (req, res, url, ctx) => {
12
+ if (url.pathname !== '/api/tour') return false;
13
+ if (req.method !== 'GET') { ctx.json(res, { ok: false, error: 'GET only' }, 405); return true; }
14
+ const rows = typeof ctx.workspaceList === 'function' ? ctx.workspaceList() : [];
15
+ ctx.json(res, { ok: true, tours: Tour.list(rows) });
16
+ return true;
17
+ },
18
+ };
@@ -0,0 +1,72 @@
1
+ 'use strict';
2
+ /* tour.js — a workspace's guided tour (initiative workspace-tour; done test planning/done-tests/workspace-tour.md).
3
+ *
4
+ * A workspace can hold a tour in `pmos/tour.json`: ordered steps a presenter walks with Next, or a new person follows the first time.
5
+ * Each step has a title and a short explanation, and can name a page to open and words to put in the chat box:
6
+ *
7
+ * { "title": "Lendly tour", "steps": [
8
+ * { "title": "Today", "text": "What needs you today …", "open": "/today.html" },
9
+ * { "title": "Ask PMOS for an idea", "text": "…", "open": "/premium-board.html", "chat": "Capture this idea: …" } ] }
10
+ *
11
+ * clean(raw) → { ok: true, title, steps } | { ok: false, error } checks and caps one parsed file
12
+ * read(root) → the same for the file in `root`, or null when the workspace has no tour
13
+ * list(workspaces) → [{ ws, name, title, steps }] the tours of the registered workspaces ([{ id, root, label|name }])
14
+ *
15
+ * A TOUR ONLY SHOWS AND SAYS. A step's `open` must be a path on this server (one leading `/`, no scheme, no `//`); any other value is
16
+ * dropped and the step keeps its words. A step's `chat` words go into the chat box for the person to read and send (public/pm/tour.js
17
+ * through page-chat.js ask): a tour never sends a message and never runs a command. Pure of the network; fs only.
18
+ */
19
+ const fs = require('fs');
20
+ const path = require('path');
21
+
22
+ const FILE = path.join('pmos', 'tour.json');
23
+ const MAX_STEPS = 40;
24
+ const MAX_TITLE = 80;
25
+ const MAX_TEXT = 600;
26
+ const MAX_OPEN = 300;
27
+
28
+ const str = (v, n) => (typeof v === 'string' ? v.replace(/\r\n?/g, '\n').trim().slice(0, n) : '');
29
+ /** A path on this server, or '' (a full URL, `//host`, `javascript:` and the like are dropped). */
30
+ function pageOf(v) {
31
+ const s = str(v, MAX_OPEN);
32
+ if (!s || s[0] !== '/' || s[1] === '/' || s[1] === '\\' || /[\s<>"'`]/.test(s) || /^\/[^?#]*:/.test(s)) return '';
33
+ return s;
34
+ }
35
+
36
+ function clean(raw) {
37
+ if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return { ok: false, error: 'a tour is a JSON object with a "steps" list' };
38
+ if (!Array.isArray(raw.steps)) return { ok: false, error: 'the tour has no "steps" list' };
39
+ const steps = [];
40
+ for (const s of raw.steps.slice(0, MAX_STEPS)) {
41
+ if (!s || typeof s !== 'object') continue;
42
+ const title = str(s.title, MAX_TITLE), text = str(s.text, MAX_TEXT);
43
+ if (!title && !text) continue;
44
+ const step = { title: title || 'Step ' + (steps.length + 1), text };
45
+ const open = pageOf(s.open); if (open) step.open = open;
46
+ const chat = str(s.chat, MAX_TEXT); if (chat) step.chat = chat;
47
+ steps.push(step);
48
+ }
49
+ if (!steps.length) return { ok: false, error: 'the tour has no step with a title or words' };
50
+ return { ok: true, title: str(raw.title, MAX_TITLE) || 'Tour', steps };
51
+ }
52
+
53
+ function read(root) {
54
+ if (!root) return null;
55
+ let text;
56
+ try { text = fs.readFileSync(path.join(root, FILE), 'utf8'); } catch { return null; }
57
+ let raw;
58
+ try { raw = JSON.parse(text); } catch { return { ok: false, error: FILE + ' is not JSON' }; }
59
+ return clean(raw);
60
+ }
61
+
62
+ function list(workspaces) {
63
+ const out = [];
64
+ for (const w of workspaces || []) {
65
+ if (!w || !w.id || !w.root) continue;
66
+ const t = read(w.root);
67
+ if (t && t.ok) out.push({ ws: w.id, name: w.label || w.name || w.id, title: t.title, steps: t.steps });
68
+ }
69
+ return out;
70
+ }
71
+
72
+ module.exports = { clean, read, list, pageOf, FILE, MAX_STEPS, MAX_TITLE, MAX_TEXT };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.746.0",
3
+ "version": "0.748.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.746.0",
9
+ "version": "0.748.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.746.0",
3
+ "version": "0.748.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",
@@ -358,5 +358,7 @@ export function mountNav(here, doc = document, opts = {}) {
358
358
  if (typeof matchMedia === 'function') { const mq = matchMedia(DESK); const f = () => { if (!N.rail) set(false); draw(); }; if (mq.addEventListener) mq.addEventListener('change', f); }
359
359
  if (typeof matchMedia === 'function') { const mp = matchMedia(PHONE_Q); const f = () => { if (!N.rail) set(false); }; if (mp.addEventListener) mp.addEventListener('change', f); }
360
360
  window.addEventListener('pm:sources', (e) => { const d = e.detail; if (d && d.ok) { N.stale = bannerOf(d.sources); draw(); } });
361
+ // a workspace's guided tour (initiative workspace-tour): the Tour control or the step card, only when a workspace holds pmos/tour.json
362
+ if (typeof document !== 'undefined' && doc === document) import('./tour.js').then((m) => m.boot()).catch(() => {});
361
363
  return w;
362
364
  }
@@ -944,7 +944,8 @@ function dateMenu(btn, uid, c, h) {
944
944
  const el = openPop(btn, 'pw-date', seg + `<div class="pw-rp">${rangeHtml(R)}</div>` + jiraNote(row), (b) => {
945
945
  if (b.dataset.ty) { const on = b.dataset.ty === 'ms'; closePop(); if (on !== !!row.ms) setKind(row, on, h); }
946
946
  }, { label: 'Set the date', focus: '.rp-g [tabindex="0"]' });
947
- mountRange(el.querySelector('.pw-rp'), { ...R, onPick: (patch, done) => { if (done) closePop(); if (h.dates) h.dates(uid, patch); } });
947
+ // mountRange draws the markup again, so the day openPop focused is gone: give the focus to the new one
948
+ mountRange(el.querySelector('.pw-rp'), { ...R, onPick: (patch, done) => { if (done) closePop(); if (h.dates) h.dates(uid, patch); } }).focus();
948
949
  }
949
950
  function rowMenu(btn, uid, c, h, body) {
950
951
  const row = c.W.rows.find((x) => x.uid === uid) || {};
@@ -0,0 +1,27 @@
1
+ /* tour.css — the guided tour's control and step card (public/pm/tour.js, initiative workspace-tour). Tokens only. */
2
+ .tr-card,.tr-go{position:fixed;z-index:2147483000;font-family:inherit;color:var(--cz-ink, var(--foreground))}
3
+ .tr-card{left:50%;bottom:var(--space-24,24px);transform:translateX(-50%);width:min(440px,calc(100vw - 32px));background:var(--card);
4
+ border:1px solid var(--cz-hair, var(--border));border-radius:8px;box-shadow:var(--cz-lift, var(--lift));padding:var(--space-16,16px) var(--space-16,16px) var(--space-12,12px)}
5
+ .tr-top{display:flex;align-items:center;gap:var(--space-8,8px);font-size:var(--fs-meta);color:var(--cz-ink3, var(--muted-foreground))}
6
+ .tr-top span{flex:1}
7
+ .tr-bar{display:block;width:100%;height:3px;margin:var(--space-8,8px) 0 var(--space-12,12px);border:0;border-radius:0;background:var(--cz-well, var(--muted));accent-color:var(--cz-blue, var(--primary));appearance:none}
8
+ .tr-bar::-webkit-progress-bar{background:var(--cz-well, var(--muted))}
9
+ .tr-bar::-webkit-progress-value{background:var(--cz-blue, var(--primary))}
10
+ .tr-bar::-moz-progress-bar{background:var(--cz-blue, var(--primary))}
11
+ .tr-card h2{margin:0 0 var(--space-8,8px);font-size:var(--fs-section);font-weight:var(--fw-strong)}
12
+ .tr-card p{margin:0 0 var(--space-8,8px);font-size:var(--fs-body);color:var(--cz-ink, var(--foreground));white-space:pre-line}
13
+ .tr-chat{margin:0 0 var(--space-8,8px);padding:var(--space-8,8px) var(--space-12,12px);border-radius:8px;background:var(--cz-well, var(--muted));font-size:var(--fs-meta);color:var(--cz-ink, var(--foreground))}
14
+ .tr-chat b{display:block;font-weight:var(--fw-strong);color:var(--cz-ink3, var(--muted-foreground));font-size:var(--fs-badge)}
15
+ .tr-row{display:flex;align-items:center;justify-content:flex-end;gap:var(--space-8,8px);margin-top:var(--space-12,12px)}
16
+ .tr-card button,.tr-go button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;min-width:36px;border-radius:6px;
17
+ border:1px solid var(--cz-hair, var(--border));background:transparent;color:inherit;font:inherit;font-size:var(--fs-body);cursor:pointer;padding:0 var(--space-12,12px)}
18
+ .tr-card .tr-x{border:0;min-height:28px;min-width:28px;padding:0}
19
+ .tr-card .tr-next{background:var(--cz-blue, var(--primary));color:var(--cz-onsolid, var(--primary-foreground));border-color:transparent;padding:0 var(--space-16,16px)}
20
+ .tr-card button:disabled{opacity:.4;cursor:default}
21
+ .tr-card button:focus-visible,.tr-go button:focus-visible{outline:2px solid color-mix(in oklab, var(--ring, var(--cz-blue)) 50%, var(--cz-ink, var(--foreground)));outline-offset:2px}
22
+ .tr-go{right:var(--space-16,16px);bottom:var(--space-16,16px);display:flex;gap:4px;background:var(--card);border:1px solid var(--cz-hair, var(--border));border-radius:8px;box-shadow:var(--cz-float, var(--raise));padding:4px}
23
+ .tr-go button{border:0}
24
+ .tr-go .tr-x{min-width:28px;padding:0;color:var(--cz-ink3, var(--muted-foreground))}
25
+ @media (pointer: coarse){.tr-card button,.tr-go button{min-height:44px;min-width:44px}}
26
+ @media (max-width:760px){.tr-card,.tr-go{bottom:calc(76px + env(safe-area-inset-bottom,0px))}}
27
+ @media print{.tr-card,.tr-go{display:none}}
@@ -0,0 +1,131 @@
1
+ /* pm/tour.js — a workspace's guided tour (initiative workspace-tour; lib/tour.js, GET /api/tour).
2
+ *
3
+ * A workspace that holds pmos/tour.json shows a small Tour control at the foot of every page that has the menu (cozy-nav.js mountNav
4
+ * loads this file). Start opens the first step. Each step is one card: "Step 3 of 14", its title, a few lines of context, and Back and
5
+ * Next. Next opens the step's page when it names one (the workspace is added to the address), and the card follows on that page.
6
+ * A step with chat words puts them in the chat box (page-chat.js ask): the presenter reads them and sends them. A tour never sends a
7
+ * message and never runs a command.
8
+ *
9
+ * boot() draws the control or the card for this page; nothing at all when no workspace has a tour
10
+ * ?tour=start in any page address starts the first tour again (after × hid the control)
11
+ *
12
+ * State is one localStorage key, 'pmos.tour': { ws, i, chatAt } while a tour runs, { hidden: [ws] } after × on the control. On a phone
13
+ * the card spans the width, above the bottom bar. Keys: → Next, ← Back, while the focus is not in a text box. */
14
+ import { pmGet } from './http.js';
15
+
16
+ const KEY = 'pmos.tour';
17
+ const NEXT = 'M5 12h14M13 6l6 6-6 6';
18
+ const BACK = 'M19 12H5M11 6l-6 6 6 6';
19
+ const PLAY = 'M8 5v14l11-7z';
20
+ const CLOSE = 'M6 6l12 12M18 6L6 18';
21
+ const esc = (v) => String(v == null ? '' : v).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
22
+ const svg = (d) => `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"/></svg>`;
23
+ const load = () => { try { return JSON.parse(localStorage.getItem(KEY) || 'null') || {}; } catch { return {}; } };
24
+ const save = (v) => { try { localStorage.setItem(KEY, JSON.stringify(v)); } catch { /* private window: the tour still runs on this page */ } };
25
+
26
+ const CSS = new URL('./tour.css', import.meta.url).href;
27
+
28
+ /** A page address split by hand into its path, its query and its hash (no URL base is needed). */
29
+ function split(h) {
30
+ const m = /^([^?#]*)(\?[^#]*)?(#.*)?$/.exec(String(h || '')) || [];
31
+ return { path: m[1] || '', q: new URLSearchParams((m[2] || '').slice(1)), hash: m[3] || '' };
32
+ }
33
+ /** The step's address with the tour's workspace added, unless the address names one. */
34
+ export function hrefOf(step, ws) {
35
+ if (!step || !step.open) return '';
36
+ const u = split(step.open);
37
+ if (ws && !u.q.has('ws')) u.q.set('ws', ws);
38
+ const q = u.q.toString();
39
+ return u.path + (q ? '?' + q : '') + u.hash;
40
+ }
41
+ /** True when the page at `loc` ({ pathname, search }) is the step's page: the same path, and every parameter the step names. */
42
+ export function isAt(href, loc) {
43
+ if (!href) return true;
44
+ const u = split(href), here = new URLSearchParams(loc.search || '');
45
+ if (u.path !== loc.pathname) return false;
46
+ for (const [k, v] of u.q) if (here.get(k) !== v) return false;
47
+ return true;
48
+ }
49
+
50
+ let T = null; // { tours, tour, el, go }
51
+
52
+ function sheet() {
53
+ if (document.getElementById('tr-css')) return;
54
+ const l = document.createElement('link'); l.id = 'tr-css'; l.rel = 'stylesheet'; l.href = CSS; document.head.appendChild(l);
55
+ }
56
+ function clear() { for (const k of ['el', 'go']) { if (T && T[k]) { T[k].remove(); T[k] = null; } } }
57
+
58
+ function drawGo(tour) {
59
+ clear();
60
+ const go = document.createElement('div');
61
+ go.className = 'tr-go'; go.setAttribute('role', 'group'); go.setAttribute('aria-label', tour.title);
62
+ go.innerHTML = `<button type="button" class="tr-start" title="Start the tour: ${esc(tour.title)}" aria-label="Start the tour: ${esc(tour.title)}">${svg(PLAY)}<span>Tour</span></button>`
63
+ + `<button type="button" class="tr-x" title="Hide the tour" aria-label="Hide the tour">${svg(CLOSE)}</button>`;
64
+ go.querySelector('.tr-start').onclick = () => to(tour, 0);
65
+ go.querySelector('.tr-x').onclick = () => { const s = load(); save({ hidden: [...new Set([...(s.hidden || []), tour.ws])] }); clear(); };
66
+ document.body.appendChild(go); T.go = go;
67
+ }
68
+
69
+ function drawCard(tour, i) {
70
+ clear();
71
+ const st = tour.steps[i], n = tour.steps.length, last = i === n - 1;
72
+ const el = document.createElement('section');
73
+ el.className = 'tr-card'; el.setAttribute('role', 'dialog'); el.setAttribute('aria-modal', 'false'); el.setAttribute('aria-labelledby', 'tr-h');
74
+ el.innerHTML = `<div class="tr-top"><span>${esc(tour.title)} · Step ${i + 1} of ${n}</span>`
75
+ + `<button type="button" class="tr-x" title="End the tour" aria-label="End the tour">${svg(CLOSE)}</button></div>`
76
+ + `<progress class="tr-bar" max="${n}" value="${i + 1}" aria-hidden="true"></progress>`
77
+ + `<h2 id="tr-h">${esc(st.title)}</h2>` + (st.text ? `<p>${esc(st.text)}</p>` : '')
78
+ + (st.chat ? `<div class="tr-chat"><b>In the chat box, ready to send</b>${esc(st.chat)}</div>` : '')
79
+ + `<div class="tr-row"><button type="button" class="tr-back" title="Back" aria-label="Back"${i === 0 ? ' disabled' : ''}>${svg(BACK)}</button>`
80
+ + `<button type="button" class="tr-next">${last ? 'Finish' : 'Next'}${last ? '' : svg(NEXT)}</button></div>`;
81
+ el.querySelector('.tr-x').onclick = end;
82
+ el.querySelector('.tr-back').onclick = () => to(tour, i - 1);
83
+ el.querySelector('.tr-next').onclick = () => (last ? end() : to(tour, i + 1));
84
+ document.body.appendChild(el); T.el = el;
85
+ el.querySelector('.tr-next').focus({ preventScroll: true });
86
+ const s = load();
87
+ if (st.chat && s.chatAt !== i) { // the step's words go in the chat box once per arrival, for the presenter to send
88
+ save({ ...s, chatAt: i });
89
+ import('./page-chat.js').then((m) => m.ask(st.chat, { ws: tour.ws })).catch(() => {});
90
+ }
91
+ }
92
+
93
+ function to(tour, i) {
94
+ if (i < 0 || i >= tour.steps.length) return;
95
+ const s = load();
96
+ save({ ws: tour.ws, i, chatAt: s.ws === tour.ws && s.i === i ? s.chatAt : -1 });
97
+ const href = hrefOf(tour.steps[i], tour.ws);
98
+ if (href && !isAt(href, location)) { location.assign(href); return; }
99
+ drawCard(tour, i);
100
+ }
101
+ function end() { const s = load(); save({ hidden: s.hidden || [] }); clear(); if (T && T.tour) drawGo(T.tour); }
102
+
103
+ function keys(e) {
104
+ if (!T || !T.el || e.altKey || e.ctrlKey || e.metaKey) return;
105
+ const t = e.target, tag = t && t.tagName;
106
+ if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT' || (t && t.isContentEditable)) return;
107
+ if (e.key === 'ArrowRight') { e.preventDefault(); T.el.querySelector('.tr-next').click(); }
108
+ else if (e.key === 'ArrowLeft') { const b = T.el.querySelector('.tr-back'); if (!b.disabled) { e.preventDefault(); b.click(); } }
109
+ }
110
+
111
+ export async function boot() {
112
+ if (typeof document === 'undefined' || T) return;
113
+ T = { tours: [], tour: null, el: null, go: null };
114
+ const r = await pmGet('/api/tour');
115
+ const tours = r && r.ok && Array.isArray(r.tours) ? r.tours : [];
116
+ if (!tours.length) return;
117
+ T.tours = tours;
118
+ const p = new URLSearchParams(location.search), s = load();
119
+ const pick = (ws) => tours.find((t) => t.ws === ws) || null;
120
+ sheet();
121
+ document.addEventListener('keydown', keys);
122
+ if (p.get('tour') === 'start') {
123
+ const tour = pick(p.get('ws')) || tours[0];
124
+ T.tour = tour; save({ hidden: (s.hidden || []).filter((w) => w !== tour.ws) }); return to(tour, 0);
125
+ }
126
+ const running = s.ws ? pick(s.ws) : null;
127
+ if (running && Number.isInteger(s.i) && s.i >= 0 && s.i < running.steps.length) { T.tour = running; return drawCard(running, s.i); }
128
+ const tour = pick(p.get('ws')) || tours.find((t) => !(s.hidden || []).includes(t.ws));
129
+ if (!tour || (s.hidden || []).includes(tour.ws)) return;
130
+ T.tour = tour; drawGo(tour);
131
+ }
@@ -11,7 +11,9 @@
11
11
  * S9 a Jira row: title and status read-only, "<Status> in Jira · read N min ago", dates editable, no Delete
12
12
  * S10 drag on a desktop: to another stage (section + order), inside a stage (order only, kept on the next read)
13
13
  * S11 a long press on a phone's title lifts the row · S12 a milestone on the Timeline is its ◇ only; Kanban says "◇ Nov 14"
14
- * S13 light and dark, phone and desktop: no page error. PMOS_SHOTS=<dir> writes the screens. */
14
+ * S13 light and dark, phone and desktop: no page error
15
+ * S14 the work popup on a desk: a row's date press opens the one calendar with the focus on a day; two taps save Start and Due.
16
+ * PMOS_SHOTS=<dir> writes the screens. */
15
17
  const path = require('path');
16
18
  const { besidePage } = require('./lib/beside-page'); // these checks read the full page beside the page; in the popup work shows its three parts (nav slice 3)
17
19
  const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
@@ -63,10 +65,11 @@ const TICKETS = [{ key: 'IDPF-3387', title: 'Refactor the AppAuthService', statu
63
65
  browser = besidePage(classicBoard(await chromium.launch({ executablePath: exe })));
64
66
 
65
67
  // where: 'home' (premium.html's Viewer) or 'board' (the Board's panel)
66
- const open = async ({ where = 'home', w = 390, h = 844, theme = 'light', view = 'list' } = {}) => {
68
+ const open = async ({ where = 'home', w = 390, h = 844, theme = 'light', view = 'list', pop = false } = {}) => {
67
69
  const touch = w < 700, id = where === 'home' ? 'self-serve-v2' : 'usage-billing';
68
70
  const ctx = await browser.newContext({ viewport: { width: w, height: h }, hasTouch: touch, isMobile: touch, colorScheme: theme });
69
71
  await ctx.addInitScript(() => { try { if (localStorage.getItem('cz-pn:board') == null) localStorage.setItem('cz-pn:board', JSON.stringify({ v: 2, share: 0.405 })); } catch { /* none */ } }); // the Board's Viewer at 560 px beside the page (cozy-panels.js keeps only this share), so its Tasks Timeline is wide enough to drag
72
+ if (pop) await ctx.addInitScript(() => { try { localStorage.setItem('cz-pop-open', 'popup'); } catch { /* none */ } }); // S14: work in the popup, as a PM sees it
70
73
  await ctx.addInitScript((v) => { localStorage.setItem('pmos.tasks.view', v); localStorage.setItem('pmos.tasks.zoom', 'month'); }, view);
71
74
  const page = await ctx.newPage(), errors = [], posts = [];
72
75
  await page.clock.install({ time: DAY }); // the fixture's day: the date picker's month and its Today chips stay on it after the real day passes
@@ -110,6 +113,7 @@ const TICKETS = [{ key: 'IDPF-3387', title: 'Refactor the AppAuthService', statu
110
113
  await until(() => page.evaluate(() => document.querySelectorAll('#ibBody .ini2, #ibBody .bt-l').length > 0), 20000);
111
114
  await page.evaluate(() => { const b = [...document.querySelectorAll('[data-row="board:usage-billing"] .bt-nm, [data-key="board:usage-billing"]')].find((x) => x.offsetParent); if (b) b.click(); });
112
115
  }
116
+ if (pop) return { ctx, page, errors, posts, S };
113
117
  // a phone shows the initiative as the popup's phone page (phone design, Ph2_init); the old page with its Tasks is ⋯ › Every part
114
118
  if (touch && where === 'home') { await everyPart(page); await sleep(800); }
115
119
  await until(() => page.evaluate((v) => !!document.querySelector(v === 'list' ? '#czViewer .iv-wbs' : '#czViewer :is(.ivt, .iva, .ivk)'), view), 20000);
@@ -409,5 +413,23 @@ const TICKETS = [{ key: 'IDPF-3387', title: 'Refactor the AppAuthService', statu
409
413
  ok(`S13 ${where} ${w} dark: no page error`, D.errors.length === 0, D.errors.join(' | '));
410
414
  await D.ctx.close();
411
415
  }
416
+
417
+ /* S14 the work popup (cozy-pop-work.js dateMenu): a row's date press opens the one range picker, and two taps set Start and Due */
418
+ {
419
+ const P = await open({ where: 'board', w: 1440, h: 900, pop: true }), q = P.page;
420
+ await until(() => q.evaluate(() => !!document.querySelector('.cz-pop:not([hidden]) [data-pw-date="task-b4"]')), 20000);
421
+ await q.evaluate(() => document.querySelector('.cz-pop:not([hidden]) [data-pw-date="task-b4"]').click());
422
+ const o14 = await until(() => q.evaluate(() => { const r = document.querySelector('.pw-rp .rp'); return r ? { ends: [...r.querySelectorAll('[data-rp-end]')].map((e) => e.dataset.rpEnd + (e.classList.contains('on') ? '*' : '')).join(), seg: !!document.querySelector('.pw-seg'), clear: !!r.querySelector('[data-rp-clear]'), focus: (document.activeElement || {}).dataset ? document.activeElement.dataset.rpDay || '' : '' } : null; }).then((x) => (x && x.focus ? x : null)), 3000) || await q.evaluate(() => ({ ends: [...document.querySelectorAll('.pw-rp [data-rp-end]')].map((e) => e.dataset.rpEnd + (e.classList.contains('on') ? '*' : '')).join(), focus: (document.activeElement || {}).outerHTML ? document.activeElement.outerHTML.slice(0, 120) : '' }));
423
+ ok('S14 the work popup: a row\'s date press opens the one calendar under Task or Milestone, Start on, the focus on a day, No date at the foot', o14 && o14.ends === 'start*,due' && o14.seg && o14.clear && /^2026-10-\d\d$/.test(o14.focus), JSON.stringify(o14));
424
+ await q.click('.pw-rp .rp-g [data-rp-day="2026-10-20"]');
425
+ const s14 = await until(() => { const x = lastPost(P, '/api/boards/tasks/edit'); return x && x.body.task === 'task-b4' && x.body.start === '2026-10-20' ? x : null; });
426
+ const due14 = await until(() => q.evaluate(() => { const e = document.querySelector('.pw-rp [data-rp-end="due"]'); return !!e && e.classList.contains('on'); }));
427
+ ok('S14 the first tap saves the start and the due day is next, the calendar stays open', s14 && due14, JSON.stringify(P.posts.slice(-3)));
428
+ await q.click('.pw-rp .rp-g [data-rp-day="2026-10-24"]');
429
+ const d14 = await until(() => { const x = lastPost(P, '/api/boards/tasks/edit'); return x && x.body.task === 'task-b4' && x.body.due === '2026-10-24' ? x : null; });
430
+ ok('S14 the second tap saves the due day and closes the calendar', d14 && await until(() => q.evaluate(() => !document.querySelector('.pw-rp'))), JSON.stringify(P.posts.slice(-3)));
431
+ ok('S14 the work popup: no page error', P.errors.length === 0, P.errors.join(' | '));
432
+ await P.ctx.close();
433
+ }
412
434
  return finish();
413
435
  })();
@@ -7,7 +7,7 @@
7
7
  "unit": [
8
8
  "test.js"
9
9
  ],
10
- "modules": [
10
+ "modules": ["tour.test.js",
11
11
  "find-browser.test.js",
12
12
  "units.test.js",
13
13
  "program-worktree.test.js",