create-pmos 0.396.0 → 0.398.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 +25 -25
- 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/scripts/nine-stages.js +49 -20
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +103 -74
- package/workspace/briefing-premium-board-test.js +316 -154
- package/workspace/briefing-premium-calendar-2-test.js +135 -195
- package/workspace/briefing-premium-calendar-3-test.js +143 -413
- package/workspace/briefing-premium-calendar-test.js +86 -185
- package/workspace/briefing-premium-doc-edit-test.js +95 -83
- package/workspace/briefing-premium-initiative-test.js +166 -294
- package/workspace/briefing-premium-insights-test.js +351 -214
- package/workspace/briefing-premium-metrics-test.js +53 -118
- package/workspace/briefing-premium-products-test.js +40 -27
- package/workspace/briefing-premium-sources-test.js +91 -52
- package/workspace/briefing-premium-test.js +150 -633
- package/workspace/briefing-premium-work-test.js +88 -269
- package/workspace/changelog.json +24 -0
- package/workspace/fixtures/board-premium-facts.js +2 -1
- package/workspace/fixtures/board-premium-jira.js +28 -0
- package/workspace/fixtures/board-premium-trail.js +32 -0
- package/workspace/fixtures/initiative-premium-facts.js +2 -1
- package/workspace/fixtures/initiatives-api/list.json +30 -42
- package/workspace/fixtures/initiatives-api/roadmap.json +40 -56
- package/workspace/fixtures/initiatives-api/sheet.json +10 -14
- package/workspace/fixtures/insights-premium-facts.js +11 -2
- package/workspace/fixtures/premium-viewer-fixtures.js +182 -0
- package/workspace/guide/briefing-premium.md +3 -1
- package/workspace/guide/home.md +47 -0
- package/workspace/guide/index.md +2 -0
- package/workspace/guide/lifecycle.md +51 -0
- package/workspace/home-shot.js +38 -0
- package/workspace/lib/agent-roles.js +71 -0
- package/workspace/lib/board-premium.js +160 -3
- package/workspace/lib/board-trail.js +223 -0
- package/workspace/lib/engine/boards.js +15 -14
- package/workspace/lib/engine/nine-stages.js +49 -20
- package/workspace/lib/engine/signals/detectors.js +13 -11
- package/workspace/lib/home-work-item.js +58 -0
- package/workspace/lib/insights-goals.js +196 -0
- package/workspace/lib/insights-premium.js +126 -1
- package/workspace/lib/insights-records.js +101 -0
- package/workspace/lib/jira-tickets.js +1 -1
- package/workspace/lib/route-modules.js +4 -0
- package/workspace/lib/routes-board-premium.js +3 -2
- package/workspace/lib/routes-board-trail.js +33 -0
- package/workspace/lib/routes-home-desk.js +176 -0
- package/workspace/lib/routes-initiatives.js +1 -1
- package/workspace/lib/routes-insights-premium.js +19 -3
- package/workspace/lib/routes-insights-records.js +129 -0
- package/workspace/lib/routes-notes.js +1 -0
- package/workspace/lib/routes-viewer.js +108 -0
- package/workspace/lib/transcript-steps.js +123 -0
- package/workspace/lib/vendor/scripts/nine-stages.js +49 -20
- package/workspace/lib/viewer-meeting.js +205 -0
- package/workspace/lib/viewer-report.js +89 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-agreed-viewer-shots.js +76 -0
- package/workspace/premium-board-actions-test.js +85 -73
- package/workspace/premium-briefing-depth-test.js +66 -53
- package/workspace/premium-chat-attach-test.js +54 -63
- package/workspace/premium-chat-chart-tab-test.js +35 -36
- package/workspace/premium-chat-context-test.js +22 -19
- package/workspace/premium-chat-goal-view-test.js +28 -26
- package/workspace/premium-chat-notes-test.js +29 -33
- package/workspace/premium-chat-report-tab-test.js +35 -25
- package/workspace/premium-chat-term-test.js +16 -14
- package/workspace/premium-chat-viewer-test.js +60 -53
- package/workspace/premium-core-doc-issue-test.js +50 -41
- package/workspace/premium-html-viewer-test.js +17 -18
- package/workspace/premium-phone-card-test.js +8 -2
- package/workspace/premium-phone-room-test.js +42 -31
- package/workspace/premium-report-read-test.js +115 -197
- package/workspace/premium-viewer-download-test.js +19 -22
- package/workspace/premium-viewer-flicker-test.js +11 -16
- package/workspace/premium-viewer-share-test.js +6 -9
- package/workspace/premium-viewer-test.js +41 -60
- package/workspace/premium-vw-backlog-test.js +53 -31
- package/workspace/premium-vw-cal-test.js +82 -123
- package/workspace/premium-vw-copy-test.js +17 -33
- package/workspace/premium-vw-doc-test.js +12 -11
- package/workspace/premium-vw-item-test.js +50 -48
- package/workspace/premium-vw-jira-test.js +55 -26
- package/workspace/premium-vw-meet-test.js +118 -187
- package/workspace/premium-vw-notes-test.js +85 -107
- package/workspace/premium-vw-rec-test.js +72 -193
- package/workspace/premium-vw-slides-test.js +46 -50
- package/workspace/premium-welcome-test.js +3 -2
- package/workspace/premium-work-depth-test.js +63 -51
- package/workspace/public/pm/bd-acts.js +305 -0
- package/workspace/public/pm/bd-span.js +224 -0
- package/workspace/public/pm/bd-stages.js +47 -0
- package/workspace/public/pm/c3-doc-sheet.js +1 -1
- package/workspace/public/pm/c3-md.js +3 -395
- package/workspace/public/pm/c3-phone-detail.js +1 -1
- package/workspace/public/pm/c3-phone-model.js +3 -68
- package/workspace/public/pm/chat-term.js +3 -3
- package/workspace/public/pm/cozy-board.css +640 -0
- package/workspace/public/pm/cozy-home.css +580 -0
- package/workspace/public/pm/cozy-home.js +172 -0
- package/workspace/public/pm/cozy-initiative.css +138 -0
- package/workspace/public/pm/cozy-insights.css +421 -0
- package/workspace/public/pm/cozy-md.js +396 -0
- package/workspace/public/pm/cozy-nav.js +65 -0
- package/workspace/public/pm/cozy-placeholder.js +26 -0
- package/workspace/public/pm/cozy-viewer.css +143 -0
- package/workspace/public/pm/cozy-viewer.js +144 -0
- package/workspace/public/pm/cozy-vw.css +485 -0
- package/workspace/public/pm/cozy.css +254 -0
- package/workspace/public/pm/home-adddoc.js +48 -0
- package/workspace/public/pm/home-app.js +905 -0
- package/workspace/public/pm/home-around.js +515 -0
- package/workspace/public/pm/home-chat.js +459 -0
- package/workspace/public/pm/home-data.js +312 -0
- package/workspace/public/pm/home-draft.js +68 -0
- package/workspace/public/pm/home-more.js +249 -0
- package/workspace/public/pm/home-phone-card.js +109 -0
- package/workspace/public/pm/home-work.js +519 -0
- package/workspace/public/pm/lifecycle-lens-model.js +45 -27
- package/workspace/public/pm/lifecycle-lens.js +22 -11
- package/workspace/public/pm/phone-moment.js +69 -0
- package/workspace/public/pm/pm-work-view.js +1 -1
- package/workspace/public/pm/premium-attach.js +4 -0
- package/workspace/public/pm/premium-board.js +544 -253
- package/workspace/public/pm/premium-brief.js +1 -1
- package/workspace/public/pm/premium-chart-tab.js +110 -62
- package/workspace/public/pm/premium-chat.js +17 -10
- package/workspace/public/pm/premium-deck.js +3 -3
- package/workspace/public/pm/premium-first.js +25 -21
- package/workspace/public/pm/premium-initiative-head.js +138 -0
- package/workspace/public/pm/premium-initiative.js +28 -4
- package/workspace/public/pm/premium-insights.js +950 -440
- package/workspace/public/pm/premium-meeting.js +61 -549
- package/workspace/public/pm/premium-notes.js +1 -1
- package/workspace/public/pm/premium-report-frame.css +20 -0
- package/workspace/public/pm/premium-report-read.js +509 -480
- package/workspace/public/pm/premium-report-tab.js +87 -63
- package/workspace/public/pm/premium-shell.js +107 -124
- package/workspace/public/pm/premium-viewer.js +27 -1
- package/workspace/public/pm/premium-vw-cal.js +187 -48
- package/workspace/public/pm/premium-vw-doc.css +6 -0
- package/workspace/public/pm/premium-vw-doc.js +40 -2
- package/workspace/public/pm/premium-vw-file.js +2 -2
- package/workspace/public/pm/premium-vw-jira-model.js +22 -5
- package/workspace/public/pm/premium-vw-jira.css +11 -0
- package/workspace/public/pm/premium-vw-jira.js +11 -4
- package/workspace/public/pm/premium-vw-meet.js +6 -83
- package/workspace/public/pm/premium-vw-mtg.js +731 -0
- package/workspace/public/pm/premium-vw-notes.js +56 -69
- package/workspace/public/pm/premium-vw-open.js +35 -0
- package/workspace/public/pm/premium-vw-page.js +16 -0
- package/workspace/public/pm/premium-vw-rec.js +11 -215
- package/workspace/public/pm/premium-vw-slides.css +5 -0
- package/workspace/public/pm/premium-vw-slides.js +44 -8
- package/workspace/public/pm/term-view.js +22 -0
- package/workspace/public/premium-board.html +57 -64
- package/workspace/public/premium-chat.html +7 -33
- package/workspace/public/premium-initiative.html +8 -41
- package/workspace/public/premium-insights.html +63 -62
- package/workspace/public/premium-viewer.html +20 -0
- package/workspace/public/premium-work.html +6 -72
- package/workspace/public/premium.html +21 -66
- package/workspace/public/vendor/nunito-var.woff2 +0 -0
- package/workspace/server.js +25 -3
- package/workspace/test-files.json +1 -0
- package/workspace/test-lists/home-libs.json +9 -0
- package/workspace/test-lists/premium-agreed-viewer.json +9 -0
- package/workspace/test-lists/premium-report-read.json +1 -1
- package/workspace/test-lists/premium-vw-agreed.json +9 -0
- package/workspace/test-lists/premium-vw-notes.json +1 -1
- package/workspace/third-party/README.md +1 -0
- package/workspace/public/pm/premium-work.js +0 -719
- package/workspace/public/pm/premium.js +0 -1133
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cozy-home.js — Home's own parts (initiative premium-agreed-design, H1 and H2; planning/prd/premium-agreed-design-prd.md).
|
|
3
|
+
*
|
|
4
|
+
* Home is the desk: one list on the left in groups, the chat in the middle and the Viewer on the right (a popup on a phone). The groups reuse the
|
|
5
|
+
* cards the Briefing and My work drew (premium.js, premium-work.js); this file adds what is new on Home:
|
|
6
|
+
* - the summary line ("Good afternoon. 3 things need you."), drawn from the Needs you count premium.js reads
|
|
7
|
+
* - the meeting line: only the current or next meeting, with +N for the rest of the day, which opens the calendar in the Viewer
|
|
8
|
+
* - the Initiatives group: each open initiative with its step on the lifecycle and what finishes it, read from GET /api/board-premium
|
|
9
|
+
* - the Sessions group's count line, and on a phone the button that opens the session list
|
|
10
|
+
* - a fold on each group, remembered on this device
|
|
11
|
+
* It writes nothing. A press opens a conversation or a page; every write stays a press in the dialog it opens.
|
|
12
|
+
*/
|
|
13
|
+
import { mountNav } from './cozy-nav.js';
|
|
14
|
+
import { $, $$, esc, store, openDlg, loadThread, openChatPage, openSessions, openSessionRow, homeDock, turnA, ptx, kv } from './premium-shell.js';
|
|
15
|
+
|
|
16
|
+
mountNav('home');
|
|
17
|
+
|
|
18
|
+
/* ── the lifecycle: six stages and two milestones (◆). Ideate counts for Discover, Strategize for Prioritize (PRD L1). ── */
|
|
19
|
+
export const STEPS = [
|
|
20
|
+
{ key: 'triage', label: 'Triage', next: 'the BRD' },
|
|
21
|
+
{ key: 'discover', label: 'Discover', next: 'the PRD' },
|
|
22
|
+
{ key: 'plan', label: 'Plan', next: 'scope, timeline and work breakdown; your Commit pushes the tickets to Jira' },
|
|
23
|
+
{ key: 'prioritize', label: 'Prioritize', next: 'ranked on the roadmap' },
|
|
24
|
+
{ key: 'build', label: 'Build', next: 'the features delivered, tracked in Jira' },
|
|
25
|
+
{ key: 'deliver', label: 'Deliver', ms: true, next: 'the release shipped, with your sign-off' },
|
|
26
|
+
{ key: 'monitor', label: 'Monitor', next: 'the outcome report' },
|
|
27
|
+
{ key: 'evaluate', label: 'Evaluate', ms: true, next: 'your call: keep, iterate or stop' },
|
|
28
|
+
];
|
|
29
|
+
const OLD = { ideate: 'discover', strategize: 'prioritize', strategise: 'prioritize' };
|
|
30
|
+
/** The step a stage name stands for, or null when the name is not one of the eight (the raw name is then shown as it is). */
|
|
31
|
+
export function stepOf(stage) {
|
|
32
|
+
const k = String(stage || '').trim().toLowerCase().replace(/^◆\s*/, '');
|
|
33
|
+
const key = OLD[k] || k;
|
|
34
|
+
const i = STEPS.findIndex((s) => s.key === key);
|
|
35
|
+
return i < 0 ? null : { ...STEPS[i], i };
|
|
36
|
+
}
|
|
37
|
+
/** The eight-step ladder as cz-ladder marks: done, now, and the milestones as diamonds. */
|
|
38
|
+
export function ladderHtml(i) {
|
|
39
|
+
return `<span class="cz-ladder" aria-hidden="true">${STEPS.map((s, j) => `<i class="${[s.ms ? 'ms' : '', j < i ? 'done' : j === i ? 'now' : ''].filter(Boolean).join(' ')}"></i>`).join('')}</span>`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* ── the summary line ── */
|
|
43
|
+
export function greeting(d = new Date()) { const h = d.getHours(); return h < 5 ? 'Good evening' : h < 12 ? 'Good morning' : h < 18 ? 'Good afternoon' : 'Good evening'; }
|
|
44
|
+
export function summaryText(n, d = new Date()) {
|
|
45
|
+
if (n == null) return 'Reading what needs you.';
|
|
46
|
+
return greeting(d) + '. ' + (n === 0 ? 'Nothing needs you.' : n + (n === 1 ? ' thing needs you.' : ' things need you.'));
|
|
47
|
+
}
|
|
48
|
+
export function drawSummary(n) { const el = $('#hSum'); if (el) el.textContent = summaryText(n); }
|
|
49
|
+
|
|
50
|
+
/* ── the meeting line: the current or next meeting only; +N opens the calendar in the Viewer ── */
|
|
51
|
+
const hm = (iso) => { const d = new Date(iso); return Number.isNaN(d.getTime()) ? '' : String(d.getHours()).padStart(2, '0') + ':' + String(d.getMinutes()).padStart(2, '0'); };
|
|
52
|
+
const CLOCK = '<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg>';
|
|
53
|
+
const NOTES = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 3h9l4 4v14H6zM14 3v5h5M9 13h7M9 17h5"/></svg>';
|
|
54
|
+
/** The line's words from the brief-page day: { meeting, more, text, aria } or null when no meeting is left today. */
|
|
55
|
+
export function meetLineOf(P) {
|
|
56
|
+
const t = P && P.ok && Array.isArray(P.today) ? P.today : [];
|
|
57
|
+
const left = t.filter((m) => m && m.state !== 'past');
|
|
58
|
+
const m = left.find((x) => x.state === 'now') || left.find((x) => x.state === 'next') || left[0];
|
|
59
|
+
if (!m) return null;
|
|
60
|
+
const todo = (m.before || []).filter((x) => x && !x.done).length;
|
|
61
|
+
const note = m.state === 'now' ? 'on now' : todo ? todo + ' to do before' : (m.prepared || []).length ? 'prep ready' : '';
|
|
62
|
+
const more = left.length - 1;
|
|
63
|
+
return { meeting: m, more, note, text: (m.state === 'now' ? 'Now' : hm(m.start)) + ' ' + m.title,
|
|
64
|
+
aria: (m.state === 'now' ? 'Meeting on now: ' : 'Next meeting: ' + hm(m.start) + ' ') + m.title + (note ? ', ' + note : '') };
|
|
65
|
+
}
|
|
66
|
+
export function drawMeetLine(P, { open } = {}) {
|
|
67
|
+
const box = $('#hMeet'); if (!box) return;
|
|
68
|
+
if (!P || !P.ok) { box.hidden = true; return; }
|
|
69
|
+
const L = meetLineOf(P);
|
|
70
|
+
const calBtn = `<button type="button" class="cz-mcal" id="hMeetCal" aria-label="${L && L.more ? 'All meetings and notes: ' + L.more + ' more today' : 'The calendar and notes'}" title="Calendar and notes, in the Viewer">${L && L.more ? '+' + L.more : CLOCK}</button>`;
|
|
71
|
+
const notesBtn = `<button type="button" class="cz-mcal" id="hMeetNotes" aria-label="Meeting notes" title="Every meeting note, in the Viewer">${NOTES}</button>`;
|
|
72
|
+
box.innerHTML = (L
|
|
73
|
+
? `<button type="button" class="cz-mgo" id="hMeetGo" aria-label="${esc(L.aria)}">${CLOCK}<span><b>${esc(L.meeting.state === 'now' ? 'Now' : hm(L.meeting.start))}</b> ${esc(L.meeting.title)}${L.note ? ` · <em>${esc(L.note)}</em>` : ''}</span></button>`
|
|
74
|
+
: '<span class="cz-mgo cz-mnone">No more meetings today</span>') + calBtn + notesBtn;
|
|
75
|
+
box.hidden = false;
|
|
76
|
+
const go = $('#hMeetGo');
|
|
77
|
+
// the Viewer's registry (premium-vw-open.js): the meeting, the calendar and the notes each open in the czViewer card; nothing reloads the page
|
|
78
|
+
const V = () => import('./premium-vw-open.js').then(() => window.czViews);
|
|
79
|
+
if (go && L) go.onclick = () => V().then((v) => v.openMeeting(L.meeting));
|
|
80
|
+
$('#hMeetCal').onclick = () => V().then((v) => v.openCalendar({ view: 'day' }));
|
|
81
|
+
$('#hMeetNotes').onclick = () => V().then((v) => v.openNotes());
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* ── the Initiatives group (GET /api/board-premium: the open initiatives the Board lists, late and at-risk first) ── */
|
|
85
|
+
const I = { rows: null, err: '', ws: '', board: '', open: new Set(), ses: [] };
|
|
86
|
+
const wsQ = () => new URLSearchParams(location.search).get('ws') || '';
|
|
87
|
+
const iniHref = (r) => '/premium-initiative.html?' + ['id=' + encodeURIComponent(r.id), I.ws ? 'ws=' + encodeURIComponent(I.ws) : '', I.board ? 'board=' + encodeURIComponent(I.board) : ''].filter(Boolean).join('&');
|
|
88
|
+
const dotOf = (r) => (r.late ? 'late m-warn' : r.status === 'at risk' ? 'risk m-info' : r.status === 'blocked' ? 'red m-crit' : r.status === 'done' ? 'ok' : 'q');
|
|
89
|
+
/** An initiative's own sessions: a chat whose conversation is about it (init:<id> or board:<id>). */
|
|
90
|
+
const sesOf = (id) => I.ses.filter((s) => s.key && (s.key === 'init:' + id || s.key === 'board:' + id || s.key.startsWith('init:' + id + ':')));
|
|
91
|
+
function initRowHtml(r) {
|
|
92
|
+
const st = stepOf(r.stage), kids = sesOf(r.id), open = I.open.has(r.id);
|
|
93
|
+
const where = st ? st.label + (st.ms ? ' · milestone' : '') : r.stage || 'No stage';
|
|
94
|
+
const sub = [where, st ? 'Next: ' + st.next : '', r.statusLabel].filter(Boolean).join(' · ');
|
|
95
|
+
const kidsLine = kids.length ? kids.length + (kids.length === 1 ? ' session' : ' sessions') : 'More';
|
|
96
|
+
return `<li class="cz-row" data-ini="${esc(r.id)}"><button type="button" class="cz-rb" data-iopen="${esc(r.id)}" aria-label="${esc(r.title + ', ' + sub)}"><i class="cz-dot ${dotOf(r)}" aria-hidden="true"></i><span class="cz-rt"><b>${esc(r.title)}</b><small>${esc(sub)}</small>${st ? ladderHtml(st.i) : ''}</span></button>`
|
|
97
|
+
+ `<button type="button" class="cz-kids" data-ikids="${esc(r.id)}" aria-expanded="${open}" aria-label="${esc((open ? 'Hide' : 'Show') + ' what is inside ' + r.title)}">${esc(kidsLine)}<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg></button>`
|
|
98
|
+
+ (open ? `<ul class="cz-sub">${kids.map((k) => `<li><button type="button" class="cz-rb sm" data-isid="${esc(k.id)}"><i class="cz-dot ${k.state === 'needs' ? 'you m-info' : k.state === 'blocked' ? 'late m-warn' : k.state === 'working' ? 'ok' : 'q'}" aria-hidden="true"></i><span class="cz-rt"><b>${esc(k.name)}</b><small>${esc(k.hint || '')}</small></span></button></li>`).join('')}`
|
|
99
|
+
+ `<li><button type="button" class="cz-rb sm" data-iask="${esc(r.id)}"><span class="cz-rt"><b>Quick ask</b><small>A new question about ${esc(r.title)}</small></span></button></li>`
|
|
100
|
+
+ `<li><a class="cz-rb sm" href="${esc(iniHref(r))}"><span class="cz-rt"><b>Open the initiative</b><small>Its page: the ladder, its records and its work</small></span></a></li></ul>` : '')
|
|
101
|
+
+ '</li>';
|
|
102
|
+
}
|
|
103
|
+
function drawInit() {
|
|
104
|
+
const b = $('#initBody'), cap = $('#initCap'); if (!b) return;
|
|
105
|
+
if (I.rows == null) { b.innerHTML = I.err ? `<p class="note" role="status">The initiatives could not be read: ${esc(I.err)}</p>` : ''; cap.textContent = I.err ? 'Not read' : 'Reading'; return; }
|
|
106
|
+
cap.textContent = String(I.rows.length);
|
|
107
|
+
b.innerHTML = I.rows.length ? `<ul class="cz-list">${I.rows.map(initRowHtml).join('')}</ul>` : '<p class="note">No initiative is open on this board.</p>';
|
|
108
|
+
}
|
|
109
|
+
async function readInit() {
|
|
110
|
+
let r = null;
|
|
111
|
+
try { const res = await fetch('/api/board-premium' + (wsQ() ? '?ws=' + encodeURIComponent(wsQ()) : ''), { credentials: 'same-origin' }); r = await res.json(); } catch { r = null; }
|
|
112
|
+
if (r && r.state === 'reading') { setTimeout(readInit, 3000); return; } // the board's first read is still running
|
|
113
|
+
const m = r && r.ok && r.model;
|
|
114
|
+
if (!m || !m.initiatives) { I.rows = null; I.err = (r && r.error) || 'the server did not answer'; drawInit(); return; }
|
|
115
|
+
I.ws = m.ws || (m.board && m.board.ws) || wsQ(); I.board = (m.board && (m.board.id || '')) || '';
|
|
116
|
+
I.rows = (m.initiatives.list && m.initiatives.list.rows) || []; I.err = '';
|
|
117
|
+
drawInit();
|
|
118
|
+
}
|
|
119
|
+
/** An initiative row opens its conversation in the middle and where it stands in the Viewer (H2). */
|
|
120
|
+
function openIni(r) {
|
|
121
|
+
const st = stepOf(r.stage), key = 'init:' + r.id;
|
|
122
|
+
const pane = `<article class="paper doc cz-ini"><p class="label">Where it stands</p><h3 class="d2">${esc(r.title)}</h3>${st ? ladderHtml(st.i) + `<p><b>${esc(st.label)}${st.ms ? ' <i class="cz-ms" aria-hidden="true"></i>' : ''}</b>. What finishes it: ${esc(st.next)}.</p>` : `<p>Stage: ${esc(r.stage || 'none on record')}.</p>`}`
|
|
123
|
+
+ kv([['Owner and lane', r.sub], ['Status', r.statusLabel || (r.status ? r.status : '')], ['Finish', r.finish], ['Progress', r.progress != null ? r.progress + '%' : '']])
|
|
124
|
+
+ `<p><a href="${esc(iniHref(r))}">Open the initiative page</a></p></article>`;
|
|
125
|
+
const say = 'Ask about ' + r.title + '. Claude reads its records; it works in a real Claude Code session.';
|
|
126
|
+
openDlg({ eye: 'Initiative' + (st ? ' · ' + st.label : ''), title: r.title, sub: r.sub, say, stream: turnA(ptx(say)), noteKey: key, pane, label: 'Status' });
|
|
127
|
+
loadThread(key);
|
|
128
|
+
}
|
|
129
|
+
document.addEventListener('click', (e) => {
|
|
130
|
+
const o = e.target.closest('[data-iopen]'), k = e.target.closest('[data-ikids]'), s = e.target.closest('[data-isid]'), a = e.target.closest('[data-iask]');
|
|
131
|
+
const row = (id) => (I.rows || []).find((x) => x.id === id);
|
|
132
|
+
if (o) { const r = row(o.dataset.iopen); if (r) openIni(r); return; }
|
|
133
|
+
if (k) { const id = k.dataset.ikids; I.open.has(id) ? I.open.delete(id) : I.open.add(id); drawInit(); const again = $(`[data-ikids="${CSS.escape(id)}"]`); if (again) again.focus(); return; }
|
|
134
|
+
if (s) { openSessionRow(s.dataset.isid); return; }
|
|
135
|
+
if (a) { const r = row(a.dataset.iask); if (r) openChatPage('init:' + r.id, r.title); }
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
/* ── the Sessions group: its count line; on a phone, where the list is not docked, a button opens it ── */
|
|
139
|
+
document.addEventListener('pmos:sessions', (e) => {
|
|
140
|
+
const m = e.detail; I.ses = (m && m.rows) || [];
|
|
141
|
+
const cap = $('#sessCap'); if (cap) cap.textContent = !m || !m.live ? 'None running' : [m.ready ? m.ready + ' ready' : '', m.blocked ? m.blocked + ' may be stuck' : '', m.working ? m.working + ' running' : ''].filter(Boolean).join(' · ') || String(m.live);
|
|
142
|
+
if (I.rows && I.open.size) drawInit();
|
|
143
|
+
});
|
|
144
|
+
if (!homeDock()) {
|
|
145
|
+
const h = $('#hSessions');
|
|
146
|
+
if (h) { h.innerHTML = '<button type="button" class="cz-chip" id="hSesOpen">Open the session list</button>'; $('#hSesOpen').onclick = () => openSessions(); }
|
|
147
|
+
}
|
|
148
|
+
{ const c = $('#hChat'); if (c) c.onclick = () => openChatPage('chat:main', ''); }
|
|
149
|
+
|
|
150
|
+
/* ── a fold on each group, remembered on this device. Every group starts open. ── */
|
|
151
|
+
const FOLD_KEY = 'pmos.home.shut';
|
|
152
|
+
const GROUPS = ['movesCard', 'aroundCard', 'initGrp', 'sessGrp', 'queue', 'waitCard', 'frCard', 'revCard', 'todayCard'];
|
|
153
|
+
let shut;
|
|
154
|
+
try { shut = JSON.parse(store.get(FOLD_KEY) || 'null'); } catch { shut = null; }
|
|
155
|
+
if (!Array.isArray(shut)) shut = [];
|
|
156
|
+
function foldMount(id) {
|
|
157
|
+
const c = document.getElementById(id), h = c && c.querySelector(':scope > .ch');
|
|
158
|
+
if (!h || h.querySelector('.cz-fold')) return;
|
|
159
|
+
const t = h.querySelector('h2'), b = document.createElement('button');
|
|
160
|
+
b.type = 'button'; b.className = 'cz-fold'; b.setAttribute('aria-controls', id);
|
|
161
|
+
b.innerHTML = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg>';
|
|
162
|
+
const set = (s) => { c.classList.toggle('cz-shut', s); b.setAttribute('aria-expanded', String(!s)); b.setAttribute('aria-label', (s ? 'Show ' : 'Fold ') + (t ? t.textContent : 'this group')); };
|
|
163
|
+
set(shut.includes(id));
|
|
164
|
+
b.onclick = () => { const s = !c.classList.contains('cz-shut'); shut = s ? [...new Set([...shut, id])] : shut.filter((x) => x !== id); try { store.set(FOLD_KEY, JSON.stringify(shut)); } catch { /* no storage */ } set(s); };
|
|
165
|
+
h.prepend(b);
|
|
166
|
+
}
|
|
167
|
+
const foldAll = () => GROUPS.forEach(foldMount);
|
|
168
|
+
foldAll(); setTimeout(foldAll, 0); setTimeout(foldAll, 1500); // the Product group (Around you) is added by premium.js after this file runs
|
|
169
|
+
|
|
170
|
+
readInit();
|
|
171
|
+
setInterval(() => { if (!document.hidden) readInit(); }, 300000);
|
|
172
|
+
if (typeof window !== 'undefined') window.__cozyHome = { stepOf, summaryText, meetLineOf };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/* pm/cozy-initiative.css — the premium initiative page in the Agreed design (initiative premium-agreed-design, I1).
|
|
2
|
+
* Builds on pm/cozy.css (tokens, the floating menu) and pm/cozy-viewer.css (the premium tokens re-pointed to the cozy palette on .czi-tok).
|
|
3
|
+
* No page header: the header card starts at the top of the panel. Motion: only the cz-dot levels move. */
|
|
4
|
+
|
|
5
|
+
/* cozy.css's own dark tokens key on html.dark; the premium pages set data-theme, so this page repeats them for data-theme and the system setting */
|
|
6
|
+
:root[data-theme="dark"] body.cz {
|
|
7
|
+
--cz-ink: var(--cz-c-eceef1); --cz-ink2: var(--cz-c-c5c9d0); --cz-ink3: var(--cz-c-9ea4ad); --cz-card: var(--cz-c-24262b); --cz-well: var(--cz-c-1b1d21); --cz-well2: var(--cz-c-2a2d33); --cz-hair: rgba(236,238,241,.08);
|
|
8
|
+
--cz-blue: var(--cz-c-6aaaf0); --cz-blueink: var(--cz-c-9bc7f4); --cz-bluebg: rgba(106,170,240,.14); --cz-ground: linear-gradient(170deg, var(--cz-c-17191c) 0%, var(--cz-c-1b1d21) 60%, var(--cz-c-1c2430) 100%);
|
|
9
|
+
}
|
|
10
|
+
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body.cz {
|
|
11
|
+
--cz-ink: var(--cz-c-eceef1); --cz-ink2: var(--cz-c-c5c9d0); --cz-ink3: var(--cz-c-9ea4ad); --cz-card: var(--cz-c-24262b); --cz-well: var(--cz-c-1b1d21); --cz-well2: var(--cz-c-2a2d33); --cz-hair: rgba(236,238,241,.08);
|
|
12
|
+
--cz-blue: var(--cz-c-6aaaf0); --cz-blueink: var(--cz-c-9bc7f4); --cz-bluebg: rgba(106,170,240,.14); --cz-ground: linear-gradient(170deg, var(--cz-c-17191c) 0%, var(--cz-c-1b1d21) 60%, var(--cz-c-1c2430) 100%);
|
|
13
|
+
} }
|
|
14
|
+
|
|
15
|
+
.cz #dock { display: none !important; }
|
|
16
|
+
.cz .rise { animation: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
|
|
17
|
+
.cz .card::before { display: none; }
|
|
18
|
+
|
|
19
|
+
/* the panel: one soft white panel with a 16px margin, as the Agreed frames */
|
|
20
|
+
.cz main.stage.czi { box-sizing: border-box; max-width: none; margin: 16px; min-height: calc(100vh - 32px); padding: 16px 24px 120px; background: var(--cz-card);
|
|
21
|
+
border-radius: 28px; box-shadow: var(--cz-lift); font-family: var(--cz-sans); color: var(--cz-ink); display: flex; flex-direction: column; gap: 14px; }
|
|
22
|
+
.cz main.stage.czi > * { width: 100%; max-width: 1180px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
|
|
23
|
+
.cz .czi .hero-slim:has(#brief:empty) { display: none; }
|
|
24
|
+
|
|
25
|
+
/* ── the header card ── */
|
|
26
|
+
.czi-card { display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 20px; background: var(--cz-card); border: 1px solid var(--cz-hair); }
|
|
27
|
+
.czi .czi-top { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 6px 4px 8px; flex-wrap: nowrap; margin: 0; }
|
|
28
|
+
.czi-flag { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--cz-bluebg); color: var(--cz-blueink); }
|
|
29
|
+
.czi-flag svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
30
|
+
.czi-where { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0; }
|
|
31
|
+
.czi-kind { font-size: 11.5px; color: var(--cz-ink3); min-width: 0; }
|
|
32
|
+
.czi-kind .ihead { display: flex; align-items: center; gap: 8px; margin: 0; flex-wrap: wrap; }
|
|
33
|
+
.czi-kind .ihm { font-size: 11.5px; color: var(--cz-ink3); }
|
|
34
|
+
.czi-kind .chp { height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
|
|
35
|
+
.czi .czi-where .where { display: flex; align-items: center; gap: 4px; min-width: 0; }
|
|
36
|
+
.czi .czi-where .crumb { display: flex; align-items: center; gap: 2px; min-width: 0; background: none; border: 0; box-shadow: none; padding: 0; height: auto; }
|
|
37
|
+
.czi .czi-where #crIni { max-width: none; min-width: 0; font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--cz-ink); }
|
|
38
|
+
.czi .czi-where .crback { order: 3; width: 34px; height: 34px; min-width: 34px; min-height: 34px; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--cz-ink3); border-radius: 999px; }
|
|
39
|
+
.czi .czi-where .cri { width: 34px; height: 34px; min-width: 34px; border-radius: 999px; color: var(--cz-ink3); }
|
|
40
|
+
.czi .czi-where .crback:hover, .czi .czi-where .cri:hover { background: var(--cz-well); }
|
|
41
|
+
.czi .czi-top .tools { flex: none; gap: 4px; flex-wrap: nowrap; }
|
|
42
|
+
.czi .czi-top .schip { height: 34px; border-radius: 999px; background: var(--cz-well); border: 0; font: 700 12.5px var(--cz-sans); color: var(--cz-ink2); }
|
|
43
|
+
.czi .czi-top #moreBtn { width: 38px; height: 38px; min-width: 38px; min-height: 38px; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--cz-ink2); }
|
|
44
|
+
.czi .czi-top #moreBtn:hover { background: var(--cz-well); }
|
|
45
|
+
|
|
46
|
+
.czi-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--cz-well); }
|
|
47
|
+
.czi-box.you { box-shadow: inset 0 0 0 1.5px var(--cz-blue); }
|
|
48
|
+
.czi-row { display: flex; align-items: center; gap: 6px; font-size: 12px; }
|
|
49
|
+
.czi-sp { flex: 1; }
|
|
50
|
+
.czi-stage { color: var(--cz-ink3); white-space: nowrap; }
|
|
51
|
+
.czi-turn { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; font-weight: 800; background: var(--cz-card); color: var(--cz-ink2); }
|
|
52
|
+
.czi-turn.you { background: var(--cz-bluebg); color: var(--cz-blueink); }
|
|
53
|
+
.czi-turn.stalled { background: transparent; box-shadow: inset 0 0 0 1px var(--cz-dot-late); color: var(--cz-late); }
|
|
54
|
+
.czi-lad { display: flex; align-items: center; gap: 6px; font-size: 12px; min-width: 0; }
|
|
55
|
+
.czi-lad svg { width: 12px; height: 12px; flex: none; fill: none; stroke: var(--cz-ink3); stroke-width: 2.4; }
|
|
56
|
+
.czi-lad b { font-size: 14px; font-weight: 800; white-space: nowrap; }
|
|
57
|
+
.czi-prev { color: var(--cz-ok); white-space: nowrap; }
|
|
58
|
+
.czi-next { color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
59
|
+
.czi-bars { width: 100%; }
|
|
60
|
+
.czi-bars i.done { background: var(--cz-dot-ok); }
|
|
61
|
+
.czi-bars i.now { background: var(--cz-blue); }
|
|
62
|
+
:root[data-theme="dark"] .czi-bars i:not(.done):not(.now) { background: var(--cz-c-33363c); }
|
|
63
|
+
|
|
64
|
+
.czi-items { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
|
|
65
|
+
.czi-ckh { display: flex; align-items: center; gap: 6px; font-size: 12px; }
|
|
66
|
+
.czi-ckh > span { margin-left: auto; color: var(--cz-ink3); white-space: nowrap; }
|
|
67
|
+
.czi-ckt, .czi-fold { display: flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 6px; border-radius: 8px; font: inherit; font-size: 12px; color: var(--cz-ink); background: none; border: 0; cursor: pointer; text-align: left; }
|
|
68
|
+
.czi-ckt b, .czi-fold b { font-weight: 800; }
|
|
69
|
+
.czi-ckt:hover, .czi-fold:hover, .czi-donerow:hover { background: var(--cz-well2); }
|
|
70
|
+
.czi-ckt svg, .czi-fold svg, .czi-donerow svg { width: 12px; height: 12px; flex: none; fill: none; stroke: var(--cz-ink3); stroke-width: 2.2; }
|
|
71
|
+
.czi-ckt[aria-expanded="true"] svg, .czi-donerow[aria-expanded="true"] svg { transform: rotate(180deg); }
|
|
72
|
+
.czi-fold span { flex: 1; min-width: 0; color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
73
|
+
.czi-it { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 2px 6px; border-radius: 8px; font-size: 13px; }
|
|
74
|
+
button.czi-it { font: inherit; font-size: 13px; background: none; border: 0; cursor: pointer; text-align: left; color: var(--cz-ink3); width: 100%; }
|
|
75
|
+
.czi-it.done { color: var(--cz-ink3); }
|
|
76
|
+
.czi-it.you { font-weight: 700; }
|
|
77
|
+
.czi-it.risk { font-weight: 700; }
|
|
78
|
+
.czi-itl { flex: 1; min-width: 0; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; }
|
|
79
|
+
.czi-donerow .czi-itl { white-space: nowrap; }
|
|
80
|
+
.czi-mk { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 11px; font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--cz-hair); }
|
|
81
|
+
.czi-mk.done { background: var(--cz-dot-ok); color: var(--cz-c-ffffff); box-shadow: none; }
|
|
82
|
+
.czi-mk.you { box-shadow: inset 0 0 0 2px var(--cz-blue); background: var(--cz-bluebg); }
|
|
83
|
+
.czi-mk.agent { box-shadow: inset 0 0 0 2px var(--cz-dot-ok); }
|
|
84
|
+
.czi-mk.jira { background: var(--cz-blueink); color: var(--cz-c-ffffff); box-shadow: none; border-radius: 6px; font-size: 10px; }
|
|
85
|
+
.czi-mk.risk { box-shadow: inset 0 0 0 2px var(--cz-dot-late); color: var(--cz-late); }
|
|
86
|
+
.czi-tag { flex: none; font-size: 11px; color: var(--cz-ink3); }
|
|
87
|
+
.czi-tag.you { padding: 1px 8px; border-radius: 999px; background: var(--cz-blue); color: var(--cz-c-ffffff); font-weight: 800; }
|
|
88
|
+
.czi-tag.risk { padding: 1px 8px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--cz-dot-late); color: var(--cz-late); font-weight: 800; }
|
|
89
|
+
.czi-tag.jira { padding: 1px 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--cz-hair); color: var(--cz-ink2); font-weight: 800; }
|
|
90
|
+
.czi-none { margin: 0; padding: 4px 6px; font-size: 13px; color: var(--cz-ink3); }
|
|
91
|
+
.czi-pay { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--cz-card); font-size: 12px; line-height: 1.4; color: var(--cz-ink2); }
|
|
92
|
+
.czi-pay b { color: var(--cz-ink); font-weight: 800; }
|
|
93
|
+
.czi-time { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--cz-ink3); }
|
|
94
|
+
.czi-time.over { color: var(--cz-late); font-weight: 700; }
|
|
95
|
+
.czi-time svg { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; }
|
|
96
|
+
.czi-acts { display: flex; gap: 6px; }
|
|
97
|
+
.czi-cta { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border-radius: 12px; font: 800 14px var(--cz-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; cursor: pointer;
|
|
98
|
+
background: var(--cz-blueink); color: var(--cz-c-ffffff); }
|
|
99
|
+
.czi-cta.alt { background: var(--cz-card); color: var(--cz-ink); box-shadow: inset 0 0 0 1px var(--cz-hair); }
|
|
100
|
+
.czi-ov { flex: none; width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; background: var(--cz-card); border: 0; box-shadow: inset 0 0 0 1px var(--cz-hair); cursor: pointer; }
|
|
101
|
+
.czi-ov span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--cz-c-d97757); color: var(--cz-c-ffffff); font-size: 12px; font-weight: 800; }
|
|
102
|
+
|
|
103
|
+
/* ── the cards below: the premium cards in cozy dress ── */
|
|
104
|
+
.czi .card { border-radius: 22px; box-shadow: none; border: 1px solid var(--cz-hair); background: var(--cz-card); padding: 20px 22px; }
|
|
105
|
+
.czi .ch { position: static; margin: -20px -22px 0; padding: 18px 22px 10px; background: transparent; box-shadow: none; }
|
|
106
|
+
.czi .ch .ic { width: 34px; height: 34px; border-radius: 12px; background: var(--cz-bluebg); color: var(--cz-blueink); }
|
|
107
|
+
.czi .ch h2 { font-size: 16px; font-weight: 800; }
|
|
108
|
+
.czi .label { font: 800 12px var(--cz-sans); letter-spacing: 0; text-transform: none; color: var(--cz-ink3); }
|
|
109
|
+
.czi .seg { background: var(--cz-well); }
|
|
110
|
+
.czi .seg .pill { background: var(--cz-card); box-shadow: 0 1px 3px rgba(42,46,53,.12); }
|
|
111
|
+
.czi .seg button { font-weight: 700; color: var(--cz-ink3); }
|
|
112
|
+
.czi .seg button[aria-pressed="true"] { color: var(--cz-ink); }
|
|
113
|
+
.czi .todo { border-radius: 16px; background: var(--cz-well); }
|
|
114
|
+
.czi .cta, .czi .fold, .czi .dmcta { border-radius: 999px; font-weight: 800; }
|
|
115
|
+
.czi .cta:hover, .czi .round:hover { transform: none; }
|
|
116
|
+
.czi .dmr, .czi .tkq, .czi .icd { border-radius: 14px; }
|
|
117
|
+
.czi .chp { font-family: var(--cz-sans); }
|
|
118
|
+
.czi .empty3, .czi .note { color: var(--cz-ink3); }
|
|
119
|
+
.czi .footi { display: flex; justify-content: flex-start; }
|
|
120
|
+
|
|
121
|
+
/* the top row's round presses (back, bell, more) are quiet icon buttons, not glass */
|
|
122
|
+
.czi .czi-top .round, .czi .czi-top .glass { background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--cz-ink2); }
|
|
123
|
+
.czi .czi-top .round:hover { background: var(--cz-well); transform: none; }
|
|
124
|
+
.czi .czi-where #crBoard.crback { width: 34px; height: 34px; min-width: 34px; min-height: 34px; background: none; border: 0; color: var(--cz-ink3); }
|
|
125
|
+
.czi .czi-where #crBoard.crback:hover { background: var(--cz-well); }
|
|
126
|
+
.czi .czi-where #crBoard.crback svg { width: 16px; height: 16px; }
|
|
127
|
+
.czi .tdw, .czi .todo .tdw { font: 800 12px var(--cz-sans); letter-spacing: 0; text-transform: none; }
|
|
128
|
+
.czi-bars i { background: var(--cz-c-dedbd5); }
|
|
129
|
+
|
|
130
|
+
/* phone: the panel fills the screen, the card's top row is the one-line bar, the floating menu sits bottom right */
|
|
131
|
+
@media (max-width: 720px) {
|
|
132
|
+
.cz main.stage.czi { margin: 0; border-radius: 0; min-height: 100vh; padding: 8px 12px 96px; box-shadow: none; }
|
|
133
|
+
.czi-card { border: 0; padding: 0; }
|
|
134
|
+
.czi .czi-top { min-height: 48px; padding: 0 0 0 2px; }
|
|
135
|
+
.czi-kind { display: none; }
|
|
136
|
+
.czi .card { padding: 16px 14px; border-radius: 18px; }
|
|
137
|
+
.czi .ch { margin: -16px -14px 0; padding: 14px 14px 8px; }
|
|
138
|
+
}
|