create-pmos 0.351.0 → 0.352.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 +18 -13
- 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-sources-test.js +6 -5
- package/workspace/briefing-premium-test.js +7 -5
- package/workspace/changelog.json +17 -0
- package/workspace/fixtures/html-viewer-report.html +49 -0
- package/workspace/guide/briefing-premium.md +2 -2
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-html-viewer-test.js +139 -0
- package/workspace/premium-vw-backlog-test.js +1 -0
- package/workspace/public/pm/premium-vw-doc.css +4 -0
- package/workspace/public/pm/premium-vw-file.js +33 -6
- package/workspace/public/pm/premium.css +7 -0
- package/workspace/public/pm/premium.js +14 -1
- package/workspace/test-lists/premium-html-viewer.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.352.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": {
|
|
@@ -32,6 +32,23 @@
|
|
|
32
32
|
"audit"
|
|
33
33
|
],
|
|
34
34
|
"pmosChanges": [
|
|
35
|
+
{
|
|
36
|
+
"v": "0.352.0",
|
|
37
|
+
"at": "2026-10-20T08:20:25.043Z",
|
|
38
|
+
"f": 2,
|
|
39
|
+
"prs": [
|
|
40
|
+
{
|
|
41
|
+
"n": 944,
|
|
42
|
+
"t": "Briefing \"What you need to do\" rows are two lines",
|
|
43
|
+
"s": "Each row is two lines, the title and then \"subject · next step\", with a chevron, as in item 5 of the premium-simple-ui mockup."
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"n": 952,
|
|
47
|
+
"t": "An .html file Claude names opens in the viewer as its page, not its source",
|
|
48
|
+
"s": "The tab draws the page itself, with its toggles and charts working."
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
35
52
|
{
|
|
36
53
|
"v": "0.351.0",
|
|
37
54
|
"at": "2026-10-20T07:13:35.370Z",
|
|
@@ -279,18 +296,6 @@
|
|
|
279
296
|
"s": "Menu rows grow with their text and keep their old height as the minimum."
|
|
280
297
|
}
|
|
281
298
|
]
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
"v": "0.332.0",
|
|
285
|
-
"at": "2026-10-20T01:00:38.017Z",
|
|
286
|
-
"f": 2,
|
|
287
|
-
"prs": [
|
|
288
|
-
{
|
|
289
|
-
"n": 927,
|
|
290
|
-
"t": "The Checker can no longer spend the whole daily cap",
|
|
291
|
-
"s": "The Checker gets a share of the cap."
|
|
292
|
-
}
|
|
293
|
-
]
|
|
294
299
|
}
|
|
295
300
|
]
|
|
296
301
|
}
|
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-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-20T08:20:20Z"}
|
|
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-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-20T08:20:20Z"}
|
|
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-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-20T08:20:20Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -94,14 +94,15 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
|
|
|
94
94
|
|
|
95
95
|
{
|
|
96
96
|
const { ctx, page, errors } = await open();
|
|
97
|
-
const rows = await page.$$eval('#rank .rr', (els) => els.map((e) => ({ key: e.dataset.key, title: e.querySelector('.rt').textContent.replace('Do this first', ''),
|
|
98
|
-
ok('S2 the first row
|
|
99
|
-
ok('S2 a row with a verb and no prepared line shows the verb alone', rows[1] &&
|
|
97
|
+
const rows = await page.$$eval('#rank .rr', (els) => els.map((e) => ({ key: e.dataset.key, title: e.querySelector('.rt').textContent.replace('Do this first', ''), line2: e.querySelector('.rs').textContent, old: e.querySelectorAll('.sug, .skip').length })));
|
|
98
|
+
ok('S2 the first row is two lines: the title, then the source and sender · the verb and the prepared line', rows[0] && rows[0].line2 === 'Across productsMail · Anna Lee · Reply: Confirm Thursday' && rows[0].old === 0, JSON.stringify(rows[0]));
|
|
99
|
+
ok('S2 a row with a verb and no prepared line shows the verb alone', rows[1] && /Confluence · Budi Santoso · Sign off$/.test(rows[1].line2), JSON.stringify(rows[1]));
|
|
100
100
|
ok('S6 the dock counts the rows', (await page.textContent('#dN')) === '4', await page.textContent('#dN'));
|
|
101
101
|
await page.click('#rank .rr:first-child .rhd');
|
|
102
102
|
await page.waitForSelector('#srcLink');
|
|
103
103
|
const link = await page.$eval('#srcLink', (a) => ({ href: a.href, target: a.target, rel: a.rel, h: Math.round(a.getBoundingClientRect().height) }));
|
|
104
104
|
ok('S3 the dialog opens the item\'s https link in a new tab', link.href === 'https://mail.example/t/1' && link.target === '_blank' && /noopener/.test(link.rel), JSON.stringify(link));
|
|
105
|
+
ok('S2 the row\'s why now is in its dialog', /Why now\s*Why aaaaaaaaaaa1/.test(await page.textContent('#card')), await page.textContent('#card'));
|
|
105
106
|
ok('S3 the dialog offers nothing that records or sends', (await page.$('#recBtn')) === null && (await page.$('[data-until]')) === null && (await page.$('#dBody [data-op]')) === null);
|
|
106
107
|
ok('S11 the link is at least 44 px high', link.h >= 44, String(link.h));
|
|
107
108
|
await page.keyboard.press('Escape');
|
|
@@ -130,7 +131,7 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
|
|
|
130
131
|
/* S11 fidelity: the source row against the mockup's second row, the digest against the mockup's Today item */
|
|
131
132
|
if (!fs.existsSync(MOCKUP)) ok('S11 the mockup is in the repository', false, MOCKUP);
|
|
132
133
|
else {
|
|
133
|
-
const PAIRS = [['row', '#rank .rr:nth-child(2)'], ['number', '#rank .rr:nth-child(2) .rn'], ['title', '#rank .rr:nth-child(2) .rt'], ['subject', '#rank .rr:nth-child(2) .rs'], ['
|
|
134
|
+
const PAIRS = [['row', '#rank .rr:nth-child(2)'], ['number', '#rank .rr:nth-child(2) .rn'], ['title', '#rank .rr:nth-child(2) .rt'], ['subject', '#rank .rr:nth-child(2) .rs'], ['event', '#tl .ev:not(:first-of-type)'], ['eventTime', '#tl .ev:not(:first-of-type) time'], ['eventTitle', '#tl .ev:not(:first-of-type) b']];
|
|
134
135
|
const PROPS = ['fontSize', 'fontWeight', 'fontFamily', 'color', 'backgroundColor', 'borderRadius', 'paddingTop', 'paddingLeft', 'letterSpacing', 'lineHeight', 'boxShadow', 'borderTopColor'];
|
|
135
136
|
const grab = (pg, sel) => pg.evaluate(([pairs, props]) => { const o = {}; for (const [n, s] of pairs) { const e = /^#tl/.test(s) && window.__ev ? window.__ev(s) : document.querySelector(s); if (!e) { o[n] = null; continue; } const cs = getComputedStyle(e), r = e.getBoundingClientRect(), v = { left: Math.round(r.left), width: Math.round(r.width) }; props.forEach((k) => { v[k] = cs[k]; }); o[n] = v; } return o; }, [sel, PROPS]);
|
|
136
137
|
for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
|
|
@@ -146,7 +147,7 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
|
|
|
146
147
|
for (const [n] of PAIRS) {
|
|
147
148
|
if (!a[n] || !c[n]) { diffs.push(n + ' missing'); continue; }
|
|
148
149
|
for (const k of Object.keys(a[n])) {
|
|
149
|
-
if (k === 'left' || k === 'width') { if (['row', 'number', 'title', 'subject', '
|
|
150
|
+
if (k === 'left' || k === 'width') { if (['row', 'number', 'title', 'subject', 'event', 'eventTime', 'eventTitle'].includes(n) && (k === 'left' || n !== 'row' && n !== 'event' && n !== 'eventTime')) continue; }
|
|
150
151
|
if ((k === 'left' || k === 'width') ? Math.abs(a[n][k] - c[n][k]) > 2 : a[n][k] !== c[n][k]) diffs.push(`${n}.${k} ${a[n][k]} | ${c[n][k]}`);
|
|
151
152
|
}
|
|
152
153
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* fixture (fixtures/briefing-premium-facts.js), so the page is checked against known data.
|
|
6
6
|
* R1 the rail, the dock, the page opens at /premium.html and the console stays the default page
|
|
7
7
|
* R2 the hero is the model's sentences, with the numbers marked
|
|
8
|
-
* R4 rows: numbered, one "Do this first",
|
|
8
|
+
* R4 rows: numbered, one "Do this first", two lines each (title, then subject · next step), "If you skip" in the dialog, Detail first on a phone
|
|
9
9
|
* R5 "N of M done" counts rows that cleared since the page first read today
|
|
10
10
|
* R7 Today: Ahead, a now marker, Earlier today, source chips that filter
|
|
11
11
|
* R8 the dock count equals the list count
|
|
@@ -214,11 +214,12 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
214
214
|
ok('R2 the date line is the model\'s', await p.evaluate((d) => document.querySelector('#date').textContent === d, MODEL.date));
|
|
215
215
|
|
|
216
216
|
/* R3, R4 */
|
|
217
|
-
const rows = await p.evaluate(() => [...document.querySelectorAll('#rank .rr')].map((r) => ({ n: r.querySelector('.rn').textContent, t: r.querySelector('.rt').childNodes[0].textContent, skip:
|
|
217
|
+
const rows = await p.evaluate(() => [...document.querySelectorAll('#rank .rr')].map((r) => ({ n: r.querySelector('.rn').textContent, t: r.querySelector('.rt').childNodes[0].textContent, skip: r.querySelectorAll('.skip, .sug').length, line2: r.querySelector('.rs').textContent, chev: !!r.querySelector('.rchev'), first: !!r.querySelector('.tgf') })));
|
|
218
218
|
ok('R3 the rows follow the model\'s order', rows.map((r) => r.t).join('|') === MODEL.list.rows.map((r) => r.title).join('|'), JSON.stringify(rows.map((r) => r.t)));
|
|
219
219
|
ok('R4 rows are numbered 01, 02, …', rows.map((r) => r.n).join() === '01,02,03,04,05');
|
|
220
220
|
ok('R4 exactly one row says Do this first, and it is the first', rows.filter((r) => r.first).length === 1 && rows[0].first);
|
|
221
|
-
ok('R4 every row
|
|
221
|
+
ok('R4 every row is two lines: the title, then subject · next step, with a chevron and no "If you skip" line', rows.every((r) => r.skip === 0 && r.chev && r.line2) && MODEL.list.rows.every((m, i) => rows[i].line2.startsWith(m.subject)), JSON.stringify(rows.map((r) => r.line2)));
|
|
222
|
+
ok('R4 a row with a next step on record shows it after the subject', MODEL.list.rows.every((m, i) => !/^Next step: /.test(m.prepared) || rows[i].line2 === m.subject + ' · ' + m.prepared.replace(/^Next step: /, '')));
|
|
222
223
|
ok('R3 the order line is shown', await p.evaluate(() => /blocked work first, then decisions only you can make/.test(document.querySelector('#order').textContent)));
|
|
223
224
|
|
|
224
225
|
/* R5 */
|
|
@@ -613,6 +614,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
613
614
|
ok(`R11 no sideways scroll at 390 px (${th})`, ov <= 0, String(ov));
|
|
614
615
|
await R.page.click('#rank .rhd');
|
|
615
616
|
const ph = await until(() => R.page.evaluate(() => document.querySelector('#dlg').classList.contains('on')), 3000) && await R.page.evaluate(() => ({ tab: document.querySelector('#dGrid').dataset.tab, pressed: document.querySelector('#dTabs [data-t="out"]').getAttribute('aria-pressed'), tabsShown: getComputedStyle(document.querySelector('#dTabs')).display !== 'none', paneBtn: getComputedStyle(document.querySelector('#dPane')).display, w: Math.round(document.querySelector('#dlg').getBoundingClientRect().width), l: Math.round(document.querySelector('#dlg').getBoundingClientRect().left), vw: innerWidth, btn: document.querySelector('#dPane').getAttribute('aria-pressed'), ov: document.documentElement.scrollWidth - innerWidth }));
|
|
617
|
+
ok(`R4 the row's dialog says what skipping costs (${th})`, await R.page.evaluate(() => /If you skip/.test(document.querySelector('#card').textContent)), await R.page.evaluate(() => document.querySelector('#card').textContent.slice(0, 300)));
|
|
616
618
|
ok(`R4 on a phone the dialog opens on Detail, with the mockup's Detail / Conversation switch and no panel button (${th})`, ph && ph.tab === 'out' && ph.pressed === 'true' && ph.tabsShown && ph.paneBtn === 'none' && ph.l === 0 && ph.w === ph.vw && ph.ov <= 0, JSON.stringify(ph));
|
|
617
619
|
ok(`0 no page error at 390 px (${th})`, R.errors.length === 0, R.errors.join(' | '));
|
|
618
620
|
await R.ctx.close();
|
|
@@ -629,7 +631,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
629
631
|
/* R12 fidelity: computed styles and geometry against the mockup */
|
|
630
632
|
if (!fs.existsSync(MOCKUP)) ok('R12 the mockup is in the repository', false, MOCKUP);
|
|
631
633
|
else {
|
|
632
|
-
const PAIRS = [['rail', '.rail'], ['name', '.top .name'], ['date', '.hero .date'], ['brief', '.brief'], ['card', '.cols2>div:first-child .card'], ['today', '#todayCard'], ['heading', '#hMoves'], ['row', '.rr'], ['number', '.rr .rn'], ['title', '.rr .rt'], ['subject', '.rr .rs'], ['
|
|
634
|
+
const PAIRS = [['rail', '.rail'], ['name', '.top .name'], ['date', '.hero .date'], ['brief', '.brief'], ['card', '.cols2>div:first-child .card'], ['today', '#todayCard'], ['heading', '#hMoves'], ['row', '.rr'], ['number', '.rr .rn'], ['title', '.rr .rt'], ['subject', '.rr .rs'], ['tag', '.tgf'], ['group', '#tl .grp'], ['event', '#tl .ev'], ['now', '.nowl'], ['dock', '.dock']];
|
|
633
635
|
const SKIP_GEOM = { 1280: [], 390: ['heading'] }; // D5: on a phone the card heading wraps its caption under the title (the mockup wrapped the title over four lines)
|
|
634
636
|
const PROPS = ['fontSize', 'fontWeight', 'fontFamily', 'color', 'backgroundColor', 'borderRadius', 'paddingTop', 'paddingLeft', 'letterSpacing', 'lineHeight', 'boxShadow', 'backdropFilter', 'borderTopColor'];
|
|
635
637
|
const grab = (pg) => pg.evaluate(([pairs, props]) => { const o = {}; for (const [n, s] of pairs) { const e = document.querySelector(s); if (!e) { o[n] = null; continue; } const cs = getComputedStyle(e), r = e.getBoundingClientRect(), v = { left: Math.round(r.left), width: Math.round(r.width) }; props.forEach((k) => { v[k] = cs[k]; }); o[n] = v; } return o; }, [PAIRS, PROPS]);
|
|
@@ -646,7 +648,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
646
648
|
if (!a[n] || !c[n]) { diffs.push(n + ' missing'); continue; }
|
|
647
649
|
for (const k of Object.keys(a[n])) {
|
|
648
650
|
if ((k === 'left' || k === 'width') && (SKIP_GEOM[w].includes(n) || ['tag', 'brief', 'now', 'event'].includes(n) && k === 'left')) continue;
|
|
649
|
-
if (k === 'width' && ['tag', 'brief', 'title', 'subject'
|
|
651
|
+
if (k === 'width' && ['tag', 'brief', 'title', 'subject'].includes(n)) continue; // D8: the row text leaves room for the pin, so its lines are narrower
|
|
650
652
|
if ((k === 'left' || k === 'width') ? Math.abs(a[n][k] - c[n][k]) > 2 : a[n][k] !== c[n][k]) diffs.push(`${n}.${k} ${a[n][k]} | ${c[n][k]}`);
|
|
651
653
|
}
|
|
652
654
|
}
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.352.0",
|
|
4
|
+
"at": "2026-10-20T08:20:25.043Z",
|
|
5
|
+
"f": 2,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 944,
|
|
9
|
+
"t": "Briefing \"What you need to do\" rows are two lines",
|
|
10
|
+
"s": "Each row is two lines, the title and then \"subject · next step\", with a chevron, as in item 5 of the premium-simple-ui mockup."
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"n": 952,
|
|
14
|
+
"t": "An .html file Claude names opens in the viewer as its page, not its source",
|
|
15
|
+
"s": "The tab draws the page itself, with its toggles and charts working."
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
},
|
|
2
19
|
{
|
|
3
20
|
"v": "0.351.0",
|
|
4
21
|
"at": "2026-10-20T07:13:35.370Z",
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>Password Conversion Funnel</title>
|
|
7
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500&display=swap">
|
|
8
|
+
<style>
|
|
9
|
+
:root{--bg:#f5f6f4;--panel:#fff;--fg:#1d2421;--muted:#5d6963;--accent:#1f6f5c;--track:#e6ebe8;color-scheme:light}
|
|
10
|
+
@media (prefers-color-scheme:dark){:root{--bg:#101513;--panel:#171d1a;--fg:#e6ece9;--muted:#9aa8a1;--accent:#7fc9b3;--track:#232c28;color-scheme:dark}}
|
|
11
|
+
body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.55 "IBM Plex Sans",system-ui,sans-serif}
|
|
12
|
+
main{max-width:960px;margin:0 auto;padding:24px 16px}
|
|
13
|
+
h1{font-size:24px;margin:0 0 4px}
|
|
14
|
+
p.sub{color:var(--muted);margin:0 0 18px}
|
|
15
|
+
.tg{display:inline-flex;gap:4px;margin-bottom:16px}
|
|
16
|
+
.tg button{font:inherit;padding:6px 12px;border-radius:6px;border:1px solid var(--track);background:var(--panel);color:var(--fg);cursor:pointer}
|
|
17
|
+
.tg button[aria-pressed="true"]{background:var(--accent);color:var(--bg)}
|
|
18
|
+
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px}
|
|
19
|
+
.pn{background:var(--panel);border-radius:10px;padding:16px}
|
|
20
|
+
.row{margin:10px 0}.row span{display:flex;justify-content:space-between;font-size:13px}
|
|
21
|
+
.bar{height:10px;background:var(--track);border-radius:5px;overflow:hidden}.bar i{display:block;height:100%;background:var(--accent)}
|
|
22
|
+
</style>
|
|
23
|
+
</head>
|
|
24
|
+
<body>
|
|
25
|
+
<main>
|
|
26
|
+
<h1>Password Conversion Funnel</h1>
|
|
27
|
+
<p class="sub">Lightbox, 19 Oct · single-day snapshot</p>
|
|
28
|
+
<div class="tg" role="group" aria-label="Count"><button type="button" data-m="events" aria-pressed="true">Events</button><button type="button" data-m="users" aria-pressed="false">Users</button></div>
|
|
29
|
+
<div class="grid" id="grid"></div>
|
|
30
|
+
</main>
|
|
31
|
+
<script>
|
|
32
|
+
const D = { events: { 'Sign-up (RF-01)': [1840, 1210, 702], 'Login (RF-02)': [5320, 4980, 4410] }, users: { 'Sign-up (RF-01)': [1310, 930, 588], 'Login (RF-02)': [3900, 3720, 3390] } };
|
|
33
|
+
const STEPS = ['Started', 'Submitted', 'Success'];
|
|
34
|
+
function draw(m) {
|
|
35
|
+
document.getElementById('grid').innerHTML = Object.entries(D[m]).map(([name, v]) => '<section class="pn"><h2 style="font-size:16px;margin:0 0 8px">' + name + '</h2>'
|
|
36
|
+
+ v.map((n, i) => '<div class="row"><span><b>' + STEPS[i] + '</b><span>' + n.toLocaleString('en') + ' · ' + Math.round(n / v[0] * 100) + '%</span></span><div class="bar"><i style="width:' + (n / v[0] * 100) + '%"></i></div></div>').join('') + '</section>').join('');
|
|
37
|
+
document.querySelectorAll('.tg button').forEach((b) => b.setAttribute('aria-pressed', String(b.dataset.m === m)));
|
|
38
|
+
document.body.dataset.mode = m;
|
|
39
|
+
}
|
|
40
|
+
document.querySelector('.tg').onclick = (e) => { const b = e.target.closest('button'); if (b) draw(b.dataset.m); };
|
|
41
|
+
draw('events');
|
|
42
|
+
// what the viewer must keep from the page: the app's document, its storage and the network
|
|
43
|
+
let parentRead = 'blocked'; try { parentRead = String(window.parent.document.title); } catch (e) { /* opaque origin */ }
|
|
44
|
+
let store = 'blocked'; try { localStorage.setItem('x', '1'); store = 'open'; } catch (e) { /* opaque origin */ }
|
|
45
|
+
document.body.dataset.parent = parentRead; document.body.dataset.store = store;
|
|
46
|
+
fetch('/api/sessions').then(() => { document.body.dataset.net = 'open'; }, () => { document.body.dataset.net = 'blocked'; });
|
|
47
|
+
</script>
|
|
48
|
+
</body>
|
|
49
|
+
</html>
|
|
@@ -113,7 +113,7 @@ The list is the console's **Needs you**: the same rows, in the same order, from
|
|
|
113
113
|
|
|
114
114
|
Each row is a thing that waits for you. The order is fixed: blocked work first, then decisions only you can make, then what has waited longest. The first row is tagged "Do this first".
|
|
115
115
|
|
|
116
|
-
A row has a verb-first title, the subject
|
|
116
|
+
A row has two lines: a verb-first title, then the subject and what the repository says is next, joined by a dot. When the line is too long it ends in "…"; the full text is in the row's dialog. "If you skip", which says what stays blocked, is in the dialog too. Press a row to open it. Detail opens first, and the conversation sits beside it. On a phone, the Detail tab is first.
|
|
117
117
|
|
|
118
118
|
The header counts "N of M done". A row counts as done when the record behind it changes, so a row clears by itself. Nothing on this page presses Done for you. The count starts again each day and is kept on this device.
|
|
119
119
|
|
|
@@ -391,7 +391,7 @@ The conversation beside every premium dialog is a real Claude Code session. Anyt
|
|
|
391
391
|
- **What it may do** is set by your own Claude Code settings. Claude can change files and run commands. When your settings say to ask first, the question shows in the panel with its options; press one to answer.
|
|
392
392
|
- **Stop** shows while Claude works. It presses Esc in the session.
|
|
393
393
|
- **The conversation** is Claude Code's own record, word for word. Claude's answers are formatted as Claude Code formats them: headings, bold, lists, code, tables, quotes and links (links open in a new tab). Your messages keep their line breaks, and a paste shows without the tags Claude Code wraps around it. A run of tool calls shows as one small grey line, for example "Used Read ×2, slack_read_thread". A connector tool shows its short name.
|
|
394
|
-
- **A file Claude names** (a path such as `briefs/drafts/plan.md`, or a link to one) is underlined. Press it to read the file beside the conversation, as a tab in the viewer; on a phone, the Detail side shows it. Markdown shows as a page and other text files as code. It is read-only. While the tab is open it shows the newest version, so a file Claude is still writing stays current. A file outside the workspaces PMOS serves says "Not in a workspace" and is not read.
|
|
394
|
+
- **A file Claude names** (a path such as `briefs/drafts/plan.md`, or a link to one) is underlined. Press it to read the file beside the conversation, as a tab in the viewer; on a phone, the Detail side shows it. Markdown shows as a page, an HTML file shows as the page it draws (press **Source** for its code), and other text files show as code. An HTML page runs its own scripts, so its toggles and charts work, but it cannot reach PMOS or the internet: a web font falls back to the system font. It is read-only. While the tab is open it shows the newest version, so a file Claude is still writing stays current. A file outside the workspaces PMOS serves says "Not in a workspace" and is not read.
|
|
395
395
|
- **A link to a Google Doc or a Confluence page** opens beside the conversation too, as the viewer shows a copy: the text PMOS has read, or **Read it now**. **A Claude artifact link** opens a tab with **Open in Claude**: claude.ai does not let another site show an artifact inside it. Other links open in a new browser tab.
|
|
396
396
|
- **The session** is also listed in **Agent sessions** and in the console, where you can open its terminal. When it has ended, your next message starts a new one.
|
|
397
397
|
- Answers from the older read-only agent stay above the session, marked "Earlier read-only answer".
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.352.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.352.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* premium-html-viewer-test.js — an .html file Claude names in a premium chat panel opens in the viewer as the page it is (bug 2026-10-20: "HTML file
|
|
4
|
+
* didn't render properly": the viewer printed the report's source in a code block). public/pm/premium-vw-file.js draws it in a frame sandboxed to
|
|
5
|
+
* allow-scripts only, under a CSP that blocks every fetch, with Page and Source on its bar. The real premium page and server; the file reads are routed.
|
|
6
|
+
* H1 the page renders, standards mode, its own scripts run (the report's toggle redraws its bars)
|
|
7
|
+
* H2 the page cannot reach the app: no parent document, no storage, no fetch, and no request leaves for the remote font
|
|
8
|
+
* H3 Source shows the file's text, Page brings the page back
|
|
9
|
+
* H4 a markdown and a plain text file still open as before
|
|
10
|
+
* H5 framedSrc() puts the CSP after the doctype, and before everything when there is none
|
|
11
|
+
* PMOS_SHOTS=<dir> also saves the viewer at 1280 and 390, light and dark (PMOS_SHOTS_TAG=before: the shots alone, for the code before a change). */
|
|
12
|
+
const fs = require('fs');
|
|
13
|
+
const path = require('path');
|
|
14
|
+
const { spawn } = require('child_process');
|
|
15
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
16
|
+
const T = require('./test-run').configure({ name: 'premium-html-viewer' });
|
|
17
|
+
|
|
18
|
+
const BASE = T.BASE;
|
|
19
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
20
|
+
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
21
|
+
const results = [];
|
|
22
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
|
|
23
|
+
let srv = null; let browser = null;
|
|
24
|
+
const finish = async (code) => {
|
|
25
|
+
if (browser) await browser.close().catch(() => {});
|
|
26
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
27
|
+
T.killTmux();
|
|
28
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
29
|
+
console.log(`\n${results.length - bad}/${results.length} premium-html-viewer assertions passed`);
|
|
30
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
31
|
+
};
|
|
32
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
33
|
+
|
|
34
|
+
const REPORT = fs.readFileSync(path.join(__dirname, 'fixtures', 'html-viewer-report.html'), 'utf8');
|
|
35
|
+
const FILES = {
|
|
36
|
+
'pmos/state/reports/lightbox-password-conversion/2026-10-19.html': { kind: 'html', text: REPORT },
|
|
37
|
+
'pmos/state/reports/lightbox-password-conversion/2026-10-19.md': { kind: 'markdown', text: '# Funnel\n\nThe **sign-up** rate is 38%.' },
|
|
38
|
+
'workspace/lib/a.js': { kind: 'text', text: 'const a = 1;\n' },
|
|
39
|
+
};
|
|
40
|
+
const SHOTS = process.env.PMOS_SHOTS || '', TAG = process.env.PMOS_SHOTS_TAG || 'after'; // TAG=before skips the checks and only saves the shots
|
|
41
|
+
|
|
42
|
+
(async () => {
|
|
43
|
+
{
|
|
44
|
+
const M = await import('./public/pm/premium-vw-file.js');
|
|
45
|
+
if (typeof M.framedSrc !== 'function') ok('H5 premium-vw-file.js exports framedSrc', false);
|
|
46
|
+
else {
|
|
47
|
+
const a = M.framedSrc('<!doctype html><html><head></head></html>'), b = M.framedSrc('<p>x</p>'), c = M.framedSrc('<!-- c -->\n<!DOCTYPE html>\n<html>');
|
|
48
|
+
ok('H5 the CSP goes right after the doctype, and first when there is none', a.startsWith('<!doctype html><meta http-equiv="Content-Security-Policy"') && b.startsWith('<meta http-equiv="Content-Security-Policy"') && /^<!-- c -->\n<!DOCTYPE html><meta /.test(c), [a, b, c].join(' | '));
|
|
49
|
+
ok('H5 the CSP blocks every fetch and names no script host', /default-src 'none'/.test(M.FRAME_CSP) && /script-src 'unsafe-inline'$/.test(M.FRAME_CSP) && !/connect-src|https?:/.test(M.FRAME_CSP));
|
|
50
|
+
const src = M.fileHtml({ name: 'r.html', kind: 'html', text: '<b>"x"</b>', rel: 'r.html' });
|
|
51
|
+
ok('H5 the frame is sandboxed to scripts alone', /sandbox="allow-scripts"/.test(src) && !/allow-same-origin/.test(src), src);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const exe = findBrowser();
|
|
55
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the premium-html-viewer suite cannot run'); return finish(1); }
|
|
56
|
+
let chromium;
|
|
57
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed — the premium-html-viewer suite cannot run'); return finish(1); }
|
|
58
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
59
|
+
await T.waitForServer(BASE);
|
|
60
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
61
|
+
|
|
62
|
+
const open = async ({ w = 1280, h = 900, theme = 'light' } = {}) => {
|
|
63
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h }, colorScheme: theme });
|
|
64
|
+
const out = [];
|
|
65
|
+
// a request the CSP refuses still shows as a request; one that left the machine finishes (or fails on the network, not on csp)
|
|
66
|
+
ctx.on('requestfinished', (r) => { if (!r.url().startsWith(BASE) && /^https?:/.test(r.url())) out.push(r.url()); });
|
|
67
|
+
ctx.on('requestfailed', (r) => { if (!r.url().startsWith(BASE) && /^https?:/.test(r.url()) && (r.failure() || {}).errorText !== 'csp') out.push(r.url()); });
|
|
68
|
+
const page = await ctx.newPage();
|
|
69
|
+
const errors = [];
|
|
70
|
+
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
71
|
+
const json = (body) => (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify(body) });
|
|
72
|
+
await page.route('**/api/brief-page*', json({ ok: false, error: 'off in this suite' }));
|
|
73
|
+
await page.route('**/api/doc/locate*', (r) => {
|
|
74
|
+
const p = new URL(r.request().url()).searchParams.get('path'), f = FILES[p];
|
|
75
|
+
return json(f ? { ok: true, ws: 'w0', rel: p, abs: '/Users/pm/pmos/' + p, name: p.split('/').pop(), mtime: 1, size: f.text.length } : { ok: false, reason: 'missing', why: 'No such file.' })(r);
|
|
76
|
+
});
|
|
77
|
+
await page.route('**/api/doc?*', (r) => {
|
|
78
|
+
const f = FILES[new URL(r.request().url()).searchParams.get('path')];
|
|
79
|
+
return r.fulfill({ status: 200, contentType: f.kind === 'markdown' ? 'text/markdown' : 'text/plain', headers: { 'X-Doc-Kind': f.kind }, body: f.text });
|
|
80
|
+
});
|
|
81
|
+
await page.goto(BASE + '/premium.html?theme=' + theme);
|
|
82
|
+
await until(() => page.evaluate(() => !!document.querySelector('#dlg')), 15000);
|
|
83
|
+
await page.evaluate(async () => {
|
|
84
|
+
const S = await import('/pm/premium-shell.js');
|
|
85
|
+
S.openDlg({ eye: 'Your item', title: 'Check GA Lightbox', say: 'The report is now an HTML file in the repo.', noteKey: null, pane: '<article class="paper doc"><p>Item record</p></article>', label: 'Item record' });
|
|
86
|
+
});
|
|
87
|
+
return { ctx, page, errors, out };
|
|
88
|
+
};
|
|
89
|
+
const press = (page, file) => page.evaluate((f) => {
|
|
90
|
+
const b = document.createElement('button'); b.type = 'button'; b.className = 'fpath'; b.dataset.file = f; b.textContent = f;
|
|
91
|
+
document.querySelector('#dBody .stream').append(b); b.click();
|
|
92
|
+
}, file);
|
|
93
|
+
const HTMLF = 'pmos/state/reports/lightbox-password-conversion/2026-10-19.html';
|
|
94
|
+
const frameOf = async (page) => { const h = await until(() => page.$('#dOut .obody.vw iframe.vwframe'), 8000); return h ? h.contentFrame() : null; };
|
|
95
|
+
|
|
96
|
+
if (TAG === 'after') {
|
|
97
|
+
const { page, errors, out, ctx } = await open();
|
|
98
|
+
await press(page, HTMLF);
|
|
99
|
+
const fr = await frameOf(page);
|
|
100
|
+
ok('H1 the .html file opens as a frame, not as code', !!fr && !(await page.$('#dOut .obody.vw .cb')));
|
|
101
|
+
const st = fr && await until(() => fr.evaluate(() => (document.body && document.body.dataset.net ? { mode: document.compatMode, title: document.title, rows: document.querySelectorAll('.row').length, m: document.body.dataset.mode, parent: document.body.dataset.parent, store: document.body.dataset.store, net: document.body.dataset.net, h1: (document.querySelector('h1') || {}).textContent } : null)), 8000);
|
|
102
|
+
ok('H1 the page renders in standards mode with its own title and bars', st && st.mode === 'CSS1Compat' && st.h1 === 'Password Conversion Funnel' && st.rows === 6 && st.m === 'events', JSON.stringify(st));
|
|
103
|
+
// the press goes through the page's own handler; a click by coordinates can land on the viewer while it is still laying out
|
|
104
|
+
if (fr) await fr.evaluate(() => document.querySelector('button[data-m="users"]').click());
|
|
105
|
+
const after = fr && await until(() => fr.evaluate(() => (document.body.dataset.mode === 'users' ? document.querySelector('.row span span').textContent : null)), 6000);
|
|
106
|
+
const why = after ? '' : fr && await fr.evaluate(() => JSON.stringify({ mode: document.body.dataset.mode, first: (document.querySelector('.row span span') || {}).textContent })).catch((e) => String(e));
|
|
107
|
+
ok('H1 the page\'s own script runs: its toggle redraws the bars', after === '1,310 · 100%', after || why);
|
|
108
|
+
ok('H2 the page cannot read the app, its storage or the network', st && st.parent === 'blocked' && st.store === 'blocked' && st.net === 'blocked', JSON.stringify(st));
|
|
109
|
+
ok('H2 nothing leaves the machine: the CSP refuses the remote font', out.length === 0, out.join(' '));
|
|
110
|
+
const bar = await page.evaluate(() => [...document.querySelectorAll('#dOut .obody.vw [data-fv]')].map((b) => b.textContent + ':' + b.getAttribute('aria-pressed')).join());
|
|
111
|
+
ok('H3 the bar offers Page and Source, Page pressed', bar === 'Page:true,Source:false', bar);
|
|
112
|
+
await page.click('#dOut .obody.vw [data-fv="source"]');
|
|
113
|
+
const src = await until(() => page.evaluate(() => { const p = document.querySelector('#dOut .obody.vw .cb pre'); return p ? { head: p.textContent.slice(0, 15), frame: !!document.querySelector('#dOut .obody.vw iframe') } : null; }), 4000);
|
|
114
|
+
ok('H3 Source shows the file\'s text', src && src.head === '<!doctype html>' && !src.frame, JSON.stringify(src));
|
|
115
|
+
await page.click('#dOut .obody.vw [data-fv="page"]');
|
|
116
|
+
ok('H3 Page brings the page back', !!(await frameOf(page)));
|
|
117
|
+
await press(page, 'pmos/state/reports/lightbox-password-conversion/2026-10-19.md');
|
|
118
|
+
const md = await until(() => page.evaluate(() => { const p = document.querySelector('#dOut .obody.vw:not([hidden]) .cfb'); return p && p.querySelector('strong') ? p.innerHTML : null; }), 6000);
|
|
119
|
+
ok('H4 a markdown file still opens as a page', md && /<strong>sign-up<\/strong>/.test(md), md);
|
|
120
|
+
await press(page, 'workspace/lib/a.js');
|
|
121
|
+
const js = await until(() => page.evaluate(() => { const p = document.querySelector('#dOut .obody.vw:not([hidden]) .cb'); return p ? p.dataset.lang + ':' + p.querySelector('pre').textContent : null; }), 6000);
|
|
122
|
+
ok('H4 a plain text file still opens as code, with no Page and Source bar', js === 'js:const a = 1;\n' && !(await page.$('#dOut .obody.vw:not([hidden]) [data-fv]')), js);
|
|
123
|
+
ok('H4 no page errors', errors.length === 0, errors.join(' | '));
|
|
124
|
+
await ctx.close();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
for (const [w, h] of [[1280, 900], [390, 844]]) for (const theme of ['light', 'dark']) {
|
|
128
|
+
const { page, ctx } = await open({ w, h, theme });
|
|
129
|
+
await press(page, HTMLF);
|
|
130
|
+
const fr = await frameOf(page);
|
|
131
|
+
if (fr) await until(() => fr.evaluate(() => document.querySelectorAll('.row').length === 6), 6000);
|
|
132
|
+
else await sleep(1500);
|
|
133
|
+
const geo = await page.evaluate(() => { const f = document.querySelector('#dOut .obody.vw iframe'), r = f && f.getBoundingClientRect(); return r ? { w: Math.round(r.width), h: Math.round(r.height), sx: document.documentElement.scrollWidth - innerWidth } : null; });
|
|
134
|
+
ok(`H1 at ${w} ${theme} the frame fills the viewer's width and has room to read`, geo && geo.w >= (w < 1000 ? 300 : 500) && geo.h >= 400 && geo.sx <= 0, JSON.stringify(geo));
|
|
135
|
+
if (SHOTS) { fs.mkdirSync(SHOTS, { recursive: true }); await sleep(300); await page.screenshot({ path: path.join(SHOTS, `${TAG}-${w}-${theme}.png`) }); }
|
|
136
|
+
await ctx.close();
|
|
137
|
+
}
|
|
138
|
+
return finish();
|
|
139
|
+
})();
|
|
@@ -112,6 +112,7 @@ const SPRINTS = { ok: true, source: 'jira', readAt: '2026-10-19T09:00:00Z', velo
|
|
|
112
112
|
{
|
|
113
113
|
const { page, ctx, S } = await open({ w: 390, h: 844, theme: 'dark' });
|
|
114
114
|
ok('R7 the backlog opens at 390px', await openBacklog(page));
|
|
115
|
+
await page.evaluate(() => Promise.race([Promise.all(document.getAnimations().filter((a) => a.effect && a.effect.getTiming().iterations !== Infinity).map((a) => a.finished.catch(() => {}))), new Promise((r) => setTimeout(r, 3000))])); // the dialog's open transition scales its buttons: measure them once it ends
|
|
115
116
|
const m = await page.evaluate(() => {
|
|
116
117
|
const p = document.querySelector('#dOut .obody.vw:not([hidden])');
|
|
117
118
|
const small = [...p.querySelectorAll('button')].filter((b) => b.getBoundingClientRect().width && b.getBoundingClientRect().height < 44).map((b) => b.textContent.trim().slice(0, 20));
|
|
@@ -174,3 +174,7 @@
|
|
|
174
174
|
@media (max-width:640px){.vwchip,.vwli>button{min-height:44px}}
|
|
175
175
|
@media (hover:hover){.vwbtn:hover{background:var(--well)}.cf a:hover{text-decoration:underline}.vwtb:hover{background:var(--well);color:var(--ink)}.vwpop button:hover{background:var(--well)}.vwxmn a:hover{background:var(--well)}.vwli>button:hover{background:var(--well)}}
|
|
176
176
|
.cfb .vwcm{display:none}
|
|
177
|
+
/* an .html file Claude named: the page itself in a sandboxed frame (premium-vw-file.js), as wide as the viewer and nearly as tall */
|
|
178
|
+
.vwdoc.vwhtml{max-width:none}
|
|
179
|
+
.vwhtml .vwdt{margin:12px 0}
|
|
180
|
+
.vwframe{display:block;width:100%;height:max(420px,calc(100dvh - 260px));border:1px solid var(--hair);border-radius:8px}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* pm/premium-vw-file.js — a file Claude named in a chat panel, read-only in the viewer beside the conversation (PM, 2026-10-20: "Why can't I click the file
|
|
2
2
|
* and see it on the right panel?"). A press on a path in Claude's words (chat-md.js draws it as button.fpath) opens the file as a tab: markdown as a page,
|
|
3
|
-
* any other text file as code. GET /api/doc/locate says which served workspace holds the path and GET /api/doc reads it there, so a path outside every
|
|
3
|
+
* an .html file as the page it is (PM, 2026-10-20: "HTML file didn't render properly"), with Source one press away, and any other text file as code. GET /api/doc/locate says which served workspace holds the path and GET /api/doc reads it there, so a path outside every
|
|
4
4
|
* workspace PMOS serves is never read: its tab says so quietly. While the tab is open the file is checked every few seconds and drawn again when it
|
|
5
5
|
* changed, so a file Claude is still writing stays current. Nothing here writes.
|
|
6
6
|
* openChatFile(path, { session, ws }) -> the tab's pane */
|
|
@@ -14,8 +14,21 @@ const OPEN = new Map(); // tab id -> state
|
|
|
14
14
|
async function getJson(url) { try { const r = await fetch(url, { credentials: 'same-origin' }); return await r.json(); } catch { return null; } }
|
|
15
15
|
async function getText(url) { try { const r = await fetch(url, { credentials: 'same-origin' }); return { ok: r.ok, text: await r.text(), kind: r.headers.get('X-Doc-Kind') || 'text' }; } catch { return { ok: false, text: 'The workspace server did not answer.' }; } }
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
/* ── an .html file is drawn as the page it is, in a frame that grants it nothing but its own inline scripts ──
|
|
18
|
+
* The frame's sandbox is allow-scripts WITHOUT allow-same-origin, so the page runs in an opaque origin: it cannot reach this app's document, storage,
|
|
19
|
+
* cookies or API, and its forms, popups and top-level navigation were never granted. The CSP put at the top of the page blocks every network fetch
|
|
20
|
+
* (default-src 'none'; no host in script-src), so a report's toggles and charts work and nothing leaves the machine. A remote font falls back to the
|
|
21
|
+
* system font. The same box the console's document tab uses (tab-doc.js htmlFrame), with scripts on, because a report page is what the PM asked to see.
|
|
22
|
+
* The meta goes right after the doctype, not before it: markup before the doctype puts the page in quirks mode and changes its layout. */
|
|
23
|
+
export const FRAME_CSP = "default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:; script-src 'unsafe-inline'";
|
|
24
|
+
export function framedSrc(text) {
|
|
25
|
+
const t = String(text || ''), meta = `<meta http-equiv="Content-Security-Policy" content="${FRAME_CSP}">`;
|
|
26
|
+
const m = /^\uFEFF?\s*(?:<!--[\s\S]*?-->\s*)*<!doctype[^>]*>/i.exec(t);
|
|
27
|
+
return m ? m[0] + meta + t.slice(m[0].length) : meta + t;
|
|
28
|
+
}
|
|
29
|
+
const isHtml = (f) => f.kind === 'html' || /\.html?$/i.test(f.name || '');
|
|
30
|
+
/** The page for one file as HTML. Pure, for Node: f is { name, rel, abs, kind, text, err, why, reason }; view is 'page' (default) or 'source' for an .html file. */
|
|
31
|
+
export function fileHtml(f, view = 'page') {
|
|
19
32
|
if (!f || f.loading) return '<div class="vwdoc"><p class="vwempty" role="status">Reading the file.</p></div>';
|
|
20
33
|
if (f.reason) {
|
|
21
34
|
const head = f.reason === 'outside' ? 'Not in a workspace' : f.reason === 'missing' ? 'No such file' : 'Not opened here';
|
|
@@ -31,6 +44,18 @@ export function fileHtml(f) {
|
|
|
31
44
|
+ `</header><div class="cfb">${body || '<p class="vwmut">The file has no text yet.</p>'}</div>${foot}</article></div>`;
|
|
32
45
|
}
|
|
33
46
|
const ext = (/\.([A-Za-z0-9]+)$/.exec(f.name || '') || [])[1] || 'text';
|
|
47
|
+
if (isHtml(f)) {
|
|
48
|
+
const page = view !== 'source';
|
|
49
|
+
const bar = `<div class="vwdt"><div class="vwsg" role="group" aria-label="Show the file as">`
|
|
50
|
+
+ `<button type="button" class="vwseg" data-fv="page" aria-pressed="${page}">Page</button><button type="button" class="vwseg" data-fv="source" aria-pressed="${!page}">Source</button></div></div>`;
|
|
51
|
+
if (page) {
|
|
52
|
+
return `<div class="vwdoc vwhtml"><article class="cf vwfile"><header class="cfh"><h1 class="cft">${esc(f.name)}</h1></header>${bar}`
|
|
53
|
+
+ `<iframe class="vwframe" sandbox="allow-scripts" referrerpolicy="no-referrer" title="${esc(f.name)}" srcdoc="${esc(framedSrc(f.text))}"></iframe>`
|
|
54
|
+
+ `<footer class="cff"><span>Read-only · the page runs offline, with no access to PMOS</span><span class="gap"></span><code>${esc(f.abs || f.rel)}</code></footer></article></div>`;
|
|
55
|
+
}
|
|
56
|
+
return `<div class="vwdoc"><article class="cf vwfile"><header class="cfh"><h1 class="cft">${esc(f.name)}</h1></header>${bar}`
|
|
57
|
+
+ `<div class="cfb"><div class="cb" data-lang="${esc(ext)}"><div class="cbh"><span>${esc(ext)}</span></div><pre>${esc(f.text)}</pre></div></div>${foot}</article></div>`;
|
|
58
|
+
}
|
|
34
59
|
return `<div class="vwdoc"><article class="cf vwfile"><header class="cfh"><h1 class="cft">${esc(f.name)}</h1></header>`
|
|
35
60
|
+ `<div class="cfb"><div class="cb" data-lang="${esc(ext)}"><div class="cbh"><span>${esc(ext)}</span></div><pre>${esc(f.text)}</pre></div></div>${foot}</article></div>`;
|
|
36
61
|
}
|
|
@@ -41,12 +66,14 @@ export function openChatFile(p, ctx = {}) {
|
|
|
41
66
|
const where = () => '/api/doc/locate?' + q({ path: p, session: ctx.session, ws: ctx.ws });
|
|
42
67
|
const id = 'file:' + p;
|
|
43
68
|
let st = OPEN.get(id);
|
|
44
|
-
if (!st) { st = { f: { loading: true, path: p }, sig: '', timer: null }; OPEN.set(id, st); }
|
|
45
|
-
|
|
69
|
+
if (!st) { st = { f: { loading: true, path: p }, sig: '', timer: null, view: 'page' }; OPEN.set(id, st); }
|
|
70
|
+
// Page and Source on an .html file: the press draws the other view; the choice stays while the tab is open
|
|
71
|
+
const wire = (el) => { el.onclick = (e) => { const b = e.target.closest('[data-fv]'); if (!b || b.dataset.fv === st.view) return; st.view = b.dataset.fv; draw(); }; };
|
|
72
|
+
const pane = vwOpen({ id, title: base(p), icon: 'doc', render: (el) => { el.innerHTML = fileHtml(st.f, st.view); wire(el); } });
|
|
46
73
|
const draw = () => {
|
|
47
74
|
const el = document.querySelector(`#dOut .obody.vw[data-vw="${CSS.escape(id)}"]`);
|
|
48
75
|
if (!el) return false;
|
|
49
|
-
const y = el.scrollTop; el.innerHTML = fileHtml(st.f); el.scrollTop = y;
|
|
76
|
+
const y = el.scrollTop; el.innerHTML = fileHtml(st.f, st.view); wire(el); el.scrollTop = y;
|
|
50
77
|
return true;
|
|
51
78
|
};
|
|
52
79
|
async function read() {
|
|
@@ -192,6 +192,13 @@ a.round{color:inherit;text-decoration:none}
|
|
|
192
192
|
.mprog{margin-top:8px}}
|
|
193
193
|
.rr.done .rt,.rr.done .rs,.rr.done .sug{opacity:.45}
|
|
194
194
|
.rr.done .rt{text-decoration:line-through}
|
|
195
|
+
/* premium-simple-ui #5: a "What you need to do" row is two lines, the title then "subject · next step", with a chevron. The pin sits beside the chevron. */
|
|
196
|
+
.rr .rs{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:4px}
|
|
197
|
+
.rr .rhd{padding-right:100px!important}
|
|
198
|
+
.rchev{position:absolute;right:14px;top:50%;width:20px;height:20px;margin-top:-10px;fill:none;stroke:var(--ink-3);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
|
|
199
|
+
.rr .rhd:hover .rchev{stroke:var(--ink)}
|
|
200
|
+
.rr .rpin{right:42px;top:50%;transform:translateY(-50%)}
|
|
201
|
+
@media (max-width:640px){.rr .rs{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.rr .rhd{padding-right:92px!important}}
|
|
195
202
|
.rn svg{width:20px;height:20px;color:var(--ok);stroke-width:2.4}
|
|
196
203
|
.dlg{display:flex;flex-direction:column;overflow:hidden;padding-bottom:22px}
|
|
197
204
|
.dbody{}
|
|
@@ -71,6 +71,18 @@ function drawHero() {
|
|
|
71
71
|
|
|
72
72
|
/* ── rows ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
73
73
|
const STAMP = (n) => String(n).padStart(2, '0');
|
|
74
|
+
/* premium-simple-ui #5: a row is two lines, the title and then "subject · next step". A "nothing on record" sentence is left off the row; the
|
|
75
|
+
* "If you skip" line and the whole next step stay in the row's dialog (skipFact). */
|
|
76
|
+
const NEXT_OF = (r) => { const t = String(r.prepared || '').replace(/^Next step: /, ''); return /^No .* is on record\.$/.test(t) ? '' : t; };
|
|
77
|
+
const line2 = (r) => [r.subject, NEXT_OF(r)].filter(Boolean).join(' · ');
|
|
78
|
+
/** The row's own "If you skip" (or "Why now", …) line, as a dialog fact, when the dialog does not already hold it. */
|
|
79
|
+
function skipFact(r) {
|
|
80
|
+
const d = r.dialog;
|
|
81
|
+
if (!r.skip || !d || !Array.isArray(d.facts) || d.items) return r;
|
|
82
|
+
const m = /^([A-Z][a-z]+(?: [a-z]+){0,3}): (.+)$/.exec(r.skip), label = m ? m[1] : 'Note', text = m ? m[2] : r.skip;
|
|
83
|
+
if (d.facts.some(([a, b]) => a === label || b === text)) return r;
|
|
84
|
+
return { ...r, dialog: { ...d, facts: d.facts.concat([[label, text]]) } };
|
|
85
|
+
}
|
|
74
86
|
const CL_ORDER = 'In the order of Needs you on the console: what cannot wait first, then by impact, urgency and effort.';
|
|
75
87
|
/** The list the page draws: the console's Needs you once it is read, else the model's records-only rows. */
|
|
76
88
|
function LIST() {
|
|
@@ -93,7 +105,7 @@ function drawRows() {
|
|
|
93
105
|
const keys = rows.map((r) => r.key), off = (LS.putOff || []).map((x) => x.key); // a row put off is not done: it leaves both counts and is named below the list
|
|
94
106
|
const base = (pend ? keys : baseline(keys)).filter((k) => !off.includes(k)), done = base.filter((k) => !keys.includes(k)).length, total = base.length;
|
|
95
107
|
const order = rows.slice().sort((a, b) => (pinned.has(b.key) - pinned.has(a.key)) || (a.n - b.n));
|
|
96
|
-
L.innerHTML = order.map((r, i) => `<div class="rr${i < 3 ? ' lead' : ''}${i === 0 ? ' first' : ''}" data-key="${esc(r.key)}"${linkOf(r) ? ` data-link="${esc(linkOf(r))}"` : ''}><button class="rhd" aria-haspopup="dialog"><span class="rn">${STAMP(i + 1)}</span><span><span class="rt">${esc(r.title)}${i === 0 ? '<em class="tgf">Do this first</em>' : ''}</span><span class="rs">${r.product ? `<b class="pn">${esc(r.product)}</b>` : ''}${esc(r
|
|
108
|
+
L.innerHTML = order.map((r, i) => `<div class="rr${i < 3 ? ' lead' : ''}${i === 0 ? ' first' : ''}" data-key="${esc(r.key)}"${linkOf(r) ? ` data-link="${esc(linkOf(r))}"` : ''}><button class="rhd" aria-haspopup="dialog"><span class="rn">${STAMP(i + 1)}</span><span><span class="rt">${esc(r.title)}${i === 0 ? '<em class="tgf">Do this first</em>' : ''}</span><span class="rs" title="${esc(line2(r))}">${r.product ? `<b class="pn">${esc(r.product)}</b>` : ''}${esc(line2(r))}</span></span><svg class="rchev" viewBox="0 0 24 24" aria-hidden="true"><path d="m9 6 6 6-6 6"/></svg></button><button class="rpin" data-pin="${esc(r.key)}" aria-pressed="${pinned.has(r.key)}" aria-label="Pin ${esc(r.title)} to the top" title="Pin to the top"><svg class="i" viewBox="0 0 24 24"><path d="M9 4h6l-1 6 3 3H7l3-3zM12 13v7"/></svg></button></div>`).join('')
|
|
97
109
|
+ (LS.more ? `<p class="note">${LS.more} more ${LS.more === 1 ? 'row is' : 'rows are'} not shown here.</p>` : '');
|
|
98
110
|
if (!$('#ibLine')) $('#calm').insertAdjacentHTML('afterend', '<div id="ibLine"></div>'); // premium-agent-inbox: the agent's results, one count line under the PM's own rows
|
|
99
111
|
$('#ibLine').innerHTML = inboxLine();
|
|
@@ -244,6 +256,7 @@ function consoleDialog(r) {
|
|
|
244
256
|
function openRow(r) {
|
|
245
257
|
if (!r) return;
|
|
246
258
|
if (!r.dialog) r = { ...r, dialog: r.src ? consoleDialog(r) : plainDialog(r) };
|
|
259
|
+
r = skipFact(r);
|
|
247
260
|
openR = r; const d = r.dialog;
|
|
248
261
|
openDlg({ eye: d.eye + ' · real data', title: d.title || r.title, sub: d.sub || r.subject, say: d.say, stream: turnA(logHtml(d)) + turnA(ptx(d.say)) + cardHtml(r), noteKey: r.chatKey || r.key, pane: paneHtml(r), label: d.pane.label }); // a goal row (premium-chat-session U7) opens its own conversation
|
|
249
262
|
ctaState(r);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Bug 2026-10-20 (\"HTML file didn't render properly\"): an .html file Claude names in a premium chat panel opens in the viewer as the page, sandboxed to its own inline scripts with no network, with Page and Source on its bar.",
|
|
3
|
+
"panels": [
|
|
4
|
+
"premium-html-viewer-test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"premium-html-viewer-test.js": 25
|
|
8
|
+
}
|
|
9
|
+
}
|