create-pmos 0.771.0 → 0.773.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 +27 -79
- 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 +26 -0
- package/workspace/guide/layout.md +8 -6
- package/workspace/lib/routes-boards.js +17 -5
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/bd-ini-panel.js +17 -1
- package/workspace/public/pm/cozy-home.css +8 -2
- package/workspace/public/pm/cozy-pop-work.js +3 -2
- package/workspace/public/pm/cozy-task-pop.js +60 -10
- package/workspace/public/pm/premium-board.js +7 -4
- package/workspace/public/pm/premium-vw-item.js +3 -1
- package/workspace/public/pm/premium-vw-jira.js +12 -0
- package/workspace/public/pm/task-card.js +11 -7
- package/workspace/public/pm/vw-ds.js +44 -2
- package/workspace/test-lists/task-detail-every-task.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.773.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -33,6 +33,32 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.773.0",
|
|
38
|
+
"at": "2026-11-24T10:11:16.212Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1738,
|
|
43
|
+
"t": "The chat box has a quiet focus and a round Send inside it",
|
|
44
|
+
"s": "The chat box has a quiet focus and a round Send inside it",
|
|
45
|
+
"k": "fix"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"v": "0.772.0",
|
|
51
|
+
"at": "2026-11-24T09:30:28.206Z",
|
|
52
|
+
"f": 4,
|
|
53
|
+
"prs": [
|
|
54
|
+
{
|
|
55
|
+
"n": 1734,
|
|
56
|
+
"t": "Every task opens the one-column task detail, Jira tickets too",
|
|
57
|
+
"s": "Every task opens the one-column task detail, Jira tickets too",
|
|
58
|
+
"k": "new"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
36
62
|
{
|
|
37
63
|
"v": "0.771.0",
|
|
38
64
|
"at": "2026-11-24T09:13:38.789Z",
|
|
@@ -421,84 +447,6 @@
|
|
|
421
447
|
}
|
|
422
448
|
}
|
|
423
449
|
]
|
|
424
|
-
},
|
|
425
|
-
{
|
|
426
|
-
"v": "0.753.0",
|
|
427
|
-
"at": "2026-11-24T00:26:15.065Z",
|
|
428
|
-
"f": 4,
|
|
429
|
-
"prs": [
|
|
430
|
-
{
|
|
431
|
-
"n": 1702,
|
|
432
|
-
"t": "Program line, Charter to Land over pmos line",
|
|
433
|
-
"s": "Program line, Charter to Land over pmos line",
|
|
434
|
-
"k": "new",
|
|
435
|
-
"try": {
|
|
436
|
-
"steps": [
|
|
437
|
-
"In a PMOS chat, ask: where are my programs?",
|
|
438
|
-
"Ask: draft the milestones for <a program>",
|
|
439
|
-
"Open that program from Home and look under Milestones"
|
|
440
|
-
],
|
|
441
|
-
"see": "The chat names each program's station (Charter, Sequence, Track or Land), what is missing and the next move, and its forecast against the target. After the second ask, the program shows dated…",
|
|
442
|
-
"open": "/pm/"
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
]
|
|
446
|
-
},
|
|
447
|
-
{
|
|
448
|
-
"v": "0.752.0",
|
|
449
|
-
"at": "2026-11-24T00:12:53.761Z",
|
|
450
|
-
"f": 4,
|
|
451
|
-
"prs": [
|
|
452
|
-
{
|
|
453
|
-
"n": 1694,
|
|
454
|
-
"t": "Settings › Workflows names the workspace it shows, with a picker",
|
|
455
|
-
"s": "Settings › Workflows names the workspace it shows, with a picker",
|
|
456
|
-
"k": "fix"
|
|
457
|
-
},
|
|
458
|
-
{
|
|
459
|
-
"n": 1700,
|
|
460
|
-
"t": "Quiet rows, at most 3 line rows a day per product and one batch (quiet-rows, slice A)",
|
|
461
|
-
"s": "Quiet rows, at most 3 line rows a day per product and one batch (quiet-rows, slice A)",
|
|
462
|
-
"k": "new",
|
|
463
|
-
"try": {
|
|
464
|
-
"steps": [
|
|
465
|
-
"Open Today",
|
|
466
|
-
"Read Your move: each product has at most 3 rows, and what other people will see is one row, Today's batch",
|
|
467
|
-
"Press Today's batch"
|
|
468
|
-
],
|
|
469
|
-
"see": "Your move shows at most 3 line rows for each product, fixed for the day. Today's batch opens full size with Back: the drafts grouped by kind, each saying who will see it, with Change it first, Skip…",
|
|
470
|
-
"open": "/today.html"
|
|
471
|
-
}
|
|
472
|
-
},
|
|
473
|
-
{
|
|
474
|
-
"n": 1698,
|
|
475
|
-
"t": "Pmos line, where each initiative stands on its own workflow",
|
|
476
|
-
"s": "Pmos line, where each initiative stands on its own workflow",
|
|
477
|
-
"k": "new",
|
|
478
|
-
"try": {
|
|
479
|
-
"steps": [
|
|
480
|
-
"In a PMOS chat on a product, ask: where is each initiative on the line?",
|
|
481
|
-
"Ask: which ones are stuck, and what moves each one next?"
|
|
482
|
-
],
|
|
483
|
-
"see": "The chat answers from pmos line: every live initiative with its station, days there, the exit items still missing, the next move, and stuck, moving, waiting or can't tell."
|
|
484
|
-
}
|
|
485
|
-
},
|
|
486
|
-
{
|
|
487
|
-
"n": 1701,
|
|
488
|
-
"t": "PMOS never waits on its own drafts",
|
|
489
|
-
"s": "PMOS never waits on its own drafts",
|
|
490
|
-
"k": "new",
|
|
491
|
-
"try": {
|
|
492
|
-
"steps": [
|
|
493
|
-
"Open Home and look at PMOS did",
|
|
494
|
-
"Find a draft PMOS applied by itself or a question it closed after 2 days, and press Undo",
|
|
495
|
-
"Open Home again the next day"
|
|
496
|
-
],
|
|
497
|
-
"see": "Applied drafts and closed questions show in PMOS did with Undo; Undo brings a closed question back as a draft. No row says the agent waits on your drafts. A message or stage move that waited 7 days…",
|
|
498
|
-
"open": "/pm/"
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
]
|
|
502
450
|
}
|
|
503
451
|
]
|
|
504
452
|
}
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-24T10:11:13Z"}
|
|
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-24T10:11:13Z"}
|
|
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-24T10:11:13Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,30 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.773.0",
|
|
4
|
+
"at": "2026-11-24T10:11:16.212Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1738,
|
|
9
|
+
"t": "The chat box has a quiet focus and a round Send inside it",
|
|
10
|
+
"s": "The chat box has a quiet focus and a round Send inside it",
|
|
11
|
+
"k": "fix"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"v": "0.772.0",
|
|
17
|
+
"at": "2026-11-24T09:30:28.206Z",
|
|
18
|
+
"f": 4,
|
|
19
|
+
"prs": [
|
|
20
|
+
{
|
|
21
|
+
"n": 1734,
|
|
22
|
+
"t": "Every task opens the one-column task detail, Jira tickets too",
|
|
23
|
+
"s": "Every task opens the one-column task detail, Jira tickets too",
|
|
24
|
+
"k": "new"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
2
28
|
{
|
|
3
29
|
"v": "0.771.0",
|
|
4
30
|
"at": "2026-11-24T09:13:38.789Z",
|
|
@@ -140,13 +140,15 @@ Text you type in a PMOS box (a chat message, a Why, notes, a routine's instructi
|
|
|
140
140
|
- Text you clear yourself, or that PMOS sends or saves, is not kept, so it never comes back.
|
|
141
141
|
- PMOS keeps nothing from password, key, token or search boxes. A kept draft goes after 14 days.
|
|
142
142
|
|
|
143
|
-
###
|
|
143
|
+
### The task detail
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
Every task opens in the same task detail, from every place: the Board and its Backlog, an initiative's work list, Events, Today, Goals and Search. A Jira ticket opens in it too. Home keeps its Viewer until Home is rebuilt. A Jira ticket that no board holds (a draft ticket, or a ticket on no board) keeps the ticket Viewer.
|
|
146
146
|
|
|
147
|
-
- The top line has **Close**, the path (product › initiative
|
|
148
|
-
-
|
|
149
|
-
-
|
|
147
|
+
- The top line has **Close**, the path (product › initiative), the Jira key, the chat button, **Open in Jira**, ⋯ and ×. Press the initiative's name to open the initiative.
|
|
148
|
+
- Under the title is one row of chips: **Status** (a menu with every state, then the day it happened), the owner, Start → Due, and one chip for each field that has a value. **+** adds a field, a note or a subtask.
|
|
149
|
+
- Then one column: **Where it stands** (what is late, what waits, what blocks it), **Description**, **Notes** (only when there are notes), **Subtasks**, **Linked** and **Activity** (All, Comments and PMOS work log, with the comment box). A change from the last 7 days has **Undo**.
|
|
150
|
+
- ⋯ has **Make it a milestone**, **Move**, **Copy link**, **Archive** and **Delete**.
|
|
151
|
+
- **A Jira ticket.** Jira owns the key, the status, the assignee, the sprint and the points. They show as chips that you cannot change; the key chip opens the ticket in Jira. **Where it stands** says what Jira flags as blocking it. **Description** is PMOS's copy of the ticket's text, with its acceptance criteria. **Subtasks** and **Linked** come from Jira. Notes and comments save in PMOS and never go to Jira. ⋯ has **Read Jira again**, **Copy link**, **Copy as text** and **Open in Jira**.
|
|
150
152
|
- After PMOS updates, the popup draws with the new version's look at once; it never keeps the look of the version before.
|
|
151
153
|
|
|
152
154
|
## Work and its chat, in one popup
|
|
@@ -160,7 +162,7 @@ On a computer, an initiative you open from Home, Board or Intelligence opens in
|
|
|
160
162
|
- The stop icon on a live session ends it at once. **Session ended** shows with **Undo** for a few seconds, and the session moves to **Earlier**.
|
|
161
163
|
- The chat icon opens the popup on the session that waits for you, or else the newest. The left side shows that session's work, or the list of sessions when it is about no work.
|
|
162
164
|
- The chat's top bar has the session, one quiet line under it that says what the chat is about, ⋯ and ×. ⋯ has **Hide the chat**, **Sessions** and, while the session is live, **End session**. On a desk, work always opens in this popup.
|
|
163
|
-
- On Today and Home the chat is drawn from the PMOS design system: your question sits in a grey box, the box you write in is one white card, and **Send** is a
|
|
165
|
+
- On Today and Home the chat is drawn from the PMOS design system: your question sits in a grey box, the box you write in is one white card, and **Send** is a blue circle inside the box. When you type in the box, its grey line gets darker. No coloured ring shows.
|
|
164
166
|
- The chat reads as on a phone: messages only, without names or times on each one. Each answer shows in full, and the small notes and steps before it fold into one line, for example "Worked 6 steps · 20 s"; press it to see them. Copy, Retry and Make it a task show on the newest answer. The box is one row: +, the words, the microphone and send.
|
|
165
167
|
- Beside the page, a panel you slide off the edge is put away. The round Live button above the chat icon then shows, and its first row brings the panel back. Otherwise the chat icon holds your sessions, and there is no Live button.
|
|
166
168
|
|
|
@@ -826,6 +826,18 @@ const openAsks = (folded, boardId) => [...folded.asks.values()].filter((a) => a.
|
|
|
826
826
|
const pageAsk = (a) => ({ ...a, by: actorLib.pageName(a.by) });
|
|
827
827
|
const pageMove = (m) => ({ ...m, by: actorLib.pageName(m.by) });
|
|
828
828
|
|
|
829
|
+
/** What a Jira reading says that the one-column task detail shows as chips (task-detail-every-task): the assignee, the sprint, the
|
|
830
|
+
* points, Jira's own status name and the link. Read only: Jira owns them. A field the reading lacks is left out. */
|
|
831
|
+
function jiraFacts(rd) {
|
|
832
|
+
if (!rd) return {};
|
|
833
|
+
const o = {};
|
|
834
|
+
if (rd.assignee) o.assignee = String(rd.assignee);
|
|
835
|
+
if (rd.sprint && rd.sprint.name) o.sprint = String(rd.sprint.name);
|
|
836
|
+
if (rd.points != null && rd.points !== '') o.points = rd.points;
|
|
837
|
+
if (rd.status) o.jiraStatus = String(rd.status);
|
|
838
|
+
if (rd.url) o.url = String(rd.url);
|
|
839
|
+
return o;
|
|
840
|
+
}
|
|
829
841
|
/** The work items of a board: its PMOS tasks (the ledger and the initiatives' breakdown items) and, with Build and deliver on, the Jira items of its initiatives
|
|
830
842
|
* (the ticket drafts this repository pushed, with the status of the cached readings; read-only, no dates or people). */
|
|
831
843
|
function itemsOf(w, fr, board, rows) {
|
|
@@ -844,7 +856,7 @@ function itemsOf(w, fr, board, rows) {
|
|
|
844
856
|
const epicKey = /^[A-Za-z][A-Za-z0-9_]*-\d+$/.test(String((d.fm && d.fm.epic) || '')) ? String(d.fm.epic).toUpperCase() : null;
|
|
845
857
|
if (epicKey) {
|
|
846
858
|
const rd = reading(epicKey);
|
|
847
|
-
out.push({ uid: epicKey, key: epicKey, kind: 'Epic', src: 'jira', title: (rd && rd.summary) || row.title, status: B.itemStatus(rd && rd.status, rd && rd.category), blocked: !!(rd && rd.flagged), owner: null, ini: row.id, epic: null, start: null, end: null, ref: null, board: board.id, readAt: (snap && snap.fetchedAt) || null });
|
|
859
|
+
out.push({ uid: epicKey, key: epicKey, kind: 'Epic', src: 'jira', title: (rd && rd.summary) || row.title, status: B.itemStatus(rd && rd.status, rd && rd.category), blocked: !!(rd && rd.flagged), owner: null, ini: row.id, epic: null, start: null, end: null, ref: null, board: board.id, readAt: (snap && snap.fetchedAt) || null, ...jiraFacts(rd) });
|
|
848
860
|
jiraKeys.add(epicKey);
|
|
849
861
|
}
|
|
850
862
|
for (const t of d.tickets || []) {
|
|
@@ -853,7 +865,7 @@ function itemsOf(w, fr, board, rows) {
|
|
|
853
865
|
// the breakdown item the ticket was drafted from keeps the plan's days: the row shows them (batch 7 item 6; it showed none). Jira owns the assignee
|
|
854
866
|
const it = (planOf || (planOf = TI.itemsById(w.root)))[t.id] || null;
|
|
855
867
|
out.push({ uid: t.jira, key: t.jira, kind: ['Story', 'Task', 'Bug'].includes(t.type) ? t.type : 'Task', src: 'jira', title: (rd && rd.summary) || t.summary || t.jira,
|
|
856
|
-
status: B.itemStatus(rd && rd.status, rd && rd.category), blocked: !!(rd && rd.flagged), owner: null, ini: row.id, epic: epicKey, start: (it && it.start) || null, end: (it && it.due) || null, ref: null, board: board.id, readAt: (snap && snap.fetchedAt) || null });
|
|
868
|
+
status: B.itemStatus(rd && rd.status, rd && rd.category), blocked: !!(rd && rd.flagged), owner: null, ini: row.id, epic: epicKey, start: (it && it.start) || null, end: (it && it.due) || null, ref: null, board: board.id, readAt: (snap && snap.fetchedAt) || null, ...jiraFacts(rd) });
|
|
857
869
|
jiraKeys.add(t.jira);
|
|
858
870
|
}
|
|
859
871
|
}
|
|
@@ -877,7 +889,7 @@ function itemsOf(w, fr, board, rows) {
|
|
|
877
889
|
const rd = whole && whole.tickets && whole.tickets.get ? whole.tickets.get(k) : null;
|
|
878
890
|
if (!rd) continue;
|
|
879
891
|
const kind = ['Story', 'Task', 'Bug'].find((t) => t.toLowerCase() === String(rd.type || '').toLowerCase()) || 'Task';
|
|
880
|
-
out.push({ uid: k, key: k, kind, src: 'jira', title: rd.summary || k, status: B.itemStatus(rd.status, rd.category), blocked: !!rd.flagged, owner: null, ini: to, epic: rd.parent || null, start: null, end: null, ref: null, board: board.id, readAt: whole.fetchedAt || null, notes: '' });
|
|
892
|
+
out.push({ uid: k, key: k, kind, src: 'jira', title: rd.summary || k, status: B.itemStatus(rd.status, rd.category), blocked: !!rd.flagged, owner: null, ini: to, epic: rd.parent || null, start: null, end: null, ref: null, board: board.id, readAt: whole.fetchedAt || null, notes: '', ...jiraFacts(rd) });
|
|
881
893
|
jiraKeys.add(k);
|
|
882
894
|
}
|
|
883
895
|
}
|
|
@@ -940,7 +952,7 @@ function epicItems(row, board, snap, seen, out) {
|
|
|
940
952
|
if (!snap || !snap.tickets || !snap.tickets.size || !(row.epics || []).length) return;
|
|
941
953
|
const epics = row.epics.filter((k) => snap.tickets.has(k));
|
|
942
954
|
const first = epics[0] || null;
|
|
943
|
-
const item = (r, kind, epic) => ({ uid: r.key, key: r.key, kind, src: 'jira', title: r.summary || r.key, status: B.itemStatus(r.status, r.category), blocked: !!r.flagged, owner: null, ini: row.id, epic, start: null, end: null, ref: null, board: board.id, readAt: snap.fetchedAt || null });
|
|
955
|
+
const item = (r, kind, epic) => ({ uid: r.key, key: r.key, kind, src: 'jira', title: r.summary || r.key, status: B.itemStatus(r.status, r.category), blocked: !!r.flagged, owner: null, ini: row.id, epic, start: null, end: null, ref: null, board: board.id, readAt: snap.fetchedAt || null, ...jiraFacts(r) });
|
|
944
956
|
for (const k of epics) { if (!seen.has(k)) { out.push(item(snap.tickets.get(k), 'Epic', null)); seen.add(k); } }
|
|
945
957
|
for (const r of snap.tickets.values()) {
|
|
946
958
|
if (seen.has(r.key) || (r.parent && !row.epics.includes(r.parent)) || (!r.parent && r.type === 'Epic')) continue; // a reading of an epic no longer linked
|
|
@@ -2362,4 +2374,4 @@ function meetingBoards(ctx) {
|
|
|
2362
2374
|
return { list, detail };
|
|
2363
2375
|
}
|
|
2364
2376
|
|
|
2365
|
-
module.exports = { prefixes: ['/api/boards'], handle, tasksOfIni, postFrame, needRows, itemsOf, readLedger, foldOf, epicsOf, rowsOfBoard, invalidateRows: (w) => { rowsLib.invalidate(w.root); rowCache.delete(w.root); }, move, switchWorkflow, taskState, taskAdd, taskEdit, taskComment, describeDraft, writeAs, taskDelete, taskRestore, initiativeWorkflow, seedInitiative, stageTasks, boardIndex, appendScanAsk, scanDeclineSignal, createAndPlace, startOnDefault, kindSwitch, kindFollowsWorkflow, recordKind, ledgerFile, append, frameFor, boardIdOf, meetingBoards, boardsOf, baseRows, boardRow, taskSpanOf, workflowRowOf, closedOf, foldOf, portfolio, SELF_REFUSAL, NO_STATE };
|
|
2377
|
+
module.exports = { prefixes: ['/api/boards'], handle, jiraFacts, tasksOfIni, postFrame, needRows, itemsOf, readLedger, foldOf, epicsOf, rowsOfBoard, invalidateRows: (w) => { rowsLib.invalidate(w.root); rowCache.delete(w.root); }, move, switchWorkflow, taskState, taskAdd, taskEdit, taskComment, describeDraft, writeAs, taskDelete, taskRestore, initiativeWorkflow, seedInitiative, stageTasks, boardIndex, appendScanAsk, scanDeclineSignal, createAndPlace, startOnDefault, kindSwitch, kindFollowsWorkflow, recordKind, ledgerFile, append, frameFor, boardIdOf, meetingBoards, boardsOf, baseRows, boardRow, taskSpanOf, workflowRowOf, closedOf, foldOf, portfolio, SELF_REFUSAL, NO_STATE };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.773.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.773.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
* openIni(r, from) the initiative: the ONE view (pm/ini-view.js from pm/ini-view-model.js, feedback batch 6 item 1; canvas OvIniA), the
|
|
14
14
|
* same as Home's initiative page: the summary card, the stage card with its dates line (it replaced the Plan card, item 3),
|
|
15
15
|
* Tasks as the WBS, then Documents and Linked. What the Board adds under them: drafted tickets and the PRD drift.
|
|
16
|
-
* openTicket(r, k) the ticket
|
|
16
|
+
* openTicket(r, k) the ticket in the one-column task detail (pm/cozy-task-pop.js, task-detail-every-task); a ticket no board item holds
|
|
17
|
+
* keeps the ticket Viewer (tk-view.js) as a drill-in: ← goes back to the initiative; the summary says what blocks it
|
|
17
18
|
* refresh() draws the shown item again after a new read, in place · close() · shown() → the key of the initiative shown, or null
|
|
18
19
|
*
|
|
19
20
|
* What has no place on the view is under ⋯: the ONE initiative menu (pm/ini-more.js, feedback batch 14 item 5; seven entries since batch 16
|
|
@@ -363,7 +364,22 @@ function blockerTitle(key) {
|
|
|
363
364
|
}
|
|
364
365
|
/** The stage a ticket sits in: the workflow's Build stage (where its tickets count), else the stage the initiative is in. */
|
|
365
366
|
const tkStage = (r) => { const L = (r && r.wfStages) || [], b = L.find((x) => /^build\b/i.test(x.name || '')); return (b && b.name) || (r && r.wfStage && r.wfStage.name) || ''; };
|
|
367
|
+
/** A ticket opens in the one-column task detail, the same as a PMOS task (task-detail-every-task, Wawan 2026-11-24: "why Jira task details
|
|
368
|
+
* different with the pmos task details? make it same."). A ticket no board item holds keeps the ticket Viewer below. */
|
|
366
369
|
export function openTicket(r, k, from) {
|
|
370
|
+
if (!O || !r || !k) return;
|
|
371
|
+
const M = O.M() || {}, B = M.board || {};
|
|
372
|
+
import('./cozy-task-pop.js').then((TP) => TP.openTask(k.key, {
|
|
373
|
+
full: true, ws: r.ws || B.ws || '', board: r.boardId || B.id || '', ini: r.id || '', path: [r.title || r.id].filter(Boolean), iniCrumb: true,
|
|
374
|
+
pmPost: (p, body) => import('./http.js').then((H) => H.pmPost(p, body)), toast: (m, undo) => O.toast(m, undo),
|
|
375
|
+
iniTitle: (id) => (id === r.id ? r.title : id), onChange: () => O.reload(),
|
|
376
|
+
openIni: () => openIni(O.rowOf(r.key) || r), refresh: M.jira ? () => O.refreshJira() : null,
|
|
377
|
+
openRef: (ref) => { const k2 = ((r.track && r.track.tickets) || []).find((x) => x.key === ref); if (k2) openTicket(r, k2); },
|
|
378
|
+
missing: () => openTicketView(r, k, from),
|
|
379
|
+
})).catch(() => openTicketView(r, k, from));
|
|
380
|
+
}
|
|
381
|
+
/** The ticket Viewer (tk-view.js): a ticket the board's items do not hold. */
|
|
382
|
+
function openTicketView(r, k, from) {
|
|
367
383
|
if (!O || !r || !k) return;
|
|
368
384
|
const c = VW.current && VW.current(), back = !!(c && c.id === vidOf(r));
|
|
369
385
|
const it = TI(r), tr = it && it.tickets ? it.tickets[k.key] || null : null, M = O.M() || {}, B = M.board || {};
|
|
@@ -1041,5 +1041,11 @@ body.pm-ds .hm-bub { border-radius: var(--radius-md); background: var(--well); p
|
|
|
1041
1041
|
body.pm-ds .hm-pills button { min-height: 32px; padding: 0 var(--space-12); border-radius: var(--radius-sm); border-color: var(--line); color: var(--ink); }
|
|
1042
1042
|
body.pm-ds .hm-pills button.pri { background: var(--blue); color: var(--on-blue); }
|
|
1043
1043
|
body.pm-ds :is(form#hmForm.hm-box, .hm-box-rich) { border-radius: var(--radius-card); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
|
|
1044
|
-
|
|
1045
|
-
|
|
1044
|
+
/* The composer's focus is quiet (Wawan 2026-11-24, "no need to have highlight color"): no coloured glow on the box and no second ring
|
|
1045
|
+
* on the text area. The box's own line darkens to --composer-focus-line, and the caret shows where you type; a key-focused button
|
|
1046
|
+
* in the box takes the same neutral ring. Send is a circle that sits inside the box and follows its corner, on every composer. */
|
|
1047
|
+
body.pm-ds { --composer-focus-line: color-mix(in srgb, var(--ink) 30%, transparent); }
|
|
1048
|
+
body.pm-ds :is(form#hmForm.hm-box, form.hm-box, .hm-box-rich):focus-within { box-shadow: inset 0 0 0 1px var(--composer-focus-line); }
|
|
1049
|
+
body.pm-ds form.hm-box :is(textarea, input):focus-visible { outline: none; box-shadow: none; }
|
|
1050
|
+
body.pm-ds form.hm-box button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--composer-focus-line); }
|
|
1051
|
+
body.pm-ds .hm-send { width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: var(--on-blue); }
|
|
@@ -1367,11 +1367,11 @@ async function editRow(uid, patch, words, c, h, x, field) {
|
|
|
1367
1367
|
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(); });
|
|
1368
1368
|
if (h.reload) await h.reload();
|
|
1369
1369
|
}
|
|
1370
|
-
/* "Open the task" opens the
|
|
1370
|
+
/* "Open the task" opens the task popup on top (round 3 point 20, pm/cozy-task-pop.js); ↑ ↓ step through this list. A Jira ticket opens there too; one no item holds keeps its
|
|
1371
1371
|
* ticket view. On close the row is lit for a moment. */
|
|
1372
1372
|
async function openSmall(uid, c, h, x, body, bt) {
|
|
1373
1373
|
const row = c.W.rows.find((r) => r.uid === uid) || {};
|
|
1374
|
-
|
|
1374
|
+
// a Jira ticket opens in the same one-column task detail (task-detail-every-task); one the board's items do not hold keeps its ticket view
|
|
1375
1375
|
const TP = await import('./cozy-task-pop.js');
|
|
1376
1376
|
const w = h.where ? h.where() : {}, o = (x && x.o && x.o()) || {};
|
|
1377
1377
|
const list = () => { const cc = body.__pwx && body.__pwx.r() ? model(body.__pwx.r(), body.__pwx.v(), body.__pwx.o()) : null; return ((cc && cc.W.rows) || c.W.rows).filter((r) => r.kind === 'task' && !r.jira).map((r) => r.uid); };
|
|
@@ -1387,6 +1387,7 @@ async function openSmall(uid, c, h, x, body, bt) {
|
|
|
1387
1387
|
// the full popup over the work side (work-ds-quick-edit, WorkStatesDS 4 and 6): ← and the path go back to this initiative, the chat button
|
|
1388
1388
|
// shows the popup's chat, × closes the popup; a milestone shows its date, the done test and PMOS's suggestion about it
|
|
1389
1389
|
full: true, path: [o.from || 'Work', o.product || '', ((x && x.v && x.v()) || {}).title || ''].filter(Boolean),
|
|
1390
|
+
missing: row.jira && h.openTask ? () => h.openTask(uid) : null,
|
|
1390
1391
|
chat: () => { const a = document.querySelector('.cz-pop [data-pop="ask"]'); if (a) a.click(); },
|
|
1391
1392
|
closeAll: () => { const k = document.querySelector('.cz-pop [data-pop="close"]'); if (k) k.click(); },
|
|
1392
1393
|
head: (t) => {
|
|
@@ -130,6 +130,8 @@ export async function openTask(uid, ctx = {}) {
|
|
|
130
130
|
// the status pick waits for the day (point 18): the card's own press is held here, the line opens under the card
|
|
131
131
|
el.addEventListener('click', holdStatus, true);
|
|
132
132
|
}
|
|
133
|
+
// a full popup opened from a place with no popup behind (the Backlog, a ticket): Ask PMOS opens the page's chat about this task
|
|
134
|
+
if (ctx.full && !ctx.chat) ctx = { ...ctx, chat: (about) => import('./page-chat.js').then((PC) => { const tt = PC.itemTarget && PC.itemTarget(about || chatAbout(S.t, S.raw), ctx.ws || ''); return tt ? PC.openTarget(tt, { title: tt.title }) : false; }).catch(() => false) };
|
|
133
135
|
S.ctx = ctx;
|
|
134
136
|
await show(uid);
|
|
135
137
|
}
|
|
@@ -142,8 +144,12 @@ async function show(uid) {
|
|
|
142
144
|
const raw = await rowOf(uid, ctx);
|
|
143
145
|
if (!S || S.uid !== uid) return;
|
|
144
146
|
S.el.removeAttribute('aria-busy');
|
|
147
|
+
// a Jira ticket no board item holds (a draft ticket, a ticket on no initiative): the host's own view instead (task-detail-every-task)
|
|
148
|
+
if (!raw && ctx.missing) { closeTask(); ctx.missing(); return; }
|
|
145
149
|
if (!raw) { S.el.innerHTML = `<div class="ctp-h">${ib('data-ctp-close', 'Close', P.x)}</div><p class="ctp-none">This task could not be read. It may have been removed.</p>`; return; }
|
|
146
|
-
|
|
150
|
+
// the initiative's name: the host's, else the board's initiatives (a ticket opened from a place that holds only the id)
|
|
151
|
+
const iniName = (id) => (ctx.iniTitle ? ctx.iniTitle(id) : '') || ((S.inis || []).find((x) => x.id === id) || {}).title || '';
|
|
152
|
+
const t = taskOf(raw, { iniTitle: iniName(raw.ini || ctx.ini), board: ctx.board, ini: ctx.ini });
|
|
147
153
|
S.raw = raw; S.t = t; S.nextDay = null;
|
|
148
154
|
// the full popup over the one popup: the chat beside it is about this task now, not its initiative (bug 2026-11-24); ← gives it back
|
|
149
155
|
if (ctx.full) S.chatOn = popChat(chatAbout(t, raw)) || S.chatOn;
|
|
@@ -156,7 +162,7 @@ async function show(uid) {
|
|
|
156
162
|
if (ctx.full) {
|
|
157
163
|
// WorkStatesDS 4 and 6, ViewerDS: ← and the path back, the source chip, then chat, ⋯ and ×; the kind, the title and one meta line under it.
|
|
158
164
|
// The body is main + side (viewer-ds-task): Where it stands, Linked and Activity, beside the task card (fields and notes) in a block.
|
|
159
|
-
const path = ctx.path || [], last = path.length - 1;
|
|
165
|
+
const path = (ctx.path || []).map((p) => (p === t.ini && t.iniTitle ? t.iniTitle : p)), last = path.length - 1;
|
|
160
166
|
// iniCrumb (a task opened from a place, not from its initiative's popup): the initiative's name opens it, and ← closes
|
|
161
167
|
const lastAttr = ctx.iniCrumb && t.ini ? `data-ctp-ini="${esc(t.ini)}"` : 'data-ctp-close';
|
|
162
168
|
const crumbs = path.map((p, k) => (k === last ? `<button type="button" class="ctp-cr" ${lastAttr}>${esc(p)}</button>` : `<span class="ctp-cr">${esc(p)}</span>`)).join('<span class="ctp-sep" aria-hidden="true">›</span>');
|
|
@@ -205,7 +211,7 @@ async function show(uid) {
|
|
|
205
211
|
canSub: () => !t.jira && !!t.ini && !t.parent,
|
|
206
212
|
} : {}),
|
|
207
213
|
});
|
|
208
|
-
if (ctx.full) { S.nopen = false; S.sadd = false; S.atab = S.atab || 'all'; S.draft = ''; S.propNo = false; S.dfull = false; S.links = null; drawMain(); loadActivity(); loadLinks(); describe(); }
|
|
214
|
+
if (ctx.full) { S.nopen = false; S.sadd = false; S.atab = S.atab || 'all'; S.draft = ''; S.propNo = false; S.dfull = false; S.links = null; S.tk = null; drawMain(); loadActivity(); loadLinks(); describe(); if (t.jira) loadTicket(); }
|
|
209
215
|
const f = S.el.querySelector('.ctp-t') || S.el.querySelector('button'); if (f) f.focus();
|
|
210
216
|
}
|
|
211
217
|
/* the one column (task-detail-one-column, pm/vw-ds.js): Where it stands, Description, Notes, Subtasks, Linked, Activity — in that order */
|
|
@@ -227,19 +233,21 @@ function drawMain() {
|
|
|
227
233
|
if (!S || !S.ctx.full || !S.t) return;
|
|
228
234
|
const put = (sel, html) => { const x = S.el.querySelector(sel); if (x) x.innerHTML = html; };
|
|
229
235
|
const R = relOf();
|
|
230
|
-
put('.ctp-stands', VD.standsHtml(S.t, { waits: S.ctx.waits ? S.ctx.waits(S.t) : '', subs: R.subs, waitsOn: R.waitsOn, noProp: !!(S.propNo || S.t.jira) }));
|
|
236
|
+
put('.ctp-stands', VD.standsHtml(S.t, { waits: S.ctx.waits ? S.ctx.waits(S.t) : '', subs: R.subs, waitsOn: R.waitsOn, noProp: !!(S.propNo || S.t.jira), blocked: S.tkBlocked || null }));
|
|
231
237
|
// the description (initiative task-descriptions): never redrawn under the PM's typing; on a phone it folds to its first line (TjPhone)
|
|
232
238
|
const dw = S.el.querySelector('.ctp-descw');
|
|
233
239
|
if (dw && !typing('[data-ctp-desc]')) {
|
|
234
240
|
const fold = phone() && !S.dfull && !S.dedit && !!S.t.description;
|
|
235
|
-
|
|
241
|
+
// a Jira ticket: PMOS's copy of its description and its acceptance criteria, read only (task-detail-every-task)
|
|
242
|
+
dw.innerHTML = (S.t.jira ? VD.ticketDescHtml(S.tk) : VD.descriptionHtml(S.t, { busy: !!S.dbusy, edit: !!S.dedit, undo: !!S.dundo }))
|
|
236
243
|
+ (fold ? '<button type="button" class="pm-fold ctp-dmore" data-ctp-dmore aria-expanded="false">More</button>' : '');
|
|
237
244
|
dw.classList.toggle('ctp-fold', fold);
|
|
238
245
|
}
|
|
239
246
|
// Notes: no empty block; + Note opens one, and a note that exists shows under the Description
|
|
240
247
|
if (!typing('[data-ctp-notes]')) put('.ctp-notesw', VD.notesHtml(S.t, { open: !!S.nopen }));
|
|
241
|
-
if (
|
|
242
|
-
put('.ctp-
|
|
248
|
+
if (S.t.jira) put('.ctp-subs', VD.ticketSubsHtml(S.tk)); // a ticket's Jira subtasks, read only
|
|
249
|
+
else if (!typing('.ctp-sadd input')) put('.ctp-subs', VD.subtasksHtml(R.subs, { adding: !!S.sadd, canAdd: !S.t.jira && !!S.t.ini && !S.t.parent }));
|
|
250
|
+
put('.ctp-linked', VD.linkedHtml(S.t, { ...R, ticket: S.tk }));
|
|
243
251
|
if (!typing('[data-ctp-cbox]')) put('.ctp-act', VD.activityHtml(S.histL || [], { open: !!S.aopen, tab: S.atab, comments: S.t.comments || [], draft: S.draft || '', first: phone() ? 2 : 3 }));
|
|
244
252
|
}
|
|
245
253
|
/** The kind of work a task reads as when its host does not say (TjKinds): a change or a done test reads Full ADLC, a sprint or an estimate
|
|
@@ -258,6 +266,33 @@ function loadLinks() {
|
|
|
258
266
|
const q = new URLSearchParams({ board: s.raw.board || s.ctx.board, initiative: s.t.ini, ...(s.ctx.ws ? { ws: s.ctx.ws } : {}) });
|
|
259
267
|
fetch('/api/task-links?' + q, { credentials: 'same-origin' }).then((x) => x.json()).catch(() => null).then((j) => { if (S !== s || !j || !j.ok) return; s.links = j.links || null; drawMain(); });
|
|
260
268
|
}
|
|
269
|
+
/* a Jira ticket (task-detail-every-task): the ticket's record (tk-view.js readTicket: the Jira tickets route, the sprints, the items) fills the
|
|
270
|
+
* chips Jira owns (assignee, sprint, points, priority, Jira's status, the link), what blocks it, its description, criteria, subtasks and links */
|
|
271
|
+
async function loadTicket() {
|
|
272
|
+
const s = S; if (!s || !s.t.jira) return;
|
|
273
|
+
console.info('[task-detail] jira');
|
|
274
|
+
const TV = await import('./tk-view.js').catch(() => null); if (!TV || S !== s) return;
|
|
275
|
+
const raw = s.raw || {}, key = s.t.jira.key;
|
|
276
|
+
const R = await TV.readTicket({ ws: s.ctx.ws, board: raw.board || s.ctx.board, ini: s.t.ini, ref: key }).catch(() => null);
|
|
277
|
+
if (S !== s || !R) return;
|
|
278
|
+
const base = { key, title: s.t.title, raw: raw.jiraStatus || '', status: raw.jiraStatus || '', assignee: raw.assignee || '', sprint: raw.sprint || '', points: raw.points != null ? raw.points : null,
|
|
279
|
+
url: raw.url || '', blocked: !!raw.blocked, epic: raw.epic || R.epicKey || null, due: s.t.due || '' };
|
|
280
|
+
const tk = TV.ticketOf({ base, model: R.model, notes: R.notes, ini: R.ini || s.t.ini, iniTitle: R.iniTitle, readAt: raw.readAt || (R.model && R.model.readAt) || '' });
|
|
281
|
+
s.tk = tk;
|
|
282
|
+
const t = s.t;
|
|
283
|
+
if (!t.owner && tk.assignee) t.owner = tk.assignee;
|
|
284
|
+
if (!t.sprint && tk.sprint) t.sprint = tk.sprint;
|
|
285
|
+
if ((t.estimate === '' || t.estimate == null) && tk.points != null) t.estimate = tk.points;
|
|
286
|
+
if (!t.priority && tk.priority) t.priority = tk.priority;
|
|
287
|
+
if (!t.jira.url && tk.url) t.jira.url = tk.url;
|
|
288
|
+
if (!t.jira.status && tk.status) t.jira.status = tk.status;
|
|
289
|
+
const sum = TV.tkSummary(tk, { blockerTitle: (k) => { const x = (s.items || []).find((y) => y.key === k || y.uid === k); return x && x.title !== k ? x.title : ''; } });
|
|
290
|
+
s.tkBlocked = sum ? { line: sum.line, text: sum.text } : null;
|
|
291
|
+
if (s.card && s.card.draw) s.card.draw();
|
|
292
|
+
// the head's Open in Jira, once the record names the link
|
|
293
|
+
if (tk.url && !s.el.querySelector('.ctp-jira')) { const x = s.el.querySelector('[data-ctp-more]'); if (x) x.insertAdjacentHTML('beforebegin', `<a class="ctp-ib ctp-jira" href="${esc(tk.url)}" target="_blank" rel="noopener" aria-label="Open in Jira" title="Open in Jira">${SVG(P.out)}</a>`); }
|
|
294
|
+
drawMain();
|
|
295
|
+
}
|
|
261
296
|
/* Notes save when the PM leaves the box, through the card's own change (Undo in the toast) */
|
|
262
297
|
function notesOut(e) {
|
|
263
298
|
const a = e.target; if (!S || !S.card || !a.matches || !a.matches('[data-ctp-notes]')) return;
|
|
@@ -399,6 +434,7 @@ async function press(e) {
|
|
|
399
434
|
// the one column (task-detail-one-column): Activity's tabs, a linked task or a subtask opens here, its tick, the ✦ proposal, the phone's fold
|
|
400
435
|
if (d.ctpAtab) { S.atab = d.ctpAtab; S.aopen = false; drawMain(); const x = S.el.querySelector(`[data-ctp-atab="${d.ctpAtab}"]`); if (x) x.focus(); return; }
|
|
401
436
|
if (d.ctpOpen) { show(d.ctpOpen); return; }
|
|
437
|
+
if (d.ctpTkref) { const k = d.ctpTkref; if ((S.items || []).some((x) => x.uid === k)) show(k); else if (ctx.openRef) { closeTask(); ctx.openRef(k); } else if (S.tk && S.tk.url) window.open(S.tk.url.replace(/[^/]+$/, k), '_blank', 'noopener'); return; }
|
|
402
438
|
if (d.ctpStick) { subTick(d.ctpStick, b); return; }
|
|
403
439
|
if (d.ctpProp && t) { S.propNo = true; S.card.setStatus(d.ctpProp); return; }
|
|
404
440
|
if ('ctpPropx' in d) { S.propNo = true; drawMain(); return; }
|
|
@@ -425,18 +461,20 @@ async function kindOf(on) {
|
|
|
425
461
|
if (s.ctx.onChange) s.ctx.onChange();
|
|
426
462
|
if (S === s) show(s.uid);
|
|
427
463
|
}
|
|
428
|
-
const jurlOf = (s) => (s.raw && ((s.raw.tracker && s.raw.tracker.url) || s.raw.url)) || '';
|
|
464
|
+
const jurlOf = (s) => (s.raw && ((s.raw.tracker && s.raw.tracker.url) || s.raw.url)) || (s.t && s.t.jira && s.t.jira.url) || '';
|
|
429
465
|
const jkeyOf = (s) => (s.t && s.t.jira ? s.t.jira.key : s.raw && s.raw.tracker && s.raw.tracker.key) || '';
|
|
430
466
|
function moreMenu(btn) {
|
|
431
467
|
const s = S; if (!s) return;
|
|
432
468
|
let m = s.el.querySelector('.ctp-menu');
|
|
433
469
|
if (m) { m.remove(); btn.setAttribute('aria-expanded', 'false'); return; }
|
|
434
470
|
m = document.createElement('div'); m.className = 'ctp-menu'; m.setAttribute('role', 'menu'); m.setAttribute('aria-label', 'More for this task');
|
|
435
|
-
// the full popup's ⋯ (TjC): milestone, Move, Copy link, Archive, Delete; on a phone also ↑ ↓ (TjPhone). A Jira ticket: Copy link
|
|
471
|
+
// the full popup's ⋯ (TjC): milestone, Move, Copy link, Archive, Delete; on a phone also ↑ ↓ (TjPhone). A Jira ticket: Read Jira again, Copy link, Copy as text, Open in Jira
|
|
436
472
|
const L = s.ctx.list ? s.ctx.list() : [], i = L.indexOf(s.uid), full = !!s.ctx.full, j = !!s.t.jira;
|
|
437
473
|
m.innerHTML = (j ? '' : `<button type="button" role="menuitem" data-k="kind">${SVG(s.t.milestone ? P.box : P.dia)}${s.t.milestone ? 'Make it a task' : 'Make it a milestone'}</button>`)
|
|
438
474
|
+ (full && !j ? '<button type="button" role="menuitem" data-k="move">Move…</button>' : '')
|
|
439
|
-
+ (
|
|
475
|
+
+ (j && s.ctx.refresh ? '<button type="button" role="menuitem" data-k="jread">Read Jira again</button>' : '') // a ticket (task-detail-every-task): the ticket view's ⋯
|
|
476
|
+
+ (linkPath({ kind: 'task', id: s.uid }) || (j && jurlOf(s)) ? '<button type="button" role="menuitem" data-k="link">Copy link</button>' : '') // the short link (bet A428); a ticket's Jira link
|
|
477
|
+
+ (j ? '<button type="button" role="menuitem" data-k="text">Copy as text</button>' : '')
|
|
440
478
|
+ (!j && s.t.status !== 'Archived' ? '<button type="button" role="menuitem" data-k="arch">Archive</button>' : '')
|
|
441
479
|
+ (full && L.length > 1 && i >= 0 ? `<button type="button" role="menuitem" class="ctp-ph" data-k="prev"${i === 0 ? ' disabled' : ''}>Previous task</button><button type="button" role="menuitem" class="ctp-ph" data-k="next"${i === L.length - 1 ? ' disabled' : ''}>Next task</button>` : '')
|
|
442
480
|
+ (full && jurlOf(s) ? `<a role="menuitem" class="ctp-ph" href="${esc(jurlOf(s))}" target="_blank" rel="noopener">Open in Jira${jkeyOf(s) ? ' · ' + esc(jkeyOf(s)) : ''}</a>` : '')
|
|
@@ -449,7 +487,10 @@ function moreMenu(btn) {
|
|
|
449
487
|
const x = e.target.closest('[data-k]'); if (!x) return;
|
|
450
488
|
e.stopPropagation(); m.remove(); btn.setAttribute('aria-expanded', 'false');
|
|
451
489
|
if (x.dataset.k === 'kind') kindOf(!s.t.milestone);
|
|
490
|
+
else if (x.dataset.k === 'link' && j && !linkPath({ kind: 'task', id: s.uid })) copyText(jurlOf(s), 'Link copied.');
|
|
452
491
|
else if (x.dataset.k === 'link') copyLink({ kind: s.t.milestone ? 'milestone' : 'task', id: s.uid, ws: s.ctx.ws || '' });
|
|
492
|
+
else if (x.dataset.k === 'text') copyText(ticketText(s), 'Copied as text.');
|
|
493
|
+
else if (x.dataset.k === 'jread') { s.ctx.refresh(); if (s.ctx.toast) s.ctx.toast('PMOS is reading Jira again.'); }
|
|
453
494
|
else if (x.dataset.k === 'arch') s.card.setStatus('Archived');
|
|
454
495
|
else if (x.dataset.k === 'move') s.card.open('move');
|
|
455
496
|
else if (x.dataset.k === 'prev' || x.dataset.k === 'next') { const L2 = s.ctx.list ? s.ctx.list() : [], k = L2.indexOf(s.uid) + (x.dataset.k === 'prev' ? -1 : 1); if (k >= 0 && k < L2.length) show(L2[k]); }
|
|
@@ -457,6 +498,15 @@ function moreMenu(btn) {
|
|
|
457
498
|
});
|
|
458
499
|
m.addEventListener('keydown', (e) => { if (e.key === 'Escape') { e.stopPropagation(); m.remove(); btn.setAttribute('aria-expanded', 'false'); btn.focus(); } });
|
|
459
500
|
}
|
|
501
|
+
/** A ticket as text (the ticket view's Copy as text): the key and title, Jira's status, the assignee, the sprint and points, what blocks it, the link. */
|
|
502
|
+
function ticketText(s) {
|
|
503
|
+
const t = s.t, tk = s.tk || {}, pts = t.estimate !== '' && t.estimate != null ? t.estimate + (String(t.estimate) === '1' ? ' point' : ' points') : '';
|
|
504
|
+
return [t.jira.key + ' ' + t.title, [t.jira.status || t.status, t.owner, t.sprint, pts].filter(Boolean).join(' · '), tk.blocked ? 'Blocked: ' + (tk.reason || 'flagged in Jira') : '', jurlOf(s)].filter(Boolean).join('\n');
|
|
505
|
+
}
|
|
506
|
+
function copyText(text, said) {
|
|
507
|
+
const say = (m) => (S && S.ctx.toast ? S.ctx.toast(m) : undefined);
|
|
508
|
+
try { navigator.clipboard.writeText(text).then(() => say(said), () => say('This browser did not allow the copy.')); } catch { say('This browser did not allow the copy.'); }
|
|
509
|
+
}
|
|
460
510
|
/* Delete (Wawan, 2026-11-19: "where is delete task?"): a task added by mistake goes, the same write as the Board's trash
|
|
461
511
|
* (POST /api/boards/tasks/delete); Undo is POST /api/boards/tasks/restore. Archive stays for work that stopped. */
|
|
462
512
|
async function delTask(s) {
|
|
@@ -1576,13 +1576,16 @@ const bkApi = () => ({
|
|
|
1576
1576
|
// a row's name: a Jira ticket opens in its initiative's ticket view or its Jira page; a PMOS task in the small task popup
|
|
1577
1577
|
openTask: (t, from) => {
|
|
1578
1578
|
const r = (M.rows || []).find((x) => x.id === t.ini && x.track && (x.ws || M.board.ws) === t.ws);
|
|
1579
|
-
|
|
1580
|
-
//
|
|
1581
|
-
// ↑ ↓ step through the PMOS rows of the same board in the list as drawn
|
|
1579
|
+
// every task opens the one-column task detail (pm/cozy-task-pop.js full mode, task-detail-every-task, Wawan 2026-11-24: "why Jira task
|
|
1580
|
+
// details different with the pmos task details? make it same."): a PMOS task and a Jira ticket alike; a ticket the board's items do not
|
|
1581
|
+
// hold keeps its ticket view or its Jira page. ↑ ↓ step through the PMOS rows of the same board in the list as drawn; on close the row is lit
|
|
1582
|
+
const jira = t.src === 'jira';
|
|
1583
|
+
const away = () => { if (r && (r.track.tickets || []).some((k) => k.key === t.key)) openTicket(r.key, t.key, from); else if (t.url) window.open(t.url, '_blank', 'noopener'); else say('Open ' + t.key + ' in Jira.'); };
|
|
1582
1584
|
const rowEl = (u) => document.querySelector(`[data-bkopen="${window.CSS.escape(u)}"]`)?.closest('[role="row"]');
|
|
1583
1585
|
const list = () => [...document.querySelectorAll('.bk [data-bkopen]')].map((e) => e.dataset.bkopen.split('|'))
|
|
1584
1586
|
.filter(([w, b]) => w === t.ws && b === t.board).map((p) => p.slice(2).join('|')).filter((id) => !/^[A-Z][A-Z0-9]+-\d+$/.test(id));
|
|
1585
|
-
import('./cozy-task-pop.js').then((TP) => TP.openTask(t.id, {
|
|
1587
|
+
import('./cozy-task-pop.js').then((TP) => TP.openTask(jira ? t.key : t.id, {
|
|
1588
|
+
full: true, path: r ? [r.title] : [], iniCrumb: !!r, missing: jira ? away : null, refresh: jira && M.jira ? () => refreshJira(null) : null,
|
|
1586
1589
|
ws: t.ws, board: t.board, ini: t.ini || '', pmPost, toast: (m, undo) => say(m, undo), onChange: () => load(), list,
|
|
1587
1590
|
iniTitle: (id) => ((M.rows || []).find((x) => x.id === id) || {}).title || '',
|
|
1588
1591
|
owners: () => [...new Set((M.rows || []).flatMap((x) => (x.tasks || []).map((q) => q.owner)).filter(Boolean))],
|
|
@@ -45,7 +45,8 @@ async function openFull(o) {
|
|
|
45
45
|
const m = s && s.state === 'ready' ? s.model : null;
|
|
46
46
|
const ws = o.ws || (m && m.board && m.board.ws) || '', board = o.board || (m && m.board && m.board.id) || '';
|
|
47
47
|
const row = m ? findTask(m, o.key) : null;
|
|
48
|
-
|
|
48
|
+
// a Jira ticket opens in the same one-column task detail (task-detail-every-task); one the board's items do not hold: the ticket Viewer
|
|
49
|
+
const jira = !!(row && cardTask(m, row).jira);
|
|
49
50
|
const product = SC && SC.productName ? SC.productName(ws, (m && m.board && m.board.name) || '') : '';
|
|
50
51
|
TP.openTask(uid, {
|
|
51
52
|
full: true, ws, board, ini: o.ini, pmPost: (p, b) => pmPost(p, b), toast: toastUndo,
|
|
@@ -54,6 +55,7 @@ async function openFull(o) {
|
|
|
54
55
|
row: () => (row ? { ...row, uid, board, ini: o.ini } : null),
|
|
55
56
|
rename: o.rename && typeof o.rename.save === 'function' ? (raw, title) => o.rename.save(title, {}) : null,
|
|
56
57
|
onChange: () => cache.clear(),
|
|
58
|
+
missing: jira ? () => openWorkItem({ ...o, full: false }) : null,
|
|
57
59
|
openIni: (id) => openWorkItem({ kind: 'initiative', id, title: id === o.ini && m ? m.title : '', ws: o.ws, board: o.board }),
|
|
58
60
|
// the chat about the task itself (bug 2026-11-24), read in from what the popup shows; with the one popup open, cozy-task-pop.js moved it already
|
|
59
61
|
chat: (about) => import('./page-chat.js').then((PC) => {
|
|
@@ -70,6 +70,18 @@ function ticketHtml(m) {
|
|
|
70
70
|
export async function openTicket(o) {
|
|
71
71
|
const { ws, board, initiative, ref } = o || {};
|
|
72
72
|
if (!ref) return null;
|
|
73
|
+
// a ticket the board's items hold opens in the one-column task detail, the same as a PMOS task (task-detail-every-task, Wawan 2026-11-24:
|
|
74
|
+
// "make it same"); a draft ticket or one on no board keeps this Viewer
|
|
75
|
+
if (board && !o.view) {
|
|
76
|
+
const TP = await import('./cozy-task-pop.js').catch(() => null);
|
|
77
|
+
if (TP) {
|
|
78
|
+
const { toastUndo } = await import('./task-card.js');
|
|
79
|
+
TP.openTask(ref, { full: true, ws: ws || '', board, ini: initiative || '', path: [initiative || ''].filter(Boolean), iniCrumb: !!initiative,
|
|
80
|
+
pmPost: (p, body) => import('./http.js').then((H) => H.pmPost(p, body)), toast: (m, undo) => toastUndo(m, undo),
|
|
81
|
+
openRef: (k) => openTicket({ ws, board, initiative, ref: k }), missing: () => { openTicket({ ...o, view: true }); } });
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
73
85
|
const TV = await import('./tk-view.js');
|
|
74
86
|
const draw = async (el) => {
|
|
75
87
|
el.innerHTML = '<div class="tkv"><p class="tkv-q">Reading the ticket</p></div>';
|
|
@@ -64,14 +64,15 @@ export function taskOf(row, extra = {}) {
|
|
|
64
64
|
const r = row || {}, jira = r.src === 'jira' || (r.pmos === false && /^Jira/.test(r.src || ''));
|
|
65
65
|
return {
|
|
66
66
|
uid: r.uid || '', key: r.key && /^task:/.test(r.key) ? r.key : 'task:' + (r.uid || r.key || ''), title: r.title || '', status: r.status || r.state || 'To do',
|
|
67
|
-
start: r.start || '', due: r.end || r.due || '', owner: r.owner || '', notes: r.notes || '', ini: r.ini || extra.ini || '',
|
|
67
|
+
start: r.start || '', due: r.end || r.due || '', owner: r.owner || (jira ? r.assignee || '' : ''), notes: r.notes || '', ini: r.ini || extra.ini || '',
|
|
68
68
|
iniTitle: extra.iniTitle || '', group: extra.group != null ? extra.group : '', board: r.board || extra.board || '',
|
|
69
69
|
section: typeof r.section === 'string' ? r.section : '', milestone: !!r.milestone, wbs: r.wbs && (r.wbs.title || r.wbs.id) ? { id: r.wbs.id || '', title: r.wbs.title || r.wbs.id } : null,
|
|
70
|
-
|
|
70
|
+
// a Jira ticket (task-detail-every-task): its link and Jira's own status name, as the board's items carry them (Jira owns both)
|
|
71
|
+
jira: jira ? { key: r.ref || r.key || r.uid || '', readAt: r.readAt || extra.readAt || '', url: r.url || '', status: r.jiraStatus || '' } : null,
|
|
71
72
|
// the task's description (initiative task-descriptions): its words, who wrote the last one ('pmos' | 'you') and PMOS's sources
|
|
72
73
|
description: typeof r.description === 'string' ? r.description : '', descBy: r.descBy || '', descSources: Array.isArray(r.descSources) ? r.descSources : [],
|
|
73
74
|
// the chip row's fields (task-detail-one-column): carried only as the row has them; the chips show the ones with a value
|
|
74
|
-
priority: r.priority || '', sprint: r.sprint || '', estimate: r.estimate != null ? r.estimate : '', labels: r.labels || '', reviewer: r.reviewer || '',
|
|
75
|
+
priority: r.priority || '', sprint: r.sprint || '', estimate: r.estimate != null ? r.estimate : jira && r.points != null ? r.points : '', labels: r.labels || '', reviewer: r.reviewer || '',
|
|
75
76
|
doneTest: r.doneTest || r.done_test || '', change: r.change || r.pr || '', moves: r.moves || '', parent: r.parent || '',
|
|
76
77
|
comments: Array.isArray(r.comments) ? r.comments : [],
|
|
77
78
|
};
|
|
@@ -186,7 +187,7 @@ export function fieldChips(t, o = {}) {
|
|
|
186
187
|
if (sec) F.stage = { label: 'Stage', value: sec, press: 'move' };
|
|
187
188
|
if (t.sprint) F.sprint = { label: 'Sprint', value: String(t.sprint) };
|
|
188
189
|
if (t.priority) F.priority = { label: 'Priority', value: String(t.priority), press: t.jira ? '' : 'prio' };
|
|
189
|
-
if (t.estimate != null && t.estimate !== '') F.estimate = { label: 'Estimate', value: String(t.estimate) };
|
|
190
|
+
if (t.estimate != null && t.estimate !== '') F.estimate = { label: t.jira ? 'Points' : 'Estimate', value: String(t.estimate) }; // a Jira ticket's estimate is its points
|
|
190
191
|
const labels = listOf(t.labels);
|
|
191
192
|
if (labels.length) F.labels = { label: 'Labels', value: labels.join(', ') };
|
|
192
193
|
if (t.reviewer) { const r = ownerLabel(t.reviewer); if (r.name) F.reviewer = { label: 'Reviewer', value: r.name }; }
|
|
@@ -198,7 +199,10 @@ export function fieldChips(t, o = {}) {
|
|
|
198
199
|
if (t.group) F.group = { label: 'Group', value: t.group, press: 'move' };
|
|
199
200
|
if (t.wbs && t.wbs.title) F.wbs = { label: 'Under', value: t.wbs.title };
|
|
200
201
|
if (t.milestone) F.milestone = { label: 'Milestone', value: 'Milestone', press: t.jira ? '' : 'ms' };
|
|
201
|
-
|
|
202
|
+
// a Jira ticket (task-detail-every-task): its key, Jira's own status and the link lead the row, in every kind; Jira owns them
|
|
203
|
+
if (t.jira && t.jira.key) F.jira = { label: 'Jira', value: t.jira.key + (t.jira.status ? ' · ' + t.jira.status : ''), href: t.jira.url || '' };
|
|
204
|
+
const order = t.jira ? ['jira'].concat(KIND_ORDER[kind].filter((k) => k !== 'jira')) : KIND_ORDER[kind];
|
|
205
|
+
return order.filter((k) => F[k]).map((k) => ({ key: k, ...F[k] }));
|
|
202
206
|
}
|
|
203
207
|
const PRIOS = ['P1', 'P2', 'P3'];
|
|
204
208
|
const AGENT_GLYPH = '<path d="M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z"/>';
|
|
@@ -217,8 +221,8 @@ function chipsHtml(t, o = {}) {
|
|
|
217
221
|
.concat(t.owner ? [{ sep: true }, { label: 'No owner', attr: 'data-tkc-owner=""' }] : []),
|
|
218
222
|
`<form class="tkc-new" data-tkc-form="owner"><input type="text" maxlength="80" placeholder="Someone else" aria-label="Owner's name" autocomplete="off"></form>`) : '';
|
|
219
223
|
const owner = anc(ow.name
|
|
220
|
-
? `<button type="button" class="tkc-chip own${ow.agent ? ' agent' : ''}${oOpen ? ' open' : ''}" data-tkc="owner" aria-label="Owner: ${esc(ow.name)}${t.jira ? '' : '. Change'}" title="Owner" aria-expanded="${oOpen}"${t.jira ? ' disabled' : ''}>${ow.agent ? ico(AGENT_GLYPH, 14) : `<span class="av">${esc(ow.initials)}</span>`}<span>${esc(ow.name)}</span></button>`
|
|
221
|
-
: `<button type="button" class="tkc-chip own ghost${oOpen ? ' open' : ''}" data-tkc="owner" aria-label="Choose an owner" title="Owner" aria-expanded="${oOpen}"${t.jira ? ' disabled' : ''}>${ico(I.user, 14)}<span
|
|
224
|
+
? `<button type="button" class="tkc-chip own${ow.agent ? ' agent' : ''}${oOpen ? ' open' : ''}" data-tkc="owner" aria-label="${t.jira ? 'Assignee' : 'Owner'}: ${esc(ow.name)}${t.jira ? '. Jira owns it' : '. Change'}" title="${t.jira ? 'Assignee' : 'Owner'}" aria-expanded="${oOpen}"${t.jira ? ' disabled' : ''}>${ow.agent ? ico(AGENT_GLYPH, 14) : `<span class="av">${esc(ow.initials)}</span>`}<span>${esc(ow.name)}</span></button>`
|
|
225
|
+
: `<button type="button" class="tkc-chip own ghost${oOpen ? ' open' : ''}" data-tkc="owner" aria-label="${t.jira ? 'No assignee. Jira owns it' : 'Choose an owner'}" title="${t.jira ? 'Assignee' : 'Owner'}" aria-expanded="${oOpen}"${t.jira ? ' disabled' : ''}>${ico(I.user, 14)}<span>${t.jira ? 'Unassigned' : 'No owner'}</span></button>`, ownerPop);
|
|
222
226
|
// Start → Due on the one calendar (the agreed task-dates picker); the late text in amber
|
|
223
227
|
const dl = dueLine(t, now), dOpen = open === 'dates';
|
|
224
228
|
const dates = anc(`<button type="button" class="tkc-chip dt${dl.late ? ' late' : ''}${dl.none ? ' ghost' : ''}${dOpen ? ' open' : ''}" data-tkc="dates" aria-label="${dl.none ? 'Add dates' : esc(dl.text) + (dl.lateText ? ', ' + esc(dl.lateText) : '') + '. Change the dates'}" title="Start and due" aria-expanded="${dOpen}">${ico(I.cal, 14)}<span>${dl.none ? 'Dates' : esc(dl.text)}${dl.lateText ? ` · ${esc(dl.lateText)}` : ''}</span></button>`,
|
|
@@ -54,9 +54,11 @@ export function standsOf(t, o = {}) {
|
|
|
54
54
|
// only what no chip says (task-detail-one-column): the risk and the next move. Status, owner and the dates are chips above it
|
|
55
55
|
const now = o.now == null ? Date.now() : o.now, out = [], T = today(now), w = who(t.owner);
|
|
56
56
|
const subs = o.subs || [], openSubs = subs.filter((x) => !done(x)).length;
|
|
57
|
+
// a Jira ticket Jira flags as blocked (task-detail-every-task): what blocks it and what that holds up lead (tk-view.js tkSummary)
|
|
58
|
+
if (o.blocked) out.push(esc(String(o.blocked.line || 'Blocked').replace(/\.$/, '')) + '.' + (o.blocked.text ? ' ' + esc(o.blocked.text) : ''));
|
|
57
59
|
if (done(t)) { if (openSubs) out.push(`${openSubs === 1 ? '1 subtask is' : openSubs + ' subtasks are'} still open.`); return out; }
|
|
58
60
|
const d = day(t.due), s = day(t.start), st = String(t.status || 'To do');
|
|
59
|
-
if (!w) out.push('Nobody has it yet, so nobody is moving it.');
|
|
61
|
+
if (!w) out.push(t.jira ? 'Nobody in Jira has it yet, so nobody is moving it.' : 'Nobody has it yet, so nobody is moving it.');
|
|
60
62
|
if (d != null) {
|
|
61
63
|
const n = Math.round((d - T) / DAY);
|
|
62
64
|
if (n < 0) out.push(`It is ${days(-n)} late${openSubs ? `, with ${openSubs === 1 ? '1 subtask' : openSubs + ' subtasks'} open` : ''}.`);
|
|
@@ -151,6 +153,40 @@ export function descriptionHtml(t, o = {}) {
|
|
|
151
153
|
return `<section class="pm-block ctp-desc" aria-label="Description">${head(edit)}${body}${by}</section>`;
|
|
152
154
|
}
|
|
153
155
|
|
|
156
|
+
/* ── A Jira ticket (task-detail-every-task): PMOS's copy of its description, its acceptance criteria and its Jira subtasks, read only ───── */
|
|
157
|
+
/** Ticket text (markdown-ish) as safe html: paragraphs, bullets and sub-headings. Every word is escaped, so nothing in it runs. */
|
|
158
|
+
export function ticketTextHtml(text) {
|
|
159
|
+
const out = []; let list = [];
|
|
160
|
+
const flush = () => { if (list.length) { out.push('<ul class="ctp-done">' + list.map((x) => '<li>' + esc(x) + '</li>').join('') + '</ul>'); list = []; } };
|
|
161
|
+
for (const raw of String(text || '').split('\n')) {
|
|
162
|
+
const l = raw.trim(), b = /^[-*]\s+(?:\[[ xX]\]\s+)?(.*)$/.exec(l), h = /^#{1,6}\s+(.*)$/.exec(l);
|
|
163
|
+
if (b) { list.push(b[1]); continue; }
|
|
164
|
+
flush();
|
|
165
|
+
if (h) out.push('<p class="pm-h-sm ctp-dh">' + esc(h[1]) + '</p>');
|
|
166
|
+
else if (l) out.push('<p class="ctp-say">' + esc(l) + '</p>');
|
|
167
|
+
}
|
|
168
|
+
flush();
|
|
169
|
+
return out.join('');
|
|
170
|
+
}
|
|
171
|
+
/** tk: tk-view.js ticketOf. Empty when the record holds no text and no criteria (zero is silence). */
|
|
172
|
+
export function ticketDescHtml(tk) {
|
|
173
|
+
if (!tk || (!tk.description && !(tk.acceptance || []).length)) return '';
|
|
174
|
+
const src = `<span class="pm-meta">${tk.inJira === false ? 'Draft, not in Jira yet' : 'PMOS\'s copy, Jira may differ'}</span>`;
|
|
175
|
+
const ac = (tk.acceptance || []).length ? `<p class="pm-h-sm ctp-dh">Acceptance criteria</p><ul class="ctp-done">${tk.acceptance.map((x) => `<li>${esc(x)}</li>`).join('')}</ul>` : '';
|
|
176
|
+
return `<section class="pm-block ctp-desc" aria-label="Description"><div class="head"><h3 class="pm-h-sm">Description</h3>${src}</div>${ticketTextHtml(tk.description)}${ac}</section>`;
|
|
177
|
+
}
|
|
178
|
+
/** The ticket's Jira subtasks: "1 of 2", a bar, one read-only row each; with only a count, the count and where the list is. */
|
|
179
|
+
export function ticketSubsHtml(tk) {
|
|
180
|
+
const sub = tk && tk.subtasks; if (!sub || !sub.total) return '';
|
|
181
|
+
const pct = Math.round((sub.done / sub.total) * 100);
|
|
182
|
+
const head = `<div class="head"><h3 class="pm-h-sm">Subtasks</h3><span class="pm-meta">${sub.done} of ${sub.total}</span></div>`;
|
|
183
|
+
const bar = `<progress class="ctp-sbar" aria-label="Subtasks done" max="${sub.total}" value="${sub.done}">${pct}%</progress>`;
|
|
184
|
+
const rows = sub.items && sub.items.length
|
|
185
|
+
? `<div class="rows">${sub.items.map((y) => `<div class="pm-li ctp-sub${y.done ? ' on' : ''}">${SV(y.done ? 'M12 4a8 8 0 1 0 0 16 8 8 0 1 0 0-16zM8.5 12.2l2.4 2.4 4.6-5' : 'M12 4a8 8 0 1 0 0 16 8 8 0 1 0 0-16z')}<span class="txt"><span class="t">${esc(y.name || y.summary || '')}</span><span class="w">Jira owns it</span></span></div>`).join('')}</div>`
|
|
186
|
+
: `<p class="pm-meta">${sub.done} done, ${sub.total - sub.done} open. The Jira read holds the count, not the list: Open in Jira has them.</p>`;
|
|
187
|
+
return `<section class="pm-block list ctp-subs" aria-label="Subtasks">${head}${bar}${rows}</section>`;
|
|
188
|
+
}
|
|
189
|
+
|
|
154
190
|
/* ── Linked ───────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
155
191
|
const URL_RE = /\bhttps?:\/\/[^\s<>"')\]]+/g;
|
|
156
192
|
const shortUrl = (u) => { try { const x = new URL(u); const p = x.pathname.replace(/\/$/, ''); return x.host.replace(/^www\./, '') + (p.length > 32 ? p.slice(0, 31) + '…' : p); } catch { return u.slice(0, 48); } };
|
|
@@ -163,6 +199,11 @@ export function linkedOf(t, o = {}) {
|
|
|
163
199
|
for (const x of o.blocks || []) out.push({ kind: 'task', title: x.title || x.uid, sub: 'Blocks', open: x.uid });
|
|
164
200
|
if (o.parent) out.push({ kind: 'task', title: o.parent.title || o.parent.uid, sub: 'Subtask of', open: o.parent.uid });
|
|
165
201
|
if (t.jira && t.jira.key) out.push({ kind: 'jira', title: t.jira.key, sub: 'Jira ticket' + (t.jira.readAt ? ' · read ' + dm(t.jira.readAt) : ''), href: t.jira.url || '' });
|
|
202
|
+
// the ticket's own Jira links, its epic and the PRD it was drafted from (task-detail-every-task; the ticket view's Linked fold)
|
|
203
|
+
const tk = o.ticket || null;
|
|
204
|
+
if (tk && tk.epic && tk.epic.key) out.push({ kind: 'jira', title: tk.epic.key + (tk.epic.title ? ' ' + tk.epic.title : ''), sub: 'Epic', tkref: tk.epic.key });
|
|
205
|
+
for (const l of (tk && tk.links) || []) out.push({ kind: 'jira', title: (l.key || l.ref || '') + (l.title ? ' ' + l.title : ''), sub: l.rel || 'Linked', tkref: l.open ? l.ref || l.key : '' });
|
|
206
|
+
if (tk && tk.prd) out.push({ kind: 'url', title: tk.prd, sub: 'Drafted from' });
|
|
166
207
|
const seen = new Set();
|
|
167
208
|
const ch = t.change && (t.change.url || (typeof t.change === 'string' && /^https?:/.test(t.change) ? t.change : ''));
|
|
168
209
|
if (ch) { seen.add(ch); const m = PR_RE.exec(ch); out.push({ kind: 'change', title: m ? 'PR #' + m[1] : shortUrl(ch), sub: 'Change', href: ch }); }
|
|
@@ -180,7 +221,8 @@ export function linkedHtml(t, o = {}) {
|
|
|
180
221
|
const row = (x) => {
|
|
181
222
|
const inner = `${icon(x.kind)}<span class="txt"><span class="w">${esc(x.sub)}</span><span class="t">${esc(x.title)}</span></span>`;
|
|
182
223
|
return x.href ? `<a class="pm-li" href="${esc(x.href)}" target="_blank" rel="noopener">${inner}</a>`
|
|
183
|
-
: x.open ? `<button type="button" class="pm-li" data-ctp-open="${esc(x.open)}">${inner}</button>`
|
|
224
|
+
: x.open ? `<button type="button" class="pm-li" data-ctp-open="${esc(x.open)}">${inner}</button>`
|
|
225
|
+
: x.tkref ? `<button type="button" class="pm-li" data-ctp-tkref="${esc(x.tkref)}">${inner}</button>` : `<div class="pm-li">${inner}</div>`;
|
|
184
226
|
};
|
|
185
227
|
return `<section class="pm-block list" aria-label="Linked"><div class="head"><h3 class="pm-h-sm">Linked</h3><span class="pm-meta">${L.length}</span></div><div class="rows">${L.map(row).join('')}</div></section>`;
|
|
186
228
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Every task opens the one-column task detail, Jira tickets too (task-detail-every-task, done test E1-E5): the board items' Jira facts, taskOf and fieldChips for a ticket, vw-ds.js ticket blocks, the openers' wiring. Node only, no browser.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"task-detail-every-task.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"task-detail-every-task.test.js": 2
|
|
8
|
+
}
|
|
9
|
+
}
|