create-pmos 0.279.0 → 0.281.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/payload/KIT-VERSION +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/bin/pmos.js +1 -1
- package/workspace/briefing-premium-board-test.js +1 -1
- package/workspace/briefing-premium-doc-edit-test.js +3 -3
- package/workspace/briefing-premium-initiative-test.js +3 -3
- package/workspace/briefing-premium-insights-test.js +1 -1
- package/workspace/briefing-premium-test.js +3 -3
- package/workspace/briefing-premium-work-test.js +3 -3
- package/workspace/guide/briefing-premium.md +13 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-core-doc-issue-test.js +5 -5
- package/workspace/premium-welcome-test.js +213 -0
- package/workspace/premium-work-depth-test.js +2 -2
- package/workspace/public/pm/premium-first.js +36 -0
- package/workspace/public/pm/premium-initiative.js +8 -4
- package/workspace/public/pm/premium-shell.js +2 -1
- package/workspace/public/pm/premium-welcome-model.js +110 -0
- package/workspace/public/pm/premium-welcome.js +235 -0
- package/workspace/public/pm/premium.css +89 -1
- package/workspace/public/pm/premium.js +2 -0
- package/workspace/public/premium-board.html +1 -1
- package/workspace/public/premium-initiative.html +1 -1
- package/workspace/public/premium-insights.html +1 -1
- package/workspace/public/premium-welcome.html +23 -0
- package/workspace/public/premium-work.html +1 -1
- package/workspace/public/premium.html +1 -1
- package/workspace/server.js +2 -2
- package/workspace/test-files.json +2 -0
- package/workspace/test-lists/briefing-premium.json +2 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* premium-board-actions, pm/premium-acts.js): move to the next stage or back, hold, cancel, archive, resume, reopen and restore, each with Undo. Nothing here issues a document. */
|
|
7
7
|
import { pmPost } from './http.js';
|
|
8
8
|
import { proposalsModel, editBody, acceptBody, rejectBody, askBody, askLine, issueBody, mdHtml } from './premium-doc-edit.js';
|
|
9
|
-
import { $, $$, esc, openDlg, closeDlg, setMode, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, kv, H2, CHECK, crumbHtml, wireCrumb, AI, openAddDoc } from './premium-shell.js';
|
|
9
|
+
import { $, $$, esc, openDlg, closeDlg, setMode, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, kv, H2, CHECK, CHEV, crumbHtml, wireCrumb, AI, openAddDoc } from './premium-shell.js';
|
|
10
10
|
import { barHtml, onBar, closeMenu } from './premium-acts.js';
|
|
11
11
|
|
|
12
12
|
let M = null; // the model
|
|
@@ -233,7 +233,9 @@ function issueBar(s) {
|
|
|
233
233
|
}
|
|
234
234
|
function sheetPane() {
|
|
235
235
|
const s = sheet, d = s.d;
|
|
236
|
-
const
|
|
236
|
+
const cnt = (k) => (k === 'props' && s.props && propsM(s).count ? ` <em>${propsM(s).count}</em>` : '');
|
|
237
|
+
const EYE = '<svg class="i" viewBox="0 0 24 24"><path d="M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/></svg>';
|
|
238
|
+
const menu = `<div class="dsvr" id="shT"><span class="dsvw"><button type="button" class="dsvb" id="shV" aria-haspopup="menu" aria-expanded="${!!s.vm}">${EYE}${esc(TABS.find((t) => t[0] === s.tab)[1])}${cnt(s.tab)}${CHEV}</button>${s.vm ? `<div class="dsmn" role="menu" aria-label="Document views">${TABS.map(([k, n]) => `<button type="button" role="menuitem" data-sh="${k}" aria-current="${s.tab === k}">${n}${cnt(k)}${s.tab === k ? CHECK : ''}</button>`).join('')}</div>` : ''}</span></div>`;
|
|
237
239
|
const head = `<p class="dpath">${esc(d.path)}</p><div class="dsm"><span class="${d.st === 'ok' ? 'ok' : d.st === 'draft' ? 'warn' : 'mut'}">${esc(d.state)}</span>${d.when ? `<span>updated ${esc(d.when)}</span>` : ''}${d.by ? `<span>${esc(d.by)}</span>` : ''}</div>`;
|
|
238
240
|
let body = '';
|
|
239
241
|
if (s.err) body = `<p class="empty3 plain">${esc(s.err)}</p>`;
|
|
@@ -278,7 +280,7 @@ function propHtml(s, p) {
|
|
|
278
280
|
const secs = p.sections.map((x) => `<div class="dsdf">${p.sections.length > 1 && !x.stale ? `<label><input type="checkbox" data-pk="${esc(p.id)}" value="${esc(x.name)}"${on(x.name) ? ' checked' : ''}> ` : ''}<b>${esc(x.name)}</b>${p.sections.length > 1 && !x.stale ? '</label>' : ''} ${x.stale ? '<span class="dst2">Changed since this was proposed</span>' : `<ins>+ ${esc(x.add)}</ins>`}</div>`).join('');
|
|
279
281
|
return `<div class="dsp"><div><b>${esc(p.who)}</b><span>${esc(p.request)}</span>${secs}${p.staleAll ? '<q>The document changed since this was proposed, so it cannot be accepted. Ask again.</q>' : ''}</div><div class="dsa">${p.canAccept ? `<button class="dmcta dark" data-ds="acc:${esc(p.id)}"${s.busy ? ' disabled' : ''}>Accept</button>` : ''}<button class="dmcta alt" data-ds="rej:${esc(p.id)}"${s.busy ? ' disabled' : ''}>Reject</button></div>${s.rejecting === p.id ? `<div class="dsrow" style="grid-column:1/-1"><input id="dsRj" class="dsy" placeholder="Why are you rejecting it? Kept in the edit log." aria-label="Why are you rejecting it" value="${esc(s.rejWhy || '')}"><button class="dmcta dark" data-ds="rejgo:${esc(p.id)}"${s.busy ? ' disabled' : ''}>Reject it</button><button class="dmcta alt" data-ds="rejno">Cancel</button></div>` : ''}</div>`;
|
|
280
282
|
}
|
|
281
|
-
function drawSheet() { $('#oMain').innerHTML = sheetPane();
|
|
283
|
+
function drawSheet() { $('#oMain').innerHTML = sheetPane(); }
|
|
282
284
|
async function getJson(url, init) { try { const r = await fetch(url, Object.assign({ credentials: 'same-origin' }, init || {})); return await r.json(); } catch { return null; } }
|
|
283
285
|
async function loadTab(tab) {
|
|
284
286
|
const s = sheet, p = encodeURIComponent(s.d.path), ws = M.board.ws ? '&ws=' + encodeURIComponent(M.board.ws) : '';
|
|
@@ -317,8 +319,10 @@ function openSheet(d) {
|
|
|
317
319
|
drawSheet(); loadThread(key); loadTab('read');
|
|
318
320
|
}
|
|
319
321
|
$('#oMain').addEventListener('click', (e) => {
|
|
322
|
+
if (sheet && sheet.vm && !e.target.closest('.dsvw')) { sheet.vm = false; drawSheet(); }
|
|
323
|
+
if (sheet && e.target.closest('#shV')) { keepDraft(); sheet.vm = !sheet.vm; drawSheet(); return; }
|
|
320
324
|
const t = e.target.closest('[data-sh]');
|
|
321
|
-
if (t && sheet) { keepDraft(); sheet.tab = t.dataset.sh; sheet.err = null; sheet.msg = ''; drawSheet(); loadTab(sheet.tab); return; }
|
|
325
|
+
if (t && sheet) { keepDraft(); sheet.vm = false; sheet.tab = t.dataset.sh; sheet.err = null; sheet.msg = ''; drawSheet(); loadTab(sheet.tab); return; }
|
|
322
326
|
const b = e.target.closest('[data-ds]'); if (b && sheet) { sheetPress(b.dataset.ds); return; }
|
|
323
327
|
const g = e.target.closest('[data-go]'); if (g) { const h = $('#ds-h' + g.dataset.go); if (h) h.scrollIntoView({ block: 'start', behavior: 'smooth' }); }
|
|
324
328
|
});
|
|
@@ -38,7 +38,7 @@ export function openDlg(o) {
|
|
|
38
38
|
$('#dEye').textContent = o.eye; $('#dTitle').textContent = o.title; $('#dSub').textContent = o.sub || ''; $('#dSub').hidden = !o.sub;
|
|
39
39
|
$('#oMain').innerHTML = o.pane || `<article class="paper doc">${o.html}</article>`; $('#oLab').textContent = o.label || 'Detail';
|
|
40
40
|
$('#dBody').innerHTML = `<div class="stream" role="log">${o.stream || turnA(ptx(o.say))}</div><form class="askbar" id="askF"><input id="askIn" placeholder="Ask the agent about this row" maxlength="2000" autocomplete="off" aria-label="A question for the agent"><button type="submit" data-act="ask" id="askGo" aria-label="Ask the agent" title="Ask the agent"><svg class="i" viewBox="0 0 24 24"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button></form><p class="fine2" id="askNote">The agent reads this repository and answers in words. It cannot change anything, and its answers are not checked against the records.</p>`;
|
|
41
|
-
$('#dlg').classList.remove('full'); setMode(
|
|
41
|
+
$('#dlg').classList.remove('full'); setMode('split'); setTab('out'); // on a phone the dialog opens on the Detail tab and the Detail / Conversation switch brings the conversation, as the mockup draws it
|
|
42
42
|
$('#veil').classList.add('on'); $('#dlg').classList.add('on');
|
|
43
43
|
$$('#dGrid .pane').forEach((p) => { p.scrollTop = 0; });
|
|
44
44
|
setTimeout(() => $('#dlg').focus(), 60);
|
|
@@ -60,6 +60,7 @@ export function setMode(m) {
|
|
|
60
60
|
}
|
|
61
61
|
$('#dPane').onclick = () => setMode($('#dlg').dataset.mode === 'split' ? 'detail' : 'split');
|
|
62
62
|
export function setFull(f) { $('#dlg').classList.toggle('full', f); const b = $('#dExpand'); b.setAttribute('aria-pressed', f); b.title = f ? 'Exit full screen' : 'Full screen'; $('#dExpP').setAttribute('d', f ? 'M20 10h-6V4M4 14h6v6M14 10l7-7M3 21l7-7' : 'M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7'); }
|
|
63
|
+
$('#tabGo').onclick = () => setTab('chat');
|
|
63
64
|
$('#dClose').onclick = closeDlg; $('#veil').onclick = closeDlg;
|
|
64
65
|
$('#dExpand').onclick = () => setFull(!$('#dlg').classList.contains('full'));
|
|
65
66
|
$('#dTabs').addEventListener('click', (e) => { const b = e.target.closest('[data-t]'); if (b) setTab(b.dataset.t); });
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/* pm/premium-welcome-model.js — the pure half of the premium Welcome page (initiative premium-welcome). No DOM, no request: it turns the
|
|
2
|
+
* onboarding routes' answers and the PM's choices into the bodies the page posts and the rows it draws, so a node test loads it with import().
|
|
3
|
+
* Routes (lib/routes-onboarding.js): GET /api/onboarding/status | structure | briefing, POST /api/onboarding/scan | apply | undo | dismiss.
|
|
4
|
+
* Text taken from the scanned folder is untrusted. Nothing here quotes a file; the page escapes every value it draws. */
|
|
5
|
+
|
|
6
|
+
/** The tools a first run can read besides the folders. `source` is a lib/freshness.js SOURCES id with a read-only skill; `brief` is a lib/proactive.js BRIEF_SOURCES key. */
|
|
7
|
+
export const TOOLS = [
|
|
8
|
+
{ source: 'calendar', name: 'Calendar', adds: 'Your meetings today and for the next 14 days, so the Briefing can get you ready for them.' },
|
|
9
|
+
{ source: 'my-work', name: 'Jira', adds: 'The Jira issues assigned to you, so My work starts with them.' },
|
|
10
|
+
{ source: 'inbox', brief: 'mail', name: 'Inbox', adds: 'The threads waiting on you, by subject and sender only. No message text is kept.' },
|
|
11
|
+
{ source: 'slack', brief: 'slack', name: 'Slack', adds: 'Messages that mention you and your direct messages, as short summaries.' },
|
|
12
|
+
];
|
|
13
|
+
export const STEPS = [['about', 'About you'], ['sources', 'Your sources'], ['found', 'What PMOS found']];
|
|
14
|
+
export const FIELDS = ['name', 'role', 'work', 'duties'];
|
|
15
|
+
|
|
16
|
+
const str = (v) => (typeof v === 'string' ? v : '');
|
|
17
|
+
export const plural = (n, one, many) => `${n} ${n === 1 ? one : many}`;
|
|
18
|
+
export const fileRef = (e) => (e && typeof e === 'object' ? (e.line ? `${str(e.file)}:${e.line}` : str(e.file)) : '');
|
|
19
|
+
|
|
20
|
+
/** The About you fields from GET /api/proactive/settings. Missing or malformed gives empty fields. */
|
|
21
|
+
export function aboutOf(ps) {
|
|
22
|
+
const s = ps && ps.ok && ps.settings && typeof ps.settings === 'object' ? ps.settings : {};
|
|
23
|
+
const a = s.about && typeof s.about === 'object' ? s.about : {};
|
|
24
|
+
return { name: str(s.name), role: str(a.role), work: str(a.work), duties: str(a.duties) };
|
|
25
|
+
}
|
|
26
|
+
/** The body of POST /api/proactive/settings for the About you step. */
|
|
27
|
+
export const aboutBody = (a) => ({ name: str(a.name).trim().slice(0, 40), about: { role: str(a.role).trim(), work: str(a.work).trim(), duties: str(a.duties).trim() } });
|
|
28
|
+
|
|
29
|
+
/** What pressing Scan starts: the tools to turn on for the daily brief, and the tools to refresh as their own read-only sessions. */
|
|
30
|
+
export function toolPlan(pick) {
|
|
31
|
+
const picked = TOOLS.filter((x) => pick && pick[x.source]);
|
|
32
|
+
return { brief: picked.filter((x) => x.brief), refresh: picked.filter((x) => !x.brief) };
|
|
33
|
+
}
|
|
34
|
+
export const briefBody = (brief) => ({ briefSources: Object.fromEntries(brief.map((x) => [x.brief, true])) });
|
|
35
|
+
|
|
36
|
+
/** The proposed initiatives of GET /api/onboarding/structure, flat, each with its board key. */
|
|
37
|
+
export function rowsOf(structure) {
|
|
38
|
+
const boards = structure && Array.isArray(structure.boards) ? structure.boards : [];
|
|
39
|
+
return boards.flatMap((b) => (Array.isArray(b.initiatives) ? b.initiatives : []).map((r) => ({ ...r, board: b.key })));
|
|
40
|
+
}
|
|
41
|
+
export const boardOfRow = (r, st) => (st.boardOf && st.boardOf[r.proposal_id]) || r.board;
|
|
42
|
+
/** The page's starting choices: a row is ticked as the scan proposed it, and keeps its own title. */
|
|
43
|
+
export function startChoices(structure) {
|
|
44
|
+
const checked = {}, titles = {};
|
|
45
|
+
for (const r of rowsOf(structure)) { checked[r.proposal_id] = !!r.checked; titles[r.proposal_id] = str(r.title); }
|
|
46
|
+
return { checked, titles };
|
|
47
|
+
}
|
|
48
|
+
export function counts(structure, st) {
|
|
49
|
+
const on = rowsOf(structure).filter((r) => st.checked[r.proposal_id]);
|
|
50
|
+
return { n: on.length, m: new Set(on.map((r) => boardOfRow(r, st))).size };
|
|
51
|
+
}
|
|
52
|
+
export const importText = (c) => `Import ${plural(c.n, 'initiative', 'initiatives')} into ${plural(c.m, 'board', 'boards')}`;
|
|
53
|
+
|
|
54
|
+
/** The revisions apply takes: a changed, non-empty title and a changed board. */
|
|
55
|
+
export function revisions(structure, st) {
|
|
56
|
+
const out = {};
|
|
57
|
+
for (const r of rowsOf(structure)) {
|
|
58
|
+
const rev = {}, t = str(st.titles && st.titles[r.proposal_id]).trim();
|
|
59
|
+
if (t && t !== r.title) rev.title = t;
|
|
60
|
+
if (st.boardOf && st.boardOf[r.proposal_id] && st.boardOf[r.proposal_id] !== r.board) rev.board = st.boardOf[r.proposal_id];
|
|
61
|
+
if (Object.keys(rev).length) out[r.proposal_id] = rev;
|
|
62
|
+
}
|
|
63
|
+
return out;
|
|
64
|
+
}
|
|
65
|
+
/** The answers apply takes. An untouched question sends its default (the PM saw it listed); a skipped one sends nothing. */
|
|
66
|
+
export function answersOf(structure, st) {
|
|
67
|
+
const answers = {};
|
|
68
|
+
for (const q of (structure && Array.isArray(structure.questions) ? structure.questions : [])) {
|
|
69
|
+
if (st.skipped && st.skipped[q.id]) continue;
|
|
70
|
+
const v = st.answers && st.answers[q.id] != null ? st.answers[q.id] : q.default;
|
|
71
|
+
if (q.id === 'template') answers.template = Object.assign(answers.template || {}, { [q.board]: v });
|
|
72
|
+
else answers[q.id] = v;
|
|
73
|
+
}
|
|
74
|
+
return answers;
|
|
75
|
+
}
|
|
76
|
+
export function applyBody(ws, structure, st) {
|
|
77
|
+
const include = rowsOf(structure).filter((r) => st.checked[r.proposal_id]).map((r) => r.proposal_id);
|
|
78
|
+
return { ws, include, revisions: revisions(structure, st), answers: answersOf(structure, st) };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const optVal = (o) => (o && typeof o === 'object' ? o.value : o);
|
|
82
|
+
const optTxt = (o) => (o && typeof o === 'object' ? (o.label || o.value) : o);
|
|
83
|
+
/** One line per scan question for the "Defaults PMOS chose" block: what it asks and the default it will send. */
|
|
84
|
+
export function defaultsView(structure, st) {
|
|
85
|
+
return (structure && Array.isArray(structure.questions) ? structure.questions : []).map((q) => {
|
|
86
|
+
const skipped = !!(st.skipped && st.skipped[q.id]);
|
|
87
|
+
const cur = st.answers && st.answers[q.id] != null ? st.answers[q.id] : q.default;
|
|
88
|
+
const opts = Array.isArray(q.options) ? q.options : [];
|
|
89
|
+
const hit = opts.find((o) => String(optVal(o)) === String(cur));
|
|
90
|
+
return { id: str(q.id), text: str(q.text), value: skipped ? 'Skipped. Nothing is sent.' : String(hit ? optTxt(hit) : cur == null ? '' : cur), skipped, options: opts.map((o) => ({ value: String(optVal(o)), text: String(optTxt(o)) })), free: str(q.free) };
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** The scan's findings, at most ten, as rows: title, why, and the first evidence's file and line. */
|
|
95
|
+
export function findingsOf(look) {
|
|
96
|
+
const f = look && Array.isArray(look.findings) ? look.findings : [];
|
|
97
|
+
return f.slice(0, 10).map((x) => ({ title: str(x.title), why: str(x.why), ref: fileRef(Array.isArray(x.evidence) ? x.evidence[0] : null) }));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** The first-Briefing card's rows from GET /api/onboarding/briefing, and the ticked tools' state Welcome recorded in this browser. */
|
|
101
|
+
export function firstView(briefing, toolState) {
|
|
102
|
+
const items = (briefing && briefing.ok && Array.isArray(briefing.items) ? briefing.items : []).map((b) => ({
|
|
103
|
+
title: str(b.title), why: str(b.why), ref: fileRef(Array.isArray(b.evidence) ? b.evidence[0] : null),
|
|
104
|
+
ini: b.initiative && typeof b.initiative === 'object' ? `${str(b.initiative.title)} · ${str(b.initiative.board)} board` : '',
|
|
105
|
+
}));
|
|
106
|
+
const state = toolState && typeof toolState === 'object' ? toolState : {};
|
|
107
|
+
const tools = TOOLS.filter((x) => state[x.source]).map((x) => ({ name: x.name, started: !!state[x.source].started, error: str(state[x.source].error) }));
|
|
108
|
+
return { items, tools, calm: items.length === 0 };
|
|
109
|
+
}
|
|
110
|
+
export const FIRST_KEY = 'pmos.welcome.tools';
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/* pm/premium-welcome.js — the premium Welcome page (initiative premium-welcome). Three steps, then the premium Briefing.
|
|
2
|
+
* About you → Your sources → What PMOS found → (Import) /premium.html?first=<import id>
|
|
3
|
+
* Routes (lib/routes-onboarding.js): GET /api/onboarding/status | structure, POST /api/onboarding/scan | apply | dismiss. About you saves with
|
|
4
|
+
* POST /api/proactive/settings, the route console Settings uses. Scan starts each ticked tool (POST /api/sources/refresh, or the brief sources and
|
|
5
|
+
* POST /api/proactive/goals/plan) and then scans the folder. Presses carry the launch nonce through pm/http.js; the page writes nothing itself.
|
|
6
|
+
* Text taken from the scanned folder is untrusted: every value goes through esc() and no quoted file text is shown. The pure half is premium-welcome-model.js. */
|
|
7
|
+
import { pmGet, pmPost } from './http.js';
|
|
8
|
+
import * as W from './premium-welcome-model.js';
|
|
9
|
+
|
|
10
|
+
const $ = (s, r = document) => r.querySelector(s);
|
|
11
|
+
const esc = (v) => String(v == null ? '' : v).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
12
|
+
const store = { get(k) { try { return localStorage.getItem(k); } catch { return null; } }, set(k, v) { try { localStorage.setItem(k, v); } catch { /* no storage */ } } };
|
|
13
|
+
const params = new URLSearchParams(location.search);
|
|
14
|
+
{ const t = params.get('theme') || store.get('pmos.c3.theme'); if (t === 'light' || t === 'dark') document.documentElement.dataset.theme = t; }
|
|
15
|
+
|
|
16
|
+
const S = {
|
|
17
|
+
ws: params.get('ws') || '', folder: null, added: [], step: 'about', busy: '', error: '', note: '',
|
|
18
|
+
about: { name: '', role: '', work: '', duties: '' }, pick: {}, sources: {},
|
|
19
|
+
look: null, structure: null, checked: {}, titles: {}, boardOf: {}, edit: {}, answers: {}, skipped: {}, defs: false,
|
|
20
|
+
};
|
|
21
|
+
const I = {
|
|
22
|
+
folder: '<svg class="i" viewBox="0 0 24 24"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></svg>',
|
|
23
|
+
plus: '<svg class="i" viewBox="0 0 24 24"><path d="M12 5v14M5 12h14"/></svg>',
|
|
24
|
+
lock: '<svg class="i" viewBox="0 0 24 24"><rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/></svg>',
|
|
25
|
+
calendar: '<svg class="i" viewBox="0 0 24 24"><rect x="3" y="5" width="18" height="16" rx="3"/><path d="M3 10h18M8 3v4M16 3v4"/></svg>',
|
|
26
|
+
'my-work': '<svg class="i" viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="16" rx="3"/><path d="M8 12l3 3 5-6"/></svg>',
|
|
27
|
+
inbox: '<svg class="i" viewBox="0 0 24 24"><rect x="3" y="5" width="18" height="14" rx="3"/><path d="m4 8 8 6 8-6"/></svg>',
|
|
28
|
+
slack: '<svg class="i" viewBox="0 0 24 24"><path d="M5 9h14M5 15h14M9 4 8 20M16 4l-1 16"/></svg>',
|
|
29
|
+
check: '<svg class="i" viewBox="0 0 24 24"><path d="m5 12.5 4.5 4.5L19 7.5"/></svg>',
|
|
30
|
+
off: '<svg class="i" viewBox="0 0 24 24"><path d="M6 12h12"/></svg>',
|
|
31
|
+
};
|
|
32
|
+
const dis = (on) => (on ? ' disabled' : '');
|
|
33
|
+
const spin = (txt) => `<span class="wl-spin" aria-hidden="true"></span>${esc(txt)}`;
|
|
34
|
+
|
|
35
|
+
/* ── actions ───────────────────────────────────────────────────────────────────────────────────── */
|
|
36
|
+
const fail = (r, what) => { S.error = (r && r.error) || `${what} did not work.`; };
|
|
37
|
+
async function run(label, fn) {
|
|
38
|
+
S.busy = label; S.error = ''; draw();
|
|
39
|
+
try { await fn(); } catch (e) { S.error = String((e && e.message) || e); }
|
|
40
|
+
S.busy = ''; draw();
|
|
41
|
+
}
|
|
42
|
+
const go = (step) => { S.step = step; S.error = ''; draw(true); };
|
|
43
|
+
const saveAbout = () => run('about', async () => {
|
|
44
|
+
const r = await pmPost('/api/proactive/settings', W.aboutBody(S.about));
|
|
45
|
+
if (!r || !r.ok) { fail(r, 'Saving what you told PMOS'); return; }
|
|
46
|
+
S.step = 'sources';
|
|
47
|
+
});
|
|
48
|
+
const addFolder = () => run('add', async () => {
|
|
49
|
+
const p = await pmPost('/api/pick-folder', {});
|
|
50
|
+
if (!p || !p.ok) { if (p && p.cancelled) return; S.note = (p && p.unsupported) ? 'This system has no folder chooser. Start pmos in the folder instead.' : ''; if (!S.note) fail(p, 'Choosing a folder'); return; }
|
|
51
|
+
const w = await pmPost('/api/workspaces', { root: p.root, name: p.root.split(/[\\/]/).filter(Boolean).pop(), focus: false });
|
|
52
|
+
if (!w || !w.workspace) { fail(w, 'Adding the folder'); return; }
|
|
53
|
+
if (!S.added.some((a) => a.id === w.workspace.id) && w.workspace.id !== S.ws) S.added.push({ id: w.workspace.id, name: w.workspace.name, root: w.workspace.root });
|
|
54
|
+
});
|
|
55
|
+
/* Each ticked tool is its own read-only agent session. A tool that cannot start says why on its row and does not stop the folder scan. */
|
|
56
|
+
async function startTools() {
|
|
57
|
+
const plan = W.toolPlan(S.pick);
|
|
58
|
+
if (plan.brief.length) {
|
|
59
|
+
const on = await pmPost('/api/proactive/settings', W.briefBody(plan.brief));
|
|
60
|
+
const r = on && on.ok ? await pmPost('/api/proactive/goals/plan', { ws: S.ws }) : on;
|
|
61
|
+
for (const x of plan.brief) S.sources[x.source] = r && r.ok ? { started: true } : { error: (r && r.error) || 'Starting the read did not work.' };
|
|
62
|
+
}
|
|
63
|
+
for (const x of plan.refresh) {
|
|
64
|
+
const r = await pmPost('/api/sources/refresh', { ws: S.ws, source: x.source });
|
|
65
|
+
S.sources[x.source] = r && r.ok ? { started: true } : { error: (r && r.error) || 'Starting the read did not work.' };
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const scan = () => run('scan', async () => {
|
|
69
|
+
await startTools();
|
|
70
|
+
const r = await pmPost('/api/onboarding/scan', { ws: S.ws, extra_roots: S.added.map((a) => a.root) });
|
|
71
|
+
if (!r || !r.ok) { fail(r, 'The scan'); return; }
|
|
72
|
+
const st = await pmGet(`/api/onboarding/structure?ws=${encodeURIComponent(S.ws)}`);
|
|
73
|
+
if (!st || !st.ok) { fail(st, 'Reading the portfolio'); return; }
|
|
74
|
+
S.look = r.first_look; S.structure = st; S.boardOf = {}; S.edit = {}; S.answers = {}; S.skipped = {}; S.defs = false;
|
|
75
|
+
Object.assign(S, W.startChoices(st));
|
|
76
|
+
S.step = 'found';
|
|
77
|
+
});
|
|
78
|
+
const importNow = () => {
|
|
79
|
+
if (!W.counts(S.structure, S).n) return;
|
|
80
|
+
run('apply', async () => {
|
|
81
|
+
const r = await pmPost('/api/onboarding/apply', W.applyBody(S.ws, S.structure, S));
|
|
82
|
+
if (!r || !r.ok) { fail(r, 'The import'); return; }
|
|
83
|
+
try { sessionStorage.setItem(W.FIRST_KEY, JSON.stringify(S.sources)); } catch { /* no storage */ }
|
|
84
|
+
location.assign('/premium.html?ws=' + encodeURIComponent(S.ws) + '&first=' + encodeURIComponent(r.import_id));
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
// "Not now": Welcome stops opening on its own for this folder (`pmos welcome` still opens it), then the premium Briefing opens
|
|
88
|
+
const notNow = () => run('dismiss', async () => {
|
|
89
|
+
const r = await pmPost('/api/onboarding/dismiss', { ws: S.ws });
|
|
90
|
+
if (!r || !r.ok) { fail(r, 'Not now'); return; }
|
|
91
|
+
location.assign('/premium.html?ws=' + encodeURIComponent(S.ws));
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
/* ── views ─────────────────────────────────────────────────────────────────────────────────────── */
|
|
95
|
+
const btn = (act, label, o = {}) => `<button class="wl-btn${o.alt ? ' alt' : ''}${o.quiet ? ' quiet' : ''}" type="button" data-w="${act}"${o.attrs || ''}${dis(o.off || (S.busy && !o.free))}${S.busy === o.busy ? ' aria-busy="true"' : ''}>${S.busy === o.busy && o.busyText ? spin(o.busyText) : (o.lead || '') + label}</button>`;
|
|
96
|
+
const foot = (left, right) => `<div class="wl-foot"><div>${left}</div><div class="r">${right}</div></div>`;
|
|
97
|
+
const err = () => (S.error ? `<p class="wl-err" role="alert">${esc(S.error)}</p>` : '');
|
|
98
|
+
|
|
99
|
+
function viewAbout() {
|
|
100
|
+
const a = S.about;
|
|
101
|
+
const f = (k, text, hint, max) => `<label>${text}<input data-f="${k}" maxlength="${max}" value="${esc(a[k])}" placeholder="${esc(hint)}" autocomplete="off"></label>`;
|
|
102
|
+
return `<h1 id="wlH" tabindex="-1">Welcome to PMOS</h1><p class="wl-lede">Tell PMOS who you are, so your Briefing knows what matters to you. Every field is optional, and you can change them later in the console's Settings.</p>
|
|
103
|
+
<div class="wl-f">${f('name', 'Your name', 'For example: Dana', 40)}${f('role', 'Your role', 'For example: Senior PM, Payments', 80)}${f('work', 'What you do', 'In one line, for example: I run checkout and the payment methods', 200)}
|
|
104
|
+
<label>Your job description<textarea data-f="duties" maxlength="1000" placeholder="What you own, decide and deliver. Paste it from your job description if you have one.">${esc(a.duties)}</textarea></label></div>${err()}`
|
|
105
|
+
+ foot('', btn('about', 'Continue', { busy: 'about', busyText: 'Saving' }));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function toolRow(x) {
|
|
109
|
+
const on = !!S.pick[x.source], st = S.sources[x.source] || {};
|
|
110
|
+
return `<li><button type="button" class="wl-row" data-w="tool" data-k="${esc(x.source)}" aria-pressed="${on}"${dis(S.busy)}><span class="wl-ic">${I[x.source] || ''}</span><span><b>${esc(x.name)}</b><small>${esc(x.adds)}</small>${st.error ? `<small class="wl-bad" role="alert">${esc(st.error)}</small>` : ''}</span><span class="wl-tog">${on ? 'Read it' : 'Off'}</span></button></li>`;
|
|
111
|
+
}
|
|
112
|
+
function viewSources() {
|
|
113
|
+
const f = S.folder || { name: '', root: '' };
|
|
114
|
+
const n = W.TOOLS.filter((x) => S.pick[x.source]).length;
|
|
115
|
+
const rows = [`<li class="wl-row"><span class="wl-ic">${I.folder}</span><span><b>${esc(f.name || 'This folder')}</b><span class="path">${esc(f.root)}</span></span><span class="chip">this folder</span></li>`]
|
|
116
|
+
.concat(S.added.map((a) => `<li class="wl-row"><span class="wl-ic">${I.folder}</span><span><b>${esc(a.name)}</b><span class="path">${esc(a.root)}</span></span><span></span></li>`)).join('');
|
|
117
|
+
if (S.busy === 'scan') {
|
|
118
|
+
return `<h1 id="wlH" tabindex="-1">Reading ${esc(f.name || 'your folder')}</h1><p class="wl-lede">A large folder can take a minute or two. The rest of PMOS keeps working.</p>
|
|
119
|
+
<div class="wl-scan" role="status"><div>${spin('Starting the tools you ticked, then reading the folder')}</div></div>`;
|
|
120
|
+
}
|
|
121
|
+
return `<h1 id="wlH" tabindex="-1">Where does your work live?</h1><p class="wl-lede">PMOS reads your folders and the tools you tick, then shows you your initiatives, your documents and what needs you first.</p>
|
|
122
|
+
<p class="wl-sec">Folders<span class="chip mono">${1 + S.added.length}</span></p><ul class="wl-list">${rows}</ul>
|
|
123
|
+
<div class="wl-add">${btn('folder', 'Add another folder', { alt: true, lead: I.plus, busy: 'add', busyText: 'Waiting for the chooser' })}</div>${S.note ? `<p class="note">${esc(S.note)}</p>` : ''}
|
|
124
|
+
<p class="wl-sec">Tools<span class="chip">optional</span></p><ul class="wl-list">${W.TOOLS.map(toolRow).join('')}</ul>
|
|
125
|
+
<p class="note wl-lock">${I.lock}<span>Reads only. PMOS writes nothing in your folders or your tools, and sends nothing out. Your agent reads the tools you tick with your own connection.</span></p>${err()}`
|
|
126
|
+
+ foot(btn('back', 'Back', { alt: true }), btn('scan', n ? `Scan the folder and read ${W.plural(n, 'tool', 'tools')}` : 'Scan this folder', { busy: 'scan' }));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function rowView(r) {
|
|
130
|
+
const id = r.proposal_id, ed = !!S.edit[id], on = !!S.checked[id], t = S.titles[id];
|
|
131
|
+
const docs = (r.docs || []).length;
|
|
132
|
+
const opts = S.structure.boards.map((b) => `<option value="${esc(b.key)}"${b.key === W.boardOfRow(r, S) ? ' selected' : ''}>${esc(b.name)}</option>`).join('');
|
|
133
|
+
const meta = [r.lane, r.anchor || 'no anchor', r.stage, W.plural(docs, 'document', 'documents')].filter(Boolean).map(esc).join(' · ');
|
|
134
|
+
return `<li class="wl-ed${on ? '' : ' off'}"><div class="wl-row"><span class="wl-ic wl-n">${on ? I.check : I.off}</span><span><b>${esc(t)}</b><small>${meta}</small></span>
|
|
135
|
+
<span class="acts"><button type="button" class="wgo" data-w="inc" data-id="${esc(id)}" aria-pressed="${on}" aria-label="${on ? 'Leave out' : 'Import'} ${esc(t)}"${dis(S.busy)}>${on ? 'Leave out' : 'Import'}</button><button type="button" class="wgo" data-w="edit" data-id="${esc(id)}" aria-expanded="${ed}"${dis(!on || S.busy)}>${ed ? 'Done' : 'Edit'}</button></span></div>
|
|
136
|
+
${ed ? `<div class="wl-edit"><label>Title<input data-f="title" data-id="${esc(id)}" value="${esc(t)}" maxlength="80"></label><label>Board<select data-f="board" data-id="${esc(id)}">${opts}</select></label></div>` : ''}</li>`;
|
|
137
|
+
}
|
|
138
|
+
function questionInputs() {
|
|
139
|
+
return W.defaultsView(S.structure, S).map((q) => {
|
|
140
|
+
const cur = S.answers[q.id] != null ? S.answers[q.id] : ((S.structure.questions.find((x) => x.id === q.id) || {}).default);
|
|
141
|
+
const input = q.options.length
|
|
142
|
+
? `<select data-f="answer" data-id="${esc(q.id)}" aria-label="${esc(q.text)}"${dis(q.skipped)}>${q.options.map((o) => `<option value="${esc(o.value)}"${String(cur) === o.value ? ' selected' : ''}>${esc(o.text)}</option>`).join('')}</select>`
|
|
143
|
+
: `<input data-f="answer" data-id="${esc(q.id)}" aria-label="${esc(q.text)}" value="${esc(cur == null ? '' : cur)}"${dis(q.skipped)}>`;
|
|
144
|
+
return `<div class="wl-q"><b>${esc(q.text)}</b>${input}<button type="button" class="wgo" data-w="skipq" data-id="${esc(q.id)}" aria-pressed="${q.skipped}">${q.skipped ? 'Skipped. Use the default' : 'Skip'}</button></div>`;
|
|
145
|
+
}).join('');
|
|
146
|
+
}
|
|
147
|
+
function viewFound() {
|
|
148
|
+
const L = S.look || {}, c = W.counts(S.structure, S), all = W.rowsOf(S.structure), found = W.findingsOf(L), defs = W.defaultsView(S.structure, S);
|
|
149
|
+
const boards = S.structure.boards.map((b) => {
|
|
150
|
+
const mine = all.filter((r) => W.boardOfRow(r, S) === b.key);
|
|
151
|
+
return `<div class="wl-bh"><b>${esc(b.name)}</b><span class="chip">${W.plural((b.unsorted || []).length, 'document', 'documents')} unsorted</span></div><ul class="wl-list">${mine.length ? mine.map(rowView).join('') : '<li class="note">No initiatives here.</li>'}</ul>`;
|
|
152
|
+
}).join('');
|
|
153
|
+
return `<h1 id="wlH" tabindex="-1">What PMOS found</h1>${L.sentence ? `<p class="wl-lede">${esc(L.sentence)}</p>` : ''}
|
|
154
|
+
${S.look ? `<p class="wl-sec">What matters most<span class="chip mono">${found.length}</span></p>` : ''}
|
|
155
|
+
${!S.look ? '' : found.length ? `<ol class="wl-list">${found.map((f, i) => `<li class="wl-row"><span class="wl-ic wl-n">${String(i + 1).padStart(2, '0')}</span><span><b>${esc(f.title)}</b>${f.why ? `<small>${esc(f.why)}</small>` : ''}<span class="path">${esc(f.ref)}</span></span><span></span></li>`).join('')}</ol>` : '<p class="note">Nothing in this folder needs you urgently.</p>'}
|
|
156
|
+
<p class="wl-sec">Your portfolio<span class="chip mono">${c.n} of ${all.length} to import</span></p>${boards}
|
|
157
|
+
<div class="wl-def"><span class="wl-sec wl-sec0">Defaults PMOS chose</span>${defs.length ? `<dl>${defs.map((d) => `<dt>${esc(d.text)}</dt><dd>${esc(d.value)}</dd>`).join('')}</dl>` : '<p class="note">The scan left no questions. Nothing needs a default.</p>'}
|
|
158
|
+
${S.defs && defs.length ? `<div class="wl-qs">${questionInputs()}</div>` : ''}
|
|
159
|
+
${defs.length ? `<div class="wl-add">${btn('defs', S.defs ? 'Done' : 'Change the defaults', { alt: true, attrs: ` aria-expanded="${S.defs}"` })}</div>` : ''}</div>${err()}`
|
|
160
|
+
+ foot(btn('back', 'Back', { alt: true }), btn('import', esc(W.importText(c)), { busy: 'apply', busyText: 'Importing', off: !c.n }));
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const VIEWS = { about: viewAbout, sources: viewSources, found: viewFound };
|
|
164
|
+
function draw(focusHead) {
|
|
165
|
+
const at = Math.max(0, W.STEPS.findIndex(([k]) => k === S.step));
|
|
166
|
+
$('#wlSteps').innerHTML = W.STEPS.map(([, t], i) => `<li data-s="${i < at ? 'done' : i === at ? 'now' : 'todo'}"${i === at ? ' aria-current="step"' : ''}><b><i></i></b><span>${esc(t)}</span></li>`).join('');
|
|
167
|
+
$('#wlCount').textContent = `Set up · step ${at + 1} of ${W.STEPS.length}`;
|
|
168
|
+
$('#wlSkip').disabled = !!S.busy;
|
|
169
|
+
const keep = document.activeElement && document.activeElement.dataset ? [document.activeElement.dataset.w, document.activeElement.dataset.id || document.activeElement.dataset.k || '', document.activeElement.dataset.f] : null;
|
|
170
|
+
const y = scrollY;
|
|
171
|
+
$('#wlCard').innerHTML = VIEWS[S.step]();
|
|
172
|
+
$('#wlCard').setAttribute('aria-busy', S.busy ? 'true' : 'false');
|
|
173
|
+
if (focusHead) { const h = $('#wlH'); if (h) h.focus({ preventScroll: true }); scrollTo(0, 0); }
|
|
174
|
+
else {
|
|
175
|
+
scrollTo(0, y);
|
|
176
|
+
if (keep && (keep[0] || keep[2])) {
|
|
177
|
+
const again = [...document.querySelectorAll('#wlCard [data-w],#wlCard [data-f]')].find((x) => (x.dataset.w || null) === (keep[0] || null) && (x.dataset.id || x.dataset.k || '') === keep[1] && (x.dataset.f || undefined) === keep[2]);
|
|
178
|
+
if (again && !again.disabled) again.focus();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* ── events: one delegate for presses, input and change on the card ──────────────────────────── */
|
|
184
|
+
document.addEventListener('click', (e) => {
|
|
185
|
+
const b = e.target.closest('[data-w]'); if (!b || b.disabled || !b.closest('#wlRoot')) return;
|
|
186
|
+
const a = b.dataset.w, id = b.dataset.id;
|
|
187
|
+
if (a === 'about') saveAbout();
|
|
188
|
+
else if (a === 'back') go(S.step === 'found' ? 'sources' : 'about');
|
|
189
|
+
else if (a === 'folder') addFolder();
|
|
190
|
+
else if (a === 'tool') { S.pick[b.dataset.k] = !S.pick[b.dataset.k]; draw(); }
|
|
191
|
+
else if (a === 'scan') scan();
|
|
192
|
+
else if (a === 'inc') { S.checked[id] = !S.checked[id]; if (!S.checked[id]) S.edit[id] = false; draw(); }
|
|
193
|
+
else if (a === 'edit') { S.edit[id] = !S.edit[id]; draw(); }
|
|
194
|
+
else if (a === 'defs') { S.defs = !S.defs; draw(); }
|
|
195
|
+
else if (a === 'skipq') { S.skipped[id] = !S.skipped[id]; draw(); }
|
|
196
|
+
else if (a === 'import') importNow();
|
|
197
|
+
else if (a === 'skip') notNow();
|
|
198
|
+
});
|
|
199
|
+
const card = $('#wlCard');
|
|
200
|
+
card.addEventListener('input', (e) => {
|
|
201
|
+
const t = e.target, f = t.dataset && t.dataset.f; if (!f) return;
|
|
202
|
+
if (W.FIELDS.includes(f)) S.about[f] = t.value;
|
|
203
|
+
else if (f === 'title') S.titles[t.dataset.id] = t.value;
|
|
204
|
+
else if (f === 'answer') {
|
|
205
|
+
const q = ((S.structure && S.structure.questions) || []).find((x) => x.id === t.dataset.id);
|
|
206
|
+
S.answers[t.dataset.id] = t.value.trim() ? t.value : (q ? q.default : t.value); // an emptied answer goes back to the default
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
card.addEventListener('change', (e) => {
|
|
210
|
+
const t = e.target, f = t.dataset && t.dataset.f; if (!f) return;
|
|
211
|
+
if (f === 'board') { S.boardOf[t.dataset.id] = t.value; draw(); }
|
|
212
|
+
else if (f === 'answer') draw();
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
/* ── start ────────────────────────────────────────────────────────────────────────────────────── */
|
|
216
|
+
async function start() {
|
|
217
|
+
draw();
|
|
218
|
+
const list = await pmGet('/api/workspaces');
|
|
219
|
+
const all = (list && list.workspaces) || [];
|
|
220
|
+
const mine = all.find((w) => w.id === S.ws) || (!S.ws ? all[0] : null);
|
|
221
|
+
if (!mine) { S.error = 'This folder is not open in PMOS. Start pmos in the folder, then reload.'; $('#wlCard').setAttribute('aria-busy', 'false'); draw(); return; }
|
|
222
|
+
S.ws = mine.id; S.folder = { name: mine.name, root: mine.root };
|
|
223
|
+
const st = await pmGet(`/api/onboarding/status?ws=${encodeURIComponent(S.ws)}`);
|
|
224
|
+
if (st && st.ok && st.state === 'imported') {
|
|
225
|
+
const live = (st.imports || []).filter((i) => !i.retracted).pop();
|
|
226
|
+
if (live) { location.replace('/premium.html?ws=' + encodeURIComponent(S.ws) + '&first=' + encodeURIComponent(live.import_id)); return; }
|
|
227
|
+
}
|
|
228
|
+
S.about = W.aboutOf(await pmGet('/api/proactive/settings'));
|
|
229
|
+
if (params.get('step') === 'found') { // back from "Undo this import": the scan is still on disk, but its first-look sentence is not, so the page does not show one
|
|
230
|
+
const sr = await pmGet(`/api/onboarding/structure?ws=${encodeURIComponent(S.ws)}`);
|
|
231
|
+
if (sr && sr.ok) { S.structure = sr; Object.assign(S, W.startChoices(sr)); S.step = 'found'; } else fail(sr, 'Reading the portfolio');
|
|
232
|
+
}
|
|
233
|
+
draw(true);
|
|
234
|
+
}
|
|
235
|
+
start();
|
|
@@ -325,6 +325,10 @@ a.round{color:inherit;text-decoration:none}
|
|
|
325
325
|
.dlg.full .dgrid .p-work,.dlg.full .dgrid .p-out{display:flex;overflow:auto;min-height:0}
|
|
326
326
|
.dlg.full #dTabs{display:none}}
|
|
327
327
|
@media (max-width:699px){#dExpand{display:none}}
|
|
328
|
+
#dPane{display:none}@media (min-width:1000px){#dPane{display:grid}.dlg.full #dPane{display:none}}
|
|
329
|
+
.dlg[data-mode="detail"] #dPane{display:grid}
|
|
330
|
+
.tabhint{display:none}
|
|
331
|
+
@media (max-width:999px){.dlg[data-mode="split"] .dgrid[data-tab="out"] .p-out .tabhint{display:none}.dlg:has(#dBody .acard:not(.answered)) .dgrid[data-tab="out"] .p-out .tabhint{display:flex;position:sticky;bottom:0;align-items:center;justify-content:space-between;gap:12px;padding:12px 4px 4px;margin-top:10px;background:linear-gradient(to top,var(--well) 70%,transparent);font-size:12.5px;color:var(--ink-2)}.tabhint button{height:44px;padding:0 18px;border-radius:999px;background:var(--solid);color:var(--on-solid);font-weight:650;font-size:12.5px}}
|
|
328
332
|
.dx2[aria-pressed="true"]{background:var(--solid);color:var(--on-solid)}
|
|
329
333
|
.fchip{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:999px;background:var(--well);font-size:12.5px}
|
|
330
334
|
.fchip svg{width:13px;height:13px}
|
|
@@ -627,7 +631,6 @@ a.round{color:inherit;text-decoration:none}
|
|
|
627
631
|
.wck.dec:hover{color:var(--ember-ink)}
|
|
628
632
|
.wrow .wtit .tgf{display:block;width:fit-content;margin:6px 0 2px}
|
|
629
633
|
.wck.dec{box-shadow:none}
|
|
630
|
-
@media (max-width:999px){.dtabs{display:none}}
|
|
631
634
|
|
|
632
635
|
.tgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:36px;margin-top:6px}
|
|
633
636
|
.tgrid .wrw:nth-child(2){border-top:0}
|
|
@@ -1645,6 +1648,91 @@ button.m3-stc{min-height:44px;margin:-7px 0}button.m3-stc:hover{background:var(-
|
|
|
1645
1648
|
.m3-shot{margin:8px 0;display:grid;gap:6px}.m3-shot img{max-width:100%;border-radius:14px;border:1px solid var(--hair)}.m3-shot figcaption{margin:0}
|
|
1646
1649
|
@media (max-width:1000px){.m3-cap{grid-template-columns:1fr}.m3-kps button,.m3-kp0{grid-template-columns:70px minmax(0,1fr)}.m3-kps time,.m3-kp0 em{display:none}.m3-ln{grid-template-columns:40px 48px minmax(0,1fr)}}
|
|
1647
1650
|
|
|
1651
|
+
/* ---- the premium Welcome page and the first-Briefing card (initiative premium-welcome): the approved mockup's rules (prototype/premium-welcome) ---- */
|
|
1652
|
+
.wl-in{position:relative;max-width:700px;margin:0 auto;padding:max(20px,env(safe-area-inset-top,0px)) 16px calc(40px + env(safe-area-inset-bottom,0px))}
|
|
1653
|
+
.wl-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
|
|
1654
|
+
.wl-brand{height:44px;display:inline-flex;align-items:center;gap:12px;padding:0 20px;border-radius:var(--r-chip);font-weight:650}
|
|
1655
|
+
.wl-brand small{font:500 var(--t-small) var(--mono);color:var(--ink-2)}
|
|
1656
|
+
.wl-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:44px;padding:0 22px;border-radius:var(--r-chip);background:var(--solid);color:var(--on-solid);font-weight:650;font-size:var(--t-body);white-space:nowrap;transition:transform .3s var(--spring),filter .2s}
|
|
1657
|
+
.wl-btn:hover{filter:brightness(1.18)}.wl-btn:active{transform:scale(.97)}.wl-btn:disabled{opacity:.4;pointer-events:none}
|
|
1658
|
+
.wl-btn.alt{background:var(--card-solid);color:var(--ink);box-shadow:inset 0 0 0 1px var(--hair)}.wl-btn.alt:hover{filter:none;background:var(--well)}
|
|
1659
|
+
.wl-btn.quiet{background:none;color:var(--ink-2);padding:0 14px}.wl-btn.quiet:hover{filter:none;background:var(--well)}
|
|
1660
|
+
.wl-btn svg{width:16px;height:16px}
|
|
1661
|
+
.wl-steps{display:flex;gap:8px;list-style:none;margin:22px 0 0;padding:0}
|
|
1662
|
+
.wl-steps li{flex:1;min-width:0}
|
|
1663
|
+
.wl-steps b{display:block;height:4px;border-radius:8px;background:color-mix(in oklab,var(--ink) 12%,transparent);margin-bottom:8px;overflow:hidden}
|
|
1664
|
+
.wl-steps b i{display:block;height:100%;width:0;background:var(--ink);border-radius:8px;transition:width .6s var(--spring)}
|
|
1665
|
+
.wl-steps li[data-s="done"] b i{width:100%;background:var(--ok)}.wl-steps li[data-s="now"] b i{width:100%}
|
|
1666
|
+
.wl-steps span{display:block;font:600 var(--t-micro) var(--mono);letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
1667
|
+
.wl-steps li[data-s="now"] span{color:var(--ink)}
|
|
1668
|
+
.wl-card{margin-top:18px;padding:32px}
|
|
1669
|
+
.wl-card h1{font-size:clamp(26px,4vw,34px);line-height:1.1;letter-spacing:-.03em;font-weight:700;text-wrap:balance}
|
|
1670
|
+
.wl-lede{margin-top:10px;color:var(--ink-2);max-width:56ch;text-wrap:pretty}
|
|
1671
|
+
.wl-sec{display:flex;align-items:center;gap:10px;margin:30px 0 10px;font:600 var(--t-micro) var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3)}
|
|
1672
|
+
.wl-sec .chip{margin-left:auto}
|
|
1673
|
+
.wl-f{display:grid;gap:16px;margin-top:24px}
|
|
1674
|
+
.wl-f label{display:grid;gap:6px;font-size:var(--t-small);font-weight:600;color:var(--ink-2)}
|
|
1675
|
+
.wl-f label em{font-style:normal;font-weight:500;color:var(--ink-3);margin-left:4px}
|
|
1676
|
+
.wl-f input,.wl-f select,.wl-f textarea,.wl-edit input,.wl-edit select{border-radius:14px;border:1px solid var(--hair);background:var(--card-solid);padding:0 14px;font:inherit;font-size:var(--t-body);color:var(--ink);min-width:0;width:100%;height:46px}
|
|
1677
|
+
.wl-f textarea{height:auto;min-height:118px;padding:12px 14px;resize:vertical;line-height:1.5}
|
|
1678
|
+
.wl-f input:focus-visible,.wl-f select:focus-visible,.wl-f textarea:focus-visible,.wl-edit input:focus-visible,.wl-edit select:focus-visible{outline:2px solid var(--ember);outline-offset:1px}
|
|
1679
|
+
.wl-list{display:grid;gap:8px;list-style:none;margin:0;padding:0}
|
|
1680
|
+
.wl-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:14px;align-items:center;padding:14px 16px;border-radius:var(--r-in);background:var(--well);width:100%;text-align:left}
|
|
1681
|
+
.wl-row > .wl-ic{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:var(--card-solid);color:var(--ink-2)}
|
|
1682
|
+
.wl-row b{display:block;font-weight:650;overflow-wrap:anywhere}
|
|
1683
|
+
.wl-row small{display:block;margin-top:2px;font-size:var(--t-small);color:var(--ink-3);line-height:1.45}
|
|
1684
|
+
.wl-row .path{font:500 var(--t-small) var(--mono);color:var(--ink-3);overflow-wrap:anywhere}
|
|
1685
|
+
.wl-row.off{opacity:.62}
|
|
1686
|
+
.wl-tog{font-size:var(--t-small);font-weight:650;height:30px;padding:0 14px;border-radius:var(--r-chip);display:inline-flex;align-items:center;background:var(--card-solid);color:var(--ink-2);box-shadow:inset 0 0 0 1px var(--hair);white-space:nowrap}
|
|
1687
|
+
button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--on-solid);box-shadow:none}
|
|
1688
|
+
.wl-n{font:600 var(--t-small) var(--mono);color:var(--ink-2)}
|
|
1689
|
+
.wl-edit{display:grid;gap:10px;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);margin:10px 0 0}
|
|
1690
|
+
.wl-edit label{display:grid;gap:4px;font-size:var(--t-small);font-weight:600;color:var(--ink-2)}
|
|
1691
|
+
.wl-edit input,.wl-edit select{height:40px}
|
|
1692
|
+
.wl-ed{background:var(--well);border-radius:var(--r-in);padding:14px 16px}
|
|
1693
|
+
.wl-ed .wl-row{padding:0;background:none;border-radius:0}
|
|
1694
|
+
.wl-ed .acts{display:flex;gap:6px;align-items:center}
|
|
1695
|
+
.wl-ed.off b{text-decoration:line-through;text-decoration-color:var(--ink-3)}
|
|
1696
|
+
.wl-ed .wgo,.wl-q .wgo{flex:none;white-space:nowrap;height:32px;padding:0 12px;border-radius:var(--r-chip);font-size:var(--t-small);font-weight:650;color:var(--ink-2);background:var(--card-solid);box-shadow:inset 0 0 0 1px var(--hair)}
|
|
1697
|
+
.wl-def{margin-top:24px;border-radius:var(--r-in);border:1px dashed var(--b2);padding:16px 18px}
|
|
1698
|
+
.wl-def dl{display:grid;grid-template-columns:auto minmax(0,1fr);gap:6px 18px;margin:10px 0 0;font-size:var(--t-small)}
|
|
1699
|
+
.wl-def dt{color:var(--ink-3);font-weight:600}.wl-def dd{margin:0;color:var(--ink)}
|
|
1700
|
+
.wl-foot{display:flex;gap:10px;align-items:center;justify-content:space-between;margin-top:32px;flex-wrap:wrap}
|
|
1701
|
+
.wl-foot .r{margin-left:auto;display:flex;gap:10px;flex-wrap:wrap}
|
|
1702
|
+
.wl-lock{display:flex;gap:10px;align-items:flex-start;margin-top:22px}.wl-lock svg{width:16px;height:16px;margin-top:2px}
|
|
1703
|
+
.wl-scan{display:grid;gap:12px;margin-top:26px}.wl-scan div{display:flex;gap:12px;align-items:center;color:var(--ink-2)}
|
|
1704
|
+
.wl-scan svg{width:18px;height:18px;color:var(--ok)}
|
|
1705
|
+
.wl-spin{width:18px;height:18px;border-radius:50%;border:2px solid var(--b3);border-top-color:var(--ink);animation:wlspin .8s linear infinite;flex:none}
|
|
1706
|
+
@keyframes wlspin{to{transform:rotate(360deg)}}
|
|
1707
|
+
.wl-about{margin-top:18px}.wl-about summary{cursor:pointer;font-size:var(--t-small);font-weight:600;color:var(--ink-2);padding:8px 0}
|
|
1708
|
+
.wl-about ul{margin:8px 0 0;padding-left:18px;font-size:var(--t-small);color:var(--ink-2);line-height:1.55;display:grid;gap:6px}
|
|
1709
|
+
.wl-about code{font:500 var(--t-small) var(--mono)}
|
|
1710
|
+
@media (max-width:640px){
|
|
1711
|
+
.wl-card{padding:22px 18px;border-radius:24px}
|
|
1712
|
+
.wl-brand small{display:none}
|
|
1713
|
+
.wl-edit{grid-template-columns:minmax(0,1fr)}
|
|
1714
|
+
.wl-row{grid-template-columns:auto minmax(0,1fr);}
|
|
1715
|
+
.wl-row>:nth-child(3){grid-column:2;justify-self:start}.wl-row>:nth-child(3):empty{display:none}
|
|
1716
|
+
.wl-foot{position:sticky;bottom:0;margin:28px -18px -22px;padding:14px 18px calc(14px + env(safe-area-inset-bottom,0px));background:var(--card);border-top:1px solid var(--hair);border-radius:0 0 24px 24px;z-index:2}
|
|
1717
|
+
.wl-foot .r{flex:1;justify-content:flex-end}.wl-foot .wl-btn{flex:1}.wl-foot .wl-btn.quiet{flex:0 0 auto}
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
.wl-first{margin-top:24px}
|
|
1721
|
+
.wl-first-note{margin:12px 0 14px}
|
|
1722
|
+
.wl-actions{display:flex;gap:10px;margin-top:18px;flex-wrap:wrap}
|
|
1723
|
+
.wl-err,.wl-bad,.wl-first-err{color:var(--bad);font-size:var(--t-small);line-height:1.45;margin:12px 0 0}
|
|
1724
|
+
.wl-lede:empty{display:none}
|
|
1725
|
+
.wl-add{margin-top:10px}
|
|
1726
|
+
.wl-bh{display:flex;align-items:center;gap:10px;margin:14px 0 8px}
|
|
1727
|
+
.wl-sec0{margin:0}
|
|
1728
|
+
.wl-qs{display:grid;gap:14px;margin-top:14px}
|
|
1729
|
+
.wl-q{display:grid;gap:8px}.wl-q select,.wl-q input{border-radius:14px;border:1px solid var(--hair);background:var(--card-solid);padding:0 14px;font:inherit;font-size:var(--t-body);color:var(--ink);min-width:0;width:100%;height:46px}
|
|
1730
|
+
.wl-q select:focus-visible,.wl-q input:focus-visible{outline:2px solid var(--ember);outline-offset:1px}
|
|
1731
|
+
.wl-q .wgo{justify-self:start}
|
|
1732
|
+
.wl-ed .wgo,.wl-tog,.wl-q .wgo{min-height:32px}
|
|
1733
|
+
@media (pointer:coarse){.wl-ed .wgo,.wl-q .wgo{min-height:44px;padding:0 16px}.wl-btn.quiet{min-height:44px}}
|
|
1734
|
+
.wl-row .wl-ic.wl-n{font:600 var(--t-small) var(--mono)}
|
|
1735
|
+
.wl-in h1:focus{outline:none}
|
|
1648
1736
|
/* ── Around you (initiative premium-briefing-depth): the card on the Briefing and the dialogs its rows open. Own block, prefix bd-. ───────────────────── */
|
|
1649
1737
|
#aroundCard .bd-rows{margin-top:6px}
|
|
1650
1738
|
#aroundCard .due.od{color:var(--ember-ink);background:color-mix(in oklab,var(--ember) 16%,transparent)}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Slice 3: the reply box asks a read-only agent. A control with nothing honest to write stays disabled and says why. */
|
|
5
5
|
import { pmPost, pmGet } from './http.js';
|
|
6
6
|
import { mountMeeting } from './premium-meeting.js';
|
|
7
|
+
import { mountFirst } from './premium-first.js';
|
|
7
8
|
import { lineItems, behindOf, refreshTargets, whenRead } from './freshness-words.js';
|
|
8
9
|
import { momentOf, inText } from './c3-phone-model.js';
|
|
9
10
|
import { $, $$, esc, store, THEME_KEY, RM, AI, S, theme, toast, kv, H, openDlg, closeDlg, setTab, setMode, CHECK, CHEV, ptx, turnA, turnU, H1, H2, P1, UL, logHtml, loadThread, onScroll, wireRail, pvFeed } from './premium-shell.js';
|
|
@@ -809,3 +810,4 @@ async function load() {
|
|
|
809
810
|
}
|
|
810
811
|
$('#brief').textContent = 'Reading the repository.';
|
|
811
812
|
load();
|
|
813
|
+
mountFirst(); // the "Your first Briefing" card, only when the page was opened with first=<import id> (initiative premium-welcome)
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<div class="dtools"><button class="round dx2" id="dPane" aria-label="Hide the conversation" aria-pressed="true" title="Hide the conversation"><svg class="i" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="3"/><path d="M9 4v16"/></svg></button><button class="round dx2" id="dExpand" aria-label="Full screen" aria-pressed="false" title="Full screen"><svg class="i" viewBox="0 0 24 24"><path id="dExpP" d="M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7"/></svg></button><button class="round dx2" id="dClose" aria-label="Close"><svg class="i" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button></div></div>
|
|
28
28
|
<div class="dtabs" id="dTabs"><div class="seg" role="group" aria-label="Sections"><i class="pill"></i><button data-t="out" aria-pressed="true">Detail</button><button data-t="chat" aria-pressed="false">Conversation</button></div></div>
|
|
29
29
|
<div class="dgrid" id="dGrid" data-tab="out"><section class="pane p-work" id="dBody" aria-label="Conversation"></section>
|
|
30
|
-
<section class="pane p-out" id="dOut" aria-label="Detail"><div class="otop"><span class="ol" id="oLab">Detail</span></div><div class="obody" id="oMain"></div></section></div>
|
|
30
|
+
<section class="pane p-out" id="dOut" aria-label="Detail"><div class="otop"><span class="ol" id="oLab">Detail</span></div><div class="obody" id="oMain"></div><div class="tabhint"><span>The action is on the Conversation tab.</span><button type="button" id="tabGo">Open it</button></div></section></div>
|
|
31
31
|
</div>
|
|
32
32
|
<div class="toast glass" id="toast" role="status"></div>
|
|
33
33
|
<main class="stage" id="stage">
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<div class="dtools"><button class="round dx2" id="dPane" aria-label="Hide the conversation" aria-pressed="true" title="Hide the conversation"><svg class="i" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="3"/><path d="M9 4v16"/></svg></button><button class="round dx2" id="dExpand" aria-label="Full screen" aria-pressed="false" title="Full screen"><svg class="i" viewBox="0 0 24 24"><path id="dExpP" d="M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7"/></svg></button><button class="round dx2" id="dClose" aria-label="Close"><svg class="i" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button></div></div>
|
|
28
28
|
<div class="dtabs" id="dTabs"><div class="seg" role="group" aria-label="Sections"><i class="pill"></i><button data-t="out" aria-pressed="true">Detail</button><button data-t="chat" aria-pressed="false">Conversation</button></div></div>
|
|
29
29
|
<div class="dgrid" id="dGrid" data-tab="out"><section class="pane p-work" id="dBody" aria-label="Conversation"></section>
|
|
30
|
-
<section class="pane p-out" id="dOut" aria-label="Detail"><div class="otop"><span class="ol" id="oLab">Detail</span></div><div class="obody" id="oMain"></div></section></div>
|
|
30
|
+
<section class="pane p-out" id="dOut" aria-label="Detail"><div class="otop"><span class="ol" id="oLab">Detail</span></div><div class="obody" id="oMain"></div><div class="tabhint"><span>The action is on the Conversation tab.</span><button type="button" id="tabGo">Open it</button></div></section></div>
|
|
31
31
|
</div>
|
|
32
32
|
<div class="toast glass" id="toast" role="status"></div>
|
|
33
33
|
<main class="stage" id="stage">
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<div class="dtools"><button class="round dx2" id="dPane" aria-label="Hide the conversation" aria-pressed="true" title="Hide the conversation"><svg class="i" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="3"/><path d="M9 4v16"/></svg></button><button class="round dx2" id="dExpand" aria-label="Full screen" aria-pressed="false" title="Full screen"><svg class="i" viewBox="0 0 24 24"><path id="dExpP" d="M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7"/></svg></button><button class="round dx2" id="dClose" aria-label="Close"><svg class="i" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button></div></div>
|
|
29
29
|
<div class="dtabs" id="dTabs"><div class="seg" role="group" aria-label="Sections"><i class="pill"></i><button data-t="out" aria-pressed="true">Detail</button><button data-t="chat" aria-pressed="false">Conversation</button></div></div>
|
|
30
30
|
<div class="dgrid" id="dGrid" data-tab="out"><section class="pane p-work" id="dBody" aria-label="Conversation"></section>
|
|
31
|
-
<section class="pane p-out" id="dOut" aria-label="Detail"><div class="otop"><span class="ol" id="oLab">Detail</span></div><div class="obody" id="oMain"></div></section></div>
|
|
31
|
+
<section class="pane p-out" id="dOut" aria-label="Detail"><div class="otop"><span class="ol" id="oLab">Detail</span></div><div class="obody" id="oMain"></div><div class="tabhint"><span>The action is on the Conversation tab.</span><button type="button" id="tabGo">Open it</button></div></section></div>
|
|
32
32
|
</div>
|
|
33
33
|
<div class="toast glass" id="toast" role="status"></div>
|
|
34
34
|
<main class="stage" id="stage">
|