create-pmos 0.793.0 → 0.794.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +14 -15
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/changelog.json +13 -0
- package/workspace/guide/breakdown.md +10 -6
- package/workspace/guide/layout.md +15 -0
- package/workspace/lib/prefs-sync.js +1 -0
- package/workspace/lib/routes-use-log.js +6 -1
- package/workspace/lib/use-log.js +18 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/bd-pop-ds.css +5 -0
- package/workspace/public/pm/bd-pop-ds.js +13 -6
- package/workspace/public/pm/cozy-pop-work.js +123 -18
- package/workspace/public/pm/pop-cap.js +103 -0
- package/workspace/test-lists/popup-cap.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.794.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -33,6 +33,19 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.794.0",
|
|
38
|
+
"at": "2026-11-24T19:46:34.647Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1809,
|
|
43
|
+
"t": "The work popup shows five actions at most (job #1774, A498)",
|
|
44
|
+
"s": "The work popup shows five actions at most (job #1774, A498)",
|
|
45
|
+
"k": "new"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
36
49
|
{
|
|
37
50
|
"v": "0.793.0",
|
|
38
51
|
"at": "2026-11-24T19:07:01.516Z",
|
|
@@ -465,20 +478,6 @@
|
|
|
465
478
|
"k": "fix"
|
|
466
479
|
}
|
|
467
480
|
]
|
|
468
|
-
},
|
|
469
|
-
{
|
|
470
|
-
"v": "0.774.0",
|
|
471
|
-
"at": "2026-11-24T10:37:50.703Z",
|
|
472
|
-
"f": 4,
|
|
473
|
-
"prs": [
|
|
474
|
-
{
|
|
475
|
-
"n": 1735,
|
|
476
|
-
"t": "Every page, chat rule, guide page and release note says Today and Work, not Home and Board",
|
|
477
|
-
"s": "Every page, chat rule, guide page and release note says Today and Work, not Home and Board",
|
|
478
|
-
"k": "fix",
|
|
479
|
-
"h": "Every page, chat rule, guide page and release note says Today and Work, not Today and Work"
|
|
480
|
-
}
|
|
481
|
-
]
|
|
482
481
|
}
|
|
483
482
|
]
|
|
484
483
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Eval calibration log"
|
|
4
4
|
description: "Append-only record of every PM override of an evaluator verdict."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-24T19:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-24T19:46:30Z"}
|
|
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-24T19:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-24T19:46:30Z"}
|
|
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-24T19:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-24T19:46:30Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.794.0",
|
|
4
|
+
"at": "2026-11-24T19:46:34.647Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1809,
|
|
9
|
+
"t": "The work popup shows five actions at most (job #1774, A498)",
|
|
10
|
+
"s": "The work popup shows five actions at most (job #1774, A498)",
|
|
11
|
+
"k": "new"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
2
15
|
{
|
|
3
16
|
"v": "0.793.0",
|
|
4
17
|
"at": "2026-11-24T19:07:01.516Z",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "An initiative's tasks"
|
|
4
4
|
description: "Where an initiative's tasks show in the workspace, how an agent adds tasks, and who made a change."
|
|
5
|
-
timestamp: 2026-11-
|
|
5
|
+
timestamp: 2026-11-24
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# An initiative's tasks
|
|
@@ -36,7 +36,7 @@ In the terminal or the initiative chat, `pmos task set <task> [<task> …] --par
|
|
|
36
36
|
|
|
37
37
|
## Sprint and priority
|
|
38
38
|
|
|
39
|
-
When you point at an open PMOS task in the List, the row shows
|
|
39
|
+
When you point at an open PMOS task in the List, the row shows three buttons: **Who**, the date and **More**. **Sprint**, **Priority** and **Stage** are in the row's **More** menu. Work › Backlog shows Sprint and Priority at the end of each row.
|
|
40
40
|
|
|
41
41
|
- **Sprint** lists the sprints that are active now or start next, with their dates, as Jira has them. The task's current sprint is ticked. When you select a sprint, the task gets that sprint's start and end dates. A milestone gets only the end date.
|
|
42
42
|
- **Priority** lists P1, P2, P3 and **No priority**. A priority that is set shows in the row, before the date.
|
|
@@ -45,9 +45,13 @@ Each change is saved at once and has one **Undo**. With the keyboard, press Ente
|
|
|
45
45
|
|
|
46
46
|
A Jira ticket keeps the sprint and priority that Jira gives it. PMOS shows no Sprint or Priority button on a Jira ticket and does not change Jira.
|
|
47
47
|
|
|
48
|
+
## The popup's actions
|
|
49
|
+
|
|
50
|
+
The initiative popup shows five actions at most. The others are in its **⋯** menu. See [Layout: the popup's actions](layout.md#the-popups-actions).
|
|
51
|
+
|
|
48
52
|
## Move several tasks at once
|
|
49
53
|
|
|
50
|
-
To select tasks, Cmd-click or Ctrl-click each one, or Shift-click to select a range. This works in the Work breakdown's List and Gantt, in Work › Backlog and in This sprint.
|
|
54
|
+
To select tasks, Cmd-click or Ctrl-click each one, or Shift-click to select a range. This works in the Work breakdown's List and Gantt, in Work › Backlog and in This sprint. The head of the Work breakdown shows the number of selected tasks and the four buttons. Use them, or the first group of **⋯**, to put the tasks under a parent, move them to a stage, give them to a person, move their dates by a number of days, or mark them done. One **Undo** puts all of them back. Press Esc to clear the selection.
|
|
51
55
|
|
|
52
56
|
On a phone or tablet, press and hold a task to select it. Then tap more tasks to add them or tap a selected task to remove it.
|
|
53
57
|
|
|
@@ -74,11 +78,11 @@ A red dot on a ticket shows that it has no epic, or that its epic is not one of
|
|
|
74
78
|
- PMOS sets the epic directly only on the tickets that are assigned to you. It uses your own Atlassian connection.
|
|
75
79
|
- PMOS adds each other ticket to the day's draft for that ticket's owner. PMOS does not send the draft. To read it, run `pmos jira epic-asks --draft`.
|
|
76
80
|
|
|
77
|
-
To set the epic of several tickets, select them. When all the selected tasks are Jira tickets,
|
|
81
|
+
To set the epic of several tickets, select them. When all the selected tasks are Jira tickets, **⋯** shows **Set the epic**. Select the initiative's epic, or type the key of another epic. PMOS uses the same rules: it changes the tickets that are assigned to you, and adds the other tickets to the day's draft.
|
|
78
82
|
|
|
79
|
-
The Gantt has a **Jira** column with the key and the red dot. To hide it, use
|
|
83
|
+
The Gantt has a **Jira** column with the key and the red dot. To hide it, use **⋯** › View › **Columns**. The column shows only when the initiative has Jira tickets.
|
|
80
84
|
|
|
81
|
-
To see only some of the tasks, use
|
|
85
|
+
To see only some of the tasks, use **⋯** › View › **Source**: **All**, **In Jira**, **Only in PMOS** or **Epic to fix**. Each choice shows its number of tasks. A parent stays in the list when one of its tasks matches. **Source** shows only when the tasks come from Jira and from PMOS, or when a ticket needs an epic fix.
|
|
82
86
|
|
|
83
87
|
## Items an agent adds
|
|
84
88
|
|
|
@@ -218,6 +218,21 @@ Press a suggestion's words to open it as its own page: ✓ and ✕, why PMOS sug
|
|
|
218
218
|
|
|
219
219
|
The **Product** and **Program** facts go one level up. A program or a product opens in the same popup with the same three parts: its overview, its initiatives (and programs) on the timeline, and its documents. Press a row to go one level down. ⋯ › **Every part** shows every part of the earlier page, so nothing is lost.
|
|
220
220
|
|
|
221
|
+
## The popup's actions
|
|
222
|
+
|
|
223
|
+
The initiative popup shows five actions at most: **Ask PMOS** in the header and four buttons at the right of **Work breakdown**. Back and Close are not actions. The four are **Add a task or milestone**, **Who**, **Set the date** and **Stage** until PMOS has 30 days of your use. After that, they are the four you use most, and PMOS works them out again once a week, so they do not move while you work. The four follow you to your phone and other browsers.
|
|
224
|
+
|
|
225
|
+
- **Add** goes to the List and puts the cursor in the add box.
|
|
226
|
+
- **Who**, **Set the date** and **Stage** change the selected tasks. If no task is selected, the line "Pick the tasks to change · Esc to stop" shows. Click the tasks, then press the line's button, for example **Who for 2 tasks**. Press Esc to stop.
|
|
227
|
+
|
|
228
|
+
Every other action is in the header's **⋯** menu, in three groups:
|
|
229
|
+
|
|
230
|
+
- **Plan**: **Move the dates** (with no task selected, it moves every open task), **Set the epic**, **Sprint**, **Priority**, **Under a parent** and **Mark them done**. Most of these show only while tasks are selected.
|
|
231
|
+
- **View**: **List** or **Gantt**, and in the Gantt **Columns**, **Span of the timeline** and **The whole popup**. **Source** and **Every part** are here too.
|
|
232
|
+
- **Jira**: **Status in Jira**, when one Jira ticket is selected.
|
|
233
|
+
|
|
234
|
+
An action that does not apply is not in the menu. The action keys and Ctrl K still reach every action.
|
|
235
|
+
|
|
221
236
|
## Events
|
|
222
237
|
|
|
223
238
|
Events is built from the PMOS design system's blocks. The top line is the path, the product chip, then **Search**, **+** and **More** (the month, the week, Show every date, Connectors). The dates are on the left: Late, Today and Coming up, each one card. The month and Show are on the right. A suggestion sits in a blue box with ✓ and ✕. Today's date in the month has a green ring. Undo is the arrow in the toast at the bottom.
|
|
@@ -47,6 +47,7 @@ const KEYS = Object.freeze({
|
|
|
47
47
|
'pmos.routine.kind', 'pmos.routine.scope.v1',
|
|
48
48
|
'pmos.intel.tiles.off', 'pmos.guide.folded', 'pmos.order.notnow', 'pmos.listen.where',
|
|
49
49
|
'pmos.home.cardfold', 'pmos-report-orders-hidden', 'cz-live-side',
|
|
50
|
+
'pmos.pop.five', // the work popup's four toolbar actions, worked out weekly from use (idea A498, pm/pop-cap.js)
|
|
50
51
|
]),
|
|
51
52
|
prefix: Object.freeze(['pmos.board.', 'pmos.pv.tab:', 'pmos.dash.view:', 'cz-vw-fold:']),
|
|
52
53
|
});
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* POST /api/use-log { events } → { ok, wrote } the page side (public/pm/use-log.js), in batches
|
|
7
7
|
* POST /api/use-log/clear {} → { ok } Clear, in Settings (also forgets what pages showed)
|
|
8
8
|
* GET /api/use-log/ease → { ok, window, bar, slow, pages } Settings › Use log › Ease check (bet A453, lib/ease-check.js)
|
|
9
|
+
* GET /api/use-log/pop → { ok, counts, span } the work popup's four actions (idea A498, pm/pop-cap.js)
|
|
9
10
|
* Hide the buttons nobody presses (idea A454; the store and the rule are lib/unused-controls.js):
|
|
10
11
|
* GET /api/use-log/hidden[?page=] → { ok, hidden: [{ page, control, at }] } the page at load; Settings › Use log
|
|
11
12
|
* POST /api/use-log/unused { page, present } → { ok, hidden, propose } what the page shows (ids), and the ✦
|
|
@@ -25,7 +26,7 @@ const POSTS = ['', 'clear', 'unused', 'hide', 'show', 'decline'];
|
|
|
25
26
|
async function handle(req, res, url, ctx) {
|
|
26
27
|
const send = (status, body) => { ctx.json(res, body, status); return true; };
|
|
27
28
|
const what = url.pathname.replace(/^\/api\/use-log\/?/, '');
|
|
28
|
-
if (!POSTS.includes(what) && what !== 'hidden' && what !== 'ease') return send(404, { ok: false, error: 'no such use-log route' });
|
|
29
|
+
if (!POSTS.includes(what) && what !== 'hidden' && what !== 'ease' && what !== 'pop') return send(404, { ok: false, error: 'no such use-log route' });
|
|
29
30
|
const dir = ctx.runtimeDir || null;
|
|
30
31
|
if (what === 'ease') {
|
|
31
32
|
if (req.method !== 'GET') return send(405, { ok: false, error: 'GET only' });
|
|
@@ -33,6 +34,10 @@ async function handle(req, res, url, ctx) {
|
|
|
33
34
|
console.log(`[ease-check] read: ${r.pages.length} pages, ${r.slow} slow`);
|
|
34
35
|
return send(200, { ok: true, ...r });
|
|
35
36
|
}
|
|
37
|
+
if (what === 'pop') {
|
|
38
|
+
if (req.method !== 'GET') return send(405, { ok: false, error: 'GET only' });
|
|
39
|
+
return send(200, { ok: true, ...UL.pop(UL.readLines(dir)) });
|
|
40
|
+
}
|
|
36
41
|
if (what === '' && req.method === 'GET') return send(200, { ok: true, ...UL.summary(UL.readLines(dir)) });
|
|
37
42
|
if (what === 'hidden') {
|
|
38
43
|
if (req.method !== 'GET') return send(405, { ok: false, error: 'GET only' });
|
package/workspace/lib/use-log.js
CHANGED
|
@@ -25,7 +25,9 @@
|
|
|
25
25
|
* node lib/use-log.js keys [--days 7] → [action-keys] used n, [action-keys] missed n, then the hit percent on its last line
|
|
26
26
|
* node lib/use-log.js control <id> [--days 7] → the uses of one control on its last line (day-tint: bet A339's health number)
|
|
27
27
|
* node lib/use-log.js focus [--days 7] → [focus-mode] entered n, [focus-mode] missed n, then the hit percent on its last line (bet A335)
|
|
28
|
-
* focus(lines, days, now) → { entered, missed, pct } PURE, focus mode (bet A335)
|
|
28
|
+
* focus(lines, days, now) → { entered, missed, pct } PURE, focus mode (bet A335)
|
|
29
|
+
* pop(lines, now) → { counts: { who: n, … }, span } PURE, the work popup's actions (idea A498, pm/pop-cap.js): the `pop-<action>` presses
|
|
30
|
+
* of the last KEEP_DAYS days, and span = the whole days the log covers (the four are worked out only at 30 or more) */
|
|
29
31
|
const fs = require('fs');
|
|
30
32
|
const path = require('path');
|
|
31
33
|
|
|
@@ -171,6 +173,21 @@ function controlCount(lines, control, days = 7, now = Date.now()) {
|
|
|
171
173
|
}
|
|
172
174
|
module.exports.controlCount = controlCount;
|
|
173
175
|
|
|
176
|
+
/** PURE: the work popup's action presses (idea A498): counts per action over the last KEEP_DAYS days, and the days of use the log covers. */
|
|
177
|
+
function pop(lines, now = Date.now()) {
|
|
178
|
+
const from = now - KEEP_DAYS * DAY, counts = {};
|
|
179
|
+
let first = Infinity;
|
|
180
|
+
for (const l of lines || []) {
|
|
181
|
+
const t = Date.parse(l && l.at);
|
|
182
|
+
if (!(t >= from)) continue;
|
|
183
|
+
if (t < first) first = t;
|
|
184
|
+
const m = l.kind === 'use' && /^pop-([a-z]{1,20})$/.exec(l.control || '');
|
|
185
|
+
if (m) counts[m[1]] = (counts[m[1]] || 0) + 1;
|
|
186
|
+
}
|
|
187
|
+
return { counts, span: first === Infinity ? 0 : Math.floor((now - first) / DAY) };
|
|
188
|
+
}
|
|
189
|
+
module.exports.pop = pop;
|
|
190
|
+
|
|
174
191
|
if (require.main === module) {
|
|
175
192
|
const cmd = process.argv[2];
|
|
176
193
|
const usage = 'usage: node lib/use-log.js count (the distinct days with a line in the last ' + KEEP_DAYS + ' days)\n'
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.794.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.794.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
.pwd-blk { gap: var(--space-12); }
|
|
9
9
|
.pwd-bh { justify-content: space-between; gap: var(--space-8); }
|
|
10
10
|
.pwd-bh .pm-h-sm { margin: 0; }
|
|
11
|
+
/* the popup cap (PopupCapDS): the toolbar of four sits at the head's end; rows picked put "n selected" and × beside it */
|
|
12
|
+
.pwd-bh .pwd-tb { margin-left: auto; gap: var(--space-4); }
|
|
13
|
+
.pwd-bh.ws-bar .ws-n { margin-left: auto; }
|
|
14
|
+
.pwd-bh.ws-bar .pwd-tb { margin-left: 0; }
|
|
15
|
+
.pwd-pick { margin: var(--space-4) 0 0; }
|
|
11
16
|
|
|
12
17
|
/* ── Where it stands ── */
|
|
13
18
|
.pwd-say { margin: 0; font-size: var(--fs-body); line-height: 24px; }
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* artMenu(arts, o) → the ⋯ menu's Artefacts section (the desk popup has no side card)
|
|
15
15
|
* stageKeyOf(text, st) → { key, name, title } the stage a captured line names ("… in Plan"), else the stage in progress
|
|
16
16
|
*
|
|
17
|
-
* The UI says PMOS, never Claude. Buttons are icons with aria-label. */
|
|
17
|
+
* The UI says PMOS, never Claude. Buttons are icons with aria-label. A row's hover shows at most three: Who, Date, More (PopupCapDS). */
|
|
18
18
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
19
19
|
const SV = (d, w = 16) => `<svg class="pm-ic" aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
|
|
20
20
|
export const I = {
|
|
@@ -127,6 +127,14 @@ export function stagesHtml(st, W) {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/* ── the Work breakdown ── */
|
|
130
|
+
/** The head under the popup cap (PopupCapDS): the title, the epic, and the toolbar of four (pm/pop-cap.js). Rows picked: "n selected" and ×
|
|
131
|
+
* join it. List or Gantt, Source, Columns and the rest are under ⋯ (cozy-pop-work moreItems). */
|
|
132
|
+
export function capHead(o = {}) {
|
|
133
|
+
const n = o.n || 0;
|
|
134
|
+
const sel = n ? `<b class="ws-n">${esc(n)} selected</b>` : '';
|
|
135
|
+
const x = n ? `<button type="button" class="pm-btn ws-x" data-ws-op="clear" aria-label="Clear the selection" title="Clear (Esc)">${SV(I.x, 16)}</button>` : '';
|
|
136
|
+
return `<div class="pm-row pwd-bh${n ? ' ws-bar' : ''}"><h2 class="pm-h-sm">Work breakdown</h2>${o.epic ? `<span class="pm-meta pwd-ep">epic</span>${keyChip({ ckey: o.epic, jurl: o.epicUrl || '' })}` : ''}${sel}${o.toolbar || ''}${x}</div>${o.line || ''}`;
|
|
137
|
+
}
|
|
130
138
|
export function wbsHead(view, epic = '', epicUrl = '') {
|
|
131
139
|
const t = (k, l) => `<button type="button" class="pm-tab" role="tab" aria-selected="${view === k}" data-pwv="${k}">${l}</button>`;
|
|
132
140
|
return `<div class="pm-row pwd-bh"><h2 class="pm-h-sm">Work breakdown</h2>${epic ? `<span class="pm-meta pwd-ep">epic</span>${keyChip({ ckey: epic, jurl: epicUrl || '' })}` : ''}<div class="pm-tabs" role="tablist" aria-label="View of the work breakdown">${t('list', 'List')}${t('gantt', 'Gantt')}</div></div>`;
|
|
@@ -189,14 +197,12 @@ export function listHtml(rows, W, o = {}) {
|
|
|
189
197
|
: o.ro || x.jira ? `<span class="pwd-ck" aria-hidden="true">${SV(x.ms ? I.dia : I.box, 14)}</span>`
|
|
190
198
|
: `<button type="button" class="pwd-ck" data-pw-tick="${esc(x.uid)}" aria-label="${esc('Mark ' + x.title + ' done')}" title="Mark it done">${SV(x.ms ? I.dia : I.box, 14)}</button>`;
|
|
191
199
|
const title = !E.name || x.done ? `<span class="t">${esc(x.title)}</span>` : `<button type="button" class="t pwd-tt" data-pw-name="${esc(x.uid)}" aria-label="${esc('Rename ' + x.title)}">${esc(x.title)}</button>`;
|
|
192
|
-
// on hover (WorkStatesDS 1): Who,
|
|
200
|
+
// on hover (WorkStatesDS 1, capped by PopupCapDS): Who, Date and More, at most three. Stage, Sprint and Priority are in More (rowMenu);
|
|
201
|
+
// a Jira ticket keeps Jira's owner
|
|
193
202
|
const ab = (attr, label, d) => `<button type="button" class="pm-btn" ${attr} aria-label="${esc(label)}" title="${esc(label)}">${SV(d)}</button>`;
|
|
194
203
|
const acts = o.ro ? '' : '<span class="acts">'
|
|
195
204
|
+ (x.jira || x.done ? '' : ab(`data-pw-who="${esc(x.uid)}" aria-haspopup="menu"`, 'Who: ' + (x.who || 'no one'), I.who))
|
|
196
205
|
+ (x.done || !E.dates ? '' : ab(`data-pw-date="${esc(x.uid)}" aria-haspopup="dialog"`, x.date ? (x.ms ? 'Date: ' : 'Due: ') + x.date : 'Set a date', I.cal))
|
|
197
|
-
+ (x.jira ? '' : ab(`data-pw-stage="${esc(x.uid)}" aria-haspopup="menu"`, 'Stage', I.stage))
|
|
198
|
-
// Sprint and Priority (inline-sprint-priority): an open PMOS task only; Jira keeps its tickets' own
|
|
199
|
-
+ (x.jira || x.done ? '' : ab(`data-pw-sprint="${esc(x.uid)}" aria-haspopup="menu"`, 'Sprint', I.sprint) + ab(`data-pw-prio="${esc(x.uid)}" aria-haspopup="menu"`, 'Priority: ' + (x.priority || 'none'), I.flag))
|
|
200
206
|
+ ab(`data-pw-row-more="${esc(x.uid)}" aria-haspopup="menu"`, 'More for ' + x.title, I.more) + '</span>';
|
|
201
207
|
// a parent (WorkSubtasksDS): the fold chevron, "n of m done" with its bar; children indent one step per level, up to three
|
|
202
208
|
const chev = x.kids ? `<button type="button" class="pwd-chev" data-pw-sub="${esc(x.uid)}" aria-expanded="${!!x.open}" aria-label="${esc((x.open ? 'Fold ' : 'Open ') + x.title)}">${SV(x.open ? I.down : I.right, 14)}</button>` : (x.depth || (o.nested && !x.depth) ? '<span class="pwd-chev sp" aria-hidden="true"></span>' : '');
|
|
@@ -219,7 +225,8 @@ export function listHtml(rows, W, o = {}) {
|
|
|
219
225
|
return head + (open ? G.tasks.map(li).join('') : '');
|
|
220
226
|
}).join('');
|
|
221
227
|
const fold = empty.length ? `<div class="pm-fold pwd-fold">${esc(empty.length === 1 ? empty[0] + ' has no tasks yet' : empty.slice(0, -1).join(', ') + ' and ' + empty[empty.length - 1] + ' have no tasks yet')}</div>` : '';
|
|
222
|
-
|
|
228
|
+
// the popup cap (PopupCapDS): with o.capped the picked rows' actions are in the head's toolbar, so the list adds no bar of its own
|
|
229
|
+
const cap = o.ro ? '' : sel.size ? (o.capped ? '' : selBar(sel.size, { epic: !!o.epicSel })) : `<input class="pm-input pwd-cap" data-pw-cap placeholder="Add a task; say its stage, or type "under Batch 2:" to add a subtask" aria-label="Add a task. Say its stage, or type under, a parent's name and a colon to add a subtask" maxlength="200" autocomplete="off">`;
|
|
223
230
|
const top = o.ro ? '' : (o.ask ? tickAskHtml(o.ask.x, o.ask.n) : '') + (o.fix && !sel.size ? epicSugHtml(o.fix) : '') + (o.group && !sel.size ? groupSugHtml(o.group) : '');
|
|
224
231
|
const loose = o.looseN && !o.ro ? `<p class="pwd-loose"><button type="button" class="pw-lk" data-pw-backlog>${esc(o.looseN === 1 ? '1 task with no stage is in the Backlog' : o.looseN + ' tasks with no stage are in the Backlog')}${SV(I.right, 13)}</button></p>` : '';
|
|
225
232
|
return cap + top + `<div class="pwd-list${sel.size ? ' picking' : ''}" role="list" aria-label="Work breakdown">${body || (fold ? '' : '<p class="pm-meta pwd-none">No task yet.</p>')}${fold}</div>` + loose;
|
|
@@ -34,6 +34,8 @@ import * as WT from './work-tree.js'; // subtasks, the epic check and its fix
|
|
|
34
34
|
import * as SEL from './work-select.js'; // select several rows and move them together (WorkBulkDS)
|
|
35
35
|
import * as IF from './inline-fields.js'; // a task's sprint and priority, set in the row (initiative inline-sprint-priority)
|
|
36
36
|
import * as SD from './star-draft.js'; // a ✦ draft runs as a PMOS background job and lands on its line (star-buttons-act-directly A7)
|
|
37
|
+
import * as CAP from './pop-cap.js'; // five actions at most: Ask PMOS and the toolbar's four, the rest under ⋯ (popup-cap, idea A498)
|
|
38
|
+
import { noteUse } from './use-log.js';
|
|
37
39
|
import * as PD from './bd-pop-ds.js'; // the popup on a computer, built from the design system's blocks (initiative work-ds-popup) // the Kind of a file and one row per kind (round 3 point 16), shared with the Library // the rename and its Undo, the same write as the old List (batch 18 item 16)
|
|
38
40
|
|
|
39
41
|
const CSS = new URL('./cozy-pop-work.css', import.meta.url).href, DSCSS = new URL('./bd-pop-ds.css', import.meta.url).href;
|
|
@@ -138,6 +140,24 @@ function critSugHtml(cr) {
|
|
|
138
140
|
/* the goal's name, not its id (board 25: "De-risk Okta dependency", not KR-C4): GET /api/boards/anchors once per product */
|
|
139
141
|
const GOALS = new Map(); // ws|board → [{ value, kind, label }] | null while reading | false
|
|
140
142
|
let goalsRedraw = null;
|
|
143
|
+
let capRedraw = null; // the popup drawn last: the four came back from the use log
|
|
144
|
+
// the popup cap (idea A498, PopupCapDS): the toolbar's four are the actions used most in the last 30 days, worked out again once a week and
|
|
145
|
+
// kept under a key that follows the person (lib/prefs-sync.js 'pmos.pop.five'); before 30 days of use, Add, Who, Set the date and Stage
|
|
146
|
+
const FIVE = 'pmos.pop.five';
|
|
147
|
+
let FOUR_ASKED = false;
|
|
148
|
+
function fourIds() {
|
|
149
|
+
const saved = store.get(FIVE, null);
|
|
150
|
+
if (!RO && !FOUR_ASKED && CAP.due(saved)) {
|
|
151
|
+
FOUR_ASKED = true;
|
|
152
|
+
Promise.resolve().then(() => pmGet('/api/use-log/pop')).then((r) => {
|
|
153
|
+
if (!r || r.ok === false) return;
|
|
154
|
+
const ids = CAP.four(r.counts, r.span), was = saved && Array.isArray(saved.ids) ? saved.ids.join() : '';
|
|
155
|
+
store.set(FIVE, { ids, at: new Date().toISOString() });
|
|
156
|
+
if (was !== ids.join() && capRedraw) capRedraw();
|
|
157
|
+
}).catch(() => {});
|
|
158
|
+
}
|
|
159
|
+
return saved && !CAP.due({ ids: saved.ids, at: new Date().toISOString() }) ? saved.ids.slice() : [...CAP.DEFAULT];
|
|
160
|
+
}
|
|
141
161
|
function goalOf(ws, board, anchor) {
|
|
142
162
|
const a = String(anchor || '').trim(); if (!a || !board) return '';
|
|
143
163
|
const k = (ws || '') + '|' + board;
|
|
@@ -335,7 +355,7 @@ function rowHtml(x, W, C, sugRows) {
|
|
|
335
355
|
return `<div class="pw-tr pw-kr${x.done ? ' done' : ''}${x.lit ? ' lit' : ''}${x.kids ? ' par' : ''}${RSEL.has(String(x.uid)) ? ' sel' : ''}" role="row" data-pw-row="${esc(x.uid)}" data-pw-sec="${esc(x.sec)}"${x.depth ? ` style="--pw-d:${x.depth}"` : ''}><span class="pw-it"${!x.jsub && canDrag() ? ' draggable="true"' : ''}>${chev}<i class="pw-bul${x.ms ? ' ms' : ''}" aria-hidden="true"></i>${title}${more2}${RO ? '' : ib(`data-pw-open="${esc(x.uid)}"`, 'Open the task', P.open, 'xs hov') + ib(`data-pw-row-more="${esc(x.uid)}" aria-haspopup="menu"`, 'More for ' + x.title, P.more, 'xs hov')}</span>${jc}${stc}${dtc}${tl}</div>`
|
|
336
356
|
+ (s ? `<div class="pw-tr pw-sugrow" role="row"><span class="pw-it">${sugLine(s, true)}</span></div>` : '');
|
|
337
357
|
}
|
|
338
|
-
function breakdownHtml(W, C, mode, full, S) {
|
|
358
|
+
function breakdownHtml(W, C, mode, full, S, capped) {
|
|
339
359
|
const sugRows = W.rowSuggests, ms = !!(S && S.msAdd);
|
|
340
360
|
// the add row (round 3 point 2): "◇" beside it makes the next one a milestone; typing "◇ " first does the same
|
|
341
361
|
const add = (key, name) => `<div class="pw-tr pw-add" role="row"><span class="pw-it"><label class="pw-addf">${SVG(P.plus, 14)}<input data-pw-add="${esc(key)}" data-pw-add-name="${esc(name)}" placeholder="${ms ? 'Add a milestone' : 'Add a task'}" aria-label="${esc((ms ? 'Add a milestone to ' : 'Add a task to ') + name)}" maxlength="200" autocomplete="off"></label>`
|
|
@@ -349,8 +369,9 @@ function breakdownHtml(W, C, mode, full, S) {
|
|
|
349
369
|
if (curSec && (!nx || nx.kind === 'stage' || nx.kind === 'far')) { if (curSec.key !== '' && !RO) out += add(curSec.key, curSec.name); curSec = null; }
|
|
350
370
|
}
|
|
351
371
|
const spanB = C.tl ? `<button type="button" class="pw-span" data-pw-span aria-haspopup="menu" aria-label="${esc('Span of the timeline: ' + (M.MODES.find((m) => m[0] === mode) || M.MODES[5])[1])}">${esc((M.MODES.find((m) => m[0] === mode) || M.MODES[5])[1])}${SVG(P.down, 12)}</button>` : '';
|
|
352
|
-
|
|
353
|
-
const
|
|
372
|
+
// under the popup cap (PopupCapDS) the head's tools are in ⋯: Span, The whole popup and Columns (the timeline is a column there)
|
|
373
|
+
const tools = capped ? '' : RO ? (spanB ? `<span class="pw-tools">${spanB}</span>` : '') : `<span class="pw-tools">${spanB}${ib(`data-pw-big aria-pressed="${!!full}"`, full ? 'Back to the initiative' : 'Give the work breakdown the whole popup', full ? P.in : P.full)}${ib('data-pw-tune="wbs" aria-haspopup="menu"', 'Show or hide columns', P.tune)}</span>`;
|
|
374
|
+
const show = !C.tl && !RO && !capped ? ib('data-pw-tl', 'Show the timeline', P.show, 'xs') : '';
|
|
354
375
|
// the tasks in no stage are not in the breakdown (Wawan, 2026-11-19): they live in Work › Backlog; one quiet line says so and goes there
|
|
355
376
|
const loose = W.looseN && !RO ? `<p class="pw-loose"><button type="button" class="pw-lk" data-pw-backlog>${esc(W.looseN === 1 ? '1 task with no stage is in the Backlog' : W.looseN + ' tasks with no stage are in the Backlog')}${SVG(P.right, 13)}</button></p>` : '';
|
|
356
377
|
return `<section class="pw-sec" aria-label="Work breakdown">${full ? `<div class="pw-sech">${tools}</div>` : `<div class="pw-sech"><h3>Work breakdown</h3>${show}${tools}</div>`}`
|
|
@@ -443,12 +464,14 @@ function dsHtml(r, v, o, W, S, C, mode) {
|
|
|
443
464
|
const cnt = WT.sourceCounts(st, epics), src = cnt.all && S.src ? S.src : 'all', stF = WT.sourceKeep(st, src, epics);
|
|
444
465
|
const group = src === 'all' ? WT.groupPlan(st, { dropped: groupDropped(id) })[0] || null : null;
|
|
445
466
|
const epicSel = S.sel.size > 0 && WT.allJira(stagesOf(r, v, { ...o, today: W.today, subAll: true }), S.sel);
|
|
446
|
-
const srcB = PD.sourceHtml(cnt, src);
|
|
447
467
|
const askRow = S.tickAsk ? st.find((x) => x.uid === S.tickAsk) : null, ask = askRow ? { x: askRow, n: openUnder(stagesOf(r, v, { ...o, today: W.today, subAll: true }), askRow.uid).length } : null;
|
|
448
|
-
|
|
468
|
+
// the popup cap (PopupCapDS): the head holds the title, the epic and the toolbar of four; rows picked add "n selected" and ×. While an
|
|
469
|
+
// action waits for rows, one line says what to do; List or Gantt, Source, Columns, Span and The whole popup are under ⋯ (moreItems)
|
|
470
|
+
const head = PD.capHead({ n: S.sel.size, epic: epics[0] || '', epicUrl: epics[0] ? jiraUrlOf(st, epics[0]) : '',
|
|
471
|
+
toolbar: CAP.toolbarHtml(fourIds(), { picked: S.sel.size > 0, jiraPicked: epicSel }), line: S.act ? CAP.pickLineHtml(S.act, S.sel.size) : '' });
|
|
449
472
|
const wbs = view === 'gantt'
|
|
450
|
-
? breakdownHtml(W, C, mode, false, S).replace('<h3>Work breakdown</h3>', head
|
|
451
|
-
: `<section class="pm-block pwd-blk pwd-wbs" aria-label="Work breakdown">${
|
|
473
|
+
? breakdownHtml(W, C, mode, false, S, true).replace('<h3>Work breakdown</h3>', head).replace('class="pw-sec"', 'class="pw-sec pm-block pwd-blk pwd-wbs"')
|
|
474
|
+
: `<section class="pm-block pwd-blk pwd-wbs" aria-label="Work breakdown">${head}${PD.listHtml(stF, W, { looseN: W.looseN, epics, fix, ask, sel: S.sel, nested: st.some((x) => x.kids), drag: canDrag(), group, epicSel, capped: true })}</section>`;
|
|
452
475
|
// the done test's acceptance criteria on the initiative's Jira tickets (jira-criteria-write): its ✦ above the breakdown, unless the PM said no
|
|
453
476
|
const crit = S.sel.size || dropped().has('crit:' + id) ? '' : critSugHtml(CRIT.get(id));
|
|
454
477
|
// Overview (Wawan, 2026-11-23): Where it stands, The case and its facts in one block across the top; folded or open is the person's choice
|
|
@@ -559,7 +582,8 @@ function phoneHtml(W, S, oid, v) {
|
|
|
559
582
|
const others = PT.others.length ? `<button type="button" class="pw-pfold" data-pw-phall aria-expanded="${all}"><b>${esc(PT.others.map((x) => x.name).join(', '))}</b><span>${esc(all ? 'tap to fold' : 'tap to open')}</span>${SVG(all ? P.down : P.right, 13)}</button>${all ? `<ul class="pw-pwbs2">${rest}</ul>` : ''}` : '';
|
|
560
583
|
const loose = W.looseN ? `<p class="pw-loose"><button type="button" class="pw-lk" data-pw-backlog>${esc(W.looseN === 1 ? '1 task with no stage is in the Backlog' : W.looseN + ' tasks with no stage are in the Backlog')}${SVG(P.right, 13)}</button></p>` : '';
|
|
561
584
|
// press and hold a row to select it, then tap more (WorkBulkDS); the bar takes the heading's place while rows are picked
|
|
562
|
-
|
|
585
|
+
// under the popup cap (PopupCapDS) the bar is "n selected", the toolbar's four and ×; Under a parent and Mark them done are in ⋯
|
|
586
|
+
const pbar = S.sel.size ? PD.capHead({ n: S.sel.size, toolbar: CAP.toolbarHtml(fourIds(), { picked: true, jiraPicked: WT.allJira(W.rows, S.sel) }), line: S.act ? CAP.pickLineHtml(S.act, S.sel.size) : '' }).replace('<h2 class="pm-h-sm">Work breakdown</h2>', '') : '';
|
|
563
587
|
const wbs = `<section class="pw-psec" aria-label="Work breakdown">${pbar || `<h4>Work breakdown${PT.now ? ' · ' + esc(PT.now.name) : ''}</h4>`}${nowList}${others}${loose}</section>`;
|
|
564
588
|
// the case: the lines that are written (Problem, Solution, Expected, Check …), each changeable where the popup lets it be
|
|
565
589
|
const lines = ov.lines.filter((L) => L.text);
|
|
@@ -820,7 +844,8 @@ export function wire(body, h0, x0) {
|
|
|
820
844
|
function cur() { const x = body.__pwx, r = x && x.r(), v = x && x.v(); return r && v ? { r, v, ...model(r, v, x.o()) } : null; }
|
|
821
845
|
function redraw() { if (body.__pwh && body.__pwh.redraw) body.__pwh.redraw(); }
|
|
822
846
|
LE.view(body, () => { if (body.querySelector('.pw')) redraw(); });
|
|
823
|
-
goalsRedraw = artRedraw = wsnRedraw = () => { if (body.isConnected && body.querySelector('.pw')) redraw(); };
|
|
847
|
+
goalsRedraw = artRedraw = wsnRedraw = capRedraw = () => { if (body.isConnected && body.querySelector('.pw')) redraw(); };
|
|
848
|
+
body.__pwcur = cur; body.__pwredraw = redraw; // ⋯ acts on the popup drawn now (capItems)
|
|
824
849
|
wireGrip(body);
|
|
825
850
|
// a phone: a proposal swiped right says yes, left says no (its own hidden Yes and No presses, so the popup's writes and Undo stay theirs)
|
|
826
851
|
wireSwipe(body, { on: phone, act: (row, way) => { const b = row.querySelector(way === 'right' ? '[data-sw-yes]' : '[data-sw-no]'); if (b) b.click(); } });
|
|
@@ -837,9 +862,10 @@ export function wire(body, h0, x0) {
|
|
|
837
862
|
if (body.__pwQuiet && Date.now() - body.__pwQuiet < 700) { e.preventDefault(); e.stopPropagation(); body.__pwQuiet = 0; return; }
|
|
838
863
|
// select several rows (WorkBulkDS): Cmd or Ctrl-click adds one, Shift-click a range; with rows picked, a click adds or takes out one
|
|
839
864
|
{ const rw = e.target.closest('[data-pw-row]'), c0 = rw && !e.target.closest('a, input, textarea, [data-pw-tick], [data-pw-sub], [data-pw-row-more], .acts') ? cur() : null;
|
|
840
|
-
|
|
865
|
+
// while an action of the toolbar waits for rows (popup cap), a plain click picks one
|
|
866
|
+
if (rw && c0 && !RO && (e.shiftKey || e.metaKey || e.ctrlKey || c0.S.sel.size || c0.S.act)) {
|
|
841
867
|
const order = [...body.querySelectorAll('[data-pw-row]')].map((el) => el.dataset.pwRow);
|
|
842
|
-
const pk = SEL.pick(c0.S.sel, order, rw.dataset.pwRow, { shift: e.shiftKey, meta: e.metaKey || e.ctrlKey, anchor: c0.S.anchor });
|
|
868
|
+
const pk = SEL.pick(c0.S.sel, order, rw.dataset.pwRow, { shift: e.shiftKey, meta: e.metaKey || e.ctrlKey, touch: !!c0.S.act, anchor: c0.S.anchor });
|
|
843
869
|
if (pk) { e.preventDefault(); c0.S.sel = pk.sel; c0.S.anchor = pk.anchor; redraw(); return; }
|
|
844
870
|
} }
|
|
845
871
|
const b = e.target.closest('button, [data-pw-line]');
|
|
@@ -894,6 +920,9 @@ export function wire(body, h0, x0) {
|
|
|
894
920
|
if ('pwCritDrop' in d) { const dd = dropped(); dd.add('crit:' + c.id); store.set(DROP, [...dd].slice(-200)); redraw(); return; }
|
|
895
921
|
if ('pwEpicDrop' in d) { const dd = dropped(); dd.add('epic:' + c.id); store.set(DROP, [...dd].slice(-200)); redraw(); return; }
|
|
896
922
|
if (d.wsOp) { await bulkPress(b, d.wsOp, c, h, x); return; }
|
|
923
|
+
// the popup cap (PopupCapDS): the toolbar's four, and the picker a waiting action opens once rows are picked
|
|
924
|
+
if (d.pwAct) { noteUse('pop-' + d.pwAct); await capPress(b, d.pwAct, c, h, x, redraw); return; }
|
|
925
|
+
if (d.pwActGo) { await capGo(b, d.pwActGo, c, h, x); return; }
|
|
897
926
|
// the follow-ups (work-subtasks-followups): the Source filter, the ✦ grouping (✓ makes the parents, ✕ hides it)
|
|
898
927
|
if ('pwSrcMenu' in d) { srcMenu(b, c, x, h); return; }
|
|
899
928
|
if (d.pwGroup) { b.disabled = true; await applyGroup(b, c, h, x); return; }
|
|
@@ -919,7 +948,7 @@ export function wire(body, h0, x0) {
|
|
|
919
948
|
body.addEventListener('keydown', async (e) => {
|
|
920
949
|
if (!live(e)) return;
|
|
921
950
|
const t = e.target, h = body.__pwh;
|
|
922
|
-
if (e.key === 'Escape') { const c0 = cur(); if (c0 && (c0.S.sel.size || c0.S.tickAsk)) { e.preventDefault(); c0.S.sel.clear(); c0.S.tickAsk = ''; redraw(); return; } }
|
|
951
|
+
if (e.key === 'Escape') { const c0 = cur(); if (c0 && (c0.S.sel.size || c0.S.tickAsk || c0.S.act)) { e.preventDefault(); c0.S.sel.clear(); c0.S.tickAsk = ''; c0.S.act = ''; redraw(); return; } }
|
|
923
952
|
if (t.matches && t.matches('[data-pw-line]') && (e.key === 'Enter' || e.key === ' ')) { e.preventDefault(); t.click(); return; }
|
|
924
953
|
// the List's one capture Input (work-ds-popup): the task goes to the stage it names ("… in Plan"), else the stage in progress
|
|
925
954
|
if (t.matches && t.matches('[data-pw-cap]') && e.key === 'Enter') {
|
|
@@ -1134,12 +1163,19 @@ function rowMenu(btn, uid, c, h, body) {
|
|
|
1134
1163
|
openPop(btn, 'pw-rowm', `<button type="button" class="hi-mi" role="menuitem" data-k="status">${SVG(P.box, 14, 2)} Status: ${esc(row.status || 'To do')}</button>`
|
|
1135
1164
|
+ `<button type="button" class="hi-mi" role="menuitem" data-k="kind">${SVG(row.ms ? P.box : P.dia, 14, 2)} ${row.ms ? 'Make it a task' : 'Make it a milestone'}</button>`
|
|
1136
1165
|
+ `<button type="button" class="hi-mi" role="menuitem" data-k="open">${SVG(P.open, 14)} Open the task</button>`
|
|
1166
|
+
// the row's hover shows Who, Date and More only (PopupCapDS): Stage, Sprint and Priority are here; Jira keeps its tickets' own
|
|
1167
|
+
+ (row.jira ? '' : `<button type="button" class="hi-mi" role="menuitem" data-k="stage" aria-haspopup="menu">${SVG(PD.I.stage, 14)} Stage</button>`)
|
|
1168
|
+
+ (row.jira || row.done ? '' : `<button type="button" class="hi-mi" role="menuitem" data-k="sprint" aria-haspopup="menu">${SVG(PD.I.sprint, 14)} Sprint${row.sprint ? ': ' + esc(row.sprint) : ''}</button>`
|
|
1169
|
+
+ `<button type="button" class="hi-mi" role="menuitem" data-k="prio" aria-haspopup="menu">${SVG(PD.I.flag, 14)} Priority: ${esc(row.priority || 'none')}</button>`)
|
|
1137
1170
|
// subtasks (WorkSubtasksDS): make it a subtask of another task, or move it out of its parent
|
|
1138
1171
|
+ (row.jsub ? '' : `<button type="button" class="hi-mi" role="menuitem" data-k="under" aria-haspopup="menu">${SVG(P.right, 14)} Make subtask of…</button>`)
|
|
1139
1172
|
+ (row.up && !row.jsub ? `<button type="button" class="hi-mi" role="menuitem" data-k="out">${SVG(P.show, 14)} Move out of ${esc(((c.W.rows.find((q) => q.uid === row.up) || {}).title) || 'its parent')}</button>` : '')
|
|
1140
1173
|
+ (row.jira ? '<p class="hi-small pw-jn">Status moves in Jira. Dates and kind are PMOS only.</p>' : ''), (b) => {
|
|
1141
1174
|
const k = b.dataset.k;
|
|
1142
1175
|
if (k === 'under') { parentMenu(btn, [uid], c, h, body.__pwx); return; }
|
|
1176
|
+
if (k === 'stage') { stageMenu(btn, uid, c, h, body.__pwx); return; }
|
|
1177
|
+
if (k === 'sprint') { sprintMenu(btn, uid, c, h, body.__pwx); return; }
|
|
1178
|
+
if (k === 'prio') { prioMenu(btn, uid, c, h, body.__pwx); return; }
|
|
1143
1179
|
if (k === 'out') { closePop(); runBulk([uid], 'parent', '', c, h, body.__pwx); return; }
|
|
1144
1180
|
// Status opens its own list (and its "when did this happen" line) in place of this menu
|
|
1145
1181
|
if (k === 'status') { if (row.jira) jiraStatusMenu(btn, uid, h, c); else statusMenu(btn, uid, h, c); return; }
|
|
@@ -1153,7 +1189,7 @@ const atOf = (h, x) => { const o = (x && x.o && x.o()) || {}, w = h.where ? h.wh
|
|
|
1153
1189
|
/** One bulk write (POST /api/boards/tasks/bulk) with one Undo; the picked rows clear. */
|
|
1154
1190
|
async function runBulk(ids, op, value, c, h, x, label) {
|
|
1155
1191
|
const at = atOf(h, x);
|
|
1156
|
-
if (c && c.S) { c.S.sel.clear(); c.S.anchor = ''; }
|
|
1192
|
+
if (c && c.S) { c.S.sel.clear(); c.S.anchor = ''; c.S.act = ''; }
|
|
1157
1193
|
await SEL.bulk(pmPost, { ws: at.ws, board: at.board }, ids, op, value, { say: (m, u) => (u ? undoToast(m, u) : h.toast ? h.toast(m) : undoToast(m)), reload: async () => { if (h.reload) await h.reload(); else if (h.redraw) h.redraw(); } }, label);
|
|
1158
1194
|
}
|
|
1159
1195
|
/** The parents a task can go under: the other tasks of this work, not the picked ones and not under them. "A new parent…" and the top level. */
|
|
@@ -1210,10 +1246,78 @@ async function addUnder(un, all, c, h, x) {
|
|
|
1210
1246
|
undoToast(`Added under ${un.parentTitle}: ${un.title}.`, async () => { await pmPost('/api/boards/tasks/undo-add', { ws: at.ws, board: at.board, task: r.item.uid }).catch(() => null); if (h.reload) await h.reload(); });
|
|
1211
1247
|
if (h.reload) await h.reload();
|
|
1212
1248
|
}
|
|
1249
|
+
/* ── the popup cap (idea A498, PopupCapDS; pure parts in pm/pop-cap.js) ── */
|
|
1250
|
+
/** A toolbar press. Add goes to the List's capture field. Move the dates moves the picked rows, or every open task when none is picked. Who,
|
|
1251
|
+
* Set the date, Stage and Set the epic open their picker on the picked rows; with none picked they start picking ("Pick the tasks to change
|
|
1252
|
+
* · Esc to stop"), and the same press again stops. */
|
|
1253
|
+
async function capPress(btn, act, c, h, x, redraw) {
|
|
1254
|
+
const S = c.S;
|
|
1255
|
+
if (act === 'add') {
|
|
1256
|
+
S.act = ''; S.sel.clear(); S.anchor = '';
|
|
1257
|
+
if (store.get(VIEW, 'list') === 'gantt') store.set(VIEW, 'list');
|
|
1258
|
+
const doc = btn.ownerDocument || document;
|
|
1259
|
+
redraw(); setTimeout(() => { const f = doc.querySelector('.pw [data-pw-cap]'); if (f) f.focus(); }, 0);
|
|
1260
|
+
return;
|
|
1261
|
+
}
|
|
1262
|
+
if (act === 'shift') {
|
|
1263
|
+
if (S.sel.size) { await bulkPress(btn, 'shift', c, h, x); return; }
|
|
1264
|
+
const ids = stagesOf(c.r, c.v, { ...((x && x.o && x.o()) || {}), today: c.W.today, subAll: true }).filter((q) => q.kind === 'task' && !q.done && !q.jira).map((q) => String(q.uid));
|
|
1265
|
+
if (!ids.length) { (h.toast || undoToast)('No open task has dates to move.'); return; }
|
|
1266
|
+
await bulkPress(btn, 'shift', c, h, x, ids);
|
|
1267
|
+
return;
|
|
1268
|
+
}
|
|
1269
|
+
if (S.sel.size) { await capGo(btn, act, c, h, x); return; }
|
|
1270
|
+
S.act = S.act === act ? '' : act;
|
|
1271
|
+
redraw();
|
|
1272
|
+
}
|
|
1273
|
+
/** The picker for the picked rows: Who, Stage and Set the epic as the bar had them; Set the date is the day form for one task, Move the dates
|
|
1274
|
+
* for several. */
|
|
1275
|
+
async function capGo(btn, act, c, h, x) {
|
|
1276
|
+
const ids = [...c.S.sel];
|
|
1277
|
+
if (!ids.length) return;
|
|
1278
|
+
if (act === 'who') return bulkPress(btn, 'owner', c, h, x);
|
|
1279
|
+
if (act === 'stage') return bulkPress(btn, 'section', c, h, x);
|
|
1280
|
+
if (act === 'epic') return bulkPress(btn, 'epic', c, h, x);
|
|
1281
|
+
if (act === 'date') {
|
|
1282
|
+
if (ids.length > 1) return bulkPress(btn, 'shift', c, h, x);
|
|
1283
|
+
c.S.act = ''; c.S.sel.clear(); c.S.anchor = '';
|
|
1284
|
+
return dateMenu(btn, ids[0], c, h, x);
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
/** ⋯ under the cap (PopupCapDS): Plan, View and Jira, with a head line each; an action that does not apply is not there (CAP.moreGroups). A
|
|
1288
|
+
* phone has no View group: it has no Gantt. */
|
|
1289
|
+
function capItems(body, hh) {
|
|
1290
|
+
if (RO || !body || !body.__pwcur || !body.querySelector || !body.querySelector('.pw') || body.querySelector('[data-pw-level]')) return [];
|
|
1291
|
+
const c = body.__pwcur(); if (!c) return [];
|
|
1292
|
+
const x = body.__pwx, h = body.__pwh || {}, redraw = body.__pwredraw || (() => {}), S = c.S, desk = !!body.querySelector('.pw.pwd');
|
|
1293
|
+
const o = (x && x.o && x.o()) || {}, all = stagesOf(c.r, c.v, { ...o, today: c.W.today, subAll: true });
|
|
1294
|
+
const picked = all.filter((q) => q.kind === 'task' && S.sel.has(String(q.uid))), one = picked.length === 1 ? picked[0] : null;
|
|
1295
|
+
const epics = (c.r.epics || []).filter(Boolean), cnt = WT.sourceCounts(stagesOf(c.r, c.v, { ...o, today: c.W.today }, S), epics);
|
|
1296
|
+
const gantt = store.get(VIEW, 'list') === 'gantt';
|
|
1297
|
+
const G = CAP.moreGroups({ picked: picked.length > 0, one: !!one, oneJira: !!(one && one.jira && !one.jsub), allJira: picked.length > 0 && WT.allJira(all, S.sel),
|
|
1298
|
+
oneOpen: !!(one && !one.done && !one.jira), view: gantt ? 'gantt' : 'list', src: !!PD.sourceHtml(cnt, S.src || 'all'), tl: cols().tl }).filter((g) => desk || g.group !== 'View');
|
|
1299
|
+
const run = async (act, a) => {
|
|
1300
|
+
noteUse('pop-' + act);
|
|
1301
|
+
if (act === 'shift') return capPress(a, 'shift', c, h, x, redraw);
|
|
1302
|
+
if (act === 'epic' || act === 'parent' || act === 'done') return bulkPress(a, act, c, h, x);
|
|
1303
|
+
if (act === 'sprint' && one) return sprintMenu(a, String(one.uid), c, h, x);
|
|
1304
|
+
if (act === 'prio' && one) return prioMenu(a, String(one.uid), c, h, x);
|
|
1305
|
+
if (act === 'jira' && one) return jiraStatusMenu(a, String(one.uid), h, c);
|
|
1306
|
+
if (act === 'view') { store.set(VIEW, gantt ? 'list' : 'gantt'); return redraw(); }
|
|
1307
|
+
if (act === 'cols') return tuneMenu(a, 'wbs', redraw);
|
|
1308
|
+
if (act === 'span') return spanMenu(a, redraw);
|
|
1309
|
+
if (act === 'big') return big(c, x, h);
|
|
1310
|
+
if (act === 'src') return srcMenu(a, c, x, h);
|
|
1311
|
+
if (act === 'parts') { if (hh && hh.allParts) hh.allParts(); }
|
|
1312
|
+
};
|
|
1313
|
+
const out = [];
|
|
1314
|
+
for (const g of G) { out.push({ head: g.group }); for (const it of g.items) out.push({ label: it.label, icon: it.icon, on: (a) => { run(it.act, a); } }); }
|
|
1315
|
+
return out.length ? out.concat({ sep: true }) : out;
|
|
1316
|
+
}
|
|
1213
1317
|
/** The bar's presses (WorkBulkDS): under a parent, stage, who, move dates, done, clear. */
|
|
1214
|
-
async function bulkPress(btn, op, c, h, x) {
|
|
1215
|
-
const S = c.S, ids = [...S.sel];
|
|
1216
|
-
if (op === 'clear') { S.sel.clear(); S.anchor = ''; if (h.redraw) h.redraw(); return; }
|
|
1318
|
+
async function bulkPress(btn, op, c, h, x, ids0) {
|
|
1319
|
+
const S = c.S, ids = ids0 || [...S.sel];
|
|
1320
|
+
if (op === 'clear') { S.sel.clear(); S.anchor = ''; S.act = ''; if (h.redraw) h.redraw(); return; }
|
|
1217
1321
|
if (!ids.length) return;
|
|
1218
1322
|
if (op === 'done') { await runBulk(ids, 'done', null, c, h, x); return; }
|
|
1219
1323
|
if (op === 'parent') { parentMenu(btn, ids, c, h, x); return; }
|
|
@@ -1587,8 +1691,9 @@ async function addArt(x, h) {
|
|
|
1587
1691
|
/** The ⋯ entries the popup adds before the host's own: the initiative's Artefacts first (desk layout only; a phone lists them in the page),
|
|
1588
1692
|
* every part of the old page, as a drill-in, and every suggestion. body: the popup body the host drew into (it carries the wired handlers). */
|
|
1589
1693
|
export function moreItems(x, h, body) {
|
|
1590
|
-
|
|
1591
|
-
|
|
1694
|
+
// under the popup cap (PopupCapDS) Plan, View and Jira come first; View holds Every part
|
|
1695
|
+
const cap = capItems(body, h), out = cap.concat(artItems(body));
|
|
1696
|
+
if (h.allParts && !cap.some((it) => it.label === 'Every part')) out.push({ label: 'Every part', on: () => h.allParts() });
|
|
1592
1697
|
if (h.props) out.push({ label: 'Everything PMOS suggests', on: () => h.props() });
|
|
1593
1698
|
return out.length ? out.concat({ sep: true }) : out;
|
|
1594
1699
|
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/* pm/pop-cap.js — the work popup shows five actions at most (popup-cap, idea A498; boards PopupCapDS and PopupStatusPhone, agreed
|
|
2
|
+
* 2026-11-24; brief design-system/popup-cap/brief.md). PURE: strings and lists, no DOM and no reads. pm/cozy-pop-work.js draws it and wires
|
|
3
|
+
* its presses; pm/use-log.js notes each press as `pop-<action>`.
|
|
4
|
+
*
|
|
5
|
+
* THE CAP Ask PMOS (in the popup's header) and the four actions of the toolbar: five. Back and Close move you; they are not actions.
|
|
6
|
+
* The ⋯ (More actions) holds the rest, grouped Plan, View and Jira. Keys (Ctrl K, the action keys) still reach every action.
|
|
7
|
+
* ACTIONS the toolbar's candidates: add, who, date, stage, shift, epic. DEFAULT: add, who, date, stage.
|
|
8
|
+
* four(counts, span) → the four ids: the ones used most in the last 30 days; while there are fewer than 30 days of use, DEFAULT
|
|
9
|
+
* due(saved, now) → true when the four are worked out again: none saved, or saved a week or more ago
|
|
10
|
+
* toolbarHtml(ids, o) → the toolbar: the four icon buttons (data-pw-act). o: { picked, jiraPicked }
|
|
11
|
+
* pickLineHtml(act, n) → the line while picking: "Pick the tasks to change · Esc to stop", then "Who for 2 tasks" with its button
|
|
12
|
+
* moreGroups(o) → [{ group, items: [{ act, label, icon }] }] for ⋯. Plan and Jira only while rows are picked (Move the
|
|
13
|
+
* dates always: with nothing picked it moves every open task); View always. o: { picked, one, oneJira,
|
|
14
|
+
* allJira, oneOpen, view, src, tl }. An action that does not apply is not there.
|
|
15
|
+
* countActions(html) → the visible actions a block's markup holds (data-pw-act and the old head tools); the guard test fails above
|
|
16
|
+
* five with the header's Ask PMOS
|
|
17
|
+
* ROW_MAX → a row's hover shows at most three: Who, Date, More
|
|
18
|
+
* The UI says PMOS, never Claude. Icon buttons carry aria-label. */
|
|
19
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
20
|
+
const SV = (d, w = 16) => `<svg class="pm-ic" aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
|
|
21
|
+
|
|
22
|
+
export const MAX = 5; // Ask PMOS plus the four
|
|
23
|
+
export const ROW_MAX = 3; // Who, Date, More
|
|
24
|
+
export const SPAN_DAYS = 30; // the use that picks the four
|
|
25
|
+
export const WEEK = 7 * 864e5;
|
|
26
|
+
export const IC = {
|
|
27
|
+
plus: 'M12 5v14M5 12h14', who: 'M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM5 20a7 7 0 0 1 14 0', cal: 'M5 6h14v14H5zM5 10h14M9 4v4M15 4v4',
|
|
28
|
+
stage: 'M5 7h14M5 12h10M5 17h6', shift: 'M4 12h14M14 8l4 4-4 4', epic: 'M13 3L5 14h6l-1 7 8-11h-6z',
|
|
29
|
+
sprint: 'M4 12h11M11 8l4 4-4 4M19 6v12', flag: 'M6 21V4M6 4h11l-2 4 2 4H6', gantt: 'M4 6h9M8 12h10M6 18h7', cols: 'M4 5h16v14H4zM9 5v14M15 5v14',
|
|
30
|
+
span: 'M4 12h16M4 8v8M20 8v8', parts: 'M5 7h14M5 12h14M5 17h14', jira: 'M12 3l9 9-9 9-9-9zM12 8l4 4-4 4-4-4z', full: 'M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5',
|
|
31
|
+
tree: 'M6 5v14M6 12h8M6 19h8', done: 'M5 12.5l4.5 4.5L19 7.5', src: 'M4 6h16l-6 7v5l-4 2v-7z',
|
|
32
|
+
};
|
|
33
|
+
/** The toolbar's candidates, in the order the default and a tie keep. `pick: true` acts on picked rows (with none picked it starts picking). */
|
|
34
|
+
export const ACTIONS = Object.freeze({
|
|
35
|
+
add: { label: 'Add a task or milestone', icon: IC.plus },
|
|
36
|
+
who: { label: 'Who', icon: IC.who, pick: true, say: 'Who' },
|
|
37
|
+
date: { label: 'Set the date', icon: IC.cal, pick: true, say: 'Dates' },
|
|
38
|
+
stage: { label: 'Stage', icon: IC.stage, pick: true, say: 'Stage' },
|
|
39
|
+
shift: { label: 'Move the dates', icon: IC.shift, say: 'Move the dates' },
|
|
40
|
+
epic: { label: 'Set the epic', icon: IC.epic, pick: true, say: 'Epic', jira: true },
|
|
41
|
+
});
|
|
42
|
+
export const DEFAULT = Object.freeze(['add', 'who', 'date', 'stage']);
|
|
43
|
+
const ORDER = Object.keys(ACTIONS);
|
|
44
|
+
|
|
45
|
+
/** The four toolbar ids. counts: { 'pop-who': 12, … } (or { who: 12 }); span: days of use the log holds. */
|
|
46
|
+
export function four(counts, span) {
|
|
47
|
+
if (!(Number(span) >= SPAN_DAYS) || !counts) return [...DEFAULT];
|
|
48
|
+
const n = (k) => Number(counts['pop-' + k] != null ? counts['pop-' + k] : counts[k]) || 0;
|
|
49
|
+
const used = ORDER.filter((k) => n(k) > 0).sort((a, b) => n(b) - n(a) || ORDER.indexOf(a) - ORDER.indexOf(b));
|
|
50
|
+
const out = used.slice(0, 4);
|
|
51
|
+
for (const k of DEFAULT) if (out.length < 4 && !out.includes(k)) out.push(k);
|
|
52
|
+
return out;
|
|
53
|
+
}
|
|
54
|
+
/** Work the four out again? None saved, a saved list that is not four known ids, or saved a week or more ago. */
|
|
55
|
+
export function due(saved, now = Date.now()) {
|
|
56
|
+
if (!saved || !Array.isArray(saved.ids) || saved.ids.length !== 4 || !saved.ids.every((k) => ACTIONS[k])) return true;
|
|
57
|
+
const at = Date.parse(saved.at || '');
|
|
58
|
+
return !(at > 0) || now - at >= WEEK;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** The toolbar. An action that cannot apply here is left out (Set the epic with no Jira row picked), so it can hold fewer than four. */
|
|
62
|
+
export function toolbarHtml(ids, o = {}) {
|
|
63
|
+
const L = (ids || []).filter((k) => ACTIONS[k] && !(ACTIONS[k].jira && !o.jiraPicked)).slice(0, 4);
|
|
64
|
+
if (!L.length) return '';
|
|
65
|
+
return `<div class="pm-row pwd-tb" role="toolbar" aria-label="Actions">${L.map((k) => {
|
|
66
|
+
const A = ACTIONS[k], lab = o.picked && A.pick ? A.label + ' for the picked tasks' : A.label;
|
|
67
|
+
return `<button type="button" class="pm-btn pwd-act" data-pw-act="${k}" aria-label="${esc(lab)}" title="${esc(lab)}">${SV(A.icon)}</button>`;
|
|
68
|
+
}).join('')}</div>`;
|
|
69
|
+
}
|
|
70
|
+
/** The line while picking. No row yet: what to do and how to stop. Rows picked: "Who for 2 tasks" and the button that opens the picker. */
|
|
71
|
+
export function pickLineHtml(act, n) {
|
|
72
|
+
const A = ACTIONS[act];
|
|
73
|
+
if (!A) return '';
|
|
74
|
+
if (!n) return `<p class="pm-meta pwd-pick" role="status">Pick the tasks to change · Esc to stop</p>`;
|
|
75
|
+
const what = `${A.say} for ${n} ${n === 1 ? 'task' : 'tasks'}`;
|
|
76
|
+
return `<p class="pwd-pick" role="status"><button type="button" class="pm-btn primary" data-pw-act-go="${act}" aria-haspopup="menu">${esc(what)}</button></p>`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** The ⋯ groups. Zero is silence: an action that does not apply is left out, and so is a group with nothing in it. */
|
|
80
|
+
export function moreGroups(o = {}) {
|
|
81
|
+
const it = (act, label, icon) => ({ act, label, icon });
|
|
82
|
+
const plan = [it('shift', o.picked ? 'Move the dates' : 'Move the dates of every open task', IC.shift)];
|
|
83
|
+
if (o.picked) {
|
|
84
|
+
if (o.allJira) plan.push(it('epic', 'Set the epic', IC.epic));
|
|
85
|
+
if (o.one && o.oneOpen) plan.push(it('sprint', 'Sprint', IC.sprint), it('prio', 'Priority', IC.flag));
|
|
86
|
+
plan.push(it('parent', 'Under a parent', IC.tree), it('done', 'Mark them done', IC.done));
|
|
87
|
+
}
|
|
88
|
+
const view = [it('view', o.view === 'gantt' ? 'List' : 'Gantt', IC.gantt)];
|
|
89
|
+
if (o.view === 'gantt') view.push(it('cols', 'Columns', IC.cols), ...(o.tl ? [it('span', 'Span of the timeline', IC.span)] : []), it('big', 'The whole popup', IC.full));
|
|
90
|
+
if (o.src) view.push(it('src', 'Source', IC.src));
|
|
91
|
+
view.push(it('parts', 'Every part', IC.parts));
|
|
92
|
+
const jira = o.picked && o.one && o.oneJira ? [it('jira', 'Status in Jira', IC.jira)] : [];
|
|
93
|
+
return [{ group: 'Plan', items: plan }, { group: 'View', items: view }, { group: 'Jira', items: jira }].filter((g) => g.items.length);
|
|
94
|
+
}
|
|
95
|
+
export const iconOf = (d, w = 14) => SV(d, w);
|
|
96
|
+
|
|
97
|
+
/** The visible actions a block's markup holds: the toolbar's buttons and any head tool the cap moved under ⋯ (List or Gantt, Span,
|
|
98
|
+
* The whole popup, Columns, Show the timeline, Source). The header's Ask PMOS is the fifth. A row's own buttons are not counted here. */
|
|
99
|
+
export function countActions(html) {
|
|
100
|
+
const s = String(html || '');
|
|
101
|
+
const re = /<button\b[^>]*\b(data-pw-act|data-pwv|data-pw-span|data-pw-big|data-pw-tune|data-pw-tl|data-pw-src-menu|data-ws-op="(?!clear)[^"]*")[^>]*>/g;
|
|
102
|
+
return (s.match(re) || []).length;
|
|
103
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "The work popup shows five actions at most (popup-cap, idea A498, done test planning/done-tests/popup-cap.md C1-C6): the count guard on the popup drawn as a string, the four from 30 days of use, picking, the grouped ⋯, the row's three, the use-log fold and the preference key. No server, network or browser.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"pop-cap.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"pop-cap.test.js": 2
|
|
8
|
+
}
|
|
9
|
+
}
|