create-pmos 0.419.0 → 0.421.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +25 -30
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/scripts/lane-defs.js +14 -1
- package/payload/scripts/workflow-state.js +2 -2
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-board-test.js +9 -13
- package/workspace/changelog.json +24 -0
- package/workspace/fixtures/report-api/draft.json +2 -1
- package/workspace/guide/briefing-premium.md +1 -1
- package/workspace/guide/home.md +3 -0
- package/workspace/home-other-product-test.js +18 -0
- package/workspace/home-rows-test.js +14 -0
- package/workspace/lib/board-premium.js +13 -3
- package/workspace/lib/brief.js +5 -0
- package/workspace/lib/briefing-premium-agent.js +8 -0
- package/workspace/lib/engine/lane-defs.js +14 -1
- package/workspace/lib/engine/workflow-state.js +2 -2
- package/workspace/lib/first-input.js +13 -6
- package/workspace/lib/hold-spans.js +64 -0
- package/workspace/lib/mention-store.js +49 -13
- package/workspace/lib/plan-tree.js +1 -1
- package/workspace/lib/report-draft.js +6 -0
- package/workspace/lib/routes-boards.js +22 -6
- package/workspace/lib/source-reads.js +5 -0
- package/workspace/lib/transcript-read.js +29 -1
- package/workspace/lib/vendor/scripts/lane-defs.js +14 -1
- package/workspace/lib/vendor/scripts/workflow-state.js +2 -2
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-viewer-test.js +1 -1
- package/workspace/public/pm/bd-acts.js +49 -1
- package/workspace/public/pm/bd-ini-panel.js +15 -8
- package/workspace/public/pm/bd-next.js +119 -0
- package/workspace/public/pm/bd-prog.js +1 -1
- package/workspace/public/pm/bd-span.js +120 -22
- package/workspace/public/pm/bd-views.js +7 -5
- package/workspace/public/pm/cozy-board.css +54 -9
- package/workspace/public/pm/cozy-live-pill.js +1 -1
- package/workspace/public/pm/cozy-nav.js +1 -1
- package/workspace/public/pm/cozy-steps.js +1 -1
- package/workspace/public/pm/cozy-today.css +9 -0
- package/workspace/public/pm/cozy-viewer.js +7 -3
- package/workspace/public/pm/cozy-xv.js +1 -1
- package/workspace/public/pm/cozy.css +10 -0
- package/workspace/public/pm/home-app.js +39 -13
- package/workspace/public/pm/home-ask.js +7 -0
- package/workspace/public/pm/home-ini.js +44 -13
- package/workspace/public/pm/home-line.js +1 -1
- package/workspace/public/pm/home-list.js +22 -2
- package/workspace/public/pm/home-mentions.js +1 -1
- package/workspace/public/pm/home-today.js +13 -2
- package/workspace/public/pm/ini-tasks.js +363 -0
- package/workspace/public/pm/ini-view-model.js +19 -11
- package/workspace/public/pm/ini-view.css +160 -0
- package/workspace/public/pm/ini-view.js +40 -9
- package/workspace/public/pm/premium-board.js +54 -17
- package/workspace/public/pm/premium-insights.js +1 -1
- package/workspace/public/pm/premium-mtg-present.js +2 -2
- package/workspace/public/pm/premium-report-read.js +1 -1
- package/workspace/public/pm/premium-report-tab.js +1 -1
- package/workspace/public/pm/premium-viewer.js +3 -3
- package/workspace/public/pm/premium-vw-mtg.js +3 -1
- package/workspace/public/pm/premium-vw-open.js +1 -1
- package/workspace/public/pm/premium-vw-slides.js +1 -1
- package/workspace/public/pm/prog-order.js +1 -1
- package/workspace/public/pm/task-card.js +6 -0
- package/workspace/public/pm/tk-send.js +1 -1
- package/workspace/server.js +26 -2
- package/workspace/skills/day-check.skill +2 -2
- package/workspace/skills/morning-brief.skill +1 -1
- package/workspace/skills/sources-read.skill +8 -4
- package/workspace/task-press-test.js +120 -0
- package/workspace/task-views-test.js +245 -0
- package/workspace/test-lists/task-press.json +6 -0
- package/workspace/test-lists/task-views.json +6 -0
- package/workspace/test-lists/timeline-holds.json +6 -0
- package/workspace/timeline-holds-test.js +199 -0
|
@@ -18,7 +18,7 @@ const TICK = 'M5 12l4 4 10-10', RIGHT = 'M10 7l5 5-5 5';
|
|
|
18
18
|
const isPhone = () => typeof innerWidth === 'number' && innerWidth <= 760;
|
|
19
19
|
export function ensureCss() {
|
|
20
20
|
if (typeof document === 'undefined' || document.querySelector('link[data-tk-css]')) return;
|
|
21
|
-
const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = '
|
|
21
|
+
const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = new URL('./tk-tasks.css', import.meta.url).href; l.dataset.tkCss = ''; document.head.appendChild(l);
|
|
22
22
|
}
|
|
23
23
|
const viewUrl = (ws, id) => '/api/jira/tickets?initiative=' + encodeURIComponent(id) + (ws ? '&ws=' + encodeURIComponent(ws) : '');
|
|
24
24
|
|
package/workspace/server.js
CHANGED
|
@@ -3246,7 +3246,9 @@ function sessionConversation(s) {
|
|
|
3246
3246
|
const found = txFound(s);
|
|
3247
3247
|
if (found.missing) {
|
|
3248
3248
|
if (s.agent === 'shell' && /wrote no session record/.test(found.missing)) return { messages: [], state: 'shell', missing: 'No agent is running in this shell yet.' };
|
|
3249
|
-
|
|
3249
|
+
// batch 10 item 1: before its first message Claude Code can wait on its folder trust prompt; the chat shows it as an ask
|
|
3250
|
+
const trust = s.agent === 'claude' ? paneTrust(s) : null;
|
|
3251
|
+
return { messages: [], state: 'unlinked', missing: found.missing, ...(trust ? { ask: trust } : {}) };
|
|
3250
3252
|
}
|
|
3251
3253
|
let stamp = null;
|
|
3252
3254
|
try { const st = fs.statSync(found.file); stamp = `${st.size}:${st.mtimeMs}`; } catch {}
|
|
@@ -3277,6 +3279,15 @@ function paneAsk(s, now = Date.now()) {
|
|
|
3277
3279
|
s.ask = r.status === 0 && r.stdout ? transcript.permissionAsk(r.stdout, scrub) : null;
|
|
3278
3280
|
return s.ask;
|
|
3279
3281
|
}
|
|
3282
|
+
// The folder trust prompt on the pane's screen ({ question, options, trust }), read at most once every 1.5s like paneAsk.
|
|
3283
|
+
function paneTrust(s, now = Date.now()) {
|
|
3284
|
+
if (!s.tmux || !TMUX) return null;
|
|
3285
|
+
if (s.trustAt && now - s.trustAt < 1500) return s.trust || null;
|
|
3286
|
+
s.trustAt = now;
|
|
3287
|
+
const r = tmuxCtl(['capture-pane', '-p', '-t', s.tmux]);
|
|
3288
|
+
s.trust = r.status === 0 && r.stdout ? transcript.trustAsk(r.stdout, scrub) : null;
|
|
3289
|
+
return s.trust;
|
|
3290
|
+
}
|
|
3280
3291
|
// The pane's visible screen, plain text, or '' (no tmux pane). lib/first-input.js reads Claude Code's input box from it.
|
|
3281
3292
|
function paneScreen(s) {
|
|
3282
3293
|
if (!s || !s.tmux || !TMUX) return '';
|
|
@@ -3300,7 +3311,7 @@ function paneNotReady(s) {
|
|
|
3300
3311
|
const cmd = paneCommand(s);
|
|
3301
3312
|
if (!cmd) return false;
|
|
3302
3313
|
if (LOGIN_SHELLS.has(cmd)) return true;
|
|
3303
|
-
if (/^(claude|\d+\.\d+\.\d+)$/i.test(cmd)) return firstInput.boxText(
|
|
3314
|
+
if (/^(claude|\d+\.\d+\.\d+)$/i.test(cmd)) { const sc = paneScreen(s); return transcript.trustAsk(sc) ? 'hold' : firstInput.boxText(sc) === null; }
|
|
3304
3315
|
return false;
|
|
3305
3316
|
}
|
|
3306
3317
|
function deliverInput(s, input) {
|
|
@@ -3308,6 +3319,7 @@ function deliverInput(s, input) {
|
|
|
3308
3319
|
firstInput.deliver(s, input, { screen, wait: screen ? () => paneNotReady(s) : null, onDone: (why) => {
|
|
3309
3320
|
if (why === 'resubmitted' || why === 'unsent') { try { s.firstInput = { result: why, at: Date.now() }; } catch { /* nothing to keep */ } }
|
|
3310
3321
|
if (why === 'unsent') { s.note = 'its prompt was typed but not sent'; try { pushSessions(); } catch { /* the next list shows it */ } }
|
|
3322
|
+
if (why === 'held') { s.note = 'its prompt waited on the folder trust question and was not sent'; try { pushSessions(); } catch { /* the next list shows it */ } }
|
|
3311
3323
|
} });
|
|
3312
3324
|
}
|
|
3313
3325
|
function transcriptHarness(s) {
|
|
@@ -4012,6 +4024,16 @@ const chatSessions = {
|
|
|
4012
4024
|
try { deliverInput(s, t + '\r'); return true; } catch { return false; }
|
|
4013
4025
|
},
|
|
4014
4026
|
keys: (id, data) => { const s = sessions.get(String(id || '')); if (!s || !s.pty || s.state === 'exited') return false; try { s.pty.write(String(data)); return true; } catch { return false; } },
|
|
4027
|
+
// batch 10 item 1: answer the folder trust prompt with its n-th answer: arrow keys from the selected one, then Enter
|
|
4028
|
+
pick: (id, n) => {
|
|
4029
|
+
const s = sessions.get(String(id || '')); if (!s || !s.pty || s.state === 'exited') return false;
|
|
4030
|
+
s.trustAt = 0; const q = paneTrust(s);
|
|
4031
|
+
if (!q || !(n >= 1 && n <= q.options.length)) return false;
|
|
4032
|
+
const d = n - q.sel;
|
|
4033
|
+
try { s.pty.write((d > 0 ? '\x1b[B' : '\x1b[A').repeat(Math.abs(d))); setTimeout(() => { try { s.pty.write('\r'); } catch { /* gone */ } }, 200); } catch { return false; }
|
|
4034
|
+
s.trust = null; s.trustAt = Date.now();
|
|
4035
|
+
return true;
|
|
4036
|
+
},
|
|
4015
4037
|
// slice 4 (PRD L3): the live chat sessions, so a new one can end the longest idle; busy = working or a permission prompt waits
|
|
4016
4038
|
list: (now = Date.now()) => [...sessions.values()].filter((s) => /^chat:/.test(String(s.origin || '')) && s.pty && s.state !== 'exited')
|
|
4017
4039
|
.map((s) => ({ id: s.id, origin: s.origin, lastOutputAt: s.lastOutputAt, busy: harness.deriveState(s.state, s.lastOutputAt, now).state === 'working' || sessionShown(s, now) === 'blocked' })),
|
|
@@ -6830,6 +6852,8 @@ async function handleRequest(req, res) {
|
|
|
6830
6852
|
if (t.length > 8000) return json(res, { ok: false, error: 'The message is too long (8000 characters at most).' }, 400);
|
|
6831
6853
|
return chatSessions.type(sess.id, t) ? json(res, { ok: true, session: sess.id }) : json(res, { ok: false, error: 'The message did not reach the session.' }, 409);
|
|
6832
6854
|
}
|
|
6855
|
+
const tp = /^t([1-6])$/.exec(String(body.press)); // the folder trust prompt's n-th answer (batch 10 item 1)
|
|
6856
|
+
if (tp) return chatSessions.pick(sess.id, +tp[1]) ? json(res, { ok: true, session: sess.id }) : json(res, { ok: false, error: 'The question is no longer on the screen.' }, 409);
|
|
6833
6857
|
const KEYS = { esc: '\x1b', 1: '1', 2: '2', 3: '3', 4: '4', 5: '5', 6: '6', 7: '7', 8: '8', 9: '9' };
|
|
6834
6858
|
const data = Object.prototype.hasOwnProperty.call(KEYS, String(body.press)) ? KEYS[String(body.press)] : null;
|
|
6835
6859
|
if (!data) return json(res, { ok: false, error: 'press must be esc or 1 to 9' }, 400);
|
|
@@ -25,13 +25,13 @@ Procedure:
|
|
|
25
25
|
1. Run `pmos proactive day`. It shows the stage, the tasks, and the check state (when the last check was, and why this one runs). Run `pmos proactive brief` to read the stored brief: its items with their ids, its events with their ids, and its digests. Run `pmos proactive settings` for the sources, the scopes, the websites and, when it prints them, the PM's role, work and job description: use those to judge what matters to this PM. Run `pmos proactive goals` for the goal ids.
|
|
26
26
|
2. Read what changed, from the sources that are on and reachable:
|
|
27
27
|
- Calendar: today's events. Note a new event, a moved one, a cancelled one, and a new link or agenda in one.
|
|
28
|
-
- Mentions of the PM since the last check, in Slack, Jira and Confluence, in every place that is not ignored. Keep where, who, the link to the conversation itself and a short paraphrase of what is asked. To tie a Jira issue to an initiative, run `pmos jira which <KEY>` (it reads local files only) and use the initiative it names. A status change of a ticket that `pmos jira which` names is not an item: the Jira status check shows it on the initiative's Jira tickets tab.
|
|
28
|
+
- Mentions of the PM since the last check, in Slack, Jira and Confluence, in every place that is not ignored, as the sources-read skill defines them: an @handle ("via": "at"), a Slack direct message ("via": "dm", in any place), or a Slack message or a mail that names the PM with no @ ("via": "name"). A message the PM wrote is never one. Keep where, who, the link to the conversation itself and a short paraphrase of what is asked. To tie a Jira issue to an initiative, run `pmos jira which <KEY>` (it reads local files only) and use the initiative it names. A status change of a ticket that `pmos jira which` names is not an item: the Jira status check shows it on the initiative's Jira tickets tab.
|
|
29
29
|
- Places with scope watch: read every message or comment since the last check. Update the digest of the place (decisions, open questions, what touches a goal). A digest you submit replaces the stored digest of that place, so carry over what still holds.
|
|
30
30
|
- GitHub, Drive, Figma and websites, if on: only what changed since the last check and matters to a goal or a meeting.
|
|
31
31
|
- The open items of the stored brief: look once at each item that has a link, in a source that is on. Note an item that is now done or no longer true, and an item whose facts changed: a new ask, a new due date, a new owner, or an answer that changes what the PM must do.
|
|
32
32
|
- Wispr Flow: notes for meetings that ended since the last check. Read the summary, the decisions and the actions. Read the related mail for the same meeting only if mail is on, and keep the subject, the sender and a gist.
|
|
33
33
|
3. Decide what the brief needs.
|
|
34
|
-
- New items: a thing the PM should act on that is not in the stored brief. Fill the fields as the morning-brief skill does: link, where, who, about, ask, reply_needed, how and kind (you, approve or auto, with the same meaning). Set "mention": true on an item that comes from a mention. Only give an item a source that is "read".
|
|
34
|
+
- New items: a thing the PM should act on that is not in the stored brief. Fill the fields as the morning-brief skill does: link, where, who, about, ask, reply_needed, how and kind (you, approve or auto, with the same meaning). Set "mention": true and its "via" on an item that comes from a mention. Only give an item a source that is "read".
|
|
35
35
|
- Resolved items: an item in the stored brief that is now done, answered or no longer true, for example a thread the PM answered, an issue that was closed, a meeting that was cancelled. List its id in "resolved". Never resolve an item only because it is old.
|
|
36
36
|
- Changed items: an open item whose facts changed. Submit it again with the SAME "title" and "source" as in the stored brief, because the workspace derives its id from them, and with the fields updated. The workspace replaces the stored item. Do not submit an item that did not change.
|
|
37
37
|
- Event notes: for a meeting that ended, add "notes": {"wispr": {"link", "summary", "decisions", "actions"}, "mail": {"subject", "from", "gist", "link"}} to that event, and mark the "after" steps that are now done with "done": true. Give the event by the same "start", "end" and "title" it has in the stored brief, because the workspace derives its id from them.
|
|
@@ -35,7 +35,7 @@ Procedure:
|
|
|
35
35
|
2. Read the calendar, and take everything else from the saved reads.
|
|
36
36
|
- Calendar: today's events. Then the CALENDAR MEMORY: every event in the window that `pmos proactive calendar` named (at most 1000 events, at most 140 days). For each event keep the start, the end, the title, the calendar's recurring-event id as "series" if it has one, the number of attendees, "external": true when someone outside the PM's company attends, "exec": true when an executive attends, and the PM's "role" ("present" when the PM presents, "decide" when the PM decides, else "attend"). For an event that has ended, add "notes": one line in your own words of what happened, from the saved Wispr Flow read, only when it has notes for that meeting; and "open": up to 3 points still open from it. For a coming event that needs work first, add "prep": up to 6 steps, and "prep_done": how many of them are already done. Read only titles, times and attendee counts. Never copy an invitation's text.
|
|
37
37
|
- THE SAVED READS. Run `pmos source show --json`. It prints one read per tool: its "state" (read, not-reached or off), its "read_at", its "items" (who, where, what is asked, the link, "mention" when it mentions the PM), its "digests" (one per watched Slack channel, Jira project or Confluence space) and its "places". In the brief, give each tool the state of its saved read. A tool with no saved read, or whose read is older than yesterday morning, is "not-reached": say in the evidence of one item that its read is old. Never add an item of a tool whose state is not "read".
|
|
38
|
-
- Turn the saved items into brief items (step 3). Keep their link, where, who, about, ask, mention, reply_needed, due and thread as they are, and give the item the tool as its "source". Copy each saved digest into "digests" with its tool as "source", and each saved place into "places".
|
|
38
|
+
- Turn the saved items into brief items (step 3). Keep their link, where, who, about, ask, mention, via, reply_needed, due and thread as they are, and give the item the tool as its "source". Copy each saved digest into "digests" with its tool as "source", and each saved place into "places".
|
|
39
39
|
- Jira issues assigned to the PM are not in the saved reads: My work owns them. Run `pmos my-work list --top 5 --json` and add each item it prints as a priority with "source": "jira" (or "github" for a WBS item), "owner": "pm", the item's key in the title, and "how": "Brief it in My work". Never make one of them an agent item: the PM briefs the agent in My work. If the command fails, say so in the evidence of one item and go on. To tie a Jira issue to an initiative, run `pmos jira which <KEY>` (it reads local files only) and use the initiative it names. A status change of a ticket that `pmos jira which` names is not an item: the Jira status check shows it on the initiative's Jira tickets tab.
|
|
40
40
|
3. PLAN EACH OPEN GOAL. For each open goal, find what moves it today in what you read and in `pmos proactive today`: a meeting where it is decided, a mention that blocks it, an issue or page it needs, a step an agent can prepare. Write each as an item with "goal": "<the goal id>". An agent step names the initiative it advances, so the PM can prepare it from Today. A calendar event that belongs to a goal also gets "goal". If you find nothing for a goal, write nothing for it: the workspace shows that goal as needing a plan. Never invent a step.
|
|
41
41
|
Then ANTICIPATE: for each other thing the PM should act on today (a mention waiting on them, a meeting to prepare for, an issue due), write one item with no goal.
|
|
@@ -25,10 +25,14 @@ Procedure:
|
|
|
25
25
|
1. Run `pmos proactive settings`. Note which sources are on, the websites and the scopes.
|
|
26
26
|
2. Read each source that is on, since yesterday morning (or since its last read, which `pmos source status` prints, if that is later than yesterday morning):
|
|
27
27
|
- Wispr Flow: today's and yesterday's meeting notes. One item per meeting: the title, when, and in "about" what was decided and what is still open.
|
|
28
|
-
- Mail: subjects and senders of threads waiting on the PM.
|
|
28
|
+
- Mail: subjects and senders of threads waiting on the PM. You may read a body to see whether it names the PM or asks the PM something; never copy it.
|
|
29
29
|
- Slack, Jira and Confluence take a scope for each place. "watch": read every message or comment, then write one digest for the place (decisions and open questions, in your words). "search": do not read the place; look only for mentions of the PM and for the words of the PM's goals (`pmos proactive goals`). "ignore": do not read, search or report the place. A place with no scope is "search".
|
|
30
|
-
- Mentions of the PM
|
|
31
|
-
|
|
30
|
+
- Mentions of the PM: one item each, with "mention": true, "via", where it is, who wrote it, the link to the conversation itself, and in "ask" what is asked. Do not read the Jira issues assigned to the PM: My work owns them. A mention is any of these:
|
|
31
|
+
- "via": "at": an @handle of the PM in Slack, Jira or Confluence.
|
|
32
|
+
- "via": "dm": a Slack direct message to the PM, or a group DM the PM is in, with no @. Set "where": "DM". Read the DMs since the last read in every scope; a DM has no scope.
|
|
33
|
+
- "via": "name": a Slack message or a mail that names the PM with no @: the PM's first name, full name, or an alias. The PM's names are the name `pmos proactive settings` prints, and the real name and display name of the PM's own Slack profile and mail address. Look for them in the places with scope watch or search, and in the mail since the last read. A name that clearly means another person with the same name is not a mention.
|
|
34
|
+
A message the PM wrote is never a mention of the PM.
|
|
35
|
+
- For each mention, keep the last messages of its thread in "thread" with who wrote each one, including the PM's own replies. Set "replied": true when the PM answered in the thread after the last ask. Set "broadcast": true when the mention is @channel, @here, a team handle or a bot: it is for the PM's information, never an ask. Set "reply_needed": true only when the message asks the PM something: a question, a request or a decision. A DM or a name mention that only tells the PM something (FYI, thanks, a link) is "reply_needed": false. Home's Mentions keeps every mention until the PM answers it, so a mention you read once is not lost when the next read no longer has it.
|
|
32
36
|
- Jira: issues due soon that are not assigned to the PM. Confluence: pages changed since the last read.
|
|
33
37
|
- GitHub: pull requests that wait on the PM for review, the PM's pull requests with a review or a failed check, and issues assigned to the PM.
|
|
34
38
|
- Drive: files shared with the PM or changed since the last read. Figma: files the PM owns or was asked to look at, with new comments.
|
|
@@ -38,7 +42,7 @@ Procedure:
|
|
|
38
42
|
```
|
|
39
43
|
{"reads": [
|
|
40
44
|
{"source": "slack", "state": "read",
|
|
41
|
-
"items": [{"title": "…", "link": "https://…", "where": "#pm-team", "who": "…", "at": "<ISO or HH:MM>", "about": "…", "ask": "…", "mention": true, "reply_needed": true, "replied": false, "broadcast": false, "due": "…",
|
|
45
|
+
"items": [{"title": "…", "link": "https://…", "where": "#pm-team", "who": "…", "at": "<ISO or HH:MM>", "about": "…", "ask": "…", "mention": true, "via": "at|dm|name", "reply_needed": true, "replied": false, "broadcast": false, "due": "…",
|
|
42
46
|
"thread": [{"who": "…", "at": "09:12", "text": "…"}], "initiative_id": "<only when `pmos jira which` or the text names one>"}],
|
|
43
47
|
"digests": [{"name": "#launch", "link": "https://…", "decisions": ["…"], "open": ["…"]}],
|
|
44
48
|
"places": [{"name": "#pm-team", "link": "https://…"}]},
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* task-press-test.js — a task's title on the initiative's view opens the task (batch 9 item 5a, Wawan 2026-10-26: "Cannot click the task and
|
|
4
|
+
* see its detail"). The view (pm/ini-view.js) draws the board's row; Home's page and the Board's panel both draw it.
|
|
5
|
+
* T1 Home: a task the initiative's own read holds opens the one task editor (task-card.js), ← back to the page
|
|
6
|
+
* T2 Home: a task only the board's row holds (a breakdown item, a stage task) opens the same editor, not "no longer on" or nothing
|
|
7
|
+
* T3 Home: the check box stays the Done control: it saves the state and opens nothing
|
|
8
|
+
* T4 the Board's panel: a task's title is a press and opens the same editor as a drill-in, ← back to the initiative
|
|
9
|
+
* Serves the real pages from the real server; the reads are fixtures. A 1440 shot of each editor goes to PMOS_SHOTS when it is set. */
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const { spawn } = require('child_process');
|
|
12
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
13
|
+
const T = require('./test-run').configure({ name: 'task-press' });
|
|
14
|
+
const IP = require('./lib/initiative-premium.js');
|
|
15
|
+
const F = require('./fixtures/initiative-premium-facts.js');
|
|
16
|
+
const BP = require('./lib/board-premium.js');
|
|
17
|
+
const BF = require('./fixtures/board-premium-facts.js');
|
|
18
|
+
const BRP = require('./lib/briefing-premium.js');
|
|
19
|
+
const BRF = require('./fixtures/briefing-premium-facts.js');
|
|
20
|
+
|
|
21
|
+
const BASE = T.BASE, SHOTS = process.env.PMOS_SHOTS || '';
|
|
22
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
23
|
+
const until = async (fn, ms = 15000, step = 100) => { const t0 = Date.now(); for (;;) { let v = null; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
24
|
+
const results = [];
|
|
25
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 400) : ''}`); };
|
|
26
|
+
let srv = null; let browser = null;
|
|
27
|
+
const finish = async (code) => {
|
|
28
|
+
if (browser) await browser.close().catch(() => {});
|
|
29
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
30
|
+
T.killTmux();
|
|
31
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
32
|
+
console.log(`\n${results.length - bad}/${results.length} task-press assertions passed`);
|
|
33
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
34
|
+
};
|
|
35
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
36
|
+
|
|
37
|
+
const ID = 'self-serve-v2';
|
|
38
|
+
// the board's row holds two tasks: t1 is in the initiative's own read too (fixtures ITEMS), t2 is only on the board (a breakdown item)
|
|
39
|
+
const TASKS = [
|
|
40
|
+
{ uid: 't1', title: 'UAT with five partners', status: 'To do', owner: 'Dara', end: '2026-10-27' },
|
|
41
|
+
{ uid: 't2', title: 'Parity check for the 23 documented rows', status: 'To do', owner: 'Ricky Cheah', end: '2026-11-11', item: true },
|
|
42
|
+
];
|
|
43
|
+
const withTasks = (m) => { (function walk(o) { if (!o || typeof o !== 'object') return; if (Array.isArray(o)) { o.forEach(walk); return; } if (o.id === ID && o.track) o.tasks = TASKS.map((x) => ({ ...x })); Object.values(o).forEach(walk); })(m); return m; };
|
|
44
|
+
const BOARD = withTasks(BP.build(BF.facts()));
|
|
45
|
+
const V = '#czViewer:not([hidden])';
|
|
46
|
+
const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'application/json', body: JSON.stringify(b) });
|
|
47
|
+
const shot = async (p, name) => { if (SHOTS) await p.screenshot({ path: path.join(SHOTS, name) }).catch(() => {}); };
|
|
48
|
+
|
|
49
|
+
async function page(url) {
|
|
50
|
+
const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 } });
|
|
51
|
+
const p = await ctx.newPage();
|
|
52
|
+
const errors = [], posts = [];
|
|
53
|
+
p.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
54
|
+
p.on('request', (rq) => { if (rq.method() === 'POST') posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}') }); });
|
|
55
|
+
await p.route('**/api/initiative-premium*', (r) => json(r, { ok: true, state: 'ready', model: IP.build(F.facts()), as_of: Date.now() }));
|
|
56
|
+
await p.route(/\/api\/board-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: BOARD, as_of: Date.now() }));
|
|
57
|
+
await p.route(/\/api\/briefing-premium(\?.*)?$/, (r) => json(r, { ok: true, state: 'ready', model: BRP.build(BRF.facts()), as_of: Date.now() }));
|
|
58
|
+
await p.route('**/api/briefing-premium/**', (r) => json(r, { ok: true, turns: [], working: false }));
|
|
59
|
+
await p.route('**/api/board-trail*', (r) => json(r, { ok: false, error: 'not in this check' }, 500));
|
|
60
|
+
await p.route('**/api/boards/items*', (r) => json(r, { ok: true, initiatives: [], items: [] }));
|
|
61
|
+
await p.route('**/api/boards/tasks/**', (r) => json(r, { ok: true }));
|
|
62
|
+
await p.goto(BASE + url);
|
|
63
|
+
return { ctx, p, errors, posts };
|
|
64
|
+
}
|
|
65
|
+
// the view's task rows: every stage section opened, so each task the board holds is drawn
|
|
66
|
+
const openSections = (p) => p.evaluate((v) => { let n = 0; for (const b of document.querySelectorAll(v + ' .iv-ws[aria-expanded="false"], ' + v + ' .iv-grp[aria-expanded="false"]')) { b.click(); n++; } return n; }, V);
|
|
67
|
+
const titleBtn = (p, uid) => until(async () => { await openSections(p); return p.evaluate((a) => !!document.querySelector(a[0] + ` [data-iv-task="${a[1]}"]`), [V, uid]); }, 10000);
|
|
68
|
+
// the one task editor: the initiative's view gave way, the Viewer's title is the task's, and the card (task-card.js) is drawn with its Status row
|
|
69
|
+
const editorOf = (p, title) => until(() => p.evaluate((a) => { const v = document.querySelector(a[0]), c = window.czViewer && window.czViewer.current(); if (!v || !c) return null;
|
|
70
|
+
const t = (v.querySelector('.cz-vw-title') || {}).textContent || '';
|
|
71
|
+
return !v.querySelector('.iv-sc') && t.includes(a[1]) && /Status/.test(v.textContent) && !/no longer on/.test(v.textContent) ? 'ok' : null; }, [V, title]), 8000);
|
|
72
|
+
const back = (p) => p.evaluate(() => { const b = document.querySelector('#czViewer [data-cz-vw="back"]'); if (!b || b.hidden) return false; b.click(); return true; });
|
|
73
|
+
|
|
74
|
+
(async () => {
|
|
75
|
+
const exe = findBrowser();
|
|
76
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
77
|
+
let chromium;
|
|
78
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
79
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT), PMOS_SELF_ROOT: path.resolve(__dirname, '..') }) });
|
|
80
|
+
await T.waitForServer(BASE);
|
|
81
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
82
|
+
|
|
83
|
+
/* Home: the initiative's page in the Viewer */
|
|
84
|
+
const H = await page('/premium.html?ini=' + ID + '&ws=w1&board=w1&theme=light');
|
|
85
|
+
const hp = H.p;
|
|
86
|
+
const up = await until(() => hp.evaluate((v) => !!document.querySelector(v + ' [data-hi-v="page"] .iv-sc'), V), 30000);
|
|
87
|
+
ok('T0 Home opens the initiative\'s page', up);
|
|
88
|
+
ok('T1 each task\'s title is a press', await titleBtn(hp, 't1') && await titleBtn(hp, 't2'));
|
|
89
|
+
await hp.click(`${V} [data-iv-task="t1"]`);
|
|
90
|
+
ok('T1 a task the initiative\'s read holds opens the one task editor', await editorOf(hp, TASKS[0].title), await hp.evaluate((v) => { const c = window.czViewer.current(); return c.kind + ' / ' + document.querySelector(v).textContent.slice(0, 300); }, V));
|
|
91
|
+
ok('T1 ← goes back to the initiative\'s page', await back(hp) && await until(() => hp.evaluate((v) => !!document.querySelector(v + ' [data-hi-v="page"]'), V), 5000));
|
|
92
|
+
await titleBtn(hp, 't2');
|
|
93
|
+
await hp.click(`${V} [data-iv-task="t2"]`);
|
|
94
|
+
ok('T2 a task only the board\'s row holds opens the same editor, not a dead end', await editorOf(hp, TASKS[1].title), await hp.evaluate((v) => (document.querySelector(v) || {}).textContent, V));
|
|
95
|
+
await shot(hp, 'home-task-press-1440.png');
|
|
96
|
+
ok('T2 ← goes back to the page', await back(hp) && await until(() => hp.evaluate((v) => !!document.querySelector(v + ' [data-hi-v="page"]'), V), 5000));
|
|
97
|
+
await titleBtn(hp, 't1');
|
|
98
|
+
const n0 = H.posts.length;
|
|
99
|
+
await hp.click(`${V} [data-iv-check="t1"]`);
|
|
100
|
+
ok('T3 the check box saves Done and opens nothing', await until(() => H.posts.slice(n0).some((x) => x.path === '/api/boards/tasks/state' && x.body.task === 't1' && x.body.state === 'Done'), 5000)
|
|
101
|
+
&& await hp.evaluate((v) => !!document.querySelector(v + ' [data-hi-v="page"]'), V), JSON.stringify(H.posts.slice(n0)));
|
|
102
|
+
ok('T0 no page error on Home', H.errors.length === 0, H.errors.join(' | '));
|
|
103
|
+
await H.ctx.close();
|
|
104
|
+
|
|
105
|
+
/* the Board's panel */
|
|
106
|
+
const B = await page('/premium-board.html?theme=light');
|
|
107
|
+
const bp = B.p;
|
|
108
|
+
const row = `.bt-l[data-row="board:${ID}"] .bt-nm`;
|
|
109
|
+
ok('T4 the Board lists the initiative', await until(() => bp.evaluate((s) => !!document.querySelector(s), row), 20000));
|
|
110
|
+
await bp.click(row);
|
|
111
|
+
ok('T4 its panel opens', await until(() => bp.evaluate(() => { const c = window.czViewer && window.czViewer.current(); return !!c && c.kind === 'Initiative'; }), 8000));
|
|
112
|
+
ok('T4 a task\'s title on the panel is a press', await titleBtn(bp, 't2'));
|
|
113
|
+
await bp.click(`${V} [data-iv-task="t2"]`);
|
|
114
|
+
ok('T4 it opens the one task editor', await editorOf(bp, TASKS[1].title), await bp.evaluate((v) => (document.querySelector(v) || {}).textContent, V));
|
|
115
|
+
await shot(bp, 'board-task-press-1440.png');
|
|
116
|
+
ok('T4 ← goes back to the initiative', await back(bp) && await until(() => bp.evaluate(() => { const c = window.czViewer && window.czViewer.current(); return !!c && c.kind === 'Initiative'; }), 5000));
|
|
117
|
+
ok('T4 no page error on the Board', B.errors.length === 0, B.errors.join(' | '));
|
|
118
|
+
await B.ctx.close();
|
|
119
|
+
return finish();
|
|
120
|
+
})().catch((e) => { console.error(e); finish(1); });
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* task-views-test.js — the initiative's Tasks as List, Timeline and Kanban, and a task's status and dates changed where it sits (feedback batch 9
|
|
4
|
+
* item 5b; canvas In development, row "Tasks views": XtvAGrill, XtvA1Status, XtvA1bDone, XtvA2Dates, XtvA3Timeline, XtvA4Kanban,
|
|
5
|
+
* XtvA5PhoneKanban, XtvA6PhoneTimeline, XtvA7BoardPanel). Serves the real Board page from the real server, answers GET /api/board-premium
|
|
6
|
+
* with the model lib/board-premium.js builds from fixtures/board-premium-facts.js plus one initiative's tasks, and captures the writes.
|
|
7
|
+
* V1 the view switch, remembered · V2 the box's one press and its caret · V3 the date press · V4 Timeline · V5 a bar's drag · V6 Kanban
|
|
8
|
+
* V7 a card's drag · V8 Won't do and Archived in the List · V9 the phone. SHOTS_5B=<dir> writes the screens. */
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const { spawn } = require('child_process');
|
|
11
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
12
|
+
const T = require('./test-run').configure({ name: 'task-views' });
|
|
13
|
+
const BP = require('./lib/board-premium.js');
|
|
14
|
+
const F = require('./fixtures/board-premium-facts.js');
|
|
15
|
+
|
|
16
|
+
const BASE = T.BASE;
|
|
17
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
18
|
+
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
19
|
+
const results = [];
|
|
20
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
21
|
+
let srv = null; let browser = null;
|
|
22
|
+
const finish = async (code) => {
|
|
23
|
+
if (browser) await browser.close().catch(() => {});
|
|
24
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
25
|
+
T.killTmux();
|
|
26
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
27
|
+
console.log(`\n${results.length - bad}/${results.length} task-views assertions passed`);
|
|
28
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
29
|
+
};
|
|
30
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
31
|
+
|
|
32
|
+
/* the fixture's day is 2026-10-17; Usage-based billing is in Discover */
|
|
33
|
+
const TASKS = [
|
|
34
|
+
{ uid: 'task-a', title: 'Parity check for the 23 documented rows', status: 'In progress', owner: 'Claude', start: '2026-10-14', end: '2026-10-21', section: 'discover' },
|
|
35
|
+
{ uid: 'task-b', title: 'Establish current behaviour for the 8 unverified rows', status: 'To do', owner: 'Claude', end: '2026-10-21', section: 'discover' },
|
|
36
|
+
{ uid: 'task-c', title: 'Map SDK public methods to v6', status: 'In progress', owner: 'Claude', start: '2026-10-08', end: '2026-10-10', section: 'discover' },
|
|
37
|
+
{ uid: 'task-d', title: 'Stakeholder review with Security', status: 'To do', owner: 'Wawan', section: 'discover' },
|
|
38
|
+
{ uid: 'task-e', title: 'Kick-off notes with the team', status: 'Done', owner: 'Wawan', end: '2026-10-12', section: 'discover' },
|
|
39
|
+
{ uid: 'task-f', title: 'Drop the legacy export', status: "Won't do", owner: 'Wawan', section: 'discover' },
|
|
40
|
+
{ uid: 'task-g', title: 'Old spike notes', status: 'Archived', owner: 'Wawan', section: 'discover' },
|
|
41
|
+
{ uid: 'task-h', title: 'Plan the rollout', status: 'To do', owner: 'Wawan', start: '2026-11-02', end: '2026-11-06', section: 'plan' },
|
|
42
|
+
];
|
|
43
|
+
const model = () => { const M = BP.build(F.facts()); const r = M.rows.find((x) => x.id === 'usage-billing'); r.tasks = TASKS.map((t) => ({ ...t })); return M; };
|
|
44
|
+
|
|
45
|
+
(async () => {
|
|
46
|
+
const exe = findBrowser();
|
|
47
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
48
|
+
let chromium;
|
|
49
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
50
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT), PMOS_SELF_ROOT: path.resolve(__dirname, '..') }) });
|
|
51
|
+
await T.waitForServer(BASE);
|
|
52
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
53
|
+
|
|
54
|
+
const open = async ({ w = 1440, h = 900, theme = 'light', touch = false, store = null } = {}) => {
|
|
55
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h }, hasTouch: touch, isMobile: touch });
|
|
56
|
+
if (store) await ctx.addInitScript((s) => { for (const [k, v] of Object.entries(s)) localStorage.setItem(k, v); }, store);
|
|
57
|
+
const page = await ctx.newPage();
|
|
58
|
+
const errors = [], posts = [];
|
|
59
|
+
page.on('pageerror', (e) => errors.push(String((e && e.stack) || e)));
|
|
60
|
+
await page.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: model(), as_of: Date.now() }) }));
|
|
61
|
+
await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'not in this check' }) }));
|
|
62
|
+
await page.route(/\/api\/(boards\/|lifecycle|board-metrics-premium)/, (r) => { const rq = r.request(), pth = new URL(rq.url()).pathname; if (rq.method() !== 'GET') posts.push({ path: pth, body: JSON.parse(rq.postData() || '{}') }); r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true }) }); });
|
|
63
|
+
await page.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, turns: [] }) }));
|
|
64
|
+
await page.goto(BASE + '/premium-board.html?theme=' + theme);
|
|
65
|
+
await until(() => page.evaluate(() => document.querySelectorAll('#ibBody .ini2, #ibBody .bt-l').length > 0), 20000);
|
|
66
|
+
// the initiative's panel, from its row's name
|
|
67
|
+
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(); });
|
|
68
|
+
await until(() => page.evaluate(() => !!document.querySelector('#czViewer .iv .iv-th')));
|
|
69
|
+
return { ctx, page, errors, posts };
|
|
70
|
+
};
|
|
71
|
+
const shot = async (p, name) => { if (process.env.SHOTS_5B) await p.screenshot({ path: path.join(process.env.SHOTS_5B, name + '.png') }); };
|
|
72
|
+
const lastPost = (A, route) => A.posts.filter((x) => x.path === route).pop();
|
|
73
|
+
|
|
74
|
+
const A = await open(), p = A.page;
|
|
75
|
+
/* V1 the switch: List first; icon only, words in aria-label; the last view is remembered */
|
|
76
|
+
const sw = await p.evaluate(() => [...document.querySelectorAll('#czViewer .ivx-sb')].map((b) => b.getAttribute('aria-label') + (b.getAttribute('aria-pressed') === 'true' ? '*' : '') + (b.textContent.trim() ? '+text' : '')).join());
|
|
77
|
+
ok('V1 the Tasks header has the icon-only switch List, Timeline, Kanban; the first time it is List', sw === 'List*,Timeline,Kanban', sw);
|
|
78
|
+
const order = await p.evaluate(() => [...document.querySelector('#czViewer .iv-th').children].map((e) => e.className || e.tagName).join());
|
|
79
|
+
ok('V1 the switch sits before the +', /ivx-seg,iv-ib$/.test(order), order);
|
|
80
|
+
|
|
81
|
+
/* V8 the List: Won't do joins the Done fold, struck through; Archived is a fold after Done, only when there is one */
|
|
82
|
+
await p.evaluate(() => { const b = [...document.querySelectorAll('#czViewer .iv-grp')].find((x) => /^Done/.test(x.textContent)); if (b) b.click(); });
|
|
83
|
+
await sleep(150);
|
|
84
|
+
await p.evaluate(() => { const b = [...document.querySelectorAll('#czViewer .iv-grp')].find((x) => /^Archived/.test(x.textContent)); if (b) b.click(); });
|
|
85
|
+
await sleep(150);
|
|
86
|
+
const L = await p.evaluate(() => {
|
|
87
|
+
const grp = [...document.querySelectorAll('#czViewer .iv-grp')].map((b) => [...b.children].map((c) => c.textContent.trim()).filter(Boolean).join(' '));
|
|
88
|
+
const wo = [...document.querySelectorAll('#czViewer .iv-tr.wo .iv-tt')].map((e) => e.textContent + ':' + getComputedStyle(e).textDecorationLine);
|
|
89
|
+
const ar = [...document.querySelectorAll('#czViewer .iv-tr.ar')].map((e) => e.textContent.replace(/\s+/g, ' ').trim());
|
|
90
|
+
return { grp, wo, ar, count: document.querySelector('#czViewer .iv-th .n').textContent };
|
|
91
|
+
});
|
|
92
|
+
ok('V8 Won\'t do joins the Done fold, struck through', L.grp.includes('Done 2') && L.wo.length === 1 && /Drop the legacy export:line-through/.test(L.wo[0]), JSON.stringify(L));
|
|
93
|
+
ok('V8 Archived folds after Done and counts nowhere else', L.grp.indexOf('Archived 1') === L.grp.indexOf('Done 2') + 1 && L.ar.length === 1 && /Old spike notes/.test(L.ar[0]) && L.count === '5 open · 2 done', JSON.stringify(L));
|
|
94
|
+
|
|
95
|
+
/* V2 one press on the box marks done, with Undo in the toast */
|
|
96
|
+
await p.click('#czViewer [data-iv-check="task-b"]');
|
|
97
|
+
const done = await until(() => { const x = lastPost(A, '/api/boards/tasks/state'); return x && x.body.task === 'task-b' ? x : null; });
|
|
98
|
+
const toast = await until(() => p.evaluate(() => { const t = document.querySelector('#bdToast'); return t && !t.hidden ? t.textContent : null; }));
|
|
99
|
+
ok('V2 one press on the box marks the task done', done && done.body.state === 'Done', JSON.stringify(done));
|
|
100
|
+
ok('V2 the toast says it, with Undo', /^Done: Establish current behaviour/.test(toast || '') && /Undo/.test(toast || ''), toast);
|
|
101
|
+
await p.click('#bdToast .bd-undo');
|
|
102
|
+
const undo = await until(() => { const x = lastPost(A, '/api/boards/tasks/state'); return x && x.body.state === 'To do' ? x : null; });
|
|
103
|
+
ok('V2 Undo puts the old status back', !!undo, JSON.stringify(A.posts.slice(-2)));
|
|
104
|
+
/* the caret on the box opens the task card's five status icons right under it */
|
|
105
|
+
await p.hover('#czViewer [data-iv-check="task-a"]');
|
|
106
|
+
const car = await p.evaluate(() => { const c = document.querySelector('#czViewer [data-iv-stat="task-a"]'); return c ? { op: getComputedStyle(c).opacity, label: c.getAttribute('aria-label') } : null; });
|
|
107
|
+
ok('V2 the box carries a caret on hover that changes the status', car && car.op === '1' && car.label === 'Change the status: Parity check for the 23 documented rows', JSON.stringify(car));
|
|
108
|
+
await p.click('#czViewer [data-iv-stat="task-a"]');
|
|
109
|
+
const pop = await until(() => p.evaluate(() => { const q = document.querySelector('.tkc.ivq'); if (!q) return null; const a = document.querySelector('#czViewer [data-iv-stat="task-a"]').getBoundingClientRect(), r = q.getBoundingClientRect();
|
|
110
|
+
return { btns: [...q.querySelectorAll('[data-ivq-state]')].map((b) => (b.getAttribute('aria-label') || b.textContent.trim()) + (b.getAttribute('aria-checked') === 'true' ? '*' : '')).join(), under: Math.round(r.top - a.bottom), dx: Math.round(r.left - a.left) }; }));
|
|
111
|
+
ok('V2 the status picker is the task card\'s five icons, only the current one named, right under the caret', pop && pop.btns === 'To do,In progress*,Done,Won\'t do,Archive' && pop.under >= 0 && pop.under <= 12 && Math.abs(pop.dx) < 40, JSON.stringify(pop));
|
|
112
|
+
await shot(p, 'list-status-1440');
|
|
113
|
+
await p.click('.tkc.ivq [data-ivq-state="Won\'t do"]');
|
|
114
|
+
const wont = await until(() => { const x = lastPost(A, '/api/boards/tasks/state'); return x && x.body.task === 'task-a' ? x : null; });
|
|
115
|
+
ok('V2 a status picked there saves at once', wont && wont.body.state === "Won't do", JSON.stringify(wont));
|
|
116
|
+
|
|
117
|
+
/* V3 the date press opens the task card's start and due picker right under it; an undated row shows a calendar icon on hover only */
|
|
118
|
+
const dbtn = await p.evaluate(() => { const b = document.querySelector('#czViewer .iv-tr [data-iv-date="task-c"]'); const n = document.querySelector('#czViewer .iv-tr [data-iv-date="task-d"]'); return { t: b && b.textContent, w: b && b.classList.contains('w'), none: n && getComputedStyle(n).opacity, nl: n && n.getAttribute('aria-label') }; });
|
|
119
|
+
ok('V3 the dates in a row are a press, amber when late; an undated row\'s calendar icon is hidden until hover', dbtn.t === 'Oct 8 – Oct 10' && dbtn.w && dbtn.none === '0' && /^Add dates: Stakeholder review/.test(dbtn.nl), JSON.stringify(dbtn));
|
|
120
|
+
await p.click('#czViewer .iv-tr [data-iv-date="task-c"]');
|
|
121
|
+
const dp = await until(() => p.evaluate(() => { const q = document.querySelector('.tkc.ivq .tkc-dp'); if (!q) return null; return { two: [...q.querySelectorAll('[data-tkc-field]')].map((b) => b.textContent).join('|'), on: (q.querySelector('[data-tkc-field].on') || {}).textContent }; }));
|
|
122
|
+
ok('V3 the start and due picker opens with the due field picked', dp && dp.two === 'StartOct 8|DueOct 10' && dp.on === 'DueOct 10', JSON.stringify(dp));
|
|
123
|
+
await p.click('.tkc.ivq .tkc-dp [data-tkc-day="2026-10-24"]');
|
|
124
|
+
const dd = await until(() => { const x = lastPost(A, '/api/boards/tasks/edit'); return x && x.body.task === 'task-c' ? x : null; });
|
|
125
|
+
ok('V3 a day picked there saves the due day at once', dd && dd.body.due === '2026-10-24' && dd.body.start == null, JSON.stringify(dd));
|
|
126
|
+
const dt = await until(() => p.evaluate(() => { const t = document.querySelector('#bdToast'); return t && !t.hidden && /Dates saved/.test(t.textContent) ? t.textContent : null; }));
|
|
127
|
+
ok('V3 the toast says the dates are saved, with Undo', /Undo/.test(dt || ''), dt);
|
|
128
|
+
await p.click('#bdToast .bd-undo');
|
|
129
|
+
const du = await until(() => { const x = lastPost(A, '/api/boards/tasks/edit'); return x && x.body.due === '2026-10-10' ? x : null; });
|
|
130
|
+
ok('V3 Undo puts the old due day back', !!du, JSON.stringify(A.posts.slice(-2)));
|
|
131
|
+
|
|
132
|
+
/* V4 Timeline: the same groups, bars by start → due, a circle for a due day only, a dashed date press at today, the Today line */
|
|
133
|
+
await p.click('#czViewer [data-iv-view="timeline"]');
|
|
134
|
+
await until(() => p.evaluate(() => !!document.querySelector('#czViewer .ivt')));
|
|
135
|
+
await sleep(200);
|
|
136
|
+
const tl = await p.evaluate(() => {
|
|
137
|
+
const T = document.querySelector('#czViewer .ivt'), rows = [...T.querySelectorAll('.ivt-r.k')];
|
|
138
|
+
const bar = (uid) => { const b = T.querySelector(`[data-ivt-bar="${uid}"]`); return b ? b.className.replace(/\s+/g, ' ').trim() : null; };
|
|
139
|
+
const today = T.querySelector('.ivt-today').getBoundingClientRect(), sc = T.querySelector('.ivt-sc'), nw = T.querySelector('.ivt-n').getBoundingClientRect();
|
|
140
|
+
return { groups: [...T.querySelectorAll('.ivt-gh b')].map((b) => b.textContent), rows: rows.map((r) => (r.querySelector('.iv-tt') || {}).textContent || r.textContent.trim()), a: bar('task-a'), b: bar('task-b'), c: bar('task-c'),
|
|
141
|
+
ghost: !!T.querySelector('.ivt-g[data-iv-date="task-d"]'), zoom: document.querySelector('#czViewer [data-iv-zoom]').textContent, seen: today.left > nw.right && today.left < sc.getBoundingClientRect().right,
|
|
142
|
+
lg: document.querySelector('#czViewer .ivt-lg').textContent, arch: /Old spike notes/.test(T.textContent) };
|
|
143
|
+
});
|
|
144
|
+
ok('V4 Timeline keeps the List\'s stage groups', tl.groups.join('|') === 'Triage|Discover|Later: Plan, Prioritize, Build, Deliver, Monitor, Evaluate', JSON.stringify(tl.groups));
|
|
145
|
+
ok('V4 bars by start and due: in progress light blue, late amber; a due day only is a circle; no dates is a dashed date press', /ivt-b/.test(tl.a) && / pr/.test(tl.a) && /ivt-d/.test(tl.b) && /ivt-b lt/.test(tl.c) && tl.ghost, JSON.stringify(tl));
|
|
146
|
+
ok('V4 Weeks is the first zoom; it opens on today, the Today line in view; the legend sits under it', tl.zoom === 'Weeks' && tl.seen && /To do.*In progress.*Late.*Due only.*Jira, read only/.test(tl.lg), JSON.stringify(tl));
|
|
147
|
+
ok('V4 an archived task shows nowhere in Timeline', !tl.arch);
|
|
148
|
+
await shot(p, 'timeline-1440');
|
|
149
|
+
await p.click('#czViewer [data-iv-zoom]');
|
|
150
|
+
await p.evaluate(() => { const b = [...document.querySelectorAll('.tkc.ivq [data-ivq-i]')].find((x) => /Months/.test(x.textContent)); if (b) b.click(); });
|
|
151
|
+
const mz = await until(() => p.evaluate(() => { const z = document.querySelector('#czViewer [data-iv-zoom]'); return z && z.textContent === 'Months' ? document.querySelector('#czViewer .ivt').dataset.px : null; }));
|
|
152
|
+
ok('V4 the zoom picker changes Weeks to Months', mz === '4', mz);
|
|
153
|
+
await p.click('#czViewer [data-iv-zoom]');
|
|
154
|
+
await p.evaluate(() => { const b = [...document.querySelectorAll('.tkc.ivq [data-ivq-i]')].find((x) => /Weeks/.test(x.textContent)); if (b) b.click(); });
|
|
155
|
+
await until(() => p.evaluate(() => (document.querySelector('#czViewer [data-iv-zoom]') || {}).textContent === 'Weeks'));
|
|
156
|
+
|
|
157
|
+
/* V5 drag a bar: it snaps to days, a tip says the new dates, the save follows with Undo; an end changes only its own day */
|
|
158
|
+
const bb = await p.evaluate(() => { const r = document.querySelector('#czViewer [data-ivt-bar="task-a"]').getBoundingClientRect(); return { x: r.left + r.width / 2, y: r.top + r.height / 2, l: r.left, r: r.right }; });
|
|
159
|
+
await p.mouse.move(bb.x, bb.y); await p.mouse.down(); await p.mouse.move(bb.x + 20, bb.y, { steps: 3 }); await p.mouse.move(bb.x + 42, bb.y, { steps: 3 });
|
|
160
|
+
const tip = await p.evaluate(() => (document.querySelector('#czViewer .ivt-tip') || {}).textContent || null);
|
|
161
|
+
await p.mouse.up();
|
|
162
|
+
const mv = await until(() => { const x = lastPost(A, '/api/boards/tasks/edit'); return x && x.body.task === 'task-a' ? x : null; });
|
|
163
|
+
ok('V5 dragging a bar shows the new dates in a tip, snapped to days', tip === 'Oct 17 → 24', tip);
|
|
164
|
+
ok('V5 the drop saves the new start and due at once', mv && mv.body.start === '2026-10-17' && mv.body.due === '2026-10-24', JSON.stringify(mv));
|
|
165
|
+
ok('V5 the drop does not open the date picker', !(await p.evaluate(() => !!document.querySelector('.tkc.ivq'))));
|
|
166
|
+
await sleep(500);
|
|
167
|
+
const b2 = await p.evaluate(() => { const r = document.querySelector('#czViewer [data-ivt-bar="task-a"] .ivt-gp.r').getBoundingClientRect(); return { x: r.left + r.width / 2, y: r.top + r.height / 2 }; });
|
|
168
|
+
await p.hover('#czViewer [data-ivt-bar="task-a"]');
|
|
169
|
+
await p.mouse.move(b2.x, b2.y); await p.mouse.down(); await p.mouse.move(b2.x + 30, b2.y, { steps: 4 }); await p.mouse.up();
|
|
170
|
+
const end = await until(() => { const x = lastPost(A, '/api/boards/tasks/edit'); return x && x.body.task === 'task-a' && x.body.start == null ? x : null; });
|
|
171
|
+
ok('V5 dragging the end changes only the due day', end && end.body.due === '2026-10-23', JSON.stringify(end));
|
|
172
|
+
await sleep(500);
|
|
173
|
+
await p.click('#czViewer [data-ivt-bar="task-c"]');
|
|
174
|
+
ok('V5 a press on a bar opens the date picker under it', await until(() => p.evaluate(() => !!document.querySelector('.tkc.ivq .tkc-dp')), 2000));
|
|
175
|
+
await p.keyboard.press('Escape');
|
|
176
|
+
ok('V5 Escape closes the picker and leaves the panel open', await p.evaluate(() => !document.querySelector('.tkc.ivq') && !!document.querySelector('#czViewer .ivt')));
|
|
177
|
+
|
|
178
|
+
/* V6 Kanban: one stage at a time (the current first), columns by status, Won't do a folded strip */
|
|
179
|
+
await p.click('#czViewer [data-iv-view="kanban"]');
|
|
180
|
+
await until(() => p.evaluate(() => !!document.querySelector('#czViewer .ivk')));
|
|
181
|
+
const kb = await p.evaluate(() => { const K = document.querySelector('#czViewer .ivk'); return { stage: document.querySelector('#czViewer [data-iv-kstage]').textContent, cols: [...K.querySelectorAll('.ivk-c h4')].map((h) => h.textContent).join('|'), wont: K.querySelector('.ivk-w').textContent, cards: [...K.querySelectorAll('.ivk-d .iv-tt')].map((e) => e.textContent), arch: /Old spike notes/.test(K.textContent) }; });
|
|
182
|
+
ok('V6 Kanban opens on the current stage, with columns To do, In progress, Done', kb.stage === 'Discover' && kb.cols === 'To do2|In progress2|Done1', JSON.stringify(kb));
|
|
183
|
+
ok('V6 Won\'t do is a folded strip with its count; archived shows nowhere', kb.wont === "Won't do · 1" && !kb.arch, JSON.stringify(kb));
|
|
184
|
+
await shot(p, 'kanban-1440');
|
|
185
|
+
await p.click('#czViewer [data-iv-kstage]');
|
|
186
|
+
const st = await until(() => p.evaluate(() => { const q = document.querySelector('.tkc.ivq .ivq-m'); return q ? [...q.querySelectorAll('[data-ivq-i]')].map((b) => b.textContent.replace(/\s+/g, ' ').trim()) : null; }));
|
|
187
|
+
ok('V6 the stage picker: current stage first, All stages, then the rest, each with its count', st && st.join('|') === 'Discover1 late · 4 open|All stages5 open|Triage|Later stages1 to do', JSON.stringify(st));
|
|
188
|
+
await p.evaluate(() => { const b = [...document.querySelectorAll('.tkc.ivq [data-ivq-i]')].find((x) => /All stages/.test(x.textContent)); if (b) b.click(); });
|
|
189
|
+
const all = await until(() => p.evaluate(() => (document.querySelector('#czViewer [data-iv-kstage]') || {}).textContent === 'All stages' ? document.querySelectorAll('#czViewer .ivk-d').length : null));
|
|
190
|
+
ok('V6 All stages shows every task but the archived one (Won\'t do stays in its folded strip)', all === 6, String(all));
|
|
191
|
+
|
|
192
|
+
/* V7 drag a card to another column: its status changes */
|
|
193
|
+
await p.dragAndDrop('#czViewer [data-ivk-card="task-b"]', '#czViewer [data-ivk-col="In progress"]');
|
|
194
|
+
const dg = await until(() => { const x = lastPost(A, '/api/boards/tasks/state'); return x && x.body.task === 'task-b' && x.body.state === 'In progress' ? x : null; });
|
|
195
|
+
ok('V7 dragging a card to In progress saves its status', !!dg, JSON.stringify(A.posts.slice(-2)));
|
|
196
|
+
|
|
197
|
+
/* V1 the view is remembered across initiatives and visits */
|
|
198
|
+
const R = await open({ store: await p.evaluate(() => ({ 'pmos.tasks.view': localStorage.getItem('pmos.tasks.view') })) });
|
|
199
|
+
const rem = await R.page.evaluate(() => (document.querySelector('#czViewer .ivx-sb[aria-pressed="true"]') || {}).dataset.ivView);
|
|
200
|
+
ok('V1 the last view is remembered for the PM: the next panel opens on Kanban', rem === 'kanban', rem);
|
|
201
|
+
await R.ctx.close();
|
|
202
|
+
ok('V0 no page error', A.errors.length === 0, A.errors.join(' | '));
|
|
203
|
+
if (process.env.SHOTS_5B) {
|
|
204
|
+
await p.emulateMedia({ colorScheme: 'dark' }); await p.goto(BASE + '/premium-board.html?theme=dark'); await sleep(200);
|
|
205
|
+
}
|
|
206
|
+
await A.ctx.close();
|
|
207
|
+
|
|
208
|
+
/* V9 the phone: Kanban one column a screen with tabs; Timeline puts the title above its bar and does not drag */
|
|
209
|
+
for (const theme of ['light', 'dark']) {
|
|
210
|
+
const Ph = await open({ w: 390, h: 844, theme, touch: true, store: { 'pmos.tasks.view': 'kanban' } }), q = Ph.page;
|
|
211
|
+
const pk = await q.evaluate(() => { const K = document.querySelector('#czViewer .ivk'), t = document.querySelector('#czViewer .ivk-tabs'), c = K && K.querySelector('.ivk-c'); return K ? { tabs: t && getComputedStyle(t).display, tw: [...t.querySelectorAll('button')].map((b) => b.textContent.trim()).join('|'), cw: Math.round(c.getBoundingClientRect().width), kw: Math.round(K.getBoundingClientRect().width), car: getComputedStyle(document.querySelector('#czViewer .iv-car') || document.body).display } : null; });
|
|
212
|
+
if (theme === 'light') {
|
|
213
|
+
ok('V9 phone Kanban: one column a screen, the next peeks, status tabs on top', pk && pk.tabs === 'flex' && pk.tw === 'To do 2|In progress 2|Done 1' && pk.cw < pk.kw && pk.cw > pk.kw * 0.7, JSON.stringify(pk));
|
|
214
|
+
ok('V9 phone: no caret (a long press on the box opens the status picker)', pk && pk.car === 'none', JSON.stringify(pk));
|
|
215
|
+
}
|
|
216
|
+
await shot(q, 'kanban-390-' + theme);
|
|
217
|
+
await q.evaluate(() => document.querySelector('#czViewer [data-iv-view="timeline"]').click());
|
|
218
|
+
await until(() => q.evaluate(() => !!document.querySelector('#czViewer .ivt')));
|
|
219
|
+
await sleep(200);
|
|
220
|
+
const pt = await q.evaluate(() => { const r = document.querySelector('#czViewer .ivt-r.k'), n = r.querySelector('.ivt-n').getBoundingClientRect(), c = r.querySelector('.ivt-c').getBoundingClientRect(); return { above: c.top >= n.bottom - 1, grips: getComputedStyle(document.querySelector('#czViewer .ivt-gp') || document.body).display }; });
|
|
221
|
+
if (theme === 'light') ok('V9 phone Timeline: the title sits above its bar; no drag grips', pt.above && pt.grips === 'none', JSON.stringify(pt));
|
|
222
|
+
await shot(q, 'timeline-390-' + theme);
|
|
223
|
+
if (theme === 'light') {
|
|
224
|
+
// a long press on the box opens the status picker; the click that follows does not mark it done
|
|
225
|
+
await q.evaluate(() => document.querySelector('#czViewer [data-iv-view="list"]').click());
|
|
226
|
+
await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-iv-check="task-b"]')));
|
|
227
|
+
const n0 = Ph.posts.length;
|
|
228
|
+
const bx = await q.evaluate(() => { const r = document.querySelector('#czViewer [data-iv-check="task-b"]').getBoundingClientRect(); return { x: r.left + r.width / 2, y: r.top + r.height / 2 }; });
|
|
229
|
+
const cdp = await q.context().newCDPSession(q);
|
|
230
|
+
await cdp.send('Input.dispatchTouchEvent', { type: 'touchStart', touchPoints: [{ x: bx.x, y: bx.y }] });
|
|
231
|
+
await sleep(700);
|
|
232
|
+
await cdp.send('Input.dispatchTouchEvent', { type: 'touchEnd', touchPoints: [] });
|
|
233
|
+
await sleep(300);
|
|
234
|
+
const lp = await q.evaluate(() => !!document.querySelector('.tkc.ivq .ivq-st'));
|
|
235
|
+
ok('V9 phone: a long press on the box opens the status picker and marks nothing done', lp && Ph.posts.length === n0, JSON.stringify({ lp, posts: Ph.posts.slice(n0) }));
|
|
236
|
+
await shot(q, 'list-longpress-390');
|
|
237
|
+
}
|
|
238
|
+
await Ph.ctx.close();
|
|
239
|
+
}
|
|
240
|
+
if (process.env.SHOTS_5B) {
|
|
241
|
+
const D = await open({ theme: 'dark', store: { 'pmos.tasks.view': 'timeline' } }); await sleep(200); await shot(D.page, 'timeline-1440-dark');
|
|
242
|
+
await D.page.evaluate(() => document.querySelector('#czViewer [data-iv-view="kanban"]').click()); await sleep(200); await shot(D.page, 'kanban-1440-dark'); await D.ctx.close();
|
|
243
|
+
}
|
|
244
|
+
return finish();
|
|
245
|
+
})();
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Batch 9 item 5a (Wawan 2026-10-26: \"Cannot click the task and see its detail\"): a task's title on the initiative's view opens the one task editor, on Home's page and on the Board's panel, also for a task only the board's row holds. Serves the real pages.",
|
|
3
|
+
"modules": [],
|
|
4
|
+
"panels": ["task-press-test.js"],
|
|
5
|
+
"seconds": { "task-press-test.js": 40 }
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Batch 9 item 5b (Wawan agreed option A, 2026-10-26): the initiative's Tasks as List, Timeline and Kanban, and a task's status and dates changed where it sits (the box's caret, the date press, a bar or card drag). Serves the real Board page; the pure half is in ini-view-model.test.js.",
|
|
3
|
+
"modules": [],
|
|
4
|
+
"panels": ["task-views-test.js"],
|
|
5
|
+
"seconds": { "task-views-test.js": 45 }
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Feedback batch 9 item 8 (holds as gaps on the Board timeline; canvas XtiA*): the hold and plain-gap fold, and the timeline's gaps, ⏸ menu, legend, edge tab, program line and phone.",
|
|
3
|
+
"modules": ["hold-spans.test.js"],
|
|
4
|
+
"panels": ["timeline-holds-test.js"],
|
|
5
|
+
"seconds": { "hold-spans.test.js": 1, "timeline-holds-test.js": 40 }
|
|
6
|
+
}
|