create-pmos 0.317.0 → 0.318.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 +1 -1
- 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 +2 -2
- package/workspace/briefing-premium-initiative-test.js +5 -10
- package/workspace/briefing-premium-insights-test.js +1 -1
- package/workspace/briefing-premium-products-test.js +9 -4
- package/workspace/briefing-premium-test.js +12 -10
- package/workspace/briefing-premium-work-test.js +1 -1
- package/workspace/guide/briefing-premium.md +21 -16
- package/workspace/lib/briefing-premium-agent.js +5 -0
- package/workspace/lib/insights-premium.js +1 -1
- package/workspace/lib/routes-briefing-premium.js +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-studio-test.js +4 -4
- package/workspace/public/pm/premium-board.js +3 -2
- package/workspace/public/pm/premium-initiative.js +2 -1
- package/workspace/public/pm/premium-insights.js +3 -2
- package/workspace/public/pm/premium-shell.js +147 -7
- package/workspace/public/pm/premium-work.js +3 -1
- package/workspace/public/pm/premium.css +47 -2
- package/workspace/public/pm/premium.js +16 -23
- package/workspace/public/premium-board.html +2 -6
- package/workspace/public/premium-initiative.html +1 -5
- package/workspace/public/premium-insights.html +1 -5
- package/workspace/public/premium-work.html +2 -6
- package/workspace/public/premium.html +3 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.318.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": {
|
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-19T14:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T14:36:49Z"}
|
|
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-19T14:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T14:36:49Z"}
|
|
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-19T14:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T14:36:49Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -65,7 +65,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
65
65
|
/* B1 */
|
|
66
66
|
const rail = await p.evaluate(() => ({ names: [...document.querySelectorAll('.rail .pl')].map((b) => b.textContent.trim()), cur: document.querySelector('.rail [aria-current="page"]').textContent.trim(), pi: getComputedStyle(document.querySelector('.rail')).getPropertyValue('--pi').trim(), title: document.title, name: document.querySelector('#crBoard').textContent, sw: document.querySelector('#crSw').hidden }));
|
|
67
67
|
ok('B1 the rail names four places, Board is current, the board is named and has no switcher for one board', rail.names.join() === 'Briefing,My work,Board,Insights' && rail.cur === 'Board' && rail.pi === '2' && rail.name === 'pmos' && rail.sw, JSON.stringify(rail));
|
|
68
|
-
{ const tc = await p.evaluate(() => { const a = document.querySelector('#toConsole'); if (!a) return null; const r = a.getBoundingClientRect(); return { href: a.getAttribute('href'), label: a.getAttribute('aria-label'), w: Math.round(r.width), h: Math.round(r.height), tab: a.tabIndex }; }); ok('B1 the
|
|
68
|
+
{ await p.click('#moreBtn'); const tc = await p.evaluate(() => { const a = document.querySelector('#toConsole'); if (!a) return null; const r = a.getBoundingClientRect(); return { href: a.getAttribute('href'), label: a.getAttribute('aria-label'), w: Math.round(r.width), h: Math.round(r.height), tab: a.tabIndex }; }); ok('B1 the ⋯ menu links to the console (premium-console-link, premium-topbar)', tc && tc.href === '/console.html' && tc.label === 'Open the console' && tc.w >= 44 && tc.h >= 44 && tc.tab === 0, JSON.stringify(tc)); await p.keyboard.press('Escape'); }
|
|
69
69
|
ok('B1 the page is served at /premium-board and /premium-board.html', (await fetch(BASE + '/premium-board')).status === 200 && (await fetch(BASE + '/premium-board.html')).status === 200);
|
|
70
70
|
for (const [go, re] of [['brief', /\/premium\.html$/], ['work', /\/premium-work\.html$/]]) {
|
|
71
71
|
const r2 = await open(); await r2.page.locator(`.rail [data-go="${go}"]`).click();
|
|
@@ -159,7 +159,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
159
159
|
const u = new URL(D.page.url());
|
|
160
160
|
ok('B14 a click on an initiative opens its page with the initiative, the workspace and the board', u.pathname === '/premium-initiative.html' && u.searchParams.get('id') === 'self-serve-v2' && u.searchParams.get('ws') === 'w1' && u.searchParams.get('board') === 'w1', D.page.url());
|
|
161
161
|
await D.page.goBack(); await until(() => D.page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0));
|
|
162
|
-
await D.page.click('#modeSeg [data-m="popup"]');
|
|
162
|
+
await D.page.click('#moreBtn'); await D.page.click('#modeSeg [data-m="popup"]'); await D.page.keyboard.press('Escape'); // premium-topbar: the switch is in the Board's ⋯ menu
|
|
163
163
|
await D.page.locator('#ibBody .ini2').first().click();
|
|
164
164
|
ok('B14 the Popup setting opens the dialog and stays on the Board', await until(() => D.page.evaluate(() => document.querySelector('#dlg').classList.contains('on'))) && new URL(D.page.url()).pathname === '/premium-board.html');
|
|
165
165
|
await D.page.keyboard.press('Escape'); await D.page.reload(); await until(() => D.page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0));
|
|
@@ -75,23 +75,18 @@ const HEALTH = { ok: true, path: 'planning/prd/self-serve-v2-prd.md', health: {
|
|
|
75
75
|
/* I1 place */
|
|
76
76
|
const rail = await p.evaluate(() => ({ names: [...document.querySelectorAll('.rail .pl')].map((b) => b.textContent.trim()), cur: document.querySelector('.rail [aria-current="page"]').textContent.trim() }));
|
|
77
77
|
ok('I1 the rail names the four places and marks Board', rail.names.join() === 'Briefing,My work,Board,Insights' && rail.cur === 'Board');
|
|
78
|
-
{ const tc = await p.evaluate(() => { const a = document.querySelector('#toConsole'); if (!a) return null; const r = a.getBoundingClientRect(); return { href: a.getAttribute('href'), label: a.getAttribute('aria-label'), w: Math.round(r.width), h: Math.round(r.height), tab: a.tabIndex }; }); ok('I1 the
|
|
79
|
-
ok('I1 the
|
|
78
|
+
{ await p.click('#moreBtn'); const tc = await p.evaluate(() => { const a = document.querySelector('#toConsole'); if (!a) return null; const r = a.getBoundingClientRect(); return { href: a.getAttribute('href'), label: a.getAttribute('aria-label'), w: Math.round(r.width), h: Math.round(r.height), tab: a.tabIndex }; }); ok('I1 the ⋯ menu links to the console (premium-console-link, premium-topbar)', tc && tc.href === '/console.html' && tc.label === 'Open the console' && tc.w >= 44 && tc.h >= 44 && tc.tab === 0, JSON.stringify(tc)); await p.keyboard.press('Escape'); }
|
|
79
|
+
ok('I1 the bar has a back button to the board, the initiative with its switcher, and Chat (premium-topbar)', await p.evaluate(() => document.querySelector('#crBoard').getAttribute('aria-label') === 'Back to Onboarding' && document.querySelector('#crIni').textContent === 'Self-serve onboarding v2' && !document.querySelector('#crSw') && !!document.querySelector('#crSw2') && document.querySelector('#crAsk').getAttribute('aria-label') === 'Ask about this initiative'));
|
|
80
80
|
await p.route('**/premium-board.html*', (r) => r.fulfill({ contentType: 'text/html', body: '<title>b</title>' }));
|
|
81
81
|
await p.route('**/premium-initiative.html?id=partner*', (r) => r.fulfill({ contentType: 'text/html', body: '<title>i</title>' }));
|
|
82
|
-
await p.click('#crSw'); const bm = await p.evaluate(() => ({ open: !document.querySelector('#crMenu').hidden, items: [...document.querySelectorAll('#crMenu button')].map((b) => b.textContent + (b.hasAttribute('aria-current') ? '*' : '')).join('|'), exp: document.querySelector('#crSw').getAttribute('aria-expanded') }));
|
|
83
|
-
ok('I1 the board switcher lists the boards and marks this one', bm.open && bm.items === 'Onboarding*|Payments' && bm.exp === 'true', JSON.stringify(bm));
|
|
84
|
-
await p.keyboard.press('Escape'); ok('I1 Escape closes the menu and gives the focus back to its button', await p.evaluate(() => document.querySelector('#crMenu').hidden && document.activeElement.id === 'crSw'));
|
|
85
82
|
await p.click('#crSw2'); const im = await p.evaluate(() => [...document.querySelectorAll('#crMenu button')].map((b) => b.textContent + (b.hasAttribute('aria-current') ? '*' : '')).join('|'));
|
|
86
83
|
ok('I1 the initiative switcher lists the board\'s initiatives and marks this one', im === 'Self-serve onboarding v2*|Partner API rate limits|Usage-based billing', im);
|
|
87
84
|
await p.click('#crMenu [data-swi="partner-rate-limits"]'); await sleep(500);
|
|
88
85
|
{ const u = new URL(p.url()); ok('I1 choosing an initiative opens its page on the same board', u.pathname === '/premium-initiative.html' && u.searchParams.get('id') === 'partner-rate-limits' && u.searchParams.get('board') === 'w1', p.url()); await p.goBack(); await until(() => p.evaluate(() => !!document.querySelector('#cIniTk'))); }
|
|
89
|
-
await p.click('#crSw'); await p.click('#crMenu [data-sw="w2|w2"]'); await sleep(500);
|
|
90
|
-
{ const u = new URL(p.url()); ok('I1 choosing a board opens that board\'s page', u.pathname === '/premium-board.html' && u.searchParams.get('ws') === 'w2' && u.searchParams.get('board') === 'w2', p.url()); await p.goBack(); await until(() => p.evaluate(() => !!document.querySelector('#cIniTk'))); }
|
|
91
86
|
await p.click('#crBoard'); await sleep(500);
|
|
92
|
-
{ const u = new URL(p.url()); ok('I1 the
|
|
87
|
+
{ const u = new URL(p.url()); ok('I1 the back button leads back to the Board', u.pathname === '/premium-board.html' && u.searchParams.get('board') === 'w1', p.url()); await p.goBack(); await until(() => p.evaluate(() => !!document.querySelector('#cIniTk'))); }
|
|
93
88
|
await p.click('#crAsk'); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
|
|
94
|
-
ok('I1
|
|
89
|
+
ok('I1 Chat opens the initiative in the dialog with the read-only agent beside it', await p.evaluate(() => document.querySelector('#dTitle').textContent === 'Self-serve onboarding v2' && /Lane\|feature/.test([...document.querySelectorAll('#oMain .kv2 span')].map((x) => x.textContent).join('|')) && !document.querySelector('#askF').hidden));
|
|
95
90
|
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
96
91
|
|
|
97
92
|
/* I3 header */
|
|
@@ -323,7 +318,7 @@ const HEALTH = { ok: true, path: 'planning/prd/self-serve-v2-prd.md', health: {
|
|
|
323
318
|
/* I12 fidelity against the mockup */
|
|
324
319
|
if (!fs.existsSync(MOCKUP)) ok('I12 the mockup is in the repository', false, MOCKUP);
|
|
325
320
|
else {
|
|
326
|
-
const PAIRS = [['rail', '.rail'], ['crumb', '.crumb'], ['
|
|
321
|
+
const PAIRS = [['rail', '.rail'], ['crumb', '.crumb'], ['lede', '#cIniOv .lede'], ['agr', '#cIniOv .agr2'], ['agc', '#cIniOv .agc'], ['tkadd', '.tkadd'], ['chip', '.ihead .chp'], ['meta', '.ihm'], ['strip', '.iws em'], ['segs', '.iws .sg2'], ['ov', '#cIniOv'], ['ovh', '#cIniOv h2'], ['todo', '#cIniOv .todo'], ['tdw', '#cIniOv .tdw'], ['tk', '#cIniTk'], ['tkq', '#cIniTk .tkq:last-child'], ['tki', '#cIniTk .tkq:last-child .tki'], ['tkn', '#cIniTk .tkq:last-child .tkn b'], ['tkp', '#cIniTk .tkq:last-child .tkp'], ['doc', '#cIniDoc'], ['dsum', '.dsum'], ['dprog', '.dprog'], ['dtool', '.dtool'], ['dmr', '#cIniDoc .dmr'], ['dmi', '#cIniDoc .dmi.c-Plan'], ['dock', '.dock']];
|
|
327
322
|
const SKIP_W = ['crumb', 'crb', 'lede', 'agr', 'agc', 'tkadd', 'ckrs', 'chip', 'meta', 'strip', 'segs', 'ov', 'ovh', 'todo', 'tdw', 'chk', 'ckr', 'tk', 'tkq', 'tki', 'tkn', 'tkp', 'doc', 'dsum', 'dprog', 'dtool', 'dmr', 'dmi'];
|
|
328
323
|
const SKIP_L = ['crumb', 'crb', 'cri', 'crask', 'lede', 'agr', 'agc', 'tkadd', 'ckrs', 'chip', 'meta', 'strip', 'segs', 'tdw', 'ovh', 'ckr', 'tkq', 'tki', 'tkn', 'tkp', 'dmr', 'dmi', 'dsum', 'dprog', 'dtool', 'todo'];
|
|
329
324
|
const PROPS = ['fontSize', 'fontWeight', 'fontFamily', 'color', 'backgroundColor', 'borderRadius', 'paddingTop', 'paddingLeft', 'letterSpacing', 'lineHeight', 'boxShadow', 'backdropFilter', 'borderTopColor'];
|
|
@@ -65,7 +65,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
65
65
|
/* I1 */
|
|
66
66
|
const rail = await p.evaluate(() => ({ names: [...document.querySelectorAll('.rail .pl')].map((b) => b.textContent.trim()), cur: document.querySelector('.rail [aria-current="page"]').textContent.trim(), pi: getComputedStyle(document.querySelector('.rail')).getPropertyValue('--pi').trim(), title: document.title, name: document.querySelector('#crBoard').textContent, sw: document.querySelector('#crSw').hidden }));
|
|
67
67
|
ok('I1 the rail names four places, Insights is current, the board is named and has no switcher for one board', rail.names.join() === 'Briefing,My work,Board,Insights' && rail.cur === 'Insights' && rail.pi === '3' && rail.name === 'pmos' && rail.sw, JSON.stringify(rail));
|
|
68
|
-
{ const tc = await p.evaluate(() => { const a = document.querySelector('#toConsole'); if (!a) return null; const r = a.getBoundingClientRect(); return { href: a.getAttribute('href'), label: a.getAttribute('aria-label'), w: Math.round(r.width), h: Math.round(r.height), tab: a.tabIndex }; }); ok('I1 the
|
|
68
|
+
{ await p.click('#moreBtn'); const tc = await p.evaluate(() => { const a = document.querySelector('#toConsole'); if (!a) return null; const r = a.getBoundingClientRect(); return { href: a.getAttribute('href'), label: a.getAttribute('aria-label'), w: Math.round(r.width), h: Math.round(r.height), tab: a.tabIndex }; }); ok('I1 the ⋯ menu links to the console (premium-console-link, premium-topbar)', tc && tc.href === '/console.html' && tc.label === 'Open the console' && tc.w >= 44 && tc.h >= 44 && tc.tab === 0, JSON.stringify(tc)); await p.keyboard.press('Escape'); }
|
|
69
69
|
ok('I1 the page is served at /premium-insights and /premium-insights.html', (await fetch(BASE + '/premium-insights')).status === 200 && (await fetch(BASE + '/premium-insights.html')).status === 200);
|
|
70
70
|
for (const [go, re] of [['brief', /\/premium\.html$/], ['work', /\/premium-work\.html$/], ['init', /\/premium-board\.html$/]]) {
|
|
71
71
|
const r2 = await open(); await r2.page.locator(`.rail [data-go="${go}"]`).click();
|
|
@@ -80,9 +80,14 @@ const product = (name, cond) => {
|
|
|
80
80
|
const page = await ctx.newPage(); const errors = [];
|
|
81
81
|
page.on('pageerror', (e) => errors.push(String(e.message || e)));
|
|
82
82
|
await page.goto(BASE + '/premium.html' + q, { waitUntil: 'domcontentloaded' });
|
|
83
|
-
await page.waitForSelector('#rank .rr, #calm:not([hidden]), #pkw:not([hidden])', { timeout: 30000 });
|
|
83
|
+
await page.waitForSelector('#rank .rr, #calm:not([hidden]), #pkw:not([hidden])', { state: 'attached', timeout: 30000 }); // the picker is parked for the Sources dialog (premium-topbar), so attached, not visible
|
|
84
84
|
return { ctx, page, errors };
|
|
85
85
|
};
|
|
86
|
+
// premium-topbar: the picker lives in the Sources dialog (the chip, or the ⋯ menu at phone width)
|
|
87
|
+
const pick = async (page) => {
|
|
88
|
+
if (!(await page.isVisible('#pick'))) { if (await page.isVisible('#srcChip')) await page.click('#srcChip'); else { await page.click('#moreBtn'); await page.click('#srcItem'); } await page.waitForSelector('#pick', { state: 'visible', timeout: 10000 }); }
|
|
89
|
+
await page.click('#pick');
|
|
90
|
+
};
|
|
86
91
|
const rowsOf = (page) => page.$$eval('#rank .rr', (els) => els.map((e) => ({ key: e.dataset.key, tag: (e.querySelector('.pn') || {}).textContent || '', title: e.querySelector('.rt').textContent })));
|
|
87
92
|
|
|
88
93
|
{
|
|
@@ -93,7 +98,7 @@ const product = (name, cond) => {
|
|
|
93
98
|
const snap = await page.textContent('#snap');
|
|
94
99
|
ok('P1 the header names what is read and what is not', /IDPF and microsites/.test(snap) && /not included/.test(snap) && /\b[Pp][Mm][Oo][Ss]\b|pmos/i.test(snap), snap);
|
|
95
100
|
ok('P2 the picker says how many of the workspaces are on', (await page.textContent('#pick')).replace(/\s+/g, '') === 'Products2of3', await page.textContent('#pick'));
|
|
96
|
-
await page
|
|
101
|
+
await pick(page);
|
|
97
102
|
const items = await page.$$eval('#pickMenu [role="menuitemcheckbox"]', (els) => els.map((e) => ({ name: e.textContent.trim(), on: e.getAttribute('aria-checked'), h: Math.round(e.getBoundingClientRect().height) })));
|
|
98
103
|
ok('P2 the menu lists every workspace, the home one included, unticked', items.length === 3 && items.filter((i) => i.on === 'true').length === 2 && items.some((i) => i.on === 'false' && /home/.test(i.name)), JSON.stringify(items));
|
|
99
104
|
const pickH = await page.$eval('#pick', (e) => Math.round(e.getBoundingClientRect().height));
|
|
@@ -107,7 +112,7 @@ const product = (name, cond) => {
|
|
|
107
112
|
ok('P13 keyboard: the menu stays open on the ticked item and Escape closes it', await page.evaluate((id) => document.activeElement && document.activeElement.dataset.ws === id, wB.id) && (await page.keyboard.press('Escape'), await until(async () => await page.$eval('#pickMenu', (e) => e.hidden), 3000)));
|
|
108
113
|
ok('P3 the choice survives a reload', await (async () => { await page.reload({ waitUntil: 'domcontentloaded' }); return until(async () => { const r = await rowsOf(page); return r.length === 1 && r[0].tag === 'IDPF' ? 1 : 0; }, 20000); })());
|
|
109
114
|
// tick the home workspace
|
|
110
|
-
await page
|
|
115
|
+
await pick(page); await page.click(`#pickMenu [data-ws="${home.id}"]`);
|
|
111
116
|
ok('P3 ticking the home workspace reads it', await until(async () => (await page.getAttribute(`#pickMenu [data-ws="${home.id}"]`, 'aria-checked')) === 'true' && new RegExp(home.name + ' and IDPF|IDPF and ' + home.name, 'i').test(await page.textContent('#snap')), 20000), await page.textContent('#snap'));
|
|
112
117
|
// back to the default
|
|
113
118
|
await page.click('#pickMenu [data-reset]');
|
|
@@ -152,7 +157,7 @@ const product = (name, cond) => {
|
|
|
152
157
|
for (const [w, th] of [[390, 'light'], [390, 'dark'], [1280, 'dark']]) {
|
|
153
158
|
const { ctx, page } = await open({ w, h: 800, theme: th });
|
|
154
159
|
await until(async () => (await rowsOf(page)).length >= 1, 20000);
|
|
155
|
-
await page
|
|
160
|
+
await pick(page);
|
|
156
161
|
const o = await page.evaluate(() => ({ sw: document.documentElement.scrollWidth, cw: document.documentElement.clientWidth, menu: (() => { const r = document.querySelector('#pickMenu').getBoundingClientRect(); return { l: Math.round(r.left), r: Math.round(r.right) }; })() }));
|
|
157
162
|
ok(`P13 at ${w} px, ${th}: no sideways scroll with the menu open, and the menu stays on screen`, o.sw <= o.cw && o.menu.l >= 0 && o.menu.r <= o.cw, JSON.stringify(o));
|
|
158
163
|
await ctx.close();
|
|
@@ -87,16 +87,18 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
87
87
|
const def = await fetch(BASE + '/').then((r) => r.text());
|
|
88
88
|
ok('R1 the premium Briefing is the default page', /class="rail/.test(def) && !/id="c3-root"/.test(def));
|
|
89
89
|
{ const con = await fetch(BASE + '/console.html').then((r) => r.text()); ok('R1 the console is served at /console.html', /id="c3-root"/.test(con)); const old = await fetch(BASE + '/c3.html', { redirect: 'manual' }); const oldQ = await fetch(BASE + '/c3.html?tab=rep', { redirect: 'manual' }); ok('R1 /c3.html goes to the premium Briefing, and with a query to the console with the same query', old.status === 302 && old.headers.get('location') === '/premium.html' && oldQ.status === 302 && oldQ.headers.get('location') === '/console.html?tab=rep', old.headers.get('location') + ' | ' + oldQ.headers.get('location')); }
|
|
90
|
-
{ const tc = await p.evaluate(() => { const a = document.querySelector('#toConsole'); if (!a) return null; const r = a.getBoundingClientRect(); return { href: a.getAttribute('href'), label: a.getAttribute('aria-label'), w: Math.round(r.width), h: Math.round(r.height), tab: a.tabIndex }; }); ok('R1 the
|
|
90
|
+
{ await p.click('#moreBtn'); const tc = await p.evaluate(() => { const a = document.querySelector('#toConsole'); if (!a) return null; const r = a.getBoundingClientRect(); return { href: a.getAttribute('href'), label: a.getAttribute('aria-label'), w: Math.round(r.width), h: Math.round(r.height), tab: a.tabIndex }; }); ok('R1 the ⋯ menu links to the console (premium-console-link, premium-topbar)', tc && tc.href === '/console.html' && tc.label === 'Open the console' && tc.w >= 44 && tc.h >= 44 && tc.tab === 0, JSON.stringify(tc)); await p.keyboard.press('Escape'); }
|
|
91
91
|
|
|
92
92
|
/* premium-search-bell: the Search button, the bell and Ctrl K, from the shared shell */
|
|
93
93
|
{
|
|
94
94
|
await p.route('**/api/boards/backlog*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, ws: 'w1', board: 'b1', rows: [{ id: 'sb-alpha', title: 'Alpha launch plan', lane: 'feature', stage: 'Build' }] }) }));
|
|
95
95
|
await p.route('**/api/core-docs*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, scope: { name: 'PMOS' }, docs: [{ key: 'roadmap', title: 'Roadmap' }] }) }));
|
|
96
96
|
await p.route('**/api/sessions', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ sessions: [{ id: 's1', name: 'Fix the footer', state: 'idle', cwd: '.' }, { id: 's2', name: 'Nightly run', state: 'idle', automatic: true }] }) }));
|
|
97
|
+
await p.click('#moreBtn');
|
|
97
98
|
const sb = await until(() => p.evaluate(() => { const s = document.querySelector('#pvSearch'), b = document.querySelector('#pvBell'), g = document.querySelector('#pvBdg'); if (!s || !b || !g || g.hidden) return null; const rs = s.getBoundingClientRect(), rb = b.getBoundingClientRect(); return { sw: Math.round(rs.width), sh: Math.round(rs.height), bw: Math.round(rb.width), bh: Math.round(rb.height), n: g.textContent, lab: b.getAttribute('aria-label') }; }), 8000);
|
|
98
99
|
const want = MODEL.list.count;
|
|
99
|
-
ok('SB1 the
|
|
100
|
+
ok('SB1 the ⋯ menu has Search and the header has the bell, 44 px, and the bell counts what the Briefing lists', sb && sb.sw >= 44 && sb.sh >= 44 && sb.bw >= 44 && sb.bh >= 44 && sb.n === String(want) && sb.lab === 'Needs you: ' + want, JSON.stringify(sb));
|
|
101
|
+
await p.keyboard.press('Escape');
|
|
100
102
|
await p.keyboard.press('Control+k');
|
|
101
103
|
const pal = await until(() => p.evaluate(() => { const o = document.querySelector('#pvOv'); return o && !o.hidden && document.activeElement && document.activeElement.id === 'pvQ' ? { rail: document.querySelector('.rail').inert, groups: [...document.querySelectorAll('#pvList .pv-grp')].map((x) => x.textContent) } : null; }), 6000);
|
|
102
104
|
ok('SB2 Ctrl K opens the search with the box focused and the page behind it inert', pal && pal.rail === true, JSON.stringify(pal));
|
|
@@ -107,8 +109,8 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
107
109
|
const ses = await until(() => p.evaluate(() => [...document.querySelectorAll('#pvList .pv-row b')].map((x) => x.textContent).join() === 'Fix the footer' ? 1 : 0), 6000);
|
|
108
110
|
ok('SB4 sessions are listed and automatic ones are left out', !!ses);
|
|
109
111
|
await p.keyboard.press('Escape');
|
|
110
|
-
const closed = await until(() => p.evaluate(() => document.querySelector('#pvOv').hidden && !document.querySelector('.rail').inert && document.activeElement.id === '
|
|
111
|
-
ok('SB5 Escape closes it and puts the focus back on the button', !!closed);
|
|
112
|
+
const closed = await until(() => p.evaluate(() => document.querySelector('#pvOv').hidden && !document.querySelector('.rail').inert && document.activeElement.id === 'moreBtn'), 4000);
|
|
113
|
+
ok('SB5 Escape closes it and puts the focus back on the ⋯ button', !!closed);
|
|
112
114
|
await p.click('#pvBell');
|
|
113
115
|
const rows = await until(() => p.evaluate(() => { const o = document.querySelector('#pvOv'); return !o.hidden ? document.querySelectorAll('#pvList .pv-row').length : 0; }), 6000);
|
|
114
116
|
ok('SB6 the bell lists the Briefing rows and a row opens the Briefing', rows === MODEL.list.rows.length, String(rows));
|
|
@@ -116,8 +118,8 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
116
118
|
ok('SB7 search and the bell only read: no POST left the page', !A.reqs.some((x) => x.startsWith('POST ')));
|
|
117
119
|
}
|
|
118
120
|
/* premium-settings: the dialog holds Workspaces and Connectors only; each press goes to its existing route */
|
|
119
|
-
{ const bt = await p.evaluate(() => { const b = document.querySelector('#settingsBtn'); if (!b) return null; const r = b.getBoundingClientRect(); return { label: b.
|
|
120
|
-
ok('S1 the
|
|
121
|
+
{ await p.click('#moreBtn'); const bt = await p.evaluate(() => { const b = document.querySelector('#settingsBtn'); if (!b) return null; const r = b.getBoundingClientRect(); return { label: b.textContent.trim(), w: Math.round(r.width), h: Math.round(r.height) }; });
|
|
122
|
+
ok('S1 the ⋯ menu has a Settings item of at least 44 px', bt && bt.label === 'Settings' && bt.w >= 44 && bt.h >= 44, JSON.stringify(bt));
|
|
121
123
|
await p.click('#settingsBtn');
|
|
122
124
|
const drawn = await until(() => p.evaluate(() => document.querySelectorAll('#oMain .sr').length > 0), 8000);
|
|
123
125
|
const labs = await p.evaluate(() => [...document.querySelectorAll('#oMain .label')].map((x) => x.textContent));
|
|
@@ -140,8 +142,8 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
140
142
|
let removes = 0, slowOnce = true;
|
|
141
143
|
await p.route('**/api/sessions', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ sessions: fake }) }));
|
|
142
144
|
await p.route('**/api/session/remove', (r) => { removes++; const id = JSON.parse(r.request().postData()).id; if (id === 'sess-2' && slowOnce) { slowOnce = false; return r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, removed: false, note: 'asked it to end' }) }); } const i = fake.findIndex((x) => x.id === id); if (i >= 0) fake.splice(i, 1); return r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, removed: true }) }); });
|
|
143
|
-
const bt = await p.evaluate(() => { const b = document.querySelector('#sessBtn'); if (!b) return null; const r = b.getBoundingClientRect(); return { w: Math.round(r.width), h: Math.round(r.height) }; });
|
|
144
|
-
ok('X1 the
|
|
145
|
+
await p.click('#moreBtn'); const bt = await p.evaluate(() => { const b = document.querySelector('#sessBtn'); if (!b) return null; const r = b.getBoundingClientRect(); return { w: Math.round(r.width), h: Math.round(r.height) }; });
|
|
146
|
+
ok('X1 the ⋯ menu has an Agent sessions item of at least 44 px', bt && bt.w >= 44 && bt.h >= 44, JSON.stringify(bt));
|
|
145
147
|
await p.click('#sessBtn');
|
|
146
148
|
const rows = await until(() => p.evaluate(() => document.querySelectorAll('#oMain .ssr').length), 8000);
|
|
147
149
|
ok('X2 the list shows the sessions that have not exited, and the title counts them', rows === 2 && (await p.evaluate(() => document.querySelector('#dTitle').textContent)) === '2 running', String(rows));
|
|
@@ -164,7 +166,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
164
166
|
let asking = true; const answers = [];
|
|
165
167
|
await p.route('**/api/runs', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, cards: asking ? { 'sess-1': { state: 'asking', asked: 'q-7', ask: { id: 'q-7', q: 'Which folder should the brief go in?', options: [{ label: 'planning/briefs', rec: true }, { label: 'planning/research' }] } } } : {} }) }));
|
|
166
168
|
await p.route('**/api/runs/answer', (r) => { answers.push({ ...JSON.parse(r.request().postData()), hasNonce: !!r.request().headers()['x-pmos-nonce'] }); asking = false; r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true }) }); });
|
|
167
|
-
await p.keyboard.press('Escape'); await p.click('#sessBtn');
|
|
169
|
+
await p.keyboard.press('Escape'); await p.click('#moreBtn'); await p.click('#sessBtn');
|
|
168
170
|
const q = await until(() => p.evaluate(() => { const b = document.querySelector('#oMain .ssq'); return b ? b.textContent : ''; }), 8000);
|
|
169
171
|
ok('Q1 a session that is asking shows its question and the options it offered, in its own words', /Which folder should the brief go in\?/.test(q) && /planning\/briefs/.test(q) && /planning\/research/.test(q), q);
|
|
170
172
|
ok('Q2 no question shows on a session that is not asking', (await p.evaluate(() => document.querySelectorAll('#oMain .ssq').length)) === 1);
|
|
@@ -527,7 +529,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
527
529
|
{
|
|
528
530
|
const t = await p.evaluate(() => {
|
|
529
531
|
const small = [];
|
|
530
|
-
for (const s of ['.rr .rhd', '.rr .rpin', '#tl .ev', '#srcChips .fchip', '.fbtn', '.rail .pl', '#
|
|
532
|
+
for (const s of ['.rr .rhd', '.rr .rpin', '#tl .ev', '#srcChips .fchip', '.fbtn', '.rail .pl', '#srcChip', '#moreBtn', '#pgChat', '#theme2']) document.querySelectorAll(s).forEach((e) => { const r = e.getBoundingClientRect(); if (r.width && (r.height < 44 || r.width < 44)) small.push(s + ' ' + Math.round(r.width) + 'x' + Math.round(r.height)); });
|
|
531
533
|
return small;
|
|
532
534
|
});
|
|
533
535
|
ok('R11 every control is at least 44 px', t.length === 0, t.join(' | '));
|
|
@@ -70,7 +70,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
70
70
|
/* M1 */
|
|
71
71
|
const rail = await p.evaluate(() => ({ names: [...document.querySelectorAll('.rail .pl')].map((b) => b.textContent.trim()), cur: document.querySelector('.rail [aria-current="page"]').textContent.trim(), go: [...document.querySelectorAll('.rail [data-go]')].map((b) => b.dataset.go), pi: getComputedStyle(document.querySelector('.rail')).getPropertyValue('--pi').trim(), title: document.title }));
|
|
72
72
|
ok('M1 the rail names four places, My work is current and the indicator sits on it', rail.names.join() === 'Briefing,My work,Board,Insights' && rail.cur === 'My work' && rail.go.join() === 'brief,work,init,rep' && rail.pi === '1', JSON.stringify(rail));
|
|
73
|
-
{ const tc = await p.evaluate(() => { const a = document.querySelector('#toConsole'); if (!a) return null; const r = a.getBoundingClientRect(); return { href: a.getAttribute('href'), label: a.getAttribute('aria-label'), w: Math.round(r.width), h: Math.round(r.height), tab: a.tabIndex }; }); ok('M1 the
|
|
73
|
+
{ await p.click('#moreBtn'); const tc = await p.evaluate(() => { const a = document.querySelector('#toConsole'); if (!a) return null; const r = a.getBoundingClientRect(); return { href: a.getAttribute('href'), label: a.getAttribute('aria-label'), w: Math.round(r.width), h: Math.round(r.height), tab: a.tabIndex }; }); ok('M1 the ⋯ menu links to the console (premium-console-link, premium-topbar)', tc && tc.href === '/console.html' && tc.label === 'Open the console' && tc.w >= 44 && tc.h >= 44 && tc.tab === 0, JSON.stringify(tc)); await p.keyboard.press('Escape'); }
|
|
74
74
|
const res = await fetch(BASE + '/premium-work').then((r) => r.status);
|
|
75
75
|
{ /* the Calendar card shared with the Briefing (initiative premium-calendar-card) */
|
|
76
76
|
const cal = await until(() => p.evaluate(() => { const b = [...document.querySelectorAll('#weekBody [data-day]')]; return b.length === 5 && !/Reading/.test(document.querySelector('#wkList').textContent) ? { title: document.querySelector('#hWeek').textContent, pressed: b.filter((x) => x.getAttribute('aria-pressed') === 'true').length, list: !!document.querySelector('#wkList .wkd'), fold: document.querySelector('#weekCard .foldb').getAttribute('aria-expanded') } : null; }));
|
|
@@ -13,18 +13,26 @@ Every premium page uses the console's type: Space Grotesk for text, IBM Plex Mon
|
|
|
13
13
|
|
|
14
14
|
A rail on the left names four places: Briefing, My work, Board and Insights. Each is a premium page.
|
|
15
15
|
|
|
16
|
-
Every premium page has
|
|
16
|
+
Every premium page has the same top bar. On the left is where you are, then a round **Chat** button. On the right are the **Sources** chip, the bell and one **⋯** menu.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
- **Chat** opens the read-only agent about the page you are on: the Briefing, My work, the board, or the initiative. On Insights, Chat opens the Insight Studio, because the Studio is that page's chat.
|
|
19
|
+
- **Sources** has a green dot when every source was read recently, and an orange dot when a source is old, was never read, failed, or the page could not read it. Hover to see which. A press opens the Sources dialog (see "Sources" below).
|
|
20
|
+
- **The bell** counts the same things the Briefing lists under what you need to do, and a press opens the Briefing.
|
|
21
|
+
- **The ⋯ menu** holds **Search** (Ctrl K), **Agent sessions** with a count, **Console**, **Theme** (Light, Dark or Auto) and **Settings**. On the Board it also holds **Open initiatives** as Page or Popup. An orange dot on ⋯ means an agent session waits on you.
|
|
22
|
+
- **On a phone** the bar is one row: the page name, Chat, the bell and ⋯. Sources moves into the ⋯ menu.
|
|
19
23
|
|
|
20
|
-
|
|
24
|
+
**Search** (Ctrl K, or `/`) opens the search over places, initiatives, documents and your running sessions; Enter opens the result. Search and the bell only read; neither changes a record. **Console** opens the console at `/console.html`, for the places premium does not have yet. In the console, the More menu has **Open premium**, which opens this page. **Settings** opens one dialog with two sections. **Workspaces** lists the repositories PMOS works in, with Add (a folder path) and Remove; Remove forgets the address and never deletes the folder, and a refusal shows the server's reason. **Connectors** has an On/Off switch for each source the Briefing reads. Each press saves that one record. Every other setting runs on a default and stays in the console; the dialog links to it. Remove needs the page's launch nonce, so an agent session cannot call it.
|
|
25
|
+
|
|
26
|
+
**Sources** is a dialog that lists each tracked source (Repository, Initiatives, Calendar, Jira status, My work and Tracker items) with its own state and the time it was last read. Each source except the repository has **Refresh**, and **Refresh all** reads them all again. Slack and email are read as part of My work, so they have no row of their own. A source PMOS does not track has no row: the dialog shows only what PMOS can say it read.
|
|
27
|
+
|
|
28
|
+
**Agent sessions** in the ⋯ menu shows a count of the sessions running. It opens a dialog that lists each running session and background run with its note, state and start time. **Stop** asks first and says what it ends, then ends the session and closes its terminal. If the session has not exited yet, the row says so and offers Stop again. When a session has asked a question, its row shows the question in the agent's own words with the options it offered; a press sends that option as your answer, and the question leaves the row. A permission request ("Wants to run"), terminals and new sessions stay in the console; the dialog links to it. Answering needs the page's launch nonce, so an agent session cannot call it.
|
|
21
29
|
|
|
22
30
|
## Products
|
|
23
31
|
|
|
24
32
|
You work across products, and a conversation in email, the calendar or Confluence cannot be tied to one product. So the Briefing reads more than one workspace and merges what needs you into one list.
|
|
25
33
|
|
|
26
34
|
- **By default** it reads every registered workspace except the home one (PMOS itself). PMOS is the tool, not a product you manage, so it is left out until you ask.
|
|
27
|
-
- **
|
|
35
|
+
- **Products**, at the top of the **Sources** dialog, lists every registered workspace, the home one included, each with a box. Tick a box to read that workspace, clear it to stop. The button says how many are on, for example "2 of 3". "Back to the default" returns to every workspace except the home one.
|
|
28
36
|
- **Your choice is saved** as the setting `ws.briefing.include` (a list of workspace ids) in this computer's state folder, so it stays when you reload or restart.
|
|
29
37
|
- **A workspace that is not ticked is not read at all.** Its decisions, blocked work, merges and runs do not count in the hero, the list or the dock.
|
|
30
38
|
- **Each row says which product it belongs to**, in a small tag before its line. Two products can hold an initiative or a kill condition of the same name. They stay separate rows, and a press is written into the journal of the product the row names.
|
|
@@ -68,12 +76,9 @@ Two reads feed the page. The quick read takes the kill conditions, the failed-re
|
|
|
68
76
|
|
|
69
77
|
## The header
|
|
70
78
|
|
|
71
|
-
The
|
|
72
|
-
|
|
73
|
-
Two buttons sit beside the pill:
|
|
79
|
+
The Briefing's **Sources** dialog has two more parts under the tracked sources. **Products** is the product picker (see "Products"). **What the Briefing read** lists each source the page reads, with its state: **Read**, **Not read**, **Not included** or **Off**, and the reason. Examples: `planning/runs/agent-runs.jsonl` is missing in that repository; the product is not chosen under **Products**; the source is switched off under **Settings → Connectors**; the morning brief could not reach it. A source that cannot be read adds nothing. The page does not guess.
|
|
74
80
|
|
|
75
|
-
|
|
76
|
-
- **Sources** lists each source that the pill names, with its state: **Read**, **Not read**, **Not included** or **Off**. For each source, it also gives the reason. Examples: `planning/runs/agent-runs.jsonl` is missing in that repository; the product is not chosen under **Products**; the source is switched off under **Settings → Connectors**; the morning brief could not reach it.
|
|
81
|
+
On the Briefing, **Refresh all** also reads every included repository again now, without waiting for the 5-minute age. If a read is already running, it does not start a second one. A read that failed is tried again at once.
|
|
77
82
|
|
|
78
83
|
## The hero sentence
|
|
79
84
|
|
|
@@ -246,9 +251,9 @@ Board is the third place on the rail, at `/premium-board.html`. It reads what th
|
|
|
246
251
|
- **List** and **Timeline** show ten tasks a page with Previous and Next; **By stage** shows six cards a column with Show more. **Timeline** draws a bar for each initiative that has both a start and an end date, with the days left or over, and counts the rest. With no dates on record it says so and draws nothing.
|
|
247
252
|
- **Sprint** appears when an agent session has read Jira for the board. Otherwise it says there is none. **Coming up** shows the next release, from the releases ledger.
|
|
248
253
|
- **Metrics** appears above the Initiatives card on the board of any workspace except the home one (PMOS itself), and counts from that workspace's own repository. It has four tiles. **Corrections per 100 runs** is the corrections logged on the week's runs in `planning/runs/agent-runs.jsonl`; a week with fewer than 10 runs is left blank. **Merged a week** counts the commits on the first-parent line of the trunk. **Blocked** and **Idle for a month** come from the workflow engine, which keeps no history. From the first day the card is read, PMOS keeps their counts once a day in the workspace's state folder (`board-metric-history.jsonl`), so their charts start on that day and their caption says **history starts today** (later, the date). Earlier weeks read **Not kept yet**. Move over a chart, or use the arrow keys, to read a week. A tile that cannot be counted says **Not read** and why; a repository with no run log says **No runs yet**. The line above the tiles starts with how many tiles need a look, and those tiles have a **Needs a look** chip and an orange outline. The line ends with **open Insights**, which opens the same board's Insights page. Press a tile for its definition and values, with the read-only agent beside it. A target is set on Insights, not here. A measure with a target shows it under the value, draws it as a dashed line, and carries **On target** or its gap (for example **2 short**); off target, it also has the orange outline. A measure without a target draws no line. Day and Month are off. It was tested only on made-up repositories, not on a real IDPF or microsite repository.
|
|
249
|
-
- **The
|
|
254
|
+
- **The top bar** names the page and the board. With more than one board a menu switches between them, and **Chat** opens the board in the dialog with the read-only agent.
|
|
250
255
|
- **Core documents** lists the board's documents with their state, cadence and writer, a summary (drafts to review, not started, up to date), a progress bar, a filter and a search. A document with a file opens in the dialog, read only, with its path and state; a draft there has **Issue it**, which marks it issued through the console's own route and sends nothing, and **Draft it again**, which starts a new draft that replaces this one (a board draft has no Edit tab). **Draft it** starts the existing read-only run that writes a draft and sends nothing; **Draft the N not started** does that for each document that can be drafted. **Set it up** and **Open** go to the console. **Add a document** opens a form (title, who writes it, where it lives) and saves a document the core set does not cover on the board's record, in `custom-docs.jsonl`. A document with no link reads "Not started". A document with a link to Confluence or Google Docs reads "Linked" and shows its address. PMOS does not read or sync the linked page, so a linked document is never counted as up to date. Issue and Drop are not on this page.
|
|
251
|
-
- **Opening an initiative.** A click on an initiative opens its page (see "Initiative page").
|
|
256
|
+
- **Opening an initiative.** A click on an initiative opens its page (see "Initiative page"). **Open initiatives** (Page or Popup) in the ⋯ menu changes that: Popup opens the initiative's dialog instead, which shows its record as a grid and the path of its file, with the read-only agent beside it. The choice is kept in this browser. The dialog holds no press.
|
|
252
257
|
- **New asks** sits at the top of the right column on a team board. Each ask shows where it came from and the drafted title, lane and anchor. **Accept** makes it an initiative in the first stage, through the console's accept route; **Decline** asks for a reason first. The card says when nothing is left to triage.
|
|
253
258
|
- **New initiative** (beside the Initiatives heading, team boards only) asks for a title, a lane and an anchor (a KR or a health budget). It writes an ask and accepts it, as the console does. An unanchored initiative is refused on the page.
|
|
254
259
|
- **⋯ on a row** (and the bar under an initiative page's heading) moves it to the next or another stage, puts it on hold with a reason and a check-back day, cancels it with a reason, or archives it. Each press writes one line through the console's route, says what it recorded, and offers Undo for a few seconds. An on-hold row offers Resume; a cancelled one offers Reopen; an archived one offers Restore. Cancelled and archived initiatives leave the list and sit under a fold below it. On the PMOS board the workflow engine places each initiative, so the moves are not offered and New asks and New initiative are hidden.
|
|
@@ -258,10 +263,10 @@ Not drawn, because PMOS holds no record for them: the mockup's demo measures (Ac
|
|
|
258
263
|
|
|
259
264
|
## Initiative page
|
|
260
265
|
|
|
261
|
-
The initiative page is at `/premium-initiative.html?id=<initiative>`. A click on a Board initiative opens it. The
|
|
266
|
+
The initiative page is at `/premium-initiative.html?id=<initiative>`. A click on a Board initiative opens it. The round back button at the top leads back to the Board. Like the Board it reads the records of the production Initiatives sheet, and the first read takes a few seconds, because the routes derive every initiative. Until they have, the page says so and shows nothing.
|
|
262
267
|
|
|
263
|
-
- **The
|
|
264
|
-
-
|
|
268
|
+
- **The top bar** has a back button to the board, then the initiative's name with a menu of the board's initiatives. **Chat** opens the initiative in the dialog with the read-only agent beside it.
|
|
269
|
+
- Long file names in the evidence of a check wrap inside the card instead of running past its edge.
|
|
265
270
|
- **The header** shows a status chip, the owner and the planned finish. Each appears only when a record holds it. Under it, the stage strip shows how far through the board's workflow the initiative is.
|
|
266
271
|
- **Overview** shows the description (the part of the record's title after " — "), then the next step with its reason, its action and what happens if you wait, as the workflow engine states them, and who it waits on. **PMOS can help** offers up to three presses that do something real: a draft of the first core document not started (the existing read-only run) and a question for the read-only agent. The health reasons and the board's warnings are shown as written.
|
|
267
272
|
- **Overview** is one full-width card, as in the mockup; there is no separate Checks card. A blocked step shows as a note, and "All N workflow steps" lists every step of the engine with the evidence each states.
|
|
@@ -277,7 +282,7 @@ Insights is the fourth place on the rail, at `/premium-insights.html`. It reads
|
|
|
277
282
|
|
|
278
283
|
- **Charts.** One chart for each KR metric that holds at least two readings. The line runs through the readings at their dates, so a month with no reading is a gap and not a zero. The dashed line is the metric's target. The chip is the record's own line status: on its line, behind it, or well behind it. Pressing a chart, or its Details link, opens the metric's record in the dialog with the read-only agent beside it.
|
|
279
284
|
- **Dashboards.** The switch lists All measures first, then your saved dashboards (the main one first, marked Main), then the pillars the metrics name. A saved dashboard draws its charts in the order you saved them. A chart whose record is gone, or that has fewer than two readings, is listed in its place with the reason and is not drawn.
|
|
280
|
-
- **Open the Studio from the top.**
|
|
285
|
+
- **Open the Studio from the top.** **Chat** beside the board name opens the Insight Studio: on the saved dashboard you are looking at, otherwise on a new dashboard, or in Report mode when no measure has a series yet.
|
|
281
286
|
- **Make or edit a dashboard.** **New dashboard**, or **Edit** on a saved one, opens the **Insight Studio**, a wide dialog. On the right, the brief shows the Name, Purpose, Charts and Main dashboard; press a chip to change it. **Library** lists the board's measures and saved dashboards to add. The preview draws the dashboard as the page will, and lists a measure with no series as not drawn. The checks (a name, a purpose, a chart, six or fewer, no repeat, a main dashboard on the board) say what fails, with a one-press fix. On the left you can say it instead: "add Partner activation", "remove …", "move … first", "call it …", "it is for …", "make it the main dashboard", "undo" or "start a new one". A turn changes the draft only. **Undo** steps back one change. **Save the dashboard** records it; **Remove the dashboard** asks once more and then removes it. In a chart's dialog, **On your dashboards** has a switch for each saved dashboard, which adds the chart to it or takes it off.
|
|
282
287
|
- **Make your own chart.** **New chart**, or **Edit** on one of your charts, opens the Insight Studio in **Chart** mode; the switch at the top moves between Chart and Dashboard, and each keeps its own draft. The brief shows the Question, Measure, Form (line, bars, number or meter), Range (all readings or the last few) and Target; **More** adds the Title, Better when, Note and Add to (a dashboard). The Studio suggests a form from the question and says why. The checks (a question, a target, enough readings, a form that fits the question, one scale) say what fails, with a one-press fix. You can say it instead: "show it as bars", "last 4 readings", "target 35", "lower is better", "call it …", "note: …", "add it to Weekly", or a question. A pie is declined, with the reason. **Save the chart** records it in the workspace's state folder, and adds it to the dashboard you named. Your charts are listed under **All measures**, and a dashboard can hold them beside the measures. **Remove the chart** asks once more; a dashboard that held it then says it was removed.
|
|
283
288
|
- **Set up a report in the Studio.** **New report** on the Reports card opens the Insight Studio in **Report** mode. The brief shows the Title, What it answers, Audience, Format, Schedule, Draw from (your work, or the board's dashboard) and the Sections. A new report always has the same sections, in the same order, so they are listed, not edited. The checks (what it answers, an audience, a format that fits the audience, a new title, the answer first) say what fails, with a one-press fix. You can say it instead: "it answers: …", "for leadership", "slides", "monthly", "every two weeks on Thursday", "call it …". **Set it up** records the report and writes its first draft as a file.
|
|
@@ -308,7 +313,7 @@ Welcome is the premium first-run page, at `/premium-welcome.html`. It is a page
|
|
|
308
313
|
|
|
309
314
|
## The default page
|
|
310
315
|
|
|
311
|
-
The premium Briefing is the default page: `/` and `/index.html` open it. The console is at `/console.html`, and
|
|
316
|
+
The premium Briefing is the default page: `/` and `/index.html` open it. The console is at `/console.html`, and **Console** in the ⋯ menu on each premium page goes there. The old address `/c3.html` goes to the premium Briefing; with a query (for example `/c3.html?tab=rep`) it goes to `/console.html` with the same query. `/classic.html` is unchanged. To go back, change the last page name in the page-route chain in `server.js` from `premium.html` to `c3.html` and delete the `/c3.html` redirect above it.
|
|
312
317
|
|
|
313
318
|
## The dialog on a phone and the document sheet's views
|
|
314
319
|
|
|
@@ -49,6 +49,11 @@ function threadOf(runtimeDir, key, now = Date.now()) {
|
|
|
49
49
|
/** The row as the server's own model has it, plus the files an answer should start from. null when the key names no row on the page. */
|
|
50
50
|
function rowFor(model, key) {
|
|
51
51
|
if (!model || !KEY_RE.test(String(key || ''))) return null;
|
|
52
|
+
if (/^(src|work):this-page$/.test(key)) { // the top bar's Chat: the whole page is the context, its summary and its first rows
|
|
53
|
+
const rows = model.rows || (model.list && model.list.rows) || [];
|
|
54
|
+
const say = (model.hero || []).map((s) => (s.parts || []).map((p) => p.t).join('')).join(' ');
|
|
55
|
+
return { title: key === 'work:this-page' ? 'The My work page' : 'The Briefing page', subject: clip(model.header && model.header.text, 240), say: clip(say, 600), facts: rows.slice(0, 12).map((r) => clip(r.kind || r.list || 'item', 40) + ': ' + clip(r.title, 240)), files: [] };
|
|
56
|
+
}
|
|
52
57
|
if (/^(work|board|init|doc|ins):/.test(key)) { // a My work item, a Board initiative, an Insights measure, an initiative page or one of its documents: the item's own record is the context
|
|
53
58
|
const w = (model.rows || []).find((r) => r.key === key); if (!w) return null;
|
|
54
59
|
const d = w.dialog || {};
|
|
@@ -189,7 +189,7 @@ function build(facts) {
|
|
|
189
189
|
const off = offOf(charts);
|
|
190
190
|
const board = f.board || {};
|
|
191
191
|
const model = {
|
|
192
|
-
header: { text: (f.pending ? 'Reading the records · ' : '') + 'Real data' + (missing.length ? ' · not read: ' + missing.join(', ') : '') },
|
|
192
|
+
header: { text: (f.pending ? 'Reading the records · ' : '') + 'Real data' + (missing.length ? ' · not read: ' + missing.join(', ') : ''), missing },
|
|
193
193
|
board: { ws: board.ws || null, id: board.id || null, name: board.name || 'Insights', switcher: (f.boards || []).map((b) => ({ ws: b.ws, id: b.id, name: b.name })) },
|
|
194
194
|
charts, mine, mineGone, mineSaved: mineAll, noSeries, dashboards, rows: charts,
|
|
195
195
|
findings: findings.length ? findings : [{ kind: 'calm', key: null, text: charts.length ? (charts.some((c) => c.target !== null) ? 'Nothing stands out. No measure moved much, and none is far behind its line.' : 'Nothing stands out. No measure here has a target, so the series can only be described.') : '' }],
|
|
@@ -75,7 +75,7 @@ async function post(req, res, url, ctx) {
|
|
|
75
75
|
}
|
|
76
76
|
if (act === 'ask') {
|
|
77
77
|
let wsId; try { const w = merged && sk ? { id: sk.ws } : ctx.getWs && ctx.getWs(url.searchParams.get('ws') || null); wsId = w && w.id; } catch { wsId = undefined; }
|
|
78
|
-
const a = Ag.ask({ runtimeDir, key: b.key, text: b.text, model: /^work:/.test(String(b.key || '')) ? WP.peekModel() : /^board:/.test(String(b.key || '')) ? BoardP.peekModel() : /^ins:/.test(String(b.key || '')) ? InsP.peekModel() : /^(init|doc):/.test(String(b.key || '')) ? InitP.peekModel() : sk || /^src:/.test(String(b.key || '')) ? Prod.peekModel() : BP.peekModel(root), spawnSession: ctx.spawnSession, wsId });
|
|
78
|
+
const a = Ag.ask({ runtimeDir, key: b.key, text: b.text, model: /^work:/.test(String(b.key || '')) ? WP.peekModel() : /^board:/.test(String(b.key || '')) ? BoardP.peekModel() : /^ins:/.test(String(b.key || '')) ? InsP.peekModel() : /^(init|doc):/.test(String(b.key || '')) ? InitP.peekModel() : sk || (/^src:/.test(String(b.key || '')) && !(b.key === 'src:this-page' && url.searchParams.get('ws'))) ? Prod.peekModel() : BP.peekModel(root), spawnSession: ctx.spawnSession, wsId });
|
|
79
79
|
ctx.json(res, a.body, a.status);
|
|
80
80
|
return true;
|
|
81
81
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.318.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.318.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -63,10 +63,10 @@ const saved = async () => { const j = await (await fetch(BASE + '/api/insights-p
|
|
|
63
63
|
const open = async (sel) => { await p.click(sel); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#oMain .stu'))); await sleep(300); };
|
|
64
64
|
const shut = async () => { for (let i = 0; i < 2 && await p.evaluate(() => document.querySelector('#dlg').classList.contains('on')); i++) { await p.keyboard.press('Escape'); await sleep(150); } };
|
|
65
65
|
|
|
66
|
-
/* O0: the
|
|
67
|
-
ok('O0 the
|
|
66
|
+
/* O0: the bar's Chat button opens the Studio on the dashboard shown (premium-topbar: the Studio is this page's chat) */
|
|
67
|
+
ok('O0 the bar has the Chat button, no label, named for the Studio (premium-topbar)', await p.evaluate(() => { const b = document.querySelector('#crAsk'); return !!b && b.textContent.trim() === '' && !!b.querySelector('svg') && b.getAttribute('aria-label') === 'Open the Insight Studio'; }));
|
|
68
68
|
await open('#crAsk');
|
|
69
|
-
ok('O0b
|
|
69
|
+
ok('O0b Chat opens the Studio', await p.evaluate(() => /^Insight Studio · /.test(document.querySelector('#dEye').textContent)));
|
|
70
70
|
await shut();
|
|
71
71
|
/* O: New dashboard opens the Studio */
|
|
72
72
|
await open('#pdNew');
|
|
@@ -168,7 +168,7 @@ const saved = async () => { const j = await (await fetch(BASE + '/api/insights-p
|
|
|
168
168
|
await q.goto(BASE + '/premium-insights.html');
|
|
169
169
|
await until(() => q.evaluate(() => !!document.querySelector('#pdNew')));
|
|
170
170
|
const pill = await q.evaluate(() => { const b = document.querySelector('#crAsk'), r = b.getBoundingClientRect(); return { txt: b.textContent.trim(), w: r.width, h: r.height, right: r.right, vw: innerWidth, vis: !!b.offsetParent }; });
|
|
171
|
-
ok(`F0 at 390 px (${theme}) the
|
|
171
|
+
ok(`F0 at 390 px (${theme}) the Chat button shows, fits the width and is 44 px`, pill.vis && pill.right <= pill.vw && Math.round(pill.h) >= 44 && Math.round(pill.w) >= 44, JSON.stringify(pill));
|
|
172
172
|
await q.click('#pdNew'); await until(() => q.evaluate(() => !!document.querySelector('#oMain .stu'))); await sleep(400);
|
|
173
173
|
// measured once the dialog has finished opening: its rise animation scales the targets while it runs
|
|
174
174
|
const measure = () => q.evaluate(() => {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* and the board's own presses of pm/premium-acts.js (initiative premium-board-actions): the New asks card, New initiative, and a row's menu (move,
|
|
5
5
|
* hold, cancel, archive and their Undo). Issue it on a document draft, read in a dialog, is POST /api/core-docs/issue (initiative premium-core-doc-issue). */
|
|
6
6
|
import { pmPost } from './http.js';
|
|
7
|
-
import { $, $$, esc, openDlg, closeDlg, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, CHECK, AI, store, crumbHtml, wireCrumb, kv, H, openAddDoc } from './premium-shell.js';
|
|
7
|
+
import { $, $$, esc, openDlg, closeDlg, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, CHECK, AI, store, crumbHtml, wireCrumb, kv, H, openAddDoc, setPageGaps } from './premium-shell.js';
|
|
8
8
|
import { issueBody } from './premium-doc-edit.js';
|
|
9
9
|
import { mountDocSheet } from './premium-doc-sheet.js';
|
|
10
10
|
import * as MT from './premium-metric-tiles.js';
|
|
@@ -30,10 +30,11 @@ function drawHead() {
|
|
|
30
30
|
if (!crumbed) {
|
|
31
31
|
crumbed = true;
|
|
32
32
|
const boards = M.board.switcher || [];
|
|
33
|
-
$('#crumbHost').innerHTML = crumbHtml({ board: M.board.name || 'Board', boards, ask: 'Ask about this board' });
|
|
33
|
+
$('#crumbHost').innerHTML = crumbHtml({ page: 'Board', board: M.board.name || 'Board', boards, ask: 'Ask about this board' });
|
|
34
34
|
wireCrumb({ boards, board: M.board.id, goBoard: (ws, id) => location.assign('/premium-board.html?ws=' + encodeURIComponent(ws) + '&board=' + encodeURIComponent(id)), ask: () => openRow(rowOf('board:this-board')) });
|
|
35
35
|
}
|
|
36
36
|
$('#snap').textContent = M.header.text;
|
|
37
|
+
setPageGaps(((M.header && M.header.missing) || []).length);
|
|
37
38
|
$('#snap').title = 'Every figure on this page comes from a record of the board. A date, owner or progress shows only when one was set.';
|
|
38
39
|
$('#brief').textContent = '';
|
|
39
40
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* premium-board-actions, pm/premium-acts.js): move to the next stage or back, hold, cancel, archive, resume, reopen and restore, each with Undo. Nothing here issues a document. */
|
|
7
7
|
import { pmPost } from './http.js';
|
|
8
8
|
import { mountDocSheet } from './premium-doc-sheet.js';
|
|
9
|
-
import { $, $$, esc, openDlg, closeDlg, setMode, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, kv, H2, CHECK, CHEV, crumbHtml, wireCrumb, AI, openAddDoc } from './premium-shell.js';
|
|
9
|
+
import { $, $$, esc, openDlg, closeDlg, setMode, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, kv, H2, CHECK, CHEV, crumbHtml, wireCrumb, AI, openAddDoc, setPageGaps } from './premium-shell.js';
|
|
10
10
|
import { barHtml, onBar, closeMenu } from './premium-acts.js';
|
|
11
11
|
|
|
12
12
|
let M = null; // the model
|
|
@@ -257,6 +257,7 @@ function draw() {
|
|
|
257
257
|
}
|
|
258
258
|
$('#iH1').textContent = M.title; document.title = 'PMOS · ' + M.title;
|
|
259
259
|
$('#snap').textContent = M.header.text;
|
|
260
|
+
setPageGaps(((M.header && M.header.missing) || []).length);
|
|
260
261
|
$('#snap').title = 'Every figure on this page comes from a record. A date, owner or progress shows only when one was set.';
|
|
261
262
|
const keepQ = $('#dmQ') && document.activeElement === $('#dmQ');
|
|
262
263
|
closeMenu();
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* draft, PRD R2 to R4). premium-studio-chart adds a saved chart (POST /api/premium-charts/save, PRD C1, C10) and its four forms (C3). premium-studio-report
|
|
7
7
|
* adds New report and Shape it in the Studio, whose presses are POST /api/report-setups/setup | from-dashboard and POST /api/report-structure/turn | remove |
|
|
8
8
|
* revert | accept (PRD R5 to R8). Nothing else posts, and nothing is sent outward. */
|
|
9
|
-
import { $, $$, esc, openDlg, closeDlg, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, crumbHtml, wireCrumb, kv } from './premium-shell.js';
|
|
9
|
+
import { $, $$, esc, openDlg, closeDlg, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, crumbHtml, wireCrumb, kv, setPageGaps } from './premium-shell.js';
|
|
10
10
|
import { pmPost, pmGet } from './http.js';
|
|
11
11
|
import { openStudio } from './premium-studio.js';
|
|
12
12
|
import { openReport } from './premium-report-read.js';
|
|
@@ -28,10 +28,11 @@ function drawHead() {
|
|
|
28
28
|
if (!crumbed) {
|
|
29
29
|
crumbed = true;
|
|
30
30
|
const boards = M.board.switcher || [];
|
|
31
|
-
$('#crumbHost').innerHTML = crumbHtml({ board: M.board.name || 'Insights', boards, ask: 'Open the Insight Studio'
|
|
31
|
+
$('#crumbHost').innerHTML = crumbHtml({ page: 'Insights', board: M.board.name || 'Insights', boards, ask: 'Open the Insight Studio' });
|
|
32
32
|
wireCrumb({ boards, board: M.board.id, goBoard: (ws, id) => location.assign('/premium-insights.html?ws=' + encodeURIComponent(ws) + '&board=' + encodeURIComponent(id)), ask: () => { const D = curDash(); if (D && D.saved) openDashEdit(D); else if (M.charts.length) openDashEdit(null); else openReportEdit(null); } }); // the mockup's Studio pill: the saved dashboard shown, else a new dashboard, else a report when no measure has a series
|
|
33
33
|
}
|
|
34
34
|
$('#snap').textContent = M.header.text;
|
|
35
|
+
setPageGaps(((M.header && M.header.missing) || []).length);
|
|
35
36
|
$('#snap').title = 'Every figure on this page comes from a KR metric record. A measure with fewer than two readings is listed, not drawn.';
|
|
36
37
|
$('#brief').textContent = M.empty || '';
|
|
37
38
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* pm/premium-shell.js — what the premium Briefing and My work pages share: the theme, the toast, the standard dialog and the read-only agent's conversation (initiatives briefing-premium and my-work-premium). */
|
|
2
2
|
import { pmGet, pmPost } from './http.js';
|
|
3
3
|
import { recChipView, STOP_LINE } from './premium-meeting.js';
|
|
4
|
+
import { lineItems, behindOf, refreshTargets, whenRead } from './freshness-words.js';
|
|
4
5
|
export const $ = (s, r = document) => r.querySelector(s);
|
|
5
6
|
export const $$ = (s, r = document) => [...r.querySelectorAll(s)];
|
|
6
7
|
export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
@@ -17,10 +18,142 @@ export function theme(t) {
|
|
|
17
18
|
export function flip() {
|
|
18
19
|
const dark = document.documentElement.dataset.theme ? document.documentElement.dataset.theme === 'dark' : matchMedia('(prefers-color-scheme: dark)').matches;
|
|
19
20
|
const next = dark ? 'light' : 'dark';
|
|
20
|
-
theme(next); store.set(THEME_KEY, next);
|
|
21
|
+
theme(next); store.set(THEME_KEY, next); tbTheme();
|
|
21
22
|
}
|
|
22
23
|
{ const t = new URLSearchParams(location.search).get('theme') || store.get(THEME_KEY); theme(t); }
|
|
23
|
-
|
|
24
|
+
/* ── the top bar (initiative premium-topbar): where you are and Chat on the left; the Sources chip, the bell and one menu on the right.
|
|
25
|
+
* The menu holds what left the bar: Search, Agent sessions, Console, Theme, Settings, and on Board how an initiative opens. Every item keeps
|
|
26
|
+
* the id the pages and the code below wire, so a press does what it did as a round button. ── */
|
|
27
|
+
export const CHAT = '<svg class="i" viewBox="0 0 24 24"><path d="M4 5h16v11h-9l-5 4v-4H4z"/><path d="M12 7.6l.8 1.9 1.9.8-1.9.8-.8 1.9-.8-1.9-1.9-.8 1.9-.8z"/></svg>';
|
|
28
|
+
const MORE = '<svg class="i" viewBox="0 0 24 24"><circle cx="6" cy="12" r="1.3"/><circle cx="12" cy="12" r="1.3"/><circle cx="18" cy="12" r="1.3"/></svg>';
|
|
29
|
+
const TH = [['light', 'Light'], ['dark', 'Dark'], ['auto', 'Auto']];
|
|
30
|
+
function tbMount() {
|
|
31
|
+
const t = $('.tools-top'); if (!t || $('#tbMore')) return;
|
|
32
|
+
const pc = $('#pgChat'); if (pc) pc.innerHTML = CHAT;
|
|
33
|
+
t.insertAdjacentHTML('beforeend', `<button type="button" class="schip" id="srcChip" aria-haspopup="dialog" title="When each source was last read"><i class="sdot" id="srcDot" aria-hidden="true"></i>Sources</button>`
|
|
34
|
+
+ `<span class="mwrap" id="tbMore"><button type="button" class="glass round" id="moreBtn" aria-haspopup="menu" aria-expanded="false" aria-controls="moreMenu" aria-label="More" title="More">${MORE}<i class="mdot" id="moreDot" hidden></i></button>`
|
|
35
|
+
+ '<div class="crmenu tbmenu" id="moreMenu" role="menu" aria-label="More" hidden>'
|
|
36
|
+
+ '<button role="menuitem" id="pvSearch" aria-haspopup="dialog">Search<em>Ctrl K</em></button>'
|
|
37
|
+
+ '<button role="menuitem" id="srcItem" class="tbm-src" aria-haspopup="dialog">Sources</button>'
|
|
38
|
+
+ '<button role="menuitem" id="sessBtn" aria-haspopup="dialog" aria-label="Agent sessions">Agent sessions<em id="sessBdg" hidden></em></button>'
|
|
39
|
+
+ '<a role="menuitem" id="toConsole" href="/console.html" aria-label="Open the console">Console</a>'
|
|
40
|
+
+ '<div class="tbrow" id="modeRow" hidden><span>Open initiatives</span></div>'
|
|
41
|
+
+ `<div class="tbrow" role="group" aria-label="Theme"><span>Theme</span><span class="tbseg" id="tbTheme">${TH.map(([k, w]) => `<button role="menuitemradio" data-th="${k}" aria-checked="false">${w}</button>`).join('')}</span></div>`
|
|
42
|
+
+ '<button role="menuitem" id="settingsBtn" aria-haspopup="dialog">Settings</button></div></span>');
|
|
43
|
+
const ms = $('#modeSeg'); if (ms) { $('#modeRow').appendChild(ms); $('#modeRow').hidden = false; }
|
|
44
|
+
tbTheme();
|
|
45
|
+
const btn = $('#moreBtn'), menu = $('#moreMenu');
|
|
46
|
+
const items = () => $$('#moreMenu [role^="menuitem"]').filter((x) => x.offsetParent !== null || x.closest('.tbseg'));
|
|
47
|
+
const close = (back) => { if (menu.hidden) return; menu.hidden = true; btn.setAttribute('aria-expanded', 'false'); if (back) btn.focus(); };
|
|
48
|
+
btn.onclick = (e) => {
|
|
49
|
+
e.stopPropagation();
|
|
50
|
+
if (!menu.hidden) { close(); return; }
|
|
51
|
+
menu.hidden = false; btn.setAttribute('aria-expanded', 'true');
|
|
52
|
+
if ($('#modeSeg', menu)) pillOf($('#modeSeg', menu));
|
|
53
|
+
const f = items()[0]; if (f) f.focus();
|
|
54
|
+
};
|
|
55
|
+
// capture: the menu closes and focus goes back to its button before the item's own press runs, so a dialog it opens returns focus there
|
|
56
|
+
menu.addEventListener('click', (e) => {
|
|
57
|
+
const th = e.target.closest('[data-th]');
|
|
58
|
+
if (th) { const v = th.dataset.th; theme(v === 'auto' ? null : v); store.set(THEME_KEY, v === 'auto' ? '' : v); tbTheme(); return; }
|
|
59
|
+
if (e.target.closest('#modeRow')) return;
|
|
60
|
+
if (e.target.closest('[role="menuitem"]')) close(true);
|
|
61
|
+
}, true);
|
|
62
|
+
document.addEventListener('click', (e) => { if (!e.target.closest('#tbMore')) close(); });
|
|
63
|
+
menu.addEventListener('keydown', (e) => {
|
|
64
|
+
if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); close(true); return; }
|
|
65
|
+
if (e.key !== 'ArrowDown' && e.key !== 'ArrowUp') return;
|
|
66
|
+
const L = items(), i = L.indexOf(document.activeElement); if (!L.length) return;
|
|
67
|
+
e.preventDefault(); L[(i + (e.key === 'ArrowDown' ? 1 : L.length - 1) + (i < 0 ? 1 : 0)) % L.length].focus();
|
|
68
|
+
});
|
|
69
|
+
$('#srcChip').onclick = () => openSources(); $('#srcItem').onclick = () => openSources();
|
|
70
|
+
if (pc) pc.onclick = () => { if (PAGE_CHAT) PAGE_CHAT(); };
|
|
71
|
+
tbReadSrc();
|
|
72
|
+
setInterval(() => { if (!document.hidden) tbReadSrc(); }, 300000);
|
|
73
|
+
}
|
|
74
|
+
function tbTheme() {
|
|
75
|
+
const cur = document.documentElement.dataset.theme || 'auto';
|
|
76
|
+
$$('#tbTheme [data-th]').forEach((b) => b.setAttribute('aria-checked', String(b.dataset.th === cur)));
|
|
77
|
+
}
|
|
78
|
+
let PAGE_CHAT = null;
|
|
79
|
+
/** The page's Chat press: fn opens the page's conversation (the Briefing and My work), the board's or the initiative's, or the Studio. */
|
|
80
|
+
export function onPageChat(fn) { PAGE_CHAT = fn; }
|
|
81
|
+
|
|
82
|
+
/* ── Sources: when each source was last read, and a Refresh for each (GET /api/sources, POST /api/sources/refresh, as Data freshness) ──
|
|
83
|
+
* The chip says no time: each source is read on its own schedule, so only the dialog's rows carry times. Its dot is orange when a source is
|
|
84
|
+
* old, failed or never read, or when the page itself could not read something (setPageGaps). A page adds its own part with sourcesHook. */
|
|
85
|
+
const TB = { src: null, gaps: 0, extra: null, msg: '', busy: false };
|
|
86
|
+
const SSTATE = { fresh: 'Recent', stale: 'Old', never: 'Never read', building: 'Reading now', failed: 'Failed', off: 'Off' };
|
|
87
|
+
const wsQ = () => { const w = new URLSearchParams(location.search).get('ws'); return w ? '?ws=' + encodeURIComponent(w) : ''; };
|
|
88
|
+
async function tbReadSrc() {
|
|
89
|
+
const r = await pmGet('/api/sources' + wsQ());
|
|
90
|
+
TB.src = r && r.ok && Array.isArray(r.sources) ? r : { ok: false, sources: [] };
|
|
91
|
+
tbDot();
|
|
92
|
+
return TB.src;
|
|
93
|
+
}
|
|
94
|
+
function tbDot() {
|
|
95
|
+
const d = $('#srcDot'), c = $('#srcChip'); if (!d || !c) return;
|
|
96
|
+
const behind = TB.src && TB.src.ok ? behindOf(lineItems(TB.src.sources)) : [];
|
|
97
|
+
const n = behind.length + TB.gaps, known = TB.src && TB.src.ok;
|
|
98
|
+
d.className = 'sdot ' + (n || (TB.src && !TB.src.ok) ? 'warn' : known ? 'ok' : '');
|
|
99
|
+
c.title = TB.src && !TB.src.ok ? 'The sources could not be read' : n ? [behind.length ? behind.map((b) => b.text).join(', ') : '', TB.gaps ? TB.gaps + (TB.gaps === 1 ? ' source this page could not read' : ' sources this page could not read') : ''].filter(Boolean).join(' · ') : known ? 'Every source was read recently' : 'Reading the sources';
|
|
100
|
+
}
|
|
101
|
+
/** n: how many sources the page itself could not read (its header's missing list). */
|
|
102
|
+
export function setPageGaps(n) { TB.gaps = n || 0; tbDot(); }
|
|
103
|
+
/** h: { html() → the page's own part of Sources, mount() after it is drawn, refresh() → what Refresh all also reads again }. */
|
|
104
|
+
export function sourcesHook(h) { TB.extra = h; }
|
|
105
|
+
function park() { $$('#oMain [data-park]').forEach((x) => { const p = document.getElementById(x.dataset.park); if (p) p.appendChild(x); }); }
|
|
106
|
+
const srcRow = (s) => {
|
|
107
|
+
const cls = s.state === 'fresh' ? 'ok' : s.state === 'stale' || s.state === 'failed' || s.state === 'never' ? 'warn' : '';
|
|
108
|
+
const when = s.id === 'repository' && s.state === 'fresh' ? 'watched for changes' : s.as_of ? 'read ' + whenRead(s.as_of) : 'never read';
|
|
109
|
+
const off = s.state === 'off' || s.state === 'building' || TB.busy;
|
|
110
|
+
return `<div class="sr"><span class="sn"><b><i class="sdot ${cls}" aria-hidden="true"></i>${esc(s.label)}</b><em>${esc(SSTATE[s.state] || s.state)}${s.as_of || s.id === 'repository' && s.state === 'fresh' ? ' · ' + esc(when) : ''}</em></span>${s.id === 'repository' ? '' : `<button type="button" class="cta alt" data-sref="${esc(s.id)}" aria-label="Refresh ${esc(s.label)}"${off ? ' disabled' : ''}>Refresh</button>`}</div>`;
|
|
111
|
+
};
|
|
112
|
+
let SPOLL = null;
|
|
113
|
+
export async function openSources() {
|
|
114
|
+
// the frame is drawn once; a re-read redraws only the rows, the button and the message, so the page's own part (the Briefing's picker) is left alone
|
|
115
|
+
const rowsHtml = () => { const s = TB.src; return !s ? '<p class="note">Reading the sources.</p>' : !s.ok ? '<p class="note err" role="alert">The sources could not be read.</p>' : s.sources.map(srcRow).join(''); };
|
|
116
|
+
const draw = () => {
|
|
117
|
+
if ($('#srcRows')) { $('#srcRows').innerHTML = rowsHtml(); $('#srcAll').disabled = TB.busy; $('#srcM').textContent = TB.msg; return; }
|
|
118
|
+
park();
|
|
119
|
+
$('#oMain').innerHTML = `<article class="paper doc"><div class="addf">
|
|
120
|
+
<div class="srctop"><p class="note" style="margin:0">Each source is read on its own schedule, not live. Each row says when it was last read.</p><button type="button" class="cta" id="srcAll"${TB.busy ? ' disabled' : ''}>Refresh all</button></div>
|
|
121
|
+
<div>${TB.extra ? '<span class="label">Sources</span>' : ''}<div id="srcRows">${rowsHtml()}</div></div>
|
|
122
|
+
${TB.extra ? TB.extra.html() : ''}
|
|
123
|
+
<p class="note" id="srcM" role="status" style="margin:0;min-height:1.2em">${esc(TB.msg)}</p></div></article>`;
|
|
124
|
+
if (TB.extra && TB.extra.mount) TB.extra.mount();
|
|
125
|
+
};
|
|
126
|
+
const say = 'When each source was last read. Each one is read on its own schedule, so the rows say their own times.';
|
|
127
|
+
TB.msg = '';
|
|
128
|
+
openDlg({ eye: 'Sources', title: 'Sources', say, stream: turnA(ptx(say)), noteKey: null, pane: '<article class="paper doc"></article>', label: 'Sources' });
|
|
129
|
+
$('#askF').hidden = true; setMode('detail');
|
|
130
|
+
const poll = (n) => { clearTimeout(SPOLL); if (!n || !TB.src || !TB.src.ok || !TB.src.sources.some((x) => x.state === 'building')) return; SPOLL = setTimeout(async () => { if ($('#dTitle').textContent !== 'Sources' || !$('#dlg').classList.contains('on')) return; await tbReadSrc(); draw(); poll(n - 1); }, 3000); };
|
|
131
|
+
$('#oMain').onclick = async (e) => {
|
|
132
|
+
const one = e.target.closest('[data-sref]'), all = e.target.closest('#srcAll');
|
|
133
|
+
if ((!one && !all) || TB.busy || !TB.src || !TB.src.ok) return;
|
|
134
|
+
const ids = all ? refreshTargets(TB.src.sources) : [one.dataset.sref];
|
|
135
|
+
TB.busy = true; TB.msg = 'Starting.'; draw();
|
|
136
|
+
const got = await Promise.all(ids.map((id) => pmPost('/api/sources/refresh', { ws: TB.src.ws || '', source: id }).catch(() => null)));
|
|
137
|
+
let extra = null; if (all && TB.extra && TB.extra.refresh) extra = await TB.extra.refresh();
|
|
138
|
+
const bad = got.filter((r) => !r || !r.ok).length;
|
|
139
|
+
TB.busy = false;
|
|
140
|
+
TB.msg = (ids.length ? (bad ? bad + ' of ' + ids.length + ' did not start.' : ids.length === 1 ? 'Reading it again.' : 'Reading ' + ids.length + ' sources again.') : '') + (extra ? ' ' + extra : '');
|
|
141
|
+
await tbReadSrc(); draw(); poll(8);
|
|
142
|
+
};
|
|
143
|
+
draw();
|
|
144
|
+
await tbReadSrc(); draw(); poll(8);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* ── Chat on the Briefing and My work: the standard dialog, read-only, about the page as a whole (key src:this-page or work:this-page) ── */
|
|
148
|
+
export function openPageChat(key, page) {
|
|
149
|
+
const lead = (($('#brief') && $('#brief').textContent) || '').replace(/\s+/g, ' ').trim();
|
|
150
|
+
const say = 'Ask anything about this page. The agent reads the records the page shows and answers in words. It cannot change anything.';
|
|
151
|
+
openDlg({ eye: page, title: 'Ask about ' + page, say, stream: turnA(ptx(say)), noteKey: key, pane: `<article class="paper doc"><h3 class="d2">What the page says</h3><p>${esc(lead || 'The page has not read its records yet.')}</p></article>`, label: page });
|
|
152
|
+
$('#askIn').placeholder = 'Ask the agent about this page';
|
|
153
|
+
loadThread(key);
|
|
154
|
+
}
|
|
155
|
+
tbMount(); // the top bar first: the menu holds the Settings, Agent sessions, Console and Search items the code below wires
|
|
156
|
+
{ const t2 = $('#theme2'); if (t2) t2.onclick = flip; }
|
|
24
157
|
{ const b = $('#settingsBtn'); if (b) b.onclick = () => openSettings(); } // hoisted: the function below is declared, not assigned
|
|
25
158
|
|
|
26
159
|
/* ── toast ──────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
@@ -32,6 +165,7 @@ export const kv = (rows) => `<div class="kv2">${rows.filter((r) => r && r[1]).ma
|
|
|
32
165
|
export const H = (t) => `<h3 class="h2">${esc(t)}</h3>`;
|
|
33
166
|
export function openDlg(o) {
|
|
34
167
|
S.key = o.noteKey || null;
|
|
168
|
+
park(); // a page's own control lent to the dialog (the Briefing's product picker) goes home before the pane is replaced
|
|
35
169
|
const ae = document.activeElement; if (ae && ae !== document.body) lastFocus = ae;
|
|
36
170
|
$$('.rail,main.stage,#dock').forEach((x) => { x.inert = true; });
|
|
37
171
|
$('#dlg').inert = false; document.documentElement.style.overflow = 'hidden';
|
|
@@ -45,6 +179,7 @@ export function openDlg(o) {
|
|
|
45
179
|
}
|
|
46
180
|
export function closeDlg() {
|
|
47
181
|
clearTimeout(threadTimer); S.key = null;
|
|
182
|
+
park();
|
|
48
183
|
$('#veil').classList.remove('on'); $$('.rail,main.stage,#dock').forEach((x) => { x.inert = false; });
|
|
49
184
|
$('#dlg').inert = true; document.documentElement.style.overflow = ''; $('#dlg').classList.remove('on');
|
|
50
185
|
$('#dock').inert = !document.body.classList.contains('docked');
|
|
@@ -188,10 +323,15 @@ export function wireRail(here) {
|
|
|
188
323
|
$$('.rail [data-go]').forEach((b) => { b.onclick = () => { if (b.dataset.go !== here) location.assign(GO[b.dataset.go]); }; });
|
|
189
324
|
}
|
|
190
325
|
|
|
191
|
-
/* ── the crumb: where you are, a menu to switch board or initiative, and
|
|
326
|
+
/* ── the crumb: where you are, a menu to switch board or initiative, and Chat, which opens the read-only agent ──────────────────── */
|
|
192
327
|
export function crumbHtml(o) {
|
|
193
328
|
const chev = (id, label, show) => `<button id="${id}" class="cri" aria-haspopup="menu" aria-expanded="false" aria-label="${esc(label)}"${show ? '' : ' hidden'}>${CHEV}</button>`;
|
|
194
|
-
|
|
329
|
+
const menu = '<div id="crMenu" class="crmenu" role="menu" hidden></div>';
|
|
330
|
+
// an initiative: a round back button to its board, then one pill with its name and the switcher; a board page: the page, the board and its switcher
|
|
331
|
+
const left = o.ini
|
|
332
|
+
? `<button id="crBoard" class="glass round crback" aria-label="Back to ${esc(o.board)}" title="Back to ${esc(o.board)}"><svg class="i" viewBox="0 0 24 24"><path d="m14 6-6 6 6 6"/></svg></button><nav class="crumb" aria-label="Where you are"><span id="crIni" aria-current="page">${esc(o.ini)}</span>${chev('crSw2', 'Switch initiative', o.siblings && o.siblings.length > 1)}${menu}</nav>`
|
|
333
|
+
: `<nav class="crumb" aria-label="Where you are">${o.page ? `<span class="crpg">${esc(o.page)}</span>` : ''}<button id="crBoard" aria-current="page" disabled>${esc(o.board)}</button>${chev('crSw', 'Switch board', o.boards && o.boards.length > 1)}${menu}</nav>`;
|
|
334
|
+
return `<div class="where">${left}<button id="crAsk" class="round tbchat" aria-haspopup="dialog" aria-label="${esc(o.ask)}" title="${esc(o.ask)}">${CHAT}</button></div>`;
|
|
195
335
|
}
|
|
196
336
|
/** o: { boards: [{ws,id,name}], board: id, siblings: [{id,title}], ini: id, goBoard(ws, id), goIni(id), ask() }. Escape and a click outside close the menu; the arrows move in it. */
|
|
197
337
|
export function wireCrumb(o) {
|
|
@@ -262,8 +402,8 @@ const pvQ = (sep) => (PV_WS ? sep + 'ws=' + encodeURIComponent(PV_WS) : '');
|
|
|
262
402
|
async function pvGet(u) { try { const r = await fetch(u, { credentials: 'same-origin' }); return { status: r.status, j: await r.json() }; } catch { return { status: 0, j: null }; } }
|
|
263
403
|
const pvOv = { kind: null, back: null, at: 0, list: [], pal: null, need: null };
|
|
264
404
|
function pvMount() {
|
|
265
|
-
const a = $('#
|
|
266
|
-
a.insertAdjacentHTML('beforebegin', `<button class="glass round
|
|
405
|
+
const a = $('#tbMore'); if (!a || $('#pvBell')) return;
|
|
406
|
+
a.insertAdjacentHTML('beforebegin', `<button class="glass round pv-hp" id="pvBell" aria-haspopup="dialog" aria-label="Needs you" title="Needs you">${BELL}<span class="pv-bdg" id="pvBdg" hidden></span></button>`);
|
|
267
407
|
document.body.insertAdjacentHTML('beforeend', '<div class="pv-scrim" id="pvScrim"></div><div class="pv-ov" id="pvOv" role="dialog" aria-modal="true" hidden inert></div>');
|
|
268
408
|
$('#pvSearch').onclick = () => pvOpen('pal'); $('#pvBell').onclick = () => pvOpen('bell'); $('#pvScrim').onclick = pvClose;
|
|
269
409
|
pvNeeds();
|
|
@@ -277,7 +417,7 @@ export function pvClose() {
|
|
|
277
417
|
function pvOpen(kind) {
|
|
278
418
|
if (pvOv.kind === kind) { pvClose(); return; }
|
|
279
419
|
if (pvOv.kind) pvClose();
|
|
280
|
-
const ae = document.activeElement; pvOv.back = ae && ae !== document.body ? ae : $(kind === 'pal' ? '#
|
|
420
|
+
const ae = document.activeElement; pvOv.back = ae && ae !== document.body ? ae : $(kind === 'pal' ? '#moreBtn' : '#pvBell');
|
|
281
421
|
pvOv.kind = kind; pvOv.at = 0;
|
|
282
422
|
$$('.rail,main.stage,#dock').forEach((x) => { x.inert = true; }); document.documentElement.style.overflow = 'hidden';
|
|
283
423
|
const o = $('#pvOv'); o.className = 'pv-ov ' + kind; o.setAttribute('aria-label', kind === 'pal' ? 'Search' : 'Needs you'); o.hidden = false; o.inert = false; $('#pvScrim').classList.add('on');
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { pmPost, pmGet } from './http.js';
|
|
7
7
|
import { weekView, stripHtml, foldLine, mountFold } from './premium-meeting.js';
|
|
8
8
|
import { mdRender } from './markdown.js';
|
|
9
|
-
import { $, $$, esc, openDlg, closeDlg, setMode, toast, loadThread, onScroll, wireRail, logHtml, turnA, turnU, ptx, CHECK, RM, S } from './premium-shell.js';
|
|
9
|
+
import { $, $$, esc, openDlg, closeDlg, setMode, toast, loadThread, onScroll, wireRail, logHtml, turnA, turnU, ptx, CHECK, RM, S, setPageGaps, onPageChat, openPageChat } from './premium-shell.js';
|
|
10
10
|
|
|
11
11
|
let M = null; // the model
|
|
12
12
|
let openR = null; // the row whose dialog is open
|
|
@@ -35,6 +35,7 @@ function drawHero() {
|
|
|
35
35
|
$('#date').textContent = M.date;
|
|
36
36
|
$('#brief').innerHTML = M.hero.map((s) => s.parts.map((p) => (p.s ? `<span class="k">${esc(p.t)}</span>` : esc(p.t))).join('')).join(' ');
|
|
37
37
|
$('#snap').textContent = M.header.text;
|
|
38
|
+
setPageGaps(((M.header && M.header.missing) || []).length);
|
|
38
39
|
$('#snap').title = 'Every figure on this page comes from an item on your list. A date shows only when one was set.';
|
|
39
40
|
}
|
|
40
41
|
function drawDock() { $('#dN').textContent = M.dock.needs; $('#dLab').textContent = M.dock.needs === 0 ? 'to clear' : M.dock.label; $('#dNext').innerHTML = M.dock.next ? `<i></i>Next <b>${esc(M.dock.next)}</b>` : 'Nothing more on your list'; }
|
|
@@ -658,5 +659,6 @@ async function load() {
|
|
|
658
659
|
if (mine && dlgKind === 'item') refreshOpen(); else if (mine) drawFocusDlg();
|
|
659
660
|
}
|
|
660
661
|
setInterval(() => { if (M && M.agents && M.agents.counts.running > 0 && !document.hidden) load(); }, 15000); // an agent's state changes without a press
|
|
662
|
+
onPageChat(() => openPageChat('work:this-page', 'My work')); // Chat in the top bar: the page as a whole (initiative premium-topbar)
|
|
661
663
|
$('#brief').textContent = 'Reading your list.';
|
|
662
664
|
load();
|
|
@@ -1531,8 +1531,7 @@ button.dsn:hover{box-shadow:inset 0 0 0 1.5px rgb(79,109,245)}
|
|
|
1531
1531
|
.rsm .mchip{font-size:1.8cqw;margin:1.2cqw 0 1.6cqw;display:inline-block}
|
|
1532
1532
|
.nrep .mhint{margin-bottom:10px}
|
|
1533
1533
|
.rsg .mt1{margin:0;padding:0;background:none;box-shadow:none}
|
|
1534
|
-
/* initiative page:
|
|
1535
|
-
.top:has(#iH1) .tools-top{flex-basis:100%;justify-content:flex-start}
|
|
1534
|
+
/* initiative page: long file names in the check evidence wrap */
|
|
1536
1535
|
#cIniChk .ckr small{overflow-wrap:anywhere}
|
|
1537
1536
|
|
|
1538
1537
|
/* search and the bell in the header (initiative premium-search-bell); the look is the mockup's overlays ov-pal and ov-bell */
|
|
@@ -2021,3 +2020,49 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
2021
2020
|
.wkdue span{font:600 var(--fs-2) var(--mono);letter-spacing:.06em;text-transform:uppercase;color:var(--ember-ink)}.wkdue b{font-weight:500}
|
|
2022
2021
|
.tl.wkday{min-height:0}.tl.wkday .ev{cursor:default}
|
|
2023
2022
|
#todayCard.wkm .foldb{margin-left:auto}
|
|
2023
|
+
|
|
2024
|
+
/* one top bar on every premium page (initiative premium-topbar): left = where you are + Chat; right = Sources chip, bell, one ⋯ menu */
|
|
2025
|
+
.top{flex-wrap:nowrap}
|
|
2026
|
+
.where{display:flex;align-items:center;gap:10px;min-width:0}
|
|
2027
|
+
.where .crumb{max-width:none;min-width:0}
|
|
2028
|
+
.tbchat{flex:none;background:var(--solid);color:var(--on-solid);border:0;box-shadow:0 10px 30px -10px rgba(20,22,31,.45)}
|
|
2029
|
+
.tbchat svg{width:19px;height:19px}
|
|
2030
|
+
#crBoard.crback{flex:none;width:44px;height:44px;padding:0;border-radius:50%;display:grid;place-items:center;background:var(--card);border:1px solid var(--hair);color:var(--ink);cursor:pointer}
|
|
2031
|
+
#crBoard.crback:hover{text-decoration:none;background:var(--well)}
|
|
2032
|
+
#crBoard.crback svg{width:20px;height:20px}
|
|
2033
|
+
.crumb .crpg{color:var(--ink);font-weight:600;padding:0 4px 0 12px}
|
|
2034
|
+
.top .tools-top{flex-wrap:nowrap;justify-content:flex-end;flex:none}
|
|
2035
|
+
.schip{height:44px;display:inline-flex;align-items:center;gap:8px;padding:0 14px;border-radius:999px;background:var(--card);border:1px solid var(--hair);font:500 var(--t-micro) var(--mono);color:var(--ink-2);flex:none}
|
|
2036
|
+
.schip:hover{background:var(--well)}
|
|
2037
|
+
.sdot{width:8px;height:8px;border-radius:50%;background:var(--ink-3);flex:none;display:inline-block}
|
|
2038
|
+
.sdot.ok{background:var(--ok)}
|
|
2039
|
+
.sdot.warn{background:var(--ember)}
|
|
2040
|
+
.sr .sn b{display:inline-flex;align-items:center;gap:8px}
|
|
2041
|
+
.srctop{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
|
|
2042
|
+
.mwrap{position:relative;display:inline-flex}
|
|
2043
|
+
.mdot{position:absolute;top:2px;right:2px;width:10px;height:10px;border-radius:50%;background:var(--ember);border:2px solid var(--card-solid)}
|
|
2044
|
+
.mdot[hidden]{display:none}
|
|
2045
|
+
.crmenu.tbmenu{left:auto;right:0;min-width:300px;z-index:45}
|
|
2046
|
+
.crmenu.tbmenu > button,.crmenu.tbmenu > a{height:44px}
|
|
2047
|
+
.crmenu .seg button{width:auto;height:38px;padding:0 12px;font-size:var(--fs-2);font-weight:600}
|
|
2048
|
+
.tbrow > span:first-child{white-space:nowrap}
|
|
2049
|
+
.crmenu a{display:flex;align-items:center;height:42px;padding:0 14px;border-radius:14px;font-weight:500;font-size:var(--fs-3);color:inherit;text-decoration:none}
|
|
2050
|
+
.crmenu a:hover,.crmenu a:focus-visible{background:var(--well)}
|
|
2051
|
+
.tbrow{display:flex;align-items:center;gap:10px;min-height:44px;padding:0 6px 0 14px;font-weight:500;font-size:var(--fs-3);border-top:1px solid var(--hair);margin-top:4px}
|
|
2052
|
+
.tbrow[hidden]{display:none}
|
|
2053
|
+
.tbrow + .tbrow{border-top:0;margin-top:0}
|
|
2054
|
+
.tbrow > .seg,.tbseg{margin-left:auto}
|
|
2055
|
+
.tbseg{display:inline-flex;padding:3px;border-radius:999px;background:var(--well);gap:2px}
|
|
2056
|
+
.crmenu .tbseg button{height:38px;width:auto;padding:0 11px;border-radius:999px;font-size:var(--fs-2);font-weight:600;color:var(--ink-2)}
|
|
2057
|
+
.crmenu .tbseg button[aria-checked="true"]{background:var(--solid);color:var(--on-solid)}
|
|
2058
|
+
.tbrow + #settingsBtn{border-top:1px solid var(--hair);border-radius:0 0 14px 14px;margin-top:4px}
|
|
2059
|
+
.crmenu .tbm-src{display:none}
|
|
2060
|
+
#oMain .pkw .pkmenu{left:0;right:auto}
|
|
2061
|
+
#oMain .pkmenu button{height:44px;min-height:44px;box-sizing:border-box}
|
|
2062
|
+
@media (max-width:700px){
|
|
2063
|
+
#srcChip{display:none}
|
|
2064
|
+
.crmenu .tbm-src{display:flex}
|
|
2065
|
+
.where .crumb:has(.crpg) #crBoard{display:none}
|
|
2066
|
+
.where #crIni{max-width:calc(100vw - 316px)}
|
|
2067
|
+
.top .tools-top{gap:8px}
|
|
2068
|
+
}
|
|
@@ -9,7 +9,7 @@ import { mountFirst } from './premium-first.js';
|
|
|
9
9
|
import { lineItems, behindOf, refreshTargets, whenRead } from './freshness-words.js';
|
|
10
10
|
import { consoleReads, briefOf, needsListOf } from './premium-brief.js';
|
|
11
11
|
import { momentOf, inText } from './c3-phone-model.js';
|
|
12
|
-
import { $, $$, esc, store, THEME_KEY, RM, AI, S, theme, toast, kv, H, openDlg, closeDlg, setTab, setMode, CHECK, CHEV, ptx, turnA, turnU, H1, H2, P1, UL, logHtml, loadThread, onScroll, wireRail, pvFeed } from './premium-shell.js';
|
|
12
|
+
import { $, $$, esc, store, THEME_KEY, RM, AI, S, theme, toast, kv, H, openDlg, closeDlg, setTab, setMode, CHECK, CHEV, ptx, turnA, turnU, H1, H2, P1, UL, logHtml, loadThread, onScroll, wireRail, pvFeed, setPageGaps, sourcesHook, onPageChat, openPageChat } from './premium-shell.js';
|
|
13
13
|
const ICON = {
|
|
14
14
|
meeting: '<rect x="4" y="5" width="16" height="15" rx="3"/><path d="M4 10h16M9 3v4M15 3v4"/>',
|
|
15
15
|
merge: '<circle cx="6" cy="6" r="2"/><circle cx="6" cy="18" r="2"/><circle cx="18" cy="9" r="2"/><path d="M6 8v8M18 11c0 4-6 3-12 5"/>',
|
|
@@ -60,6 +60,7 @@ function drawHero() {
|
|
|
60
60
|
if (shownBrief == null) $('#brief').innerHTML = M.hero.map((s) => s.parts.map((p) => (p.s ? `<span class="k">${esc(p.t)}</span>` : esc(p.t))).join('')).join(' ');
|
|
61
61
|
drawConsoleBrief();
|
|
62
62
|
$('#snap').textContent = M.header.text;
|
|
63
|
+
setPageGaps(M.header.sources ? M.header.sources.filter((x) => x.state === 'not-read').length : (M.header.missing || []).length);
|
|
63
64
|
$('#snap').title = M.header.missing.length ? 'A source that cannot be read adds nothing. It is named here, and the page does not guess.' : 'Every figure on this page comes from a record in the repository.';
|
|
64
65
|
}
|
|
65
66
|
|
|
@@ -947,34 +948,26 @@ async function load() {
|
|
|
947
948
|
else if (r.pending) setTimeout(load, 3000);
|
|
948
949
|
else if (r.refreshing) setTimeout(load, 10000);
|
|
949
950
|
}
|
|
950
|
-
/* ──
|
|
951
|
-
|
|
951
|
+
/* ── the Briefing's part of Sources (initiative premium-topbar): the products it reads, what it could not read and why, and Refresh all
|
|
952
|
+
* also reads the included repositories again. The product picker is the header's own control, lent to the dialog while it is open. ── */
|
|
953
|
+
const RDST = { read: ['ok', 'Read'], 'not-read': ['warn', 'Not read'], 'not-included': ['', 'Not included'], off: ['', 'Off'] };
|
|
952
954
|
function sourcesHtml() {
|
|
953
955
|
const L = (M && M.header && M.header.sources) || [];
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
return `<div
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
}
|
|
960
|
-
async function pressRefresh(btn) {
|
|
961
|
-
if (btn.disabled) return;
|
|
962
|
-
btn.disabled = true; btn.textContent = 'Refreshing';
|
|
956
|
+
const rows = !L.length ? '<p class="note">The Briefing has not read anything yet.</p>'
|
|
957
|
+
: L.map((x) => { const [c, w] = RDST[x.state] || ['', x.state]; return `<div class="sr"><span class="sn"><b><i class="sdot ${c}" aria-hidden="true"></i>${esc(x.name)}</b><em>${esc(w)}${x.reason ? ' · ' + esc(x.reason) : ''}</em></span></div>`; }).join('');
|
|
958
|
+
return `<div id="pkSlot"></div><div><span class="label">What the Briefing read</span>${rows}</div>`;
|
|
959
|
+
}
|
|
960
|
+
async function refreshRepos() {
|
|
963
961
|
const ws = new URLSearchParams(location.search).get('ws');
|
|
964
962
|
const r = await pmPost('/api/briefing-premium/refresh' + (ws ? '?ws=' + encodeURIComponent(ws) : ''), {});
|
|
965
|
-
if (!r || !r.ok)
|
|
966
|
-
|
|
967
|
-
|
|
963
|
+
if (!r || !r.ok) return 'The repositories were not read again: ' + ((r && r.error) || 'the server did not answer') + '.';
|
|
964
|
+
clearTimeout(RTIMER); RTIMER = setTimeout(load, 4000);
|
|
965
|
+
return r.started && r.started.length ? 'Reading again: ' + r.started.join(', ') + '.' : r.already && r.already.length ? 'Already reading ' + r.already.join(', ') + '.' : 'No repository is included.';
|
|
968
966
|
}
|
|
969
967
|
let RTIMER = null;
|
|
970
|
-
(
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
w.innerHTML = '<button type="button" class="fchip" id="rdRefresh" title="Read the included repositories again now">Refresh</button><button type="button" class="fchip" id="rdSources" aria-haspopup="dialog" title="Which source was read, which was not, and why">Sources</button>';
|
|
974
|
-
snap.insertAdjacentElement('afterend', w);
|
|
975
|
-
$('#rdRefresh').addEventListener('click', (e) => pressRefresh(e.currentTarget));
|
|
976
|
-
$('#rdSources').addEventListener('click', () => bdDlg('rd', 'Sources · real data', 'What the Briefing read', 'Which source was read, which was not, and why', M ? 'Each source below says whether it was read and, when it was not, the reason.' : 'The Briefing has not read anything yet.', sourcesHtml, () => {}));
|
|
977
|
-
})();
|
|
968
|
+
$('#pkw').dataset.park = 'pkPark';
|
|
969
|
+
sourcesHook({ html: sourcesHtml, mount: () => { const slot = $('#pkSlot'), w = $('#pkw'); if (slot && w) slot.appendChild(w); }, refresh: refreshRepos });
|
|
970
|
+
onPageChat(() => openPageChat('src:this-page', 'the Briefing'));
|
|
978
971
|
$('#brief').textContent = 'Reading the repository.';
|
|
979
972
|
load();
|
|
980
973
|
mountFirst(); // the "Your first Briefing" card, only when the page was opened with first=<import id> (initiative premium-welcome)
|
|
@@ -33,12 +33,8 @@
|
|
|
33
33
|
<main class="stage" id="stage">
|
|
34
34
|
<header class="top rise" style="--d:0">
|
|
35
35
|
<h1 class="vh">Board</h1><div id="crumbHost"></div>
|
|
36
|
-
<div class="tools tools-top"><span class="
|
|
37
|
-
<span class="seg modeseg" id="modeSeg" role="group" aria-label="How an initiative opens"><i class="pill"></i><button data-m="page" aria-pressed="true">Page</button><button data-m="popup" aria-pressed="false">Popup</button></span>
|
|
38
|
-
<a class="glass round" id="toConsole" href="/console.html" aria-label="Open the console" title="Open the console"><svg class="i" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="3"/><path d="m7 9 3 3-3 3M13 15h4"/></svg></a>
|
|
39
|
-
<button class="glass round sbtn" id="sessBtn" aria-haspopup="dialog" aria-label="Agent sessions" title="Agent sessions"><svg class="i" viewBox="0 0 24 24"><path d="M4 6h16M4 12h10M4 18h6"/><circle cx="18" cy="16" r="3"/></svg><span class="sbdg" id="sessBdg" aria-hidden="true" hidden></span></button>
|
|
40
|
-
<button class="glass round" id="settingsBtn" aria-label="Settings" title="Settings"><svg class="i" viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6 7 7M17 17l1.4 1.4M5.6 18.4 7 17M17 7l1.4-1.4"/></svg></button>
|
|
41
|
-
<button class="glass round" id="theme" aria-label="Switch light or dark"><svg class="i" viewBox="0 0 24 24"><path d="M20 14.5A8 8 0 0 1 9.5 4 8 8 0 1 0 20 14.5z"/></svg></button></div>
|
|
36
|
+
<div class="tools tools-top"><span class="vh" id="snap">Reading the board</span>
|
|
37
|
+
<span id="modePark" hidden><span class="seg modeseg" id="modeSeg" role="group" aria-label="How an initiative opens"><i class="pill"></i><button data-m="page" aria-pressed="true">Page</button><button data-m="popup" aria-pressed="false">Popup</button></span></span></div>
|
|
42
38
|
</header>
|
|
43
39
|
<section class="hero hero-slim"><p class="brief rise" style="--d:2" id="brief" aria-live="polite"></p></section>
|
|
44
40
|
<section class="card rise" style="--d:4" id="cMet" aria-labelledby="hMet" hidden>
|
|
@@ -33,11 +33,7 @@
|
|
|
33
33
|
<main class="stage" id="stage">
|
|
34
34
|
<header class="top rise" style="--d:0">
|
|
35
35
|
<h1 class="vh" id="iH1">Initiative</h1><div id="crumbHost"></div>
|
|
36
|
-
<div class="tools tools-top"><span class="
|
|
37
|
-
<a class="glass round" id="toConsole" href="/console.html" aria-label="Open the console" title="Open the console"><svg class="i" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="3"/><path d="m7 9 3 3-3 3M13 15h4"/></svg></a>
|
|
38
|
-
<button class="glass round sbtn" id="sessBtn" aria-haspopup="dialog" aria-label="Agent sessions" title="Agent sessions"><svg class="i" viewBox="0 0 24 24"><path d="M4 6h16M4 12h10M4 18h6"/><circle cx="18" cy="16" r="3"/></svg><span class="sbdg" id="sessBdg" aria-hidden="true" hidden></span></button>
|
|
39
|
-
<button class="glass round" id="settingsBtn" aria-label="Settings" title="Settings"><svg class="i" viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6 7 7M17 17l1.4 1.4M5.6 18.4 7 17M17 7l1.4-1.4"/></svg></button>
|
|
40
|
-
<button class="glass round" id="theme" aria-label="Switch light or dark"><svg class="i" viewBox="0 0 24 24"><path d="M20 14.5A8 8 0 0 1 9.5 4 8 8 0 1 0 20 14.5z"/></svg></button></div>
|
|
36
|
+
<div class="tools tools-top"><span class="vh" id="snap">Reading the initiative</span></div>
|
|
41
37
|
</header>
|
|
42
38
|
<section class="hero hero-slim"><p class="brief rise" style="--d:2" id="brief" aria-live="polite"></p></section>
|
|
43
39
|
<div id="iMain"><p class="empty3 plain" id="iRead">The initiative is read from its records. This page shows nothing until it has read, rather than guess.</p></div>
|
|
@@ -34,11 +34,7 @@
|
|
|
34
34
|
<main class="stage" id="stage">
|
|
35
35
|
<header class="top rise" style="--d:0">
|
|
36
36
|
<h1 class="vh">Insights</h1><div id="crumbHost"></div>
|
|
37
|
-
<div class="tools tools-top"><span class="
|
|
38
|
-
<a class="glass round" id="toConsole" href="/console.html" aria-label="Open the console" title="Open the console"><svg class="i" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="3"/><path d="m7 9 3 3-3 3M13 15h4"/></svg></a>
|
|
39
|
-
<button class="glass round sbtn" id="sessBtn" aria-haspopup="dialog" aria-label="Agent sessions" title="Agent sessions"><svg class="i" viewBox="0 0 24 24"><path d="M4 6h16M4 12h10M4 18h6"/><circle cx="18" cy="16" r="3"/></svg><span class="sbdg" id="sessBdg" aria-hidden="true" hidden></span></button>
|
|
40
|
-
<button class="glass round" id="settingsBtn" aria-label="Settings" title="Settings"><svg class="i" viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6 7 7M17 17l1.4 1.4M5.6 18.4 7 17M17 7l1.4-1.4"/></svg></button>
|
|
41
|
-
<button class="glass round" id="theme" aria-label="Switch light or dark"><svg class="i" viewBox="0 0 24 24"><path d="M20 14.5A8 8 0 0 1 9.5 4 8 8 0 1 0 20 14.5z"/></svg></button></div>
|
|
37
|
+
<div class="tools tools-top"><span class="vh" id="snap">Reading the records</span></div>
|
|
42
38
|
</header>
|
|
43
39
|
<section class="hero hero-slim"><p class="brief rise" style="--d:2" id="brief" aria-live="polite"></p></section>
|
|
44
40
|
<section class="card rise" style="--d:4" id="cBm" aria-labelledby="hBm" hidden>
|
|
@@ -32,12 +32,8 @@
|
|
|
32
32
|
<div class="toast glass" id="toast" role="status"></div>
|
|
33
33
|
<main class="stage" id="stage">
|
|
34
34
|
<header class="top rise" style="--d:0">
|
|
35
|
-
<h1 class="vh">My work</h1><span class="glass name" aria-hidden="true">My work</span>
|
|
36
|
-
<div class="tools tools-top"><span class="
|
|
37
|
-
<a class="glass round" id="toConsole" href="/console.html" aria-label="Open the console" title="Open the console"><svg class="i" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="3"/><path d="m7 9 3 3-3 3M13 15h4"/></svg></a>
|
|
38
|
-
<button class="glass round sbtn" id="sessBtn" aria-haspopup="dialog" aria-label="Agent sessions" title="Agent sessions"><svg class="i" viewBox="0 0 24 24"><path d="M4 6h16M4 12h10M4 18h6"/><circle cx="18" cy="16" r="3"/></svg><span class="sbdg" id="sessBdg" aria-hidden="true" hidden></span></button>
|
|
39
|
-
<button class="glass round" id="settingsBtn" aria-label="Settings" title="Settings"><svg class="i" viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6 7 7M17 17l1.4 1.4M5.6 18.4 7 17M17 7l1.4-1.4"/></svg></button>
|
|
40
|
-
<button class="glass round" id="theme" aria-label="Switch light or dark"><svg class="i" viewBox="0 0 24 24"><path d="M20 14.5A8 8 0 0 1 9.5 4 8 8 0 1 0 20 14.5z"/></svg></button></div>
|
|
35
|
+
<h1 class="vh">My work</h1><div class="where"><span class="glass name" aria-hidden="true">My work</span><button class="round tbchat" id="pgChat" aria-haspopup="dialog" aria-label="Ask about this page" title="Ask about this page"></button></div>
|
|
36
|
+
<div class="tools tools-top"><span class="vh" id="snap">Reading your list</span></div>
|
|
41
37
|
</header>
|
|
42
38
|
<section class="hero">
|
|
43
39
|
<p class="date rise" style="--d:1" id="date"></p>
|
|
@@ -42,13 +42,9 @@
|
|
|
42
42
|
<div class="toast glass" id="toast" role="status"></div>
|
|
43
43
|
<main class="stage" id="stage">
|
|
44
44
|
<header class="top rise" style="--d:0">
|
|
45
|
-
<h1 class="vh">Briefing</h1><span class="glass name" aria-hidden="true">Briefing</span>
|
|
46
|
-
<div class="tools tools-top"><span class="
|
|
47
|
-
<span class="pkw" id="pkw" hidden><button class="fchip" id="pick" aria-haspopup="menu" aria-expanded="false" aria-controls="pickMenu">Products<em id="pickN"></em></button><div class="crmenu pkmenu" id="pickMenu" role="menu" hidden></div></span>
|
|
48
|
-
<a class="glass round" id="toConsole" href="/console.html" aria-label="Open the console" title="Open the console"><svg class="i" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="3"/><path d="m7 9 3 3-3 3M13 15h4"/></svg></a>
|
|
49
|
-
<button class="glass round sbtn" id="sessBtn" aria-haspopup="dialog" aria-label="Agent sessions" title="Agent sessions"><svg class="i" viewBox="0 0 24 24"><path d="M4 6h16M4 12h10M4 18h6"/><circle cx="18" cy="16" r="3"/></svg><span class="sbdg" id="sessBdg" aria-hidden="true" hidden></span></button>
|
|
50
|
-
<button class="glass round" id="settingsBtn" aria-label="Settings" title="Settings"><svg class="i" viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6 7 7M17 17l1.4 1.4M5.6 18.4 7 17M17 7l1.4-1.4"/></svg></button>
|
|
51
|
-
<button class="glass round" id="theme" aria-label="Switch light or dark"><svg class="i" viewBox="0 0 24 24"><path d="M20 14.5A8 8 0 0 1 9.5 4 8 8 0 1 0 20 14.5z"/></svg></button></div>
|
|
45
|
+
<h1 class="vh">Briefing</h1><div class="where"><span class="glass name" aria-hidden="true">Briefing</span><button class="round tbchat" id="pgChat" aria-haspopup="dialog" aria-label="Ask about this page" title="Ask about this page"></button></div>
|
|
46
|
+
<div class="tools tools-top"><span class="vh" id="snap">Reading the repository</span>
|
|
47
|
+
<span id="pkPark" hidden><span class="pkw" id="pkw" hidden><button class="fchip" id="pick" aria-haspopup="menu" aria-expanded="false" aria-controls="pickMenu">Products<em id="pickN"></em></button><div class="crmenu pkmenu" id="pickMenu" role="menu" hidden></div></span></span></div>
|
|
52
48
|
</header>
|
|
53
49
|
<section class="hero">
|
|
54
50
|
<p class="date rise" style="--d:1" id="date"></p>
|