create-pmos 0.455.0 → 0.457.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 +105 -79
- package/payload/KIT-VERSION +2 -2
- 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/payload/state/log.md +1 -1
- package/workspace/changelog.json +270 -1841
- package/workspace/ev-everywhere-test.js +24 -1
- package/workspace/guide/initiatives-screen.md +2 -0
- package/workspace/guide/settings.md +13 -3
- package/workspace/lib/kit-update.js +1 -1
- package/workspace/lib/settings-store.js +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/cozy-ev.css +21 -4
- package/workspace/public/pm/cozy-settings.js +43 -19
- package/workspace/public/pm/ini-view.css +14 -5
- package/workspace/public/pm/ini-view.js +4 -8
- package/workspace/public/pm/premium-shell.js +24 -24
- package/workspace/public/pm/premium.css +11 -14
- package/workspace/public/pm/upd-weeks.js +56 -0
- package/workspace/stage-card-test.js +7 -0
- package/workspace/test-lists/update-weeks.json +5 -0
|
@@ -142,10 +142,33 @@ const put = (root, rel, text) => { fs.mkdirSync(path.dirname(path.join(root, rel
|
|
|
142
142
|
await until(() => pg.evaluate(() => !document.querySelector('#evSettings:not([hidden])')));
|
|
143
143
|
await menu(pg); await pg.click('#czMenu [data-cz-settings]');
|
|
144
144
|
const st = await until(() => pg.evaluate(() => { const d = document.querySelector('#evSettings:not([hidden])'); return d ? { nav: [...d.querySelectorAll('[data-ev-sec]')].map((a) => a.textContent.replace(/\d+$/, '').trim()), h: (d.querySelector('#evStTitle') || {}).textContent, t: d.textContent } : null; }));
|
|
145
|
-
ok('R2 Settings opens on General (or Connectors while a source is stale), with Connectors, Workspaces
|
|
145
|
+
ok('R2 Settings opens on General (or Connectors while a source is stale), with Connectors, Workspaces and Updates, and no What\'s new of its own', !!st && st.h === (stale ? 'Connectors' : 'General') && ['General', 'Connectors', 'Workspaces', 'Updates'].every((k) => st.nav.some((n) => n.startsWith(k))) && !st.nav.some((n) => /What/.test(n)) && (stale || /Theme/.test(st.t)), JSON.stringify(st && { nav: st.nav, h: st.h }));
|
|
146
146
|
await snap(pg, 'settings-1440-light');
|
|
147
147
|
await pg.click('#evSettings [data-ev-sec="workspaces"]');
|
|
148
148
|
ok('R2 Workspaces lists the product', !!(await until(() => pg.evaluate(() => /EVPROD/.test(document.querySelector('#evSettings').textContent)))));
|
|
149
|
+
/* W2: Settings › Updates checks on open, shows what's new by week, and installs without a second question (stubbed kit routes; nothing reaches npm) */
|
|
150
|
+
const hits = { check: 0, update: 0, upgrade: 0 };
|
|
151
|
+
const day = (n) => new Date(Date.now() - n * 864e5).toISOString();
|
|
152
|
+
await pg.route('**/api/kit/status*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, app: { version: '0.442.0' }, kit: { present: true, version: '0.442.0' }, latest: '0.451.0', appBehind: true, kitBehind: true, checkDaily: true,
|
|
153
|
+
changes: [{ v: '0.451.0', at: day(0), prs: [{ n: 1098, t: 'Claude settings', s: 'Settings has a Claude section.', k: 'new' }, { n: 1100, t: 'Hide linked worktrees', s: 'They no longer show as repositories.', k: 'fix' }] }, { v: '0.441.0', at: day(8), prs: [{ n: 1078, t: 'Ready-made dashboards', s: 'Every program has one.', k: 'new' }] }] }) }));
|
|
154
|
+
await pg.route('**/api/kit/check', (r) => { hits.check++; r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, latest: '0.451.0', appBehind: true, kitBehind: true, latestChanges: [] }) }); });
|
|
155
|
+
await pg.route('**/api/kit/update', (r) => { hits.update++; r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true }) }); });
|
|
156
|
+
await pg.route('**/api/kit/upgrade-app', (r) => { hits.upgrade++; r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'stubbed: not installing' }) }); });
|
|
157
|
+
await pg.keyboard.press('Escape'); await until(() => pg.evaluate(() => !document.querySelector('#evSettings:not([hidden])')));
|
|
158
|
+
await menu(pg); await pg.click('#czMenu [data-cz-settings]'); await pg.waitForSelector('#evSettings:not([hidden])'); // reopen: the routes above answer the status read
|
|
159
|
+
await pg.click('#evSettings [data-ev-sec="updates"]');
|
|
160
|
+
const wk = await until(() => pg.evaluate(() => { const d = document.querySelector('#evSettings'); const h = d.querySelector('.ev-wkh'); return h ? { head: h.textContent, groups: [...d.querySelectorAll('.ev-wk > .ev-wkm .ev-wgl')].map((x) => x.textContent), t: d.querySelector('.ev-wk > .ev-wkm').textContent, arc: !!d.querySelector('[data-ev-arc][aria-expanded="false"]'), rows: d.querySelectorAll('[data-ev-wk]').length } : null; }), 20000);
|
|
161
|
+
const first = await (async () => { await sleep(800); return hits.check; })();
|
|
162
|
+
await pg.click('#evSettings [data-ev-sec="general"]'); await pg.click('#evSettings [data-ev-sec="updates"]'); await sleep(500);
|
|
163
|
+
ok('W2 opening Updates asks for the latest kit by itself (one read for each workspace), and only once while Settings stays open', first >= 1 && hits.check === first, JSON.stringify(hits));
|
|
164
|
+
ok('W2 what\'s new shows this week open: New and Fixed groups, no empty Improved group, the earlier week folded in a closed Archive', !!wk && /^This week/.test(wk.head) && wk.groups.join() === 'New,Fixed' && /Claude settings\./.test(wk.t) && /#1100/.test(wk.t) && wk.arc && wk.rows === 0, JSON.stringify(wk));
|
|
165
|
+
await pg.click('#evSettings [data-ev-arc]'); await pg.click('#evSettings [data-ev-wk]');
|
|
166
|
+
ok('W2 the Archive opens to the earlier weeks, and a week opens on press', !!(await until(() => pg.evaluate(() => /Ready-made dashboards\./.test(document.querySelector('#evSettings').textContent)))));
|
|
167
|
+
await snap(pg, 'updates-1440-light');
|
|
168
|
+
await pg.click('#evSettings [data-ev-upd="update"]');
|
|
169
|
+
await until(() => hits.upgrade > 0, 8000);
|
|
170
|
+
ok('W2 Update installs at once: the kit and the app are posted with no Restart and update step', hits.update >= 1 && hits.upgrade === 1 && !(await pg.evaluate(() => /Restart and update/.test(document.querySelector('#evSettings').textContent))), JSON.stringify(hits));
|
|
171
|
+
await pg.unroute('**/api/kit/status*'); await pg.unroute('**/api/kit/check'); await pg.unroute('**/api/kit/update'); await pg.unroute('**/api/kit/upgrade-app');
|
|
149
172
|
await pg.keyboard.press('Escape');
|
|
150
173
|
ok('R2 Escape closes Settings', !!(await until(() => pg.evaluate(() => !document.querySelector('#evSettings:not([hidden])')))));
|
|
151
174
|
|
|
@@ -11,6 +11,8 @@ The Initiatives place shows every initiative of the selected repository. Each in
|
|
|
11
11
|
|
|
12
12
|
Press **Roadmap** or **List** at the top to change the view. The workspace keeps your choice in this browser.
|
|
13
13
|
|
|
14
|
+
An open initiative uses one column. On a wide screen, a compact mission summary shows the current stage, dates and next-stage action above the milestones. Tasks fills the width below and scrolls with the page. On a narrow screen, tap the mission picture to see its dates and milestones.
|
|
15
|
+
|
|
14
16
|
### Scan repository
|
|
15
17
|
|
|
16
18
|
The workspace reads the stage, the files and the breakdown of each initiative from the repository. It reads them again when an initiative record changes, and at the latest after ten minutes. A change that does not touch a record, for example a new PRD or a pull request merged on the trunk, can show late.
|
|
@@ -36,7 +36,7 @@ Settings is not a tab. While it is open, no tab is selected. Press a tab to go b
|
|
|
36
36
|
| Privacy and data | A list of what leaves this computer and when. Whether a TypeSafe key is saved, the local model that answers when there is no key (Off, Winnow or Laya), and the data folder. |
|
|
37
37
|
| Appearance | The theme (Same as system, Light or Dark) and the page that opens first. |
|
|
38
38
|
| Claude | The Claude profile that new Claude sessions start with, and the Anthropic API key for Claude's own runs on the API (see below). |
|
|
39
|
-
| Updates | The version of the app and of each workspace's kit
|
|
39
|
+
| Updates | The version of the app and of each workspace's kit, the check for updates, and what changed in each week's kits (what's new). See below. |
|
|
40
40
|
|
|
41
41
|
Type in **Search settings** to find a setting in any section. Press **Open section** to go to its section.
|
|
42
42
|
|
|
@@ -58,12 +58,22 @@ Some rows show a feature that PMOS does not have yet, such as choosing calendars
|
|
|
58
58
|
|
|
59
59
|
## Update PMOS and the kit
|
|
60
60
|
|
|
61
|
-
Open **Updates
|
|
61
|
+
Open **Updates**. PMOS asks the npm registry for the latest version at once, and the card says if a newer one is ready. **Check now** asks again. PMOS also checks once a day while a page is open. To check only when you press **Check now**, set the update check to press (the `upd.check` setting, or `PMOS_UPDATE_CHECK=press`).
|
|
62
62
|
|
|
63
|
-
- **Update to** a version on the **PMOS app** row updates the app.
|
|
63
|
+
- **Update to** a version on the **PMOS app** row updates the app. Press **Update** (or **Restart to update**) and PMOS starts at once, with no second question. PMOS stops, installs the new version, and starts again. Open terminals keep running. The page that you are on reloads when the new version starts. PMOS does not open a new tab. If the update is refused, or PMOS starts again on the old version, or PMOS does not come back, the row says so and names the update log.
|
|
64
64
|
- When PMOS runs from a PMOS checkout, the row says to update it with `git pull`. There is no Update button.
|
|
65
65
|
- **Update** on a workspace row updates the kit in that repository. It replaces the kit files in its `pmos/` folder (AGENTS.md, skills, scripts, templates, `okf/core`, the mod and KIT-VERSION). It does not change `state/`, `planning/` or `okf/product/`, and it does not commit. Review the change in the repository as a normal pull request.
|
|
66
66
|
|
|
67
|
+
### What's new
|
|
68
|
+
|
|
69
|
+
Under the update card, **Updates** shows what changed in the published kits. **This week** is open: it is the one you need. A week runs Monday to Sunday. Every earlier week, last week included, is folded into **Archive**. Press **Archive** to list the earlier weeks (**Week of** a date), each with its counts, and press a week to read it. When there is nothing for this week yet, the newest week with changes is the open one.
|
|
70
|
+
|
|
71
|
+
- Each week has up to three groups: **New** (a feature), **Improved** (a faster or better thing that already existed) and **Fixed** (a problem that is gone). A group with nothing in it is not shown, and a week with nothing to show is not listed.
|
|
72
|
+
- Each line is a bold name and one sentence, copied from the pull request that made the change, with its number at the end. Work that you cannot see in PMOS (notes, tests, run logs) is left out.
|
|
73
|
+
- A week shows **Ready to install** when one of its kits is newer than the version you run.
|
|
74
|
+
- A kit published before PMOS kept the kind of each change has no kind. Its title decides: a word such as "fix" or "no longer" puts it under **Fixed**, and anything else under **Improved**.
|
|
75
|
+
- **What's new** is not a section of its own any more. The button on the update card in **General** opens **Updates**.
|
|
76
|
+
|
|
67
77
|
## Claude: the profile and the API key
|
|
68
78
|
|
|
69
79
|
**Claude profile.** Pick one of the profiles on this computer, or **No profile**. New Claude sessions start with it. The list comes from the profile files in `~/.claude/profiles/`.
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* newer kits' entries in the same `npm view` call, so the page can say what an update brings before it runs.
|
|
31
31
|
*
|
|
32
32
|
* NETWORK. These are the workspace's only egress to the npm registry. No HTTP client is opened here: npm and npx open
|
|
33
|
-
* their own. Every call is reached only from a POST the page sends when the PM presses a button (server.js
|
|
33
|
+
* their own. Every call is reached only from a POST the page sends: when the PM presses a button, or when the PM opens Updates (unless upd.check is press) (server.js
|
|
34
34
|
* /api/kit/check, /api/kit/update, /api/kit/upgrade-app); no timer and no GET reaches them. no-network.test.js holds
|
|
35
35
|
* that.
|
|
36
36
|
*/
|
|
@@ -107,7 +107,7 @@ const DEFS = Object.freeze({
|
|
|
107
107
|
* shows; `off` is the value that turns the thing off, or null when any value wins. */
|
|
108
108
|
const ENV = Object.freeze([
|
|
109
109
|
{ key: 'notes.language', env: 'PMOS_WHISPER_LANG', off: null, effect: 'Every line is transcribed in this language, whatever the picker says.' },
|
|
110
|
-
{ key: 'upd.check', env: 'PMOS_UPDATE_CHECK', off: 'press', effect: 'Updates are checked only when you press Check on this computer.' },
|
|
110
|
+
{ key: 'upd.check', env: 'PMOS_UPDATE_CHECK', off: 'press', effect: 'Updates are checked only when you press Check now on this computer, not when you open Updates.' },
|
|
111
111
|
{ key: 'rec.echo', env: 'PMOS_NOTES_ECHO', off: 'off', effect: 'Echo removal is off on this computer.' },
|
|
112
112
|
{ key: 'rec.final', env: 'PMOS_NOTES_FINAL', off: 'off', effect: 'The pass after Stop is off on this computer.' },
|
|
113
113
|
{ key: 'notes.wispr', env: 'PMOS_NOTES_WISPR', off: 'off', effect: 'Wispr Flow notes are not fetched on this computer.' },
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.457.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.457.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -217,14 +217,30 @@
|
|
|
217
217
|
.ev-st .ev-ad { display: inline-flex; align-items: center; flex: none; }
|
|
218
218
|
.ev-st .ev-say.honest { display: flex; align-items: center; gap: 8px; }
|
|
219
219
|
.ev-st .ev-upd p { flex: 1; margin: 0; }
|
|
220
|
+
.ev-st .ev-upd.first { margin-top: 0; }
|
|
220
221
|
.ev-st .ev-sw { height: 28px; min-width: 52px; border-radius: 999px; border: 0; background: var(--cz-well2); color: var(--cz-ink3); font: inherit; font-size: var(--fs-2); font-weight: 700; cursor: pointer; }
|
|
221
222
|
.ev-st .ev-sw[aria-checked="true"] { background: var(--cz-bluebg); color: var(--cz-blueink); }
|
|
222
223
|
.ev-st .ev-add { display: flex; gap: 8px; margin-top: 8px; }
|
|
223
|
-
.ev-st .ev-kv { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
|
|
224
|
-
.ev-st .ev-kv li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--cz-hair); }
|
|
225
|
-
.ev-st .ev-kv li b { width: 64px; flex: none; }
|
|
226
|
-
.ev-st .ev-kv li .ev-tx p { margin: 0 0 2px; font-size: var(--fs-2); color: var(--cz-ink2); }
|
|
227
224
|
.ev-st [role="status"] { min-height: 1.2em; margin: 0; font-size: var(--fs-2); color: var(--cz-ink3); }
|
|
225
|
+
/* Updates › what's new: this week open, the earlier weeks folded into an Archive */
|
|
226
|
+
.ev-st .ev-wk { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--cz-hair); }
|
|
227
|
+
.ev-st .ev-wkh { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
|
|
228
|
+
.ev-st .ev-wkh b { font-size: var(--fs-4); font-weight: 800; }
|
|
229
|
+
.ev-st .ev-wkm { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
|
|
230
|
+
.ev-st .ev-wg { display: flex; flex-direction: column; gap: 6px; }
|
|
231
|
+
.ev-st .ev-wgl { display: flex; align-items: center; gap: 8px; font-size: var(--fs-1); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--cz-ink2); }
|
|
232
|
+
.ev-st .ev-wi { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
|
|
233
|
+
.ev-st .ev-wi li { font-size: var(--fs-3); line-height: 1.5; color: var(--cz-ink2); max-width: 68ch; overflow-wrap: anywhere; }
|
|
234
|
+
.ev-st .ev-wi li b { color: var(--cz-ink); font-weight: 700; }
|
|
235
|
+
.ev-st .ev-pr { font-size: var(--fs-1); font-variant-numeric: tabular-nums; }
|
|
236
|
+
.ev-st .ev-arc { display: flex; flex-direction: column; border-top: 1px solid var(--cz-hair); }
|
|
237
|
+
.ev-st .ev-arcb, .ev-st .ev-wkt { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; width: 100%; min-height: 44px; padding: 10px 0; border: 0; background: none; font: inherit; color: var(--cz-ink); text-align: left; cursor: pointer; }
|
|
238
|
+
.ev-st .ev-arcb svg, .ev-st .ev-wkt svg { margin-left: auto; align-self: center; fill: none; stroke: currentColor; stroke-width: 2; color: var(--cz-ink3); transition: transform .15s; }
|
|
239
|
+
.ev-st .ev-arcb[aria-expanded="true"] svg, .ev-st .ev-wkt[aria-expanded="true"] svg { transform: rotate(180deg); }
|
|
240
|
+
.ev-st .ev-wkr { display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; border-top: 1px solid var(--cz-hair); }
|
|
241
|
+
.ev-st .ev-wkr .ev-wkm { padding: 0 0 4px; }
|
|
242
|
+
.ev-st .ev-wkt .ev-tl { margin-right: 8px; }
|
|
243
|
+
@media (prefers-reduced-motion: reduce) { .ev-st .ev-arcb svg, .ev-st .ev-wkt svg { transition: none; } }
|
|
228
244
|
@media (max-width: 760px) {
|
|
229
245
|
.ev-st { left: 0; top: 0; transform: none; width: 100vw; height: 100%; border-radius: 0; flex-direction: column; }
|
|
230
246
|
.ev-st-nav { width: auto; flex-direction: row; overflow-x: auto; padding: 14px 12px 8px; gap: 4px; scrollbar-width: none; }
|
|
@@ -233,6 +249,7 @@
|
|
|
233
249
|
.ev-st-main { padding: 16px 16px 32px; }
|
|
234
250
|
.ev-st .ev-trow { flex-wrap: wrap; }
|
|
235
251
|
.ev-st .ev-upd { flex-wrap: wrap; }
|
|
252
|
+
.ev-st .ev-upd .ev-tx { flex: 1 1 180px; }
|
|
236
253
|
.ev-st .ev-sw, .ev-st .ev-pick, .ev-st select.ev-inp, .ev-st input.ev-inp { min-height: 44px; font-size: var(--fs-4); }
|
|
237
254
|
.ev-st .ev-seg button { min-height: 40px; }
|
|
238
255
|
}
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
* /api/proactive/settings)
|
|
14
14
|
* Workspaces the repositories PMOS works in (GET and POST /api/workspaces, POST /api/workspaces/forget; the folder is never touched)
|
|
15
15
|
* Workflows a link to its own page, /premium-workflows.html (pm/wf-page.js, D99): the stages each kind of initiative goes through
|
|
16
|
-
* Updates the versions and Check now, Update, Restart to update (GET /api/kit/status, POST /api/kit/check | update | upgrade-app)
|
|
17
|
-
*
|
|
16
|
+
* Updates the versions and Check now, Update, Restart to update (GET /api/kit/status, POST /api/kit/check | update | upgrade-app); opening it
|
|
17
|
+
* asks for the latest kit. Under it, what's new: the published kits grouped by week as New, Improved and Fixed, this week open and every earlier
|
|
18
|
+
* week folded into an Archive (pm/upd-weeks.js). It was a section of its own, What's new.
|
|
18
19
|
* Adler's moments (batch 17 item 4-B, AdM4): one face per section, where Claude speaks. Updates: glasses while it checks or installs,
|
|
19
20
|
* holding the card when a version is ready, calm when up to date. General: holding the update card, else the Jira promise (only after
|
|
20
21
|
* Commit). A failure in the status line takes the honest face, and then the section's face steps back (one Adler per screen).
|
|
@@ -27,17 +28,18 @@ import { esc, svg, ICON, toast, wsParam, wsQ } from './cozy-evui.js';
|
|
|
27
28
|
import { sourceRows, staleOf, partsOf } from './cozy-evmodel.js';
|
|
28
29
|
import * as AD from './cozy-adler.js';
|
|
29
30
|
import * as SE from './cozy-seasons.js';
|
|
31
|
+
import { weeksOf, lineOf, KINDS } from './upd-weeks.js';
|
|
30
32
|
|
|
31
33
|
/** PUT or DELETE with the page's launch nonce (pressFetch). Only the key row needs them. */
|
|
32
34
|
async function pmSend(method, path, body) {
|
|
33
35
|
try { const res = await pressFetch(path, { method, ...(body === undefined ? {} : { body: JSON.stringify(body) }) }); const out = await res.json(); if (out && typeof out === 'object' && !res.ok) out.status = res.status; return out; }
|
|
34
36
|
catch (e) { return { ok: false, error: 'could not reach the workspace server — ' + ((e && e.message) || String(e)) }; }
|
|
35
37
|
}
|
|
36
|
-
const SECTIONS = [['general', 'General'], ['claude', 'Claude'], ['adler', 'Adler'], ['connectors', 'Connectors'], ['workspaces', 'Workspaces'], ['workflows', 'Workflows'], ['updates', 'Updates']
|
|
38
|
+
const SECTIONS = [['general', 'General'], ['claude', 'Claude'], ['adler', 'Adler'], ['connectors', 'Connectors'], ['workspaces', 'Workspaces'], ['workflows', 'Workflows'], ['updates', 'Updates']];
|
|
37
39
|
const PAGE_LINKS = { workflows: '/premium-workflows.html' }; // a section that is a page of its own: the row goes there
|
|
38
40
|
const SRC = { calendar: 'Calendar', wispr: 'Wispr Flow', mail: 'Mail', slack: 'Slack', jira: 'Jira', confluence: 'Confluence', github: 'GitHub', drive: 'Google Drive', figma: 'Figma', website: 'Your websites' };
|
|
39
41
|
const VIEWER_KEY = 'pmos.cz.viewer';
|
|
40
|
-
const T = { el: null, sec: 'general', ws: null, st: {}, src: null, con: {}, conn: [], set: null, prods: null, msg: '', busy: false, phase: '', say: '', back: null, fresh: null, reading: '', note: {}, lines: null, dress: false, more: false, bday: false, dset: {} };
|
|
42
|
+
const T = { el: null, sec: 'general', ws: null, st: {}, src: null, con: {}, conn: [], set: null, prods: null, msg: '', busy: false, phase: '', say: '', back: null, fresh: null, reading: '', note: {}, lines: null, dress: false, more: false, bday: false, dset: {}, wkOpen: new Set(), arc: false };
|
|
41
43
|
const cmpVer = (a, b) => { const x = String(a || '0').split('-')[0].split('.').map(Number), y = String(b || '0').split('-')[0].split('.').map(Number); for (let i = 0; i < 3; i++) if ((x[i] || 0) !== (y[i] || 0)) return (x[i] || 0) < (y[i] || 0) ? -1 : 1; return 0; };
|
|
42
44
|
const home = () => (T.ws && T.ws[0] ? T.st[T.ws[0].id] : null);
|
|
43
45
|
const latest = () => { const s = home(); return (s && (s.latest || (s.lastCheck && s.lastCheck.latest))) || null; };
|
|
@@ -67,7 +69,7 @@ function general() {
|
|
|
67
69
|
const pname = !P ? 'Reading' : !P.length ? 'No product' : on.length === 1 ? on[0].name : on.length + ' of ' + P.length + ' products';
|
|
68
70
|
const we = T.set && Array.isArray(T.set.settings) ? T.set.settings.find((x) => x.key === 'time.workEnd') : null, end = we ? Number(we.value) : 18;
|
|
69
71
|
const hours = []; for (let h = 13; h <= 23; h++) hours.push(h);
|
|
70
|
-
const upd = ready() ? `<div class="ev-card ev-upd">${adFace('needs-you')}<span class="ev-pill y">Update</span><p><b>PMOS ${esc(latest())} is ready.</b> <span class="ev-mut">${esc(firstLine())}</span></p><button type="button" class="ev-btn sm" data-ev-go="
|
|
72
|
+
const upd = ready() ? `<div class="ev-card ev-upd">${adFace('needs-you')}<span class="ev-pill y">Update</span><p><b>PMOS ${esc(latest())} is ready.</b> <span class="ev-mut">${esc(firstLine())}</span></p><button type="button" class="ev-btn sm" data-ev-go="updates">What's new</button><button type="button" class="ev-btn sm dark" data-ev-upd="update">${appBehind() ? 'Restart to update' : 'Update'}</button></div>` : '';
|
|
71
73
|
return trow('Theme', 'Auto follows your computer', seg('Theme', 'theme', theme, [['light', 'Light'], ['dark', 'Dark'], ['auto', 'Auto']]))
|
|
72
74
|
+ trow('Viewer opens as', 'A column beside the chat, or a popup over it', seg('Viewer opens as', 'viewer', vw, [['column', 'Column'], ['popup', 'Popup']]))
|
|
73
75
|
+ trow('Product', 'Which products Home, Board and Intelligence read', `<button type="button" class="ev-pick" data-ev-products aria-haspopup="menu">${esc(pname)} ${svg(ICON.down, 14)}</button>`)
|
|
@@ -199,16 +201,29 @@ function updates() {
|
|
|
199
201
|
: ready() ? `<b>PMOS ${esc(L)} is ready</b><p class="ev-small ev-mut">You have ${esc(app)}.${appBehind() ? ' PMOS stops for about a minute while it installs. Open terminals keep running.' : ''}</p>`
|
|
200
202
|
: L ? `<b>PMOS ${esc(app)} is up to date</b><p class="ev-small ev-mut">${fromGit() && s.appBehind ? esc(L) + ' is published. This PMOS runs from a checkout: update it with git pull.' : 'The newest published kit is ' + esc(L) + '.'}</p>`
|
|
201
203
|
: `<b>PMOS ${esc(app)}</b><p class="ev-small ev-mut">Press Check now to ask for the latest version.</p>`;
|
|
202
|
-
const acts = T.phase === 'busy' ? '' :
|
|
203
|
-
: `<button type="button" class="ev-btn sm" data-ev-upd="check"${T.busy ? ' disabled' : ''}>Check now</button>${ready() ? `<button type="button" class="ev-btn sm dark" data-ev-upd="update">${appBehind() ? 'Restart to update' : 'Update'}</button>` : ''}`;
|
|
204
|
+
const acts = T.phase === 'busy' ? '' : `<button type="button" class="ev-btn sm" data-ev-upd="check"${T.busy ? ' disabled' : ''}>Check now</button>${ready() ? `<button type="button" class="ev-btn sm dark" data-ev-upd="update">${appBehind() ? 'Restart to update' : 'Update'}</button>` : ''}`;
|
|
204
205
|
const kits = (T.ws || []).map((w) => { const k = T.st[w.id], kit = k && k.kit; return trow(w.label || w.name || w.id, kit && kit.present ? 'kit ' + (kit.version || 'vendored by hand') : 'no kit in this workspace', k && k.kitBehind && L ? `<span class="ev-pill y">${esc(L)} ready</span>` : kit && kit.present && (k.lastCheck || k.latest) ? '<span class="ev-pill ok">Up to date</span>' : ''); }).join('');
|
|
205
206
|
const last = s.lastCheck ? 'Last checked ' + new Date(s.lastCheck.at).toLocaleString() + '. ' : '';
|
|
206
|
-
return `<div class="ev-card ev-upd">${mood ? adFace(mood) : ''}<div class="ev-tx ev-grow">${head}</div>${acts}</div>${kits}<p class="ev-small ev-mut">${esc(last)}${s.checkDaily ? 'PMOS checks once a day while a page is open; Check now asks again.' : 'PMOS checks only when you press Check now.'}</p
|
|
207
|
+
return `<div class="ev-card ev-upd first">${mood ? adFace(mood) : ''}<div class="ev-tx ev-grow">${head}</div>${acts}</div>${kits}<p class="ev-small ev-mut">${esc(last)}${s.checkDaily ? 'PMOS checks when you open Updates and once a day while a page is open; Check now asks again.' : 'PMOS checks only when you press Check now.'}</p>${weeks()}`;
|
|
207
208
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
/** One week: its name and dates, then New, Improved and Fixed with a line for each published PR. */
|
|
210
|
+
function weekBody(w) {
|
|
211
|
+
const dot = { new: 'you', imp: 'ok', fix: 'risk' };
|
|
212
|
+
const grp = KINDS.filter(([k]) => w.groups[k].length).map(([k, label]) => `<div class="ev-wg"><div class="ev-wgl"><i class="ev-dot ${dot[k]}"></i>${label}</div><ul class="ev-wi">${w.groups[k].map((p) => { const x = lineOf(p); return `<li>${x.b ? `<b>${esc(x.b)}${/[.!?]$/.test(x.b) ? '' : '.'}</b> ` : ''}${esc(x.s)}${p.n ? ` <span class="ev-mut ev-pr">#${esc(p.n)}</span>` : ''}</li>`; }).join('')}</ul></div>`).join('');
|
|
213
|
+
return `<div class="ev-wkm">${grp}</div>`;
|
|
214
|
+
}
|
|
215
|
+
const kitsOf = (w) => (w.kits[0] === w.kits[1] ? w.kits[0] : w.kits[0] + ' – ' + w.kits[1]);
|
|
216
|
+
/** What's new, under the update card: this week (the newest week) open, and every earlier week folded into the Archive. */
|
|
217
|
+
function weeks() {
|
|
218
|
+
const s = home(), mine = s && s.app && !fromGit() ? s.app.version : null;
|
|
219
|
+
const W = weeksOf(changes(), Date.now(), mine);
|
|
220
|
+
if (!W.length) return '<p class="ev-small ev-mut">No kit summaries yet. Each kit published from now on carries one, and Check now reads the newest ones.</p>';
|
|
221
|
+
const [w, ...old] = W.slice(0, 13);
|
|
222
|
+
const head = (x) => `<div class="ev-wkh"><b>${esc(x.name)}</b><span class="ev-small ev-mut">${esc(x.range)} · kits ${esc(kitsOf(x))}</span>${x.newer ? '<span class="ev-pill y">Ready to install</span>' : ''}</div>`;
|
|
223
|
+
const tally = (x) => [['new', 'new'], ['imp', 'improved'], ['fix', 'fixed']].filter(([k]) => x.groups[k].length).map(([k, l]) => x.groups[k].length + ' ' + l).join(' · ');
|
|
224
|
+
const rows = old.map((x) => { const on = T.wkOpen.has(x.key); return `<div class="ev-wkr"><button type="button" class="ev-wkt" data-ev-wk="${esc(x.key)}" aria-expanded="${on}"><b>${esc(x.name)}</b><span class="ev-small ev-mut">${esc(x.range)}</span><span class="ev-small ev-mut ev-tl">${esc(tally(x))}</span>${svg(ICON.down, 14)}</button>${on ? weekBody(x) : ''}</div>`; }).join('');
|
|
225
|
+
const arc = old.length ? `<div class="ev-arc"><button type="button" class="ev-arcb" data-ev-arc aria-expanded="${T.arc}"><b>Archive</b><span class="ev-small ev-mut">${old.length} earlier ${old.length === 1 ? 'week' : 'weeks'}</span>${svg(ICON.down, 14)}</button>${T.arc ? rows : ''}</div>` : '';
|
|
226
|
+
return `<div class="ev-wk">${head(w)}${weekBody(w)}${arc}</div>`;
|
|
212
227
|
}
|
|
213
228
|
/* Settings > Claude: which Claude profile PMOS starts Claude sessions with, and the API key for Claude's own runs (D101).
|
|
214
229
|
* The key is typed here and goes to this computer only; the page never gets it back, only whether one is set and where from. */
|
|
@@ -226,7 +241,7 @@ function claudeSec() {
|
|
|
226
241
|
+ trow('API key', keySub, keyRight)
|
|
227
242
|
+ (k.present && C.off ? trow('Runs on the API', 'Off: PMOS_GRILL_API is off in the environment.', '<span class="ev-pill">Off</span>') : '');
|
|
228
243
|
}
|
|
229
|
-
const BODY = { general, claude: claudeSec, adler: adlerSec, connectors, workspaces, updates
|
|
244
|
+
const BODY = { general, claude: claudeSec, adler: adlerSec, connectors, workspaces, updates };
|
|
230
245
|
function draw() {
|
|
231
246
|
const el = T.el; if (!el || el.hidden) return;
|
|
232
247
|
// a redraw replaces the nodes: keep focus on the same control (by its data-ev-* key), else on the open section, never on the body
|
|
@@ -238,6 +253,7 @@ function draw() {
|
|
|
238
253
|
const all = T.sec === 'connectors' ? `<button type="button" class="ev-ib" data-ev-readall aria-label="Read every source again" title="Read all again"${T.reading ? ' disabled' : ''}>${svg(RD, 18)}</button>` : '';
|
|
239
254
|
el.querySelector('.ev-st-main').innerHTML = staleHtml() + `<div class="ev-top"><h3 class="ev-h2" id="evStTitle">${esc(label)}</h3>${all}<button type="button" class="ev-ib" data-ev-close aria-label="Close settings" title="Close settings">${svg(ICON.close, 18)}</button></div>`
|
|
240
255
|
+ BODY[T.sec]() + `<p role="status"${T.msg && AD.moodOfText(T.msg) === 'honest' ? ' class="ev-say honest"' : ''}>${T.msg && AD.moodOfText(T.msg) === 'honest' ? AD.adler('honest', 24, { label: false }) : ''}${esc(T.msg)}</p>`;
|
|
256
|
+
const cur = el.querySelector('.ev-st-nav [aria-current="page"]'); if (cur && cur.scrollIntoView) cur.scrollIntoView({ block: 'nearest', inline: 'nearest' }); // on a phone the section row scrolls: keep the open one in view
|
|
241
257
|
if (had && !ae.isConnected) { const f = (key && el.querySelector(`[${key.name}="${CSS.escape(key.value)}"]`)) || el.querySelector('[aria-current="page"]'); if (f) f.focus(); }
|
|
242
258
|
}
|
|
243
259
|
function mount() {
|
|
@@ -272,8 +288,10 @@ function mount() {
|
|
|
272
288
|
}
|
|
273
289
|
async function press(e) {
|
|
274
290
|
const t = e.target.closest('a[data-ev-sec], button'); if (!t) return;
|
|
275
|
-
if (t.dataset.evSec) { e.preventDefault(); T.sec = t.dataset.evSec; T.msg = ''; T.dress = false; draw(); const f = T.el.querySelector(`[data-ev-sec="${T.sec}"]`); if (f) f.focus(); return; }
|
|
291
|
+
if (t.dataset.evSec) { e.preventDefault(); T.sec = t.dataset.evSec; T.msg = ''; T.dress = false; draw(); const f = T.el.querySelector(`[data-ev-sec="${T.sec}"]`); if (f) f.focus(); openCheck(); return; }
|
|
276
292
|
if ('evClose' in t.dataset) { closeSettings(); return; }
|
|
293
|
+
if (t.dataset.evWk) { const k = t.dataset.evWk; if (T.wkOpen.has(k)) T.wkOpen.delete(k); else T.wkOpen.add(k); draw(); return; }
|
|
294
|
+
if ('evArc' in t.dataset) { T.arc = !T.arc; draw(); return; }
|
|
277
295
|
if (t.dataset.evGo) { T.sec = t.dataset.evGo; draw(); return; }
|
|
278
296
|
if (t.dataset.evSeg === 'theme') { const M = await import('./cozy-nav.js'); M.setTheme(t.dataset.v); draw(); return; }
|
|
279
297
|
if (t.dataset.evSeg && t.dataset.evSeg.startsWith('adler.')) { const r = await AD.savePref(pmPost, t.dataset.evSeg, t.dataset.v); T.msg = r && r.ok ? 'Saved.' : (r && r.error) || 'Not saved.'; draw(); return; }
|
|
@@ -325,17 +343,22 @@ async function press(e) {
|
|
|
325
343
|
} finally { T.busy = false; }
|
|
326
344
|
draw();
|
|
327
345
|
}
|
|
328
|
-
|
|
329
|
-
|
|
346
|
+
/** Opening Updates asks for the latest kit once per open, unless Settings turned the automatic check off (upd.check = press). */
|
|
347
|
+
async function openCheck() {
|
|
348
|
+
const s = home();
|
|
349
|
+
if (T.sec !== 'updates' || T.auto || !T.ws || !s || !s.checkDaily || T.checking || T.phase === 'busy') return;
|
|
350
|
+
T.auto = true;
|
|
351
|
+
await upd('check', true); draw();
|
|
352
|
+
}
|
|
353
|
+
async function upd(a, quiet) {
|
|
330
354
|
if (a === 'check') {
|
|
331
355
|
T.checking = true; T.msg = ''; draw();
|
|
332
356
|
try {
|
|
333
357
|
for (const w of T.ws || []) { const r = await pmPost('/api/kit/check', { ws: w.id }); if (r && r.ok) T.st[w.id] = { ...(T.st[w.id] || {}), ...r }; else T.msg = (r && r.error) || 'The check failed.'; }
|
|
334
358
|
} finally { T.checking = false; }
|
|
335
|
-
if (!T.msg) toast(ready() ? 'PMOS ' + latest() + ' is ready' : 'Checked. PMOS is up to date');
|
|
359
|
+
if (!T.msg && !quiet) toast(ready() ? 'PMOS ' + latest() + ' is ready' : 'Checked. PMOS is up to date');
|
|
336
360
|
return;
|
|
337
361
|
}
|
|
338
|
-
if (a === 'update' && appBehind()) { T.sec = 'updates'; T.phase = 'confirm'; return; }
|
|
339
362
|
const v = latest(); T.sec = 'updates'; T.phase = 'busy';
|
|
340
363
|
for (const w of kitsBehind()) {
|
|
341
364
|
T.say = 'Updating the kit in ' + (w.label || w.name || w.id) + '.'; draw();
|
|
@@ -397,11 +420,12 @@ async function load() {
|
|
|
397
420
|
draw();
|
|
398
421
|
await Promise.all(T.ws.map(async (x) => { const r = await pmGet('/api/kit/status?ws=' + encodeURIComponent(x.id)); if (r && r.ok) T.st[x.id] = r; }));
|
|
399
422
|
draw();
|
|
423
|
+
openCheck();
|
|
400
424
|
}
|
|
401
425
|
export function openSettings(section) {
|
|
402
426
|
const el = mount();
|
|
403
427
|
if (section === 'dress') { T.sec = 'adler'; T.dress = true; } else if (section && BODY[section]) { T.sec = section; T.dress = false; }
|
|
404
|
-
if (el.hidden) { const ae = document.activeElement; T.back = ae && ae !== document.body ? ae : null; T.ws = null; T.src = null; T.msg = ''; T.phase = ''; T.fresh = null; T.note = {}; T.dset = {}; T.cl = null; }
|
|
428
|
+
if (el.hidden) { const ae = document.activeElement; T.back = ae && ae !== document.body ? ae : null; T.ws = null; T.src = null; T.msg = ''; T.phase = ''; T.auto = false; T.wkOpen = new Set(); T.arc = false; T.fresh = null; T.note = {}; T.dset = {}; T.cl = null; }
|
|
405
429
|
el.hidden = false; document.getElementById('evStScrim').hidden = false; el.setAttribute('data-esc-layer', '');
|
|
406
430
|
draw();
|
|
407
431
|
const f = el.querySelector('[aria-current="page"]'); if (f) f.focus();
|
|
@@ -870,12 +870,9 @@ button.iva-tb:hover, button.iva-r.g:not(:disabled):hover { filter: brightness(.9
|
|
|
870
870
|
.iv { container: iv / inline-size; }
|
|
871
871
|
.iv-cols { display: flex; flex-direction: column; gap: 12px; }
|
|
872
872
|
.iv-cl, .iv-cr { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
|
|
873
|
-
/*
|
|
873
|
+
/* One reading column: the summary and milestones lead into full-width Tasks. */
|
|
874
874
|
@container iv (min-width: 820px) {
|
|
875
|
-
.iv-
|
|
876
|
-
.iv-cl { position: sticky; top: 0; }
|
|
877
|
-
/* Tasks starts level with the card (canvas v582), fills the Viewer's height and scrolls on its own */
|
|
878
|
-
.iv-cr > .iv-tasks { height: var(--iv-h, auto); overflow-y: auto; overscroll-behavior: contain; flex: none; }
|
|
875
|
+
.iv-cr > .iv-tasks { height: auto; overflow: visible; }
|
|
879
876
|
.iv-cl > .iv-msc { display: flex; }
|
|
880
877
|
}
|
|
881
878
|
/* the Milestones card under the card, desktop only (Wawan 10:53, canvas v586): a green tick when done, the next in blue */
|
|
@@ -984,6 +981,18 @@ button.iv-mt.iv-wf { padding: 0 !important; margin: 0 !important; }
|
|
|
984
981
|
.iv-mio-h .iv-dtc { display: block !important; line-height: 36px; white-space: nowrap; min-width: 0; max-width: 100%; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
|
|
985
982
|
.iv-mio-h .iv-mo, .iv-mio-h .iv-scgo { flex: none; }
|
|
986
983
|
.iv-dtc.w { color: var(--cz-late) !important; }
|
|
984
|
+
/* Desktop summary: keep the illustration small instead of stretching it across the page. */
|
|
985
|
+
@container iv (min-width: 820px) {
|
|
986
|
+
.iv-card .iv-mis { display: grid; grid-template-columns: 260px minmax(0, 1fr); column-gap: 20px; align-items: center; }
|
|
987
|
+
.iv-card .iv-mis > .iv-mi { grid-column: 1; grid-row: 1 / span 2; margin: 0; border-radius: 12px; }
|
|
988
|
+
.iv-card .iv-mis > .iv-sch { display: flex; grid-column: 2; grid-row: 1; }
|
|
989
|
+
.iv-mis .iv-shn { display: inline-flex; }
|
|
990
|
+
.iv-mis .iv-mi-nm { display: none; }
|
|
991
|
+
.iv-card .iv-mis > .iv-mio { grid-column: 2; grid-row: 2; }
|
|
992
|
+
.iv-card:not(:has(.iv-ask, .iv-win)) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 20px; }
|
|
993
|
+
.iv-card:not(:has(.iv-ask, .iv-win)) > .iv-hr { display: none; }
|
|
994
|
+
.iv-card:not(:has(.iv-ask, .iv-win)) > .iv-meta { max-width: 240px; flex-wrap: wrap; }
|
|
995
|
+
}
|
|
987
996
|
/* a real win (XvpE5Adler 1): he stands in the card with a soft green glow, his thanks and the one primary */
|
|
988
997
|
.iv-win { display: flex; align-items: flex-end; gap: 12px; position: relative; }
|
|
989
998
|
.iv-wfig { flex: none; position: relative; }
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*
|
|
6
6
|
* viewHtml(v, o) the body: the card (batch 18 item 1, XvpA1: Adler's ask with the one primary, the meta line of icons, then the
|
|
7
7
|
* mission, pm/mission.js, in the stage line's place), then Tasks as the WBS (sections in workflow order), then Documents
|
|
8
|
-
* and Linked as folds.
|
|
9
|
-
*
|
|
8
|
+
* and Linked as folds. The compact desktop summary and milestones sit above full-width Tasks.
|
|
9
|
+
* Under the card, the success measure Claude drafted from the PRD (pm/metric-drafts.js, GET
|
|
10
10
|
* /api/metric-drafts scope initiative): the proposal, or once kept its fold with Undo; nothing when nothing is drafted.
|
|
11
11
|
* o: { add (the Tasks + icon), adding (the inline field is open), next (the next stage is a press: Home's move sheet), openTask, docs: { n, html? } | null,
|
|
12
12
|
* quick (each task's box carries the status caret and its date is a press: the host has h.status and h.dates),
|
|
@@ -361,8 +361,7 @@ export function viewHtml(v, o = {}) {
|
|
|
361
361
|
if (v && v.id) VIEWED.set(v.id, v);
|
|
362
362
|
// a merged initiative leads with where its work went, and draws no stage or tasks (they moved; its folds stay); an open one shows Claude's split or merge card under the summary (batch 11 item 14)
|
|
363
363
|
if (v.merged) return `<div class="iv" data-iv="${esc(v.id || v.key || '')}"><div class="iv-cols"><div class="iv-cl">${smMerged(v.merged)}</div><div class="iv-cr">${foldsHtml(v, o)}${o.tail || ''}</div></div></div>`;
|
|
364
|
-
//
|
|
365
|
-
// for it on the left, Tasks on the right from the same top (canvas v582), as one panel with its own scroll; one column below it
|
|
364
|
+
// One reading column: summary, milestones and proposals, then content-sized Tasks and document folds.
|
|
366
365
|
return `<div class="iv" data-iv="${esc(v.id || v.key || '')}"><div class="iv-cols"><div class="iv-cl">${cardHtml(v, o)}${msCardHtml(v, o)}${o.sm !== false ? smCard(v.suggest, v.title) : ''}${MD.iniHtml(v.id, '', v.title)}</div>`
|
|
367
366
|
+ `<div class="iv-cr"><section class="iv-tasks" aria-label="Tasks">${tasksHtml(v, o)}</section>${foldsHtml(v, o)}${o.tail || ''}</div></div></div>`;
|
|
368
367
|
}
|
|
@@ -382,10 +381,7 @@ export function wireView(body, h) {
|
|
|
382
381
|
body.__ivWired = true;
|
|
383
382
|
// the ✦ after the title and the drafted measure follow each draw
|
|
384
383
|
if (typeof MutationObserver === 'function') {
|
|
385
|
-
|
|
386
|
-
const tall = () => { const iv = body.querySelector('.iv'); if (!iv) return; const top = iv.getBoundingClientRect().top - body.getBoundingClientRect().top + body.scrollTop;
|
|
387
|
-
const h = Math.max(320, Math.round(body.clientHeight - top - 16)); if (iv.style.getPropertyValue('--iv-h') !== h + 'px') iv.style.setProperty('--iv-h', h + 'px'); };
|
|
388
|
-
let q = 0; const fit = () => { if (q) return; q = requestAnimationFrame(() => { q = 0; chip(); tall(); }); };
|
|
384
|
+
let q = 0; const fit = () => { if (q) return; q = requestAnimationFrame(() => { q = 0; chip(); }); };
|
|
389
385
|
new MutationObserver(fit).observe(body, { childList: true, subtree: true });
|
|
390
386
|
if (typeof ResizeObserver === 'function') new ResizeObserver(fit).observe(body);
|
|
391
387
|
fit();
|
|
@@ -5,6 +5,7 @@ import { openChatFile, openWebLink } from './premium-vw-file.js';
|
|
|
5
5
|
import { turnsOf } from './chat-context.js';
|
|
6
6
|
import { chipsHtml, itemOf, openCtx } from './premium-vw-ctx.js';
|
|
7
7
|
import { lineItems, behindOf, whenRead } from './freshness-words.js';
|
|
8
|
+
import { weeksOf, lineOf, KINDS } from './upd-weeks.js';
|
|
8
9
|
import { splitGoal, shownUser, goalBlockHtml, goalProgressHtml, goalChipHtml, goalViewHtml, goalNow, slashMatches } from './goal-chat.js';
|
|
9
10
|
import { mdHtml, userHtml, toolLine, webKind } from './chat-md.js';
|
|
10
11
|
import { splitReport, reportChipHtml, blockSig } from './report-chat.js';
|
|
@@ -1126,22 +1127,21 @@ function updDay(iso) {
|
|
|
1126
1127
|
return d.toDateString() === t.toDateString() ? 'Today, ' + dm : d.toDateString() === y.toDateString() ? 'Yesterday, ' + dm : DOW[d.getDay()] + ' ' + dm;
|
|
1127
1128
|
}
|
|
1128
1129
|
const updTime = (iso) => { const d = iso ? new Date(iso) : null; return d && !isNaN(d) ? pad2(d.getHours()) + ':' + pad2(d.getMinutes()) : ''; };
|
|
1130
|
+
/** One week: New, Improved and Fixed, a line for each published PR. */
|
|
1131
|
+
function updWeek(w) {
|
|
1132
|
+
const dot = { new: 'n', imp: 'i', fix: 'f' };
|
|
1133
|
+
return `<div class="wkm">${KINDS.filter(([k]) => w.groups[k].length).map(([k, label]) => `<div class="wkg"><div class="wkgl"><i class="${dot[k]}"></i>${label}</div><ul>${w.groups[k].map((p) => { const x = lineOf(p); return `<li>${x.b ? `<b>${esc(x.b)}${/[.!?]$/.test(x.b) ? '' : '.'}</b> ` : ''}${esc(x.s)}${p.n ? ` <em>#${esc(p.n)}</em>` : ''}</li>`; }).join('')}</ul></div>`).join('')}</div>`;
|
|
1134
|
+
}
|
|
1135
|
+
/** What's new: this week (the newest week) open, every earlier week folded into the Archive. */
|
|
1129
1136
|
function updWhatsNew(U) {
|
|
1130
|
-
const
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
? `<p><b>${esc(p.t)}</b>${p.n ? ` <em>#${esc(p.n)}</em>` : ''}<span class="ks">${esc(p.s)}</span></p>`
|
|
1139
|
-
: `<p>${esc(p.s)}${p.n ? ` <em>#${esc(p.n)}</em>` : ''}</p>`)).join('') : '<p class="note">No summary was recorded for this kit.</p>';
|
|
1140
|
-
return `<li class="kver${newer ? ' new' : ''}"><span class="kv"><b>${esc(e.v)}</b>${yours ? '<i>yours</i>' : newer ? '<i class="nw">newer</i>' : ''}<em>${esc(updTime(e.at))}</em></span><div class="kp">${lines}</div></li>`;
|
|
1141
|
-
}).join('') : '';
|
|
1142
|
-
const more = open && !full && g.e.length > 5 ? `<button type="button" class="kmore" data-kfull="${esc(g.k)}">Show ${g.e.length - 5} more from ${esc(g.k.split(',')[0])}</button>` : '';
|
|
1143
|
-
return `<div class="kday"><button type="button" class="kdh" data-kday="${esc(g.k)}" aria-expanded="${open}"><span>${esc(g.k)}</span><em>${g.e.length} ${g.e.length === 1 ? 'kit' : 'kits'}</em></button>${open ? `<ul class="kvl">${rows}</ul>${more}` : ''}</div>`;
|
|
1144
|
-
}).join('');
|
|
1137
|
+
const s = updHome(), mine = s && s.app && !updGit() ? s.app.version : null; // a checkout has no published version
|
|
1138
|
+
const W = weeksOf(updList(), Date.now(), mine);
|
|
1139
|
+
if (!W.length) return '<p class="note">No kit summaries yet. Each kit published from now on carries one, and Check now reads the newest ones.</p>';
|
|
1140
|
+
const [w, ...old] = W.slice(0, 13), kits = (x) => (x.kits[0] === x.kits[1] ? x.kits[0] : x.kits[0] + ' – ' + x.kits[1]);
|
|
1141
|
+
const tally = (x) => [['new', 'new'], ['imp', 'improved'], ['fix', 'fixed']].filter(([k]) => x.groups[k].length).map(([k, l]) => x.groups[k].length + ' ' + l).join(' · ');
|
|
1142
|
+
const rows = old.map((x) => { const on = U.wk.has(x.key); return `<div class="wkr"><button type="button" class="wkt" data-wk="${esc(x.key)}" aria-expanded="${on}"><b>${esc(x.name)}</b><span class="note">${esc(x.range)}</span><span class="note">${esc(tally(x))}</span></button>${on ? updWeek(x) : ''}</div>`; }).join('');
|
|
1143
|
+
const arc = old.length ? `<div class="wka"><button type="button" class="wkt" data-arc aria-expanded="${U.arc}"><b>Archive</b><span class="note">${old.length} earlier ${old.length === 1 ? 'week' : 'weeks'}</span></button>${U.arc ? rows : ''}</div>` : '';
|
|
1144
|
+
return `<div class="wk"><div class="wkh"><b>${esc(w.name)}</b><span class="note">${esc(w.range)} · kits ${esc(kits(w))}</span>${w.newer ? '<b class="updpill">Ready to install</b>' : ''}</div>${updWeek(w)}${arc}</div>`;
|
|
1145
1145
|
}
|
|
1146
1146
|
function updBlock(U) {
|
|
1147
1147
|
const s = updHome();
|
|
@@ -1152,14 +1152,14 @@ function updBlock(U) {
|
|
|
1152
1152
|
: latest ? `<b>PMOS ${esc(app)} is up to date</b><span class="note">${updGit() && s.appBehind ? esc(latest) + ' is published. This PMOS runs from a checkout: update it with git pull.' : 'The newest published kit is ' + esc(latest) + '.'}</span>`
|
|
1153
1153
|
: `<b>PMOS ${esc(app)}</b><span class="note">Press Check now to ask for the latest version.</span>`;
|
|
1154
1154
|
const acts = U.phase === 'busy' ? '' : U.phase === 'confirm'
|
|
1155
|
-
? '
|
|
1155
|
+
? ''
|
|
1156
1156
|
: `<button type="button" class="cta alt" data-upd="check"${U.checking ? ' disabled' : ''}>${U.checking ? 'Checking…' : 'Check now'}</button>${ready ? '<button type="button" class="cta" data-upd="update">Update</button>' : ''}`;
|
|
1157
1157
|
const rows = UPD.ws.map((w) => { const k = UPD.st[w.id], kit = k && k.kit;
|
|
1158
1158
|
const tag = !k || !(kit && kit.present) ? '' : k.kitBehind && latest ? `<b class="updpill">${esc(latest)} ready</b>` : k.lastCheck || k.latest ? '<b class="updpill ok">Up to date</b>' : '';
|
|
1159
1159
|
return `<div class="sr"><span class="sn"><b>${esc(w.label || w.name || w.id)}</b><em>${kit && kit.present ? 'kit ' + esc(kit.version || 'vendored by hand') : 'no kit in this workspace'}${w.root ? ' · ' + esc(w.root) : ''}</em></span>${tag}</div>`; }).join('');
|
|
1160
1160
|
const last = s.lastCheck ? 'Last checked ' + updDay(s.lastCheck.at).replace(/^Today, .*/, 'today').replace(/^Yesterday, .*/, 'yesterday') + ' at ' + updTime(s.lastCheck.at) + '. ' : '';
|
|
1161
1161
|
return `<div class="updb"><div class="t">${head}</div><div class="a">${acts}</div></div>${rows}
|
|
1162
|
-
<p class="note">${esc(last)}${s.checkDaily ? 'PMOS checks once a day while a page is open; Check now asks again.' : 'PMOS checks only when you press Check now.'}</p>`;
|
|
1162
|
+
<p class="note">${esc(last)}${s.checkDaily ? 'PMOS checks when you open Settings and once a day while a page is open; Check now asks again.' : 'PMOS checks only when you press Check now.'}</p>`;
|
|
1163
1163
|
}
|
|
1164
1164
|
/** The app update stops this server and starts a new one: wait for it, then reload (the console's waitForRestart). */
|
|
1165
1165
|
async function updWaitRestart(from, log, say) {
|
|
@@ -1176,7 +1176,7 @@ async function updWaitRestart(from, log, say) {
|
|
|
1176
1176
|
|
|
1177
1177
|
export async function openSettings() {
|
|
1178
1178
|
const M = { ws: null, src: null, conn: [], con: {}, err: '', busy: false };
|
|
1179
|
-
const U = { phase: null, say: '', checking: false,
|
|
1179
|
+
const U = { phase: null, say: '', checking: false, wk: new Set(), arc: false };
|
|
1180
1180
|
const draw = () => {
|
|
1181
1181
|
const w = M.ws, s = M.src;
|
|
1182
1182
|
const wsRows = w === null ? '<p class="note">Reading the repositories.</p>' : w.some((x) => !x.linked) ? w.filter((x) => !x.linked).map((x) => `<div class="sr"><span class="sn"><b>${esc(x.label || x.name || x.id)}</b><em>${esc(x.root || '')}${x.home ? ' · home' : ''}</em></span>${x.home ? '' : `<button type="button" class="cta alt" data-rm="${esc(x.id)}">Remove</button>`}</div>`).join('') : '<p class="note">No repository is registered yet.</p>';
|
|
@@ -1199,19 +1199,19 @@ export async function openSettings() {
|
|
|
1199
1199
|
M.con = p && p.ok && p.settings ? { ...p.settings.connectors } : {}; M.conn = p && p.connectors && Array.isArray(p.connectors.list) ? p.connectors.list : [];
|
|
1200
1200
|
if (!w || !Array.isArray(w.workspaces)) M.err = 'The repositories could not be read.'; else if (!p || !p.ok) M.err = 'The sources could not be read.';
|
|
1201
1201
|
draw();
|
|
1202
|
+
const h = updHome();
|
|
1203
|
+
if (h && h.checkDaily && !U.checking) { U.checking = true; draw(); const err = await updCheck(); U.checking = false; if (err) M.err = err; draw(); } // opening Settings asks for the latest kit once
|
|
1202
1204
|
};
|
|
1203
1205
|
const say = (t) => { U.phase = null; M.err = t; draw(); };
|
|
1204
1206
|
$('#oMain').onclick = async (e) => {
|
|
1205
1207
|
if (M.busy) return;
|
|
1206
|
-
const
|
|
1207
|
-
if (
|
|
1208
|
-
if (
|
|
1208
|
+
const wkb = e.target.closest('[data-wk]'), arcb = e.target.closest('[data-arc]'), up = e.target.closest('[data-upd]');
|
|
1209
|
+
if (wkb) { const k = wkb.dataset.wk; if (U.wk.has(k)) U.wk.delete(k); else U.wk.add(k); draw(); const b = $(`#oMain [data-wk="${CSS.escape(k)}"]`); if (b) b.focus(); return; }
|
|
1210
|
+
if (arcb) { U.arc = !U.arc; draw(); const b = $('#oMain [data-arc]'); if (b) b.focus(); return; }
|
|
1209
1211
|
if (up) {
|
|
1210
1212
|
const a = up.dataset.upd; M.err = '';
|
|
1211
1213
|
if (a === 'check') { U.checking = true; draw(); const err = await updCheck(); U.checking = false; M.err = err; draw(); if (!err) toast(updReady() ? 'PMOS ' + updLatest() + ' is ready' : 'Checked. PMOS is up to date'); return; }
|
|
1212
|
-
if (a === '
|
|
1213
|
-
if (a === 'update' && updAppBehind()) { U.phase = 'confirm'; draw(); return; }
|
|
1214
|
-
if (a === 'update' || a === 'go') {
|
|
1214
|
+
if (a === 'update') {
|
|
1215
1215
|
const v = updLatest(), home = updHome(); U.phase = 'busy';
|
|
1216
1216
|
for (const w of updKitsBehind()) {
|
|
1217
1217
|
U.say = 'Updating the kit in ' + (w.label || w.name || w.id) + '.'; draw();
|
|
@@ -2187,20 +2187,17 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
2187
2187
|
.updb{display:flex;flex-wrap:wrap;align-items:center;gap:12px 14px;padding:14px 16px;border-radius:18px;background:var(--spot);margin-bottom:6px}
|
|
2188
2188
|
.updb .t{display:grid;gap:2px;flex:1 1 240px;min-width:0}.updb .t b{font-size:var(--fs-4)}
|
|
2189
2189
|
.updb .a{display:flex;flex-wrap:wrap;gap:8px}.updb .cta{height:auto;min-height:44px;padding:0 18px}
|
|
2190
|
-
.
|
|
2191
|
-
.
|
|
2192
|
-
.
|
|
2193
|
-
.
|
|
2194
|
-
.
|
|
2195
|
-
.
|
|
2196
|
-
.doc .
|
|
2197
|
-
.
|
|
2198
|
-
.
|
|
2199
|
-
.
|
|
2200
|
-
.
|
|
2201
|
-
.kp{display:grid;gap:6px;min-width:0;overflow-wrap:anywhere}.doc .kp p{margin:0;color:var(--ink);max-width:none;line-height:1.5}.kp p em{font:500 var(--fs-2) var(--mono);font-style:normal;color:var(--ink-3)}.kp p b{font-weight:600}.kp .ks{display:block;color:var(--ink-2)}
|
|
2202
|
-
.kmore{min-height:44px;font-weight:600;color:var(--ink-2)}
|
|
2203
|
-
@media (max-width:640px){.doc .kver{grid-template-columns:minmax(0,1fr)}.kver .kv{grid-auto-flow:column;justify-content:start;align-items:center;gap:8px}}
|
|
2190
|
+
.wk{display:grid;gap:14px}
|
|
2191
|
+
.wkh{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px}.wkh>b:first-child{font-size:var(--fs-4)}
|
|
2192
|
+
.wkm{display:grid;gap:16px;min-width:0}
|
|
2193
|
+
.wkg{display:grid;gap:6px}
|
|
2194
|
+
.wkgl{display:flex;align-items:center;gap:8px;font:600 var(--fs-1) var(--mono);letter-spacing:.06em;text-transform:uppercase;color:var(--ink-2)}
|
|
2195
|
+
.wkgl i{width:8px;height:8px;border-radius:50%;background:var(--ink-3)}.wkgl i.n{background:var(--ember-ink)}.wkgl i.i{background:var(--ok)}.wkgl i.f{background:var(--bad)}
|
|
2196
|
+
.doc .wkg ul{list-style:none;margin:0;padding:0;display:grid;gap:8px;max-width:none}
|
|
2197
|
+
.doc .wkg li{color:var(--ink-2);line-height:1.5;overflow-wrap:anywhere}.wkg li b{color:var(--ink);font-weight:600}.wkg li em{font:500 var(--fs-1) var(--mono);font-style:normal;color:var(--ink-3)}
|
|
2198
|
+
.wka{border-top:1px solid var(--hair)}.wkr{display:grid;gap:12px;padding-bottom:12px;border-top:1px solid var(--hair)}
|
|
2199
|
+
.wkt{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;width:100%;min-height:44px;padding:10px 0;color:var(--ink);text-align:left}
|
|
2200
|
+
.wkt::after{content:"Show";margin-left:auto;align-self:center;font:600 var(--fs-2) var(--sans);color:var(--ink-2)}.wkt[aria-expanded="true"]::after{content:"Hide"}
|
|
2204
2201
|
/* premium-chat-session: the session's tool line, permission options and Stop in the conversation */
|
|
2205
2202
|
.toolline{margin:2px 0 2px 42px;font:500 var(--fs-2) var(--mono);color:var(--ink-3)}
|
|
2206
2203
|
.chatopts{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
|