create-pmos 0.440.0 → 0.441.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 +13 -13
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +16 -13
- package/workspace/briefing-premium-products-test.js +4 -4
- package/workspace/briefing-premium-sources-test.js +2 -2
- package/workspace/briefing-premium-test.js +29 -23
- package/workspace/changelog.json +12 -0
- package/workspace/guide/core-documents.md +2 -2
- package/workspace/guide/data-freshness.md +7 -5
- package/workspace/guide/home.md +1 -1
- package/workspace/guide/horizon-scan.md +1 -1
- package/workspace/lib/agent-inbox.js +20 -2
- package/workspace/lib/briefing-premium-sources.js +3 -0
- package/workspace/lib/briefing-premium.js +37 -7
- package/workspace/lib/driver-cli.js +1 -1
- package/workspace/lib/driver-run.js +15 -1
- package/workspace/lib/driver.js +31 -2
- package/workspace/lib/news-for-you.js +24 -9
- package/workspace/lib/pm-idle.js +12 -0
- package/workspace/lib/refresh.js +17 -8
- package/workspace/lib/routes-core-docs.js +1 -1
- package/workspace/lib/routes-news.js +15 -1
- package/workspace/lib/routes-phone-day.js +6 -4
- package/workspace/need-shot.js +57 -0
- package/workspace/news-viewers-test.js +183 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-core-doc-issue-test.js +9 -8
- package/workspace/public/pm/bd-ini-panel.js +4 -11
- package/workspace/public/pm/cozy-ev.css +29 -0
- package/workspace/public/pm/cozy-news.js +186 -22
- package/workspace/public/pm/cozy-today.css +5 -0
- package/workspace/public/pm/cozy-viewer.js +4 -3
- package/workspace/public/pm/cozy-vw-shell.css +49 -0
- package/workspace/public/pm/home-adddoc.js +46 -26
- package/workspace/public/pm/home-app.js +134 -112
- package/workspace/public/pm/home-day.js +10 -5
- package/workspace/public/pm/home-draft.js +35 -23
- package/workspace/public/pm/home-ini.js +2 -2
- package/workspace/public/pm/home-need.js +336 -0
- package/workspace/public/pm/home-today.js +2 -2
- package/workspace/public/pm/home-work.js +51 -4
- package/workspace/public/pm/small-vw.js +128 -0
- package/workspace/server.js +10 -6
- package/workspace/skills/initiative-drive.skill +4 -1
- package/workspace/test-lists/batch18-asks.json +5 -0
- package/workspace/test-lists/news-viewers.json +13 -0
- package/workspace/test-lists/small-viewers.json +5 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.441.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.441.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -126,21 +126,22 @@ const BODY = '## Purpose\n\nWhy this board exists.\n\n## Scope\n\nWhat it covers
|
|
|
126
126
|
await until(() => ip.evaluate((k) => !!document.querySelector(`#czViewer [data-ov-dread="${k}"]`), ikey), 60000);
|
|
127
127
|
await unfold(ip, `#czViewer [data-ov-dread="${ikey}"]`);
|
|
128
128
|
await ip.click(`#czViewer [data-ov-dread="${ikey}"]`);
|
|
129
|
-
ok('I1 the reader of a draft has the Issue it
|
|
129
|
+
ok('I1 the reader of a draft has the summary with Issue it above the text (shell A, batch 18 item 2-C)', await until(() => ip.evaluate(() => { const o = document.querySelector('#czViewer:not([hidden])'); const b = o && o.querySelector('[data-issue-bar="draft"]'); const t = o && o.querySelector('.dsbody'); return !!b && !!t && /sends nothing to anyone/.test(b.textContent) && /Why this board exists/.test(t.textContent) && !!(b.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING); }), 30000));
|
|
130
130
|
ok('I1 no old dialog opens', await ip.evaluate(() => { const d = document.querySelector('#dlg'); return !d || !d.classList.contains('on'); }));
|
|
131
|
-
await ip.
|
|
131
|
+
ok('I1 ✎ Edit is a press in the header (no Read | Edit tabs), the path is under ⋯ and not in the body', await ip.evaluate((pt) => !!document.querySelector('#czViewer .cz-vw-hd [data-cz-vw-p="edit"]') && !document.querySelector('#czViewer [role="tablist"]') && !document.querySelector('#czViewer .cz-vw-body').textContent.includes(pt) && /^A draft/.test((document.querySelector('#czViewer .cz-vw-sub') || {}).textContent || ''), d2.path));
|
|
132
|
+
await ip.click('#czViewer .cz-vw-hd [data-cz-vw-p="edit"]');
|
|
132
133
|
await until(() => ip.evaluate(() => !!document.querySelector('#czViewer [data-ds-host] .cfb[contenteditable="true"]')), 30000);
|
|
133
134
|
await ip.click('#czViewer [data-ds-host] .cfb'); await ip.keyboard.press('Control+End'); await ip.keyboard.type(' Unsaved line.');
|
|
134
135
|
const nI = I.posts.filter((x) => x.path === '/api/core-docs/issue').length;
|
|
135
|
-
await ip.click('#czViewer [data-
|
|
136
|
+
await ip.click('#czViewer [data-czs-act="issue"]');
|
|
136
137
|
ok('I2 Issue it with unsaved edits posts nothing and says to save or cancel first', await until(() => ip.evaluate(() => /unsaved changes.*Save or cancel/.test((document.querySelector('#czViewer #dsErr') || {}).textContent || ''))) && I.posts.filter((x) => x.path === '/api/core-docs/issue').length === nI);
|
|
137
138
|
ok('I2 the ledger has no issue line for that draft yet', !ledger().some((l) => l.ev === 'issue' && l.slot === d2.slot && l.scope === iscope));
|
|
138
139
|
await ip.click('#czViewer [data-vd="cancel"]');
|
|
139
|
-
await until(() => ip.evaluate(() => !!document.querySelector('#czViewer [data-
|
|
140
|
+
await until(() => ip.evaluate(() => !!document.querySelector('#czViewer [data-czs-act="issue"]') && !!document.querySelector('#czViewer .dsbody')));
|
|
140
141
|
/* a refusal: someone else issues the same draft first (the console, a second tab) */
|
|
141
142
|
const raced = await fetch(BASE + '/api/core-docs/issue', { method: 'POST', headers: H, body: JSON.stringify({ ws: B.ws, scope: iscope, key: ikey, slot: d2.slot }) });
|
|
142
143
|
ok('I3 setup the draft is issued behind the page\'s back', raced.status === 200);
|
|
143
|
-
await ip.click('#czViewer [data-
|
|
144
|
+
await ip.click('#czViewer [data-czs-act="issue"]');
|
|
144
145
|
ok('I3 a refused press shows the server\'s words and the reader changes nothing else', await until(() => ip.evaluate(() => /already/.test((document.querySelector('#czViewer #dsErr') || {}).textContent || '') && !!document.querySelector('#czViewer [data-issue-bar="draft"]'))));
|
|
145
146
|
ok('I3 the refusal wrote no second issue line', ledger().filter((l) => l.ev === 'issue' && l.slot === d2.slot && l.scope === iscope).length === 1);
|
|
146
147
|
await I.ctx.close();
|
|
@@ -152,9 +153,9 @@ const BODY = '## Purpose\n\nWhy this board exists.\n\n## Scope\n\nWhat it covers
|
|
|
152
153
|
await until(() => jp.evaluate((k) => !!document.querySelector(`#czViewer [data-ov-dread="${k}"]`), k3), 60000);
|
|
153
154
|
await unfold(jp, `#czViewer [data-ov-dread="${k3}"]`);
|
|
154
155
|
await jp.click(`#czViewer [data-ov-dread="${k3}"]`);
|
|
155
|
-
await until(() => jp.evaluate(() => !!document.querySelector('#czViewer [data-
|
|
156
|
-
await jp.click('#czViewer [data-
|
|
157
|
-
const issued = !!(await toastIs(jp, /Issued\. Nothing was sent to anyone/)) && await until(() => jp.evaluate(() => !!document.querySelector('#czViewer [data-issue-bar="done"]') && !document.querySelector('#czViewer [data-
|
|
156
|
+
await until(() => jp.evaluate(() => !!document.querySelector('#czViewer [data-czs-act="issue"]')));
|
|
157
|
+
await jp.click('#czViewer [data-czs-act="issue"]');
|
|
158
|
+
const issued = !!(await toastIs(jp, /Issued\. Nothing was sent to anyone/)) && await until(() => jp.evaluate(() => !!document.querySelector('#czViewer [data-issue-bar="done"]') && !document.querySelector('#czViewer [data-czs-act="issue"]')));
|
|
158
159
|
await sleep(1500); await ovOpen(jp);
|
|
159
160
|
// shell A (XvADocs): an up-to-date document says nothing about its state (zero is silence); it is a plain Open press, not the draft reader
|
|
160
161
|
ok('I4 Issue it works from the reader: the toast, the issued bar, and the Overview row is a plain open, no longer a draft', issued && await until(() => jp.evaluate((k) => { const r = document.querySelector(`#czViewer [data-ov-doc="${k}"]`); return !!r && !!r.querySelector('[data-ov-open]') && !r.querySelector('[data-ov-dread]'); }, k3), 30000), JSON.stringify({ issued, row: await jp.evaluate((k) => ((document.querySelector(`#czViewer [data-ov-doc="${k}"]`) || {}).outerHTML || 'none').replace(/<svg.*?<\/svg>/g, '').slice(0, 400), k3) }));
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
* Change workflow, Won't do and Archive are Home's (ini-wf.js). Discuss in chat takes the question to Home. */
|
|
24
24
|
import * as IM from './impact.js'; // Your impact (batch 16 item 7): who made a delivered milestone happen
|
|
25
25
|
import * as VW from './cozy-viewer.js';
|
|
26
|
+
import * as SV from './small-vw.js'; // the one stakeholder form, Home's too (batch 18 item 2-C)
|
|
26
27
|
import { esc } from './premium-shell.js';
|
|
27
28
|
import { lr, copyText } from './cozy-xv.js';
|
|
28
29
|
import { iniView } from './ini-view-model.js';
|
|
@@ -105,18 +106,10 @@ function wfUi() {
|
|
|
105
106
|
return { openPop, closePop, undoToast: (t, undo) => O.toast(t, undo), toast: (t) => O.toast(t), pmGet, pmPost, load: async () => { if (O.reload) await O.reload(); },
|
|
106
107
|
row: byId, title: (id) => byId(id).title || id, bw: (id) => where(byId(id)) };
|
|
107
108
|
}
|
|
108
|
-
/** The stakeholder form,
|
|
109
|
+
/** The stakeholder form, Home's own (pm/small-vw.js, canvas OvA8People): a drill-in of the initiative, ✓ in the header adds, ← comes back. */
|
|
109
110
|
function addPerson(r) {
|
|
110
|
-
VW.
|
|
111
|
-
|
|
112
|
-
html: '<div class="hi-form"><label class="hi-field"><span>Name</span><input id="hpN" autocomplete="off"></label><label class="hi-field"><span>Role</span><input id="hpR" placeholder="e.g. Head of Sales"></label><label class="hi-field"><span>Note</span><input id="hpT" placeholder="What they care about"></label><div class="hi-acts"><button type="button" class="hi-btn dark" data-hp-add>Add</button></div></div>' });
|
|
113
|
-
setTimeout(() => { const i = body.querySelector('#hpN'); if (i) i.focus(); }, 0);
|
|
114
|
-
body.onclick = async (e) => {
|
|
115
|
-
if (!e.target.closest('[data-hp-add]')) return;
|
|
116
|
-
const name = body.querySelector('#hpN').value.trim(); if (!name) return;
|
|
117
|
-
const res = await pmPost('/api/home-desk/stakeholder', { ws: where(r).ws, initiative: r.id, name, role: body.querySelector('#hpR').value.trim(), note: body.querySelector('#hpT').value.trim() }).catch(() => null);
|
|
118
|
-
if (res && res.ok) { O.toast('Added ' + name + '.'); openIni(O.rowOf(r.key) || r); } else O.toast((res && res.error) || 'Not added.');
|
|
119
|
-
};
|
|
111
|
+
SV.openPersonForm({ VW, pmPost: (u, b) => pmPost(u, b), toast: (t, undo) => O.toast(t, undo), ws: where(r).ws, ini: r.id, iniTitle: r.title,
|
|
112
|
+
saved: async () => { if (O.reload) await O.reload(); }, back: () => VW.back() });
|
|
120
113
|
}
|
|
121
114
|
function iniMore(r) {
|
|
122
115
|
const id = r.id;
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
.cz .ev-dot.you { background: var(--cz-blue); } .cz .ev-dot.risk { background: var(--cz-dot-risk); } .cz .ev-dot.ok { background: var(--cz-dot-ok); } .cz .ev-dot.none { background: transparent; }
|
|
46
46
|
.cz .ev-av { width: 22px; height: 22px; border-radius: 50%; background: var(--cz-well2); color: var(--cz-ink2); font-size: var(--fs-1); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
|
|
47
47
|
.cz .ev-av.b { background: var(--cz-bluebg); color: var(--cz-blueink); }
|
|
48
|
+
.cz .ev-av.sp { border-radius: 7px; background: var(--cz-bluebg); color: var(--cz-blue); }
|
|
48
49
|
.cz .ev-trow { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--cz-hair); font-size: var(--fs-3); color: var(--cz-ink); }
|
|
49
50
|
.cz .ev-trow:last-child { border-bottom: 0; }
|
|
50
51
|
.cz .ev-trow p { margin: 0; }
|
|
@@ -252,3 +253,31 @@
|
|
|
252
253
|
.ev-st .ev-ib-sp { width: 32px; flex: none; }
|
|
253
254
|
.ev-st-nav .ev-mi .ev-dot.risk { margin-left: 6px; }
|
|
254
255
|
.ev-st .ev-rl { margin: 4px 0; }
|
|
256
|
+
|
|
257
|
+
/* New for you's item Viewers (batch 18 items 2 and 2b, canvas OvA5Overlap, OvA6Given): the summary, then the two initiatives, the pick and ONE primary */
|
|
258
|
+
.nv { display: flex; flex-direction: column; gap: 10px; }
|
|
259
|
+
.nv-ini, .nv-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 14px; border: 1px solid var(--cz-hair); border-radius: 14px; background: var(--cz-card); color: var(--cz-ink); text-align: left; font: inherit; cursor: pointer; }
|
|
260
|
+
.nv-ini:hover, .nv-opt:hover { background: var(--cz-well); }
|
|
261
|
+
.nv-it { width: 32px; height: 32px; border-radius: 10px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--cz-bluebg); color: var(--cz-blueink); }
|
|
262
|
+
.nv-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
|
|
263
|
+
.nv-tx b { font-size: var(--fs-3); font-weight: 800; overflow-wrap: anywhere; }
|
|
264
|
+
.nv-tx em { font-style: normal; font-size: var(--fs-1); color: var(--cz-ink3); }
|
|
265
|
+
.nv-nth { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--cz-well2); color: var(--cz-ink2); font-size: var(--fs-1); font-weight: 800; }
|
|
266
|
+
.nv-opts { display: flex; flex-direction: column; gap: 8px; }
|
|
267
|
+
.nv-opt { align-items: flex-start; }
|
|
268
|
+
.nv-opt.on { border-color: var(--cz-blue); background: var(--cz-bluebg); }
|
|
269
|
+
.nv-rd { width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--cz-ink3); flex: none; box-sizing: border-box; }
|
|
270
|
+
.nv-opt.on .nv-rd { border: 5px solid var(--cz-blue); }
|
|
271
|
+
.nv-rec { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--cz-card); color: var(--cz-blueink); font-size: var(--fs-1); font-weight: 800; vertical-align: 1px; }
|
|
272
|
+
.nv-go { padding-top: 2px; }
|
|
273
|
+
.nv-pri svg { flex: none; }
|
|
274
|
+
.nv-parts { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 6px; color: var(--cz-ink2); }
|
|
275
|
+
.nv-sp { display: inline-flex; vertical-align: -2px; margin-right: 6px; color: var(--cz-blue); }
|
|
276
|
+
.nv-when { display: flex; flex-wrap: wrap; gap: 8px; }
|
|
277
|
+
.nv-rows { border: 1px solid var(--cz-hair); border-radius: 14px; background: var(--cz-card); overflow: hidden; }
|
|
278
|
+
.nv-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 14px; border: 0; background: none; color: var(--cz-ink); font: inherit; text-align: left; cursor: pointer; }
|
|
279
|
+
.nv-row + .nv-row { border-top: 1px solid var(--cz-hair); }
|
|
280
|
+
.nv-row:disabled { cursor: default; }
|
|
281
|
+
.nv-row b { flex: none; font-weight: 800; }
|
|
282
|
+
.nv-row span { flex: 1; min-width: 0; text-align: right; color: var(--cz-ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
283
|
+
.nv-row svg { flex: none; color: var(--cz-ink3); }
|
|
@@ -3,16 +3,23 @@
|
|
|
3
3
|
*
|
|
4
4
|
* For your information only: Given to you, Finished while you were away (GET /api/news-for-you), and today's digests from the morning
|
|
5
5
|
* brief (GET /api/briefing-premium). Mentions owns every mention (batch 16 item 12), so none is here. An item leaves once it is seen: the
|
|
6
|
-
* items shown are marked seen when the card closes, and Mark all seen marks them at once (POST /api/news-for-you/seen). Open on a row
|
|
7
|
-
* the item
|
|
6
|
+
* items shown are marked seen when the card closes, and Mark all seen marks them at once (POST /api/news-for-you/seen). Open on a row opens
|
|
7
|
+
* the item as its own Viewer, one step in the trail, so the Viewer's ← comes back to the list (batch 18 item 2: one header, no second
|
|
8
|
+
* "New for you" back press); finished work opens where it waits. The page's meetings ring, its two legend cards, "Where
|
|
8
9
|
* the rest went" and the "Not here" note are gone (FmAudit: Your day holds the meetings, and a page that explains itself is chrome).
|
|
9
|
-
*
|
|
10
|
+
* The item Viewers (batch 18 items 2 and 2b, canvas OvA5Overlap, OvA6Given), summary first with ONE primary:
|
|
11
|
+
* overlap Claude proposes: both initiatives by name with their stage and owner, "N of M parts overlap" and how sure when the agent said so,
|
|
12
|
+
* and the pick. Keep both, in this order (Claude's pick: POST /api/driver/keep) · Merge (Home's merge check with both set, through
|
|
13
|
+
* go({ merge })) · Not an overlap (POST /api/driver/drop, and /api/boards/notdup so the Board stops flagging the pair too).
|
|
14
|
+
* task Given to you: what it asks, when it is due, where it came from. The agent's part only as it really is: its draft ready
|
|
15
|
+
* ("Read my draft"), drafting now, or its offer ("Draft it": POST /api/my-work/act brief). Done, Not before… and ↗ its source in place.
|
|
16
|
+
* openNews({ go?, view? }) → the body element; view: an item's id opens straight on that item. go(d): Home's own opener ({ ini } | { merge }) */
|
|
10
17
|
import { pmGet, pmPost } from './http.js';
|
|
11
|
-
import { open as vwOpen, current as vwCurrent } from './cozy-viewer.js';
|
|
18
|
+
import { open as vwOpen, current as vwCurrent, back as vwBack, czSummary, czSections } from './cozy-viewer.js';
|
|
12
19
|
import { esc, svg, ICON, toast, wsParam, wsQ, skelRows, cantRead, allClear } from './cozy-evui.js';
|
|
13
20
|
import { initials, ago } from './cozy-evmodel.js';
|
|
14
21
|
|
|
15
|
-
const N = { r: null, dig: null, view: '', body: null, shown: new Set(), busy: false };
|
|
22
|
+
const N = { r: null, dig: null, view: '', body: null, shown: new Set(), busy: false, go: null };
|
|
16
23
|
const homeUrl = (params) => { const q = new URLSearchParams(params); if (wsParam()) q.set('ws', wsParam()); return '/premium.html?' + q.toString(); };
|
|
17
24
|
const https = (u) => (/^https:\/\/\S+$/i.test(String(u || '')) ? u : '');
|
|
18
25
|
/** The deep link of a finished item, as the bell's was: a My work item opens its dialog; anything else opens on Home. */
|
|
@@ -21,10 +28,13 @@ const finHref = (it) => (/^item:/.test(it.open) ? homeUrl({ item: it.open.slice(
|
|
|
21
28
|
function items() { return N.r && N.r.ok ? N.r.groups.flatMap((g) => g.items) : []; }
|
|
22
29
|
function rowHtml(it) {
|
|
23
30
|
const who = it.kind === 'task' ? (it.from || 'Someone') : (it.product || 'Agent');
|
|
24
|
-
|
|
25
|
-
const
|
|
31
|
+
// an overlap note is Claude's proposal (batch 18 item 2b): the ✦ tile and both initiatives by name, never an id or "a source"
|
|
32
|
+
const av = it.kind === 'overlap' ? `<span class="ev-av sp" aria-hidden="true">${svg(SPARK, 15)}</span>` : `<span class="ev-av${it.kind === 'finished' ? ' b' : ''}" aria-hidden="true">${esc(initials(who))}</span>`;
|
|
33
|
+
const sub = it.kind === 'overlap' ? [[it.a && it.a.title, it.b && it.b.title].filter(Boolean).join(' and ') || 'Two open initiatives', it.at ? ago(new Date(it.at).toISOString()) : ''].filter(Boolean).join(' · ')
|
|
34
|
+
: it.kind === 'task' ? [it.from ? 'From ' + it.from + (it.key ? ' ' + it.key : '') : it.key, it.due ? 'due ' + dayWords(it.due) : '', it.iniTitle ? 'filed under ' + it.iniTitle : ''].filter(Boolean).join(' · ')
|
|
26
35
|
: [it.what, it.product, it.target, it.at ? ago(new Date(it.at).toISOString()) : ''].filter(Boolean).join(' · ');
|
|
27
|
-
|
|
36
|
+
const title = it.kind === 'task' ? String(it.title || '').replace(/^New task: /, '') : it.title;
|
|
37
|
+
return `<div class="ev-trow" data-ev-id="${esc(it.id)}"><i class="ev-dot you" aria-hidden="true"></i>${av}<div class="ev-tx"><p><b>${esc(title)}</b></p><p class="ev-small ev-mut">${esc(sub)}</p></div>`
|
|
28
38
|
+ `<button type="button" class="ev-ib" data-ev-open="${esc(it.id)}" aria-label="Open: ${esc(it.title)}" title="Open">${svg(ICON.open, 16)}</button></div>`;
|
|
29
39
|
}
|
|
30
40
|
function digHtml() {
|
|
@@ -43,25 +53,20 @@ function listHtml() {
|
|
|
43
53
|
const notRead = r && r.ok && r.read ? [['inbox', 'The agents\' results'], ['work', 'Your tasks']].filter(([k]) => r.read[k] === false).map(([, l]) => l) : [];
|
|
44
54
|
return head + body + (notRead.length ? `<p class="ev-small ev-mut" role="status">Not read: ${esc(notRead.join(', '))}.</p>` : '') + digHtml();
|
|
45
55
|
}
|
|
46
|
-
function detailHtml(it) {
|
|
47
|
-
const back = '<div class="ev-head"><button type="button" class="ev-btn sm ghost" data-ev-back>' + svg(ICON.back, 16) + 'New for you</button></div>';
|
|
48
|
-
const l = https(it.link);
|
|
49
|
-
return back + `<p class="ev-lbl">Given to you · ${esc(it.from || 'a source')}</p><h2 class="ev-h2">${esc(it.title.replace(/^New task: /, ''))}</h2>`
|
|
50
|
-
+ `<p class="ev-small ev-mut">${esc([it.key, it.due ? 'due ' + it.due : '', it.initiative ? 'filed under ' + it.initiative : ''].filter(Boolean).join(' · '))}</p>`
|
|
51
|
-
+ `<div class="ev-acts"><a class="ev-btn sm pri" href="${esc(homeUrl({ item: it.tid }))}">Open in Home</a>${l ? `<a class="ev-btn sm" href="${esc(l)}" target="_blank" rel="noopener noreferrer">Open in ${esc(it.from || 'its source')}</a>` : ''}</div>`;
|
|
52
|
-
}
|
|
53
56
|
function draw() {
|
|
54
57
|
const b = N.body; if (!b || !b.isConnected) return;
|
|
55
58
|
{ const c = vwCurrent(); if (!c || c.id !== 'news') return; } // the Viewer moved on to another item: a late read draws nothing
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (!it) for (const x of items()) N.shown.add(x.id);
|
|
59
|
+
b.innerHTML = listHtml();
|
|
60
|
+
for (const x of items()) N.shown.add(x.id);
|
|
59
61
|
}
|
|
60
62
|
async function read() {
|
|
61
63
|
const [r, d] = await Promise.all([pmGet('/api/news-for-you' + wsQ()), N.dig ? Promise.resolve(null) : pmGet('/api/briefing-premium' + wsQ())]);
|
|
62
64
|
N.r = r && r.ok ? r : { ok: false, error: (r && r.error) || 'the server did not answer' };
|
|
63
65
|
if (d && d.ok && d.model) { const T = d.model.today || {}; N.dig = [].concat(T.earlier || [], T.ahead || []).filter((e) => e && e.kind === 'digest'); }
|
|
64
|
-
|
|
66
|
+
// opened straight on one item (Your day's fold): its own Viewer, once the list is read; an item gone since shows the list
|
|
67
|
+
const it = N.view && items().find((x) => x.id === N.view);
|
|
68
|
+
N.view = '';
|
|
69
|
+
if (it && it.kind !== 'finished') openItem(it, { fresh: true }); else draw();
|
|
65
70
|
if (N.r.ok) document.dispatchEvent(new CustomEvent('cz:news', { detail: { count: N.r.count } }));
|
|
66
71
|
}
|
|
67
72
|
/** Mark ids seen; the count in the menu follows. */
|
|
@@ -74,7 +79,12 @@ async function seen(ids) {
|
|
|
74
79
|
}
|
|
75
80
|
|
|
76
81
|
export function openNews(o = {}) {
|
|
77
|
-
N.view = o.view || ''; N.shown = new Set(o.
|
|
82
|
+
N.view = o.view || ''; N.shown = new Set(); N.go = typeof o.go === 'function' ? o.go : null;
|
|
83
|
+
if (N.view) { read(); return null; } // straight onto one item: its Viewer opens once the list is read
|
|
84
|
+
return openList(o);
|
|
85
|
+
}
|
|
86
|
+
function openList(o = {}) {
|
|
87
|
+
// ← from an item draws the list again and reads it again, so what was seen has left
|
|
78
88
|
N.body = vwOpen({ id: 'news', kind: 'For your information', title: 'New for you', icon: ICON.news, render: (b) => { b.classList.add('ev-card-b', 'ev-news'); N.body = b; draw(); wire(b, o); },
|
|
79
89
|
onClose: () => { const ids = [...N.shown]; N.shown = new Set(); seen(ids); } }); // an item leaves once seen: what the card showed is seen when it closes
|
|
80
90
|
read();
|
|
@@ -85,7 +95,6 @@ function wire(b, o) {
|
|
|
85
95
|
const t = e.target.closest('button'); if (!t || N.busy) return;
|
|
86
96
|
if ('evRetry' in t.dataset) { N.r = null; draw(); read(); return; }
|
|
87
97
|
if ('evSources' in t.dataset) { import('./cozy-settings.js').then((M) => M.openSettings('connectors')); return; }
|
|
88
|
-
if ('evBack' in t.dataset) { N.view = ''; draw(); const f = b.querySelector('[data-ev-open]'); if (f) f.focus(); return; }
|
|
89
98
|
if ('evAll' in t.dataset) {
|
|
90
99
|
N.busy = true; const ids = items().map((x) => x.id);
|
|
91
100
|
const ok = await seen(ids); N.busy = false;
|
|
@@ -96,10 +105,165 @@ function wire(b, o) {
|
|
|
96
105
|
const it = items().find((x) => x.id === t.dataset.evOpen); if (!it) return;
|
|
97
106
|
N.shown.add(it.id);
|
|
98
107
|
if (it.kind === 'finished') { await seen([it.id]); location.assign(finHref(it)); return; }
|
|
99
|
-
|
|
108
|
+
openItem(it); return;
|
|
100
109
|
}
|
|
101
110
|
};
|
|
102
111
|
void o;
|
|
103
112
|
}
|
|
104
113
|
/** Still open on this item? For a page that redraws around the Viewer. */
|
|
105
114
|
export const isNewsOpen = () => { const c = vwCurrent(); return !!(c && c.id === 'news'); };
|
|
115
|
+
|
|
116
|
+
/* ── one item, as its own Viewer (batch 18 items 2 and 2b) ── */
|
|
117
|
+
const SPARK = 'M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z';
|
|
118
|
+
const TASK = 'M5 5h14v14H5zM8.5 12l2.5 2.5 4.5-5';
|
|
119
|
+
const CHEV = 'M9 6l6 6-6 6';
|
|
120
|
+
const INI = 'M12 4a8 8 0 1 0 0 16a8 8 0 1 0 0-16M12 9a3 3 0 1 0 0 6a3 3 0 1 0 0-6';
|
|
121
|
+
const P = { check: 'M5 12l4.5 4.5L19 7', clock: 'M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18M12 7v5l3 2', open: 'M14 4h6v6M20 4l-9 9M18 14v5H5V6h5', doc: 'M7 3h7l5 5v13H7zM14 3v5h5' };
|
|
122
|
+
const WD = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
|
123
|
+
const MO = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
124
|
+
/** "today", "tomorrow", "Thursday" (this week), else "Oct 30". Pure. */
|
|
125
|
+
export function dayWords(iso, now = Date.now()) {
|
|
126
|
+
const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); if (!m) return '';
|
|
127
|
+
const d = new Date(+m[1], +m[2] - 1, +m[3]), t = new Date(now); t.setHours(0, 0, 0, 0);
|
|
128
|
+
const n = Math.round((d - t) / 864e5);
|
|
129
|
+
return n === 0 ? 'today' : n === 1 ? 'tomorrow' : n > 1 && n < 7 ? WD[d.getDay()] : MO[d.getMonth()] + ' ' + d.getDate();
|
|
130
|
+
}
|
|
131
|
+
const whose = (owner) => (!owner ? 'no owner' : /^(you|me|pm)$/i.test(owner) ? 'yours' : owner + '’s');
|
|
132
|
+
const sureWord = { high: 'high', medium: 'medium', low: 'low' };
|
|
133
|
+
|
|
134
|
+
function openItem(it, o = {}) {
|
|
135
|
+
if (it.kind === 'overlap') return openOverlap(it, o);
|
|
136
|
+
if (it.kind === 'task') return openGiven(it, o);
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
/** After a pick: the item is seen, and the Viewer steps back (to the list, or to where it was opened from). */
|
|
140
|
+
async function doneWith(it, id) {
|
|
141
|
+
await seen([it.id]);
|
|
142
|
+
if (N.r && N.r.ok) { N.r = { ...N.r, count: Math.max(0, N.r.count - 1), groups: N.r.groups.map((g) => ({ ...g, items: g.items.filter((x) => x.id !== it.id) })).filter((g) => g.items.length) }; }
|
|
143
|
+
const c = vwCurrent(); if (c && c.id === id) vwBack();
|
|
144
|
+
}
|
|
145
|
+
const goIni = (id) => { if (N.go) N.go({ ini: id }); else location.assign(homeUrl({ ini: id })); };
|
|
146
|
+
|
|
147
|
+
/* the overlap note (OvA5Overlap): Claude proposes; both initiatives read from the Board, so each has its name, stage and owner */
|
|
148
|
+
function openOverlap(it, o = {}) {
|
|
149
|
+
const id = 'news:' + it.id, V = { a: null, b: null, pick: 'keep', busy: false };
|
|
150
|
+
const O = it.overlap || {};
|
|
151
|
+
const first = O.first === 'other' ? 'b' : O.first === 'this' ? 'a' : '';
|
|
152
|
+
const nameOf = (k) => (V[k] && V[k].title) || it[k].title || 'the other initiative';
|
|
153
|
+
const when = it.at ? ago(new Date(it.at).toISOString()) : '';
|
|
154
|
+
const draw = (body) => {
|
|
155
|
+
if (!body || !body.isConnected) return;
|
|
156
|
+
const one = first ? first : 'a', two = one === 'a' ? 'b' : 'a';
|
|
157
|
+
const card = (k) => {
|
|
158
|
+
const r = V[k], sub = r ? [r.stage, whose(r.owner)].filter(Boolean).join(' · ') : (V.read ? '' : 'Reading…');
|
|
159
|
+
const nth = first ? (k === one ? '1st' : '2nd') : '';
|
|
160
|
+
return `<button type="button" class="nv-ini" data-nv-ini="${esc(k)}" aria-label="${esc('Open ' + nameOf(k))}"><span class="nv-it" aria-hidden="true">${svg(INI, 16)}</span><span class="nv-tx"><b>${esc(nameOf(k))}</b>${sub ? `<em>${esc(sub)}</em>` : ''}</span>${nth ? `<span class="nv-nth">${nth}</span>` : ''}</button>`;
|
|
161
|
+
};
|
|
162
|
+
const parts = O.parts && O.of ? `${O.parts} of ${O.of} parts overlap` : '';
|
|
163
|
+
const text = O.text || it.why || `${nameOf('a')} and ${nameOf('b')} may cover the same work.`;
|
|
164
|
+
const sure = O.sure ? 'How sure: ' + sureWord[O.sure] + '.' + (O.sureWhy ? ' ' + O.sureWhy : '') : '';
|
|
165
|
+
const keepWhy = first ? (O.firstWhy || `${nameOf(one)} goes first, then ${nameOf(two)}.`) + ' I keep the order on record.' : 'Both stay as they are. I keep the note on record.';
|
|
166
|
+
const choices = [
|
|
167
|
+
['keep', first ? 'Keep both, in this order' : 'Keep both', keepWhy, true],
|
|
168
|
+
['merge', 'Merge into ' + nameOf(one), 'Opens Merge with both set. You see what moves first.', false],
|
|
169
|
+
['not', 'Not an overlap', 'I stop flagging this pair.', false],
|
|
170
|
+
];
|
|
171
|
+
const opts = `<div class="nv-opts" role="radiogroup" aria-label="What to do">${choices.map(([k, l, w, rec]) => `<button type="button" role="radio" class="nv-opt${V.pick === k ? ' on' : ''}" aria-checked="${V.pick === k}" data-nv-pick="${k}"><span class="nv-rd" aria-hidden="true"></span><span class="nv-tx"><b>${esc(l)}${rec ? ' <span class="nv-rec">I’d do this</span>' : ''}</b><em>${esc(w)}</em></span></button>`).join('')}</div>`;
|
|
172
|
+
const lbl = choices.find((c) => c[0] === V.pick)[1];
|
|
173
|
+
const go = `<div class="nv-go"><button type="button" class="czs-pri nv-pri" data-nv-go${V.busy ? ' disabled' : ''}>${svg(P.check, 16)}<span>${esc(lbl)}</span></button></div>`;
|
|
174
|
+
const items = Array.isArray(O.items) && O.items.length ? czSections([{ id: 'parts', title: O.items.length === 1 ? 'The part that overlaps' : 'The ' + O.items.length + ' parts that overlap', count: O.items.length,
|
|
175
|
+
html: `<ul class="nv-parts">${O.items.map((x) => `<li>${esc(x)}</li>`).join('')}</ul>` }], { key: 'news-overlap' }) : '';
|
|
176
|
+
body.innerHTML = `<div class="nv">${czSummary({ line: parts, tone: parts ? 'you' : '', text, meta: sure })}${card(one)}${card(two)}${opts}${go}${items}</div>`;
|
|
177
|
+
};
|
|
178
|
+
vwOpen({ id, kind: 'Claude proposes', title: 'Possible overlap', icon: SPARK, sub: ['Claude noticed', when].filter(Boolean).join(' · '), fresh: !!o.fresh,
|
|
179
|
+
more: [{ label: 'Open ' + nameOf('a'), on: () => goIni(it.a.id) }, { label: 'Open ' + nameOf('b'), on: () => goIni(it.b.id) }],
|
|
180
|
+
onClose: () => { if (o.fresh) seen([it.id]); },
|
|
181
|
+
render: (body) => {
|
|
182
|
+
body.classList.add('ev-card-b');
|
|
183
|
+
draw(body);
|
|
184
|
+
if (!V.read) {
|
|
185
|
+
Promise.all(['a', 'b'].map((k) => pmGet('/api/boards/initiative?ws=' + encodeURIComponent(it.ws) + '&id=' + encodeURIComponent(it[k].id)).catch(() => null)))
|
|
186
|
+
.then(([ra, rb]) => { V.read = true; for (const [k, r] of [['a', ra], ['b', rb]]) if (r && r.ok && r.row) V[k] = { title: r.row.title, stage: r.row.stage, owner: r.row.owner, board: (r.board || {}).id || '' }; draw(body); });
|
|
187
|
+
}
|
|
188
|
+
body.onclick = async (e) => {
|
|
189
|
+
const t = e.target.closest('button'); if (!t || V.busy) return;
|
|
190
|
+
if (t.dataset.nvPick) { V.pick = t.dataset.nvPick; draw(body); const f = body.querySelector(`[data-nv-pick="${V.pick}"]`); if (f) f.focus(); return; }
|
|
191
|
+
if (t.dataset.nvIni) { goIni(it[t.dataset.nvIni].id); return; }
|
|
192
|
+
if (!('nvGo' in t.dataset)) return;
|
|
193
|
+
const one = first || 'a', two = one === 'a' ? 'b' : 'a';
|
|
194
|
+
if (V.pick === 'merge') { await seen([it.id]); if (N.go) N.go({ merge: { from: it[two].id, into: it[one].id } }); else location.assign(homeUrl({ ini: it[two].id })); return; }
|
|
195
|
+
V.busy = true; draw(body);
|
|
196
|
+
let ok = false, err = '';
|
|
197
|
+
if (V.pick === 'keep') {
|
|
198
|
+
const r = await pmPost('/api/driver/keep', { ws: it.ws, proposal: it.pid }).catch(() => null);
|
|
199
|
+
ok = !!(r && r.ok); err = (r && r.error) || '';
|
|
200
|
+
if (ok) toast(first ? 'Kept both: ' + nameOf(one) + ' first.' : 'Kept both.');
|
|
201
|
+
} else {
|
|
202
|
+
const r = await pmPost('/api/driver/drop', { ws: it.ws, proposal: it.pid, note: 'Not an overlap with ' + it.b.id }).catch(() => null);
|
|
203
|
+
ok = !!(r && r.ok); err = (r && r.error) || '';
|
|
204
|
+
// the Board's own duplicate flag stops for the pair too; the note is dropped either way
|
|
205
|
+
const bd = (V.a && V.a.board) || (V.b && V.b.board) || '';
|
|
206
|
+
if (ok && bd) await pmPost('/api/boards/notdup', { ws: it.ws, board: bd, id: it.a.id, of: it.b.id }).catch(() => null);
|
|
207
|
+
if (ok) toast('Not an overlap. I won’t flag this pair again.');
|
|
208
|
+
}
|
|
209
|
+
V.busy = false;
|
|
210
|
+
if (!ok) { draw(body); toast('That did not go through' + (err ? ': ' + err : '.')); return; }
|
|
211
|
+
doneWith(it, id);
|
|
212
|
+
};
|
|
213
|
+
} });
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* a task given to you (OvA6Given): what it asks, due, from whom; the agent's part only as it really is; Done, Not before… and ↗ in place */
|
|
217
|
+
function openGiven(it, o = {}) {
|
|
218
|
+
const id = 'news:' + it.id, V = { busy: false, when: false, agent: it.agent || null };
|
|
219
|
+
const title = String(it.title || '').replace(/^New task: /, '');
|
|
220
|
+
const link = https(it.link);
|
|
221
|
+
const draw = (body) => {
|
|
222
|
+
if (!body || !body.isConnected) return;
|
|
223
|
+
const a = V.agent, due = it.due ? 'Due ' + dayWords(it.due) : '';
|
|
224
|
+
let text = '', primary = null, line = due, tone = due ? 'you' : '';
|
|
225
|
+
if (a && a.state === 'ready') { text = a.draft ? 'I drafted it: ' + a.draft : 'I drafted it. It waits for you to read.'; primary = { label: 'Read my draft', act: 'read' }; }
|
|
226
|
+
else if (a && ['queued', 'working', 'sending'].includes(a.state)) { text = 'I’m drafting it now. It shows here when it is ready.'; line = due || 'Drafting'; tone = 'live'; }
|
|
227
|
+
else if (a && a.state === 'failed') { text = 'I couldn’t finish the draft.'; primary = { label: 'Try again', act: 'draft' }; }
|
|
228
|
+
else if (a && a.state === 'suggest') { text = a.suggest ? 'I can ' + a.suggest.charAt(0).toLowerCase() + a.suggest.slice(1).replace(/\.?$/, '.') : 'I can draft it for you.'; primary = { label: 'Draft it', act: 'draft' }; }
|
|
229
|
+
else if (it.why) text = it.why;
|
|
230
|
+
const offer = text && a ? `<span class="nv-sp" aria-hidden="true">${svg(SPARK, 14)}</span>` : '';
|
|
231
|
+
const also = [{ act: 'done', label: 'Done', icon: P.check }, { act: 'later', label: 'Not before…', icon: P.clock }, link ? { act: 'src', label: 'Open in ' + (it.from || 'its source'), icon: P.open } : null];
|
|
232
|
+
const when = V.when ? `<div class="nv-when" role="group" aria-label="Not before">${[['later-today', 'Later today'], ['tomorrow', 'Tomorrow'], ['next-week', 'Next week']].map(([k, l]) => `<button type="button" class="ev-btn sm" data-nv-when="${k}">${l}</button>`).join('')}</div>` : '';
|
|
233
|
+
// where it came from and where it is filed: one quiet row each, the value on the right; a press opens it
|
|
234
|
+
const row = (act, k, v) => `<button type="button" class="nv-row" data-czs-act="${act}"${act ? '' : ' disabled'}><b>${esc(k)}</b><span>${esc(v)}</span>${act ? svg(CHEV, 15) : ''}</button>`;
|
|
235
|
+
const rows = [it.from ? row(link ? 'src' : '', 'From ' + it.from, it.status || it.key || '') : '', it.iniTitle ? row('ini', 'Filed under', it.iniTitle) : ''].filter(Boolean);
|
|
236
|
+
const secs = rows.length ? `<div class="nv-rows">${rows.join('')}</div>` : '';
|
|
237
|
+
body.innerHTML = `<div class="nv">${czSummary({ line, tone, text: text ? offer + esc(text) : '', textHtml: true, primary: primary && !V.busy ? primary : primary ? { ...primary, disabled: true } : null, also })}${when}${secs}</div>`;
|
|
238
|
+
};
|
|
239
|
+
vwOpen({ id, kind: 'Given to you', title, icon: TASK, sub: ['From ' + (it.from || 'your work'), it.key].filter(Boolean).join(' · '), fresh: !!o.fresh,
|
|
240
|
+
more: [link ? { label: 'Open in ' + (it.from || 'its source'), on: () => window.open(link, '_blank', 'noopener') } : null, { label: 'Open in your work', on: () => location.assign(homeUrl({ item: it.tid })) }].filter(Boolean),
|
|
241
|
+
onClose: () => { if (o.fresh) seen([it.id]); },
|
|
242
|
+
render: (body) => {
|
|
243
|
+
body.classList.add('ev-card-b');
|
|
244
|
+
draw(body);
|
|
245
|
+
body.onclick = async (e) => {
|
|
246
|
+
const t = e.target.closest('button'); if (!t || V.busy) return;
|
|
247
|
+
const act = t.dataset.czsAct || '';
|
|
248
|
+
if (act === 'src') { if (link) window.open(link, '_blank', 'noopener'); return; }
|
|
249
|
+
if (act === 'ini') { if (it.initiative) goIni(it.initiative); return; }
|
|
250
|
+
if (act === 'read') { location.assign(homeUrl({ item: it.tid })); return; }
|
|
251
|
+
if (act === 'later') { V.when = !V.when; draw(body); const f = body.querySelector('[data-nv-when]'); if (f) f.focus(); return; }
|
|
252
|
+
if (act === 'draft') {
|
|
253
|
+
V.busy = true; draw(body);
|
|
254
|
+
const r = await pmPost('/api/my-work/act', { action: 'brief', item: it.tid, ws: wsParam() || undefined }).catch(() => null);
|
|
255
|
+
V.busy = false;
|
|
256
|
+
if (!r || !r.ok) { draw(body); toast('The draft did not start' + (r && r.error ? ': ' + r.error : '.')); return; }
|
|
257
|
+
V.agent = { ...(V.agent || {}), state: 'queued' }; draw(body); toast('I’m drafting it.'); return;
|
|
258
|
+
}
|
|
259
|
+
if (act === 'done' || t.dataset.nvWhen) {
|
|
260
|
+
V.busy = true;
|
|
261
|
+
const r = act === 'done' ? await pmPost('/api/pm-items/done', { id: it.tid }).catch(() => null) : await pmPost('/api/pm-items/notyet', { id: it.tid, when: t.dataset.nvWhen }).catch(() => null);
|
|
262
|
+
V.busy = false;
|
|
263
|
+
if (!r || !r.ok) { toast('That did not go through' + (r && r.error ? ': ' + r.error : '.')); return; }
|
|
264
|
+
toast(act === 'done' ? 'Done.' : 'Put off: ' + t.textContent.toLowerCase() + '.');
|
|
265
|
+
doneWith(it, id);
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
} });
|
|
269
|
+
}
|
|
@@ -444,6 +444,10 @@ body.cz-home .hv-r.sp-on + .hv-r::before { display: none; }
|
|
|
444
444
|
.hv-card .hv-r.two .hm-rm { min-height: 58px; }
|
|
445
445
|
}
|
|
446
446
|
body.cz-home .hm-hd.hv-bar { padding: 0; }
|
|
447
|
+
/* batch 18 item 10: the greeting is never cut. When it and the controls do not fit on one line, the controls go to a second line on the right, together */
|
|
448
|
+
body.cz-home .hm-hd.hv-bar { flex-wrap: wrap; height: auto; min-height: 44px; }
|
|
449
|
+
body.cz-home .hm-hd.hv-bar > .hv-hi { flex: 1 0 auto; max-width: 100%; }
|
|
450
|
+
.hv-acts { display: flex; align-items: center; gap: inherit; margin-left: auto; }
|
|
447
451
|
|
|
448
452
|
/* A session's context (batch 13 item 8, XctxA1Desk): the pie sits at the row's end. Claude's ✦ Compact uses item 7's ✦ and ✓ (.hm-sv, .hm-cls) */
|
|
449
453
|
.hm-rm .cz-ctx { margin: 0 6px 0 8px; }
|
|
@@ -500,6 +504,7 @@ body.cz-home .hm-hd.hv-bar { padding: 0; }
|
|
|
500
504
|
.yd-nd { width: 8px; height: 8px; border-radius: 4px; background: var(--cz-blue); flex: none; margin-top: 12px; }
|
|
501
505
|
.yd-av { width: 32px; height: 32px; border-radius: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--cz-well); color: var(--cz-ink2); font-size: var(--fs-1); font-weight: 800; }
|
|
502
506
|
.yd-av.b { background: var(--cz-bluebg); color: var(--cz-blueink); }
|
|
507
|
+
.yd-av.sp { background: var(--cz-bluebg); color: var(--cz-blue); border-radius: 10px; }
|
|
503
508
|
.yd-nw .yd-mt b { font-weight: 600; }
|
|
504
509
|
.yd-more { align-self: flex-start; border: 0; background: none; padding: 6px 6px 8px 58px; min-height: 36px; font: inherit; font-size: var(--fs-3); font-weight: 700; color: var(--cz-blueink); cursor: pointer; }
|
|
505
510
|
.yd-all { width: 40px; height: 40px; border-radius: 20px; border: 0; background: none; color: var(--cz-ink2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
|
|
@@ -36,8 +36,9 @@
|
|
|
36
36
|
* sub one quiet line under the title: what the item is when the title is its parent's name (a program's "Charter", canvas MsBCharter)
|
|
37
37
|
* chip { n, label, on(button) }: the blue ✦ with its count right after the title (what Claude proposes on an initiative, batch 12
|
|
38
38
|
* items 2, 3 and 4, canvas In development PiA0/TpA1). Hidden at zero. setChip(id, chip) changes it while the item is shown.
|
|
39
|
-
* presses [{ act, label, icon, text?, solid?, pressed? }]: the item's own presses before ⋯ (a program's charter icon, canvas MsB0Entry; the
|
|
40
|
-
* charter's Save, MsBCharter). text draws the word beside the icon (not on a phone); solid is the one dark primary
|
|
39
|
+
* presses [{ act, label, icon, text?, solid?, blue?, pressed? }]: the item's own presses before ⋯ (a program's charter icon, canvas MsB0Entry; the
|
|
40
|
+
* charter's Save, MsBCharter). text draws the word beside the icon (not on a phone); solid is the one dark primary; blue
|
|
41
|
+
* makes it the round blue ✓ a form saves with (batch 18 item 2-C, canvas OvA8People, OvA9Docs).
|
|
41
42
|
* onPress(act, button) runs them. setPresses(id, list) changes them while the item is shown (Save shows only after a change).
|
|
42
43
|
* guard (go, anchor) → true when the item holds unsaved changes and asks first: Close, ←, Escape and another open() call it, and
|
|
43
44
|
* nothing leaves until the caller runs go() (canvas MsB5Leave: Save or Discard). false or none: it leaves at once.
|
|
@@ -134,7 +135,7 @@ export function headHtml(it) {
|
|
|
134
135
|
const more = typeof o.more === 'function' || (Array.isArray(o.more) && o.more.some((m) => m && !m.sep)) || o.url ? ib('more', 'More', P.more, ' aria-haspopup="menu" aria-expanded="false"') : '';
|
|
135
136
|
const add = o.add && o.add.label && !phone ? ib('add', o.add.label, P.add) : '';
|
|
136
137
|
const own = (o.presses || []).filter((x) => x && x.act && x.label).map((x) => x.solid
|
|
137
|
-
? `<button type="button" class="cz-vw-pri${x.text && !phone ? '' : ' i'}" data-cz-vw="press" data-cz-vw-p="${esc(x.act)}" aria-label="${esc(x.label)}" title="${esc(x.label)}">${svg(path(x.icon), 15, 2.2)}${x.text && !phone ? `<span>${esc(x.text)}</span>` : ''}</button>`
|
|
138
|
+
? `<button type="button" class="cz-vw-pri${x.text && !phone ? '' : ' i'}${x.blue ? ' blue' : ''}" data-cz-vw="press" data-cz-vw-p="${esc(x.act)}" aria-label="${esc(x.label)}" title="${esc(x.label)}">${svg(path(x.icon), 15, 2.2)}${x.text && !phone ? `<span>${esc(x.text)}</span>` : ''}</button>`
|
|
138
139
|
: `<button type="button" class="cz-vw-ib" data-cz-vw="press" data-cz-vw-p="${esc(x.act)}" aria-label="${esc(x.label)}" title="${esc(x.label)}"${x.pressed != null ? ` aria-pressed="${x.pressed ? 'true' : 'false'}"` : ''}>${svg(path(x.icon), 18)}</button>`).join('');
|
|
139
140
|
const sub = o.sub ? `<p class="cz-vw-sub">${esc(o.sub)}</p>` : '';
|
|
140
141
|
const chip = o.chip && (o.chip.n > 0 || o.chip.looking) ? `<button type="button" class="cz-vw-chip${o.chip.looking ? ' live' : ''}" data-cz-vw="chip" aria-haspopup="dialog" aria-label="${esc(o.chip.label || 'Claude proposes ' + o.chip.n + '. Open')}" title="${esc(o.chip.label || 'Claude proposes')}">${svg(ICONS.spark, 13, 2)}${o.chip.n > 0 ? `<b>${esc(o.chip.n)}</b>` : ''}</button>` : '';
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
.cz-vw-pri { height: 36px; padding: 0 14px; margin: 0 4px; border-radius: 999px; border: 0; background: var(--cz-ink); color: var(--cz-card); font: inherit; font-size: var(--fs-3); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; flex: none; cursor: pointer; }
|
|
18
18
|
.cz-vw-pri.i { width: 40px; height: 40px; padding: 0; justify-content: center; }
|
|
19
19
|
.cz-vw-pri:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
20
|
+
.cz-vw-pri.blue { background: var(--cz-solid); color: var(--cz-onsolid); } /* a form's round ✓ (batch 18 item 2-C, canvas OvA8People) */
|
|
21
|
+
@media (max-width: 760px) { .cz-vw-pri.i { width: 44px; height: 44px; } } /* 44 px targets on a phone */
|
|
20
22
|
.cz-vw-ib { border-radius: 999px; }
|
|
21
23
|
|
|
22
24
|
/* rename (canvas RnATask, RnAIni, RnAProg, RnAPhone): the title is the press; a tap makes it one field with a blue check */
|
|
@@ -173,3 +175,50 @@ body.cz-vw-rail [data-cz-vw-list] > :not(.cz-vw-railbar), body.cz-vw-rail #hmLis
|
|
|
173
175
|
.cz-vw-chip:not(:has(b)) { padding: 0 6px; }
|
|
174
176
|
.cz-vw-chip:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 1px; }
|
|
175
177
|
@media (max-width: 760px) { .cz-vw-chip { min-height: 32px; } }
|
|
178
|
+
|
|
179
|
+
/* a form in the Viewer (batch 18 item 2-C, canvas OvA8People, OvA9Docs): ✓ in the header saves, ← cancels. Labels over 44 px fields,
|
|
180
|
+
* one-choice chips, a quiet note and a ✦ line; the same on Home and the Board (cozy-home.css is not loaded on the Board) */
|
|
181
|
+
.czf { display: flex; flex-direction: column; gap: 14px; margin: 0; }
|
|
182
|
+
.czf-l[hidden] { display: none; }
|
|
183
|
+
.czf-l { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink2); }
|
|
184
|
+
.czf-l input, .czf-l select { font: inherit; font-size: var(--fs-3); font-weight: 500; color: var(--cz-ink); height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--cz-hair); background: var(--cz-card); box-sizing: border-box; width: 100%; }
|
|
185
|
+
.czf-l input::placeholder { color: var(--cz-ink3); }
|
|
186
|
+
.czf-l input:disabled { background: var(--cz-well); color: var(--cz-ink3); }
|
|
187
|
+
.czf-l input:focus-visible, .czf-l select:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 1px; }
|
|
188
|
+
.czf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
|
|
189
|
+
.czf-chips .cz-chip { height: 36px; padding: 0 14px; font-weight: 600; }
|
|
190
|
+
.czf-chips .cz-chip[aria-pressed="true"] { background: var(--cz-bluebg); border-color: transparent; color: var(--cz-blueink); font-weight: 700; }
|
|
191
|
+
.czf-chips .cz-chip svg { width: 13px; height: 13px; }
|
|
192
|
+
.czf-note { margin: 0; font-size: var(--fs-2); line-height: 1.45; color: var(--cz-ink3); }
|
|
193
|
+
.czf-spark { margin: 0; display: flex; gap: 8px; font-size: var(--fs-3); line-height: 1.5; color: var(--cz-ink2); }
|
|
194
|
+
.czf-spark svg { flex: none; width: 14px; height: 14px; margin-top: 4px; color: var(--cz-blue); }
|
|
195
|
+
.czf-err { margin: 0; font-size: var(--fs-2); color: var(--cz-red); }
|
|
196
|
+
.czf-err:empty { display: none; }
|
|
197
|
+
.czs-quiet { margin: 0; font-size: var(--fs-2); color: var(--cz-ink3); }
|
|
198
|
+
@media (max-width: 760px), (pointer: coarse) { .czf-chips .cz-chip { height: 44px; } .czf-l input, .czf-l select { font-size: var(--fs-4); } }
|
|
199
|
+
|
|
200
|
+
/* the Viewer's title wraps to two lines, then clamps (batch 18 item 2, the one pattern: OvA1Start). A title with Claude's ✦ chip keeps one. */
|
|
201
|
+
.cz-vw-title:not(.has-chip) { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; overflow-wrap: anywhere; }
|
|
202
|
+
.cz-vw-hd { align-items: center; }
|
|
203
|
+
|
|
204
|
+
/* an ask's summary (batch 18 item 2-A, OvA1Start, OvA3Waited): ✦ Claude's offer, the progress of what it started, the amber "If it waits" line */
|
|
205
|
+
.nv { display: flex; flex-direction: column; gap: 12px; }
|
|
206
|
+
.nv-offer, .nv-cost { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-3); line-height: 1.5; color: var(--cz-ink); }
|
|
207
|
+
.nv-offer svg { flex: none; margin-top: 3px; color: var(--cz-blueink); }
|
|
208
|
+
.nv-cost { font-size: var(--fs-2); font-weight: 700; color: var(--cz-risk); }
|
|
209
|
+
.nv-cost svg { flex: none; margin-top: 2px; }
|
|
210
|
+
.nv-bar { height: 6px; border-radius: 99px; background: var(--cz-hair); overflow: hidden; }
|
|
211
|
+
.nv-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--cz-blue); }
|
|
212
|
+
.czs-pri svg { flex: none; }
|
|
213
|
+
/* the quiet owner line under the card: whose it is, the kind of work in words, the goal it moves */
|
|
214
|
+
.nv-own { margin: 0; display: flex; align-items: center; gap: 8px; font-size: var(--fs-2); font-weight: 600; color: var(--cz-ink3); line-height: 1.4; }
|
|
215
|
+
.nv-av { width: 22px; height: 22px; border-radius: 50%; background: var(--cz-bluebg); color: var(--cz-blueink); font-size: var(--fs-1); font-weight: 800; display: inline-grid; place-items: center; flex: none; }
|
|
216
|
+
/* a decision: the choices, Claude's pick marked, the why it wrote, and Record with its words */
|
|
217
|
+
.nv-dec { display: flex; flex-direction: column; gap: 8px; }
|
|
218
|
+
.nv-pick { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--cz-card); color: var(--cz-blueink); font-size: var(--fs-1); font-weight: 800; }
|
|
219
|
+
.nv .ut-field label em { font-style: normal; font-weight: 600; color: var(--cz-ink3); }
|
|
220
|
+
.nv-facts { margin: 0; display: grid; gap: 6px; }
|
|
221
|
+
.nv-facts div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
|
|
222
|
+
.nv-facts dt { color: var(--cz-ink3); font-size: var(--fs-2); }
|
|
223
|
+
.nv-facts dd { margin: 0; overflow-wrap: anywhere; }
|
|
224
|
+
.nv-rev .czs-cv { align-self: center; font-size: var(--fs-4); }
|