create-pmos 0.429.0 → 0.430.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 +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/briefing-premium-board-test.js +2 -2
- package/workspace/briefing-premium-insights-test.js +1 -1
- package/workspace/changelog.json +12 -0
- package/workspace/guide/adler.md +45 -0
- package/workspace/guide/briefing-premium.md +2 -0
- package/workspace/guide/home.md +2 -2
- package/workspace/guide/index.md +1 -0
- package/workspace/guide/metric-drafts.md +2 -1
- package/workspace/guide/programs.md +2 -0
- package/workspace/intelligence-gaps-ui-test.js +168 -0
- package/workspace/lib/initiative-writer.js +16 -2
- package/workspace/lib/insight-moves.js +135 -0
- package/workspace/lib/insights-premium.js +4 -3
- package/workspace/lib/intel-report.js +16 -3
- package/workspace/lib/metric-drafts.js +32 -2
- package/workspace/lib/page-opens.js +74 -0
- package/workspace/lib/report-setups.js +1 -1
- package/workspace/lib/route-modules.js +2 -0
- package/workspace/lib/routes-insight-moves.js +119 -0
- package/workspace/lib/routes-insights-premium.js +10 -1
- package/workspace/lib/routes-metric-drafts.js +10 -1
- package/workspace/lib/routes-page-opens.js +26 -0
- package/workspace/lib/routes-report-setups.js +6 -1
- package/workspace/lib/settings-store.js +6 -0
- package/workspace/metric-drafts-ui-test.js +4 -4
- package/workspace/milestone-suggest-test.js +4 -4
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-viewer-flicker-test.js +1 -1
- package/workspace/public/pm/bd-prog-panel.js +3 -3
- package/workspace/public/pm/bd-prog.js +2 -2
- package/workspace/public/pm/cozy-adler.css +82 -0
- package/workspace/public/pm/cozy-adler.js +270 -0
- package/workspace/public/pm/cozy-ev.css +3 -0
- package/workspace/public/pm/cozy-home.css +4 -0
- package/workspace/public/pm/cozy-insights.css +15 -1
- package/workspace/public/pm/cozy-nav.js +2 -0
- package/workspace/public/pm/cozy-search.js +4 -2
- package/workspace/public/pm/cozy-settings.js +15 -2
- package/workspace/public/pm/cozy-today.css +15 -0
- package/workspace/public/pm/cozy.css +16 -0
- package/workspace/public/pm/home-app.js +7 -9
- package/workspace/public/pm/home-chat.js +10 -2
- package/workspace/public/pm/home-day.js +39 -16
- package/workspace/public/pm/home-today.js +5 -3
- package/workspace/public/pm/ini-view-model.js +1 -1
- package/workspace/public/pm/ini-view.css +6 -0
- package/workspace/public/pm/ini-view.js +13 -0
- package/workspace/public/pm/metric-drafts.css +7 -0
- package/workspace/public/pm/metric-drafts.js +46 -7
- package/workspace/public/pm/ms-suggest.js +2 -1
- package/workspace/public/pm/premium-board.js +2 -2
- package/workspace/public/pm/premium-insights.js +76 -10
- package/workspace/public/pm/premium-vw-cal.js +1 -1
- package/workspace/public/pm/premium-welcome.js +3 -2
- package/workspace/public/pm/premium.css +3 -0
- package/workspace/public/pm/program-model.js +7 -0
- package/workspace/public/pm/split-merge.js +2 -1
- package/workspace/public/premium-intelligence.html +1 -1
- package/workspace/test-lists/intelligence-gaps-ui.json +5 -0
- package/workspace/test-lists/intelligence-gaps.json +5 -0
|
@@ -12,7 +12,8 @@ import { esc, svg, ICON, wsParam, wsQ, skelRows, cantRead, failedItem } from './
|
|
|
12
12
|
const ARROW = { up: 'M12 19V5M6 11l6-6 6 6', down: 'M12 5v14M6 13l6 6 6-6', enter: 'M20 5v7a3 3 0 0 1-3 3H5M9 11l-4 4 4 4' }; // the footer's keys, drawn (R28-13: no glyph as a control)
|
|
13
13
|
import { SEARCH_KINDS, PHONE_KINDS, searchGroups, resultSub, resultTag, wtChip } from './cozy-evmodel.js';
|
|
14
14
|
import { open as vwOpen, current as vwCurrent } from './cozy-viewer.js';
|
|
15
|
-
import { nameOf as sessionName } from './home-data.js';
|
|
15
|
+
import { nameOf as sessionName } from './home-data.js';
|
|
16
|
+
import { adler } from './cozy-adler.js'; // session names A: the PM's name wins, then Claude's
|
|
16
17
|
|
|
17
18
|
const PHONE = 760;
|
|
18
19
|
const isPhone = () => innerWidth <= PHONE;
|
|
@@ -132,7 +133,8 @@ function drawList() {
|
|
|
132
133
|
if (q.length < 2) h = '<p class="ev-sp-empty">Type two letters or more. Search reads the initiatives, the documents, slides and reports, the artifacts and designs, and the meetings, in the repository and every worktree.</p>';
|
|
133
134
|
else if (S.err) h = cantRead({ what: 'Search', why: S.err, sources: false });
|
|
134
135
|
else if (S.busy && !groups.length) h = skelRows(3);
|
|
135
|
-
|
|
136
|
+
// nothing found: Adler with his magnifier (canvas AdU4); the words stay the same
|
|
137
|
+
else if (!groups.length) h = `<div class="ev-sp-empty ev-sp-ad" role="status">${adler('needs-you', 'l', { label: false, prop: 'magnifier' })}<p>Nothing matches “${esc(q)}”${S.kind !== 'all' ? ' in this kind' : ''}.</p></div>`;
|
|
136
138
|
groups.forEach((g, gi) => {
|
|
137
139
|
h += `<p class="ev-mlbl">${esc(g.label)}</p>` + g.rows.map((r) => rowHtml(r, i++)).join('');
|
|
138
140
|
if (gi === 0 && isPhone() && g.key === 'initiative') h += '<div class="ev-sp-chips ev-phchips" aria-hidden="true"></div>';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* pm/cozy-settings.js — Settings (initiative premium-uncovered-features, E3; canvas EvSettings). A dialog over the page, its sections on the left:
|
|
2
2
|
* General Theme (this device), Viewer opens as a column or a popup (this device), Product (which products Home reads: the Products card),
|
|
3
3
|
* Your day (when the end-of-day card shows: time.workEnd, POST /api/settings), Agents write to Jira (fixed: only after Commit)
|
|
4
|
+
* Adler how much of Claude's face shows, Motion, Celebrations, Quiet after (adler.*, POST /api/settings; canvas AdM5, batch 16 item 2)
|
|
4
5
|
* Connectors what PMOS reads on its own, and the connectors your sessions have (GET and POST /api/proactive/settings)
|
|
5
6
|
* Workspaces the repositories PMOS works in (GET and POST /api/workspaces, POST /api/workspaces/forget; the folder is never touched)
|
|
6
7
|
* Workflows a link to its own page, /premium-workflows.html (pm/wf-page.js, D99): the stages each kind of initiative goes through
|
|
@@ -10,8 +11,9 @@
|
|
|
10
11
|
* openSettings(section?) */
|
|
11
12
|
import { pmGet, pmPost } from './http.js';
|
|
12
13
|
import { esc, svg, ICON, toast } from './cozy-evui.js';
|
|
14
|
+
import * as AD from './cozy-adler.js';
|
|
13
15
|
|
|
14
|
-
const SECTIONS = [['general', 'General'], ['connectors', 'Connectors'], ['workspaces', 'Workspaces'], ['workflows', 'Workflows'], ['updates', 'Updates'], ['whatsnew', "What's new"]];
|
|
16
|
+
const SECTIONS = [['general', 'General'], ['adler', 'Adler'], ['connectors', 'Connectors'], ['workspaces', 'Workspaces'], ['workflows', 'Workflows'], ['updates', 'Updates'], ['whatsnew', "What's new"]];
|
|
15
17
|
const PAGE_LINKS = { workflows: '/premium-workflows.html' }; // a section that is a page of its own: the row goes there
|
|
16
18
|
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' };
|
|
17
19
|
const VIEWER_KEY = 'pmos.cz.viewer';
|
|
@@ -51,6 +53,15 @@ function general() {
|
|
|
51
53
|
+ trow('Agents write to Jira', 'Only after you press Commit. Never on their own.', '<span class="ev-pill ok">Fixed</span>')
|
|
52
54
|
+ upd;
|
|
53
55
|
}
|
|
56
|
+
/* Settings > Adler (AdM5): four choices, each saved for this computer the moment it is pressed */
|
|
57
|
+
function adlerSec() {
|
|
58
|
+
const P = AD.prefs();
|
|
59
|
+
return `<div class="ev-ad-hd">${AD.adler('handled', 48)}<p class="ev-small ev-mut">Adler is how Claude shows its mood in PMOS. You choose how much of him you see.</p></div>`
|
|
60
|
+
+ trow('How much Adler', 'Face only keeps his face where Claude speaks and drops the scenes. Off shows the plain mood dot.', seg('How much Adler', 'adler.amount', P['adler.amount'], [['full', 'Full'], ['face', 'Face only'], ['off', 'Off']]))
|
|
61
|
+
+ trow('Motion', 'Still stops every animation. Reduced motion on your computer always stops it.', seg('Motion', 'adler.motion', P['adler.motion'], [['system', 'Follow my computer'], ['still', 'Still']]))
|
|
62
|
+
+ trow('Celebrations', 'At most once a week, and only for a real event.', seg('Celebrations', 'adler.celebrate', P['adler.celebrate'], [['real', 'Real wins only'], ['never', 'Never']]))
|
|
63
|
+
+ trow('Quiet after', 'After this time, opening PMOS shows Adler asleep and nothing urgent.', seg('Quiet after', 'adler.quiet', P['adler.quiet'], [['22', '22:00'], ['never', 'Never']]));
|
|
64
|
+
}
|
|
54
65
|
const firstLine = () => { const c = changes().find((e) => e.v === latest()); const p = c && c.prs && c.prs[0]; return p ? (p.t || p.s || '') : ''; };
|
|
55
66
|
function connectors() {
|
|
56
67
|
if (T.src === null) return '<p class="ev-small ev-mut">Reading the connectors.</p>';
|
|
@@ -83,7 +94,7 @@ function whatsnew() {
|
|
|
83
94
|
if (!L.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>';
|
|
84
95
|
return `<ul class="ev-kv">${L.slice(0, 40).map((e) => `<li><b>${esc(e.v)}</b><div class="ev-tx">${mine && e.v === mine ? '<span class="ev-pill">Yours</span> ' : mine && cmpVer(e.v, mine) > 0 ? '<span class="ev-pill y">Newer</span> ' : ''}${(e.prs || []).map((p) => `<p>${esc(p.t && p.t !== p.s ? p.t + ': ' + p.s : p.s)}${p.n ? ' <span class="ev-mut">#' + esc(p.n) + '</span>' : ''}</p>`).join('') || '<p class="ev-mut">No summary was recorded for this kit.</p>'}</div></li>`).join('')}</ul>`;
|
|
85
96
|
}
|
|
86
|
-
const BODY = { general, connectors, workspaces, updates, whatsnew };
|
|
97
|
+
const BODY = { general, adler: adlerSec, connectors, workspaces, updates, whatsnew };
|
|
87
98
|
function draw() {
|
|
88
99
|
const el = T.el; if (!el || el.hidden) return;
|
|
89
100
|
// 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
|
|
@@ -121,6 +132,7 @@ async function press(e) {
|
|
|
121
132
|
if ('evClose' in t.dataset) { closeSettings(); return; }
|
|
122
133
|
if (t.dataset.evGo) { T.sec = t.dataset.evGo; draw(); return; }
|
|
123
134
|
if (t.dataset.evSeg === 'theme') { const M = await import('./cozy-nav.js'); M.setTheme(t.dataset.v); draw(); return; }
|
|
135
|
+
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; }
|
|
124
136
|
if (t.dataset.evSeg === 'viewer') { store.set(VIEWER_KEY, t.dataset.v); document.body.classList.toggle('ev-vw-popup', t.dataset.v === 'popup'); draw(); return; }
|
|
125
137
|
// the one product pick (batch 12 item 5): the same list as the chip on Home, Board and Insights, under this row
|
|
126
138
|
if ('evProducts' in t.dataset) {
|
|
@@ -183,6 +195,7 @@ async function load() {
|
|
|
183
195
|
T.src = p && p.ok && p.settings ? { ...p.settings.briefSources } : {}; T.con = p && p.ok && p.settings ? { ...p.settings.connectors } : {};
|
|
184
196
|
T.conn = p && p.connectors && Array.isArray(p.connectors.list) ? p.connectors.list : [];
|
|
185
197
|
T.set = s && s.ok ? s : null;
|
|
198
|
+
if (T.set) await AD.loadPrefs(async () => T.set);
|
|
186
199
|
T.prods = b && b.ok && b.model && b.model.products ? b.model.products.available || [] : [];
|
|
187
200
|
if (!w || !Array.isArray(w.workspaces)) T.msg = 'The repositories could not be read.'; else if (!p || !p.ok) T.msg = 'The connectors could not be read.';
|
|
188
201
|
draw();
|
|
@@ -461,6 +461,18 @@ body.cz-home .hm-hd.hv-bar { padding: 0; }
|
|
|
461
461
|
.yd-face { width: 48px; height: 48px; border-radius: 24px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-ink); background: var(--cz-riskbg); }
|
|
462
462
|
.yd-face.calm { background: var(--cz-bluebg); }
|
|
463
463
|
.yd-face.concerned { background: color-mix(in srgb, var(--cz-late) 22%, var(--cz-card)); }
|
|
464
|
+
/* Adler (batch 16 item 2): his M face replaces the tinted disc; the morning scene on the day's first open (AdP1); the L figure in Your move
|
|
465
|
+
when nothing needs the PM (AdB2, AdB3); the night scene after 22:00 (AdP4) */
|
|
466
|
+
.yd-face.ad, .yd-face.ad.calm, .yd-face.ad.concerned { background: none; border-radius: 0; }
|
|
467
|
+
.yd-open.has-scene { padding-top: 0; overflow: hidden; }
|
|
468
|
+
.yd-scene { margin: 0 -16px; }
|
|
469
|
+
.yd-scene .ad-scene { border-radius: 18px 18px 0 0; max-height: 150px; }
|
|
470
|
+
.yd-big, .yd-night { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 20px 12px 12px; }
|
|
471
|
+
.yd-big b, .yd-night b { font-size: var(--fs-5); font-weight: 800; color: var(--cz-ink); margin-top: 8px; }
|
|
472
|
+
.yd-big em, .yd-night em { font-style: normal; font-size: var(--fs-3); color: var(--cz-ink3); max-width: 280px; }
|
|
473
|
+
.yd-night { padding: 0 0 12px; }
|
|
474
|
+
.yd-night .ad-scene { max-height: 320px; }
|
|
475
|
+
.yd-awake { margin-top: 12px; min-height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid var(--cz-hair); background: var(--cz-card); color: var(--cz-ink); font: inherit; font-weight: 700; cursor: pointer; }
|
|
464
476
|
.yd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
465
477
|
.yd-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 10px; border-radius: 12px; background: color-mix(in srgb, var(--cz-card) 70%, transparent); font-size: var(--fs-3); font-weight: 700; color: var(--cz-ink); }
|
|
466
478
|
.yd-chip svg { color: var(--cz-blue); }
|
|
@@ -482,3 +494,6 @@ body.cz-home .hm-hd.hv-bar { padding: 0; }
|
|
|
482
494
|
.hm-phc .phrow b { width: 48px; flex: none; font-size: var(--fs-3); font-weight: 700; color: var(--cz-ink3); }
|
|
483
495
|
.hm-phc .phty { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--cz-bluebg); }
|
|
484
496
|
.hm-phc .phty .phl { font-size: var(--fs-4); color: var(--cz-ink); }
|
|
497
|
+
.hv-hi .ad-svg.hv-ad { width: 36px; height: 36px; margin-right: 2px; } /* Adler greets (batch 16 item 2, AdH1): the chevron rule above sizes svg to 16 px */
|
|
498
|
+
.hm-none.hm-ad { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
|
|
499
|
+
.hm-none.hm-ad p { margin: 0; }
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/vendor/nunito-var.woff2) format('woff2'); }
|
|
7
7
|
|
|
8
|
+
/* iOS Safari inflates text it thinks is too small to read ("text autosizing"), unevenly: a wide title or sub-line grows and a narrow time
|
|
9
|
+
column does not, so the calendar rows broke the scale on a phone (batch 16 item 4). The sizes are the scale's; the browser keeps them. */
|
|
10
|
+
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
|
|
8
11
|
:root{
|
|
9
12
|
/* The type scale (R27; feedback batch 15 item 2): every font size in the cozy sheets is one of these six. Hierarchy comes from weight and
|
|
10
13
|
colour, never from a half pixel. 11 marks and badges · 12 meta · 14 body and rows · 16 group heads and phone rows · 20 page titles · 28 display. */
|
|
@@ -107,6 +110,19 @@
|
|
|
107
110
|
--cz-c-3a3018: #3A3018; --cz-c-e3c46a: #E3C46A; --cz-c-3a1f1d: #3A1F1D; --cz-c-f09a92: #F09A92;
|
|
108
111
|
/* the report's title slide (ReportPanel.dc.html): its gradient and the accent of its second line */
|
|
109
112
|
--cz-c-2546b8: #2546B8; --cz-c-1b3a9e: #1B3A9E; --cz-c-cfe88a: #CFE88A; --cz-c-9ab53c: #9AB53C;
|
|
113
|
+
/* Adler, Claude's face (feedback batch 16 item 2; pm/cozy-adler.js and cozy-adler.css name these, never a colour): Wawan's art. Fur, cream,
|
|
114
|
+
hoodie and sprout gradients, then the face, the props, and the scenes' skies and grounds. */
|
|
115
|
+
--ad-f0: #FFD995; --ad-f1: #F0B05A; --ad-f2: #C98030; --ad-c0: #FFFFFA; --ad-c1: #FCEFD8; --ad-c2: #EBD3AE;
|
|
116
|
+
--ad-h0: #93B163; --ad-h1: #6A8A44; --ad-h2: #4A682C; --ad-l0: #C7E37A; --ad-l1: #78A93A;
|
|
117
|
+
--ad-pink: #F4B3A2; --ad-blush: #F49C8C; --ad-ink: #2A2018; --ad-mouth: #7A2E2E; --ad-tongue: #E8737A; --ad-white: #FFFFFF;
|
|
118
|
+
--ad-creamhi: #FFF8EA; --ad-shade: #8A5A20; --ad-shadow: #5A3A10; --ad-hoodd: #46652C; --ad-hoodl: #7A9C55;
|
|
119
|
+
--ad-mug: #6E8E4B; --ad-mugleaf: #CFE0B0; --ad-gold: #E9B949; --ad-glass: #3A2E22; --ad-cardline: #C9C3B6; --ad-tick: #2B55C9;
|
|
120
|
+
--ad-hp: #3A4466; --ad-lens: #EAF4FA;
|
|
121
|
+
--ad-morning0: #FFF4E2; --ad-morning1: #FBE6C4; --ad-tea0: #F6F3EA; --ad-tea1: #EEE9DC; --ad-win0: #FFF5E3; --ad-win1: #F6E9D0;
|
|
122
|
+
--ad-think0: #F1F2EE; --ad-think1: #E6E9E0; --ad-rain0: #EEF0F2; --ad-rain1: #E2E5E9; --ad-night0: #2D3550; --ad-night1: #1E2438;
|
|
123
|
+
--ad-plain0: #F7F6F3; --ad-plain1: #F7F6F3; --ad-sun: #FFC85A; --ad-sunglow: #FFD27A; --ad-moon: #F4E9C6; --ad-firefly: #E9F59A;
|
|
124
|
+
--ad-raincloud: #C9CED6; --ad-drop: #9AA6B8; --ad-ground: #E4D8BC; --ad-groundn: #3A4466; --ad-grass: #8DB05A; --ad-leaf2: #9CC25A;
|
|
125
|
+
--ad-thinkdot: #A9B39A;
|
|
110
126
|
}
|
|
111
127
|
.cz {
|
|
112
128
|
--cz-ink: var(--cz-c-2a2e35); --cz-ink2: var(--cz-c-4a4f58); --cz-ink3: var(--cz-c-646a74);
|
|
@@ -36,7 +36,8 @@ import { mountPhoneCard } from './home-phone-card.js';
|
|
|
36
36
|
import { mountFirst } from './premium-first.js';
|
|
37
37
|
import * as L from './home-list.js';
|
|
38
38
|
import * as TD from './home-today.js';
|
|
39
|
-
import * as YD from './home-day.js';
|
|
39
|
+
import * as YD from './home-day.js';
|
|
40
|
+
import * as AD from './cozy-adler.js'; // Adler, Claude's face (batch 16 item 2) // Your day in the Viewer (XvAPhDay)
|
|
40
41
|
import { canDictate, dictate } from './home-dictate.js';
|
|
41
42
|
import { mountIni, iniList, iniOverview, iniPage, iniAddTask } from './home-ini.js'; // the initiative's page, its stage move, Tasks and Core documents (premium-uncovered-features, HbC)
|
|
42
43
|
import * as MEN from './home-mentions.js'; // @Mentions, the permanent row at the top of Home and its Viewer (Viewer kit, XvANew)
|
|
@@ -294,20 +295,17 @@ function homeListHtml() {
|
|
|
294
295
|
pick: S.D.pick, tones: pickTones(), review: R, mic: canDictate(), phone: isPhone(), day: S.day, top: S.ready ? RECROW.html() + MEN.rowHtml(S.D, { sel: S.sel }) : '',
|
|
295
296
|
});
|
|
296
297
|
}
|
|
297
|
-
/** Your day (XvAPhDay, was the HvAOpen sheet)
|
|
298
|
-
*
|
|
298
|
+
/** Your day (XvAPhDay, was the HvAOpen sheet): "Good morning" opens it in the Viewer on a phone and a desktop alike (batch 16, Wawan: the same
|
|
299
|
+
* press must lead to the same place); the calendar is under ⋯. A phone also draws the moment card (TfPhone) as its Now section. */
|
|
299
300
|
function dayHtml() { return ''; }
|
|
300
301
|
function day(on) {
|
|
301
302
|
S.day = !!on;
|
|
302
303
|
if (!on) { const c = VW.current(); if (c && c.id === 'day') VW.close(); return; }
|
|
303
304
|
if (!S.M) return;
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
if (!isPhone()) { S.day = false; openCalendar(); return; }
|
|
307
|
-
const Y = YD.dayModel(S.M, S.D, L.reviewModel(S.D, NOW()), NOW(), { delightOk: delightOk() });
|
|
308
|
-
if (Y.mood === 'delighted') { try { localStorage.setItem(DELIGHT_KEY, new Date(NOW()).toDateString()); } catch { /* the face still shows */ } }
|
|
305
|
+
const Y = YD.dayModel(S.M, S.D, L.reviewModel(S.D, NOW()), NOW(), { delightOk: delightOk() && AD.mayCelebrate(NOW()) });
|
|
306
|
+
if (Y.mood === 'delighted') { try { localStorage.setItem(DELIGHT_KEY, new Date(NOW()).toDateString()); } catch { /* the face still shows */ } AD.celebrated(NOW()); }
|
|
309
307
|
const ph = isPhone() && PHC;
|
|
310
|
-
const P = YD.dayParts(Y, { moment: !!ph });
|
|
308
|
+
const P = YD.dayParts(Y, { moment: !!ph, now: NOW(), first: YD.firstOpenToday('day', NOW()) });
|
|
311
309
|
VW.open({ id: 'day', kind: 'Your day', title: 'Your day', icon: YD.DAY_ICON, more: [{ label: 'Open the calendar', on: () => openCalendar() }],
|
|
312
310
|
onClose: () => { S.day = false; },
|
|
313
311
|
render: (body) => {
|
|
@@ -32,6 +32,7 @@ import { splitChase, runStop, sweepLine, stopText } from './home-sweep.js';
|
|
|
32
32
|
import { splitFiles, filesHtml, sizeText, MAX_BYTES, MAX_FILES, setAttachSink } from './premium-attach.js';
|
|
33
33
|
import * as VWC from './cozy-viewer.js';
|
|
34
34
|
import { canDictate, dictate } from './home-dictate.js';
|
|
35
|
+
import { adler } from './cozy-adler.js';
|
|
35
36
|
/* The views a chat opens go in the Viewer: on a page with no dialog the old viewer's views draw in the cozy card (premium-viewer.js). */
|
|
36
37
|
const views = {
|
|
37
38
|
ctx: () => import('./premium-vw-ctx.js'), file: () => import('./premium-vw-file.js'), attach: () => import('./premium-attach.js'),
|
|
@@ -50,6 +51,11 @@ export function avHtml(role, size = 28, cls = '') {
|
|
|
50
51
|
return `<span class="hm-av t-${tintOf(k)} s${size}${k.length > 1 ? ' two' : ''}${cls ? ' ' + cls : ''}" aria-hidden="true">${k}</span>`;
|
|
51
52
|
}
|
|
52
53
|
|
|
54
|
+
/** Adler is Claude's avatar once, on the latest reply, in that reply's mood (batch 16 item 2, canvas AdU1): needs you while it asks,
|
|
55
|
+
* honest when the run stopped, thinking while it runs, handled otherwise. Another role keeps its letter. */
|
|
56
|
+
const isClaude = (r) => !r || !r.key || r.key === 'claude';
|
|
57
|
+
export const adlerAvHtml = (mood) => `<span class="hm-av hm-adler" aria-hidden="true">${adler(mood, 36, { label: false, id: 'chat' })}</span>`;
|
|
58
|
+
|
|
53
59
|
export function mountChat(el, host) {
|
|
54
60
|
const esc = host.esc;
|
|
55
61
|
const C = { t: null, th: null, conv: null, timer: null, show: 12, plOpen: false, plAll: false, open: new Set(), seq: 0, sending: false, files: [], seenAt: null, lastKey: null, picked: {}, auto: { key: null, ctx: new Set(), rep: null, goal: null }, slashAt: 0 };
|
|
@@ -117,7 +123,8 @@ export function mountChat(el, host) {
|
|
|
117
123
|
const go = GU.blockOpts(it.mi, g.block, gl); // home-goal.js: the newest plan, the method menu, the editor in place
|
|
118
124
|
// a run that stopped: the divider sits where it finished, over Claude's last message, and the fix sits under it (canvas XcbOptions, Routine)
|
|
119
125
|
const stopAt = R.stop && i === R.lastAgent;
|
|
120
|
-
|
|
126
|
+
const av = last && isClaude(R.role) ? adlerAvHtml(asking || ak.block ? 'needs-you' : stopAt ? 'honest' : running() ? 'thinking' : 'handled') : avHtml(R.role);
|
|
127
|
+
return (stopAt ? dividerHtml({ tone: R.stop.tone, text: R.stop.text }) : '') + `<div class="hm-a${asking ? ' ask' : ''}">${av}<div class="hm-ab"><p class="hm-who">${esc(R.role.name)} <span>${esc(hm(it.at))}</span></p>${rp.text ? mdHtml(rp.text) : ''}${goalBlockHtml(go.block, go)}${reportChipHtml(rp.block, it.mi)}${R.chips(it.mi)}`
|
|
121
128
|
+ (asking ? '' : `<div class="hm-tools" role="group" aria-label="Message actions"><button type="button" data-hm-copy="${i}">Copy</button>${last && !running() && !(stopAt && R.stop.actions.length) ? `<button type="button" data-hm-retry>Retry</button>` : ''}<button type="button" data-hm-wi="${i}">Make a work-item</button></div>`) + '</div></div>'
|
|
122
129
|
+ (stopAt && R.stop.actions.length ? `<div class="hm-fix" role="group" aria-label="What to do next">${R.stop.actions.map((a, k) => iconBtn({ icon: a.icon, label: a.label, attr: a.data, pri: k === 0 })).join('')}</div>` : '')
|
|
123
130
|
+ blockAskHtml(ak.block, it, R);
|
|
@@ -190,7 +197,8 @@ export function mountChat(el, host) {
|
|
|
190
197
|
html += GU.choiceHtml(); // /goal while a goal works here: In a new chat, or Here instead
|
|
191
198
|
if (C.th && C.th.working) html += `<p class="hm-note" role="status">The agent is answering. You can write again when it has.</p>`;
|
|
192
199
|
if (C.conv && C.conv.state === 'ended') html += '<p class="hm-note">This session has ended. Your conversation is kept here, and your next message picks it up.</p>';
|
|
193
|
-
|
|
200
|
+
// an empty chat: Adler resting, because nothing runs here yet (canvas AdH1)
|
|
201
|
+
if (!html) html = `<div class="hm-empty hm-empty-ad">${adler('resting', 'l', { id: 'chatempty' })}<p>${esc(t.empty || 'Ask anything. It works in a real Claude Code session.')}</p></div>`;
|
|
194
202
|
put(log, html);
|
|
195
203
|
C.items = items;
|
|
196
204
|
GU.afterDraw(log);
|
|
@@ -12,9 +12,14 @@
|
|
|
12
12
|
* a thank-you only from a real mention, a miss only from a failed task. No data, no line (zero is silence). The mood is never happier than
|
|
13
13
|
* the data: concerned when something failed or is blocked, delighted at most once a week, calm on a packed or ordinary day.
|
|
14
14
|
* Voice: Claude's Adlerian rules (canvas note ydAdler): thanks for contribution, no praise, no orders, say whose task it is, no blame,
|
|
15
|
-
* no "N days late". dayModel is pure; dayParts turns it into the shell's sections. Text from records goes through esc().
|
|
15
|
+
* no "N days late". dayModel is pure; dayParts turns it into the shell's sections. Text from records goes through esc().
|
|
16
|
+
* Adler (batch 16 item 2) is the face: the M face on the opening card in the day's mood (ADLER: glad and calm are handled, delighted is
|
|
17
|
+
* celebrating, concerned is honest, a run still drafting is thinking); the morning scene on the day's first open before noon (AdP1);
|
|
18
|
+
* the L figure with his tea when nothing needs the PM (AdB2) or celebrating on an earned day (AdB3), and then the small face hides (one
|
|
19
|
+
* Adler per screen); after 22:00 the night scene guards the evening (AdP4) unless something is wrong, which is never hidden. */
|
|
16
20
|
|
|
17
21
|
import { todayOf, hm } from './home-data.js';
|
|
22
|
+
import { adler, adlerScene, asleep, firstOpenToday } from './cozy-adler.js'; // Adler, Claude's face (batch 16 item 2): AdB1-3, AdP1, AdP4
|
|
18
23
|
|
|
19
24
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
20
25
|
const plural = (n, one, many) => n + ' ' + (n === 1 ? one : many);
|
|
@@ -104,28 +109,24 @@ export function dayModel(M, D, R, now = Date.now(), o = {}) {
|
|
|
104
109
|
// no prep run today: say so, and offer it (Prepare my day); never claim work that did not happen
|
|
105
110
|
if (!run && h < 17) offer = { kind: 'prep', text: 'I haven’t prepared today yet.', sub: 'Shall I prep your meetings and draft what I can?' };
|
|
106
111
|
return {
|
|
107
|
-
mood, line, sub, chips, misses, offer, calls, drafts, wait, done, thanks,
|
|
112
|
+
mood, face: run && run.working && mood === 'calm' ? 'working' : mood, line, sub, chips, misses, offer, calls, drafts, wait, done, thanks,
|
|
108
113
|
next: next ? { meeting: next, now: next.state === 'now', time: hm(next.start), title: next.title || 'A meeting' } : null,
|
|
109
114
|
week: { sub: un || 'Weekly review' },
|
|
110
115
|
};
|
|
111
116
|
}
|
|
112
117
|
|
|
113
|
-
/* Claude's
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
delighted: '<path d="M7 13h10c-.6 3-2.6 4.6-5 4.6S7.6 16 7 13z" fill="currentColor" stroke-width="1.6" stroke-linejoin="round"/>',
|
|
117
|
-
calm: '<path d="M8.5 15c1 .9 2.2 1.3 3.5 1.3s2.5-.4 3.5-1.3" fill="none" stroke-width="1.6" stroke-linecap="round"/>',
|
|
118
|
-
concerned: '<path d="M7.6 7.6l2.4.9M16.4 7.6l-2.4.9" stroke-width="1.4" stroke-linecap="round"/><path d="M8.5 16.5c1-1.3 2.2-1.9 3.5-1.9s2.5.6 3.5 1.9" fill="none" stroke-width="1.6" stroke-linecap="round"/>',
|
|
119
|
-
};
|
|
120
|
-
export const faceHtml = (mood) => `<span class="yd-face ${esc(mood)}" role="img" aria-label="Claude is ${esc(mood)}"><svg width="32" height="32" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><circle cx="9" cy="10.5" r="1.3" fill="currentColor" stroke="none"/><circle cx="15" cy="10.5" r="1.3" fill="currentColor" stroke="none"/>${MOUTH[mood] || MOUTH.calm}</svg></span>`;
|
|
118
|
+
/* Claude's face is Adler's M face (it replaced the yellow mood circle): the day's mood read as his */
|
|
119
|
+
export const ADLER = { glad: 'handled', calm: 'handled', delighted: 'celebrating', concerned: 'honest', working: 'thinking' };
|
|
120
|
+
export const faceHtml = (mood) => `<span class="yd-face ad ${esc(mood)}">${adler(ADLER[mood] || 'handled', 48, { label: 'Claude is ' + mood })}</span>`;
|
|
121
121
|
const ok = (act, label, id) => `<button type="button" class="yd-ok" data-yd="${esc(act)}"${id ? ` data-id="${esc(id)}"` : ''} aria-label="${esc(label)}" title="${esc(label)}">${svg(CHECK, 22, 2.6)}</button>`;
|
|
122
122
|
const alt = (act, label, id, icon) => `<button type="button" class="yd-alt" data-yd="${esc(act)}"${id ? ` data-id="${esc(id)}"` : ''} aria-label="${esc(label)}" title="${esc(label)}">${svg(icon || OPEN, 18, 2)}</button>`;
|
|
123
123
|
|
|
124
124
|
/** The opening card: face, line, sub, the chips of real work, and Claude's own misses with a ✓ to run them again. */
|
|
125
|
-
export function openHtml(Y) {
|
|
125
|
+
export function openHtml(Y, o = {}) {
|
|
126
|
+
const head = o.scene ? `<div class="yd-scene">${adlerScene('morning', 'handled', { label: false })}</div>` : o.big ? '' : faceHtml(Y.face || Y.mood);
|
|
126
127
|
const chips = Y.chips.length ? `<div class="yd-chips">${Y.chips.map((c) => `<span class="yd-chip">${svg(CHECK, 14, 2.6)}${esc(c)}</span>`).join('')}</div>` : '';
|
|
127
128
|
const miss = Y.misses.map((m) => `<div class="yd-miss" data-id="${esc(m.id)}"><div class="yd-mt"><b>My miss: ${esc(m.title)}</b>${m.why ? `<em>${esc(m.why)}</em>` : ''}</div>${ok('retry', 'Run it again', m.id)}</div>`).join('');
|
|
128
|
-
return `<div class="yd-open ${esc(Y.mood)}"
|
|
129
|
+
return `<div class="yd-open ${esc(Y.mood)}${o.scene ? ' has-scene' : ''}">${o.scene ? head : ''}<div class="yd-hd">${o.scene ? '' : head}<div class="yd-ht"><b>${esc(Y.line)}</b>${Y.sub ? `<em>${esc(Y.sub)}</em>` : ''}</div></div>${chips}${miss}</div>`
|
|
129
130
|
+ (Y.offer ? `<div class="yd-card yd-offer"><div class="yd-mt"><b>${esc(Y.offer.text)}</b><em>${esc(Y.offer.sub)}</em></div>${ok('prep', 'Prepare my day')}</div>` : '');
|
|
130
131
|
}
|
|
131
132
|
|
|
@@ -147,11 +148,25 @@ function draftRow(d) {
|
|
|
147
148
|
return `<div class="hm-r hv-r two yd-fin"><div class="hm-rm"><span class="hv-mk"><span class="yd-tick">${svg(CHECK, 13, 2.6)}</span></span><span class="hm-rt"><b>${esc(f.title)}</b><em>${esc(DSTATE[f.status] || 'Finished')}${f.summary ? ' · ' + esc(f.summary) : ''}</em></span></div></div>`;
|
|
148
149
|
}
|
|
149
150
|
|
|
150
|
-
|
|
151
|
+
/* the L figure in Your move when nothing needs the PM: his tea on a quiet day (AdB2), celebrating on an earned one (AdB3) */
|
|
152
|
+
const bigHtml = (kind) => (kind === 'win'
|
|
153
|
+
? `<div class="yd-big">${adler('celebrating', 'l')}<b>That was everything that needed you today.</b></div>`
|
|
154
|
+
: `<div class="yd-big">${adler('handled', 'l', { label: 'Adler, handled, with his tea' })}<b>Nothing else needs you today.</b><em>I’ll tell you if that changes.</em></div>`);
|
|
155
|
+
/** After 22:00 (Settings > Adler > Quiet after), unless something is wrong: Adler asleep, and the day one press away (AdP4). */
|
|
156
|
+
export function nightHtml(Y) {
|
|
157
|
+
const sub = Y.calls.length ? (Y.calls.length === 1 ? 'One call waits for you in the morning.' : Y.calls.length + ' calls wait for you in the morning.') : 'Nothing needs you tonight.';
|
|
158
|
+
return `<div class="yd-night">${adlerScene('night', 'resting')}<b>It’ll keep till morning.</b><em>${esc(sub)}</em><button type="button" class="yd-awake" data-yd="awake">Open anyway</button></div>`;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** The shell's parts for Your day (czSections takes them). o: { moment: true on a phone with the moment card, now, first: the day's first
|
|
162
|
+
* open (the morning scene) } → { open, sections, night } */
|
|
151
163
|
export function dayParts(Y, o = {}) {
|
|
152
|
-
const sections = [];
|
|
164
|
+
const sections = [], now = o.now || Date.now();
|
|
165
|
+
// the tea figure only after a real day (something done, drafted or waiting): nothing at all stays silent (zero is silence)
|
|
166
|
+
const real = Y.done > 0 || Y.chips.length || Y.drafts.length || Y.wait.length;
|
|
167
|
+
const big = Y.calls.length || Y.mood === 'concerned' ? null : Y.mood === 'delighted' ? 'win' : real ? 'tea' : null;
|
|
153
168
|
if (Y.calls.length) sections.push({ id: 'move', title: 'Your move', count: Y.calls.length, open: true, html: Y.calls.map(callHtml).join('') });
|
|
154
|
-
else if (
|
|
169
|
+
else if (big) sections.push({ id: 'move', title: 'Your move', open: true, html: bigHtml(big) });
|
|
155
170
|
if (Y.drafts.length) sections.push({ id: 'drafts', title: 'Drafted for you', count: Y.drafts.length, html: `<div class="hv-card">${Y.drafts.map(draftRow).join('')}</div>` });
|
|
156
171
|
if (Y.wait.length) sections.push({ id: 'wait', title: 'Can wait', count: Y.wait.length, html: `<div class="hv-card hd-move">${Y.wait.map(waitRow).join('')}</div>` });
|
|
157
172
|
if (o.moment) sections.push({ id: 'now', title: 'Now', open: true, html: '<div class="hd-now"></div>' }); // drawDay puts the moment card in
|
|
@@ -159,11 +174,19 @@ export function dayParts(Y, o = {}) {
|
|
|
159
174
|
sections.push({ id: 'next', title: Y.next.now ? 'On now' : 'Next meeting', count: Y.next.now ? '' : Y.next.time, html: `<div class="hv-card"><div class="hm-r hv-r two"><button type="button" class="hm-rm" data-hd-meet><span class="hv-mk">${svg(CLOCK, 15)}</span><span class="hm-rt"><b>${esc(Y.next.title)}</b><em>${esc(Y.next.now ? 'On now' : Y.next.time)}</em></span><span class="hv-cv">${svg(CHEV, 16)}</span></button></div></div>` });
|
|
160
175
|
}
|
|
161
176
|
sections.push({ id: 'week', title: 'This week', count: Y.week.sub, html: `<div class="hv-card"><div class="hm-r hv-r two" data-id="review"><button type="button" class="hm-rm" data-hm-review aria-label="Weekly review: ${esc(Y.week.sub)}. Open"><span class="hv-mk">${svg(CAL, 16)}</span><span class="hm-rt"><b>Weekly review</b><em>${esc(Y.week.sub)}</em></span><span class="hv-cv">${svg(CHEV, 16)}</span></button></div></div>` });
|
|
162
|
-
|
|
177
|
+
const scene = !big && o.first && Y.mood !== 'concerned' && new Date(now).getHours() < 12;
|
|
178
|
+
const night = Y.mood !== 'concerned' && asleep(now) ? nightHtml(Y) : '';
|
|
179
|
+
return { open: openHtml(Y, { big: !!big, scene }), sections, night };
|
|
163
180
|
}
|
|
164
181
|
|
|
165
182
|
/** Draws Your day into the Viewer's body: the opening card, then the folds; moment(el) puts the phone's moment card in Now. */
|
|
183
|
+
export { firstOpenToday };
|
|
166
184
|
export function drawDay(body, P, VW, moment) {
|
|
185
|
+
if (P.night) { // AdP4: the evening is guarded; Open anyway shows the day, this once
|
|
186
|
+
body.innerHTML = `<div class="yd">${P.night}</div>`;
|
|
187
|
+
const b = body.querySelector('[data-yd="awake"]'); if (b) b.addEventListener('click', (e) => { e.stopPropagation(); drawDay(body, { ...P, night: '' }, VW, moment); });
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
167
190
|
body.innerHTML = `<div class="yd">${P.open}${VW.czSections(P.sections, { key: 'day' })}</div>`;
|
|
168
191
|
const now = body.querySelector('.hd-now'); if (now && moment) moment(now);
|
|
169
192
|
}
|
|
@@ -18,6 +18,7 @@ import { gripHtml, sugHtml } from './prog-order.js'; // a program's order: the
|
|
|
18
18
|
import * as SO from './sort-order.js'; // the sort button and ONE order with the Board (batch 14 item 8, canvas SoAHomePhone)
|
|
19
19
|
import { prodKey } from './order-model.js';
|
|
20
20
|
import * as CW from './ctx-wedge.js'; // how full a session's context is: the pie, and Claude's ✦ Compact (batch 13 item 8, XctxA1Desk)
|
|
21
|
+
import * as AD from './cozy-adler.js'; // Adler greets on Home (batch 16 item 2, canvas AdH1): the M face, honest when the read failed
|
|
21
22
|
|
|
22
23
|
export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
23
24
|
export const P = {
|
|
@@ -269,7 +270,7 @@ const MOMENT = new Set(['rec', 'soon', 'live', 'eod', 'review']);
|
|
|
269
270
|
/** M is homeList(); T todayCard(); o: { sel, ses (the initiative row whose pill is open), pOpen, restOpen, pin, avHtml, ready, err, pick (GET /api/briefing-premium/products), tones, review, phone, day (Your day is open) } */
|
|
270
271
|
export function listHtml(M, T, o) {
|
|
271
272
|
const flt = M.filter !== 'today' ? M.filters.find((f) => f.key === M.filter) : null;
|
|
272
|
-
const head = `<div class="hm-hd hv-bar"><button type="button" class="hv-hi" data-hm-day aria-expanded="${!!o.day}" aria-label="${esc(M.word || 'Today')}. Open your day"
|
|
273
|
+
const head = `<div class="hm-hd hv-bar"><button type="button" class="hv-hi" data-hm-day aria-expanded="${!!o.day}" aria-label="${esc(M.word || 'Today')}. Open your day">${AD.adler(o.err ? 'honest' : 'handled', 36, { label: false, cls: 'hv-ad' })}<b>${esc(M.word || 'Today')}</b>${svg(P.chevD, 18)}</button>`
|
|
273
274
|
// the product chip, always (it is also the way to add one): the ticked products' tiles, or All (canvas XhpA2States)
|
|
274
275
|
+ (o.pick ? chipHtml(o.pick, { id: 'hmPick', attrs: 'data-hm-pick', label: 'Products on Home', tones: o.tones }) : '')
|
|
275
276
|
+ (o.phone ? '' : `<button type="button" class="ut-ib hv-ib${flt ? ' on' : ''}" data-hm-flt aria-haspopup="menu" aria-label="Show: Today, Kept or Done${flt ? '. Now ' + esc(flt.label) : ''}" title="Show: Today, Kept or Done">${svg(P.filter, 18)}</button>`)
|
|
@@ -278,8 +279,9 @@ export function listHtml(M, T, o) {
|
|
|
278
279
|
+ (M.yours ? `<p class="hv-sub">${M.yours} ${M.yours === 1 ? 'is' : 'are'} yours</p>` : '');
|
|
279
280
|
// the Today card only while the day has a moment; the plain day (its meetings and load) is in Your day
|
|
280
281
|
const card = MOMENT.has(T.mode) ? todayHtml(T, { greet: M.greet, sub: '', phone: o.phone }) : '';
|
|
281
|
-
|
|
282
|
-
|
|
282
|
+
// start-up and errors (canvas AdU9, AdU6): Adler wears his glasses while Home reads, and says a failure plainly; the greeting's face hides
|
|
283
|
+
if (!o.ready) return head + card + `<div class="hm-none hm-ad" role="status">${AD.adler('thinking', 'l', { label: false })}<p>Reading your work.</p></div>`;
|
|
284
|
+
const errLine = `<div class="hm-none hm-ad" role="status">${AD.adler('honest', 48, { label: false })}<p>Home could not read the repository: ${esc(o.err)}.</p></div>`;
|
|
283
285
|
if (o.err && !M.groups.some((g) => (g.kind === 'product' && g.count) || (g.rows && g.rows.length))) return head + card + errLine;
|
|
284
286
|
// the repository's read failed but sessions or notes still answered: say so above what did come back, never an empty product as if calm
|
|
285
287
|
let body = o.err && !M.groups.some((g) => g.kind === 'product' && (g.count || g.flat.length)) ? errLine : '';
|
|
@@ -250,7 +250,7 @@ export function iniView(r, ctx = {}) {
|
|
|
250
250
|
const lateSay = late.length ? plural(late.length, 'task is', 'tasks are') + ' late' + (late.length > 1 ? ', the oldest since ' + dateY(late.map((x) => x.end).sort()[0], today) : ', since ' + dateY(late[0].end, today)) + '.' : '';
|
|
251
251
|
const why = whyText(r, list, cur, today, finished);
|
|
252
252
|
const it = tr || {};
|
|
253
|
-
const progress = jira ? (ctx.jiraAt || '') : r.progress != null && Number.isFinite(Number(r.progress)) ? Math.round(Number(r.progress)) + '%
|
|
253
|
+
const progress = jira ? (ctx.jiraAt || '') : r.progress != null && Number.isFinite(Number(r.progress)) ? Math.round(Number(r.progress)) + '% · by hand' : '';
|
|
254
254
|
// what waits on the PM: the track's, else the trail's (the Board merges the trail into the track; Home reads the row as sent)
|
|
255
255
|
const you = t.you || (it.you && it.you.text) || null, youKind = t.youKind || (it.you && it.you.kind) || null, youWhy = t.youWhy || (it.you && it.you.why) || '';
|
|
256
256
|
let wait = null;
|
|
@@ -22,6 +22,12 @@
|
|
|
22
22
|
.iv-s1 .iv-r + .iv-go { margin-left: 6px; }
|
|
23
23
|
.iv-s1 b + .iv-go { margin-left: auto; }
|
|
24
24
|
.iv-why { margin: 0; font-size: var(--fs-3); line-height: 1.5; color: var(--cz-ink); }
|
|
25
|
+
/* one row when the summary is only its status (batch 16 item 7): status, owner avatar, workflow icon, program, progress at the end */
|
|
26
|
+
.iv-sum.iv-one { padding: 8px 14px; }
|
|
27
|
+
.iv-one .iv-s1 { flex-wrap: wrap; row-gap: 4px; }
|
|
28
|
+
.iv-one .iv-meta { flex-wrap: nowrap; min-width: 0; gap: 8px; }
|
|
29
|
+
.iv-one .iv-prog { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
30
|
+
.iv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
25
31
|
.iv-meta { margin: 0; font-size: var(--fs-2); color: var(--cz-ink3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
|
|
26
32
|
.iv-meta > span, .iv-meta > button { display: inline-flex; align-items: center; gap: 5px; }
|
|
27
33
|
.iv-meta .wfi { color: var(--cz-ink3); display: inline-flex; }
|
|
@@ -66,6 +66,19 @@ function summaryHtml(s, o = {}) {
|
|
|
66
66
|
: `<span class="iv-wf">${wfIcon(s.wf, 15)}${esc(s.wf.name || 'Product feature')}</span>`);
|
|
67
67
|
if (s.program) meta.push(`<button type="button" class="iv-prog" data-iv-program="${esc(s.program.id)}" title="Open the program ${esc(s.program.title)}">${SVG(P.prog, 15)}${esc(s.program.title)}</button>`);
|
|
68
68
|
if (!s.line && !s.text && !go) return '';
|
|
69
|
+
// nothing to say beyond the status (batch 16 item 7, "feels like wasting space"): one row. The owner is the avatar, the workflow its icon,
|
|
70
|
+
// each named on hover and to a reader; the program keeps its name, because it is a press
|
|
71
|
+
if (!s.text && !go) {
|
|
72
|
+
const m = [];
|
|
73
|
+
if (s.status) m.push(`<span class="iv-st ${esc(s.status.tone)}"><i aria-hidden="true"></i>${esc(s.status.text)}</span>`);
|
|
74
|
+
m.push(s.owner ? `<span class="iv-who" title="${esc('Owner: ' + s.owner.name)}"><span class="iv-av" aria-hidden="true">${esc(s.owner.av)}</span><span class="iv-sr">${esc(s.owner.name)}</span></span>` : '<span class="iv-who q">No owner</span>');
|
|
75
|
+
const wn = s.wf ? s.wf.name || 'Product feature' : '';
|
|
76
|
+
if (s.wf) m.push(o.wf ? `<button type="button" class="iv-wf" data-iv-wf aria-haspopup="listbox" aria-label="${esc('Workflow: ' + wn + '. Change')}" title="${esc('Workflow: ' + wn + '. Change')}">${wfIcon(s.wf, 15)}<span class="iv-sr">${esc(wn)}</span></button>`
|
|
77
|
+
: `<span class="iv-wf" title="${esc('Workflow: ' + wn)}">${wfIcon(s.wf, 15)}<span class="iv-sr">${esc(wn)}</span></span>`);
|
|
78
|
+
if (s.program) m.push(`<button type="button" class="iv-prog" data-iv-program="${esc(s.program.id)}" title="Open the program ${esc(s.program.title)}">${SVG(P.prog, 15)}${esc(s.program.title)}</button>`);
|
|
79
|
+
return `<section class="iv-sum iv-one" aria-label="Summary"><div class="iv-s1 ${dot}">${dot && dot !== 'ok' ? '<span class="iv-dot" aria-hidden="true"></span>' : ''}<b>${esc(s.line)}</b>`
|
|
80
|
+
+ `<p class="iv-meta">${m.join('')}</p>${s.right ? `<span class="iv-r">${esc(s.right)}</span>` : ''}</div></section>`;
|
|
81
|
+
}
|
|
69
82
|
return `<section class="iv-sum" aria-label="Summary"><div class="iv-s1 ${dot}">${dot && dot !== 'ok' ? '<span class="iv-dot" aria-hidden="true"></span>' : ''}<b>${esc(s.line)}</b>`
|
|
70
83
|
+ `${s.right ? `<span class="iv-r">${esc(s.right)}</span>` : ''}${go}</div>${s.text ? `<p class="iv-why">${esc(s.text)}</p>` : ''}`
|
|
71
84
|
+ `<p class="iv-meta">${meta.join('<span class="iv-sep" aria-hidden="true">·</span>')}</p></section>`;
|
|
@@ -80,3 +80,10 @@
|
|
|
80
80
|
.md-in { animation: md-in .3s ease-out both; }
|
|
81
81
|
@keyframes md-in { from { opacity: 0; } to { opacity: 1; } }
|
|
82
82
|
}
|
|
83
|
+
|
|
84
|
+
/* the inline edit (batch 16 item 1): each draft as one row of fields, its role over it */
|
|
85
|
+
.md-ed { display: flex; flex-direction: column; gap: 10px; }
|
|
86
|
+
.md-er { display: flex; flex-direction: column; gap: 4px; }
|
|
87
|
+
.md-ef { display: grid; grid-template-columns: minmax(0, 110px) minmax(0, 1fr); gap: 6px; align-items: center; }
|
|
88
|
+
.md-fld { box-sizing: border-box; width: 100%; min-width: 0; height: 32px; border: 1px solid var(--cz-hair); border-radius: 10px; padding: 0 9px; font: inherit; font-size: var(--fs-3); font-weight: 700; background: var(--cz-card); color: var(--cz-ink); }
|
|
89
|
+
.md-fld:focus { outline: 2px solid color-mix(in srgb, var(--cz-blueink) 45%, transparent); outline-offset: 0; border-color: var(--cz-blueink); }
|
|
@@ -11,11 +11,13 @@
|
|
|
11
11
|
* open rows: "✦ Proposed success measure": Proves it worked, Early signal and Guardrail as Now → Target rows,
|
|
12
12
|
* one line of why, then Edit and ✓ keep all
|
|
13
13
|
* kept rows: the folded "Success measure · Set before the build · N" with its rows, and Undo
|
|
14
|
-
* press(b, h) a press on [data-md]: keep all, Undo, the fold. h: { redraw(), toast(text) }. → true when it was one
|
|
14
|
+
* press(b, h) a press on [data-md]: keep all, Undo, the fold, Edit, Save, Cancel. h: { redraw(), toast(text) }. → true when it was one
|
|
15
15
|
*
|
|
16
|
-
* Zero is silence: no row drafted (or a read that failed) draws nothing.
|
|
17
|
-
*
|
|
16
|
+
* Zero is silence: no row drafted (or a read that failed) draws nothing. Edit (✎) turns the card's rows into fields in place (batch 16 item 1):
|
|
17
|
+
* each row's name, target and where it is measured; ✓ saves them (POST /api/metric-drafts/edit, one per changed row), × puts them back, and the
|
|
18
|
+
* chat icon asks Claude in Home for anything else. Discuss goes to Home's chat. Nothing is kept until the PM's ✓ keep. */
|
|
18
19
|
import { pmPost } from './http.js';
|
|
20
|
+
import { adler } from './cozy-adler.js'; // Claude drafted it unasked, so Adler holds the card (batch 16 item 2, canvas AdM3)
|
|
19
21
|
|
|
20
22
|
(function sheet() { // once, at import: the parts show on the Board and in Home's Viewer, and the look must come with them on both
|
|
21
23
|
if (typeof document === 'undefined' || !document.head || typeof document.getElementById !== 'function' || document.getElementById('mdCss')) return;
|
|
@@ -29,7 +31,7 @@ const SVG = (d, w = 16, sw = 1.8) => `<svg aria-hidden="true" width="${w}" heigh
|
|
|
29
31
|
const I = {
|
|
30
32
|
spark: 'M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z', ask: 'M4 5h16v11H9l-5 4z',
|
|
31
33
|
pen: 'M4 20h4l10.5-10.5a2.1 2.1 0 0 0-3-3L5 17v3z', check: 'M5 12l5 5L20 7', undo: 'M9 14L4 9l5-5M4 9h11a5 5 0 0 1 0 10h-3',
|
|
32
|
-
right: 'M10 7l5 5-5 5', down: 'M7 10l5 5 5-5',
|
|
34
|
+
right: 'M10 7l5 5-5 5', down: 'M7 10l5 5 5-5', x: 'M6 6l12 12M18 6L6 18',
|
|
33
35
|
};
|
|
34
36
|
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
35
37
|
const DAY = /^(\d{4})-(\d{2})-(\d{2})/;
|
|
@@ -40,6 +42,7 @@ const month = (iso) => { const m = DAY.exec(String(iso || '')); return m ? MON[+
|
|
|
40
42
|
const READ = new Map(); // scope|id → { ws, d: the GET answer | null, reading, busy }
|
|
41
43
|
const SEEN = new Set(); // scope|id whose part has been drawn once: the soft fade runs on the first draw only, never on a redraw
|
|
42
44
|
const FOLD = new Set(); // initiative ids whose kept success measure is open (it starts folded: summary first)
|
|
45
|
+
const EDIT = new Set(); // scope|id whose proposal is open for an inline edit
|
|
43
46
|
const keyOf = (scope, id) => scope + '|' + id;
|
|
44
47
|
function fetchOne(ws, scope, id) {
|
|
45
48
|
const q = new URLSearchParams({ scope, id }); if (ws) q.set('ws', ws);
|
|
@@ -82,10 +85,23 @@ const homeHref = (o) => { const q = new URLSearchParams(); for (const [k, v] of
|
|
|
82
85
|
const ib = (o) => (o.href
|
|
83
86
|
? `<a class="md-ib" href="${esc(o.href)}" aria-label="${esc(o.label)}" title="${esc(o.title || o.label)}">${SVG(o.icon)}</a>`
|
|
84
87
|
: `<button type="button" class="md-ib${o.solid ? ' solid' : ''}" data-md="${esc(o.act)}" data-md-scope="${esc(o.scope)}" data-md-id="${esc(o.id)}" aria-label="${esc(o.label)}" title="${esc(o.title || o.label)}"${o.busy ? ' disabled' : ''}>${SVG(o.icon, 16, o.solid ? 2.2 : 1.8)}</button>`);
|
|
85
|
-
const head = (label, src) => `<div class="md-hd"><span class="md-sp">${
|
|
88
|
+
const head = (label, src) => `<div class="md-hd"><span class="md-sp ad">${adler('needs-you', 32, { label: false })}</span><b>${esc(label)}</b>${src ? `<span class="md-src">${esc(src)}</span>` : ''}</div>`;
|
|
86
89
|
/** The one line of why: the server's line for the whole draft, else the lead row's own. */
|
|
87
90
|
const whyOf = (d, lead) => String((d && d.sub) || (lead && lead.why) || '');
|
|
88
91
|
|
|
92
|
+
/* ── the inline edit (batch 16 item 1): one field row per open draft; the card's footer turns into ask, ×, ✓ ── */
|
|
93
|
+
const field = (r, f, val, label, o = {}) => `<input class="md-fld${o.cls ? ' ' + o.cls : ''}" data-md-f="${f}" data-md-row="${esc(r.id)}" value="${esc(val)}" aria-label="${esc(label)}"${o.ph ? ` placeholder="${esc(o.ph)}"` : ''}${o.num ? ' inputmode="decimal"' : ''} maxlength="${o.max || 80}">`;
|
|
94
|
+
function editRows(rows, label) {
|
|
95
|
+
return `<div class="md-ed" role="list">${rows.map((r) => `<div class="md-er" role="listitem"><span class="md-role">${esc(label(r))}</span>`
|
|
96
|
+
+ field(r, 'name', r.name, 'Name of ' + r.name)
|
|
97
|
+
+ `<span class="md-ef">${r.type === 'Done or not' ? `<b class="md-to">${esc(r.targetTxt || 'Done')}</b>` : field(r, 'target', r.target == null ? '' : String(r.target), 'Target of ' + r.name, { num: true, cls: 'n', max: 20, ph: 'Target' })}`
|
|
98
|
+
+ field(r, 'source', r.source || '', 'Where ' + r.name + ' is measured', { ph: 'Measured by', max: 40 }) + '</span></div>').join('')}</div>`;
|
|
99
|
+
}
|
|
100
|
+
const editFoot = (scope, id, ask, busy) => `<div class="md-ft"><p class="md-why">Name, target and where it is measured. Anything else, ask me in Home.</p>`
|
|
101
|
+
+ ib({ href: ask, icon: I.ask, label: 'Ask Claude in Home to change something else', title: 'Ask in Home' })
|
|
102
|
+
+ ib({ act: 'cancel', scope, id, icon: I.x, label: 'Cancel the edit', title: 'Cancel', busy })
|
|
103
|
+
+ ib({ act: 'save', scope, id, icon: I.check, label: 'Save the edit', title: 'Save', solid: true, busy }) + '</div>';
|
|
104
|
+
|
|
89
105
|
/* ── the program: the proposed goal, then the kept Goal row ── */
|
|
90
106
|
export function progHtml(p, ws) {
|
|
91
107
|
if (!p || !p.id) return '';
|
|
@@ -107,11 +123,13 @@ export function progHtml(p, ws) {
|
|
|
107
123
|
+ rolls.map((r) => { const [a, ...b] = String(r.name).split(' · ');
|
|
108
124
|
return `<div class="md-ru" role="row"><span role="cell">${b.length ? `<b>${esc(a)}</b> · ${esc(b.join(' · '))}` : esc(a)}</span><span role="cell">${esc(nowOf(r))}</span><span role="cell">${r.ticket && r.now == null ? ticketPill(r.ticket) : esc([r.targetTxt, r.by ? 'by ' + day(r.by) : ''].filter(Boolean).join(' '))}</span></div>`; }).join('') + '</div>' : '';
|
|
109
125
|
const q = (w) => homeHref({ ws: ws || p.home, ask: 'program:' + p.id, q: w + p.title + ': ' });
|
|
126
|
+
if (EDIT.has(keyOf('program', p.id))) return `<section class="md-card md-top" aria-label="Edit the proposed goal">${head('Proposed goal', P.d.src)}`
|
|
127
|
+
+ editRows([goal].concat(rolls, guard), (r) => (r === goal ? 'Goal' : String(r.group || ''))) + editFoot('program', p.id, q('Change the proposed goal for '), P.busy) + '</section>';
|
|
110
128
|
return `<section class="md-card md-top${fade('program', p.id)}" aria-label="Proposed goal">${head('Proposed goal', P.d.src)}<p class="md-gl">${esc(line)}</p>`
|
|
111
129
|
+ (chips ? `<div class="md-cps">${chips}</div>` : '') + built
|
|
112
130
|
+ `<div class="md-ft"><p class="md-why">${esc(whyOf(P.d, goal))}</p>`
|
|
113
131
|
+ ib({ href: q('About the proposed goal for '), icon: I.ask, label: 'Discuss the proposed goal in Home', title: 'Discuss in Home' })
|
|
114
|
-
+ ib({
|
|
132
|
+
+ ib({ act: 'edit', scope: 'program', id: p.id, icon: I.pen, label: 'Edit the proposed goal', title: 'Edit', busy: P.busy })
|
|
115
133
|
+ ib({ act: 'keep', scope: 'program', id: p.id, icon: I.check, label: 'Keep this goal', solid: true, busy: P.busy }) + '</div></section>';
|
|
116
134
|
}
|
|
117
135
|
|
|
@@ -134,8 +152,9 @@ export function iniHtml(id, ws, title) {
|
|
|
134
152
|
}
|
|
135
153
|
const row = (r) => `<div class="md-mr"><span class="md-nm"><span class="md-role">${esc(roleOf(r))}</span><b>${esc(r.name)}</b>${r.ticket && r.now == null ? `<small>${ticketPill(r.ticket)}</small>` : r.why && r.why !== why ? `<small>${esc(r.why)}</small>` : ''}</span><span class="md-now">${esc(nowOf(r))}</span><b class="md-to">${esc(targetOf(r))}</b></div>`;
|
|
136
154
|
const q = homeHref({ ws, ask: id, q: 'Change the proposed success measure for ' + (title || id) + ': ' });
|
|
155
|
+
if (EDIT.has(keyOf('initiative', id))) return `<section class="md-card" aria-label="Edit the proposed success measure">${head('Proposed success measure', P.d.src)}` + editRows(R, roleOf) + editFoot('initiative', id, q, P.busy) + '</section>';
|
|
137
156
|
return `<section class="md-card${fade('initiative', id)}" aria-label="Proposed success measure">${head('Proposed success measure', P.d.src)}<div class="md-ms" role="list">${R.map(row).join('')}</div>`
|
|
138
|
-
+ `<div class="md-ft"><p class="md-why">${esc(why)}</p>${ib({
|
|
157
|
+
+ `<div class="md-ft"><p class="md-why">${esc(why)}</p>${ib({ act: 'edit', scope: 'initiative', id, icon: I.pen, label: 'Edit the proposed success measure', title: 'Edit', busy: P.busy })}`
|
|
139
158
|
+ ib({ act: 'keep', scope: 'initiative', id, icon: I.check, label: 'Keep this success measure', solid: true, busy: P.busy }) + '</div></section>';
|
|
140
159
|
}
|
|
141
160
|
|
|
@@ -145,7 +164,27 @@ export function press(b, h = {}) {
|
|
|
145
164
|
const scope = b.dataset.mdScope, id = b.dataset.mdId, one = READ.get(keyOf(scope, id));
|
|
146
165
|
const redraw = () => { if (h.redraw) h.redraw(); }, say = (m) => { if (h.toast) h.toast(m); };
|
|
147
166
|
if (a === 'fold') { if (FOLD.has(id)) FOLD.delete(id); else FOLD.add(id); redraw(); return true; }
|
|
167
|
+
if (a === 'edit') { EDIT.add(keyOf(scope, id)); redraw(); return true; }
|
|
168
|
+
if (a === 'cancel') { EDIT.delete(keyOf(scope, id)); redraw(); return true; }
|
|
148
169
|
if (!one || !one.d || one.busy) return true;
|
|
170
|
+
if (a === 'save') {
|
|
171
|
+
// what each field row says now, against the draft as read: only a changed row is sent
|
|
172
|
+
const card = b.closest('section') || (typeof document !== 'undefined' ? document : null), want = new Map();
|
|
173
|
+
for (const x of card ? card.querySelectorAll('[data-md-f]') : []) { const r = x.dataset.mdRow; if (!want.has(r)) want.set(r, {}); want.get(r)[x.dataset.mdF] = x.value; }
|
|
174
|
+
const rows = rowsOf(one.d).filter((r) => r.state === 'open' && want.has(r.id)).map((r) => ({ r, w: want.get(r.id) }))
|
|
175
|
+
.filter(({ r, w }) => (w.name !== undefined && w.name.trim() !== r.name) || (w.source !== undefined && w.source.trim() !== (r.source || '')) || (w.target !== undefined && w.target.trim() !== (r.target == null ? '' : String(r.target))));
|
|
176
|
+
if (!rows.length) { EDIT.delete(keyOf(scope, id)); redraw(); say('Nothing changed.'); return true; }
|
|
177
|
+
one.busy = true; redraw();
|
|
178
|
+
(async () => {
|
|
179
|
+
let bad = null;
|
|
180
|
+
for (const { r, w } of rows) { const res = await pmPost('/api/metric-drafts/edit', { ws: one.ws || null, scope, id, row: r.id, ...w }).catch(() => null); if (!res || !res.ok) { bad = (res && res.error) || 'Not saved. The server did not say why.'; break; } }
|
|
181
|
+
one.busy = false;
|
|
182
|
+
if (bad) { say(bad); redraw(); return; }
|
|
183
|
+
EDIT.delete(keyOf(scope, id)); say('Saved. Keep it to track it as you wrote it.');
|
|
184
|
+
await again(scope, id, redraw);
|
|
185
|
+
})();
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
149
188
|
const body = { ws: one.ws || null, scope, id };
|
|
150
189
|
one.busy = true; redraw();
|
|
151
190
|
(async () => {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* Every press is icon-only: ✓ keeps, the pencil opens the charter with the change filled in, ✕ drops it (Claude does not ask again unless the
|
|
12
12
|
* source changes). A row says why and where it came from. Nothing shows when there is nothing to suggest (zero is silence). The presses carry
|
|
13
13
|
* data-ms-act and data-key; the panel handles them. */
|
|
14
|
+
import { adler } from './cozy-adler.js'; // Adler holds Claude's suggested milestones (batch 16 item 2, canvas AdM2); the rows keep their ✦
|
|
14
15
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
15
16
|
const SV = (d, w, sw) => `<svg viewBox="0 0 24 24" width="${w || 16}" height="${w || 16}" fill="none" stroke="currentColor" stroke-width="${sw || 1.8}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
16
17
|
const I = {
|
|
@@ -78,7 +79,7 @@ export function firstHtml(p, L) {
|
|
|
78
79
|
const n = L.length, from = fromWords(L);
|
|
79
80
|
const all = L.length > 1 ? `<span class="msg-ends"><button type="button" class="msg-ok" data-ms-act="keepall" aria-label="Keep all ${n} suggestions" title="Keep all">${SV(I.check, 15, 2.4)}</button>`
|
|
80
81
|
+ `<button type="button" class="msg-ib" data-ms-act="dropall" aria-label="Drop all ${n} suggestions" title="Drop all">${SV(I.x, 15)}</button></span>` : '';
|
|
81
|
-
return `<div class="msg-box" role="group" aria-label="Claude's suggested milestones"><div class="msg-hd"><span class="msg-mk" aria-hidden="true">${
|
|
82
|
+
return `<div class="msg-box" role="group" aria-label="Claude's suggested milestones"><div class="msg-hd"><span class="msg-mk ad" aria-hidden="true">${adler('needs-you', 28, { label: false })}</span>`
|
|
82
83
|
+ `<span class="msg-ht"><b>Claude suggests ${n} ${plural(n, 'milestone', 'milestones')}</b>${from ? ' from ' + esc(from) : ''}</span>${all}</div>`
|
|
83
84
|
+ `<div role="list">${L.map((i) => rowHtml(p, i, 'first')).join('')}</div></div>`;
|
|
84
85
|
}
|