create-pmos 0.318.0 → 0.320.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-work-test.js +1 -9
- package/workspace/guide/briefing-premium.md +3 -3
- package/workspace/lib/my-work-premium.js +1 -24
- package/workspace/lib/routes-my-work-premium.js +1 -3
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-viewer-test.js +136 -0
- package/workspace/public/pm/premium-meeting.js +3 -3
- package/workspace/public/pm/premium-shell.js +2 -1
- package/workspace/public/pm/premium-viewer.js +97 -0
- package/workspace/public/pm/premium-work.js +2 -28
- package/workspace/public/pm/premium.css +19 -0
- package/workspace/public/premium-work.html +2 -8
- package/workspace/test-lists/premium-viewer.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.320.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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T15:07:56Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Health budgets"
|
|
4
4
|
description: "Closed registry of health-budget anchors (D59), edited only by the PM."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T15:07:56Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Discoveries and friction log"
|
|
4
4
|
description: "Append-only record of what runs discovered and where the process rubbed."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T15:07:56Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -72,15 +72,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
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
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
|
-
|
|
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; }));
|
|
77
|
-
ok('M13 My work shows the same Calendar card: five day buttons, a day list and a chevron, open at 1280 px', cal && cal.title === 'Calendar' && cal.pressed <= 1 && cal.list && cal.fold === 'true', JSON.stringify(cal));
|
|
78
|
-
const other = await p.evaluate(() => { const b = document.querySelector('#weekBody [data-day][aria-pressed="false"]'); b.click(); return b.dataset.day; });
|
|
79
|
-
ok('M13 pressing a day lists that day', await until(() => p.evaluate((d) => document.querySelector('#weekBody [data-day="' + d + '"]').getAttribute('aria-pressed') === 'true' && !!document.querySelector('#wkList .wkd'), other)));
|
|
80
|
-
await p.click('#weekCard .foldb');
|
|
81
|
-
ok('M13 the chevron hides the card to one line', await p.evaluate(() => document.querySelector('#weekCard').classList.contains('calhid') && getComputedStyle(document.querySelector('#wkList')).display === 'none' && !document.querySelector('#weekCard .folds').hidden));
|
|
82
|
-
await p.click('#weekCard .folds');
|
|
83
|
-
}
|
|
75
|
+
ok('M13 My work has no Calendar card: the Briefing holds the calendar (premium-calendar-card A1)', await p.evaluate(() => !document.querySelector('#weekCard') && ![...document.querySelectorAll('h2')].some((h) => /Calendar|This week/.test(h.textContent))));
|
|
84
76
|
ok('M1 the page is served at /premium-work and /premium-work.html', res === 200 && (await fetch(BASE + '/premium-work.html')).status === 200);
|
|
85
77
|
{
|
|
86
78
|
const r2 = await open(); await r2.page.locator('.rail [data-go="brief"]').click();
|
|
@@ -107,7 +107,7 @@ The pin on a row keeps it at the top for this session.
|
|
|
107
107
|
|
|
108
108
|
## Calendar
|
|
109
109
|
|
|
110
|
-
The Calendar card holds the week and the day. Its top row is a strip of Monday to Friday: each day shows its meeting time from the calendar PMOS holds, and blocks for items done and due that day from your list. Today is picked when the page opens. Press another day to list its meetings; press today to come back.
|
|
110
|
+
The Calendar card holds the week and the day. Its top row is a strip of Monday to Friday: each day shows its meeting time from the calendar PMOS holds, and blocks for items done and due that day from your list. Today is picked when the page opens. Press another day to list its meetings; press today to come back. My work has no calendar: this card is the one place it shows.
|
|
111
111
|
|
|
112
112
|
The chevron in the card header hides the card down to one line: the next meeting today (or "Nothing more today"), the week's meeting count and the items due. Press the line or the chevron to show the card again. The page remembers this in this browser. With nothing remembered, the card starts open on a computer and hidden on a phone.
|
|
113
113
|
|
|
@@ -166,6 +166,8 @@ When you scroll past the hero, the hero folds into a bar at the top. The bar sho
|
|
|
166
166
|
|
|
167
167
|
A row or a Today item opens a dialog with the same parts every time. At the top is a short log of what PMOS read, for example the kill-condition file and `pm-decisions.md`. Under it is one plain sentence. Then one card holds the evidence and, for a decision, the options. The record sits on the right: a draft `pm-decisions.md` entry for a decision, the initiative record for blocked work, the commit for a merge.
|
|
168
168
|
|
|
169
|
+
The right side can hold more than one item. When the dialog opens a related item there, such as a document, a meeting or a ticket, the item opens as a tab beside the dialog's own detail. The first tab is always the dialog's own detail. You can have up to four more tabs; a fifth closes the oldest. Click a tab or use the arrow keys to move between them. Use the **×** on a tab, or press Delete, to close it. The tabs close when the dialog closes. With no extra item, there are no tabs.
|
|
170
|
+
|
|
169
171
|
A decision opens with no option chosen, because no recommendation is on record. Choose one and the draft entry on the right changes. Nothing is written. The main button, "Not yet" and "Return this run to the agent" are off in this version, and each says why.
|
|
170
172
|
|
|
171
173
|
## The conversation
|
|
@@ -207,8 +209,6 @@ The Start button on a blocked row stays off. Starting an agent that writes needs
|
|
|
207
209
|
|
|
208
210
|
My work is the second place on the rail, at `/premium-work.html`. It reads the list the Work page reads, so the two pages show one list, and every press uses the Work page's own route. It adds no writer of its own.
|
|
209
211
|
|
|
210
|
-
**Calendar.** The same Calendar card as on the Briefing sits at the top of the right column. Its strip shows Monday to Friday. Each day has a grey bar for its meeting time, from your calendar, with black blocks for items done that day and orange hatched blocks for items due, from your list (at most three of each; they count items, not hours). A legend names the three. If PMOS cannot read the calendar, the card says so and draws no meeting bar. The mockup's hours done, hours free, warning line and Move to Friday need an estimate per item and working hours, which PMOS does not hold, so they are not drawn. It makes no "will not fit" note, because no item has a size and PMOS holds no working hours. Press a day to list its meetings below the strip; here the rows are for reading only. The chevron hides the card, as on the Briefing.
|
|
211
|
-
|
|
212
212
|
**Row suggestions and buttons.** A row shows a suggestion line only when a record backs it: an agent's offer on the item, a draft that is ready, or a date. A row has no button of its own. Press the row to open the item, where you review a draft, start the agent, or give the item a day. To act without opening it, swipe the row or press the right or left arrow key. A row in Today goes to Done (or opens its draft when one is ready) on the right and to Tomorrow on the left. Any other row goes to Today on the right and to Someday on the left. A row from Jira shows its Jira key.
|
|
213
213
|
|
|
214
214
|
**Weekly review.** A card lists five steps: sort the inbox, place what you added, check who owes you, review agent drafts, and look at what sat untouched. Each step shows a count from your list and opens its first item. **Start the review** opens the first step that has something. On a Friday the card reads Friday review. PMOS keeps no review schedule and no timing, so the card shows none. Answers, ideas and reports an agent files by itself are not shown, because PMOS holds no records for them.
|
|
@@ -93,28 +93,6 @@ function suggestOf(it, list, today, overdue) {
|
|
|
93
93
|
return { sug, cta };
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
/** This week, Monday to Friday, from three records: the meetings the calendar holds, the items marked done that day, and the open items with that due date.
|
|
97
|
-
* No effort, capacity or "won't fit" figure is made: no item carries a size and PMOS holds no working hours. */
|
|
98
|
-
function weekOf({ today, items, events }) {
|
|
99
|
-
const base = isoDay(today);
|
|
100
|
-
const dow = (base.getDay() + 6) % 7;
|
|
101
|
-
const iso = (d) => d.getFullYear() + '-' + pad(d.getMonth() + 1) + '-' + pad(d.getDate());
|
|
102
|
-
const days = [0, 1, 2, 3, 4].map((i) => { const d = new Date(base.getFullYear(), base.getMonth(), base.getDate() - dow + i); return { iso: iso(d), dow: WEEKDAYS[d.getDay()].slice(0, 3).toUpperCase(), n: d.getDate() }; });
|
|
103
|
-
const read = Array.isArray(events);
|
|
104
|
-
for (const d of days) {
|
|
105
|
-
const ev = read ? events.filter((e) => String(e.at || '').slice(0, 10) === d.iso) : [];
|
|
106
|
-
d.meetings = ev.length;
|
|
107
|
-
d.meet_min = ev.reduce((a, e) => { const m = Date.parse(e.end) - Date.parse(e.at); return a + (m > 0 && m < 86400000 ? Math.round(m / 60000) : 0); }, 0);
|
|
108
|
-
d.done = items.filter((it) => it.done && String(it.done_at || '').slice(0, 10) === d.iso).length;
|
|
109
|
-
d.due = items.filter((it) => !it.done && it.due === d.iso).length;
|
|
110
|
-
d.today = d.iso === today; d.past = d.iso < today;
|
|
111
|
-
}
|
|
112
|
-
const tot = (k) => days.reduce((a, d) => a + d[k], 0);
|
|
113
|
-
const bits = [read ? tot('meetings') + ' ' + plural(tot('meetings'), 'meeting', 'meetings') : null, tot('done') + ' done', tot('due') + ' due'].filter(Boolean);
|
|
114
|
-
return { title: 'This week', cap: bits.join(' · '), days, calendar: read,
|
|
115
|
-
note: (read ? 'The grey bar is meeting time from your calendar. ' : 'The calendar could not be read, so there is no meeting bar. ') + 'Each Done block is an item done that day and each Due block an item due, up to three of each; they count items, not hours. PMOS holds no estimate or working hours, so it does not say what will not fit.' };
|
|
116
|
-
}
|
|
117
|
-
|
|
118
96
|
/** The weekly review: a count and a first item for each place the PM sorts things. Every figure is a count of the list. No step time is made: PMOS does not time a review. */
|
|
119
97
|
function fridayOf({ today, work, tray, ready, review }) {
|
|
120
98
|
const first = (a) => (a[0] ? 'work:' + (a[0].it ? a[0].it.id : a[0].id) : null);
|
|
@@ -168,7 +146,7 @@ function rowOf(it, list, v, inReview, focusIds) {
|
|
|
168
146
|
};
|
|
169
147
|
}
|
|
170
148
|
|
|
171
|
-
function build({ v, now
|
|
149
|
+
function build({ v, now }) {
|
|
172
150
|
now = now || Date.now();
|
|
173
151
|
v = v || {};
|
|
174
152
|
const today = v.today || new Date(now).toISOString().slice(0, 10);
|
|
@@ -266,7 +244,6 @@ function build({ v, now, events }) {
|
|
|
266
244
|
dock: { needs: clear, label: 'to clear', next: firstToday ? firstToday.title : (sections[0].rows[0] ? sections[0].rows[0].title : null) },
|
|
267
245
|
queue,
|
|
268
246
|
friday: fridayOf({ today, work, tray, ready, review: v.review || [] }),
|
|
269
|
-
week: weekOf({ today, items: v.items || all.map((x) => x.it), events }),
|
|
270
247
|
focus, jobs,
|
|
271
248
|
rows: rowsAll,
|
|
272
249
|
};
|
|
@@ -23,10 +23,8 @@ module.exports = {
|
|
|
23
23
|
let v = null, err = null;
|
|
24
24
|
try { v = await listView(req, ctx); } catch (e) { err = String((e && e.message) || e).slice(0, 200); }
|
|
25
25
|
if (!v || v.ok === false) { ctx.json(res, { ok: false, state: 'error', error: err || (v && v.error) || 'the list could not be read' }, 500); return true; }
|
|
26
|
-
let events = null;
|
|
27
|
-
try { events = require('./calendar-events.js').readAll(ctx.runtimeDir, { now: Date.now() }); } catch { events = null; }
|
|
28
26
|
let model;
|
|
29
|
-
try { model = WP.build({ v, now: Date.now()
|
|
27
|
+
try { model = WP.build({ v, now: Date.now() }); } catch (e) { ctx.json(res, { ok: false, state: 'error', error: 'the page could not be built: ' + String((e && e.message) || e).slice(0, 160) }, 500); return true; }
|
|
30
28
|
ctx.json(res, { ok: true, state: 'ready', model, as_of: Date.now() });
|
|
31
29
|
return true;
|
|
32
30
|
},
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.320.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.320.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* premium-viewer-test.js — the premium dialog's right pane as a viewer with tabs (initiative premium-viewer, S1; planning/prd/premium-viewer-prd.md R1, R7).
|
|
4
|
+
* Serves the real Briefing page from the real server with the Briefing model answered by a stand-in, opens a row's dialog, then drives window.__premiumViewer.
|
|
5
|
+
* R1 tabs: open, switch, close, at most 4 extra, #oMain kept with its handlers, reset on the next dialog · R7 floors: 390px, 44px targets, dark theme
|
|
6
|
+
* Every wait polls the page; no fixed sleep stands in for a state. */
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const { spawn } = require('child_process');
|
|
9
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
10
|
+
const T = require('./test-run').configure({ name: 'premium-viewer' });
|
|
11
|
+
const B = require('./lib/briefing-premium.js');
|
|
12
|
+
const F = require('./fixtures/briefing-premium-facts.js');
|
|
13
|
+
|
|
14
|
+
const BASE = T.BASE;
|
|
15
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
16
|
+
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
17
|
+
const results = [];
|
|
18
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
19
|
+
let srv = null; let browser = null;
|
|
20
|
+
const finish = async (code) => {
|
|
21
|
+
if (browser) await browser.close().catch(() => {});
|
|
22
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
23
|
+
T.killTmux();
|
|
24
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
25
|
+
console.log(`\n${results.length - bad}/${results.length} premium-viewer assertions passed`);
|
|
26
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
27
|
+
};
|
|
28
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
29
|
+
|
|
30
|
+
(async () => {
|
|
31
|
+
const exe = findBrowser();
|
|
32
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
33
|
+
let chromium;
|
|
34
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
35
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
36
|
+
await T.waitForServer(BASE);
|
|
37
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
38
|
+
|
|
39
|
+
const open = async ({ w = 1280, h = 900, theme = 'light' } = {}) => {
|
|
40
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
41
|
+
const page = await ctx.newPage();
|
|
42
|
+
const S = { errors: [] };
|
|
43
|
+
page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
|
|
44
|
+
await page.route('**/api/briefing-premium*', (r) => r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: B.build(F.facts()), as_of: Date.now() }) }));
|
|
45
|
+
await page.goto(BASE + '/premium.html?theme=' + theme);
|
|
46
|
+
S.up = await until(() => page.evaluate(() => document.querySelectorAll('#rank .rr .rhd').length > 0 && !!window.__premiumViewer), 20000);
|
|
47
|
+
return { page, ctx, S };
|
|
48
|
+
};
|
|
49
|
+
/* opens the first row that opens a dialog on this page (a row with its own page would navigate away) */
|
|
50
|
+
const openDialog = async (page) => {
|
|
51
|
+
const n = await page.evaluate(() => document.querySelectorAll('#rank .rr .rhd').length);
|
|
52
|
+
for (let i = 0; i < n; i++) {
|
|
53
|
+
const url = page.url();
|
|
54
|
+
await page.evaluate((k) => document.querySelectorAll('#rank .rr .rhd')[k].click(), i);
|
|
55
|
+
if (await until(() => page.evaluate(() => document.querySelector('#dlg').classList.contains('on')), 3000)) return true;
|
|
56
|
+
if (page.url() !== url) { await page.goBack(); await until(() => page.evaluate(() => document.querySelectorAll('#rank .rr .rhd').length > 0 && !!window.__premiumViewer), 20000); }
|
|
57
|
+
}
|
|
58
|
+
return false;
|
|
59
|
+
};
|
|
60
|
+
const st = (page) => page.evaluate(() => {
|
|
61
|
+
const t = document.querySelector('#vTabs'), m = document.querySelector('#oMain'), lab = document.querySelector('#oLab');
|
|
62
|
+
const vis = (e) => !!e && !e.hidden && getComputedStyle(e).display !== 'none';
|
|
63
|
+
return { ...window.__premiumViewer.vwState(), strip: vis(t), lab: vis(lab), main: vis(m), tabs: t ? [...t.querySelectorAll('.vtab')].map((x) => x.dataset.vw) : [],
|
|
64
|
+
sel: t ? [...t.querySelectorAll('.vtab[aria-selected="true"]')].map((x) => x.dataset.vw) : [], panes: [...document.querySelectorAll('#dOut .obody.vw')].map((p) => [p.dataset.vw, vis(p)]) };
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
/* R1 desktop */
|
|
68
|
+
{
|
|
69
|
+
const { page, ctx, S } = await open();
|
|
70
|
+
ok('R1 the Briefing loads with the viewer module', S.up);
|
|
71
|
+
ok('R1 a row opens the dialog', await openDialog(page));
|
|
72
|
+
let s = await st(page);
|
|
73
|
+
ok('R1 with no extra tab the strip is hidden, #oLab shows, #oMain shows', !s.strip && s.lab && s.main && s.ids.length === 0, JSON.stringify(s));
|
|
74
|
+
/* a page's handler on #oMain, and a node inside it, must survive the tabs */
|
|
75
|
+
await page.evaluate(() => { const m = document.querySelector('#oMain'); window.__hits = 0; m.addEventListener('click', () => { window.__hits++; }); const p = document.createElement('p'); p.id = 'vwMark'; p.textContent = 'mark'; m.append(p); });
|
|
76
|
+
await page.evaluate(() => window.__premiumViewer.vwOpen({ id: 'a', title: 'Alpha doc', icon: 'doc', html: '<p id="paneA">Alpha</p>', wire: (el) => { el.querySelector('#paneA').dataset.wired = '1'; } }));
|
|
77
|
+
s = await st(page);
|
|
78
|
+
ok('R1 opening an item shows the strip with the main tab and the item, the item selected', s.strip && !s.lab && JSON.stringify(s.tabs) === '["main","a"]' && JSON.stringify(s.sel) === '["a"]' && !s.main, JSON.stringify(s));
|
|
79
|
+
ok('R1 the item fills its own pane and wire runs on it', await page.evaluate(() => document.querySelector('#paneA') && document.querySelector('#paneA').dataset.wired === '1'));
|
|
80
|
+
ok('R1 the main tab is labelled with the dialog\'s label and has no close button', await page.evaluate(() => { const t = document.querySelector('#vTabs .vtab[data-vw="main"]'); return t.textContent.trim() === document.querySelector('#oLab').textContent.trim() && !t.querySelector('.vx'); }));
|
|
81
|
+
await page.click('#vTabs .vtab[data-vw="main"]');
|
|
82
|
+
s = await st(page);
|
|
83
|
+
ok('R1 a click on the main tab shows #oMain and hides the item', s.main && s.on === 'main' && s.panes.every((p) => !p[1]), JSON.stringify(s));
|
|
84
|
+
ok('R1 #oMain was not re-rendered: the node inside it and its handler are still there', await page.evaluate(() => { document.querySelector('#vwMark').click(); return !!document.querySelector('#oMain #vwMark') && window.__hits === 1; }));
|
|
85
|
+
await page.evaluate(() => window.__premiumViewer.vwOpen({ id: 'a', title: 'Alpha doc', html: '<p id="paneA">Alpha 2</p>' }));
|
|
86
|
+
s = await st(page);
|
|
87
|
+
ok('R1 opening the same id again refills that tab and shows it, with no second tab', s.ids.length === 1 && s.on === 'a' && (await page.textContent('#paneA')) === 'Alpha 2', JSON.stringify(s));
|
|
88
|
+
for (const id of ['b', 'c', 'd', 'e']) await page.evaluate((x) => window.__premiumViewer.vwOpen({ id: x, title: 'Item ' + x, html: `<p>${x}</p>` }), id);
|
|
89
|
+
s = await st(page);
|
|
90
|
+
ok('R1 at most 4 extra tabs: the fifth closes the oldest', JSON.stringify(s.ids) === '["b","c","d","e"]' && s.on === 'e' && s.panes.length === 4, JSON.stringify(s));
|
|
91
|
+
await page.click('#vTabs .vtab[data-vw="e"] .vx');
|
|
92
|
+
s = await st(page);
|
|
93
|
+
ok('R1 closing the shown tab shows the one before it', JSON.stringify(s.ids) === '["b","c","d"]' && s.on === 'd', JSON.stringify(s));
|
|
94
|
+
await page.focus('#vTabs .vtab[data-vw="d"]');
|
|
95
|
+
await page.keyboard.press('ArrowLeft');
|
|
96
|
+
s = await st(page);
|
|
97
|
+
ok('R1 the arrow keys move between tabs', s.on === 'c' && (await page.evaluate(() => document.activeElement.dataset.vw)) === 'c', JSON.stringify(s));
|
|
98
|
+
await page.keyboard.press('Delete');
|
|
99
|
+
s = await st(page);
|
|
100
|
+
ok('R1 Delete closes the focused tab', JSON.stringify(s.ids) === '["b","d"]', JSON.stringify(s));
|
|
101
|
+
const yes = page.evaluate(() => window.__premiumViewer.vwConfirm(document.querySelector('#dOut .obody.vw:not([hidden])'), { text: 'Undo all 3 edits?', yes: 'Undo all' }));
|
|
102
|
+
await until(() => page.evaluate(() => !!document.querySelector('.vcf')));
|
|
103
|
+
ok('R1 vwConfirm draws a card with the question in the shown pane', (await page.textContent('.vcf p')) === 'Undo all 3 edits?');
|
|
104
|
+
await page.click('.vcf [data-a="1"]');
|
|
105
|
+
ok('R1 vwConfirm resolves true on the yes button and removes the card', (await yes) === true && !(await page.$('.vcf')));
|
|
106
|
+
await page.evaluate(() => window.__premiumViewer.vwStyle('none-such'));
|
|
107
|
+
ok('R1 vwStyle adds the view\'s stylesheet link once', await page.evaluate(() => { window.__premiumViewer.vwStyle('none-such'); window.__premiumViewer.vwStyle('../x'); return document.querySelectorAll('link[data-vw-css]').length === 1 && document.querySelector('link[data-vw-css]').getAttribute('href') === '/pm/premium-vw-none-such.css'; }));
|
|
108
|
+
await page.keyboard.press('Escape');
|
|
109
|
+
await until(() => page.evaluate(() => !document.querySelector('#dlg').classList.contains('on')), 3000);
|
|
110
|
+
await openDialog(page);
|
|
111
|
+
s = await st(page);
|
|
112
|
+
ok('R1 the next dialog starts with no extra tab', s.ids.length === 0 && !s.strip && s.main && s.panes.length === 0, JSON.stringify(s));
|
|
113
|
+
ok('R1 no page error', S.errors.length === 0, S.errors.join(' | '));
|
|
114
|
+
await ctx.close();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* R7 phone and dark theme */
|
|
118
|
+
{
|
|
119
|
+
const { page, ctx, S } = await open({ w: 390, h: 844, theme: 'dark' });
|
|
120
|
+
ok('R7 a row opens the dialog at 390px', await openDialog(page));
|
|
121
|
+
for (const id of ['a', 'b']) await page.evaluate((x) => window.__premiumViewer.vwOpen({ id: x, title: 'A long item title ' + x, html: `<p>${x}</p>` }), id);
|
|
122
|
+
const m = await page.evaluate(() => {
|
|
123
|
+
const r = (e) => e.getBoundingClientRect();
|
|
124
|
+
const tabs = [...document.querySelectorAll('#vTabs .vtab')], xs = [...document.querySelectorAll('#vTabs .vx')];
|
|
125
|
+
return { tabH: Math.min(...tabs.map((t) => r(t).height)), xH: Math.min(...xs.map((t) => r(t).height)), xW: Math.min(...xs.map((t) => r(t).width)),
|
|
126
|
+
over: document.documentElement.scrollWidth > window.innerWidth, stripW: r(document.querySelector('#vTabs')).right <= window.innerWidth + 1,
|
|
127
|
+
bg: getComputedStyle(document.querySelector('#vTabs .vtab[aria-selected="true"]')).backgroundColor };
|
|
128
|
+
});
|
|
129
|
+
ok('R7 tabs and close buttons are at least 44px at 390px', m.tabH >= 44 && m.xH >= 44 && m.xW >= 44, JSON.stringify(m));
|
|
130
|
+
ok('R7 the strip fits the width and the page does not scroll sideways', m.stripW && !m.over, JSON.stringify(m));
|
|
131
|
+
ok('R7 in the dark theme the selected tab is not a light card', (() => { const c = (m.bg.match(/\d+/g) || []).slice(0, 3).map(Number); return c.length === 3 && c[0] + c[1] + c[2] < 3 * 160; })(), m.bg);
|
|
132
|
+
ok('R7 no page error', S.errors.length === 0, S.errors.join(' | '));
|
|
133
|
+
await ctx.close();
|
|
134
|
+
}
|
|
135
|
+
finish();
|
|
136
|
+
})();
|
|
@@ -42,12 +42,12 @@ export function weekView(r, today) {
|
|
|
42
42
|
initiatives: (Array.isArray(r.gantt) ? r.gantt : []).filter((g) => g && g.id).slice(0, 60).map((g) => ({ id: g.id, name: clip(g.title || g.id, 70) })) };
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
/* ── the Calendar card
|
|
45
|
+
/* ── the Briefing's Calendar card (initiative premium-calendar-card; My work has none, A1): the day strip, its summary line and the chevron ── */
|
|
46
46
|
const weekKeys = (today) => {
|
|
47
47
|
const [y, m, d] = today.split('-').map(Number), wd = (new Date(Date.UTC(y, m - 1, d)).getUTCDay() + 6) % 7;
|
|
48
48
|
return [0, 1, 2, 3, 4].map((i) => new Date(Date.UTC(y, m - 1, d - wd + i)).toISOString().slice(0, 10));
|
|
49
49
|
};
|
|
50
|
-
/** Monday to Friday
|
|
50
|
+
/** Monday to Friday: meeting minutes from the week answer `W` (weekView), done and due counts from the PM's
|
|
51
51
|
* list `items` (GET /api/pm-items). With no calendar the days still carry the list's counts and `calendar` is false. */
|
|
52
52
|
export function stripOf(W, items, today) {
|
|
53
53
|
const ok = !!(W && W.state === 'ok'), its = Array.isArray(items) ? items : [];
|
|
@@ -60,7 +60,7 @@ export function stripOf(W, items, today) {
|
|
|
60
60
|
});
|
|
61
61
|
return { days, calendar: ok };
|
|
62
62
|
}
|
|
63
|
-
/** The strip: one button per day, the picked one pressed.
|
|
63
|
+
/** The strip: one button per day, the picked one pressed. Meeting bar, done and due blocks, as PR 878 drew them. */
|
|
64
64
|
export function stripHtml(S, picked, esc) {
|
|
65
65
|
const top = Math.max(60, ...S.days.map((d) => d.meet_min));
|
|
66
66
|
const blk = (n, c) => Array.from({ length: Math.min(n, 3) }, () => `<i class="${c}"></i>`).join('');
|
|
@@ -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 { vwReset } from './premium-viewer.js';
|
|
4
5
|
import { lineItems, behindOf, refreshTargets, whenRead } from './freshness-words.js';
|
|
5
6
|
export const $ = (s, r = document) => r.querySelector(s);
|
|
6
7
|
export const $$ = (s, r = document) => [...r.querySelectorAll(s)];
|
|
@@ -170,7 +171,7 @@ export function openDlg(o) {
|
|
|
170
171
|
$$('.rail,main.stage,#dock').forEach((x) => { x.inert = true; });
|
|
171
172
|
$('#dlg').inert = false; document.documentElement.style.overflow = 'hidden';
|
|
172
173
|
$('#dEye').textContent = o.eye; $('#dTitle').textContent = o.title; $('#dSub').textContent = o.sub || ''; $('#dSub').hidden = !o.sub;
|
|
173
|
-
$('#oMain').innerHTML = o.pane || `<article class="paper doc">${o.html}</article>`; $('#oLab').textContent = o.label || 'Detail';
|
|
174
|
+
$('#oMain').innerHTML = o.pane || `<article class="paper doc">${o.html}</article>`; $('#oLab').textContent = o.label || 'Detail'; vwReset(); // extra viewer tabs belong to the dialog that opened them
|
|
174
175
|
$('#dBody').innerHTML = `<div class="stream" role="log">${o.stream || turnA(ptx(o.say))}</div><form class="askbar" id="askF"><input id="askIn" placeholder="Ask the agent about this row" maxlength="2000" autocomplete="off" aria-label="A question for the agent"><button type="submit" data-act="ask" id="askGo" aria-label="Ask the agent" title="Ask the agent"><svg class="i" viewBox="0 0 24 24"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button></form><p class="fine2" id="askNote">The agent reads this repository and answers in words. It cannot change anything, and its answers are not checked against the records.</p>`;
|
|
175
176
|
$('#dlg').classList.remove('full'); setMode('split'); setTab('out'); // on a phone the dialog opens on the Detail tab and the Detail / Conversation switch brings the conversation, as the mockup draws it
|
|
176
177
|
$('#veil').classList.add('on'); $('#dlg').classList.add('on');
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/* pm/premium-viewer.js — the right pane of the premium dialog as a viewer with tabs (initiative premium-viewer, R1).
|
|
2
|
+
* The dialog's own detail (#oMain) is always the first tab and is never re-rendered here, so the handlers pages bind on #oMain keep
|
|
3
|
+
* working. vwOpen(item) opens another item as a tab beside it, in its own .obody; at most MAX extra tabs, the oldest closes first.
|
|
4
|
+
* With no extra tab the pane looks as it did: the tab strip is hidden and #oLab shows the label.
|
|
5
|
+
* vwOpen({ id, title, icon?, html | render(el), wire?(el) }) · vwClose(id) · vwShow(id | 'main') · vwReset() (openDlg calls it)
|
|
6
|
+
* vwStyle(name) loads pm/premium-vw-<name>.css once, so each view keeps its rules out of the shared premium.css.
|
|
7
|
+
* vwConfirm(el, { text, yes, no }) puts a confirm card at the top of a view's pane and resolves true or false.
|
|
8
|
+
* The contract for views is /mnt/project-files/premium-viewer-build/frame-contract.md. */
|
|
9
|
+
const MAX = 4;
|
|
10
|
+
const IC = {
|
|
11
|
+
doc: 'M6 3h9l4 4v14H6zM14 3v5h5M9 12h7M9 16h5', cal: 'M3.5 5h17v15h-17zM3.5 10h17M8 3v4M16 3v4', notes: 'M6 3h9l4 4v14H6zM14 3v5h5M9 12h7M9 16h5',
|
|
12
|
+
tk: 'M4 4h16v16H4zM8.5 12.5l2.5 2.5 4.5-5', list: 'M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01', mic: 'M9 3h6v11H9zM5 11a7 7 0 0 0 14 0M12 18v3',
|
|
13
|
+
};
|
|
14
|
+
const svg = (k) => `<svg class="i" viewBox="0 0 24 24"><path d="${IC[k] || IC.doc}"/></svg>`;
|
|
15
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
16
|
+
const V = { items: [], on: 'main' };
|
|
17
|
+
const q = (s) => document.querySelector(s);
|
|
18
|
+
|
|
19
|
+
function strip() {
|
|
20
|
+
let t = q('#vTabs');
|
|
21
|
+
if (!t) { const top = q('#dOut .otop'); if (!top) return null; t = document.createElement('div'); t.id = 'vTabs'; t.className = 'vtabs'; t.setAttribute('role', 'tablist'); t.setAttribute('aria-label', 'Open items'); top.prepend(t); t.onclick = onTab; t.onkeydown = onKey; } // delegated: the tabs carry role=tab and the keys below, the close is a real button
|
|
22
|
+
return t;
|
|
23
|
+
}
|
|
24
|
+
function draw() {
|
|
25
|
+
const t = strip(); if (!t) return;
|
|
26
|
+
const lab = q('#oLab'), many = V.items.length > 0;
|
|
27
|
+
t.hidden = !many; if (lab) lab.hidden = many;
|
|
28
|
+
if (!many) { t.innerHTML = ''; return; }
|
|
29
|
+
const tab = (id, title, icon, x) => `<div class="vtab" role="tab" tabindex="${V.on === id ? 0 : -1}" aria-selected="${V.on === id}" data-vw="${esc(id)}">${svg(icon)}<span>${esc(title)}</span>${x ? `<button type="button" class="vx" data-vx="${esc(id)}" aria-label="Close ${esc(title)}" title="Close"><svg class="i" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button>` : ''}</div>`;
|
|
30
|
+
t.innerHTML = tab('main', (lab && lab.textContent) || 'Detail', 'doc', false) + V.items.map((it) => tab(it.id, it.title, it.icon, true)).join('');
|
|
31
|
+
}
|
|
32
|
+
function pane(id) { return id === 'main' ? q('#oMain') : document.querySelector(`#dOut .obody.vw[data-vw="${CSS.escape(id)}"]`); }
|
|
33
|
+
export function vwShow(id) {
|
|
34
|
+
if (id !== 'main' && !V.items.some((x) => x.id === id)) id = 'main';
|
|
35
|
+
V.on = id;
|
|
36
|
+
const m = q('#oMain'); if (m) m.hidden = id !== 'main';
|
|
37
|
+
document.querySelectorAll('#dOut .obody.vw').forEach((p) => { p.hidden = p.dataset.vw !== id; });
|
|
38
|
+
draw();
|
|
39
|
+
const p = q('#dOut'); if (p) p.scrollTop = 0;
|
|
40
|
+
}
|
|
41
|
+
export function vwOpen(it) {
|
|
42
|
+
if (!it || !it.id) return null;
|
|
43
|
+
const was = V.items.find((x) => x.id === it.id);
|
|
44
|
+
if (was) { Object.assign(was, it); fill(was); vwShow(it.id); return pane(it.id); }
|
|
45
|
+
if (V.items.length >= MAX) vwClose(V.items[0].id, true);
|
|
46
|
+
const el = document.createElement('div'); el.className = 'obody vw'; el.dataset.vw = it.id; el.setAttribute('role', 'tabpanel');
|
|
47
|
+
const at = q('#dOut .tabhint'); if (at) at.before(el); else q('#dOut').append(el);
|
|
48
|
+
const rec = { id: it.id, title: it.title || 'Item', icon: it.icon || 'doc', html: it.html, render: it.render, wire: it.wire };
|
|
49
|
+
V.items.push(rec); fill(rec); vwShow(it.id);
|
|
50
|
+
return el;
|
|
51
|
+
}
|
|
52
|
+
function fill(rec) {
|
|
53
|
+
const el = pane(rec.id); if (!el) return;
|
|
54
|
+
if (rec.render) rec.render(el); else el.innerHTML = rec.html || '';
|
|
55
|
+
if (rec.wire) rec.wire(el);
|
|
56
|
+
}
|
|
57
|
+
export function vwClose(id, quiet) {
|
|
58
|
+
const i = V.items.findIndex((x) => x.id === id); if (i < 0) return;
|
|
59
|
+
V.items.splice(i, 1); const p = pane(id); if (p) p.remove();
|
|
60
|
+
if (quiet) return;
|
|
61
|
+
if (V.on === id) vwShow(V.items[i - 1] ? V.items[i - 1].id : V.items[i] ? V.items[i].id : 'main'); else draw();
|
|
62
|
+
}
|
|
63
|
+
export function vwReset() {
|
|
64
|
+
V.items.forEach((it) => { const p = pane(it.id); if (p) p.remove(); });
|
|
65
|
+
V.items = []; V.on = 'main';
|
|
66
|
+
const m = q('#oMain'); if (m) m.hidden = false;
|
|
67
|
+
draw();
|
|
68
|
+
}
|
|
69
|
+
export const vwState = () => ({ on: V.on, ids: V.items.map((x) => x.id) });
|
|
70
|
+
function onTab(e) {
|
|
71
|
+
const x = e.target.closest('[data-vx]'); if (x) { e.stopPropagation(); vwClose(x.dataset.vx); return; }
|
|
72
|
+
const t = e.target.closest('[data-vw]'); if (t) vwShow(t.dataset.vw);
|
|
73
|
+
}
|
|
74
|
+
function onKey(e) {
|
|
75
|
+
const tabs = [...document.querySelectorAll('#vTabs .vtab')], i = tabs.indexOf(document.activeElement); if (i < 0) return;
|
|
76
|
+
let n = -1;
|
|
77
|
+
if (e.key === 'ArrowRight') n = (i + 1) % tabs.length; else if (e.key === 'ArrowLeft') n = (i - 1 + tabs.length) % tabs.length;
|
|
78
|
+
else if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); vwShow(tabs[i].dataset.vw); return; }
|
|
79
|
+
else if ((e.key === 'Delete' || e.key === 'Backspace') && tabs[i].dataset.vw !== 'main') { vwClose(tabs[i].dataset.vw); return; }
|
|
80
|
+
if (n < 0) return; e.preventDefault(); vwShow(tabs[n].dataset.vw); const f = q(`#vTabs .vtab[data-vw="${CSS.escape(tabs[n].dataset.vw)}"]`); if (f) f.focus();
|
|
81
|
+
}
|
|
82
|
+
export function vwStyle(name) {
|
|
83
|
+
if (!/^[a-z0-9-]+$/.test(name || '') || document.querySelector(`link[data-vw-css="${name}"]`)) return;
|
|
84
|
+
const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = `/pm/premium-vw-${name}.css`; l.dataset.vwCss = name; document.head.append(l);
|
|
85
|
+
}
|
|
86
|
+
export function vwConfirm(el, o) {
|
|
87
|
+
return new Promise((done) => {
|
|
88
|
+
if (!el) { done(false); return; }
|
|
89
|
+
const old = el.querySelector(':scope > .vcf'); if (old) old.remove();
|
|
90
|
+
const c = document.createElement('div'); c.className = 'vcf'; c.setAttribute('role', 'alertdialog'); c.setAttribute('aria-label', (o && o.text) || 'Confirm');
|
|
91
|
+
c.innerHTML = `<p>${esc(o && o.text)}</p><div class="vcfb"><button type="button" class="btn" data-a="1">${esc((o && o.yes) || 'Yes')}</button><button type="button" class="btn sec" data-a="0">${esc((o && o.no) || 'Cancel')}</button></div>`;
|
|
92
|
+
c.onclick = (e) => { // delegated to the card's two buttons
|
|
93
|
+
const b = e.target.closest('[data-a]'); if (!b) return; c.remove(); done(b.dataset.a === '1'); };
|
|
94
|
+
el.prepend(c); const f = c.querySelector('[data-a="1"]'); if (f) f.focus();
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (typeof window !== 'undefined') window.__premiumViewer = { vwOpen, vwClose, vwShow, vwReset, vwState, vwStyle, vwConfirm };
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* Every press goes to the Work page's own route under /api/pm-items, /api/pm-jobs or /api/my-work; this file adds no writer. A control with nothing honest to write stays off and says why.
|
|
4
4
|
* My work depth (initiative premium-work-depth): the dialog's tool row (Edit, Who does each step, Not before, Someday), the Focus bar and its jobs, the agent on an item
|
|
5
5
|
* (draft, stop, edit, post after a confirm, send back, try again), and keys and swipe on the rows. */
|
|
6
|
-
import { pmPost
|
|
7
|
-
import { weekView, stripHtml, foldLine, mountFold } from './premium-meeting.js';
|
|
6
|
+
import { pmPost } from './http.js';
|
|
8
7
|
import { mdRender } from './markdown.js';
|
|
9
8
|
import { $, $$, esc, openDlg, closeDlg, setMode, toast, loadThread, onScroll, wireRail, logHtml, turnA, turnU, ptx, CHECK, RM, S, setPageGaps, onPageChat, openPageChat } from './premium-shell.js';
|
|
10
9
|
|
|
@@ -121,31 +120,7 @@ $('#frBody').addEventListener('click', (e) => {
|
|
|
121
120
|
const st = M.friday.steps.find((x) => x.key === b.dataset.fr); const r = st && st.first ? rowOf(st.first) : null;
|
|
122
121
|
if (r) openRow(r); else toast('Nothing to open here.');
|
|
123
122
|
});
|
|
124
|
-
|
|
125
|
-
let wkPick = null, WK = null, wkFold = null;
|
|
126
|
-
const wkToday = () => (M && M.today) || new Date().toISOString().slice(0, 10);
|
|
127
|
-
async function readWk() {
|
|
128
|
-
const w = new URLSearchParams(location.search).get('ws');
|
|
129
|
-
WK = weekView(await pmGet('/api/calendar-views?view=week&date=' + wkToday() + (w ? '&ws=' + encodeURIComponent(w) : '')), wkToday());
|
|
130
|
-
drawWeek();
|
|
131
|
-
}
|
|
132
|
-
function drawWeek() {
|
|
133
|
-
const W = M.week; if (!W) return;
|
|
134
|
-
if (!wkFold) wkFold = mountFold($('#weekCard'), 'work');
|
|
135
|
-
const pick = wkPick || wkToday(), S = { days: W.days.map((d) => ({ ...d, meetings: d.meetings || 0 })), calendar: W.calendar };
|
|
136
|
-
$('#weekCap').textContent = W.cap;
|
|
137
|
-
$('#weekBody').innerHTML = stripHtml(S, pick, esc);
|
|
138
|
-
$('#weekNote').textContent = W.note;
|
|
139
|
-
wkFold.line(S, foldLine(S, WK), esc);
|
|
140
|
-
const x = WK && WK.state === 'ok' ? WK.days.find((y) => y.key === pick) : null;
|
|
141
|
-
const due = (M.rows || []).filter((r) => r.edit && r.edit.due === pick && r.list !== 'done');
|
|
142
|
-
$('#wkList').innerHTML = !WK ? '<div class="empty">Reading the calendar PMOS holds.</div>' : WK.state === 'error' ? `<div class="empty" role="status">Calendar not read. ${esc(WK.reason)}</div>`
|
|
143
|
-
: `<div class="wkd${x && x.today ? ' now' : ''}">${esc(x ? x.label : pick)}${x && x.today ? ' · today' : ''}<em>${x && x.rows.length ? x.rows.length + (x.rows.length === 1 ? ' meeting' : ' meetings') : ''}</em></div>`
|
|
144
|
-
+ due.map((r) => `<div class="wkdue" role="listitem"><span>Due</span><b>${esc(r.title)}</b></div>`).join('')
|
|
145
|
-
+ (x && x.rows.length ? x.rows.map((r) => `<div class="ev src-meeting${r.past || (x.today && Date.parse(r.end || r.at) < Date.now()) ? ' wkpast' : ''}" role="listitem"><time>${esc(r.time)}</time><span class="gl-t"><svg class="i" viewBox="0 0 24 24"><rect x="4" y="5" width="16" height="15" rx="3"/><path d="M4 10h16M9 3v4M15 3v4"/></svg></span><span><b>${esc(r.title)}</b><span class="d">${esc([r.sub, r.about].filter(Boolean).join(' · ') || 'No other people listed')}</span></span></div>`).join('') : '<div class="empty">No meetings.</div>');
|
|
146
|
-
}
|
|
147
|
-
$('#weekBody').addEventListener('click', (e) => { const b = e.target.closest('[data-day]'); if (!b || !M) return; wkPick = b.dataset.day; drawWeek(); });
|
|
148
|
-
function draw() { drawHero(); drawWeek(); drawFriday(); drawFocus(); drawQueue(); drawWaiting(); drawReview(); drawDock(); onScroll(); backFocus(); }
|
|
123
|
+
function draw() { drawHero(); drawFriday(); drawFocus(); drawQueue(); drawWaiting(); drawReview(); drawDock(); onScroll(); backFocus(); }
|
|
149
124
|
const rowOf = (key) => (M && M.rows || []).find((r) => r.key === key) || null;
|
|
150
125
|
|
|
151
126
|
/* ── the dialog: detail first, the presses of the Work page, the tool row, the agent, the read-only agent beside it ─────────────────── */
|
|
@@ -654,7 +629,6 @@ async function load() {
|
|
|
654
629
|
}
|
|
655
630
|
M = r.model; draw();
|
|
656
631
|
openAsked();
|
|
657
|
-
if (!WK) readWk();
|
|
658
632
|
const mine = dlgOpen() && ((dlgKind === 'item' && openR && S.key === openR.key) || (dlgKind === 'fjobs' && S.key === 'focus:today'));
|
|
659
633
|
if (mine && dlgKind === 'item') refreshOpen(); else if (mine) drawFocusDlg();
|
|
660
634
|
}
|
|
@@ -2020,6 +2020,25 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
2020
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}
|
|
2021
2021
|
.tl.wkday{min-height:0}.tl.wkday .ev{cursor:default}
|
|
2022
2022
|
#todayCard.wkm .foldb{margin-left:auto}
|
|
2023
|
+
/* the viewer's tabs (initiative premium-viewer, R1): the dialog's detail is the first tab, items opened from it follow */
|
|
2024
|
+
.vtabs{display:flex;align-items:center;gap:4px;min-width:0;overflow-x:auto;scrollbar-width:none;flex:1 1 auto}
|
|
2025
|
+
.vtabs[hidden]{display:none}
|
|
2026
|
+
.vtab{display:inline-flex;align-items:center;gap:7px;height:34px;padding:0 6px 0 12px;border-radius:var(--r-chip);font-size:var(--fs-2);font-weight:500;color:var(--ink-2);white-space:nowrap;cursor:pointer;flex:none;max-width:220px}
|
|
2027
|
+
.vtab span{overflow:hidden;text-overflow:ellipsis}
|
|
2028
|
+
.vtab .i{width:14px;height:14px;flex:none}
|
|
2029
|
+
.vtab:hover{background:var(--card)}
|
|
2030
|
+
.vtab[aria-selected="true"]{background:var(--card-solid);color:var(--ink);font-weight:600;box-shadow:var(--card-shadow)}
|
|
2031
|
+
.vtab[data-vw="main"]{padding-right:12px}
|
|
2032
|
+
.vtab .vx{width:24px;height:24px;border-radius:6px;display:grid;place-items:center;color:var(--ink-3)}
|
|
2033
|
+
.vtab .vx:hover{background:var(--well);color:var(--ink)}
|
|
2034
|
+
.vtab .vx .i{width:12px;height:12px}
|
|
2035
|
+
.vtab:focus-visible{outline:2px solid var(--ink);outline-offset:1px}
|
|
2036
|
+
.obody[hidden]{display:none!important}
|
|
2037
|
+
@media (max-width:700px){.vtab{height:44px}.vtab .vx{width:44px;height:44px}}
|
|
2038
|
+
.vcf{border:1px solid var(--hair);border-radius:var(--r-chip);background:var(--card-solid);box-shadow:var(--card-shadow);padding:12px 14px;margin:0 0 14px}
|
|
2039
|
+
.vcf p{margin:0 0 10px;font-size:var(--fs-3)}
|
|
2040
|
+
.vcfb{display:flex;gap:8px;flex-wrap:wrap}
|
|
2041
|
+
@media (max-width:700px){.vcfb .btn{min-height:44px}}
|
|
2023
2042
|
|
|
2024
2043
|
/* one top bar on every premium page (initiative premium-topbar): left = where you are + Chat; right = Sources chip, bell, one ⋯ menu */
|
|
2025
2044
|
.top{flex-wrap:nowrap}
|
|
@@ -58,6 +58,8 @@
|
|
|
58
58
|
<div class="ch"><span class="ic"><svg class="i" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg></span><h2 id="hWait">Waiting on others</h2><small id="waitCap"></small></div>
|
|
59
59
|
<div id="waitBody"></div>
|
|
60
60
|
</section>
|
|
61
|
+
</div>
|
|
62
|
+
<div>
|
|
61
63
|
<section class="card rise" style="--d:9" id="frCard" aria-labelledby="hFr">
|
|
62
64
|
<div class="ch"><span class="ic"><svg class="i" viewBox="0 0 24 24"><rect x="4" y="5" width="16" height="15" rx="3"/><path d="m8.5 13 2.5 2.5 4.5-5"/></svg></span><h2 id="hFr">Weekly review</h2><small id="frCap"></small></div>
|
|
63
65
|
<div id="frBody"></div>
|
|
@@ -67,14 +69,6 @@
|
|
|
67
69
|
<div class="revc"><p id="revTxt"></p><button id="revBtn" type="button">Look at them</button></div>
|
|
68
70
|
</section>
|
|
69
71
|
</div>
|
|
70
|
-
<div>
|
|
71
|
-
<section class="card rise" style="--d:6" id="weekCard" aria-labelledby="hWeek">
|
|
72
|
-
<div class="ch"><span class="ic"><svg class="i" viewBox="0 0 24 24"><rect x="4" y="5" width="16" height="15" rx="3"/><path d="M4 10h16M9 3v4M15 3v4"/></svg></span><h2 id="hWeek">Calendar</h2><small id="weekCap"></small></div>
|
|
73
|
-
<div id="weekBody"></div>
|
|
74
|
-
<div class="tl wkday" id="wkList" role="list" aria-label="Meetings of the picked day"></div>
|
|
75
|
-
<p class="note" id="weekNote" style="margin-top:8px"></p>
|
|
76
|
-
</section>
|
|
77
|
-
</div>
|
|
78
72
|
</div>
|
|
79
73
|
<p class="foot" id="foot">This page reads your list, the same one the Work page reads. It writes only when you press a button that says what it does, and each press uses the Work page's own route. Starting an agent from a list is not built here. The Kept and Done tabs show only your own items. Answers, ideas and reports an agent files on its own, effort figures and review timing need records PMOS does not hold yet. Jira and Slack items appear only when an agent session has read them.</p>
|
|
80
74
|
</main>
|