create-pmos 0.714.0 → 0.715.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 +26 -26
- package/payload/KIT-VERSION +1 -1
- package/payload/design-system/ui/interactions.md +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 +25 -0
- package/workspace/design-system/ui/interactions.md +1 -1
- package/workspace/guide/breakdown.md +11 -0
- package/workspace/guide/layout.md +2 -2
- package/workspace/lib/backlog.js +3 -1
- package/workspace/lib/board-premium.js +1 -1
- package/workspace/lib/engine/boards.js +9 -2
- package/workspace/lib/routes-boards.js +19 -5
- package/workspace/lib/task-store.js +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/action-keys.js +57 -10
- package/workspace/public/pm/bd-backlog-ds.js +9 -3
- package/workspace/public/pm/bd-backlog.js +20 -1
- package/workspace/public/pm/bd-pop-ds.js +6 -1
- package/workspace/public/pm/bd-work-ds.css +1 -1
- package/workspace/public/pm/cozy-ev.css +5 -4
- package/workspace/public/pm/cozy-pop-work.js +38 -0
- package/workspace/public/pm/ini-view-model.js +1 -1
- package/workspace/public/pm/inline-fields.js +64 -0
- package/workspace/public/pm/pop-work-model.js +1 -1
- package/workspace/test-lists/inline-sprint-priority.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.715.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,31 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.715.0",
|
|
38
|
+
"at": "2026-11-22T20:02:36.257Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1581,
|
|
43
|
+
"t": "The ? list is sized by tokens and uses Komorebi parts only (Checker K5, action-keys)",
|
|
44
|
+
"s": "The ?",
|
|
45
|
+
"k": "fix"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"n": 1582,
|
|
49
|
+
"t": "Key hints step back once a key is learned (A480)",
|
|
50
|
+
"s": "Key hints step back once a key is learned (A480)",
|
|
51
|
+
"k": "new"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"n": 1584,
|
|
55
|
+
"t": "Set a task's sprint and priority in place, with one Undo (job #1563)",
|
|
56
|
+
"s": "Set a task's sprint and priority in place, with one Undo (job #1563)",
|
|
57
|
+
"k": "new"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
36
61
|
{
|
|
37
62
|
"v": "0.714.0",
|
|
38
63
|
"at": "2026-11-22T18:31:53.842Z",
|
|
@@ -453,31 +478,6 @@
|
|
|
453
478
|
"k": "new"
|
|
454
479
|
}
|
|
455
480
|
]
|
|
456
|
-
},
|
|
457
|
-
{
|
|
458
|
-
"v": "0.677.0",
|
|
459
|
-
"at": "2026-11-22T06:18:36.434Z",
|
|
460
|
-
"f": 4,
|
|
461
|
-
"prs": [
|
|
462
|
-
{
|
|
463
|
-
"n": 1464,
|
|
464
|
-
"t": "An ask marked Done in Today stays done, re-worded copies included",
|
|
465
|
-
"s": "An ask marked Done in Today stays done, re-worded copies included",
|
|
466
|
-
"k": "fix"
|
|
467
|
-
},
|
|
468
|
-
{
|
|
469
|
-
"n": 1458,
|
|
470
|
-
"t": "A task Jira closed carries the resolution day as its finish day",
|
|
471
|
-
"s": "A task Jira closed carries the resolution day as its finish day",
|
|
472
|
-
"k": "new"
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
"n": 1471,
|
|
476
|
-
"t": "Remove the unreachable Welcome page, dead screenshot scripts and unused dev dependencies",
|
|
477
|
-
"s": "Remove the unreachable Welcome page, dead screenshot scripts and unused dev dependencies",
|
|
478
|
-
"k": "x"
|
|
479
|
-
}
|
|
480
|
-
]
|
|
481
481
|
}
|
|
482
482
|
]
|
|
483
483
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -55,4 +55,4 @@ One part draws all three, so they look the same on every page: [State](component
|
|
|
55
55
|
| `z` | Undo (the item's Undo, else the Toast's) |
|
|
56
56
|
| `?` | The list of keys, with the ones that work on this page |
|
|
57
57
|
|
|
58
|
-
`y`, `o`, `s`, `p` and `z` press the item's own button, found by its words; a button that has a key shows it in its tooltip ("Open (O)"). The workspace does this once for every page in `pm/action-keys.js`.
|
|
58
|
+
`y`, `o`, `s`, `p` and `z` press the item's own button, found by its words; a button that has a key shows it in its tooltip ("Open (O)") until the person has used that key 3 times, then the tooltip steps back (`aria-keyshortcuts` and the `?` list keep it). The workspace does this once for every page in `pm/action-keys.js`.
|
|
@@ -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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T20:02:32Z"}
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T20:02:32Z"}
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T20:02:32Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.715.0",
|
|
4
|
+
"at": "2026-11-22T20:02:36.257Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1581,
|
|
9
|
+
"t": "The ? list is sized by tokens and uses Komorebi parts only (Checker K5, action-keys)",
|
|
10
|
+
"s": "The ?",
|
|
11
|
+
"k": "fix"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"n": 1582,
|
|
15
|
+
"t": "Key hints step back once a key is learned (A480)",
|
|
16
|
+
"s": "Key hints step back once a key is learned (A480)",
|
|
17
|
+
"k": "new"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"n": 1584,
|
|
21
|
+
"t": "Set a task's sprint and priority in place, with one Undo (job #1563)",
|
|
22
|
+
"s": "Set a task's sprint and priority in place, with one Undo (job #1563)",
|
|
23
|
+
"k": "new"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
2
27
|
{
|
|
3
28
|
"v": "0.714.0",
|
|
4
29
|
"at": "2026-11-22T18:31:53.842Z",
|
|
@@ -55,4 +55,4 @@ One part draws all three, so they look the same on every page: [State](component
|
|
|
55
55
|
| `z` | Undo (the item's Undo, else the Toast's) |
|
|
56
56
|
| `?` | The list of keys, with the ones that work on this page |
|
|
57
57
|
|
|
58
|
-
`y`, `o`, `s`, `p` and `z` press the item's own button, found by its words; a button that has a key shows it in its tooltip ("Open (O)"). The workspace does this once for every page in `pm/action-keys.js`.
|
|
58
|
+
`y`, `o`, `s`, `p` and `z` press the item's own button, found by its words; a button that has a key shows it in its tooltip ("Open (O)") until the person has used that key 3 times, then the tooltip steps back (`aria-keyshortcuts` and the `?` list keep it). The workspace does this once for every page in `pm/action-keys.js`.
|
|
@@ -26,6 +26,17 @@ A parent shows a fold arrow and "n of m done". Its dates are the earliest start
|
|
|
26
26
|
|
|
27
27
|
In the terminal, `pmos task set <task> --parent <task>` sets the parent, and `--parent none` moves the task back to the top level. `pmos task list` shows each subtask under its parent.
|
|
28
28
|
|
|
29
|
+
## Sprint and priority
|
|
30
|
+
|
|
31
|
+
When you point at an open PMOS task in the List, the row shows its buttons. **Sprint** and **Priority** are next to **Who** and the date. Work › Backlog shows the same two buttons at the end of each row.
|
|
32
|
+
|
|
33
|
+
- **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.
|
|
34
|
+
- **Priority** lists P1, P2, P3 and **No priority**. A priority that is set shows in the row, before the date.
|
|
35
|
+
|
|
36
|
+
Each change is saved at once and has one **Undo**. With the keyboard, press Enter on the button to open the list, and Esc to close it without a change.
|
|
37
|
+
|
|
38
|
+
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.
|
|
39
|
+
|
|
29
40
|
## Move several tasks at once
|
|
30
41
|
|
|
31
42
|
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. A bar shows the number of selected tasks. Use it 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.
|
|
@@ -275,9 +275,9 @@ The Board shows initiatives by stage, with programs, a timeline and a list. Inte
|
|
|
275
275
|
| S | Move the item you point at to the next sprint. |
|
|
276
276
|
| P | Park the item you point at (put it on hold). |
|
|
277
277
|
| Z | Undo the last change. |
|
|
278
|
-
| ? | Show these keys, and which of them work on this page. |
|
|
278
|
+
| ? | Show these keys, and which of them work on this page. Esc, ? again or × closes the list. |
|
|
279
279
|
|
|
280
|
-
Y, O, S, P and Z press the item's own button, so they work only where the item has that button. Point at the item, or tab to it, then press the key. Hover a button to see its key, for example **Open (O)**. PMOS counts your key presses in the Use log on this computer.
|
|
280
|
+
Y, O, S, P and Z press the item's own button, so they work only where the item has that button. Point at the item, or tab to it, then press the key. Hover a button to see its key, for example **Open (O)**. After you use a key 3 times, its buttons stop showing it. Press **?** to see every key again. PMOS counts your key presses in the Use log on this computer.
|
|
281
281
|
|
|
282
282
|
A key that you type in a field, or in a terminal, goes to the field or the terminal.
|
|
283
283
|
|
package/workspace/lib/backlog.js
CHANGED
|
@@ -307,7 +307,9 @@ function tasksOf(input) {
|
|
|
307
307
|
sprint: rd.sprint && rd.sprint.name ? { name: str(rd.sprint.name, 80), state: rd.sprint.state || '' } : null, url: rd.url || null });
|
|
308
308
|
} else {
|
|
309
309
|
push({ id, src: 'pmos', key: '', title: str(w.title, 300), ini: iniBy.has(w.ini) ? w.ini : null, kind: w.milestone ? 'Milestone' : 'Task', milestone: !!w.milestone, epic: null,
|
|
310
|
-
...whoOf(w.owner), state: w.status === "Won't do" || w.status === 'Archived' || w.status === 'Done' ? w.status : OPEN.has(w.status) ? w.status : 'To do', due: w.end || null, sprint: null, url: null, item: !!w.item
|
|
310
|
+
...whoOf(w.owner), state: w.status === "Won't do" || w.status === 'Archived' || w.status === 'Done' ? w.status : OPEN.has(w.status) ? w.status : 'To do', due: w.end || null, sprint: null, url: null, item: !!w.item,
|
|
311
|
+
// set in the row (inline-sprint-priority): the PM's priority when set, and the start, so the Sprint list ticks the sprint it is in
|
|
312
|
+
start: w.start || null, ...(w.priority ? { priority: w.priority } : {}) });
|
|
311
313
|
}
|
|
312
314
|
}
|
|
313
315
|
// the tickets of the board's sprints that no initiative holds: No home, unless the PM placed one (a ticket-move line)
|
|
@@ -354,7 +354,7 @@ function build(f) {
|
|
|
354
354
|
// the start too: the Tasks Timeline draws a bar from the start to the due day (batch 9 item 5b)
|
|
355
355
|
taskBy.get(w.ini).push({ uid: w.uid, title: clip(w.title || '', 160), status: w.status || 'To do', owner: w.owner || '', start: w.start || '', end: w.end || '', ...(w.from ? { from: { stage: w.from.stage, finish: w.from.finish } } : {}),
|
|
356
356
|
// one view (feedback batch 6 item 1): its place in the breakdown, and a breakdown item's own stage and order
|
|
357
|
-
...(typeof w.section === 'string' ? { section: w.section } : {}), ...(w.itemStage ? { itemStage: w.itemStage } : {}), ...(Number.isFinite(w.order) ? { order: w.order } : {}), ...(Number.isFinite(w.rank) ? { rank: w.rank } : {}), ...(w.store === 'item' ? { item: true } : {}), ...(w.milestone ? { milestone: true } : {}), ...(w.since ? { since: w.since } : {}),
|
|
357
|
+
...(typeof w.section === 'string' ? { section: w.section } : {}), ...(w.itemStage ? { itemStage: w.itemStage } : {}), ...(Number.isFinite(w.order) ? { order: w.order } : {}), ...(Number.isFinite(w.rank) ? { rank: w.rank } : {}), ...(w.store === 'item' ? { item: true } : {}), ...(w.milestone ? { milestone: true } : {}), ...(w.since ? { since: w.since } : {}), ...(w.priority ? { priority: w.priority } : {}),
|
|
358
358
|
// a subtask's parent (initiative work-subtasks), and the Jira ticket the task names as read: its key, link, epic, assignee and sub-tasks
|
|
359
359
|
...(w.parent ? { parent: w.parent } : {}), ...(w.tracker && w.tracker.key ? { jira: jiraOf(w.tracker) } : {}) });
|
|
360
360
|
}
|
|
@@ -46,6 +46,8 @@
|
|
|
46
46
|
* task-pin { task, pinned } the PM's pin on a milestone (feedback batch 13 item 4, XcalmA5Milestones):
|
|
47
47
|
* true draws it on the Board timeline, false hides it, null goes back to the rule (only the initiative's last milestone).
|
|
48
48
|
* `task` is a Board task, a breakdown item or a Jira key; the last line wins.
|
|
49
|
+
* task-priority { task, priority } the PM's priority, set in the row (inline-sprint-priority):
|
|
50
|
+
* 'P1', 'P2' or 'P3'; '' takes it out. `task` is a Board task or a breakdown item (Jira keeps its tickets' own); the last line wins.
|
|
49
51
|
* task-order { initiative, section, tasks: [id] } the PM's order of the open tasks inside one stage of an
|
|
50
52
|
* initiative's breakdown (feedback batch 18 item 16, a drag in the stage list): the ids top to bottom. A task not named sorts after
|
|
51
53
|
* them. An empty list takes the order out (the urgency again). It never changes a task's status, dates or place; the last line wins.
|
|
@@ -188,7 +190,9 @@ const KINDS = new Set(['board', 'workflow', 'move', 'assign', 'ask', 'ask-accept
|
|
|
188
190
|
// split or merge initiatives (feedback batch 11 item 14): a Jira ticket moved to another initiative, the split and merge records with their Undo, Claude's suggestion dismissed
|
|
189
191
|
'ticket-move', 'ini-split', 'ini-merge', 'ini-sm-undo', 'ini-suggest', 'backlog-rank',
|
|
190
192
|
// Delete an initiative with its tasks, and its Undo (feedback batch 16 item 5d)
|
|
191
|
-
'ini-delete', 'ini-restore'
|
|
193
|
+
'ini-delete', 'ini-restore',
|
|
194
|
+
// a task's priority, set in the row (initiative inline-sprint-priority): P1, P2 or P3; '' takes it out
|
|
195
|
+
'task-priority']);
|
|
192
196
|
// A task's state is its only stage (Wawan, 2026-10-25): the same five every workflow ends in. An old 'In review' reads as In progress (taskState).
|
|
193
197
|
const TASK_STATES = Object.freeze(['To do', 'In progress', 'Done', "Won't do", 'Archived']);
|
|
194
198
|
const taskState = (s) => (s === 'In review' ? 'In progress' : TASK_STATES.includes(s) ? s : null);
|
|
@@ -222,6 +226,7 @@ function fold(events) {
|
|
|
222
226
|
const parents = new Map(); // task id (or Jira key) → the id of its parent task (subtasks, initiative work-subtasks); the last task-parent line wins
|
|
223
227
|
const orders = new Map(); // key(initiative, section) → the task ids in the PM's order inside that stage; the last task-order line wins
|
|
224
228
|
const pins = new Map(); // task id (or Jira key) → true | false: the PM's pin on a milestone; a null line takes it out (the rule again)
|
|
229
|
+
const priorities = new Map(); // task id → 'P1' | 'P2' | 'P3': the PM's priority (inline-sprint-priority); a '' line takes it out, the last line wins
|
|
225
230
|
const removed = new Map(); // task id → the task a task-remove took out, so a task-restore (Delete's Undo) puts it back
|
|
226
231
|
const ticketNotes = new Map(); // key(board, Jira key) → the PM's notes on that ticket (the last ticket-note line wins)
|
|
227
232
|
const ticketDates = new Map(); // key(board, Jira key) → { start, due } the PM keeps in PMOS for that ticket (the last ticket-dates line wins)
|
|
@@ -327,6 +332,8 @@ function fold(events) {
|
|
|
327
332
|
} else if (e.kind === 'task-order' && typeof e.initiative === 'string' && e.initiative && typeof e.section === 'string' && Array.isArray(e.tasks)) {
|
|
328
333
|
const ids = e.tasks.filter((x) => typeof x === 'string' && x);
|
|
329
334
|
if (ids.length) orders.set(key(e.initiative, e.section), ids); else orders.delete(key(e.initiative, e.section));
|
|
335
|
+
} else if (e.kind === 'task-priority' && typeof e.task === 'string' && e.task && typeof e.priority === 'string' && /^(P[1-3])?$/.test(e.priority)) {
|
|
336
|
+
if (e.priority) priorities.set(e.task, e.priority); else priorities.delete(e.task);
|
|
330
337
|
} else if (e.kind === 'task-pin' && typeof e.task === 'string' && e.task && (typeof e.pinned === 'boolean' || e.pinned === null)) {
|
|
331
338
|
if (e.pinned === null) pins.delete(e.task); else pins.set(e.task, e.pinned);
|
|
332
339
|
} else if (e.kind === 'ticket-dates' && b && typeof e.ref === 'string' && JIRA_KEY_RE.test(e.ref)) {
|
|
@@ -408,7 +415,7 @@ function fold(events) {
|
|
|
408
415
|
suggestNo.set(e.id, { kind: e.of === 'merge' ? 'merge' : 'split', fp: e.fp, at: e.at || null });
|
|
409
416
|
}
|
|
410
417
|
}
|
|
411
|
-
return { boards, moves, assigns, asks, stages, iniWorkflows, tasks, removed, sections, parents, orders, milestones, pins, ticketNotes, ticketDates, epics, archives, deleted, notDup, iniWf, ends, judged, autoOver, ticketMoves, backlogRank, smOps, smUndone, suggestNo, events: list };
|
|
418
|
+
return { boards, moves, assigns, asks, stages, iniWorkflows, tasks, removed, sections, parents, orders, milestones, pins, priorities, ticketNotes, ticketDates, epics, archives, deleted, notDup, iniWf, ends, judged, autoOver, ticketMoves, backlogRank, smOps, smUndone, suggestNo, events: list };
|
|
412
419
|
}
|
|
413
420
|
|
|
414
421
|
/** The stages an initiative runs on a board: its own workflow when one is recorded, else the board's. */
|
|
@@ -871,6 +871,9 @@ function itemsOf(w, fr, board, rows) {
|
|
|
871
871
|
// the PM's pin on a milestone (batch 13 item 4, XcalmA5Milestones): carried only when set, so an unset one follows the rule (the last one shows)
|
|
872
872
|
const PN = fr.folded.pins || new Map();
|
|
873
873
|
if (PN.size) for (const x of out) if (x.kind !== 'Epic' && PN.has(x.uid)) x.pinned = PN.get(x.uid);
|
|
874
|
+
// the PM's priority (inline-sprint-priority): carried only when set
|
|
875
|
+
const PR = fr.folded.priorities || new Map();
|
|
876
|
+
if (PR.size) for (const x of out) if (x.kind !== 'Epic' && x.src !== 'jira' && PR.has(x.uid)) x.priority = PR.get(x.uid);
|
|
874
877
|
return B.rollupItems(out);
|
|
875
878
|
}
|
|
876
879
|
|
|
@@ -1653,13 +1656,16 @@ const WRITES = {
|
|
|
1653
1656
|
const p = postFrame(ctx, res, body);
|
|
1654
1657
|
if (!p) return;
|
|
1655
1658
|
if (body.milestone != null && typeof body.milestone !== 'boolean') return fail(ctx, res, 400, 'milestone is true or false');
|
|
1659
|
+
// the priority and the sprint, set in the row (initiative inline-sprint-priority): sprint is the sprint's name, only to word the line's why
|
|
1660
|
+
if (body.priority != null && (typeof body.priority !== 'string' || !/^(P[1-3])?$/.test(body.priority))) return fail(ctx, res, 400, "priority is P1, P2, P3, or '' for none");
|
|
1661
|
+
if (body.sprint != null && body.sprint !== '' && !ONE_LINE(body.sprint, 80)) return fail(ctx, res, 400, 'sprint is the sprint\'s name, one line of at most 80 characters');
|
|
1656
1662
|
if (body.pinned !== undefined && body.pinned !== null && typeof body.pinned !== 'boolean') return fail(ctx, res, 400, 'pinned is true, false, or null for the rule (the last milestone only)');
|
|
1657
1663
|
const pinWas = (id) => { const PN = p.fr.folded.pins || new Map(); return PN.has(id) ? PN.get(id) : null; };
|
|
1658
1664
|
const pinLine = (id) => ({ kind: 'task-pin', board: p.board.id, task: id, pinned: body.pinned, why: body.pinned === true ? 'pinned to the timeline' : body.pinned === false ? 'taken off the timeline' : 'pin back to the rule' });
|
|
1659
1665
|
// a Jira ticket takes the milestone flag (feedback batch 11 item 3) and the PM's own start and due days, kept in PMOS only (item 23):
|
|
1660
1666
|
// Jira keeps its title, status and assignee, and nothing is written to Jira
|
|
1661
1667
|
if (typeof body.task === 'string' && B.JIRA_KEY_RE.test(body.task) && !B.taskOf(p.fr.folded, body.task)) {
|
|
1662
|
-
if (['owner', 'notes', 'initiative', 'section'].some((k) => body[k] != null)) return fail(ctx, res, 409, 'Jira owns this ticket: only its dates, its milestone flag and its pin change here');
|
|
1668
|
+
if (['owner', 'notes', 'initiative', 'section', 'priority'].some((k) => body[k] != null)) return fail(ctx, res, 409, 'Jira owns this ticket: only its dates, its milestone flag and its pin change here');
|
|
1663
1669
|
if (body.milestone == null && body.start == null && body.due == null && body.pinned === undefined && body.parent == null) return fail(ctx, res, 400, 'nothing to change: send start, due, milestone, pinned or parent');
|
|
1664
1670
|
if (body.parent != null) { const pe = parentError(p, body.task, body.parent, null); if (pe) return fail(ctx, res, 400, pe); }
|
|
1665
1671
|
for (const k of ['start', 'due']) if (body[k] != null && body[k] !== '' && !/^\d{4}-\d{2}-\d{2}$/.test(String(body[k]))) return fail(ctx, res, 400, `${k} is a day, YYYY-MM-DD, or '' for none`);
|
|
@@ -1732,6 +1738,9 @@ const WRITES = {
|
|
|
1732
1738
|
// the pin (batch 13 item 4): a board-ledger line like the milestone flag
|
|
1733
1739
|
const pin = body.pinned !== undefined;
|
|
1734
1740
|
if (pin) { if (!p.file) return fail(ctx, res, 409, NO_STATE); from.pinned = pinWas(t.id); }
|
|
1741
|
+
// the priority (inline-sprint-priority): a board-ledger line for every kind of task, like the milestone flag
|
|
1742
|
+
const prio = body.priority != null;
|
|
1743
|
+
if (prio) { if (!p.file) return fail(ctx, res, 409, NO_STATE); from.priority = (p.fr.folded.priorities || new Map()).get(t.id) || ''; }
|
|
1735
1744
|
// a subtask's parent (initiative work-subtasks): a board-ledger line for every kind of task, like the section
|
|
1736
1745
|
let par = null;
|
|
1737
1746
|
if (body.parent != null) {
|
|
@@ -1740,10 +1749,11 @@ const WRITES = {
|
|
|
1740
1749
|
if (!p.file) return fail(ctx, res, 409, NO_STATE);
|
|
1741
1750
|
par = body.parent; from.parent = (p.fr.folded.parents || new Map()).get(t.id) || '';
|
|
1742
1751
|
}
|
|
1743
|
-
if (!Object.keys(ev).length && sec == null && ms == null && !pin && par == null) return fail(ctx, res, 400, 'nothing to change: send owner, notes, start, due, initiative, section, milestone, pinned or parent');
|
|
1752
|
+
if (!Object.keys(ev).length && sec == null && ms == null && !pin && !prio && par == null) return fail(ctx, res, 400, 'nothing to change: send owner, notes, start, due, initiative, section, milestone, pinned, priority or parent');
|
|
1744
1753
|
if (sec != null) append(p.file, g.actor, { kind: 'task-section', board: p.board.id, task: t.id, section: sec, why: sec ? 'placed under ' + sec : 'placed under no stage' });
|
|
1745
1754
|
if (ms != null) append(p.file, g.actor, { kind: 'task-milestone', board: p.board.id, task: t.id, milestone: ms, why: ms ? 'made a milestone' : 'no longer a milestone' });
|
|
1746
1755
|
if (pin) append(p.file, g.actor, pinLine(t.id));
|
|
1756
|
+
if (prio) { append(p.file, g.actor, { kind: 'task-priority', board: p.board.id, task: t.id, priority: body.priority, why: body.priority ? 'priority ' + body.priority : 'no priority' }); console.info('[inline-field] priority'); }
|
|
1747
1757
|
if (par != null) append(p.file, g.actor, parentLine(p, t.id, par));
|
|
1748
1758
|
if (!Object.keys(ev).length) {
|
|
1749
1759
|
const items = itemsOf(p.w, { ...p.fr, folded: B.fold(readLedger(ctx, p.w)) }, p.board, (needRows(ctx, res, p.w) || []).filter((r) => r.id === t.initiative));
|
|
@@ -1751,9 +1761,13 @@ const WRITES = {
|
|
|
1751
1761
|
}
|
|
1752
1762
|
if (t.item) return itemWrite(ctx, res, p, t, TI.editEvents(t, ev), g, { from });
|
|
1753
1763
|
if (!p.file) return fail(ctx, res, 409, NO_STATE);
|
|
1754
|
-
|
|
1755
|
-
const
|
|
1756
|
-
|
|
1764
|
+
// a sprint pick gives the task the sprint's days (inline-sprint-priority): the why names the sprint
|
|
1765
|
+
const intoSprint = typeof body.sprint === 'string' && !!body.sprint.trim() && (ev.start != null || ev.due != null);
|
|
1766
|
+
append(p.file, g.actor, { kind: 'task-update', board: p.board.id, task: t.id, ...ev, why: intoSprint ? 'into sprint ' + String(body.sprint).trim() : 'edited ' + Object.keys(ev).join(', ') });
|
|
1767
|
+
if (intoSprint) console.info('[inline-field] sprint');
|
|
1768
|
+
const F2 = B.fold(readLedger(ctx, p.w)), t2 = B.taskOf(F2, t.id), it2 = B.rollupItems([B.taskItem(t2)])[0];
|
|
1769
|
+
if (F2.priorities && F2.priorities.has(t.id)) it2.priority = F2.priorities.get(t.id);
|
|
1770
|
+
ctx.json(res, { ok: true, from, item: it2 });
|
|
1757
1771
|
},
|
|
1758
1772
|
'/api/boards/tasks/bulk': (ctx, res, body, g) => {
|
|
1759
1773
|
// bulk move (initiative work-subtasks, board WorkBulkDS): several tasks under a parent, to a stage, to a person, by N days, or to Done.
|
|
@@ -28,7 +28,7 @@ const path = require('path');
|
|
|
28
28
|
const ledgers = require('./plan-ledgers.js');
|
|
29
29
|
|
|
30
30
|
const LEDGER = 'initiative-tasks.jsonl';
|
|
31
|
-
const TASK_KINDS = Object.freeze(['task', 'task-update', 'task-remove', 'task-restore', 'task-section', 'task-milestone', 'task-pin', 'task-order', 'task-parent']);
|
|
31
|
+
const TASK_KINDS = Object.freeze(['task', 'task-update', 'task-remove', 'task-restore', 'task-section', 'task-milestone', 'task-pin', 'task-order', 'task-parent', 'task-priority']);
|
|
32
32
|
const KINDS = new Set(TASK_KINDS);
|
|
33
33
|
const isTaskKind = (k) => KINDS.has(k);
|
|
34
34
|
const isTaskLine = (r) => !!r && typeof r === 'object' && !Array.isArray(r) && isTaskKind(r.kind);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.715.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.715.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
* so `y` on one row never says Yes to the next row's proposal. Undo also takes the newest Toast's Undo, from anywhere.
|
|
9
9
|
*
|
|
10
10
|
* Hover explains: a button that has a key gets aria-keyshortcuts and its key in its tooltip ("Open the PRD (O)").
|
|
11
|
+
* The hint steps back once learned (bet A480): after LEARNED_AT presses of a key that acted, in this browser, that key's buttons keep
|
|
12
|
+
* aria-keyshortcuts (a screen reader still says it) but their tooltip loses the key. The ? list always shows every key. The counts are
|
|
13
|
+
* five numbers in localStorage (LEARNED_KEY), no text; with no storage every hint stays.
|
|
11
14
|
* Keys do nothing while typing, in a terminal, with Ctrl, Cmd or Alt, on a held key, or when the page already used the key.
|
|
12
15
|
* Each press is counted on this computer only (pm/use-log.js noteUse: `key-<action>` or `key-miss`, no text, no value).
|
|
13
16
|
*
|
|
@@ -15,7 +18,9 @@
|
|
|
15
18
|
* actOf(words) PURE: 'approve' | 'open' | 'sprint' | 'park' | 'undo' | ''
|
|
16
19
|
* keyAct(e) PURE: the action a key event asks for, 'sheet' for ?, or null
|
|
17
20
|
* targetOf(act, here, doc) the button (or, for open, the row) the key presses, or null
|
|
18
|
-
* hint(el)
|
|
21
|
+
* hint(el, learned?) put the key on a button's tooltip once (aria-keyshortcuts only, when its action is in `learned`)
|
|
22
|
+
* unhint(el) take the key back off a tooltip, keep aria-keyshortcuts
|
|
23
|
+
* learnedActs(store?) the Set of actions pressed LEARNED_AT times or more · countUse(act, store?) one more; true on the press that learns it
|
|
19
24
|
* sheetHtml(here) PURE: the ? list's markup; here = Set of the actions with something to act on */
|
|
20
25
|
import { noteUse } from './use-log.js';
|
|
21
26
|
|
|
@@ -43,6 +48,31 @@ const STOP = 'body, main, [role="main"], section, [role="region"], dialog, [role
|
|
|
43
48
|
const TOAST = '.pm-toast, [data-c3-toast], .toast, [role="status"], [role="alert"]';
|
|
44
49
|
const TYPING = 'input, textarea, select, [contenteditable=""], [contenteditable="true"], [role="textbox"]';
|
|
45
50
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
51
|
+
export const LEARNED_AT = 3;
|
|
52
|
+
export const LEARNED_KEY = 'pmos.actionKeys.used';
|
|
53
|
+
const local = () => { try { return typeof localStorage !== 'undefined' ? localStorage : null; } catch { return null; } };
|
|
54
|
+
function counts(store) {
|
|
55
|
+
try {
|
|
56
|
+
const o = JSON.parse((store && store.getItem(LEARNED_KEY)) || '{}');
|
|
57
|
+
return Object.fromEntries(Object.keys(KEY_OF_ACT).map((a) => [a, Number.isFinite(o && o[a]) ? o[a] : 0]));
|
|
58
|
+
} catch { return null; }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** The actions this person has pressed LEARNED_AT times or more in this browser. Empty when nothing is kept. */
|
|
62
|
+
export function learnedActs(store = local()) {
|
|
63
|
+
const c = counts(store);
|
|
64
|
+
return new Set(c ? Object.keys(c).filter((a) => c[a] >= LEARNED_AT) : []);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** One more use of `act`. True only on the press that reaches LEARNED_AT (the hint steps back now). */
|
|
68
|
+
export function countUse(act, store = local()) {
|
|
69
|
+
if (!KEY_OF_ACT[act] || !store) return false;
|
|
70
|
+
const c = counts(store);
|
|
71
|
+
if (!c) return false;
|
|
72
|
+
c[act] += 1;
|
|
73
|
+
try { store.setItem(LEARNED_KEY, JSON.stringify(c)); } catch { return false; }
|
|
74
|
+
return c[act] === LEARNED_AT;
|
|
75
|
+
}
|
|
46
76
|
const say = (s) => { try { console.info('[action-keys] ' + s); } catch { /* no console */ } };
|
|
47
77
|
|
|
48
78
|
/** The words a control is known by: aria-label, then title (without a key already added), then its text. */
|
|
@@ -105,30 +135,42 @@ export function actsHere(doc) {
|
|
|
105
135
|
return out;
|
|
106
136
|
}
|
|
107
137
|
|
|
108
|
-
/** Put the key on a button's tooltip once: "Open the PRD (O)". A button with no key is left alone.
|
|
109
|
-
|
|
138
|
+
/** Put the key on a button's tooltip once: "Open the PRD (O)". A button with no key is left alone.
|
|
139
|
+
* A learned action gets aria-keyshortcuts only: its tooltip stays as it was. */
|
|
140
|
+
export function hint(el, learned = new Set()) {
|
|
110
141
|
if (!el || !el.getAttribute || el.getAttribute('aria-keyshortcuts')) return false;
|
|
111
|
-
const
|
|
142
|
+
const act = actOf(wordsOf(el));
|
|
143
|
+
const k = KEY_OF_ACT[act];
|
|
112
144
|
if (!k) return false;
|
|
113
145
|
el.setAttribute('aria-keyshortcuts', k);
|
|
146
|
+
if (learned.has(act)) return true;
|
|
114
147
|
const t = el.getAttribute('title') || el.getAttribute('aria-label') || '';
|
|
115
148
|
if (t) el.setAttribute('title', t + ' (' + k.toUpperCase() + ')');
|
|
116
149
|
return true;
|
|
117
150
|
}
|
|
118
151
|
|
|
152
|
+
/** Take the key back off a tooltip ("Open the PRD (O)" → "Open the PRD"); aria-keyshortcuts stays. */
|
|
153
|
+
export function unhint(el) {
|
|
154
|
+
const t = el && el.getAttribute ? el.getAttribute('title') : null;
|
|
155
|
+
if (!t || !/\s\([A-Z?]\)$/.test(t)) return false;
|
|
156
|
+
el.setAttribute('title', t.replace(/\s\([A-Z?]\)$/, ''));
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
|
|
119
160
|
const X = '<svg aria-hidden="true" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 6l12 12M18 6L6 18"/></svg>';
|
|
120
161
|
|
|
121
162
|
/** PURE: the ? list. here = Set of the actions with something to act on on this page. */
|
|
122
163
|
export function sheetHtml(here = new Set()) {
|
|
123
164
|
const row = (k, words, on = true) => `<li class="pm-row"><kbd class="pm-kbd">${esc(k)}</kbd><span>${esc(words)}</span>${on ? '' : '<span class="pm-meta">Not on this page</span>'}</li>`;
|
|
124
|
-
return `<div class="pm-row
|
|
165
|
+
return `<div class="pm-row"><h2 class="pm-h-sm" id="akTitle">Keys</h2>`
|
|
125
166
|
+ `<button type="button" class="pm-btn" data-ak-close aria-label="Close" title="Close">${X}</button></div>`
|
|
126
167
|
+ '<p class="pm-meta">Point at an item, or tab to it, then press its key.</p>'
|
|
127
|
-
+ `<ul
|
|
168
|
+
+ `<ul>${KEYS.map((k) => row(k.key.toUpperCase(), k.say, here.has(k.act))).join('')}${row('?', 'This list')}</ul>`;
|
|
128
169
|
}
|
|
129
170
|
|
|
130
171
|
let started = false;
|
|
131
|
-
const S = { pointer: null, pointerT: 0, focusT: 0, sheet: null };
|
|
172
|
+
const S = { pointer: null, pointerT: 0, focusT: 0, sheet: null, learned: null };
|
|
173
|
+
const learnedNow = () => (S.learned || (S.learned = learnedActs()));
|
|
132
174
|
|
|
133
175
|
function hereOf(doc) {
|
|
134
176
|
const a = doc.activeElement;
|
|
@@ -163,11 +205,11 @@ export function startActionKeys(doc = typeof document !== 'undefined' ? document
|
|
|
163
205
|
doc.addEventListener('pointerover', (e) => {
|
|
164
206
|
S.pointer = e.target; S.pointerT = Date.now();
|
|
165
207
|
const c = e.target && e.target.closest ? e.target.closest(PRESS) : null;
|
|
166
|
-
if (c) hint(c);
|
|
208
|
+
if (c) hint(c, learnedNow());
|
|
167
209
|
}, { passive: true });
|
|
168
210
|
doc.addEventListener('focusin', (e) => {
|
|
169
211
|
S.focusT = Date.now();
|
|
170
|
-
if (e.target && e.target.closest) { const c = e.target.closest(PRESS); if (c) hint(c); }
|
|
212
|
+
if (e.target && e.target.closest) { const c = e.target.closest(PRESS); if (c) hint(c, learnedNow()); }
|
|
171
213
|
});
|
|
172
214
|
// the bubble phase, so a page's own key (j, k, x, t, a dialog's Esc) runs first and wins
|
|
173
215
|
doc.addEventListener('keydown', (e) => {
|
|
@@ -178,10 +220,15 @@ export function startActionKeys(doc = typeof document !== 'undefined' ? document
|
|
|
178
220
|
const el = targetOf(act, hereOf(doc), doc);
|
|
179
221
|
if (!el) { noteUse('key-miss'); say(act + ': nothing here to act on'); return; }
|
|
180
222
|
e.preventDefault();
|
|
181
|
-
hint(el);
|
|
223
|
+
hint(el, learnedNow());
|
|
182
224
|
el.click();
|
|
183
225
|
noteUse('key-' + act);
|
|
184
226
|
say(act);
|
|
227
|
+
if (countUse(act)) { // learned now: this key's hints step back on this page too
|
|
228
|
+
learnedNow().add(act);
|
|
229
|
+
for (const b of doc.querySelectorAll('[aria-keyshortcuts="' + KEY_OF_ACT[act] + '"]')) unhint(b);
|
|
230
|
+
say('hint stepped back: ' + act);
|
|
231
|
+
}
|
|
185
232
|
});
|
|
186
233
|
return true;
|
|
187
234
|
}
|
|
@@ -10,10 +10,12 @@
|
|
|
10
10
|
* Groups follow their best-ranked row; "No initiative yet" goes last. A row's number is its place in that one list.
|
|
11
11
|
*/
|
|
12
12
|
import { sugHtml } from './bd-stands.js';
|
|
13
|
+
import { canEdit } from './inline-fields.js'; // a task's sprint and priority, set in the row (initiative inline-sprint-priority)
|
|
13
14
|
|
|
14
15
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
15
16
|
const SV = (d, n = 16) => `<svg class="pm-ic" width="${n}" height="${n}" viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
16
|
-
const I = { star: 'M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z', grip: 'M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01', down: 'M7 10l5 5 5-5'
|
|
17
|
+
const I = { star: 'M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z', grip: 'M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01', down: 'M7 10l5 5 5-5',
|
|
18
|
+
sprint: 'M4 12h11M11 8l4 4-4 4M19 6v12', flag: 'M6 21V4M6 4h11l-2 4 2 4H6' };
|
|
17
19
|
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
18
20
|
const DAY = 864e5;
|
|
19
21
|
const dayNum = (d) => { const t = Date.parse(String(d || '').slice(0, 10) + 'T00:00:00Z'); return Number.isFinite(t) ? Math.round(t / DAY) : null; };
|
|
@@ -169,8 +171,12 @@ function rowHtml(t, o, drag) {
|
|
|
169
171
|
const state = ps ? `<span class="pm-badge${ps.tone === 'late' ? ' alert' : ' blue'}" title="${esc(ps.title || ps.text)}">${esc(ps.text)}</span>` : `<span class="pm-badge${ready ? ' blue' : ''}">${ready ? 'Ready' : 'Needs detail'}</span>`;
|
|
170
172
|
const src = t.key ? `<span class="pm-meta code">${esc(t.key)}</span>` : '<span class="pm-chip">Not in Jira</span>';
|
|
171
173
|
const n = o.rank ? o.rank.get(t.id) : null;
|
|
174
|
+
// Sprint and Priority in the row (inline-sprint-priority): an open PMOS task only, when the page wires them (o.inline); a set priority shows
|
|
175
|
+
const ib = (attr, label, d) => `<button type="button" class="pm-btn" ${attr}="${esc(u)}" aria-haspopup="menu" aria-label="${esc(label)}" title="${esc(label)}">${SV(d, 14)}</button>`;
|
|
176
|
+
const inl = o.inline && canEdit(t) ? ib('data-bk-sprint', 'Sprint', I.sprint) + ib('data-bk-prio', 'Priority: ' + (t.priority || 'none'), I.flag) : '';
|
|
177
|
+
const prio = t.priority && t.src !== 'jira' ? ` <span class="pm-badge" title="Priority">${esc(t.priority)}</span>` : '';
|
|
172
178
|
return `<tr class="wk-br${ck ? ' sel' : ''}" data-bk="${esc(u)}" data-bkid="${esc(t.id)}"${drag ? ' draggable="true"' : ''}>`
|
|
173
179
|
+ `<td class="wk-rk"><span class="pm-row">${drag ? `<span class="wk-grip" aria-hidden="true">${SV(I.grip, 14)}</span>` : ''}<input type="checkbox" class="wk-ck" data-bkck="${esc(u)}" aria-label="Tick ${esc(t.title)}"${ck ? ' checked' : ''}><span class="pm-meta">${n != null ? n + 1 : ''}</span></span></td>`
|
|
174
|
-
+ `<td><button type="button" class="wk-tt" data-bkopen="${esc(u)}" title="${esc(t.title)}">${esc(t.title)}</button>${idle != null && idle >= SAY_FROM ? ` <span class="pm-badge">${idle} days untouched</span>` : ''}${t.late ? ` <span class="pm-badge alert">${plural(t.late, 'day late', 'days late')}</span>` : ''}</td>`
|
|
175
|
-
+ `<td>${who}</td><td>${state}</td><td>${src}</td><td><span class="pm-meta code">${t.touched ? dayText(t.touched) : ''}</span></td><td class="wk-ac">${o.act ? o.act(t) : ''}</td></tr>`;
|
|
180
|
+
+ `<td><button type="button" class="wk-tt" data-bkopen="${esc(u)}" title="${esc(t.title)}">${esc(t.title)}</button>${prio}${idle != null && idle >= SAY_FROM ? ` <span class="pm-badge">${idle} days untouched</span>` : ''}${t.late ? ` <span class="pm-badge alert">${plural(t.late, 'day late', 'days late')}</span>` : ''}</td>`
|
|
181
|
+
+ `<td>${who}</td><td>${state}</td><td>${src}</td><td><span class="pm-meta code">${t.touched ? dayText(t.touched) : ''}</span></td><td class="wk-ac">${inl}${o.act ? o.act(t) : ''}</td></tr>`;
|
|
176
182
|
}
|
|
@@ -18,6 +18,7 @@ import { inView, nextShown, moreHtml, totalOf, logMore, findRows } from './list-
|
|
|
18
18
|
import { productName } from './scope-chip.js'; // the product's display name ("IDPF"), never its folder id
|
|
19
19
|
import * as SP from './bd-sprint.js';
|
|
20
20
|
import * as WS from './work-select.js'; // the bulk move with one Undo, shared with the initiative popup and This sprint (WorkBulkDS)
|
|
21
|
+
import * as IF from './inline-fields.js'; // a task's sprint and priority, set in the row (initiative inline-sprint-priority)
|
|
21
22
|
import * as BD from './bd-backlog-ds.js'; // the Backlog from the system's parts (WorkBacklogDS) // the sprint overview while "This sprint" is on (initiative sprint-overview)
|
|
22
23
|
|
|
23
24
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
@@ -200,7 +201,7 @@ function drawBk() {
|
|
|
200
201
|
+ BD.standsHtml(B, { today: DATA.today, next: DATA.next, pull: pullFor(order) })
|
|
201
202
|
+ BD.tableHtml(order, { tab: BV.tab, group: BV.group, menu: BMENU, today: DATA.today, rank, sel: SEL, picking: host.classList.contains('picking'),
|
|
202
203
|
act: (t) => actHtml(t, BM.groupOf(t, partB())), stateOf: (t) => { if (!t.agent) return null; const x = BM.stateOf(t); return { text: x.text, tone: x.tone, title: x.text + (x.note ? ' · ' + x.note : '') }; },
|
|
203
|
-
groupsPmos: pmosGroups, said: showing + said, mode });
|
|
204
|
+
groupsPmos: pmosGroups, said: showing + said, mode, inline: true });
|
|
204
205
|
drawBar();
|
|
205
206
|
}
|
|
206
207
|
const saveBv = () => put('pmos.work.backlog', BV);
|
|
@@ -212,6 +213,14 @@ async function bkPress(e) {
|
|
|
212
213
|
if (hit('data-bkgroup')) { BMENU = !BMENU; draw(); const n = host.querySelector('[data-bkgrp][aria-checked="true"]'); if (BMENU && n) n.focus(); return true; }
|
|
213
214
|
if ((b = hit('data-bkgrp'))) { BV.group = b.dataset.bkgrp; BMENU = false; saveBv(); draw(); const n = host.querySelector('[data-bkgroup]'); if (n) n.focus(); return true; }
|
|
214
215
|
if (BMENU) { BMENU = false; draw(); }
|
|
216
|
+
// Sprint and Priority in the row (inline-sprint-priority): each pick saves through editMany, whose line carries the Undo
|
|
217
|
+
if ((b = hit('data-bk-sprint'))) { const t = taskOf(b.dataset.bkSprint); if (t) sprintPick(b, t); return true; }
|
|
218
|
+
if ((b = hit('data-bk-prio'))) {
|
|
219
|
+
const t = taskOf(b.dataset.bkPrio); if (!t) return true;
|
|
220
|
+
const L = IF.priorityItems(t.priority || '');
|
|
221
|
+
pickPop(b, 'Priority', L.map((p) => [p.v || '-', p.label + (p.on ? ' (now)' : '')]), async (v) => { const p = v === '-' ? '' : v; if (p === (t.priority || '')) return; await editMany([t], { priority: p }, p || 'No priority'); });
|
|
222
|
+
return true;
|
|
223
|
+
}
|
|
215
224
|
if ((b = hit('data-bktune'))) { if (pop && pop.classList.contains('bk-tune')) closePop(); else tune(b); return true; }
|
|
216
225
|
if ((b = hit('data-bksug'))) {
|
|
217
226
|
const p = pullFor(ORDER); if (!p) return true;
|
|
@@ -473,6 +482,16 @@ function datePop(at, pick) {
|
|
|
473
482
|
pop.addEventListener('click', (e) => { if (e.target.closest('[data-ok]') && inp.value) { closePop(); pick(inp.value); } });
|
|
474
483
|
pop.addEventListener('keydown', (e) => { if (e.key === 'Escape') { closePop(); at.focus(); } });
|
|
475
484
|
}
|
|
485
|
+
/** The Sprint list of a row (inline-sprint-priority): the active sprints and the next one, as the tracker holds them, with their days. */
|
|
486
|
+
function sprintPick(at, t) {
|
|
487
|
+
const all = (DATA.now || []).filter((s) => s.ws === t.ws && s.board === t.board).map((s) => ({ ...s, state: 'active' }))
|
|
488
|
+
.concat(DATA.next && (DATA.hist || []).length <= 1 ? [{ ...DATA.next, state: 'future' }] : []); // the next sprint is read for one board only
|
|
489
|
+
const L = IF.sprintItems({ start: t.start || '', end: t.due || '' }, IF.sprintChoices(all, DATA.today));
|
|
490
|
+
pickPop(at, 'Sprint', L.map((s, i) => [String(i), s.label + ' · ' + s.dates + (s.on ? ' (now)' : '')]), async (v) => {
|
|
491
|
+
const s = L[+v]; if (!s || s.on) return;
|
|
492
|
+
await editMany([t], IF.sprintPatch(t, s), 'Into ' + s.label);
|
|
493
|
+
});
|
|
494
|
+
}
|
|
476
495
|
/** ⋯ on a row PMOS works on (design check 1 g): Stop, and Give to a person (PMOS stops, then the person has it). */
|
|
477
496
|
function rowMenu(at, t) {
|
|
478
497
|
pickPop(at, 'PMOS is working on it', [['stop', 'Stop'], ['person', 'Give to a person']], async (k) => {
|
|
@@ -21,6 +21,8 @@ export const I = {
|
|
|
21
21
|
dia: 'M12 4l8 8-8 8-8-8z', doc: 'M7 3h7l4 4v14H7zM14 3v4h4M9.5 12h6M9.5 16h6', deck: 'M4 5h16v11H4zM12 16v4M8 20h8', link: 'M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1',
|
|
22
22
|
proto: 'M4 5h16v12H4zM9 21h6M12 17v4', right: 'M10 7l5 5-5 5', down: 'M7 10l5 5 5-5', jira: 'M12 3l9 9-9 9-9-9zM12 8l4 4-4 4-4-4z',
|
|
23
23
|
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', stage: 'M5 7h14M5 12h10M5 17h6',
|
|
24
|
+
// the row's Sprint and Priority (initiative inline-sprint-priority): a run of days, a flag
|
|
25
|
+
sprint: 'M4 12h11M11 8l4 4-4 4M19 6v12', flag: 'M6 21V4M6 4h11l-2 4 2 4H6',
|
|
24
26
|
};
|
|
25
27
|
import * as WT from './work-tree.js'; // subtasks and the epic check (initiative work-subtasks)
|
|
26
28
|
import { barHtml as selBar } from './work-select.js'; // the bulk bar (WorkBulkDS)
|
|
@@ -170,7 +172,8 @@ export function listHtml(rows, W, o = {}) {
|
|
|
170
172
|
}
|
|
171
173
|
const sel = o.sel || new Set();
|
|
172
174
|
const li = (x) => {
|
|
173
|
-
|
|
175
|
+
// a priority set in the row (inline-sprint-priority) says itself first; none, nothing
|
|
176
|
+
const sub = x.jsub ? [x.who && x.who !== 'You' ? x.who : '', x.date].filter(Boolean).join(' · ') : [x.priority || '', x.date, x.who && x.who !== 'You' ? x.who : ''].filter(Boolean).join(' · ');
|
|
174
177
|
// the tick (WorkStatesDS 3): marks it done, with Undo; a done task and a Jira ticket show their state only
|
|
175
178
|
const box = x.done ? `<span class="pwd-ck dn" aria-label="Done" role="img">${SV(I.ok, 14)}</span>`
|
|
176
179
|
: o.ro || x.jira ? `<span class="pwd-ck" aria-hidden="true">${SV(x.ms ? I.dia : I.box, 14)}</span>`
|
|
@@ -182,6 +185,8 @@ export function listHtml(rows, W, o = {}) {
|
|
|
182
185
|
+ (x.jira || x.done ? '' : ab(`data-pw-who="${esc(x.uid)}" aria-haspopup="menu"`, 'Who: ' + (x.who || 'no one'), I.who))
|
|
183
186
|
+ (x.done ? '' : ab(`data-pw-date="${esc(x.uid)}" aria-haspopup="dialog"`, x.date ? (x.ms ? 'Date: ' : 'Due: ') + x.date : 'Set a date', I.cal))
|
|
184
187
|
+ (x.jira ? '' : ab(`data-pw-stage="${esc(x.uid)}" aria-haspopup="menu"`, 'Stage', I.stage))
|
|
188
|
+
// Sprint and Priority (inline-sprint-priority): an open PMOS task only; Jira keeps its tickets' own
|
|
189
|
+
+ (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))
|
|
185
190
|
+ ab(`data-pw-row-more="${esc(x.uid)}" aria-haspopup="menu"`, 'More for ' + x.title, I.more) + '</span>';
|
|
186
191
|
// a parent (WorkSubtasksDS): the fold chevron, "n of m done" with its bar; children indent one step per level, up to three
|
|
187
192
|
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>' : '');
|
|
@@ -151,7 +151,7 @@ body.bd-page.bk-on [id="bkBody"] { display: flex; flex-direction: column; gap: v
|
|
|
151
151
|
.wk-bkt .wk-tt { all: unset; cursor: pointer; font-weight: var(--fw-strong); }
|
|
152
152
|
.wk-bkt .wk-tt:hover { text-decoration: underline; }
|
|
153
153
|
.wk-bkt .wk-tt:focus-visible { box-shadow: var(--glow); border-radius: var(--radius-sm); }
|
|
154
|
-
.wk-bkt th.wk-ac, .wk-bkt td.wk-ac { width: 1%; text-align: right; }
|
|
154
|
+
.wk-bkt th.wk-ac, .wk-bkt td.wk-ac { width: 1%; text-align: right; white-space: nowrap; }
|
|
155
155
|
.wk-bkt tr.drag td { opacity: .5; }
|
|
156
156
|
.wk-bkt tr.drop td { box-shadow: inset 0 2px 0 var(--blue); }
|
|
157
157
|
.wk-bkt tr.wk-g td { padding: 0; }
|
|
@@ -542,7 +542,8 @@
|
|
|
542
542
|
.ev-st.pm-ds svg.ev-gbar .bg { fill: var(--well); }
|
|
543
543
|
.ev-st.pm-ds svg.ev-gbar .fg { fill: var(--leaf); }
|
|
544
544
|
|
|
545
|
-
/* ── the ? list of action keys (pm/action-keys.js, bet A477): a Komorebi sheet over the page; its parts are pm-h-sm, pm-row, pm-kbd, pm-meta, pm-btn
|
|
546
|
-
|
|
547
|
-
.ev-keys.pm-ds
|
|
548
|
-
.ev-keys.pm-ds .
|
|
545
|
+
/* ── the ? list of action keys (pm/action-keys.js, bet A477): a Komorebi sheet over the page; its parts are pm-h-sm, pm-row, pm-kbd, pm-meta, pm-btn.
|
|
546
|
+
* It takes the width of its rows, never wider than the window less space-16 a side, and its head and list are reached through those parts. ── */
|
|
547
|
+
.ev-keys.pm-ds { border: 0; border-radius: var(--radius-card); background: var(--card); color: var(--ink); box-shadow: var(--lift); padding: var(--space-24); width: fit-content; max-width: calc(100% - var(--space-32)); }
|
|
548
|
+
.ev-keys.pm-ds > .pm-row { justify-content: space-between; }
|
|
549
|
+
.ev-keys.pm-ds > ul { list-style: none; margin: var(--space-16) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-8); }
|
|
@@ -29,6 +29,7 @@ const { localToday } = DP;
|
|
|
29
29
|
import * as AK from './artefact-kind.js';
|
|
30
30
|
import * as WT from './work-tree.js'; // subtasks, the epic check and its fix (initiative work-subtasks)
|
|
31
31
|
import * as SEL from './work-select.js'; // select several rows and move them together (WorkBulkDS)
|
|
32
|
+
import * as IF from './inline-fields.js'; // a task's sprint and priority, set in the row (initiative inline-sprint-priority)
|
|
32
33
|
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)
|
|
33
34
|
|
|
34
35
|
const CSS = new URL('./cozy-pop-work.css', import.meta.url).href, DSCSS = new URL('./bd-pop-ds.css', import.meta.url).href;
|
|
@@ -660,6 +661,8 @@ export function wire(body, h0, x0) {
|
|
|
660
661
|
if (d.pwGroupDrop) { const dd = dropped(); dd.add('group:' + c.id + ':' + d.pwGroupDrop); store.set(DROP, [...dd].slice(-200)); redraw(); return; }
|
|
661
662
|
if (d.pwWho) { whoMenu(b, d.pwWho, c, h, x); return; }
|
|
662
663
|
if (d.pwStage) { stageMenu(b, d.pwStage, c, h, x); return; }
|
|
664
|
+
if (d.pwSprint) { sprintMenu(b, d.pwSprint, c, h, x); return; }
|
|
665
|
+
if (d.pwPrio) { prioMenu(b, d.pwPrio, c, h, x); return; }
|
|
663
666
|
if ('pwAddty' in d) { S.msAdd = !S.msAdd; const f = b.closest('.pw-add'), k = f && f.querySelector('[data-pw-add]') && f.querySelector('[data-pw-add]').dataset.pwAdd; redraw(); if (k != null) setTimeout(() => { const i = body.querySelector(`[data-pw-add="${window.CSS.escape(k)}"]`); if (i) i.focus(); }, 0); return; }
|
|
664
667
|
if (d.pwFact) { fact(d.pwFact, b, c, h); return; }
|
|
665
668
|
if (d.pwStatus) { statusMenu(b, d.pwStatus, h, c); return; }
|
|
@@ -1161,6 +1164,41 @@ function stageMenu(btn, uid, c, h, x) {
|
|
|
1161
1164
|
h.move(uid, { to: s.key, from: cur, name: s.name });
|
|
1162
1165
|
}, { menu: true, label: 'Stage', focus: '[aria-checked="true"]' });
|
|
1163
1166
|
}
|
|
1167
|
+
/* Sprint and Priority (initiative inline-sprint-priority): each pick saves at once through POST /api/boards/tasks/edit, and its Undo sends the
|
|
1168
|
+
* answer's `from` back. Sprint lists the board's open sprints (GET /api/boards/sprints, as the tracker holds them) and gives the task the
|
|
1169
|
+
* sprint's days; a Jira ticket has neither button (Jira keeps its own). The pop list closes on Esc (pm/hi-pop.js). */
|
|
1170
|
+
const SPRINTS = new Map(); // ws|board → the open sprints, read once per popup page
|
|
1171
|
+
async function sprintMenu(btn, uid, c, h, x) {
|
|
1172
|
+
const row = c.W.rows.find((r) => r.uid === uid) || {};
|
|
1173
|
+
const o = (x && x.o && x.o()) || {}, w = h.where ? h.where() : {}, ws = w.ws || o.ws, board = w.board || o.board, k = ws + '|' + board;
|
|
1174
|
+
if (!SPRINTS.has(k)) {
|
|
1175
|
+
const r = await pmGet('/api/boards/sprints?ws=' + encodeURIComponent(ws || '') + '&board=' + encodeURIComponent(board || '')).catch(() => null);
|
|
1176
|
+
SPRINTS.set(k, r && r.ok !== false ? r.sprints || [] : []);
|
|
1177
|
+
}
|
|
1178
|
+
const L = IF.sprintItems(row, IF.sprintChoices(SPRINTS.get(k), c.W.today));
|
|
1179
|
+
openPop(btn, 'pw-sprint', L.map((s, i) => `<button type="button" class="hi-mi" role="menuitemradio" aria-checked="${s.on}" data-i="${i}">${esc(s.label)} <span class="hi-small">${esc(s.dates)}</span></button>`).join('')
|
|
1180
|
+
|| '<p class="hi-small">No open sprint has dates yet. When the tracker has one, it shows here.</p>', async (b) => {
|
|
1181
|
+
const s = L[+b.dataset.i]; closePop(); if (!s || s.on) return;
|
|
1182
|
+
await editRow(uid, IF.sprintPatch(row, s), IF.saySprint(row.title, s), c, h, x, 'sprint');
|
|
1183
|
+
}, { menu: true, label: 'Sprint', focus: '[aria-checked="true"]' });
|
|
1184
|
+
}
|
|
1185
|
+
function prioMenu(btn, uid, c, h, x) {
|
|
1186
|
+
const row = c.W.rows.find((r) => r.uid === uid) || {};
|
|
1187
|
+
const L = IF.priorityItems(row.priority || '');
|
|
1188
|
+
openPop(btn, 'pw-prio', L.map((p, i) => `<button type="button" class="hi-mi" role="menuitemradio" aria-checked="${p.on}" data-i="${i}">${esc(p.label)}</button>`).join(''), async (b) => {
|
|
1189
|
+
const p = L[+b.dataset.i]; closePop(); if (!p || p.on) return;
|
|
1190
|
+
await editRow(uid, { priority: p.v }, IF.sayPriority(row.title, p.v), c, h, x, 'priority');
|
|
1191
|
+
}, { menu: true, label: 'Priority', focus: '[aria-checked="true"]' });
|
|
1192
|
+
}
|
|
1193
|
+
async function editRow(uid, patch, words, c, h, x, field) {
|
|
1194
|
+
const o = (x && x.o && x.o()) || {}, w = h.where ? h.where() : {}, ws = w.ws || o.ws, board = w.board || o.board;
|
|
1195
|
+
const say = (m) => (h.toast ? h.toast(m) : undoToast(m));
|
|
1196
|
+
const r = await pmPost('/api/boards/tasks/edit', { ws, board, task: uid, ...patch }).catch(() => null);
|
|
1197
|
+
if (!r || r.ok === false) { say((r && r.error) || 'The ' + field + ' was not changed.'); return; }
|
|
1198
|
+
const back = {}; for (const k of Object.keys(patch)) if (k !== 'sprint') back[k] = r.from && r.from[k] != null ? r.from[k] : '';
|
|
1199
|
+
undoToast(words, async () => { const u = await pmPost('/api/boards/tasks/edit', { ws, board, task: uid, ...back }).catch(() => null); if (!u || u.ok === false) say((u && u.error) || 'The undo did not land.'); if (h.reload) await h.reload(); });
|
|
1200
|
+
if (h.reload) await h.reload();
|
|
1201
|
+
}
|
|
1164
1202
|
/* "Open the task" opens the small task popup on top (round 3 point 20, pm/cozy-task-pop.js); ↑ ↓ step through this list. A Jira ticket keeps its
|
|
1165
1203
|
* ticket view. On close the row is lit for a moment. */
|
|
1166
1204
|
async function openSmall(uid, c, h, x, body, bt) {
|
|
@@ -146,7 +146,7 @@ function rowOf(k0, today, J = null) {
|
|
|
146
146
|
jkey: J ? J.key : '', jst: J ? String(J.raw || J.status || '') : '', jmove: J && J.move ? J.move : null, _k: k0, _t: today, // jmove: a move asked in PMOS (lib/jira-moves.js)
|
|
147
147
|
// subtasks and the Jira chip and epic check (initiative work-subtasks): the parent task; the ticket's link, epic (undefined: not read),
|
|
148
148
|
// assignee, type and sub-tasks, from the sprint read (J) or the read of the ticket the task names (k0.jira, lib/board-premium.js jiraOf)
|
|
149
|
-
parent: k0.parent || '', ...jiraFields(J, k0.jira) };
|
|
149
|
+
parent: k0.parent || '', ...jiraFields(J, k0.jira), ...(k0.priority && !J ? { priority: k0.priority } : {}) }; // priority: set in the row (inline-sprint-priority)
|
|
150
150
|
}
|
|
151
151
|
function jiraFields(J, R) {
|
|
152
152
|
if (!J && !R) return {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* pm/inline-fields.js — a task's sprint and priority, set in the row (initiative inline-sprint-priority, idea A469).
|
|
2
|
+
* PURE: no DOM, no request, no clock (the caller passes today). The initiative popup (pm/bd-pop-ds.js, wired in pm/cozy-pop-work.js) and
|
|
3
|
+
* Work › Backlog (pm/bd-backlog-ds.js, wired in pm/bd-backlog.js) draw the two buttons and their lists from here.
|
|
4
|
+
*
|
|
5
|
+
* canEdit(row) → bool an open PMOS task: not done, not a Jira ticket (Jira keeps its own sprint and priority)
|
|
6
|
+
* sprintChoices(sprints, today) → [choice] the open sprints with dates: active first, then coming, by start day; ended, closed or
|
|
7
|
+
* undated ones left out; one per name. choice: { name, label, start, end, state, dates }
|
|
8
|
+
* sprintOf(task, choices) → choice | null the sprint whose days hold the task's due day (its start, with no due)
|
|
9
|
+
* sprintItems(task, choices) → [{ ...choice, on }] the Sprint list, the one the task is in ticked
|
|
10
|
+
* sprintPatch(task, choice) → { start?, due, sprint } what POST /api/boards/tasks/edit takes: the sprint's days (a milestone: the last day only)
|
|
11
|
+
* priorityItems(cur) → [{ v, label, on }] P1, P2, P3 and No priority ('')
|
|
12
|
+
* saySprint(title, choice) · sayPriority(title, v) the one line said after a pick (with Undo)
|
|
13
|
+
*
|
|
14
|
+
* A pick saves at once through POST /api/boards/tasks/edit, whose answer `from` is the Undo. Nothing is written to Jira. */
|
|
15
|
+
|
|
16
|
+
export const PRIORITIES = Object.freeze(['P1', 'P2', 'P3']);
|
|
17
|
+
const MON3 = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
18
|
+
const day = (v) => (typeof v === 'string' && /^\d{4}-\d{2}-\d{2}/.test(v) ? v.slice(0, 10) : '');
|
|
19
|
+
const short = (d) => { const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(d); return m ? Number(m[3]) + ' ' + MON3[Number(m[2]) - 1] : d; };
|
|
20
|
+
/** "IDPF Sprint 119" → "Sprint 119"; a name with no sprint number stays as it is (lib/sprint-now.js labelOf). */
|
|
21
|
+
const labelOf = (name) => { const m = /(sprint\s*\d+)\s*$/i.exec(String(name || '')); return m ? m[1].replace(/^s/, 'S') : String(name || ''); };
|
|
22
|
+
|
|
23
|
+
/** An open PMOS task: the row of the initiative popup ({ kind, done, jira }) or of the Backlog ({ src, state }). */
|
|
24
|
+
export function canEdit(r) {
|
|
25
|
+
if (!r || r.jira || r.src === 'jira' || r.done) return false;
|
|
26
|
+
if (r.kind === 'stage' || r.kind === 'Epic') return false;
|
|
27
|
+
return !['Done', "Won't do", 'Archived'].includes(r.state || r.status || '');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function sprintChoices(sprints, today) {
|
|
31
|
+
const t = day(today), seen = new Set(), out = [];
|
|
32
|
+
for (const s of Array.isArray(sprints) ? sprints : []) {
|
|
33
|
+
if (!s || !s.name || seen.has(String(s.name))) continue;
|
|
34
|
+
const start = day(s.start), end = day(s.end), state = String(s.state || '');
|
|
35
|
+
if (!start || !end || state === 'closed' || (t && end < t)) continue;
|
|
36
|
+
seen.add(String(s.name));
|
|
37
|
+
out.push({ name: String(s.name), label: s.label || labelOf(s.name), start, end, state, dates: short(start) + ' – ' + short(end) });
|
|
38
|
+
}
|
|
39
|
+
return out.sort((a, b) => (a.state === 'active' ? 0 : 1) - (b.state === 'active' ? 0 : 1) || a.start.localeCompare(b.start) || a.name.localeCompare(b.name));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function sprintOf(task, choices) {
|
|
43
|
+
const d = day(task && (task.end || task.due)) || day(task && task.start);
|
|
44
|
+
if (!d) return null;
|
|
45
|
+
return (choices || []).find((s) => s.start <= d && d <= s.end) || null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function sprintItems(task, choices) {
|
|
49
|
+
const cur = sprintOf(task, choices);
|
|
50
|
+
return (choices || []).map((s) => ({ ...s, on: !!cur && cur.name === s.name }));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function sprintPatch(task, s) {
|
|
54
|
+
const ms = !!(task && (task.ms || task.milestone));
|
|
55
|
+
return ms ? { due: s.end, sprint: s.name } : { start: s.start, due: s.end, sprint: s.name };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function priorityItems(cur) {
|
|
59
|
+
const c = PRIORITIES.includes(cur) ? cur : '';
|
|
60
|
+
return PRIORITIES.map((v) => ({ v, label: v, on: v === c })).concat([{ v: '', label: 'No priority', on: !c }]);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const saySprint = (title, s) => `In ${(s && (s.label || s.name)) || 'the sprint'}: ${title || 'the task'}.`;
|
|
64
|
+
export const sayPriority = (title, v) => `${v || 'No priority'}: ${title || 'the task'}.`;
|
|
@@ -299,7 +299,7 @@ function taskRow(x, t) {
|
|
|
299
299
|
prog: /progress|review/i.test(st), wont: !!x.wont || st === "Won't do",
|
|
300
300
|
// subtasks and Jira (initiative work-subtasks): the parent, the chip's key and link, the epic as read, the assignee, a Jira sub-task
|
|
301
301
|
parent: x.parent || '', ckey: x.ckey || x.jkey || '', jurl: x.jurl || '', ...(x.jepic !== undefined ? { jepic: x.jepic, jepicName: x.jepicName || '' } : {}), jassignee: x.jassignee || '', jtype: x.jtype || '',
|
|
302
|
-
...(x.jsub ? { jsub: true } : {}), ...(x.jsubOf ? { jsubOf: x.jsubOf } : {}) };
|
|
302
|
+
...(x.jsub ? { jsub: true } : {}), ...(x.jsubOf ? { jsubOf: x.jsubOf } : {}), ...(x.priority ? { priority: x.priority } : {}) };
|
|
303
303
|
}
|
|
304
304
|
/** The tasks of every stage, nested (initiative work-subtasks): the read Jira sub-tasks join as rows under their ticket, and a task that names
|
|
305
305
|
* a sub-task's key with no parent of its own sits under its ticket's row. → { T: Map uid → node, isChild(x), rx(x) (a parent with its roll-up) } */
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Set a task's sprint and priority in place (idea A469, initiative inline-sprint-priority, done test planning/done-tests/inline-sprint-priority.md S1-S8): the task-priority line and its fold, the edit route's priority and sprint, the items and the Backlog carrying them, the Sprint and Priority lists, the row buttons and their wiring. A scratch repository; no server, network or browser.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"inline-fields.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"inline-fields.test.js": 4
|
|
8
|
+
}
|
|
9
|
+
}
|