create-pmos 0.295.0 → 0.297.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-adddoc-test.js +1 -1
- package/workspace/briefing-premium-initiative-test.js +29 -6
- package/workspace/guide/briefing-premium.md +4 -3
- package/workspace/lib/initiative-premium.js +2 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-studio-test.js +18 -0
- package/workspace/public/pm/premium-initiative.js +38 -16
- package/workspace/public/pm/premium-studio.js +19 -3
- package/workspace/public/pm/premium.css +17 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.297.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-19T05:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T05:47:10Z"}
|
|
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-19T05:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T05:47:10Z"}
|
|
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-19T05:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T05:47:10Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -94,7 +94,7 @@ const PAGES = {
|
|
|
94
94
|
ok(`${kind} A1 the dialog closes, the page reads again and focus returns to the button`, A.calls() > calls0 && await p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')) && await p.evaluate((s) => document.activeElement === document.querySelector(s), P.btn));
|
|
95
95
|
A.setCustom(CUSTOM.map((d) => Object.assign({}, d, { scope: P.scope }))); await p.reload(); await until(() => p.evaluate((s) => !!document.querySelector(s), P.ready), 20000); await sleep(400);
|
|
96
96
|
const sel = ini ? '#cIniDoc' : '#cDocs';
|
|
97
|
-
const rows = await p.evaluate((s) => [...document.querySelectorAll(s + ' .dmr')].map((r) => ({ t: r.querySelector('b').textContent, s: r.querySelector('.dmm .s').textContent.trim(), small: r.querySelector('.dmn>small').textContent, meta: r.querySelector('.dmm').textContent, btn: r.querySelectorAll('button').length })), sel);
|
|
97
|
+
const rows = await p.evaluate((s) => [...document.querySelectorAll(s + ' .dmr')].map((r) => ({ t: r.querySelector('b').textContent, s: r.querySelector('.dmm .s').textContent.trim(), small: r.querySelector('.dmn>small').textContent, meta: r.querySelector('.dmm').textContent, btn: r.querySelectorAll('.dmq button').length })), sel);
|
|
98
98
|
const uat = rows.find((r) => r.t === 'UAT plan'), con = rows.find((r) => r.t === 'Contract');
|
|
99
99
|
ok(`${kind} A5 an unlinked document reads Not started with the date it was added and no press`, uat && uat.s === 'Not started' && /added 18 Oct/.test(uat.meta) && /You write it/.test(uat.meta) && uat.btn === 0, JSON.stringify(uat));
|
|
100
100
|
ok(`${kind} A5 a linked document reads Linked, shows its address as text and has no press`, con && con.s === 'Linked' && /Confluence: https:\/\/example\.atlassian\.net/.test(con.small) && con.btn === 0 && !/Up to date/.test(con.s), JSON.stringify(con));
|
|
@@ -99,10 +99,10 @@ const HEALTH = { ok: true, path: 'planning/prd/self-serve-v2-prd.md', health: {
|
|
|
99
99
|
/* I4 overview and I5 checks */
|
|
100
100
|
const ov = await p.evaluate(() => ({ who: document.querySelector('#cIniOv .tdw').textContent, h: document.querySelector('#cIniOv .todo b').textContent, p: document.querySelector('#cIniOv .todo p').textContent, more: document.querySelector('#cIniOv .todo small').textContent, skip: document.querySelector('#cIniOv .tdk').textContent, notes: [...document.querySelectorAll('#cIniOv .note')].map((n) => n.textContent) }));
|
|
101
101
|
ok('I4 the next step, its reason, its action and what happens if you wait come from the workflow engine; the reasons are shown', ov.who === 'Waits on you' && ov.h === 'Next: contract' && /pre_run_contract/.test(ov.p) && /Agree done_criteria/.test(ov.more) && ov.skip === 'If you wait: it stays at contract.' && ov.notes.length === 2, JSON.stringify(ov));
|
|
102
|
-
const chk = await p.evaluate(() =>
|
|
103
|
-
ok('I5
|
|
104
|
-
ok('I5
|
|
105
|
-
ok('I5 "All 7 workflow steps" lists every step of the ladder', /All 7 workflow steps/.test(await txt('#
|
|
102
|
+
const chk = await p.evaluate(() => !!document.querySelector('#cIniChk'));
|
|
103
|
+
ok('I5 there is no Checks card: the mockup has none, and the Overview is the full-width card', chk === false && await p.evaluate(() => document.querySelector('#cIniOv').classList.contains('ifull') && !document.querySelector('.bcols')));
|
|
104
|
+
ok('I5 the Overview keeps the engine\'s evidence in "All 7 workflow steps"', /first-appeared at or before the first build commit/.test(await txt('#cIniOv .src .ckr:first-child small')) && /never claims a test result it did not run/.test(await all('#cIniOv .src .ckr small').then((x) => x.join(' '))));
|
|
105
|
+
ok('I5 "All 7 workflow steps" lists every step of the ladder', /All 7 workflow steps/.test(await txt('#cIniOv .src summary')) && (await p.evaluate(() => document.querySelectorAll('#cIniOv .src .ckr').length)) === 7);
|
|
106
106
|
ok('I4 the description line is shown only when the record has one', await p.evaluate(() => !document.querySelector('#cIniOv .lede')));
|
|
107
107
|
/* PMOS can help: two real presses */
|
|
108
108
|
ok('I4 PMOS can help offers a draft of the first document not started and a question for the agent', (await all('#cIniOv .agc')).join('|') === 'Draft the problem statement|Summarise the review findings');
|
|
@@ -221,7 +221,13 @@ const HEALTH = { ok: true, path: 'planning/prd/self-serve-v2-prd.md', health: {
|
|
|
221
221
|
await p.fill('#askIn', 'What is missing?'); const nA = A.posts.length; await p.press('#askIn', 'Enter');
|
|
222
222
|
ok('I8 a question posts the document key and the text', await until(() => A.posts.length > nA && A.posts[A.posts.length - 1].path === '/api/briefing-premium/ask' && A.posts[A.posts.length - 1].body.key === 'doc:self-serve-v2:prd' && A.posts[A.posts.length - 1].body.text === 'What is missing?'));
|
|
223
223
|
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
224
|
-
|
|
224
|
+
await p.fill('#dmQ', ''); await p.click('#dmF [data-dmf="all"]');
|
|
225
|
+
ok('I8 every document row opens, including one with no file', await p.evaluate(() => [...document.querySelectorAll('#dmList .dmr')].every((r) => !!r.querySelector('.dmo[data-doc]'))));
|
|
226
|
+
await p.click('#dmList .dmo[data-doc="problem"]'); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(400);
|
|
227
|
+
{ const ab = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, body: document.querySelector('#oMain').textContent, draft: !!document.querySelector('#abDraft'), ask: document.querySelector('#askF').hidden }));
|
|
228
|
+
ok('I8 a document with no file says what it is for, who writes it and offers Draft it', ab.title === 'Problem statement' && /Who writes it/.test(ab.body) && ab.draft && ab.ask === true, JSON.stringify(ab)); }
|
|
229
|
+
const nD = A.posts.length; A.set({ status: 200, body: { ok: true, run: 'r1' } }); await p.click('#abDraft');
|
|
230
|
+
ok('I8 Draft it in that popup posts the draft route and closes the popup', await until(() => A.posts.length > nD && A.posts[A.posts.length - 1].path === '/api/core-docs/draft' && A.posts[A.posts.length - 1].body.key === 'problem') && await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))));
|
|
225
231
|
ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
|
|
226
232
|
await A.ctx.close();
|
|
227
233
|
|
|
@@ -261,6 +267,23 @@ const HEALTH = { ok: true, path: 'planning/prd/self-serve-v2-prd.md', health: {
|
|
|
261
267
|
await L.ctx.close();
|
|
262
268
|
}
|
|
263
269
|
|
|
270
|
+
/* I6 a long task list is paged */
|
|
271
|
+
{
|
|
272
|
+
const many = Array.from({ length: 25 }, (_, n) => ({ uid: 'm' + n, key: 'M-' + n, kind: 'Task', src: 'jira', title: 'Task ' + n, status: n % 3 ? 'To do' : 'Done', blocked: false, owner: null, ini: 'self-serve-v2', start: null, end: null }));
|
|
273
|
+
const D = await open({ model: mk({ items: many }) });
|
|
274
|
+
const rows = () => D.page.evaluate(() => document.querySelectorAll('#tkBody .tkq').length);
|
|
275
|
+
ok('I6 the List shows ten tasks and says where it is', await rows() === 10 && /1–10 of 28/.test(await D.page.evaluate(() => document.querySelector('.tkpg').textContent)));
|
|
276
|
+
await D.page.click('[data-tkpg="1"]'); await D.page.click('[data-tkpg="1"]');
|
|
277
|
+
ok('I6 Next walks to the last page, which holds the rest, and Next is then off', await rows() === 8 && await D.page.evaluate(() => document.querySelector('[data-tkpg="1"]').disabled));
|
|
278
|
+
await D.page.click('#tkTabs [data-v="stage"]');
|
|
279
|
+
ok('I6 By stage caps a column and Show more opens it', await D.page.evaluate(() => document.querySelectorAll('#tkBody .isc:nth-child(1) .tkc').length) <= 6 && (await D.page.locator('[data-tkmore]').count()) > 0);
|
|
280
|
+
await D.page.locator('[data-tkmore]').first().click();
|
|
281
|
+
ok('I6 Show more lists the whole column', await D.page.evaluate(() => document.querySelectorAll('#tkBody .tkc').length) >= 25);
|
|
282
|
+
await D.page.click('#tkTabs [data-v="time"]');
|
|
283
|
+
ok('I6 the Timeline keeps working and is paged too', /of 28/.test(await D.page.evaluate(() => document.querySelector('.tkpg').textContent)));
|
|
284
|
+
await D.ctx.close();
|
|
285
|
+
}
|
|
286
|
+
|
|
264
287
|
/* I3 degraded: nothing invented */
|
|
265
288
|
{
|
|
266
289
|
const D = await open({ model: mk({ row: Object.assign({}, F.ROW, { owner: null, end: null, status: null }), sheet: null, ladder: null, items: [], docs: null }) });
|
|
@@ -298,7 +321,7 @@ const HEALTH = { ok: true, path: 'planning/prd/self-serve-v2-prd.md', health: {
|
|
|
298
321
|
/* I12 fidelity against the mockup */
|
|
299
322
|
if (!fs.existsSync(MOCKUP)) ok('I12 the mockup is in the repository', false, MOCKUP);
|
|
300
323
|
else {
|
|
301
|
-
const PAIRS = [['rail', '.rail'], ['crumb', '.crumb'], ['crb', '#crBoard'], ['cri', '#crSw'], ['crask', '#crAsk'], ['lede', '#cIniOv .lede'], ['agr', '#cIniOv .agr2'], ['agc', '#cIniOv .agc'], ['tkadd', '.tkadd'], ['
|
|
324
|
+
const PAIRS = [['rail', '.rail'], ['crumb', '.crumb'], ['crb', '#crBoard'], ['cri', '#crSw'], ['crask', '#crAsk'], ['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']];
|
|
302
325
|
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'];
|
|
303
326
|
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'];
|
|
304
327
|
const PROPS = ['fontSize', 'fontWeight', 'fontFamily', 'color', 'backgroundColor', 'borderRadius', 'paddingTop', 'paddingLeft', 'letterSpacing', 'lineHeight', 'boxShadow', 'backdropFilter', 'borderTopColor'];
|
|
@@ -224,7 +224,7 @@ Board is the third place on the rail, at `/premium-board.html`. It reads what th
|
|
|
224
224
|
- **The header** counts the board's open initiatives: how many are on track, at risk, late and on hold, with a bar. A zero is shown.
|
|
225
225
|
- **List** shows the late and at-risk initiatives first, then the board's now view, up to 100 loaded and 25 on screen at a time. A row shows the owner and lane, a status chip when it is not on track, how far through the workflow it is (and "derived" when the workflow engine placed it), a progress bar only when a record holds progress, and the planned finish only when an end date was set ("Not planned" otherwise). "Do this first" appears only when the first row is late.
|
|
226
226
|
- **By stage** has one column for each stage of the board's workflow with the board's own count and its first five initiatives.
|
|
227
|
-
- **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.
|
|
227
|
+
- **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.
|
|
228
228
|
- **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.
|
|
229
229
|
- **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 and keep no history, so they have no chart. Move over a chart, or use the arrow keys, to read a week. A tile that cannot be counted says **Not read** and why. Press a tile for its definition and values, with the read-only agent beside it. There are no targets, and Day and Month are off. It was tested only on made-up repositories, not on a real IDPF or microsite repository.
|
|
230
230
|
- **The crumb** at the top names the board. With more than one board a menu switches between them, and the sparkle opens the board in the dialog with the read-only agent.
|
|
@@ -245,8 +245,8 @@ The initiative page is at `/premium-initiative.html?id=<initiative>`. A click on
|
|
|
245
245
|
- **The data pill and the theme button** sit on a line under the crumb. Long file names in the evidence of a check wrap inside the card instead of running past its edge.
|
|
246
246
|
- **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.
|
|
247
247
|
- **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.
|
|
248
|
-
- **
|
|
249
|
-
- **Tasks** lists the PRD requirements and the board's tracker items for this initiative. The repository records no result for each requirement, so a requirement says "No result" and is never drawn as done or open. **By stage** groups them by state. **Timeline** draws a bar for each task that has both a start and a due date, and lists the rest. Press a task to read its record; for a PMOS task you can change its status. **Add a task** writes a PMOS task to the board's own record; with no dates the board plans it from tomorrow for a week. Jira tickets stay read-only. **Add a document** works as on the Board, with a phase as well, and saves on the initiative's record.
|
|
248
|
+
- **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.
|
|
249
|
+
- **Tasks** lists the PRD requirements and the board's tracker items for this initiative. The repository records no result for each requirement, so a requirement says "No result" and is never drawn as done or open. **By stage** groups them by state. **Timeline** draws a bar for each task that has both a start and a due date, and lists the rest. Press a task to read its record; every Core documents row opens too: a document with no file shows what it is for, who writes it and what a draft will contain, with Draft it where a draft can run; for a PMOS task you can change its status. **Add a task** writes a PMOS task to the board's own record; with no dates the board plans it from tomorrow for a week. Jira tickets stay read-only. **Add a document** works as on the Board, with a phase as well, and saves on the initiative's record.
|
|
250
250
|
- **Core documents** has the same counts, filter and search as the Board's card, for this initiative. **Draft it** starts the existing read-only run that writes a draft and sends nothing. Technical documents (the record, the rubric, the stories, the review and the explainer) are grouped and not counted.
|
|
251
251
|
- **The document sheet.** A document that has a file opens in a dialog with **Read** (the file's text, its front matter as a grid and an outline), **Edit** (the file as plain Markdown, a reason, and **Save**), **Proposals** (**Ask the agent**, the open proposals with **Accept** and **Reject**, and the closed ones), **Edit log** (the revisions and other entries of the document sheet; **Show change** on a revision marks the words it added and removed against the revision before), **Health** (the document-health checks; a check with no input is not counted) and **Relations** (the documents it draws on, its goals, and the documents that use it, from the document library; a related file opens in the same sheet, and a goal or a missing file is listed but cannot be opened). The status line also names each **copy in another tool** (a Confluence page or Google Doc, with its state: in step, behind, both changed and so on), or offers **Link a copy**. Pressing it opens a panel with each copy's state, a link to open it, **Check now** (one agent session reads the copies with your connectors) and a box to paste a link. The sheet never writes to a copy; updating one is in the console. The file changes only when you press Save or Accept, and every change is kept in the Edit log with its reason. Save and Reject need a reason. A proposal made on text that has since changed shows which sections are out of date and cannot take them. The agent beside the sheet still only reads. A draft shows a bar above its text: **Issue it** marks the draft issued, through the console's own route, and sends nothing; it refuses while the Edit tab holds unsaved changes. Bold and undo buttons and Drop are not built on this page.
|
|
252
252
|
|
|
@@ -261,6 +261,7 @@ Insights is the fourth place on the rail, at `/premium-insights.html`. It reads
|
|
|
261
261
|
- **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.
|
|
262
262
|
- **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.
|
|
263
263
|
- **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.
|
|
264
|
+
- **Change the size of the Studio.** On a wide window, **Normal**, **Half**, **3/4** and **Whole** sit beside **Library**. Whole is the full screen. At Half, the conversation and the Studio are two tabs. The Studio opens on Whole, and PMOS remembers your choice on this browser.
|
|
264
265
|
- **Shape a report's sections.** On a report drawn from your work, **Shape it in the Studio** opens Report mode on it. Tell PMOS how to shape the sections in your own words; PMOS proposes the next version and says what it changed. **Leave out** on a section makes the next version without it; the headline, Needs your call and Sources are always in. **Undo** goes back one version. **Use this structure** saves the version shown, and the next cycle follows it.
|
|
265
266
|
- **What stands out.** Up to three plain sentences taken from the series: behind its line for three readings in a row, behind and still moving away from the target, closing in, slipped, reached its target, or a large one-step move. There is no forecast and no cause.
|
|
266
267
|
- **No series recorded.** A KR metric with one reading or none is listed with the reason and is not drawn.
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
const pad = (n) => String(n).padStart(2, '0');
|
|
20
20
|
const hhmm = (ms) => { const d = new Date(ms); return pad(d.getHours()) + ':' + pad(d.getMinutes()); };
|
|
21
21
|
const Custom = require('./custom-docs.js');
|
|
22
|
+
const { GUIDE } = require('./core-docs.js');
|
|
22
23
|
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
23
24
|
const isoDay = (v) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(v || '')); return m ? new Date(+m[1], +m[2] - 1, +m[3]) : null; };
|
|
24
25
|
const shortDate = (v) => { const d = isoDay(v); return d ? d.getDate() + ' ' + MON[d.getMonth()] : ''; };
|
|
@@ -103,7 +104,7 @@ function build(f) {
|
|
|
103
104
|
const dd = f.docs || null;
|
|
104
105
|
const all = dd ? (dd.docs || []).map((d) => ({
|
|
105
106
|
key: d.key, title: d.title, what: d.for || '', st: d.st, state: d.kind === 'live' ? 'Live' : DOC_STATE[d.st] || d.st || '', by: BY[d.by] || d.by || '', byKey: d.by || '',
|
|
106
|
-
when: d.when ? shortDate(d.when) : '', cat: d.cat === 'Do' ? 'Build' : d.cat === 'Learn' ? 'Evaluate' : d.cat || 'Board', path: d.open && d.open.path ? d.open.path : null, slot: d.st === 'draft' && d.draft && d.draft.slot ? d.draft.slot : '', running: !!d.running, tech: TECH.has(d.key),
|
|
107
|
+
when: d.when ? shortDate(d.when) : '', cat: d.cat === 'Do' ? 'Build' : d.cat === 'Learn' ? 'Evaluate' : d.cat || 'Board', path: d.open && d.open.path ? d.open.path : null, slot: d.st === 'draft' && d.draft && d.draft.slot ? d.draft.slot : '', running: !!d.running, tech: TECH.has(d.key), kind: d.kind || '', reader: d.reader || '', cadence: d.cadence || '', sections: ((GUIDE[d.key] || {}).sections || []).slice(),
|
|
107
108
|
act: d.act && d.act.do === 'draft' ? { kind: 'draft', label: d.running ? 'Drafting' : d.act.label || 'Draft it' } : null,
|
|
108
109
|
})) : [];
|
|
109
110
|
const custom = (f.custom || []).map((d) => Object.assign(Custom.rowOf(d), { added: shortDate(d.at), cat: d.phase || 'Board' }));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.297.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.297.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -72,6 +72,24 @@ const saved = async () => { const j = await (await fetch(BASE + '/api/insights-p
|
|
|
72
72
|
ok('O4 a new draft shows Not set on Name and Purpose and 0 charts', await chipv('name') === 'Not set' && await chipv('use') === 'Not set' && await chipv('charts') === '0');
|
|
73
73
|
ok('K1 the checks start at 2 of 6 (count and repeats pass)', await checksTxt() === '2 of 6 checks pass', await checksTxt());
|
|
74
74
|
|
|
75
|
+
/* Z: the Studio's size (Normal, Half, 3/4, Whole), as the console's Design studio has it */
|
|
76
|
+
const sz = () => p.evaluate(() => { const d = document.querySelector('#dlg'), r = d.getBoundingClientRect(); return { w: Math.round(r.width), full: d.classList.contains('full'), on: (document.querySelector('#stSz [aria-pressed="true"]') || {}).textContent, n: document.querySelectorAll('#stSz button').length, saved: localStorage.getItem('pmos.premium.studio-size') }; });
|
|
77
|
+
let z = await sz();
|
|
78
|
+
ok('Z1 the Studio offers Normal, Half, 3/4 and Whole, and opens on Whole', z.n === 4 && z.on === 'Whole' && z.full, JSON.stringify(z));
|
|
79
|
+
await tap('#stSz [data-st="size|half"]'); await sleep(900); z = await sz();
|
|
80
|
+
ok('Z2 Half is half the window and leaves full screen', !z.full && z.on === 'Half' && Math.abs(z.w - 640) < 12 && z.saved === 'half', JSON.stringify(z));
|
|
81
|
+
ok('Z3 at Half the conversation and the Studio are two tabs', await p.evaluate(() => getComputedStyle(document.querySelector('#dTabs')).display !== 'none'));
|
|
82
|
+
await tap('#stSz [data-st="size|three-quarters"]'); await sleep(900); z = await sz();
|
|
83
|
+
ok('Z4 3/4 is three-quarters of the window', z.on === '3/4' && Math.abs(z.w - 960) < 12, JSON.stringify(z));
|
|
84
|
+
await tap('#stSz [data-st="size|normal"]'); await sleep(900); z = await sz();
|
|
85
|
+
ok('Z5 Normal is the dialog\'s own size', z.on === 'Normal' && z.w > 1000 && z.w < 1270 && !z.full, JSON.stringify(z));
|
|
86
|
+
await tap('#dExpand'); await sleep(300); z = await sz();
|
|
87
|
+
ok('Z6 the full-screen button of the dialog moves the size to Whole', z.on === 'Whole' && z.full, JSON.stringify(z));
|
|
88
|
+
await tap('#stSz [data-st="size|half"]'); await sleep(300);
|
|
89
|
+
await shut(); await open('#pdNew'); z = await sz();
|
|
90
|
+
ok('Z7 the size is kept for the next time', z.on === 'Half' && !z.full, JSON.stringify(z));
|
|
91
|
+
await tap('#stSz [data-st="size|whole"]'); await sleep(300);
|
|
92
|
+
|
|
75
93
|
/* C: the conversation */
|
|
76
94
|
let a = await say('add Partner activation and Time to first call');
|
|
77
95
|
ok('C1 "add" names the measures it added and draws them', /^Done: added Partner activation, added Time to first call/.test(a) && (await tiles()).join() === 'Partner activation,Time to first call', a);
|
|
@@ -10,7 +10,9 @@ import { $, $$, esc, openDlg, closeDlg, setMode, toast, loadThread, onScroll, wi
|
|
|
10
10
|
import { barHtml, onBar, closeMenu } from './premium-acts.js';
|
|
11
11
|
|
|
12
12
|
let M = null; // the model
|
|
13
|
-
let taskView = 'list';
|
|
13
|
+
let taskView = 'list', taskPage = 0;
|
|
14
|
+
const PAGE = 10, COL = 6; // rows in a page of the List and the Timeline; cards in a By stage column before Show more
|
|
15
|
+
const colMore = new Set();
|
|
14
16
|
const DAY = 86400000;
|
|
15
17
|
let docFilter = 'all', docQuery = '';
|
|
16
18
|
let readTimer = null;
|
|
@@ -41,13 +43,10 @@ function overviewHtml() {
|
|
|
41
43
|
else if (o.none) todo = `<div class="todo"><span class="tdw">Nothing is waiting</span><p>${esc(o.why)}</p></div>`;
|
|
42
44
|
else todo = `<div class="todo ${o.tone || ''}"><span class="tdw">${esc(o.who)}</span><b>${esc(o.h)}</b>${o.p ? `<p>${esc(o.p)}</p>` : ''}${o.more ? `<small>${esc(o.more)}</small>` : ''}${o.skip ? `<small class="tdk">If you wait: ${esc(o.skip)}</small>` : ''}</div>`;
|
|
43
45
|
const help = M.help.length ? `<div class="agr2"><span class="label">PMOS can help</span><div>${M.help.map((h, n) => `<button class="agc" data-help="${n}">${AI}${esc(h.label)}</button>`).join('')}</div><small>You press, PMOS proposes, you decide. Nothing changes until you accept.</small></div>` : '';
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (!M.checks.length) return '';
|
|
49
|
-
const all = M.allSteps.length ? `<details class="src"><summary>All ${M.allSteps.length} workflow steps</summary><div class="ckl">${M.allSteps.map((c) => `<div class="ckr"><i></i><b>${esc(c.label)}</b><span>${esc(c.stateLabel)}</span><small>${esc(c.note)}</small></div>`).join('')}</div></details>` : '';
|
|
50
|
-
return `<section class="card rise" style="--d:4" id="cIniChk" aria-labelledby="hChk"><div class="ch"><span class="ic">${ICO('<path d="M5 12l5 5L20 7"/>')}</span><h2 id="hChk">Checks</h2><small>from the workflow engine</small></div><div class="ckl">${M.checks.map((c) => `<div class="ckr ${esc(c.state)}${c.cur ? ' cur' : ''}"><i></i><b>${esc(c.label)}</b><span>${esc(c.stateLabel)}</span>${c.owed ? `<small>${esc(c.owed)}</small>` : ''}</div>`).join('')}</div>${all}</section>`;
|
|
46
|
+
const blocked = M.checks.filter((c) => c.state === 'blocked').map((c) => `${c.label} is blocked${c.owed ? ': ' + c.owed : '.'}`);
|
|
47
|
+
const notes = blocked.concat(M.health, M.warnings).map((t) => `<p class="note" style="margin:10px 0 0">${esc(t)}</p>`).join('');
|
|
48
|
+
const steps = M.allSteps.length ? `<details class="src"><summary>All ${M.allSteps.length} workflow steps</summary><div class="ckl">${M.allSteps.map((c) => `<div class="ckr"><i></i><b>${esc(c.label)}</b><span>${esc(c.stateLabel)}</span><small>${esc(c.note)}</small></div>`).join('')}</div></details>` : '';
|
|
49
|
+
return `<section class="card rise ifull" style="--d:3" id="cIniOv" aria-labelledby="hOv"><div class="ch"><span class="ic">${ICO('<path d="M4 6h16M4 12h16M4 18h10"/>')}</span><h2 id="hOv">Overview</h2><small>from the repository</small></div>${M.desc ? `<p class="lede" style="margin:0 0 14px">${esc(M.desc)}</p>` : ''}${todo}${help}${notes}${steps}</section>`;
|
|
51
50
|
}
|
|
52
51
|
/* the bar's presses (pm/premium-acts.js): the page's context and the initiative as a row */
|
|
53
52
|
const actCtx = () => ({ ws: M.board.ws, board: M.board.id, boardName: M.board.name, self: !!M.acts.self, first: M.acts.stages[0] || '', reload: load });
|
|
@@ -71,11 +70,19 @@ const dateText = (t) => (t.state === 'Done' ? '' : t.end ? (over(t) ? 'Overdue
|
|
|
71
70
|
function taskRow(t) {
|
|
72
71
|
return `<button class="tkq${over(t) ? ' ov' : ''}" data-task="${esc(t.key)}" aria-haspopup="dialog"><span class="tki ${taskKind(t)}">${ICO(TKI[taskKind(t)])}</span><span class="tkn"><b>${esc(t.title)}</b><small>${esc([t.ref, t.src, t.owner].filter(Boolean).join(' · '))}</small></span><span class="tkw">${esc(dateText(t))}</span><small class="tkp ${TONE[t.state] || 'mut'}">${esc(taskState(t))}</small></button>`;
|
|
73
72
|
}
|
|
73
|
+
const pages = () => Math.max(1, Math.ceil(M.tasks.rows.length / PAGE));
|
|
74
|
+
const pageRows = () => { taskPage = Math.min(taskPage, pages() - 1); return M.tasks.rows.slice(taskPage * PAGE, taskPage * PAGE + PAGE); };
|
|
75
|
+
/** Previous and Next under the List and the Timeline; nothing when every task fits one page. */
|
|
76
|
+
function pager() {
|
|
77
|
+
const n = M.tasks.rows.length; if (n <= PAGE) return '';
|
|
78
|
+
const a = taskPage * PAGE + 1, z = Math.min(n, a + PAGE - 1);
|
|
79
|
+
return `<nav class="tkpg" aria-label="Task pages"><small>${a}–${z} of ${n}</small><span><button class="dmcta alt" data-tkpg="-1"${taskPage === 0 ? ' disabled' : ''}>Previous</button><small>Page ${taskPage + 1} of ${pages()}</small><button class="dmcta alt" data-tkpg="1"${taskPage >= pages() - 1 ? ' disabled' : ''}>Next</button></span></nav>`;
|
|
80
|
+
}
|
|
74
81
|
function tasksTimeline() {
|
|
75
|
-
const
|
|
82
|
+
const ALL = M.tasks.rows.filter((t) => t.start && t.end), T = pageRows(), D = T.filter((t) => t.start && t.end).sort((a, b) => dayOf(a.start) - dayOf(b.start)), U = T.filter((t) => !(t.start && t.end));
|
|
76
83
|
const und = U.length ? `<div class="tkund"><span class="label">No dates set <em>${U.length}</em></span><div>${U.map((t) => `<button class="tkch" data-task="${esc(t.key)}"><b>${esc(t.title)}</b><small class="tkp ${TONE[t.state] || 'mut'}">${esc(taskState(t))}</small></button>`).join('')}</div></div>` : '';
|
|
77
84
|
if (!D.length) return `<p class="empty3" style="color:var(--ink-2);margin:6px 0 10px">${U.length ? 'No task has a start and a due date, so there is nothing to draw.' : 'No tasks yet.'} The repository records no dates for PRD requirements.</p>${und}`;
|
|
78
|
-
const T0 = +today(), lo = Math.min(...
|
|
85
|
+
const T0 = +today(), lo = Math.min(...ALL.map((t) => +dayOf(t.start)), T0 - 5 * DAY), hi = Math.max(...ALL.map((t) => +dayOf(t.end)), T0 + 14 * DAY);
|
|
79
86
|
const a = new Date(lo), from = new Date(a.getFullYear(), a.getMonth(), 1), z = new Date(hi), to = new Date(z.getFullYear(), z.getMonth() + 1, 0), span = to - from, X = (d) => ((d - from) / span * 100);
|
|
80
87
|
const ticks = []; for (let d = new Date(from); d <= to; d = new Date(d.getFullYear(), d.getMonth() + 1, 1)) ticks.push(d);
|
|
81
88
|
const tx = X(T0);
|
|
@@ -94,10 +101,10 @@ function tasksBody() {
|
|
|
94
101
|
const cols = ['To do', 'In progress', 'On hold', 'Done'].map((s) => [s, T.rows.filter((t) => (t.state === 'In review' ? 'In progress' : t.state) === s)]);
|
|
95
102
|
const none = T.rows.filter((t) => !t.state);
|
|
96
103
|
const all = cols.concat(none.length ? [['No result recorded', none]] : []);
|
|
97
|
-
return `<div class="istg tkkb" style="grid-template-columns:repeat(${all.length},minmax(0,1fr))">${all.map(([s, L]) => `<div class="isc"><p class="label">${esc(s)} <em>${L.length}</em></p>${L.map((t) => `<button class="icd tkc${over(t) ? ' ov' : ''}" data-task="${esc(t.key)}" aria-haspopup="dialog"><b>${esc(t.title)}</b><small>${esc([t.ref, t.src].filter(Boolean).join(' · '))}</small>${t.state === 'In review' || dateText(t) ? `<span class="tkcm">${t.state === 'In review' ? '<small class="tkp wip">In review</small>' : '<span></span>'}<small>${esc(dateText(t))}</small></span>` : ''}</button>`).join('') || '<p class="mut">None</p>'}</div>`).join('')}</div>`;
|
|
104
|
+
return `<div class="istg tkkb" style="grid-template-columns:repeat(${all.length},minmax(0,1fr))">${all.map(([s, L]) => `<div class="isc"><p class="label">${esc(s)} <em>${L.length}</em></p>${(colMore.has(s) ? L : L.slice(0, COL)).map((t) => `<button class="icd tkc${over(t) ? ' ov' : ''}" data-task="${esc(t.key)}" aria-haspopup="dialog"><b>${esc(t.title)}</b><small>${esc([t.ref, t.src].filter(Boolean).join(' · '))}</small>${t.state === 'In review' || dateText(t) ? `<span class="tkcm">${t.state === 'In review' ? '<small class="tkp wip">In review</small>' : '<span></span>'}<small>${esc(dateText(t))}</small></span>` : ''}</button>`).join('') || '<p class="mut">None</p>'}${L.length > COL && !colMore.has(s) ? `<button class="dlink" data-tkmore="${esc(s)}">Show ${L.length - COL} more</button>` : ''}</div>`).join('')}</div>`;
|
|
98
105
|
}
|
|
99
|
-
if (taskView === 'time') return tasksTimeline();
|
|
100
|
-
return `<div class="tkl" role="list">${
|
|
106
|
+
if (taskView === 'time') return tasksTimeline() + pager();
|
|
107
|
+
return `<div class="tkl" role="list">${pageRows().map(taskRow).join('')}</div>` + pager();
|
|
101
108
|
}
|
|
102
109
|
function tasksHtml() {
|
|
103
110
|
const T = M.tasks;
|
|
@@ -109,13 +116,15 @@ function tasksHtml() {
|
|
|
109
116
|
}
|
|
110
117
|
$('#iMain').addEventListener('click', (e) => {
|
|
111
118
|
const v = e.target.closest('#tkTabs [data-v]'); if (v) { taskView = v.dataset.v; $('#tkBody').innerHTML = tasksBody(); $$('#tkTabs button').forEach((b) => b.setAttribute('aria-pressed', b.dataset.v === taskView)); pillOf($('#tkTabs')); return; }
|
|
119
|
+
const pg = e.target.closest('[data-tkpg]'); if (pg && !pg.disabled) { taskPage = Math.max(0, Math.min(pages() - 1, taskPage + +pg.dataset.tkpg)); $('#tkBody').innerHTML = tasksBody(); $('#cIniTk').scrollIntoView({ block: 'nearest' }); return; }
|
|
120
|
+
const mo = e.target.closest('[data-tkmore]'); if (mo) { colMore.add(mo.dataset.tkmore); $('#tkBody').innerHTML = tasksBody(); return; }
|
|
112
121
|
if (e.target.closest('[data-tkadd]')) { openAddTask(); return; }
|
|
113
122
|
if (e.target.closest('[data-adddoc]')) { openAddDoc({ ws: M.board.ws, scope: M.docs.scope, sub: M.title, onAdded: async () => { await load(); const b = $('[data-adddoc]'); if (b) b.focus(); } }); return; }
|
|
114
123
|
const t = e.target.closest('[data-task]'); if (t) { openTask(M.tasks.rows.find((x) => x.key === t.dataset.task)); return; }
|
|
115
124
|
const f = e.target.closest('[data-dmf]'); if (f) { docFilter = f.dataset.dmf; drawDocList(); return; }
|
|
116
125
|
const d = e.target.closest('[data-draft]'); if (d && !d.disabled) { draft(d); return; }
|
|
117
126
|
const all = e.target.closest('[data-draftall]'); if (all && !all.disabled) { draftAll(all); return; }
|
|
118
|
-
const o = e.target.closest('[data-doc]'); if (o) {
|
|
127
|
+
const o = e.target.closest('[data-doc]'); if (o) { const d = M.docs.rows.find((x) => x.key === o.dataset.doc); if (d && d.path) docSheet.open(d); else openAbout(d); }
|
|
119
128
|
});
|
|
120
129
|
const STATES = ['To do', 'In progress', 'In review', 'Done'];
|
|
121
130
|
function openTask(t) {
|
|
@@ -162,7 +171,7 @@ function openAddTask() {
|
|
|
162
171
|
function docRow(d) {
|
|
163
172
|
const act = d.act && d.act.kind === 'draft' ? `<button class="dmcta alt" data-draft="${esc(d.key)}"${d.running ? ' disabled' : ''}>${d.running ? '<span class="spin"></span>' : ICO(SPARK)}${esc(d.act.label)}</button>` : d.path ? `<button class="dmcta alt" data-doc="${esc(d.key)}">Read</button>` : '';
|
|
164
173
|
const inner = `<span class="dmi c-${esc(d.cat || 'Board')}">${ICO(DOCI)}</span><span class="dmn"><b>${esc(d.title)}</b><small>${esc(d.what)}</small><span class="dmm"><span class="s ${esc(d.st || 'live')}">${ICO(STATE_ICO[d.state] || STATE_ICO['Not started'])}${esc(d.state)}</span>${d.when ? `<span>${ICO('<rect x="3" y="5" width="18" height="16" rx="3"/><path d="M3 10h18M8 3v4M16 3v4"/>')}updated ${esc(d.when)}</span>` : ''}${d.added ? `<span>${ICO('<rect x="3" y="5" width="18" height="16" rx="3"/><path d="M3 10h18M8 3v4M16 3v4"/>')}added ${esc(d.added)}</span>` : ''}${d.by ? `<span>${ICO('<circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0 1 16 0"/>')}${esc(d.by)}</span>` : ''}</span></span>`;
|
|
165
|
-
return `<div class="dmr ${esc(d.st || '')}" role="listitem"
|
|
174
|
+
return `<div class="dmr ${esc(d.st || '')}" role="listitem"><button class="dmo" data-doc="${esc(d.key)}" aria-haspopup="dialog">${inner}</button><span class="dmq">${act}</span></div>`;
|
|
166
175
|
}
|
|
167
176
|
const matches = (d) => (docFilter === 'all' || (docFilter === 'none' ? d.st === 'missing' : docFilter === 'draft' ? d.st === 'draft' : (d.st === 'ok' || d.st === 'live'))) && (!docQuery.trim() || (d.title + ' ' + d.what).toLowerCase().includes(docQuery.trim().toLowerCase()));
|
|
168
177
|
function drawDocList() {
|
|
@@ -220,6 +229,19 @@ function openAsk(q) {
|
|
|
220
229
|
}
|
|
221
230
|
|
|
222
231
|
/* ── the document sheet: Read, Edit, Proposals, Edit log, Health. ─────────────────────────────────────────────── */
|
|
232
|
+
/** A row with no file to read (not started, derived or live): what the document is for, who writes it and what a draft would hold, with Draft it where a draft can run. */
|
|
233
|
+
function openAbout(d) {
|
|
234
|
+
if (!d) return;
|
|
235
|
+
const draftable = d.act && d.act.kind === 'draft' && !d.running;
|
|
236
|
+
const say = d.title + ' is ' + (d.state || 'not started').toLowerCase() + '. ' + (d.path ? '' : d.st === 'missing' ? 'There is no file to read yet.' : 'It has no file of its own to read.') + (d.what ? ' ' + d.what : '');
|
|
237
|
+
const rows = [['State', d.state], ['Who writes it', d.by], ['Read by', d.reader], ['How often', d.cadence], ['Updated', d.when], ['Added', d.added]];
|
|
238
|
+
const holds = d.sections && d.sections.length ? `<p class="label" style="margin:16px 0 8px">What a draft will contain</p><ul class="dabt">${d.sections.map((x) => `<li>${esc(x)}</li>`).join('')}</ul>` : '';
|
|
239
|
+
const why = d.st === 'missing' ? (draftable ? 'Draft it starts a read-only agent run that writes a draft for you to read. Nothing is sent.' : d.act ? '' : 'PMOS does not draft this one. It is written by ' + (d.by ? d.by.toLowerCase() : 'you') + ', or derived from other records.') : d.path ? '' : 'There is no file to open yet, so there is nothing to read here.';
|
|
240
|
+
const act = draftable ? `<div class="cact"><button class="cta" id="abDraft">${ICO(SPARK)}${esc(d.act.label)}</button></div>` : d.running ? '<p class="note" role="status" style="margin-top:12px">The agent is drafting this now. It runs in the background and sends nothing.</p>' : '';
|
|
241
|
+
openDlg({ eye: 'Document · real data', title: d.title, sub: M.title, say, stream: turnA(ptx(say)), noteKey: null, pane: `<article class="paper doc">${d.what ? `<p class="lede" style="margin:0 0 12px">${esc(d.what)}</p>` : ''}${kv(rows)}${holds}${why ? `<p class="note" style="margin-top:12px">${esc(why)}</p>` : ''}${act}</article>`, label: 'Document' });
|
|
242
|
+
$('#askF').hidden = true;
|
|
243
|
+
const b = $('#abDraft'); if (b) b.onclick = async () => { b.disabled = true; closeDlg(); await draftKey(d.key); };
|
|
244
|
+
}
|
|
223
245
|
$('#dBody').addEventListener('click', (e) => { const lt = e.target.closest('#logT'); if (lt) { const c = $('#alog').classList.toggle('col'); lt.setAttribute('aria-expanded', !c); } });
|
|
224
246
|
|
|
225
247
|
/* ── load: the routes derive the initiatives in the background, so the first answers are "reading" ────────── */
|
|
@@ -238,7 +260,7 @@ function draw() {
|
|
|
238
260
|
$('#snap').title = 'Every figure on this page comes from a record. A date, owner or progress shows only when one was set.';
|
|
239
261
|
const keepQ = $('#dmQ') && document.activeElement === $('#dmQ');
|
|
240
262
|
closeMenu();
|
|
241
|
-
$('#iMain').innerHTML = headHtml() + (M.acts ? `<div id="iBar">${barHtml(actCtx(), actRow())}</div>` : '') +
|
|
263
|
+
$('#iMain').innerHTML = headHtml() + (M.acts ? `<div id="iBar">${barHtml(actCtx(), actRow())}</div>` : '') + `${overviewHtml()}` + tasksHtml() + docsHtml();
|
|
242
264
|
if ($('#dmList')) drawDocList();
|
|
243
265
|
if (keepQ) { const q = $('#dmQ'); q.focus(); q.setSelectionRange(q.value.length, q.value.length); }
|
|
244
266
|
pillOf($('#tkTabs'));
|
|
@@ -18,6 +18,21 @@ const UPI = ICO('<path d="M12 19V5M6 11l6-6 6 6"/>'), DNI = ICO('<path d="M12 5v
|
|
|
18
18
|
const OKI = ICO('<path d="M5 12.5l4.5 4.5L19 7.5"/>'), WRN = ICO('<path d="M12 4 2.5 20h19z"/><path d="M12 10v4M12 17v.5"/>'), CHV = ICO('<path d="M6 9l6 6 6-6"/>');
|
|
19
19
|
const DSI = ICO('<rect x="3" y="3" width="8" height="8" rx="2"/><rect x="13" y="3" width="8" height="8" rx="2"/><rect x="3" y="13" width="8" height="8" rx="2"/><rect x="13" y="13" width="8" height="8" rx="2"/>');
|
|
20
20
|
const MAX_UNDO = 30;
|
|
21
|
+
/* The Studio's size, as the console's Design studio has it, plus Normal (the dialog's own size). Whole is the dialog's full screen. Kept on this browser. */
|
|
22
|
+
const SIZE_KEY = 'pmos.premium.studio-size';
|
|
23
|
+
const SIZES = [['normal', 'Normal', 'The usual size'], ['half', 'Half', 'Half of the window'], ['three-quarters', '3/4', 'Three-quarters of the window'], ['whole', 'Whole', 'The whole window']];
|
|
24
|
+
const sizeOk = (v) => SIZES.some((x) => x[0] === v);
|
|
25
|
+
const sizeGet = () => { try { const v = localStorage.getItem(SIZE_KEY); return sizeOk(v) ? v : 'whole'; } catch { return 'whole'; } };
|
|
26
|
+
const sizeSet = (v) => { try { localStorage.setItem(SIZE_KEY, v); } catch { /* no storage */ } };
|
|
27
|
+
const sizeNow = () => { const d = $('#dlg'); return d.classList.contains('full') ? 'whole' : d.classList.contains('sz-half') ? 'half' : d.classList.contains('sz-three-quarters') ? 'three-quarters' : 'normal'; };
|
|
28
|
+
const sizeHtml = () => `<span class="stsz" role="group" aria-label="Size of the Studio">${SIZES.map(([k, l, t]) => `<button type="button" class="lk" data-st="size|${k}" aria-pressed="${sizeNow() === k}" title="${t}" aria-label="${t}">${l}</button>`).join('')}</span>`;
|
|
29
|
+
function setSize(k) {
|
|
30
|
+
const d = $('#dlg'); d.classList.remove('sz-half', 'sz-three-quarters');
|
|
31
|
+
setFull(k === 'whole');
|
|
32
|
+
if (k === 'half' || k === 'three-quarters') d.classList.add('sz-' + k);
|
|
33
|
+
sizeSet(k); syncSize();
|
|
34
|
+
}
|
|
35
|
+
function syncSize() { const e = $('#stSz'); if (e) e.innerHTML = sizeHtml(); }
|
|
21
36
|
const MODES = { chart: 'Chart', dash: 'Dashboard', rep: 'Report' };
|
|
22
37
|
const FORMN = { line: 'Line', bars: 'Bars', number: 'Number', meter: 'Meter' };
|
|
23
38
|
const FORMD = { line: 'How it moves over time. The default for a trend.', bars: 'One reading against another. Bars start at zero.', number: 'One current value, with its change and a small line.', meter: 'How far it is from its target or limit.' };
|
|
@@ -183,7 +198,7 @@ function guide() {
|
|
|
183
198
|
}
|
|
184
199
|
const modesHtml = () => `<div class="stmd" role="group" aria-label="What to make">${Object.keys(MODES).map((k) => `<button type="button" data-st="mode|${k}" aria-pressed="${st.mode === k}">${MODES[k]}</button>`).join('')}</div>`;
|
|
185
200
|
function canvasHtml() {
|
|
186
|
-
return `<div class="stu"><div class="stt"><span id="stMd">${modesHtml()}</span><span class="stx"><button type="button" class="lk" data-st="lib" aria-expanded="${st.lib}">Library</button></span></div><p class="stsug" id="stG">${guide()}</p><div id="stBr">${briefHtml()}</div><div id="stTr">${trayHtml()}</div><div id="stLb">${libHtml()}</div><div id="stPv">${previewHtml()}</div><div id="stCk">${checksHtml()}</div><p class="note stmsg" id="stMsg" role="status"></p><div id="stFt">${footHtml()}</div></div>`;
|
|
201
|
+
return `<div class="stu"><div class="stt"><span id="stMd">${modesHtml()}</span><span class="stx"><span id="stSz">${sizeHtml()}</span><button type="button" class="lk" data-st="lib" aria-expanded="${st.lib}">Library</button></span></div><p class="stsug" id="stG">${guide()}</p><div id="stBr">${briefHtml()}</div><div id="stTr">${trayHtml()}</div><div id="stLb">${libHtml()}</div><div id="stPv">${previewHtml()}</div><div id="stCk">${checksHtml()}</div><p class="note stmsg" id="stMsg" role="status"></p><div id="stFt">${footHtml()}</div></div>`;
|
|
187
202
|
}
|
|
188
203
|
function draw(parts) {
|
|
189
204
|
const all = !parts, set = (id, h) => { const e = $('#' + id); if (e) e.innerHTML = h; };
|
|
@@ -216,6 +231,7 @@ function act(a) {
|
|
|
216
231
|
if (k === 'mode') { if (st.mode !== x) { st.mode = x; st.pop = null; st.ck = false; if (x === 'rep' && !st.r) st.r = REP.blankReport(); draw(); } return; }
|
|
217
232
|
if (k === 'chip') { st.pop = st.pop === x ? null : x; draw(['br', 'tr', 'ft']); const i = $('#stI'); if (i) { i.focus(); try { i.setSelectionRange(i.value.length, i.value.length); } catch { /* no caret */ } } return; }
|
|
218
233
|
if (k === 'more') { st.more = !st.more; if (!st.more && /^(title|better|note|addTo)$/.test(st.pop || '')) st.pop = null; draw(['br', 'tr']); return; }
|
|
234
|
+
if (k === 'size') { setSize(x); return; }
|
|
219
235
|
if (k === 'lib') { st.lib = !st.lib; draw(['lb', 'tr', 'ft']); return; }
|
|
220
236
|
if (k === 'ck') { st.ck = !st.ck; draw(['ck']); return; }
|
|
221
237
|
if (k === 'fix') { const f = checks()[+x]; if (f && f.fix) act(f.fix[1].split('|')); return; }
|
|
@@ -414,7 +430,7 @@ export function openStudio(p) {
|
|
|
414
430
|
$('#askF').hidden = true; const an = $('#askNote'); if (an) an.hidden = true;
|
|
415
431
|
$('#dBody').insertAdjacentHTML('beforeend', `<form class="askbar" id="stF"><input id="stIn" placeholder="Say what to change" maxlength="400" autocomplete="off" aria-label="Say what to change"><button type="submit" aria-label="Send" title="Send">${ICO('<path d="M5 12h14M13 6l6 6-6 6"/>')}</button></form><p class="fine2" id="stHelp"></p>`);
|
|
416
432
|
$('#stF').onsubmit = onSay;
|
|
417
|
-
if (innerWidth >= 1000)
|
|
433
|
+
if (innerWidth >= 1000) setSize(sizeGet()); else syncSize();
|
|
418
434
|
draw();
|
|
419
435
|
}
|
|
420
436
|
REP.useStudio({ get st() { return st; }, get P() { return P; }, chip: (k, l, v) => chip(k, l, v), opt: (...a) => opt(...a), field: (...a) => field(...a), draw: (x) => draw(x), snap: () => snap(),
|
|
@@ -426,4 +442,4 @@ document.addEventListener('input', (e) => { if (inStudio(e)) onInput(e); });
|
|
|
426
442
|
document.addEventListener('focusout', (e) => { if (e.target && e.target.id === 'stI') typed = false; });
|
|
427
443
|
document.addEventListener('keydown', (e) => { if (e.key === 'Enter' && e.target.id === 'stI' && inStudio(e)) { e.preventDefault(); st.pop = null; typed = false; draw(['br', 'tr']); } });
|
|
428
444
|
/* Another dialog of the page opens without the Studio's class. */
|
|
429
|
-
new MutationObserver(() => { const d = $('#dlg'); if (d
|
|
445
|
+
new MutationObserver(() => { const d = $('#dlg'); if (!d) return; if (!d.classList.contains('on') && d.classList.contains('stud')) d.classList.remove('stud', 'sz-half', 'sz-three-quarters'); else if (d.classList.contains('stud')) syncSize(); }).observe($('#dlg'), { attributes: true, attributeFilter: ['class'] });
|
|
@@ -1796,6 +1796,11 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
1796
1796
|
.phstats b{font-size:var(--t-lead,20px);font-weight:700;color:var(--ink)}
|
|
1797
1797
|
.phstats span{font-size:var(--t-small);color:var(--ink-3)}
|
|
1798
1798
|
}
|
|
1799
|
+
/* initiative page: Tasks paging and the about-popup of a document with no file */
|
|
1800
|
+
.tkpg{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:12px}.tkpg>span{display:flex;align-items:center;gap:10px}.tkpg small{color:var(--ink-2)}
|
|
1801
|
+
.tkpg .dmcta:disabled{opacity:.45;cursor:default}
|
|
1802
|
+
.tkkb .dlink{margin-top:6px}
|
|
1803
|
+
.dabt{margin:0;padding-left:18px;display:grid;gap:6px;color:var(--ink-2)}
|
|
1799
1804
|
|
|
1800
1805
|
/* My work: per-row suggestion and press, and the This week card */
|
|
1801
1806
|
.wrow.hc .wcta{grid-column:2;justify-self:start;margin-bottom:10px}
|
|
@@ -1926,3 +1931,15 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
1926
1931
|
.dscr .lk{justify-self:start;min-height:44px;display:inline-flex;align-items:center}
|
|
1927
1932
|
.lgdf{margin-top:6px;white-space:pre-wrap;overflow-wrap:anywhere}.lgdf del{color:var(--bad);text-decoration:line-through}
|
|
1928
1933
|
.evl .hsr .lk{grid-column:2;justify-self:start;min-height:44px;display:inline-flex;align-items:center}.evl .hsr .dsdf{grid-column:2}
|
|
1934
|
+
|
|
1935
|
+
/* The Studio's size (Normal, Half, 3/4, Whole). Whole is .full. Half is the Studio's two parts as tabs, as on a narrow window. Not shown on a phone. */
|
|
1936
|
+
.stsz{display:none;gap:2px}
|
|
1937
|
+
@media (min-width:1000px){.stsz{display:inline-flex}}
|
|
1938
|
+
.stsz .lk[aria-pressed="true"]{background:var(--well);border-radius:999px;font-weight:700;color:var(--ink)}
|
|
1939
|
+
@media (min-width:1000px){
|
|
1940
|
+
.dlg.stud.sz-half:not(.full){width:50vw;min-width:560px;height:min(90vh,860px)}
|
|
1941
|
+
.dlg.stud.sz-three-quarters:not(.full){width:75vw;height:min(90vh,860px)}
|
|
1942
|
+
.dlg.stud.sz-half[data-mode="split"] #dTabs{display:flex}
|
|
1943
|
+
.dlg.stud.sz-half[data-mode="split"] .dgrid{grid-template-columns:minmax(0,1fr)}
|
|
1944
|
+
.dlg.stud.sz-half[data-mode="split"] .dgrid[data-tab="chat"] .p-out,.dlg.stud.sz-half[data-mode="split"] .dgrid[data-tab="out"] .p-work{display:none}
|
|
1945
|
+
}
|