create-pmos 0.745.0 → 0.746.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 +20 -14
- 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-board-test.js +3 -2
- package/workspace/changelog.json +19 -0
- package/workspace/guide/home.md +9 -1
- package/workspace/lib/doc-category.js +1 -0
- package/workspace/lib/short-links.js +90 -0
- package/workspace/lib/vendor/workspace/lib/doc-category.js +1 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/bd-ini-panel.js +3 -1
- package/workspace/public/pm/cozy-task-pop.js +3 -0
- package/workspace/public/pm/cozy-viewer.js +11 -1
- package/workspace/public/pm/home-ini.js +3 -1
- package/workspace/public/pm/home-need.js +6 -2
- package/workspace/public/pm/home-task.js +2 -0
- package/workspace/public/pm/premium-board.js +14 -1
- package/workspace/public/pm/short-link.js +35 -0
- package/workspace/server.js +8 -0
- package/workspace/task-card-test.js +6 -0
- package/workspace/test-lists/short-links.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.746.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,25 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.746.0",
|
|
38
|
+
"at": "2026-11-23T11:03:05.465Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1670,
|
|
43
|
+
"t": "Give PressRelease a doc-category row (red main)",
|
|
44
|
+
"s": "Give PressRelease a doc-category row (red main)",
|
|
45
|
+
"k": "fix"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"n": 1668,
|
|
49
|
+
"t": "A short link for every item, which opens it in its panel on a desktop and full screen on a phone (A428)",
|
|
50
|
+
"s": "A short link for every item, which opens it in its panel on a desktop and full screen on a phone (A428)",
|
|
51
|
+
"k": "new"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
36
55
|
{
|
|
37
56
|
"v": "0.745.0",
|
|
38
57
|
"at": "2026-11-23T10:30:13.712Z",
|
|
@@ -611,19 +630,6 @@
|
|
|
611
630
|
"k": "fix"
|
|
612
631
|
}
|
|
613
632
|
]
|
|
614
|
-
},
|
|
615
|
-
{
|
|
616
|
-
"v": "0.721.0",
|
|
617
|
-
"at": "2026-11-23T00:30:20.134Z",
|
|
618
|
-
"f": 4,
|
|
619
|
-
"prs": [
|
|
620
|
-
{
|
|
621
|
-
"n": 1597,
|
|
622
|
-
"t": "Search counts pages and actions on All only (job #1562 follow-up)",
|
|
623
|
-
"s": "Search counts pages and actions on All only (job #1562 follow-up)",
|
|
624
|
-
"k": "fix"
|
|
625
|
-
}
|
|
626
|
-
]
|
|
627
633
|
}
|
|
628
634
|
]
|
|
629
635
|
}
|
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-23T11:03:02Z"}
|
|
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-23T11:03:02Z"}
|
|
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-23T11:03:02Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -401,7 +401,7 @@ const IVREAD = () => {
|
|
|
401
401
|
ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
|
|
402
402
|
await A.ctx.close();
|
|
403
403
|
|
|
404
|
-
/* B14 there is no Page/Popup switch. Re-pointed (batch 14 item 5): "Open in full" left ⋯ (the header's Open wide says it once); Copy link holds the initiative
|
|
404
|
+
/* B14 there is no Page/Popup switch. Re-pointed (batch 14 item 5): "Open in full" left ⋯ (the header's Open wide says it once); Copy link holds the initiative's short link (A428) */
|
|
405
405
|
{
|
|
406
406
|
const D = await open();
|
|
407
407
|
await D.ctx.route('**/premium-initiative.html*', (r) => r.fulfill({ contentType: 'text/html', body: '<title>x</title>' }));
|
|
@@ -416,7 +416,8 @@ const IVREAD = () => {
|
|
|
416
416
|
await D.page.click('#czViewer [data-cz-vw="more"]'); await D.page.click('.cz-vw-menu [role="menuitem"]:has(> span:text-is("Copy"))'); await D.page.click('.hi-pop [role="menuitem"]:has(> span:text-is("Link"))');
|
|
417
417
|
const cl = await until(() => D.page.evaluate(() => navigator.clipboard.readText().catch(() => '')));
|
|
418
418
|
const u = new URL(cl || 'http://x/none');
|
|
419
|
-
|
|
419
|
+
// the short link (bet A428, lib/short-links.js): /i/i/<id>?w=<product> opens the initiative on any device
|
|
420
|
+
ok('B14 Copy › Link holds the initiative\'s short link with its product', u.pathname === '/i/i/self-serve-v2' && u.searchParams.get('w') === 'w1', cl);
|
|
420
421
|
ok('0 no page error on expand', D.errors.length === 0, D.errors.join(' | '));
|
|
421
422
|
await D.ctx.close();
|
|
422
423
|
}
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.746.0",
|
|
4
|
+
"at": "2026-11-23T11:03:05.465Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1670,
|
|
9
|
+
"t": "Give PressRelease a doc-category row (red main)",
|
|
10
|
+
"s": "Give PressRelease a doc-category row (red main)",
|
|
11
|
+
"k": "fix"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"n": 1668,
|
|
15
|
+
"t": "A short link for every item, which opens it in its panel on a desktop and full screen on a phone (A428)",
|
|
16
|
+
"s": "A short link for every item, which opens it in its panel on a desktop and full screen on a phone (A428)",
|
|
17
|
+
"k": "new"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
2
21
|
{
|
|
3
22
|
"v": "0.745.0",
|
|
4
23
|
"at": "2026-11-23T10:30:13.712Z",
|
package/workspace/guide/home.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Home: your list, the chat, the Viewer, My work, documents and people"
|
|
4
4
|
description: "Home's list, Mentions, Your day, the chat and the Viewer; My work; documents and their copies; People; and the suggested next prompt."
|
|
5
|
-
timestamp: 2026-11-
|
|
5
|
+
timestamp: 2026-11-23
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Home
|
|
@@ -270,6 +270,14 @@ This section gives the order of **Your move** in Your day. `pmos today` prints t
|
|
|
270
270
|
|
|
271
271
|
A session that waits on you has a blue dot in Home's list, under its initiative.
|
|
272
272
|
|
|
273
|
+
## A short link for every item
|
|
274
|
+
|
|
275
|
+
Each initiative, task, milestone and Needs-you decision has one short link. To get it, open the item, press ⋯ and then **Copy link**. For an initiative, press ⋯, then **Copy**, then **Link**. Paste it in Slack, an email, a Jira comment or a report. The link looks like `<your PMOS address>/i/t/IDPF-12`: `i` is an initiative, `t` a task, `m` a milestone and `d` a decision.
|
|
276
|
+
|
|
277
|
+
When you open the link on a computer, the item opens in its own panel: an initiative or a task on the Board, and a decision on Today. On a phone the item covers the whole screen, and ← goes back. The link names the item, so it also opens on a teammate's PMOS when that PMOS has the same item. A link to an item that is gone opens the Viewer page with "Nothing is open".
|
|
278
|
+
|
|
279
|
+
PMOS counts the links you open and copy in the local use log on this computer (`node workspace/lib/short-links.js count`). Nothing is sent anywhere.
|
|
280
|
+
|
|
273
281
|
## PMOS's leads
|
|
274
282
|
|
|
275
283
|
The premium Briefing page is now Home. Its leads still work, in popups and from a terminal.
|
|
@@ -49,6 +49,7 @@ const TYPE_TO_CATEGORY = {
|
|
|
49
49
|
Radar: 'report', Checklist: 'other', Calibration: 'report', Research: null, Design: 'spec-artifact',
|
|
50
50
|
Prototype: 'other', Handover: 'report', Review: 'report',
|
|
51
51
|
Decision: 'spec-artifact', Principle: 'knowledge', Debt: 'report', Discovery: 'report', Guide: 'knowledge',
|
|
52
|
+
PressRelease: 'spec-artifact',
|
|
52
53
|
};
|
|
53
54
|
|
|
54
55
|
/* A tenant repository is not bound to PMOS's registry, so a few spellings a PM would write for the same kinds are read too. */
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* short-links.js — a short link for every item (bet A428, initiative item-short-links; done test planning/done-tests/item-short-links.md).
|
|
4
|
+
*
|
|
5
|
+
* A link a PM pastes in Slack, an email, a Jira comment or a report opens that one item: in its panel on a desk, full screen on a phone (the
|
|
6
|
+
* Viewer does that by itself at 760 px or less). The link NAMES the item, so it opens on any PMOS that holds the item, on any product, and
|
|
7
|
+
* nothing is stored to make it:
|
|
8
|
+
* /i/<k>/<id>[?w=<product>] k: i initiative · t task · m milestone · d decision
|
|
9
|
+
*
|
|
10
|
+
* pathOf({ kind, id, ws? }) → '/i/t/IDPF-12?w=idpf' | null an unknown kind or a bad id: null
|
|
11
|
+
* parse(pathname, searchParams) → { kind, id, ws } | null
|
|
12
|
+
* targetOf({ kind, id, ws? }) → the page that opens it:
|
|
13
|
+
* initiative /premium-board.html?focus=<id> the Board opens its panel (premium-board.js focusOnce)
|
|
14
|
+
* task, milestone /premium-board.html?task=<id> the Board opens the task view, ← its initiative (taskOnce)
|
|
15
|
+
* decision /today.html?open=decision:<id> Today opens the Needs-you row (home-app.js ?open=)
|
|
16
|
+
* each with &ws=<product> when the link names one
|
|
17
|
+
* resolve(pathname, searchParams, { runtimeDir, ua, now }) → { status: 302, location }
|
|
18
|
+
* server.js answers /i/… with it. Each open adds one use line (control shortLinkOpen, the device from the browser) to the local use log
|
|
19
|
+
* (lib/use-log.js), the health number. A link that names nothing goes to /premium-viewer.html ("Nothing is open") and logs nothing.
|
|
20
|
+
* CLI: node lib/short-links.js count → [short-links] opens …, then the opens in the last 7 days on its last line (the health number)
|
|
21
|
+
*
|
|
22
|
+
* Nothing here sends anything. The page side (public/pm/short-link.js) makes the same links. */
|
|
23
|
+
const UL = require('./use-log.js');
|
|
24
|
+
|
|
25
|
+
const KINDS = Object.freeze({ initiative: 'i', task: 't', milestone: 'm', decision: 'd' });
|
|
26
|
+
const BY_LETTER = Object.freeze(Object.fromEntries(Object.entries(KINDS).map(([k, v]) => [v, k])));
|
|
27
|
+
const ID_RE = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,119}$/;
|
|
28
|
+
const WS_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,79}$/;
|
|
29
|
+
const NOTHING = '/premium-viewer.html';
|
|
30
|
+
const say = (s) => { try { console.log('[short-links] ' + s); } catch { /* no console */ } };
|
|
31
|
+
|
|
32
|
+
function pathOf(item) {
|
|
33
|
+
if (!item || !Object.prototype.hasOwnProperty.call(KINDS, item.kind)) return null;
|
|
34
|
+
const id = String(item.id == null ? '' : item.id);
|
|
35
|
+
if (!ID_RE.test(id)) return null;
|
|
36
|
+
const ws = item.ws && WS_RE.test(String(item.ws)) ? String(item.ws) : '';
|
|
37
|
+
return '/i/' + KINDS[item.kind] + '/' + id + (ws ? '?w=' + encodeURIComponent(ws) : '');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function parse(pathname, searchParams) {
|
|
41
|
+
const m = /^\/i\/([a-z])\/([^/]+)$/.exec(String(pathname || ''));
|
|
42
|
+
if (!m || !BY_LETTER[m[1]]) return null;
|
|
43
|
+
let id;
|
|
44
|
+
try { id = decodeURIComponent(m[2]); } catch { return null; }
|
|
45
|
+
if (!ID_RE.test(id)) return null;
|
|
46
|
+
const w = searchParams && typeof searchParams.get === 'function' ? searchParams.get('w') || '' : '';
|
|
47
|
+
return { kind: BY_LETTER[m[1]], id, ws: WS_RE.test(w) ? w : '' };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function targetOf(item) {
|
|
51
|
+
const q = new URLSearchParams();
|
|
52
|
+
let page;
|
|
53
|
+
if (item.kind === 'initiative') { page = '/premium-board.html'; q.set('focus', item.id); }
|
|
54
|
+
else if (item.kind === 'task' || item.kind === 'milestone') { page = '/premium-board.html'; q.set('task', item.id); }
|
|
55
|
+
else { page = '/today.html'; q.set('open', 'decision:' + item.id); }
|
|
56
|
+
if (item.ws) q.set('ws', item.ws);
|
|
57
|
+
return page + '?' + q.toString();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function deviceOf(ua) {
|
|
61
|
+
const s = String(ua || '');
|
|
62
|
+
if (/iPad|Tablet/i.test(s) || (/Android/i.test(s) && !/Mobile/i.test(s))) return 'tablet';
|
|
63
|
+
if (/Mobi|iPhone|Android/i.test(s)) return 'phone';
|
|
64
|
+
return 'desk';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function resolve(pathname, searchParams, { runtimeDir = null, ua = '', now = Date.now() } = {}) {
|
|
68
|
+
const item = parse(pathname, searchParams);
|
|
69
|
+
if (!item) { say('names nothing'); return { status: 302, location: NOTHING }; }
|
|
70
|
+
const device = deviceOf(ua);
|
|
71
|
+
if (runtimeDir) {
|
|
72
|
+
const r = UL.record(runtimeDir, [{ kind: 'use', page: '/short-link', control: 'shortLinkOpen', device }], now);
|
|
73
|
+
if (!r || !r.ok) say('open not logged: ' + ((r && r.error) || 'no reason'));
|
|
74
|
+
}
|
|
75
|
+
say(`open ${item.kind} on ${device}`); // never the id: the log stays free of item names
|
|
76
|
+
return { status: 302, location: targetOf(item) };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** The opens in the last `days` days (the health number). */
|
|
80
|
+
const opens = (lines, days = 7, now = Date.now()) => UL.controlCount(lines, 'shortLinkOpen', days, now);
|
|
81
|
+
|
|
82
|
+
module.exports = { KINDS, ID_RE, pathOf, parse, targetOf, deviceOf, resolve, opens };
|
|
83
|
+
|
|
84
|
+
if (require.main === module) {
|
|
85
|
+
if (process.argv[2] !== 'count') { console.error('usage: node lib/short-links.js count (short-link opens in the last 7 days, on the last line)'); process.exit(2); }
|
|
86
|
+
const dir = require('./state-root.js').defaultRoot({ env: process.env });
|
|
87
|
+
const lines = UL.readLines(dir), n = opens(lines);
|
|
88
|
+
console.log('[short-links] opens in the last 7 days: ' + n + ' (copies: ' + UL.controlCount(lines, 'shortLinkCopy', 7) + ')');
|
|
89
|
+
console.log(String(n));
|
|
90
|
+
}
|
|
@@ -49,6 +49,7 @@ const TYPE_TO_CATEGORY = {
|
|
|
49
49
|
Radar: 'report', Checklist: 'other', Calibration: 'report', Research: null, Design: 'spec-artifact',
|
|
50
50
|
Prototype: 'other', Handover: 'report', Review: 'report',
|
|
51
51
|
Decision: 'spec-artifact', Principle: 'knowledge', Debt: 'report', Discovery: 'report', Guide: 'knowledge',
|
|
52
|
+
PressRelease: 'spec-artifact',
|
|
52
53
|
};
|
|
53
54
|
|
|
54
55
|
/* A tenant repository is not bound to PMOS's registry, so a few spellings a PM would write for the same kinds are read too. */
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.746.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.746.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -27,6 +27,7 @@ import * as VW from './cozy-viewer.js';
|
|
|
27
27
|
import * as SV from './small-vw.js'; // the one stakeholder form, Home's too (batch 18 item 2-C)
|
|
28
28
|
import { esc } from './premium-shell.js';
|
|
29
29
|
import { copyText } from './cozy-xv.js';
|
|
30
|
+
import { linkPath } from './short-link.js'; // the initiative's short link (bet A428)
|
|
30
31
|
import { iniView } from './ini-view-model.js';
|
|
31
32
|
import { gateOf } from './premium-initiative-head.js'; // the gate chips (PRD, draft, reviewed), as Home's page reads them (UI grill U1)
|
|
32
33
|
import { rowFor } from './ini-versions.js'; // planned versus actual (batch 11 item 8): Live or the draft the PM shows, with the plan line
|
|
@@ -130,7 +131,8 @@ function iniMore(r) {
|
|
|
130
131
|
// split or merge, then the one Program picker (batch 11 items 2 and 14; batch 16 item 5c; pm/split-merge.js, pm/prog-move.js)
|
|
131
132
|
sm: id && O.smItems && !r.ended ? O.smItems(r) : [],
|
|
132
133
|
pm: id && O.moveItems ? O.moveItems(r) : [],
|
|
133
|
-
|
|
134
|
+
// Copy › Link is the item's short link (bet A428, pm/short-link.js): it opens the initiative on any device; an id it cannot carry keeps the page link
|
|
135
|
+
link: id ? () => copyText(new URL(linkPath({ kind: 'initiative', id, ws: r.ws || ((O.M() || {}).board || {}).ws || '' }) || O.pageHref(r), location.href).href, 'Link copied.') : null,
|
|
134
136
|
text: () => copyText(iniText(r.title, viewOf(r), (r.track && r.track.tickets) || []), 'Copied as text.'),
|
|
135
137
|
record: id ? async () => { VW.drill(); (await import('./premium-vw-item.js')).openWorkItem({ kind: 'initiative', id, title: r.title, ...where(r) }); } : null,
|
|
136
138
|
del: id ? () => deleteIni(r) : null,
|
|
@@ -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 { linkPath, copyLink } from './short-link.js'; // Copy link in ⋯ (bet A428)
|
|
21
22
|
import * as VD from './vw-ds.js'; // viewer-ds-task (board ViewerDS): the full popup's Where it stands, Linked and Activity blocks
|
|
22
23
|
|
|
23
24
|
const CSS = new URL('./cozy-task-pop.css', import.meta.url).href;
|
|
@@ -244,6 +245,7 @@ function moreMenu(btn) {
|
|
|
244
245
|
if (m) { m.remove(); btn.setAttribute('aria-expanded', 'false'); return; }
|
|
245
246
|
m = document.createElement('div'); m.className = 'ctp-menu'; m.setAttribute('role', 'menu'); m.setAttribute('aria-label', 'More for this task');
|
|
246
247
|
m.innerHTML = `<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>`
|
|
248
|
+
+ (linkPath({ kind: 'task', id: s.uid }) ? '<button type="button" role="menuitem" data-k="link">Copy link</button>' : '') // the short link (bet A428)
|
|
247
249
|
+ (s.t.status !== 'Archived' ? '<button type="button" role="menuitem" data-k="arch">Archive</button>' : '')
|
|
248
250
|
+ '<button type="button" role="menuitem" data-k="del" class="ctp-del">Delete</button>';
|
|
249
251
|
btn.setAttribute('aria-expanded', 'true');
|
|
@@ -253,6 +255,7 @@ function moreMenu(btn) {
|
|
|
253
255
|
const x = e.target.closest('[data-k]'); if (!x) return;
|
|
254
256
|
e.stopPropagation(); m.remove(); btn.setAttribute('aria-expanded', 'false');
|
|
255
257
|
if (x.dataset.k === 'kind') kindOf(!s.t.milestone);
|
|
258
|
+
else if (x.dataset.k === 'link') copyLink({ kind: s.t.milestone ? 'milestone' : 'task', id: s.uid, ws: s.ctx.ws || '' });
|
|
256
259
|
else if (x.dataset.k === 'arch') s.card.setStatus('Archived');
|
|
257
260
|
else if (x.dataset.k === 'del') delTask(s);
|
|
258
261
|
});
|
|
@@ -127,6 +127,7 @@ const kindKey = (k) => String(k || 'item').trim().toLowerCase().replace(/^file
|
|
|
127
127
|
* the listeners, the rail's card. Only the first instance (#czViewer) writes the browser history; another keeps its own ← → trail.
|
|
128
128
|
* Without cozy-panels.js (Board, Intelligence) the limit stays 1 and there is one Viewer, as before. */
|
|
129
129
|
import { capture as capturePlace, restore as restorePlace } from './back-place.js'; // Back restores your place (A430)
|
|
130
|
+
import { linkOf, copyLink } from './short-link.js'; // a short link for every item (A428): Copy link in ⋯
|
|
130
131
|
const G = { chat: null, subs: [], railKey: null, rail: false, lw: 0, tick: 0, limit: 1, beside: null, place: null, managed: null, popH: null, popNext: null, behindNext: null };
|
|
131
132
|
const mk = (i) => ({ i, el: null, cur: null, back: null, stack: [], fwd: [], unplace: null, wide: false, w: 0, drill: false, over: false, used: 0, ph: false, via: '', pop: false });
|
|
132
133
|
let V = mk(0);
|
|
@@ -190,7 +191,7 @@ export function headHtml(it) {
|
|
|
190
191
|
// in the popup the work side's header is the title and ⋯ only (board 20): its quiet icon presses go into ⋯; a solid primary stays
|
|
191
192
|
const toMenu = (x) => (phone && x.menu) || (o.pop && !x.solid);
|
|
192
193
|
const inMenu = (o.presses || []).some((x) => x && x.act && x.label && toMenu(x));
|
|
193
|
-
const more = inMenu || typeof o.more === 'function' || (Array.isArray(o.more) && o.more.some((m) => m && !m.sep)) || o.url ? ib('more', 'More', P.more, ' aria-haspopup="menu" aria-expanded="false"') : '';
|
|
194
|
+
const more = inMenu || typeof o.more === 'function' || (Array.isArray(o.more) && o.more.some((m) => m && !m.sep)) || o.url || linkOf(o) ? ib('more', 'More', P.more, ' aria-haspopup="menu" aria-expanded="false"') : '';
|
|
194
195
|
const add = o.add && o.add.label && !phone ? ib('add', o.add.label, P.add) : '';
|
|
195
196
|
const pressHtml = (x) => (x.solid
|
|
196
197
|
? `<button type="button" class="cz-vw-pri${x.text && !phone ? '' : ' i'}${x.blue ? ' blue' : ''}" data-cz-vw="press" data-cz-vw-p="${esc(x.act)}" aria-label="${esc(x.label)}" title="${esc(x.label)}">${svg(path(x.icon), 15, 2.2)}${x.text && !phone ? `<span>${esc(x.text)}</span>` : ''}</button>`
|
|
@@ -426,6 +427,15 @@ function itemsOf(X, b) {
|
|
|
426
427
|
const at = items.findIndex((x) => x && x.danger), tab = { label: X.cur.full ? 'Open in full' : 'Open in a new tab', on: () => window.open(X.cur.url, '_blank', 'noopener') };
|
|
427
428
|
if (at < 0) items.push({ sep: true }, tab); else items.splice(at > 0 && items[at - 1].sep ? at - 1 : at, 0, { sep: true }, tab);
|
|
428
429
|
}
|
|
430
|
+
// Copy link (bet A428): an item that names itself (its own link: a task, a milestone, a decision) gets one short link that opens it,
|
|
431
|
+
// in its panel on a desk and full screen on a phone. It sits with the item's own address, before the red group.
|
|
432
|
+
const link = linkOf(X.cur.args);
|
|
433
|
+
if (link) {
|
|
434
|
+
const copy = { label: 'Copy link', on: () => { copyLink(link); } }, tabAt = X.cur.url ? items.findIndex((x) => x && x.on && /^Open in (a new tab|full)$/.test(x.label || '')) : -1;
|
|
435
|
+
const at = items.findIndex((x) => x && x.danger);
|
|
436
|
+
if (tabAt >= 0) items.splice(tabAt + 1, 0, copy);
|
|
437
|
+
else if (at < 0) items.push({ sep: true }, copy); else items.splice(at > 0 && items[at - 1].sep ? at - 1 : at, 0, { sep: true }, copy);
|
|
438
|
+
}
|
|
429
439
|
while (items.length && items[0].sep) items.shift();
|
|
430
440
|
for (let i = items.length - 1; i > 0; i--) if (items[i].sep && items[i - 1].sep) items.splice(i, 1);
|
|
431
441
|
return items;
|
|
@@ -31,6 +31,7 @@ import * as WF from './ini-wf.js';
|
|
|
31
31
|
import { openPop, closePop, undoToast, popEl, ensureCss as ensurePopCss } from './hi-pop.js';
|
|
32
32
|
import { iniMore, iniText, pageHref, stagePick, deleteSaid, DELETE_MS } from './ini-more.js'; // the one initiative ⋯ menu and stage picker, the same on the Board (batch 14 item 5, batch 16 item 5c)
|
|
33
33
|
import * as SC from './home-stage-card.js';
|
|
34
|
+
import { linkPath } from './short-link.js'; // the initiative's short link (bet A428)
|
|
34
35
|
import { viewHtml, wireView } from './ini-view.js'; // the one initiative view, the Board's panel's own renderer
|
|
35
36
|
import { ensureCss as ensureStepsCss } from './cozy-steps.js'; // stage card D: the card's last node and the move sheet's words // D99: the initiative's own workflow (Change picker, switch, Won't do, Archive)
|
|
36
37
|
import * as DB from './dash-view.js'; // the ready-made Dashboard view (batch 17 item 1)
|
|
@@ -410,7 +411,8 @@ function pageMore(id) {
|
|
|
410
411
|
sm: C.smItems && !row.ended ? C.smItems(id, openList) : [],
|
|
411
412
|
pm: C.moveItems ? C.moveItems(id, openList) : [],
|
|
412
413
|
board: () => { location.href = '/premium-board.html?focus=' + encodeURIComponent(id) + (M.board.ws ? '&ws=' + encodeURIComponent(M.board.ws) : '') + (M.board.id ? '&board=' + encodeURIComponent(M.board.id) : ''); },
|
|
413
|
-
|
|
414
|
+
// Copy › Link is the item's short link (bet A428, pm/short-link.js): it opens the initiative on any device; an id it cannot carry keeps the page link
|
|
415
|
+
link: () => copy(new URL(linkPath({ kind: 'initiative', id, ws: M.board.ws || '' }) || pageHref(id, M.board.ws, M.board.id), location.href).href, 'Link copied.'),
|
|
414
416
|
text: () => copy(iniText(C.iniTitle(id), C.view ? C.view(id) : null, (row.track && row.track.tickets) || []), 'Copied as text.'),
|
|
415
417
|
record: async () => (C.VW.drill(), await import('./premium-vw-item.js')).openWorkItem({ kind: 'initiative', id, title: M.title, ...bw(M) }),
|
|
416
418
|
del: M.board && M.board.id ? () => deleteIni(id, M) : null,
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
* linkOf(r), toast(m), signIn(), rowGone(key) }
|
|
20
20
|
* refresh() draws the open ask again when its phase changed (a run finished, the row left Home); called after each read. */
|
|
21
21
|
|
|
22
|
+
import { linkPath } from './short-link.js';
|
|
23
|
+
/** A decision's short link (bet A428, pm/short-link.js): the Viewer's ⋯ then shows Copy link for /i/d/<id>, which opens this row on any
|
|
24
|
+
* device. Other rows, and a decision whose id a short link cannot carry, keep the page link (h.linkOf). */
|
|
25
|
+
const shortOf = (r) => { const id = r && r.row && r.row.kind === 'decision' ? String(r.key || '').replace(/^decision:/, '') : ''; return id && linkPath({ kind: 'decision', id }) ? { kind: 'decision', id, ws: (r.row && r.row.ws) || r.ws || '' } : null; };
|
|
22
26
|
const STEP_WORD = { spec: 'the spec', prototype: 'the prototype', contract: 'the agreed done-criteria', anchor: 'the goal it moves', route: 'its lane', brief: 'the problem brief', prd: 'the PRD', rubric: 'the rubric' };
|
|
23
27
|
const STEP_AT = { spec: 'the spec', prototype: 'the prototype', contract: 'the contract', anchor: 'the goal', route: 'routing' };
|
|
24
28
|
export const LANE_WORD = { feature: 'New feature', discovery: 'Discovery', chore: 'Upkeep', incident: 'Incident', content: 'Content', prototype: 'Prototype' };
|
|
@@ -238,11 +242,11 @@ export function openNeed(r, h, o = {}) {
|
|
|
238
242
|
const out = [];
|
|
239
243
|
const rec = h.recordHref(r); if (rec) out.push({ label: 'Open the record', on: () => window.open(rec, '_blank', 'noopener') });
|
|
240
244
|
const bd = h.boardHref(r); if (bd) out.push({ label: 'Open on the Board', on: () => window.open(bd, '_blank', 'noopener') });
|
|
241
|
-
out.push({ label: 'Copy link', on: async () => { try { await navigator.clipboard.writeText(h.linkOf(r)); h.toast('The link is copied.'); } catch { h.toast('The link could not be copied.'); } } });
|
|
245
|
+
if (!shortOf(r)) out.push({ label: 'Copy link', on: async () => { try { await navigator.clipboard.writeText(h.linkOf(r)); h.toast('The link is copied.'); } catch { h.toast('The link could not be copied.'); } } });
|
|
242
246
|
return out;
|
|
243
247
|
};
|
|
244
248
|
const body = h.VW.open({ id: 'need:' + r.key, kind: ({ decision: 'Decision', blocked: 'Blocked', waited: 'Waiting', source: 'Source' }[r.row.kind] || 'Needs you'), title: m0.title, sub: m0.sub, icon: m0.icon,
|
|
245
|
-
presses: pressesOf(m0, r, h), more, onPress: (act, b) => pressHead(act, b), render: draw });
|
|
249
|
+
link: shortOf(r), presses: pressesOf(m0, r, h), more, onPress: (act, b) => pressHead(act, b), render: draw });
|
|
246
250
|
NV.sig = sigOf(m0);
|
|
247
251
|
if (body) {
|
|
248
252
|
body.oninput = (e) => { if (e.target.id === 'nvWhy') { NV.st.why = e.target.value; const b = body.querySelector('[data-nv-rec]'); if (b) b.disabled = !canRecord(); } };
|
|
@@ -28,6 +28,8 @@ export function openTask(task, h) {
|
|
|
28
28
|
const del = deleteEntry({ ws, board, t, post: (p, b) => h.pmPost(p, b), toast, done: () => { if (h.VW.close) h.VW.close(); if (h.onChange) h.onChange(); } });
|
|
29
29
|
const body = h.VW.open({
|
|
30
30
|
id, kind: 'Task', title: t.title, icon: 'task', check: checkOf(t),
|
|
31
|
+
// a short link (bet A428): ⋯ Copy link gives /i/t/<uid> (or /i/m/ for a milestone), which opens this task on any device
|
|
32
|
+
link: { kind: t.milestone ? 'milestone' : 'task', id: raw.uid, ws: ws || '' },
|
|
31
33
|
rename: t.jira ? null : h.rename ? h.rename(raw) : null,
|
|
32
34
|
more: () => {
|
|
33
35
|
return [{ label: 'Talk it through in chat', on: () => h.askInChat(raw) }, ...(del ? [{ sep: true }, del] : [])]; // Delete: batch 7 item 5
|
|
@@ -1408,6 +1408,19 @@ function focusOnce() {
|
|
|
1408
1408
|
const b = $$('#ibBody [data-key]').find((x) => x.dataset.key === r.key);
|
|
1409
1409
|
openIni(r, b || null, 'track');
|
|
1410
1410
|
}
|
|
1411
|
+
/** ?task=<id> (a short link, lib/short-links.js; bet A428): open that task or milestone once, on the first read that has it. A PMOS task opens in
|
|
1412
|
+
* the task view with ← to its initiative; a Jira ticket in its ticket view. The Viewer covers the screen on a phone by itself. */
|
|
1413
|
+
let taskDone = false;
|
|
1414
|
+
function taskOnce() {
|
|
1415
|
+
if (taskDone) return;
|
|
1416
|
+
const id = new URLSearchParams(location.search).get('task'); if (!id) { taskDone = true; return; }
|
|
1417
|
+
const rows = (M.rows || []).filter((x) => x.track);
|
|
1418
|
+
if (!rows.length) return; // the first read is still on its way
|
|
1419
|
+
taskDone = true;
|
|
1420
|
+
for (const r of rows) { const k = (r.tasks || []).find((x) => x.uid === id); if (k) { openTask(r, k); return; } }
|
|
1421
|
+
for (const r of rows) { const k = ((r.track && r.track.tickets) || []).find((x) => x.key === id); if (k) { BI.openTicket(r, k, null); return; } }
|
|
1422
|
+
say('That task is not on this Board. It may have moved to another product or been deleted.');
|
|
1423
|
+
}
|
|
1411
1424
|
/* The address follows the initiative or program open in the Viewer (?focus=, ?program=), so Back from another page comes back to it
|
|
1412
1425
|
* (batch 14 item 7). The Viewer writes it once the history has settled on the entry the Board shows. */
|
|
1413
1426
|
VW.onChange((d) => {
|
|
@@ -1478,7 +1491,7 @@ async function load() {
|
|
|
1478
1491
|
LE.loaded({ since, stale: !!r.stale }); // a change still saving stays on the new read; open views (the big Work breakdown) follow it
|
|
1479
1492
|
STRAT.refresh($('#cStrat'), { ws: M.board.ws || null, board: M.board.id || null, single: !ALL, say });
|
|
1480
1493
|
PRIN.refresh($('#cPrin'), { ws: M.board.ws || null, single: !ALL, say });
|
|
1481
|
-
focusOnce(); programOnce(); newOnce(); loadOthers(); loadWorkflows();
|
|
1494
|
+
focusOnce(); taskOnce(); programOnce(); newOnce(); loadOthers(); loadWorkflows();
|
|
1482
1495
|
if (r.stale) setTimeout(load, 2000); // a press is still being derived: ask again
|
|
1483
1496
|
else { loadTrail(); loadGrill(); }
|
|
1484
1497
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* pm/short-link.js — the page side of a short link for every item (bet A428, initiative item-short-links). The server side and the rules are
|
|
2
|
+
* lib/short-links.js; this module makes the same links.
|
|
3
|
+
*
|
|
4
|
+
* linkPath({ kind, id, ws? }) → '/i/t/IDPF-12?w=idpf' | null kind: initiative | task | milestone | decision
|
|
5
|
+
* linkOf(o) → { kind, id, ws } | null what a Viewer item names: its own o.link (a task, a milestone, a decision)
|
|
6
|
+
* An initiative's link is Copy › Link in the one initiative ⋯ (pm/ini-more.js), built by bd-ini-panel.js and home-ini.js with linkPath.
|
|
7
|
+
* copyLink(link) → copies the full address (this PMOS's origin + the path) and says so in the page's toast; logs shortLinkCopy
|
|
8
|
+
*
|
|
9
|
+
* Opening the link: in its panel on a desk, full screen on a phone (the Viewer does that at 760 px or less). Nothing here sends anything:
|
|
10
|
+
* the copy is the person's own press. */
|
|
11
|
+
const KINDS = { initiative: 'i', task: 't', milestone: 'm', decision: 'd' };
|
|
12
|
+
const ID_RE = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,119}$/;
|
|
13
|
+
const WS_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,79}$/;
|
|
14
|
+
|
|
15
|
+
export function linkPath(item) {
|
|
16
|
+
if (!item || !Object.prototype.hasOwnProperty.call(KINDS, item.kind)) return null;
|
|
17
|
+
const id = String(item.id == null ? '' : item.id);
|
|
18
|
+
if (!ID_RE.test(id)) return null;
|
|
19
|
+
const ws = item.ws && WS_RE.test(String(item.ws)) ? String(item.ws) : '';
|
|
20
|
+
return '/i/' + KINDS[item.kind] + '/' + id + (ws ? '?w=' + encodeURIComponent(ws) : '');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function linkOf(o) {
|
|
24
|
+
if (!o || !o.link || !linkPath(o.link)) return null;
|
|
25
|
+
return { kind: o.link.kind, id: String(o.link.id), ws: o.link.ws || '' };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export async function copyLink(link) {
|
|
29
|
+
const p = linkPath(link); if (!p) return false;
|
|
30
|
+
const url = location.origin + p;
|
|
31
|
+
try { import('./use-log.js').then((U) => { if (U && typeof U.noteUse === 'function') U.noteUse('shortLinkCopy'); }).catch(() => {}); } catch { /* the log is optional */ }
|
|
32
|
+
const { copyText } = await import('./cozy-xv.js');
|
|
33
|
+
await copyText(url, 'Link copied. It opens this ' + (link.kind === 'decision' ? 'decision' : link.kind) + ' on any device.');
|
|
34
|
+
return true;
|
|
35
|
+
}
|
package/workspace/server.js
CHANGED
|
@@ -7396,6 +7396,14 @@ async function handleRequest(req, res) {
|
|
|
7396
7396
|
}, (e) => { res.writeHead(500); res.end(String(e && e.message)); });
|
|
7397
7397
|
});
|
|
7398
7398
|
}
|
|
7399
|
+
// A short link for every item (bet A428, lib/short-links.js): /i/<k>/<id> goes to the page that opens it, in its panel on a desk and full
|
|
7400
|
+
// screen on a phone. Each open is one shortLinkOpen line in the local use log.
|
|
7401
|
+
if (p.startsWith('/i/')) {
|
|
7402
|
+
const r = require('./lib/short-links.js').resolve(p, url.searchParams, { runtimeDir: STATE, ua: req.headers['user-agent'] });
|
|
7403
|
+
// (Location starts with the literal '/i/' so run-tests.js --changed reads this block as a redirect of /i/ and runs only the suites that name it)
|
|
7404
|
+
res.writeHead(302, { Location: '/i/' === p ? '/premium-viewer.html' : r.location, 'Cache-Control': 'no-store' });
|
|
7405
|
+
return res.end();
|
|
7406
|
+
}
|
|
7399
7407
|
// claude-onboarding-build: first run is a conversation in Home now. The old Welcome pages (/welcome and the three-step /premium-welcome.html)
|
|
7400
7408
|
// open Home's project setup; their old query (?ws=, ?step=) has nothing left to say there.
|
|
7401
7409
|
if (p === '/welcome' || p === '/welcome.html' || p === '/premium-welcome' || p === '/premium-welcome.html') {
|
|
@@ -237,6 +237,12 @@ async function pure() {
|
|
|
237
237
|
ok('D4 a day typed in Due ("5 Nov") and Enter sets the due day and closes the picker', await until(() => last(A, '/api/boards/tasks/edit').body.due === '2026-11-05') && await until(() => p.evaluate((c) => !document.querySelector(c + ' .tkc-dp'), C)), JSON.stringify(last(A, '/api/boards/tasks/edit')));
|
|
238
238
|
await p.click(C + ' [data-tkc="dates"]');
|
|
239
239
|
await until(() => p.evaluate((c) => !!document.querySelector(c + ' .tkc-dp'), C));
|
|
240
|
+
// the week and month keys: Home and End go to the week's Monday and Sunday, Page Down and Page Up move a month
|
|
241
|
+
await p.focus(C + ' .tkc-dp .rp-g [tabindex="0"]');
|
|
242
|
+
const fd = () => p.evaluate(() => (document.activeElement || {}).dataset && document.activeElement.dataset.rpDay);
|
|
243
|
+
const wk = [await fd()];
|
|
244
|
+
for (const k of ['Home', 'End', 'PageDown', 'PageUp']) { await p.keyboard.press(k); wk.push(await fd()); }
|
|
245
|
+
ok('D4 the keys: Home and End go to the week ends, Page Down and Page Up move a month and redraw it', wk.join() === '2026-10-23,2026-10-19,2026-10-25,2026-11-25,2026-10-25', JSON.stringify(wk));
|
|
240
246
|
await p.mouse.click(5, 5);
|
|
241
247
|
ok('D4 a press outside closes the picker', await until(() => p.evaluate((c) => !document.querySelector(c + ' .tkc-dp'), C)));
|
|
242
248
|
// owner
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "A short link for every item (initiative item-short-links, bet A428, done test S1-S7): /i/<k>/<id> opens the item in its panel on a desktop and full screen on a phone; Copy link in the Viewer's ⋯. Pure checks and source reads. No browser, no network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"short-links.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"short-links.test.js": 5
|
|
8
|
+
}
|
|
9
|
+
}
|