create-pmos 0.664.0 → 0.665.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 +28 -22
- 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/briefing-premium-insights-test.js +30 -2
- package/workspace/changelog.json +27 -8
- package/workspace/guide/layout.md +8 -0
- package/workspace/intelligence-gaps-ui-test.js +5 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/cozy-task-pop.css +21 -1
- package/workspace/public/pm/cozy-task-pop.js +45 -9
- package/workspace/public/pm/premium-vw-item.js +30 -0
- package/workspace/public/pm/task-card.js +5 -0
- package/workspace/public/pm/vw-ds.js +100 -0
- package/workspace/test-lists/viewer-ds-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.665.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": {
|
|
@@ -34,10 +34,35 @@
|
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
36
|
{
|
|
37
|
-
"v": "0.
|
|
38
|
-
"at": "2026-11-22T04:
|
|
37
|
+
"v": "0.665.0",
|
|
38
|
+
"at": "2026-11-22T04:21:42.729Z",
|
|
39
39
|
"f": 4,
|
|
40
40
|
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1448,
|
|
43
|
+
"t": "Check launch readiness before go-live",
|
|
44
|
+
"s": "Check launch readiness before go-live",
|
|
45
|
+
"k": "new"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"n": 1452,
|
|
49
|
+
"t": "A task opened from a place is the full popup from design system blocks",
|
|
50
|
+
"s": "A task opened from a place is the full popup from design system blocks",
|
|
51
|
+
"k": "new"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"v": "0.663.0",
|
|
57
|
+
"at": "2026-11-22T04:09:31.042Z",
|
|
58
|
+
"f": 4,
|
|
59
|
+
"prs": [
|
|
60
|
+
{
|
|
61
|
+
"n": 1449,
|
|
62
|
+
"t": "Rebuild the Intelligence page from Komorebi blocks",
|
|
63
|
+
"s": "Rebuild the Intelligence page from Komorebi blocks",
|
|
64
|
+
"k": "new"
|
|
65
|
+
},
|
|
41
66
|
{
|
|
42
67
|
"n": 1442,
|
|
43
68
|
"t": "Routine is built from the design system's blocks",
|
|
@@ -49,12 +74,6 @@
|
|
|
49
74
|
"t": "A design critic reads each design against every standing rule before the PM sees it",
|
|
50
75
|
"s": "A design critic reads each design against every standing rule before the PM sees it",
|
|
51
76
|
"k": "new"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"n": 1448,
|
|
55
|
-
"t": "Check launch readiness before go-live",
|
|
56
|
-
"s": "Check launch readiness before go-live",
|
|
57
|
-
"k": "new"
|
|
58
77
|
}
|
|
59
78
|
]
|
|
60
79
|
},
|
|
@@ -321,19 +340,6 @@
|
|
|
321
340
|
"k": "fix"
|
|
322
341
|
}
|
|
323
342
|
]
|
|
324
|
-
},
|
|
325
|
-
{
|
|
326
|
-
"v": "0.633.0",
|
|
327
|
-
"at": "2026-11-19T13:29:42.454Z",
|
|
328
|
-
"f": 4,
|
|
329
|
-
"prs": [
|
|
330
|
-
{
|
|
331
|
-
"n": 1415,
|
|
332
|
-
"t": "Build the agreed phone design (Ph2 boards)",
|
|
333
|
-
"s": "Build the agreed phone design (Ph2 boards)",
|
|
334
|
-
"k": "new"
|
|
335
|
-
}
|
|
336
|
-
]
|
|
337
343
|
}
|
|
338
344
|
]
|
|
339
345
|
}
|
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-22T04:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T04:21:39Z"}
|
|
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-22T04:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T04:21:39Z"}
|
|
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-22T04:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T04:21:39Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -63,7 +63,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
|
|
|
63
63
|
await T.waitForServer(BASE);
|
|
64
64
|
browser = classicBoard(await chromium.launch({ executablePath: exe }));
|
|
65
65
|
|
|
66
|
-
const open = async ({ w = 1440, h = 900, theme = 'light', model = mk(), answers = null, bm = BMR, q = '', pick = null } = {}) => {
|
|
66
|
+
const open = async ({ w = 1440, h = 900, theme = 'light', model = mk(), answers = null, bm = BMR, q = '', pick = null, tab = 'goals' } = {}) => {
|
|
67
67
|
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
68
68
|
const page = await ctx.newPage();
|
|
69
69
|
let current = model, calls = 0; const errors = [], posts = [];
|
|
@@ -78,7 +78,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
|
|
|
78
78
|
if (r.request().method() === 'POST') { pk.on = JSON.parse(r.request().postData() || '{}').on; pk.posts.push(pk.on); }
|
|
79
79
|
r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, all: false, chosen: true, products: reg.map((x, i) => ({ ...x, home: false, primary: !i, initials: null, on: pk.on.includes(x.ws) })) }) });
|
|
80
80
|
});
|
|
81
|
-
await page.goto(BASE + '/premium-intelligence.html?theme=' + theme + '&tab=
|
|
81
|
+
await page.goto(BASE + '/premium-intelligence.html?theme=' + theme + (tab ? '&tab=' + tab : '') + q); // key results live on Goals: ?tab=goals shows them here (intelligence-ds-page)
|
|
82
82
|
const up = await until(() => page.evaluate(() => document.querySelectorAll('#goalTbl .ins-row').length > 0 || /could not be read/.test(document.querySelector('#brief').textContent) || !!document.querySelector('#goalTbl .ins-empty')), 20000);
|
|
83
83
|
return { ctx, page, errors, posts, up, pk, calls: () => calls, setModel: (m) => { current = m; } };
|
|
84
84
|
};
|
|
@@ -292,6 +292,34 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
|
|
|
292
292
|
ok('I9 no demo label, and the page makes no write request on its own', !(await p.evaluate(() => /demo/i.test(document.querySelector('main.stage').textContent))) && A.posts.length === 0, A.posts.join());
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
+
/* C4 + C6 (intelligence-ds-page): the default desk view, with no ?tab=goals. Key results step aside; Delivery trends is its own block with
|
|
296
|
+
* Choose tiles; a phone keeps its goal cards. */
|
|
297
|
+
{ const D = await open({ tab: '' }); const dp = D.page;
|
|
298
|
+
await until(() => dp.evaluate(() => !!document.querySelector('#trendBox:not([hidden]) #bmBody [data-tile]')), 10000);
|
|
299
|
+
const dv = await dp.evaluate(() => { const tb = document.querySelector('#trendBox'), g = document.querySelector('#pGoals'); return { krs: document.body.classList.contains('ins-krs'), goals: getComputedStyle(g).display, block: tb.matches('section.pm-block') && !tb.hidden && tb.parentElement === g.parentElement, inGoals: !!g.querySelector('#trendBox'), h: (tb.querySelector('#hTr') || {}).textContent, tiles: tb.querySelectorAll('#bmBody [data-tile]').length, chooser: (tb.querySelector('#tileB') || { getAttribute: () => '' }).getAttribute('aria-label'), menu: !!document.querySelector('#tileMenu') }; });
|
|
300
|
+
ok('C6 on a desk the default view shows no key results: the table is in the page but hidden, and ?tab=goals is what shows it', !dv.krs && dv.goals === 'none', JSON.stringify(dv));
|
|
301
|
+
ok('C4 on the default view Delivery trends is a pm-block of its own (not inside key results), with its tiles and Choose tiles, its menu shut', dv.block && !dv.inGoals && dv.h === 'Delivery trends' && dv.tiles >= 3 && dv.chooser === 'Choose tiles' && !dv.menu, JSON.stringify(dv));
|
|
302
|
+
await dp.click('#tileB');
|
|
303
|
+
const mn = await until(() => dp.evaluate(() => { const m = document.querySelector('#tileMenu'); return m ? [...m.querySelectorAll('.pm-switch[role="switch"]')].map((s) => s.dataset.tileon + ':' + s.getAttribute('aria-checked')) : null; }), 3000);
|
|
304
|
+
ok('C4 Choose tiles opens a menu with one switch per tile, all on', !!mn && mn.length === dv.tiles && mn.every((x) => /:true$/.test(x)), JSON.stringify(mn));
|
|
305
|
+
const k0 = mn && mn[0].split(':')[0];
|
|
306
|
+
await dp.click(`#tileMenu [data-tileon="${k0}"]`);
|
|
307
|
+
const off = await until(() => dp.evaluate((k) => !document.querySelector(`#bmBody [data-tile="${k}"]`) && document.querySelector(`#tileMenu [data-tileon="${k}"]`).getAttribute('aria-checked') === 'false', k0), 3000);
|
|
308
|
+
ok('C4 a switch turned off takes its tile out of the block', !!off, k0);
|
|
309
|
+
await dp.click(`#tileMenu [data-tileon="${k0}"]`);
|
|
310
|
+
ok('C4 turned on again, the tile comes back', !!(await until(() => dp.evaluate((k) => !!document.querySelector(`#bmBody [data-tile="${k}"]`), k0), 3000)));
|
|
311
|
+
await dp.click('#tileB');
|
|
312
|
+
await dp.click('#trendBox [data-tile="merges"]');
|
|
313
|
+
ok('C4 on the default view a tile press opens the tile in the Viewer', !!(await until(() => dp.evaluate(() => { const v = document.querySelector('#czViewer'); return v && !v.hidden && !!v.querySelector('[data-tgset]'); }), 3000)));
|
|
314
|
+
await dp.click('#czViewer [data-tgset]');
|
|
315
|
+
ok('C4 and its Set target opens the target popover over the tiles', !!(await until(() => dp.evaluate(() => !!document.querySelector('#tgPop')), 3000)));
|
|
316
|
+
ok('C4 no page error on the default view', D.errors.length === 0, D.errors.join(' | '));
|
|
317
|
+
await D.ctx.close();
|
|
318
|
+
const P = await open({ tab: '', w: 390, h: 844 });
|
|
319
|
+
const ph = await P.page.evaluate(() => ({ goals: getComputedStyle(document.querySelector('#pGoals')).display, cards: [...document.querySelectorAll('#goalCards .ins-card')].filter((c) => c.getBoundingClientRect().height > 0).map((c) => c.dataset.goal).join() }));
|
|
320
|
+
ok('C6 a phone keeps its goal cards on the default view (the phone page does not change)', ph.goals !== 'none' && ph.cards === 'krm-act,krm-up,krm-ttfc,krm-nps', JSON.stringify(ph));
|
|
321
|
+
await P.ctx.close(); }
|
|
322
|
+
|
|
295
323
|
/* D: New dashboard (AgInsNewDash), describe, the saved view, Edit chart (AgInsChart) and the pin */
|
|
296
324
|
{
|
|
297
325
|
const R = await open(), q = R.page, sent = [];
|
package/workspace/changelog.json
CHANGED
|
@@ -1,9 +1,34 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"v": "0.
|
|
4
|
-
"at": "2026-11-22T04:
|
|
3
|
+
"v": "0.665.0",
|
|
4
|
+
"at": "2026-11-22T04:21:42.729Z",
|
|
5
5
|
"f": 4,
|
|
6
6
|
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1448,
|
|
9
|
+
"t": "Check launch readiness before go-live",
|
|
10
|
+
"s": "Check launch readiness before go-live",
|
|
11
|
+
"k": "new"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"n": 1452,
|
|
15
|
+
"t": "A task opened from a place is the full popup from design system blocks",
|
|
16
|
+
"s": "A task opened from a place is the full popup from design system blocks",
|
|
17
|
+
"k": "new"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"v": "0.663.0",
|
|
23
|
+
"at": "2026-11-22T04:09:31.042Z",
|
|
24
|
+
"f": 4,
|
|
25
|
+
"prs": [
|
|
26
|
+
{
|
|
27
|
+
"n": 1449,
|
|
28
|
+
"t": "Rebuild the Intelligence page from Komorebi blocks",
|
|
29
|
+
"s": "Rebuild the Intelligence page from Komorebi blocks",
|
|
30
|
+
"k": "new"
|
|
31
|
+
},
|
|
7
32
|
{
|
|
8
33
|
"n": 1442,
|
|
9
34
|
"t": "Routine is built from the design system's blocks",
|
|
@@ -15,12 +40,6 @@
|
|
|
15
40
|
"t": "A design critic reads each design against every standing rule before the PM sees it",
|
|
16
41
|
"s": "A design critic reads each design against every standing rule before the PM sees it",
|
|
17
42
|
"k": "new"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"n": 1448,
|
|
21
|
-
"t": "Check launch readiness before go-live",
|
|
22
|
-
"s": "Check launch readiness before go-live",
|
|
23
|
-
"k": "new"
|
|
24
43
|
}
|
|
25
44
|
]
|
|
26
45
|
},
|
|
@@ -116,6 +116,14 @@ The Viewer shows one item: an initiative, a program, a task, a document, a meeti
|
|
|
116
116
|
- On a page drawn from the PMOS design system (Today, Home, an item on its own page), the parts inside the Viewer card follow the system too: a meeting, the calendar and a report use its corners, its buttons and its switches. A word button has a small corner, a switch looks like tabs, and a chip or a tag stays round.
|
|
117
117
|
- One item shows in one Viewer only. If an item is already open, opening it again (a row, a ⌘-click, Open beside) shows it in the Viewer it is in. It never opens a second copy.
|
|
118
118
|
|
|
119
|
+
### A task opened from a place
|
|
120
|
+
|
|
121
|
+
On a computer, a PMOS task you open from Events, Today, Goals or Search opens as one full popup, in the middle of the page. Home keeps its Viewer until Home is rebuilt, and a Jira ticket keeps the ticket Viewer.
|
|
122
|
+
|
|
123
|
+
- The top line has **Close**, the path (product › initiative › Jira key), the Jira chip, the chat button, ⋯ and ×. Press the initiative's name to open the initiative. One line under the name says Task or Milestone, who has it, when it is due and its stage.
|
|
124
|
+
- The left column has three blocks. **Where it stands** says who has it, its status, when it is due or how many days late it is, what waits on you and which initiative it moves. A task with no due date says so. **Linked** lists the initiative, the Jira ticket and each link in the notes; with nothing linked, the block does not show. **Activity** lists PMOS's kept changes, newest first: three, then **Earlier**. A change from the last 7 days has **Undo**.
|
|
125
|
+
- The right column is the task card: status, dates, owner, notes and every change you can make there, each with **Undo**.
|
|
126
|
+
|
|
119
127
|
## Work and its chat, in one popup
|
|
120
128
|
|
|
121
129
|
On a computer, an initiative you open from Home, Board or Intelligence opens in one popup over the page. The work is on the left and the chat about the same work is on the right. A thin dimmed edge of the page shows around it. Escape, × or a press on the edge closes it.
|
|
@@ -94,6 +94,11 @@ const WEEKLY = { view: 'view', weeks: 3, day: 'Mon', opens: 4 };
|
|
|
94
94
|
const s0 = await until(() => p.evaluate(() => { const m = document.querySelector('#insMv'); const b = document.querySelector('#insAct [data-mv="apply"]'); return m && !m.hidden && b ? { mv: m.textContent, label: b.getAttribute('aria-label'), text: b.textContent.trim(), solid: b.classList.contains('primary'), two: document.querySelector('#insHero').classList.contains('mv') } : null; }), 5000);
|
|
95
95
|
ok('S the drafted move is the expanded Suggestion under the finding (its label, then PMOS will …), with a primary ✓ that is icon-only', !!s0 && s0.mv.startsWith(MOVE.label) && s0.mv.includes('PMOS will' + MOVE.text) && s0.label === MOVE.label && !s0.text && s0.solid && s0.two, JSON.stringify(s0));
|
|
96
96
|
await shot(p, 'gap1-strip-move', '#insHero');
|
|
97
|
+
/* C2 (intelligence-ds-page): the expanded Suggestion's parts, in the board's order, and its three answers */
|
|
98
|
+
const sx = await p.evaluate(() => { const m = document.querySelector('#insMv'); return { cls: m.className, dt: [...m.querySelectorAll('dl > dt')].map((d) => d.textContent).join('|'), why: ((m.querySelector('dl > dt + dd') || {}).textContent || ''), src: (m.querySelector('dd.src') || {}).textContent || '', acts: [...m.querySelectorAll('#insAct > .pm-btn')].map((b) => b.getAttribute('aria-label') + ':' + (b.classList.contains('primary') ? 'p' : b.classList.contains('outline') ? 'o' : '-') + ':' + !!b.querySelector('svg') + ':' + !b.textContent.trim()).join('|'), chg: (m.querySelector('#insAct a.pm-btn') || {}).href || '' }; });
|
|
99
|
+
ok('C2 the move is a pm-sug x with Why, PMOS will, What changes and Based on, in that order', /\bpm-sug\b/.test(sx.cls) && /\bx\b/.test(sx.cls) && sx.dt === 'Why|PMOS will|What changes|Based on' && !!sx.why.trim() && !!sx.src.trim(), JSON.stringify(sx));
|
|
100
|
+
ok('C2 its answers are Change it first (pencil, opens a chat), Yes (primary ✓) and No (outline ✕), each icon-only', sx.acts === 'Change it first:-:true:true|' + MOVE.label + ':p:true:true|Not now:o:true:true' && /ask=insights/.test(sx.chg) && /Change%20this%20before|Change\+this\+before/.test(sx.chg), JSON.stringify(sx));
|
|
101
|
+
ok('C2 with a move, the reason is not said twice under the finding', (await p.evaluate(() => document.querySelector('#insWhy').textContent)) === '');
|
|
97
102
|
await p.click('#insAct [data-mv="apply"]');
|
|
98
103
|
await until(() => A.posts.some((x) => x.path === '/api/insight-moves/apply'), 3000);
|
|
99
104
|
const ap = A.posts.find((x) => x.path === '/api/insight-moves/apply');
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.665.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.665.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -45,10 +45,30 @@ button.ctp-cr:hover { text-decoration: underline; }
|
|
|
45
45
|
.ctp-sep { color: var(--cz-ink2); }
|
|
46
46
|
.ctp-th { display: flex; align-items: center; gap: var(--space-8); margin: 0 0 var(--space-12); }
|
|
47
47
|
.ctp-full .ctp-t { font-size: var(--fs-panel); }
|
|
48
|
-
.ctp-full .ctp-
|
|
48
|
+
.ctp-full .ctp-hx { max-width: 720px; }
|
|
49
49
|
.ctp-hx { margin: 0 0 var(--space-16); display: flex; flex-direction: column; gap: var(--space-12); }
|
|
50
50
|
.ctp-hx .pwd-facts { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--space-4) var(--space-12); margin: 0; }
|
|
51
51
|
.ctp-hx .pwd-facts dt { color: var(--cz-ink2); }
|
|
52
52
|
.ctp-hx .pwd-facts dd { margin: 0; }
|
|
53
53
|
.ctp-hx .grey { color: var(--cz-ink2); }
|
|
54
54
|
.ctp-hx .warn { color: var(--cz-late); }
|
|
55
|
+
|
|
56
|
+
/* viewer-ds-task (board ViewerDS): the full popup is main + side, built from Komorebi blocks (pm/vw-ds.js); here only their places.
|
|
57
|
+
* With no popup behind (a task opened from Today, Events, Goals or Search) it is centred and near full (ctp-solo). */
|
|
58
|
+
.ctp.ctp-full.ctp-solo { left: var(--space-24); top: var(--space-24); right: var(--space-24); bottom: var(--space-24); margin: 0 auto; max-width: 1280px; }
|
|
59
|
+
.ctp-full .ctp-th { margin-bottom: var(--space-4); }
|
|
60
|
+
.ctp-meta { margin: 0 0 var(--space-16); }
|
|
61
|
+
.ctp-g { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: var(--space-16); align-items: start; }
|
|
62
|
+
.ctp-main { display: flex; flex-direction: column; gap: var(--space-16); min-width: 0; }
|
|
63
|
+
.ctp-main > div:empty { display: none; }
|
|
64
|
+
.ctp-main .ctp-hx { margin: 0; }
|
|
65
|
+
.ctp-say { margin: 0; }
|
|
66
|
+
.ctp-side { position: sticky; top: 0; min-width: 0; }
|
|
67
|
+
.ctp-ad { flex: none; width: 52px; }
|
|
68
|
+
.ctp-main .pm-li { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; text-decoration: none; cursor: pointer; }
|
|
69
|
+
.ctp-main .pm-li:hover { background: var(--well); }
|
|
70
|
+
.ctp-main div.pm-li { cursor: default; }
|
|
71
|
+
@media (max-width: 900px) {
|
|
72
|
+
.ctp-g { grid-template-columns: minmax(0, 1fr); }
|
|
73
|
+
.ctp-side { position: static; order: -1; }
|
|
74
|
+
}
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* Every write is the PM's press, on the board's own routes. The UI says PMOS, never Claude; icon-only buttons carry aria-label. */
|
|
19
19
|
import { taskOf, mountCard, boardSaver, cardStyle, historyFor } from './task-card.js';
|
|
20
20
|
import * as SWN from './cozy-status-when.js';
|
|
21
|
+
import * as VD from './vw-ds.js'; // viewer-ds-task (board ViewerDS): the full popup's Where it stands, Linked and Activity blocks
|
|
21
22
|
|
|
22
23
|
const CSS = new URL('./cozy-task-pop.css', import.meta.url).href;
|
|
23
24
|
if (typeof document !== 'undefined' && document.head && !document.querySelector(`link[href="${CSS}"]`)) {
|
|
@@ -59,6 +60,7 @@ export function closeTask() {
|
|
|
59
60
|
function place() {
|
|
60
61
|
if (!S || !S.el.classList.contains('ctp-full')) return;
|
|
61
62
|
const L = document.querySelector('.cz-pop .cz-pop-l'), r = L && L.getBoundingClientRect();
|
|
63
|
+
S.el.classList.toggle('ctp-solo', !r || !r.width); // no popup behind (a task opened from Today, Events, Goals or Search): centred, near full
|
|
62
64
|
if (!r || !r.width) { S.el.removeAttribute('style'); return; }
|
|
63
65
|
Object.assign(S.el.style, { left: r.left + 'px', top: r.top + 'px', width: r.width + 'px', height: r.height + 'px' });
|
|
64
66
|
}
|
|
@@ -87,7 +89,9 @@ export async function openTask(uid, ctx = {}) {
|
|
|
87
89
|
S = { el, scrim, ctx, uid, prevFocus: document.activeElement };
|
|
88
90
|
// the full popup lies over the work side of the popup and follows its size (the chat opening beside it narrows it)
|
|
89
91
|
if (ctx.full) {
|
|
90
|
-
el.classList.add('ctp-full'); scrim.classList.add('ctp-full');
|
|
92
|
+
el.classList.add('ctp-full', 'pm-ds'); scrim.classList.add('ctp-full'); // pm-ds: the Komorebi parts inside (komorebi.css, loaded below)
|
|
93
|
+
const K = new URL('./komorebi.css', import.meta.url).href;
|
|
94
|
+
if (!document.querySelector(`link[href="${K}"]`) && !document.querySelector('link[href="/pm/komorebi.css"]')) { const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = K; document.head.appendChild(l); }
|
|
91
95
|
const L = document.querySelector('.cz-pop .cz-pop-l');
|
|
92
96
|
if (L && typeof ResizeObserver !== 'undefined') { S.ro = new ResizeObserver(place); S.ro.observe(L); }
|
|
93
97
|
window.addEventListener('resize', place); place();
|
|
@@ -122,14 +126,19 @@ async function show(uid) {
|
|
|
122
126
|
const more = !t.jira ? ib('data-ctp-more aria-haspopup="menu"', 'More for this task', P.more) : '';
|
|
123
127
|
S.el.setAttribute('aria-label', (t.milestone ? 'Milestone: ' : 'Task: ') + t.title);
|
|
124
128
|
if (ctx.full) {
|
|
125
|
-
// WorkStatesDS 4 and 6: ← and the path back
|
|
129
|
+
// 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.
|
|
130
|
+
// The body is main + side (viewer-ds-task): Where it stands, Linked and Activity, beside the task card (fields and notes) in a block.
|
|
126
131
|
const path = ctx.path || [], last = path.length - 1;
|
|
127
|
-
|
|
132
|
+
// iniCrumb (a task opened from a place, not from its initiative's popup): the initiative's name opens it, and ← closes
|
|
133
|
+
const lastAttr = ctx.iniCrumb && t.ini ? `data-ctp-ini="${esc(t.ini)}"` : 'data-ctp-close';
|
|
134
|
+
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>');
|
|
128
135
|
const head = ctx.head ? ctx.head(t) : '';
|
|
129
|
-
|
|
136
|
+
const back = path.length && !ctx.iniCrumb ? 'Back to ' + path[last] : 'Close';
|
|
137
|
+
S.el.innerHTML = `<div class="ctp-h ctp-fh">${ib('data-ctp-close', back, P.back)}<nav class="ctp-path" aria-label="Where this is">${crumbs}${t.jira ? '<span class="pm-chip">Jira</span>' : ''}</nav>`
|
|
130
138
|
+ `<span class="ctp-tools">${step}${ctx.chat ? ib('data-ctp-chat', 'Ask PMOS about this', P.chat) : ''}${more}${ib('data-ctp-x', 'Close', P.x)}</span></div>`
|
|
131
|
-
+ `<div class="ctp-th">${kind}${title}</div
|
|
132
|
-
+ '<div class="ctp-
|
|
139
|
+
+ `<div class="ctp-th">${kind}${title}</div><p class="pm-meta ctp-meta">${esc(VD.metaOf(t))}</p>`
|
|
140
|
+
+ `<div class="ctp-g"><div class="ctp-main">${head ? `<div class="ctp-hx">${head}</div>` : ''}<div class="ctp-stands"></div><div class="ctp-linked"></div><div class="ctp-act"></div></div>`
|
|
141
|
+
+ '<aside class="ctp-side"><section class="pm-block" aria-label="Fields and notes"><div class="ctp-b"></div><div class="ctp-when" hidden></div></section></aside></div>';
|
|
133
142
|
} else {
|
|
134
143
|
S.el.innerHTML = `<div class="ctp-h">${kind}${title}<span class="ctp-tools">${step}${more}${ib('data-ctp-close', 'Close', P.x)}</span></div>`
|
|
135
144
|
+ '<div class="ctp-b"></div><div class="ctp-when" hidden></div>';
|
|
@@ -143,18 +152,34 @@ async function show(uid) {
|
|
|
143
152
|
return base(patch);
|
|
144
153
|
};
|
|
145
154
|
// the host's row changes at once (ctx.patch: the list behind shows the new status and dates before the board is read again)
|
|
146
|
-
const changed = () => { raw.status = t.status; raw.end = t.due; raw.start = t.start; raw.owner = t.owner; raw.notes = t.notes; raw.milestone = t.milestone; if (ctx.patch) { try { ctx.patch(t.uid, { status: t.status, end: t.due || '', start: t.start || '', milestone: !!t.milestone, title: t.title }); } catch { /* the reload still draws it */ } } clearTimeout(changed.t); changed.t = setTimeout(() => { if (ctx.onChange) ctx.onChange(); }, 400); };
|
|
155
|
+
const changed = () => { raw.status = t.status; raw.end = t.due; raw.start = t.start; raw.owner = t.owner; raw.notes = t.notes; raw.milestone = t.milestone; if (ctx.patch) { try { ctx.patch(t.uid, { status: t.status, end: t.due || '', start: t.start || '', milestone: !!t.milestone, title: t.title }); } catch { /* the reload still draws it */ } } clearTimeout(changed.t); changed.t = setTimeout(() => { if (ctx.onChange) ctx.onChange(); }, 400); if (ctx.full) drawMain(); };
|
|
147
156
|
const toast = (msg, undo) => (ctx.toast ? ctx.toast(msg, undo) : undefined);
|
|
157
|
+
S.hist = historyFor({ ws: ctx.ws, board: raw.board || ctx.board, t, post: (p, b) => ctx.pmPost(p, b) });
|
|
158
|
+
S.histL = null;
|
|
148
159
|
S.card = mountCard(S.el.querySelector('.ctp-b'), t, {
|
|
149
160
|
save, toast, changed, now: () => Date.now(),
|
|
150
161
|
openIni: (id) => { closeTask(); if (ctx.openIni) ctx.openIni(id); },
|
|
151
162
|
iniTitleOf: (id) => (ctx.iniTitle ? ctx.iniTitle(id) : id),
|
|
152
163
|
owners: () => (ctx.owners ? ctx.owners() : []),
|
|
153
164
|
inis: () => (ctx.inis ? ctx.inis() : []),
|
|
154
|
-
|
|
165
|
+
// the full popup says PMOS's changes once, in its Activity block; the small popup keeps the card's History fold
|
|
166
|
+
history: ctx.full ? null : S.hist,
|
|
155
167
|
});
|
|
168
|
+
if (ctx.full) { drawMain(); loadActivity(); }
|
|
156
169
|
const f = S.el.querySelector('.ctp-t') || S.el.querySelector('button'); if (f) f.focus();
|
|
157
170
|
}
|
|
171
|
+
/* the full popup's main column (viewer-ds-task, pm/vw-ds.js): Where it stands and Linked from the task, Activity from PMOS's kept changes */
|
|
172
|
+
function drawMain() {
|
|
173
|
+
if (!S || !S.ctx.full || !S.t) return;
|
|
174
|
+
const put = (sel, html) => { const x = S.el.querySelector(sel); if (x) x.innerHTML = html; };
|
|
175
|
+
put('.ctp-stands', VD.standsHtml(S.t, { waits: S.ctx.waits ? S.ctx.waits(S.t) : '' }));
|
|
176
|
+
put('.ctp-linked', VD.linkedHtml(S.t));
|
|
177
|
+
put('.ctp-act', VD.activityHtml(S.histL || [], { open: !!S.aopen }));
|
|
178
|
+
}
|
|
179
|
+
function loadActivity() {
|
|
180
|
+
const s = S; if (!s || !s.hist) return;
|
|
181
|
+
Promise.resolve(s.hist.load()).catch(() => []).then((L) => { if (S !== s) return; s.histL = Array.isArray(L) ? L : []; drawMain(); });
|
|
182
|
+
}
|
|
158
183
|
|
|
159
184
|
/* the card's status press waits for "When did this happen?": Today preselected, so a second press of the status or Enter keeps today */
|
|
160
185
|
function holdStatus(e) {
|
|
@@ -180,8 +205,19 @@ function hideWhen() { if (!S) return; const w = S.el.querySelector('.ctp-when');
|
|
|
180
205
|
|
|
181
206
|
async function press(e) {
|
|
182
207
|
if (!S) return;
|
|
183
|
-
const b = e.target.closest('button'); if (!b || b.disabled || !S.el.contains(b)) return;
|
|
208
|
+
const b = e.target.closest('button,a[data-ctp-ini]'); if (!b || b.disabled || !S.el.contains(b)) return;
|
|
184
209
|
const d = b.dataset, ctx = S.ctx, t = S.t;
|
|
210
|
+
// the full popup's main column (viewer-ds-task): the initiative opens it; Undo a kept change; the Activity fold
|
|
211
|
+
if (d.ctpIni) { e.preventDefault(); const id = d.ctpIni; closeTask(); if (ctx.openIni) ctx.openIni(id); return; }
|
|
212
|
+
if (d.ctpHundo && S.hist) {
|
|
213
|
+
const s0 = S; b.disabled = true;
|
|
214
|
+
const r = await Promise.resolve(s0.hist.undo(d.ctpHundo)).catch(() => null);
|
|
215
|
+
if (!r || r.ok === false) { if (ctx.toast) ctx.toast((r && r.error) || 'The undo did not land.'); }
|
|
216
|
+
if (ctx.onChange) ctx.onChange();
|
|
217
|
+
if (S === s0) show(s0.uid); // the task as it is now, and its Activity again
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if ('ctpAfold' in d) { S.aopen = true; drawMain(); return; }
|
|
185
221
|
if (b.closest('.ctp-hx')) { if (ctx.headPress) { const s0 = S; await ctx.headPress(b, { refresh: () => { if (S === s0) show(s0.uid); }, close: closeTask }); } return; }
|
|
186
222
|
if ('ctpClose' in d) { closeTask(); return; }
|
|
187
223
|
if ('ctpChat' in d) { if (ctx.chat) ctx.chat(); return; }
|
|
@@ -34,8 +34,38 @@ async function read(o) {
|
|
|
34
34
|
return p;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/* viewer-ds-task (board ViewerDS, brief: the Viewer's item as the full popup): a PMOS task opened from a place (Events, Today, Goals, Search)
|
|
38
|
+
* opens as the full task popup (pm/cozy-task-pop.js full mode: Where it stands, Linked and Activity beside the task card), centred when no
|
|
39
|
+
* popup is open. Home keeps its own Viewer trail until its own rebuild (it holds #hmChat); a Jira ticket keeps the ticket Viewer. */
|
|
40
|
+
const onHome = () => typeof document !== 'undefined' && !!document.getElementById('hmChat');
|
|
41
|
+
async function openFull(o) {
|
|
42
|
+
const uid = String(o.key || '').replace(/^task:/, '');
|
|
43
|
+
const [TP, SC] = await Promise.all([import('./cozy-task-pop.js'), import('./scope-chip.js').catch(() => null)]);
|
|
44
|
+
const s = await read({ id: o.ini, ws: o.ws || '', board: o.board || '' });
|
|
45
|
+
const m = s && s.state === 'ready' ? s.model : null;
|
|
46
|
+
const ws = o.ws || (m && m.board && m.board.ws) || '', board = o.board || (m && m.board && m.board.id) || '';
|
|
47
|
+
const row = m ? findTask(m, o.key) : null;
|
|
48
|
+
if (row && cardTask(m, row).jira) return false; // a Jira ticket: the ticket Viewer, as before
|
|
49
|
+
const product = SC && SC.productName ? SC.productName(ws, (m && m.board && m.board.name) || '') : '';
|
|
50
|
+
TP.openTask(uid, {
|
|
51
|
+
full: true, ws, board, ini: o.ini, pmPost: (p, b) => pmPost(p, b), toast: toastUndo,
|
|
52
|
+
path: [product, (m && m.title) || o.ini].filter(Boolean), iniCrumb: true,
|
|
53
|
+
iniTitle: (id) => (id === o.ini && m ? m.title : id),
|
|
54
|
+
row: () => (row ? { ...row, uid, board, ini: o.ini } : null),
|
|
55
|
+
rename: o.rename && typeof o.rename.save === 'function' ? (raw, title) => o.rename.save(title, {}) : null,
|
|
56
|
+
onChange: () => cache.clear(),
|
|
57
|
+
openIni: (id) => openWorkItem({ kind: 'initiative', id, title: id === o.ini && m ? m.title : '', ws: o.ws, board: o.board }),
|
|
58
|
+
chat: () => import('./page-chat.js').then((PC) => PC.openChat({ kind: 'task', id: uid, title: (row && row.title) || o.title || 'this task' }, { ws })),
|
|
59
|
+
});
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
|
|
37
63
|
export function openWorkItem(o) {
|
|
38
64
|
if (!o) return null;
|
|
65
|
+
if (o.kind === 'task' && /^task:/.test(o.key || '') && o.ini && !onHome() && o.full !== false) {
|
|
66
|
+
openFull(o).then((done) => { if (!done) openWorkItem({ ...o, full: false }); }).catch(() => openWorkItem({ ...o, full: false }));
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
39
69
|
vwStyle('item');
|
|
40
70
|
const ctx = { id: o.kind === 'task' ? o.ini : o.id, ws: o.ws || '', board: o.board || '' };
|
|
41
71
|
if (!ctx.id) return null;
|
|
@@ -197,6 +197,11 @@ export function cardHtml(t, o = {}) {
|
|
|
197
197
|
/** History (canvas TpA6): Claude's approved changes to the task, newest first (lib/proposals.js historyOf). Zero is silence. */
|
|
198
198
|
const FIELD = { due: 'Due', status: 'Status', name: 'Name', notes: 'Notes', add: 'Added' };
|
|
199
199
|
const valOf = (f, v) => (v == null || v === '' ? '—' : typeof v === 'object' ? [short(v.start), short(v.due)].filter(Boolean).join(' – ') || '—' : f === 'notes' ? 'edited' : String(v));
|
|
200
|
+
/** One history entry in words: { what, by, day } (the Activity block of the full task popup, pm/vw-ds.js, says it the same way). */
|
|
201
|
+
export function historyWords(x) {
|
|
202
|
+
const what = x.field === 'add' ? 'Added from ' + (x.source || 'your sources') : (FIELD[x.field] || x.field) + ': ' + valOf(x.field, x.from) + ' → ' + valOf(x.field, x.to);
|
|
203
|
+
return { what, by: ['PMOS, kept by you', x.why, x.field !== 'add' && x.source ? x.source : ''].filter(Boolean).join(' · '), day: short(String(x.at || '').slice(0, 10)) };
|
|
204
|
+
}
|
|
200
205
|
export function historyHtml(hist, open, now = Date.now()) {
|
|
201
206
|
const L = (hist || []).filter((x) => x && !x.undone);
|
|
202
207
|
if (!L.length) return '';
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/* pm/vw-ds.js — the blocks a task's full popup is built from (initiative viewer-ds-task; Exploring 3 page "pages", board ViewerDS; brief
|
|
2
|
+
* design-system/pages-rebuild/brief.md, Viewer: item as the full popup). Built only from PMOS Komorebi parts (workspace/design-system/ui).
|
|
3
|
+
* PURE: no DOM, no fetch; `now` comes in. pm/cozy-task-pop.js draws them in its full mode and wires the presses by their data- attributes.
|
|
4
|
+
*
|
|
5
|
+
* metaOf(t) → 'Task · Dina · due 24 Nov · Build' the one line under the title
|
|
6
|
+
* pathOf(t, o) → [crumb] product › initiative › task (the Jira key, or the task's name)
|
|
7
|
+
* standsOf(t, o) → [html] Where it stands, from the record only
|
|
8
|
+
* linkedOf(t) → [{ kind, title, sub, href?, act? }] the initiative, the Jira ticket, each link in the notes
|
|
9
|
+
* standsHtml · linkedHtml · activityHtml(hist, o) the three main-column blocks
|
|
10
|
+
*
|
|
11
|
+
* NOTHING HERE MAKES A FACT UP. A task with no due date says so; a task nobody has says so; zero is silence (no link, no Linked block). */
|
|
12
|
+
import { historyWords } from './task-card.js';
|
|
13
|
+
|
|
14
|
+
export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
15
|
+
const SV = (d, n = 16, cls = '') => `<svg class="pm-ic${cls ? ' ' + cls : ''}" width="${n}" height="${n}" viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
16
|
+
export const I = {
|
|
17
|
+
star: 'M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z', 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',
|
|
18
|
+
ini: 'M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01', jira: 'M12 3l9 9-9 9-9-9z', undo: 'M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3', chev: 'M9 6l6 6-6 6',
|
|
19
|
+
};
|
|
20
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
21
|
+
const DAY = 864e5;
|
|
22
|
+
const day = (v) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(v || '')); return m ? Date.UTC(+m[1], +m[2] - 1, +m[3]) : null; };
|
|
23
|
+
const today = (now) => { const d = new Date(now); return Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()); };
|
|
24
|
+
export const dm = (v) => { const t = day(v); if (t == null) return ''; const d = new Date(t); return d.getUTCDate() + ' ' + MON[d.getUTCMonth()]; };
|
|
25
|
+
const days = (n) => n + (n === 1 ? ' day' : ' days');
|
|
26
|
+
const done = (t) => /^(done|closed|resolved|won'?t do|archived)$/i.test(String(t.status || ''));
|
|
27
|
+
/** "pm:wawan" is the PM: "You". */
|
|
28
|
+
const who = (o) => (/^pm:/.test(String(o || '')) ? 'You' : String(o || '').trim());
|
|
29
|
+
|
|
30
|
+
export function metaOf(t) {
|
|
31
|
+
const d = t.due ? 'due ' + dm(t.due) : '', w = who(t.owner);
|
|
32
|
+
return [t.milestone ? 'Milestone' : 'Task', w, d, t.section || ''].filter(Boolean).join(' · ');
|
|
33
|
+
}
|
|
34
|
+
export function pathOf(t, o = {}) {
|
|
35
|
+
return [o.product || '', t.iniTitle || t.ini || '', t.jira ? t.jira.key : ''].filter(Boolean);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* ── Where it stands ──────────────────────────────────────────────────────────────────────────────────────────── */
|
|
39
|
+
export function standsOf(t, o = {}) {
|
|
40
|
+
const now = o.now == null ? Date.now() : o.now, out = [], T = today(now), w = who(t.owner);
|
|
41
|
+
if (done(t)) out.push(`It is ${esc(String(t.status).toLowerCase())}.`);
|
|
42
|
+
else {
|
|
43
|
+
const d = day(t.due), st = String(t.status || 'To do');
|
|
44
|
+
const holder = w ? (w === 'You' ? 'You have it' : `${esc(w)} has it`) : 'Nobody has it yet';
|
|
45
|
+
out.push(`${holder}, and it is ${esc(st.toLowerCase())}.`);
|
|
46
|
+
if (d == null) out.push('It has no due date yet, so nothing shows when it will finish.');
|
|
47
|
+
else {
|
|
48
|
+
const n = Math.round((d - T) / DAY);
|
|
49
|
+
out.push(n < 0 ? `It was due ${esc(dm(t.due))} and is ${days(-n)} late.` : n === 0 ? 'It is due today.' : n === 1 ? `It is due tomorrow, ${esc(dm(t.due))}.` : `It is due ${esc(dm(t.due))}, in ${days(n)}.`);
|
|
50
|
+
}
|
|
51
|
+
if (o.waits) out.push(`It waits on you: ${esc(String(o.waits).replace(/\.$/, ''))}.`);
|
|
52
|
+
}
|
|
53
|
+
if (t.ini) out.push(`It ${t.milestone ? 'is a milestone of' : 'moves'} <a href="#" data-ctp-ini="${esc(t.ini)}">${esc(t.iniTitle || t.ini)}</a>${t.section ? `, in its ${esc(t.section)} stage` : ''}.`);
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
export function standsHtml(t, o = {}) {
|
|
57
|
+
const S = standsOf(t, o);
|
|
58
|
+
if (!S.length && !o.sug) return '';
|
|
59
|
+
return `<section class="pm-block" aria-label="Where it stands"><h3 class="pm-h-sm pm-row">${SV(I.star, 16, 'pm-star')}Where it stands</h3>`
|
|
60
|
+
+ (S.length ? `<p class="ctp-say">${S.join(' ')}</p>` : '') + (o.sug || '') + '</section>';
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* ── Linked ───────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
64
|
+
const URL_RE = /\bhttps?:\/\/[^\s<>"')\]]+/g;
|
|
65
|
+
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); } };
|
|
66
|
+
export function linkedOf(t) {
|
|
67
|
+
const out = [];
|
|
68
|
+
if (t.ini) out.push({ kind: 'ini', title: t.iniTitle || t.ini, sub: 'initiative', act: t.ini });
|
|
69
|
+
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) : '') });
|
|
70
|
+
const seen = new Set();
|
|
71
|
+
for (const u of String(t.notes || '').match(URL_RE) || []) { if (seen.has(u) || seen.size >= 5) continue; seen.add(u); out.push({ kind: 'url', title: shortUrl(u), sub: 'link in the notes', href: u }); }
|
|
72
|
+
return out;
|
|
73
|
+
}
|
|
74
|
+
export function linkedHtml(t) {
|
|
75
|
+
const L = linkedOf(t);
|
|
76
|
+
if (!L.length) return '';
|
|
77
|
+
const icon = (k) => SV(k === 'ini' ? I.ini : k === 'jira' ? I.jira : I.link);
|
|
78
|
+
const row = (x) => {
|
|
79
|
+
const inner = `${icon(x.kind)}<span class="txt"><span class="t">${esc(x.title)}</span><span class="w">${esc(x.sub)}</span></span>`;
|
|
80
|
+
return x.href ? `<a class="pm-li" href="${esc(x.href)}" target="_blank" rel="noopener">${inner}</a>`
|
|
81
|
+
: x.act ? `<button type="button" class="pm-li" data-ctp-ini="${esc(x.act)}">${inner}</button>` : `<div class="pm-li">${inner}</div>`;
|
|
82
|
+
};
|
|
83
|
+
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>`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* ── Activity: PMOS's kept changes, newest first ──────────────────────────────────────────────────────────────── */
|
|
87
|
+
/** hist: GET /api/proposals/history entries (task-card.js historyFor). o: { now, open: the fold is open, first: rows before the fold (3) }. */
|
|
88
|
+
export function activityHtml(hist, o = {}) {
|
|
89
|
+
const now = o.now == null ? Date.now() : o.now, first = o.first || 3;
|
|
90
|
+
const L = (hist || []).filter((x) => x && !x.undone);
|
|
91
|
+
if (!L.length) return '';
|
|
92
|
+
const row = (x) => {
|
|
93
|
+
const w = historyWords(x), recent = now - (Date.parse(x.at) || 0) < 7 * DAY;
|
|
94
|
+
return `<div class="pm-li"><span class="code pm-meta ctp-ad">${esc(w.day)}</span><span class="txt"><span class="t">${esc(w.what)}</span><span class="w">${esc(w.by)}</span></span>`
|
|
95
|
+
+ (recent && x.batch ? `<button type="button" class="pm-btn" data-ctp-hundo="${esc(x.batch)}" aria-label="Undo this change" title="Undo">${SV(I.undo)}</button>` : '') + '</div>';
|
|
96
|
+
};
|
|
97
|
+
const shown = o.open ? L : L.slice(0, first), rest = L.length - shown.length;
|
|
98
|
+
return `<section class="pm-block list" aria-label="Activity"><div class="head"><h3 class="pm-h-sm">Activity</h3></div><div class="rows">${shown.map(row).join('')}</div>`
|
|
99
|
+
+ (rest > 0 ? `<button type="button" class="pm-fold" data-ctp-afold aria-expanded="false">Earlier <span class="pm-meta">${rest}</span></button>` : '') + '</section>';
|
|
100
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "A task opened from a place as the full popup from design system blocks (initiative viewer-ds-task, done test C1-C7): pm/vw-ds.js, pm/cozy-task-pop.js full mode, pm/premium-vw-item.js opener. Pure, node.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"vw-ds.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"vw-ds.test.js": 2
|
|
8
|
+
}
|
|
9
|
+
}
|