create-pmos 0.363.0 → 0.365.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 +35 -25
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-board-test.js +4 -4
- package/workspace/briefing-premium-initiative-test.js +4 -3
- package/workspace/briefing-premium-test.js +57 -54
- package/workspace/briefing-premium-work-test.js +9 -5
- package/workspace/c3-settings-test.js +2 -2
- package/workspace/changelog.json +34 -0
- package/workspace/guide/briefing-premium.md +8 -8
- package/workspace/guide/data-freshness.md +16 -1
- package/workspace/lib/briefing-premium-agent.js +3 -1
- package/workspace/lib/freshness.js +17 -1
- package/workspace/lib/pmos-verbs.js +3 -0
- package/workspace/lib/refresh-run.js +3 -1
- package/workspace/lib/refresh.js +10 -3
- package/workspace/lib/source-cli.js +85 -0
- package/workspace/lib/source-reads.js +200 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-studio-test.js +4 -4
- package/workspace/premium-vw-item-test.js +3 -3
- package/workspace/premium-work-depth-test.js +14 -8
- package/workspace/public/pm/premium-board.js +4 -3
- package/workspace/public/pm/premium-chat.js +9 -0
- package/workspace/public/pm/premium-initiative.js +4 -3
- package/workspace/public/pm/premium-insights.js +2 -2
- package/workspace/public/pm/premium-shell.js +30 -17
- package/workspace/public/pm/premium-work.js +56 -25
- package/workspace/public/pm/premium.css +24 -0
- package/workspace/public/pm/premium.js +2 -2
- package/workspace/public/premium-board.html +1 -1
- package/workspace/public/premium-chat.html +39 -0
- package/workspace/public/premium-initiative.html +1 -1
- package/workspace/public/premium-insights.html +1 -1
- package/workspace/public/premium-work.html +1 -1
- package/workspace/public/premium.html +1 -1
- package/workspace/server.js +4 -2
- package/workspace/skills/morning-brief.skill +7 -14
- package/workspace/skills/sources-read.skill +54 -0
- package/workspace/test-lists/briefing-source-flow.json +5 -0
|
@@ -18,7 +18,9 @@ const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for
|
|
|
18
18
|
const results = [];
|
|
19
19
|
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
20
20
|
/* the dialog's fields (premium-simple-ui): a field opens its panel; When holds Today, Not yet, Not before and Someday */
|
|
21
|
-
|
|
21
|
+
/* the fields sit in a sheet behind Edit ▾ in the dialog's switch row, closed by default (PM, 2026-10-20) */
|
|
22
|
+
const sheet = async (pg) => { if (await pg.locator('#iTog[aria-expanded="false"]').count()) await pg.click('#iTog'); };
|
|
23
|
+
const field = async (pg, k) => { await sheet(pg); if (await pg.locator(`#card .ffd[data-k="${k}"][aria-expanded="false"]`).count()) await pg.click(`#card .ffd[data-k="${k}"]`); };
|
|
22
24
|
const more = (pg) => field(pg, 'when');
|
|
23
25
|
let srv = null; let browser = null;
|
|
24
26
|
const finish = async (code) => {
|
|
@@ -69,6 +71,8 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
|
|
|
69
71
|
const dlgOff = (p) => until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
70
72
|
/* the Work queue shows one tab at a time: bring up the tab that holds a row before pressing it (each press redraws the tab row, so the button is found again) */
|
|
71
73
|
const showKey = (p, key) => p.evaluate((key) => { const has = () => document.querySelector(`#qBody .wrow[data-key="${key}"], #waitBody .wrow[data-key="${key}"]`); if (has()) return true; for (const k of [...document.querySelectorAll('#qTabs .qtb')].map((b) => b.dataset.tab)) { document.querySelector(`#qTabs [data-tab="${k}"]`).click(); if (has()) return true; } return false; }, key);
|
|
74
|
+
/* Escape closes the fields sheet first, then the dialog */
|
|
75
|
+
const escAll = async (p) => { await p.keyboard.press('Escape'); if (await p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))) { await sleep(100); await p.keyboard.press('Escape'); } await dlgOff(p); };
|
|
72
76
|
const qTab = (p, k) => p.click(`#qTabs [data-tab="${k}"]`);
|
|
73
77
|
const openKey = async (p, key) => { await showKey(p, key); await p.locator(`.wrow[data-key="${key}"] .wrh`).first().click(); await dlgOn(p); await sleep(700); };
|
|
74
78
|
const undoOf = async (p, direct) => { await until(() => p.evaluate(() => /Undo/.test(document.querySelector('#toast').textContent))); if (direct) { /* the Undo window is 8 s; on a loaded runner the real-server steps before this can outlast it, so press the button itself rather than race the toast's fade */ await p.evaluate(() => document.querySelector('#toast .undo').click()); } else await p.locator('#toast .undo').click(); await sleep(250); };
|
|
@@ -100,7 +104,7 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
|
|
|
100
104
|
ok('W9 Undo of Add the job posts pm-jobs/delete for that job', A.last().path === '/api/pm-jobs/delete' && A.last().body.id === 'job-new', JSON.stringify(A.last()));
|
|
101
105
|
await p.click('[data-fx="no"]');
|
|
102
106
|
ok('W6 Not today posts focus/dismiss with the key', await wait(() => A.last().path === '/api/pm-items/focus/dismiss' && A.last().body.key === 'job:job-1' && Object.keys(A.last().body).join() === 'key'), JSON.stringify(A.last()));
|
|
103
|
-
await
|
|
107
|
+
await escAll(p);
|
|
104
108
|
{ const m = mk((v) => { v.focus = { suggestions: [], accepted: [{ key: 'job:job-1', title: 'to walk in with a decision ready', why: '1 due today', item_ids: ['item-bbbbbbbbbbb2'], job: 'job-1' }], dismissed: [] }; });
|
|
105
109
|
const R = await open({ model: m }); const t = await R.page.evaluate(() => ({ bar: document.querySelector('#xFocus').textContent, tag: [...document.querySelectorAll('.xfc')].map((x) => x.closest('.wrow').dataset.key) }));
|
|
106
110
|
ok('W6 an accepted group is named on the bar and tags its Today row with Focus', /Your focus today/.test(t.bar) && t.tag.join() === 'work:item-bbbbbbbbbbb2', JSON.stringify(t));
|
|
@@ -144,7 +148,9 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
|
|
|
144
148
|
ok('W3 the dialog stays open and the typed step is cleared', await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#xsIn') && document.querySelector('#xsIn').value === '')));
|
|
145
149
|
const n1 = pc(); await p.click('[data-p="xsadd"]'); await sleep(250);
|
|
146
150
|
ok('W3 Add with no text posts nothing', pc() === n1);
|
|
147
|
-
await p.keyboard.press('Escape');
|
|
151
|
+
await p.keyboard.press('Escape');
|
|
152
|
+
ok('W3 Escape closes the fields sheet first and leaves the dialog open', await until(() => p.evaluate(() => document.querySelector('#iSheet').hidden && document.querySelector('#iTog').getAttribute('aria-expanded') === 'false' && document.querySelector('#dlg').classList.contains('on'))));
|
|
153
|
+
await escAll(p);
|
|
148
154
|
|
|
149
155
|
/* W4 Not before */
|
|
150
156
|
await openKey(p, 'work:item-ccccccccccc1');
|
|
@@ -184,17 +190,17 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
|
|
|
184
190
|
await p.click('[data-p="ag-brief"]');
|
|
185
191
|
ok('W7 Let the agent draft this posts act brief with the item, the PM\'s words and the workspace', await wait(() => A.last().path === '/api/my-work/act' && A.last().body.action === 'brief' && A.last().body.item === 'item-aaaaaaaaaaa1' && A.last().body.instruction === 'Draft your reply: partial refunds, short' && 'ws' in A.last().body && Object.keys(A.last().body).sort().join() === 'action,instruction,item,ws'), JSON.stringify(A.last()));
|
|
186
192
|
ok('W7 the dialog stays open', await p.evaluate(() => document.querySelector('#dlg').classList.contains('on')));
|
|
187
|
-
await
|
|
193
|
+
await escAll(p);
|
|
188
194
|
await openKey(p, 'work:item-bbbbbbbbbbb3');
|
|
189
195
|
ok('W7 a working agent shows its state and only Stop', await p.evaluate(() => document.querySelector('.agblk').dataset.state === 'working' && [...document.querySelectorAll('.agblk button')].map((b) => b.textContent.trim()).join() === 'Stop'));
|
|
190
196
|
await p.click('[data-p="ag-stop"]');
|
|
191
197
|
ok('W7 Stop posts the item to stop', await wait(() => A.last().path === '/api/my-work/stop' && A.last().body.item === 'item-bbbbbbbbbbb3' && Object.keys(A.last().body).join() === 'item'), JSON.stringify(A.last()));
|
|
192
|
-
await
|
|
198
|
+
await escAll(p);
|
|
193
199
|
await openKey(p, 'work:item-ccccccccccc2');
|
|
194
200
|
ok('W7 a failed run says why, that nothing was sent, and offers Try again and Stop', await p.evaluate(() => { const b = document.querySelector('.agblk'); return b.dataset.state === 'failed' && /the run ended/.test(b.textContent) && /Nothing was sent/.test(b.textContent) && [...b.querySelectorAll('button')].map((x) => x.textContent.trim()).join() === 'Try again,Stop'; }));
|
|
195
201
|
await p.click('[data-p="ag-retry"]');
|
|
196
202
|
ok('W7 Try again posts decide retry', await wait(() => A.last().path === '/api/my-work/decide' && A.last().body.action === 'retry' && A.last().body.item === 'item-ccccccccccc2' && Object.keys(A.last().body).sort().join() === 'action,item'), JSON.stringify(A.last()));
|
|
197
|
-
await
|
|
203
|
+
await escAll(p);
|
|
198
204
|
|
|
199
205
|
/* W7 a ready draft: nothing is posted before the confirm */
|
|
200
206
|
const RD = await open({ model: mk((v) => { v.work.today[0].origin = 'jira'; v.work.today[0].place = null; }) }), q = RD.page;
|
|
@@ -262,7 +268,7 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
|
|
|
262
268
|
ok('W8 a Today row whose draft is ready offers Review on the right, not Done', /Right arrow: Review/.test(await p.evaluate(() => document.activeElement.getAttribute('aria-description'))));
|
|
263
269
|
await p.keyboard.press('ArrowRight'); await dlgOn(p);
|
|
264
270
|
ok('W8 …and Review opens the dialog without posting', pc() === n2 + 0 || A.last().path !== '/api/pm-items/done');
|
|
265
|
-
await
|
|
271
|
+
await escAll(p);
|
|
266
272
|
{ const r = await open(); const t = r.page;
|
|
267
273
|
await showKey(t, 'work:item-aaaaaaaaaaa4'); await t.locator('#qBody .wrow[data-key="work:item-aaaaaaaaaaa4"] .wrh').focus(); await t.keyboard.press('ArrowRight');
|
|
268
274
|
ok('W8 the keys work on a row you added too (flag)', await until(() => r.last() && r.last().path === '/api/pm-items/flag' && r.last().body.id === 'item-aaaaaaaaaaa4'), JSON.stringify(r.last()));
|
|
@@ -314,7 +320,7 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
|
|
|
314
320
|
g[k] = await q2.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1 || document.querySelector('#dlg').scrollWidth > document.querySelector('#dlg').clientWidth + 1, small: [...document.querySelectorAll('#card button, #card input, #card select')].filter((b) => !b.closest('[hidden]') && b.getBoundingClientRect().height > 0 && b.getBoundingClientRect().height < 43.5).map((b) => (b.dataset.p || b.id) + ':' + Math.round(b.getBoundingClientRect().height)) }));
|
|
315
321
|
}
|
|
316
322
|
ok(`W12 at 390 px (${theme}) the edit, steps and Not before panels have no sideways scroll and every control is 44 px`, ['edit', 'steps', 'defer'].every((k) => !g[k].over && g[k].small.length === 0), JSON.stringify(g));
|
|
317
|
-
await
|
|
323
|
+
await escAll(q2);
|
|
318
324
|
await showKey(R.page, 'work:wbs:alpha:4.2'); await R.page.locator('#qBody .wrow[data-key="work:wbs:alpha:4.2"] .wrh').click(); await dlgOn(q2); await sleep(500); await q2.click('#dTabs [data-t="chat"]'); await sleep(900);
|
|
319
325
|
const ag = await q2.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1 || document.querySelector('#dlg').scrollWidth > document.querySelector('#dlg').clientWidth + 1, small: [...document.querySelectorAll('.agblk button')].filter((b) => b.getBoundingClientRect().height < 43.5).map((b) => b.textContent.trim()) }));
|
|
320
326
|
ok(`W12 at 390 px (${theme}) the agent block has no sideways scroll and its buttons are 44 px`, !ag.over && ag.small.length === 0, JSON.stringify(ag));
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { openWorkItem, recordPress } from './premium-vw-item.js';
|
|
7
7
|
import { pmPost } from './http.js';
|
|
8
8
|
import { openBacklog } from './premium-vw-backlog.js';
|
|
9
|
-
import { $, $$, esc, openDlg, closeDlg, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, CHECK, AI, store, crumbHtml, wireCrumb, kv, H, openAddDoc, setPageGaps } from './premium-shell.js';
|
|
9
|
+
import { $, $$, esc, openDlg, closeDlg, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, CHECK, AI, store, crumbHtml, wireCrumb, chatAbout, kv, H, openAddDoc, setPageGaps } from './premium-shell.js';
|
|
10
10
|
import { issueBody } from './premium-doc-edit.js';
|
|
11
11
|
import { mountDocSheet } from './premium-doc-sheet.js';
|
|
12
12
|
import * as MT from './premium-metric-tiles.js';
|
|
@@ -33,8 +33,9 @@ function drawHead() {
|
|
|
33
33
|
if (!crumbed) {
|
|
34
34
|
crumbed = true;
|
|
35
35
|
const boards = M.board.switcher || [];
|
|
36
|
-
$('#crumbHost').innerHTML = crumbHtml({ page: 'Board', board: M.board.name || 'Board', boards
|
|
37
|
-
wireCrumb({ boards, board: M.board.id, goBoard: (ws, id) => location.assign('/premium-board.html?ws=' + encodeURIComponent(ws) + '&board=' + encodeURIComponent(id))
|
|
36
|
+
$('#crumbHost').innerHTML = crumbHtml({ page: 'Board', board: M.board.name || 'Board', boards });
|
|
37
|
+
wireCrumb({ boards, board: M.board.id, goBoard: (ws, id) => location.assign('/premium-board.html?ws=' + encodeURIComponent(ws) + '&board=' + encodeURIComponent(id)) });
|
|
38
|
+
chatAbout('board:this-board', M.board.name ? 'the ' + M.board.name + ' board' : 'this board');
|
|
38
39
|
}
|
|
39
40
|
$('#snap').textContent = M.header.text;
|
|
40
41
|
setPageGaps(((M.header && M.header.missing) || []).length);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* pm/premium-chat.js — the Chat page (initiative premium-chat-page). The rail's middle place: the session list, the conversation and the viewer
|
|
2
|
+
* as a page of their own. ?about=<key>&label=<name> is the page the PM came from (the rail's Chat carries it); without it, the PM's own chat. */
|
|
3
|
+
import { wireRail, openChatPage } from './premium-shell.js';
|
|
4
|
+
|
|
5
|
+
wireRail('chat');
|
|
6
|
+
const q = new URLSearchParams(location.search);
|
|
7
|
+
// a conversation key as the ask route takes it (lib/briefing-premium-agent.js KEY_RE); anything else is the PM's own chat
|
|
8
|
+
const about = /^(decision|blocked|waited|src|ev|work|board|init|doc|ins):[A-Za-z0-9][A-Za-z0-9._:-]{0,100}$/.test(q.get('about') || '') ? q.get('about') : null;
|
|
9
|
+
openChatPage(about || 'chat:main', about ? (q.get('label') || '').slice(0, 80) : '');
|
|
@@ -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 { mountDocSheet } from './premium-doc-sheet.js';
|
|
9
|
-
import { $, $$, esc, openDlg, closeDlg, setMode, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, kv, H2, CHECK, CHEV, crumbHtml, wireCrumb, AI, openAddDoc, setPageGaps } from './premium-shell.js';
|
|
9
|
+
import { $, $$, esc, openDlg, closeDlg, setMode, toast, loadThread, onScroll, wireRail, logHtml, turnA, ptx, pillOf, kv, H2, CHECK, CHEV, crumbHtml, wireCrumb, chatAbout, AI, openAddDoc, setPageGaps } from './premium-shell.js';
|
|
10
10
|
import { barHtml, onBar, closeMenu } from './premium-acts.js';
|
|
11
11
|
import { openWorkItem, recordPress } from './premium-vw-item.js';
|
|
12
12
|
import { openTicket } from './premium-vw-jira.js';
|
|
@@ -256,11 +256,12 @@ let crumbed = false;
|
|
|
256
256
|
function draw() {
|
|
257
257
|
if (!crumbed) {
|
|
258
258
|
crumbed = true;
|
|
259
|
-
$('#crumbHost').innerHTML = crumbHtml({ board: M.board.name || 'Board', boards: M.boards, ini: M.crumbTitle, siblings: M.siblings
|
|
259
|
+
$('#crumbHost').innerHTML = crumbHtml({ board: M.board.name || 'Board', boards: M.boards, ini: M.crumbTitle, siblings: M.siblings });
|
|
260
260
|
const q = (id) => '?id=' + encodeURIComponent(id) + (M.board.ws ? '&ws=' + encodeURIComponent(M.board.ws) + '&board=' + encodeURIComponent(M.board.id) : '');
|
|
261
261
|
wireCrumb({ boards: M.boards, board: M.board.id, siblings: M.siblings, ini: M.id,
|
|
262
262
|
goBoard: (ws, id) => location.assign('/premium-board.html' + (ws ? '?ws=' + encodeURIComponent(ws) + '&board=' + encodeURIComponent(id) : '')),
|
|
263
|
-
goIni: (id) => location.assign('/premium-initiative.html' + q(id))
|
|
263
|
+
goIni: (id) => location.assign('/premium-initiative.html' + q(id)) });
|
|
264
|
+
if (M.rows[0]) chatAbout(M.rows[0].key, M.crumbTitle || M.rows[0].title);
|
|
264
265
|
}
|
|
265
266
|
$('#iH1').textContent = M.title; document.title = 'PMOS · ' + M.title;
|
|
266
267
|
$('#snap').textContent = M.header.text;
|
|
@@ -33,8 +33,8 @@ function drawHead() {
|
|
|
33
33
|
if (!crumbed) {
|
|
34
34
|
crumbed = true;
|
|
35
35
|
const boards = M.board.switcher || [];
|
|
36
|
-
$('#crumbHost').innerHTML = crumbHtml({ page: 'Insights', board: M.board.name || 'Insights', boards
|
|
37
|
-
wireCrumb({ boards, board: M.board.id, goBoard: (ws, id) => location.assign('/premium-insights.html?ws=' + encodeURIComponent(ws) + '&board=' + encodeURIComponent(id))
|
|
36
|
+
$('#crumbHost').innerHTML = crumbHtml({ page: 'Insights', board: M.board.name || 'Insights', boards });
|
|
37
|
+
wireCrumb({ boards, board: M.board.id, goBoard: (ws, id) => location.assign('/premium-insights.html?ws=' + encodeURIComponent(ws) + '&board=' + encodeURIComponent(id)) });
|
|
38
38
|
}
|
|
39
39
|
$('#snap').textContent = M.header.text;
|
|
40
40
|
setPageGaps(((M.header && M.header.missing) || []).length);
|
|
@@ -78,9 +78,11 @@ function tbTheme() {
|
|
|
78
78
|
const cur = document.documentElement.dataset.theme || 'auto';
|
|
79
79
|
$$('#tbTheme [data-th]').forEach((b) => b.setAttribute('aria-checked', String(b.dataset.th === cur)));
|
|
80
80
|
}
|
|
81
|
-
let
|
|
82
|
-
/** The rail's Chat
|
|
83
|
-
export function
|
|
81
|
+
let ABOUT = null;
|
|
82
|
+
/** The page the rail's Chat brings along (premium-chat-page): the conversation key of this page and its name. The Chat page opens that conversation. */
|
|
83
|
+
export function chatAbout(key, label) { ABOUT = key ? { key, label: label || '' } : null; }
|
|
84
|
+
/** On the Chat page the dialog is the page: it never closes, Escape does nothing, and the rail stays live. */
|
|
85
|
+
const chatPage = () => document.body.classList.contains('chatpg');
|
|
84
86
|
|
|
85
87
|
/* ── Sources: when each source was last read, and a Refresh for each (GET /api/sources, POST /api/sources/refresh, as Data freshness) ──
|
|
86
88
|
* The chip says no time: each source is read on its own schedule, so only the dialog's rows carry times. Its dot is orange when a source is
|
|
@@ -156,12 +158,18 @@ export async function openSources() {
|
|
|
156
158
|
await tbReadSrc(); draw(); poll(8);
|
|
157
159
|
}
|
|
158
160
|
|
|
159
|
-
/* ──
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
/* ── the Chat page (initiative premium-chat-page): the standard dialog held open as the page, beside the rail ───────────────────────────
|
|
162
|
+
* key: the conversation (the page the PM came from, or their own chat:main). The session list shows beside it on a desktop; on a phone its chip
|
|
163
|
+
* opens the list. Nothing here writes: a message goes through the same ask route as every other conversation. */
|
|
164
|
+
export function openChatPage(key, label) {
|
|
165
|
+
const say = label
|
|
166
|
+
? 'Talk to Claude about ' + label + '. It works in a real Claude Code session: it can read, change files, run commands and take slash commands.'
|
|
167
|
+
: 'Talk to Claude. It works in a real Claude Code session: it can read, change files, run commands and take slash commands. Pick another session from the list.';
|
|
168
|
+
openDlg({ eye: label ? 'Chat · ' + label : 'Chat', title: label ? 'Ask about ' + label : 'Chat', say, stream: turnA(ptx(say)), noteKey: key, pane: `<article class="paper doc"><p class="note">${esc(label ? 'This conversation is about ' + label + '. Files Claude opens show here.' : 'Files Claude opens show here.')}</p></article>`, label: label || 'Chat', sessions: true });
|
|
169
|
+
$$('.rail').forEach((x) => { x.inert = false; }); document.documentElement.style.overflow = '';
|
|
170
|
+
$('#veil').classList.remove('on');
|
|
171
|
+
$('#askIn').placeholder = label ? 'Message Claude about ' + label : 'Message Claude, or type /';
|
|
172
|
+
if (desk()) setFull(true); else setTab('chat');
|
|
165
173
|
loadThread(key);
|
|
166
174
|
}
|
|
167
175
|
tbMount(); // the top bar first: the menu holds the Settings, Sessions, Console and Search items the code below wires
|
|
@@ -217,6 +225,7 @@ $('#dOut').addEventListener('scroll', () => {
|
|
|
217
225
|
else if (p.scrollTop < 8) g.classList.remove('shrunk');
|
|
218
226
|
}, { passive: true });
|
|
219
227
|
export function closeDlg() {
|
|
228
|
+
if (chatPage()) return;
|
|
220
229
|
clearTimeout(threadTimer); S.key = null; flushPad(); railOnClose();
|
|
221
230
|
park();
|
|
222
231
|
$('#veil').classList.remove('on'); $$('.rail,main.stage,#dock').forEach((x) => { x.inert = false; });
|
|
@@ -240,7 +249,7 @@ $('#dExpand').onclick = () => setFull(!$('#dlg').classList.contains('full'));
|
|
|
240
249
|
$('#dTabs').addEventListener('click', (e) => { const b = e.target.closest('[data-t]'); if (b) setTab(b.dataset.t); });
|
|
241
250
|
addEventListener('keydown', (e) => {
|
|
242
251
|
if (e.key !== 'Escape' || !$('#dlg').classList.contains('on')) return;
|
|
243
|
-
if (document.querySelector('[data-esc-layer]')) return; // a layer open over the dialog (a viewer menu, Present) closes itself first
|
|
252
|
+
if (document.querySelector('[data-esc-layer]') || chatPage()) return; // a layer open over the dialog (a viewer menu, Present) closes itself first
|
|
244
253
|
if ($('#dlg').classList.contains('full')) { setFull(false); e.stopImmediatePropagation(); return; }
|
|
245
254
|
closeDlg();
|
|
246
255
|
}, true);
|
|
@@ -457,7 +466,7 @@ if (window.visualViewport) {
|
|
|
457
466
|
}
|
|
458
467
|
|
|
459
468
|
/* ── the rail: Briefing, My work, Board and Insights are premium pages ── */
|
|
460
|
-
const GO = { brief: '/premium.html', work: '/premium-work.html', init: '/premium-board.html', rep: '/premium-insights.html' };
|
|
469
|
+
const GO = { brief: '/premium.html', work: '/premium-work.html', chat: '/premium-chat.html', init: '/premium-board.html', rep: '/premium-insights.html' };
|
|
461
470
|
/* ── the recording chip: while a note records or is paused, every premium page says so and can stop it (initiative briefing-premium-calendar, slice 3) ───────────────
|
|
462
471
|
* It reads GET /api/notes. Only the Briefing holds a recorder; the other pages show what the server holds, and Stop there ends the meeting through POST /api/notes/stop. */
|
|
463
472
|
function mountRecChip(here) {
|
|
@@ -506,12 +515,17 @@ export function wireRail(here) {
|
|
|
506
515
|
rail.style.setProperty('--pi', String(all.indexOf(cur)));
|
|
507
516
|
const place = () => { if (cur) rail.style.setProperty('--py', (cur.offsetTop - all[0].offsetTop) + 'px'); };
|
|
508
517
|
place(); addEventListener('resize', place);
|
|
509
|
-
$$('.rail [data-go]').forEach((b) => { b.onclick = () => { if (b.dataset.go
|
|
518
|
+
$$('.rail [data-go]').forEach((b) => { b.onclick = () => { if (b.dataset.go !== here) location.assign(b.dataset.go === 'chat' ? chatHref() : GO[b.dataset.go]); }; });
|
|
519
|
+
}
|
|
520
|
+
/** The Chat page's address: the workspace the PM is in, and the page they came from as the conversation it opens (premium-chat-page). */
|
|
521
|
+
function chatHref() {
|
|
522
|
+
const q = new URLSearchParams(), ws = new URLSearchParams(location.search).get('ws');
|
|
523
|
+
if (ws) q.set('ws', ws);
|
|
524
|
+
if (ABOUT) { q.set('about', ABOUT.key); if (ABOUT.label) q.set('label', ABOUT.label); }
|
|
525
|
+
const s = q.toString(); return GO.chat + (s ? '?' + s : '');
|
|
510
526
|
}
|
|
511
|
-
/** The rail's Chat: the page's own conversation (its Sessions chip and full screen reach the other sessions); with none, the session list. */
|
|
512
|
-
function railChat() { if (PAGE_CHAT) PAGE_CHAT(); else openSessions(); }
|
|
513
527
|
|
|
514
|
-
/* ── the crumb: where you are and a menu to switch board or initiative. Its Chat moved to the rail (premium-chat-rail)
|
|
528
|
+
/* ── the crumb: where you are and a menu to switch board or initiative. Its Chat moved to the rail (premium-chat-rail) ──────────── */
|
|
515
529
|
export function crumbHtml(o) {
|
|
516
530
|
const chev = (id, label, show) => `<button id="${id}" class="cri" aria-haspopup="menu" aria-expanded="false" aria-label="${esc(label)}"${show ? '' : ' hidden'}>${CHEV}</button>`;
|
|
517
531
|
const menu = '<div id="crMenu" class="crmenu" role="menu" hidden></div>';
|
|
@@ -521,7 +535,7 @@ export function crumbHtml(o) {
|
|
|
521
535
|
: `<nav class="crumb" aria-label="Where you are">${o.page ? `<span class="crpg">${esc(o.page)}</span>` : ''}<button id="crBoard" aria-current="page" disabled>${esc(o.board)}</button>${chev('crSw', 'Switch board', o.boards && o.boards.length > 1)}${menu}</nav>`;
|
|
522
536
|
return `<div class="where">${left}</div>`;
|
|
523
537
|
}
|
|
524
|
-
/** o: { boards: [{ws,id,name}], board: id, siblings: [{id,title}], ini: id, goBoard(ws, id), goIni(id)
|
|
538
|
+
/** o: { boards: [{ws,id,name}], board: id, siblings: [{id,title}], ini: id, goBoard(ws, id), goIni(id) }. Escape and a click outside close the menu; the arrows move in it. */
|
|
525
539
|
export function wireCrumb(o) {
|
|
526
540
|
const menu = $('#crMenu'); if (!menu) return;
|
|
527
541
|
const close = () => { menu.hidden = true; $$('#crSw,#crSw2').forEach((b) => b.setAttribute('aria-expanded', 'false')); };
|
|
@@ -547,7 +561,6 @@ export function wireCrumb(o) {
|
|
|
547
561
|
if (e.key === 'Escape') { const k = menu.dataset.k === 'b' ? b1 : b2; close(); if (k) k.focus(); }
|
|
548
562
|
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') { e.preventDefault(); const L = $$('button', menu), i = L.indexOf(document.activeElement); L[(i + (e.key === 'ArrowDown' ? 1 : L.length - 1)) % L.length].focus(); }
|
|
549
563
|
});
|
|
550
|
-
if (o.ask) onPageChat(o.ask);
|
|
551
564
|
}
|
|
552
565
|
|
|
553
566
|
/* ── Add a document: the dialog the Board and the initiative page share (initiative briefing-premium-adddoc) ──────────────────────────────────
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* (draft, stop, edit, post after a confirm, send back, try again), and keys and swipe on the rows. */
|
|
6
6
|
import { pmPost } from './http.js';
|
|
7
7
|
import { mdRender } from './markdown.js';
|
|
8
|
-
import { $, $$, esc, openDlg, closeDlg, setMode, toast, loadThread, onScroll, wireRail, logHtml, turnA, turnU, ptx, CHECK, RM, S, setPageGaps,
|
|
8
|
+
import { $, $$, esc, openDlg, closeDlg, setMode, toast, loadThread, onScroll, wireRail, logHtml, turnA, turnU, ptx, CHECK, RM, S, setPageGaps, chatAbout } from './premium-shell.js';
|
|
9
9
|
|
|
10
10
|
let M = null; // the model
|
|
11
11
|
let openR = null; // the row whose dialog is open
|
|
@@ -119,7 +119,7 @@ const WHO = [['you', 'You'], ['agent-drafts', 'Agent drafts'], ['agent-does', 'A
|
|
|
119
119
|
const PRIS = ['P1', 'P2', 'P3', ''];
|
|
120
120
|
let dlgKind = null; // 'item' | 'fjobs': what the open dialog shows
|
|
121
121
|
let ui = {}; // what is typed or opened in the item dialog; kept across a redraw
|
|
122
|
-
const freshUi = () => ({ xp: null, ed: null, dd: '', sn: '', ask: null, body: null, editing: false, confirm: false, back: false, note: '', wo: '', pick: null, round: null, more: false, dpick: null, pane: '' });
|
|
122
|
+
const freshUi = () => ({ xp: null, ed: null, dd: '', sn: '', ask: null, body: null, editing: false, confirm: false, back: false, note: '', wo: '', pick: null, round: null, more: false, dpick: null, pane: '', sheet: false });
|
|
123
123
|
const dlgOpen = () => $('#dlg').classList.contains('on');
|
|
124
124
|
const paras = (t) => String(t || '').split(/\n{2,}/).filter((x) => x.trim()).map((x) => `<p>${esc(x.trim()).replace(/\n/g, '<br>')}</p>`).join('');
|
|
125
125
|
|
|
@@ -193,7 +193,7 @@ function agentInner(r) {
|
|
|
193
193
|
|
|
194
194
|
/* the dialog's fields (initiative premium-simple-ui): one labelled field for each choice, showing its value from the record, with a chevron.
|
|
195
195
|
* A field opens its panel under it, one at a time. When holds Today, Not yet, Not before and Someday; Waiting on, Who does it and Priority · Due
|
|
196
|
-
* hold the Waiting, Steps and Edit panels.
|
|
196
|
+
* hold the Waiting, Steps and Edit panels. Since 2026-10-20 they sit in a sheet behind Edit ▾ (see cardInner). Every press is the same route as before. */
|
|
197
197
|
const CHEV = '<svg class="i chev" viewBox="0 0 24 24"><path d="m6 9 6 6 6-6"/></svg>';
|
|
198
198
|
const PLACE = { today: ['Today', ''], inbox: ['Inbox', 'not placed yet'], tray: ['Not placed yet', 'you added it'], upcoming: ['Upcoming', ''], waiting: ['Waiting', ''], someday: ['Someday', ''] };
|
|
199
199
|
function whenOf(r) {
|
|
@@ -236,27 +236,45 @@ function panelHtml(r, x) {
|
|
|
236
236
|
}
|
|
237
237
|
return '';
|
|
238
238
|
}
|
|
239
|
+
/* the fields live at dialog level (PM, 2026-10-20: "accessible on popup level instead of on the beginning of the chat, and hidden when not needed"):
|
|
240
|
+
* one row beside the Detail / Conversation switch holds Edit ▾ and Done; Edit opens a sheet with the fields and Keep it / Drop it, closed by default,
|
|
241
|
+
* so the conversation gets the whole body. A field with nothing to set for this item (Waiting on when the item cannot wait and waits on nobody) is left out. */
|
|
242
|
+
const SLIDERS = '<svg class="i" viewBox="0 0 24 24"><path d="M4 7h10M18 7h2M4 17h4M12 17h8"/><circle cx="16" cy="7" r="2"/><circle cx="10" cy="17" r="2"/></svg>';
|
|
239
243
|
function cardInner(r) {
|
|
240
244
|
const d = r.dialog, a = d.write.actions, x = ui.xp || '', S = d.steps || [], e = d.edit, ag = d.agent;
|
|
241
245
|
const steps = S.length ? S.length + (S.length === 1 ? ' step' : ' steps') : 'no steps yet';
|
|
242
246
|
const whos = [...new Set(S.map((s) => (WHO.find((w) => w[0] === s.who) || [0, 'You'])[1]))];
|
|
243
247
|
const fld = (k, label, val, sub, open = x === k) => fieldHtml(k, label, val, sub, open) + (open ? panelHtml(r, k) : '');
|
|
244
|
-
const when = whenOf(r);
|
|
245
|
-
let
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
else h += agentHtml(r);
|
|
249
|
-
h += `<div class="ffds">`
|
|
248
|
+
const when = whenOf(r), sum = [when[0], e.waiting_on ? 'waiting on ' + e.waiting_on : '', e.priority || '', e.due ? 'due ' + dayLabel(e.due) : ''].filter(Boolean).join(' · ');
|
|
249
|
+
let f = '';
|
|
250
|
+
if (ag && ag.state === 'suggest') f += fld('agent', 'The agent', 'Can draft this for you', ag.mine ? 'nothing leaves PMOS' : 'you read it first');
|
|
251
|
+
f += `<div class="ffds">`
|
|
250
252
|
+ fieldHtml('when', 'When', when[0], when[1], x === 'when' || x === 'defer') + (x === 'when' || x === 'defer' ? panelHtml(r, x) : '')
|
|
251
|
-
+ fld('wait', 'Waiting on', e.waiting_on || 'Nobody', '')
|
|
253
|
+
+ (a.includes('waiting') || e.waiting_on ? fld('wait', 'Waiting on', e.waiting_on || 'Nobody', '') : '')
|
|
252
254
|
+ fld('steps', 'Who does it', whos.length ? whos.join(', ') : 'You', steps)
|
|
253
255
|
+ fld('edit', 'Priority · Due', e.priority || 'None', e.due ? 'due ' + dayLabel(e.due) : 'no date')
|
|
254
256
|
+ `</div>`;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
257
|
+
f += `<div class="fbar"><div class="fmeta">${a.includes('keep') ? '<button class="flink" data-p="keep">Keep it</button>' : ''}<button class="flink" data-p="remove">Drop it</button></div></div>`;
|
|
258
|
+
return `<div class="ibrow"><button class="ichip" id="iTog" data-p="sheet" aria-expanded="${!!ui.sheet}" aria-controls="iSheet" title="Edit when, who and priority">${SLIDERS}<span>Edit</span><em class="isum">${esc(sum)}</em>${CHEV}</button>`
|
|
259
|
+
+ `<button class="cta fdone" data-p="done">${CHECK}<span>Done</span></button></div>`
|
|
260
|
+
+ `<div class="isheet" id="iSheet" role="group" aria-label="Item fields"${ui.sheet ? ' data-esc-layer' : ' hidden'}>${f}</div>`
|
|
261
|
+
+ '<p class="nodef err" id="cardErr" role="alert" hidden></p>';
|
|
262
|
+
}
|
|
263
|
+
/* an agent that is working, ready, failed or posted needs the PM's eye, so its block stays in the conversation; one that only can draft is a field in the sheet */
|
|
264
|
+
const agCardInner = (r) => (r.dialog.agent && r.dialog.agent.state !== 'suggest' ? agentHtml(r) : '');
|
|
265
|
+
const agCardHtml = (r) => { const h = agCardInner(r); return h ? `<div class="acard" id="agCard">${h}</div>` : ''; };
|
|
266
|
+
/* the bar sits in the switch row (#dTabs), which the dialog shows at every width while an item is open */
|
|
267
|
+
function mountBar(r) {
|
|
268
|
+
unmountBar();
|
|
269
|
+
$('#dTabs').insertAdjacentHTML('beforeend', `<div class="ibar" id="card">${cardInner(r)}</div>`);
|
|
270
|
+
$('#dlg').classList.add('itm');
|
|
271
|
+
}
|
|
272
|
+
function unmountBar() { const c = $('#card'); if (c) c.remove(); $('#dlg').classList.remove('itm'); }
|
|
273
|
+
function placeSheet() {
|
|
274
|
+
const s = $('#iSheet'); if (!s || s.hidden) return;
|
|
275
|
+
const dl = $('#dlg').getBoundingClientRect(), t = $('#dTabs').getBoundingClientRect();
|
|
276
|
+
s.style.maxHeight = Math.max(200, dl.bottom - t.bottom - 20) + 'px';
|
|
258
277
|
}
|
|
259
|
-
const cardHtml = (r) => `<div class="acard" id="card">${cardInner(r)}</div>`;
|
|
260
278
|
function paneHtml(r) {
|
|
261
279
|
const p = r.dialog.pane, ag = r.dialog.agent, dr = ag && ag.draft && (ag.draft.body || ag.draft.summary) ? ag.draft : null;
|
|
262
280
|
let h = '';
|
|
@@ -289,17 +307,19 @@ $('#oMain').addEventListener('click', async (e) => {
|
|
|
289
307
|
function openRow(r) {
|
|
290
308
|
if (!r) return;
|
|
291
309
|
openR = r; dlgKind = 'item'; ui = freshUi(); const d = r.dialog;
|
|
292
|
-
openDlg({ eye: d.eye + ' · real data', title: r.title, sub: r.sub, say: d.say, stream: turnA(logHtml(d)) + turnA(ptx(d.say)) +
|
|
293
|
-
ui.pane = paneSig(r);
|
|
310
|
+
openDlg({ eye: d.eye + ' · real data', title: r.title, sub: r.sub, say: d.say, stream: turnA(logHtml(d)) + turnA(ptx(d.say)) + agCardHtml(r), noteKey: r.key, pane: paneHtml(r), label: paneLabel(r) });
|
|
294
311
|
ui.pane = paneSig(r);
|
|
312
|
+
mountBar(r);
|
|
295
313
|
loadThread(r.key);
|
|
296
314
|
setTimeout(() => { const b = $('#dBody'); b.scrollTop = b.scrollHeight; }, 120);
|
|
297
315
|
}
|
|
298
316
|
/* redraw the card from what the model and the typed state hold; `sel` is the control to focus again */
|
|
299
317
|
function paint(sel) {
|
|
300
318
|
const c = $('#card'); if (!c || !openR) return;
|
|
301
|
-
c.innerHTML = cardInner(openR);
|
|
302
|
-
|
|
319
|
+
c.innerHTML = cardInner(openR); placeSheet();
|
|
320
|
+
const ac = $('#agCard'), ah = agCardInner(openR);
|
|
321
|
+
if (ac && ah) ac.innerHTML = ah; else if (ac) ac.remove(); else if (ah) $('#dBody .stream').insertAdjacentHTML('beforeend', agCardHtml(openR));
|
|
322
|
+
if (sel) { const f = $(sel, c) || $(sel, $('#dBody')); if (f) f.focus(); }
|
|
303
323
|
}
|
|
304
324
|
function showErr(msg) { const e = $('#cardErr'); if (!e) { toast(msg); return; } e.textContent = msg; e.hidden = false; }
|
|
305
325
|
const sigOf = (r) => JSON.stringify([r.dialog.agent, r.dialog.steps, r.dialog.defer, r.dialog.someday, r.dialog.edit, r.dialog.write.actions]);
|
|
@@ -321,7 +341,7 @@ function toastUndo(msg, undo) {
|
|
|
321
341
|
clearTimeout(toastUndo.t); toastUndo.t = setTimeout(() => t.classList.remove('on'), 8000);
|
|
322
342
|
}
|
|
323
343
|
async function commit(o) {
|
|
324
|
-
if (!o.list) $$('#card button').forEach((b) => { b.disabled = true; });
|
|
344
|
+
if (!o.list) $$('#card button, #agCard button').forEach((b) => { b.disabled = true; });
|
|
325
345
|
const res = await o.send();
|
|
326
346
|
if (!res || res.ok !== true) {
|
|
327
347
|
const msg = (res && res.error) || 'The press was not recorded.';
|
|
@@ -381,6 +401,7 @@ function dlgClick(b, r) {
|
|
|
381
401
|
case 'notyet': return commit({ send: () => post('/api/pm-items/notyet', { id, when: b.dataset.when }), say: SAID.notyet });
|
|
382
402
|
case 'waiting': return commit({ send: () => post('/api/pm-items/waiting', { id, on: ($('#wOn').value || '').trim() }), say: SAID.waiting });
|
|
383
403
|
case 'done': return doneP(r);
|
|
404
|
+
case 'sheet': ui.sheet = !ui.sheet; if (!ui.sheet) ui.xp = null; return paint(ui.sheet ? '#iSheet .ffd' : '#iTog');
|
|
384
405
|
case 'remove': return commit({ send: () => post('/api/pm-items/remove', { id }), say: SAID.remove, undo: () => post('/api/pm-items/undo', { id }) });
|
|
385
406
|
case 'flag': return todayP(r);
|
|
386
407
|
case 'keep': return commit({ send: () => post('/api/pm-items/keep', { id }), say: SAID.keep });
|
|
@@ -435,7 +456,7 @@ function dlgClick(b, r) {
|
|
|
435
456
|
}
|
|
436
457
|
}
|
|
437
458
|
const FIELD = { xeT: 'title', xeD: 'due', xeW: 'wo', xeJ: 'job' };
|
|
438
|
-
|
|
459
|
+
const onInput = (e) => {
|
|
439
460
|
const t = e.target, id = t.id;
|
|
440
461
|
if (id === 'wOn') { ui.wo = t.value; const b = $('#wBtn'); if (b) b.disabled = !t.value.trim(); }
|
|
441
462
|
else if (ui.ed && FIELD[id]) ui.ed[FIELD[id]] = t.value;
|
|
@@ -444,15 +465,25 @@ $('#dBody').addEventListener('input', (e) => {
|
|
|
444
465
|
else if (id === 'agAsk') ui.ask = t.value;
|
|
445
466
|
else if (id === 'agBody') ui.body = t.value;
|
|
446
467
|
else if (id === 'agNote') { ui.note = t.value; const g = $('[data-p="ag-sendback"]'); if (g) g.disabled = !t.value.trim(); }
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
|
|
468
|
+
};
|
|
469
|
+
const onChange = (e) => { if (ui.ed && e.target.id === 'xeJ') ui.ed.job = e.target.value; };
|
|
470
|
+
const onClick = (e) => {
|
|
450
471
|
const lt = e.target.closest('#logT');
|
|
451
472
|
if (lt) { const c = $('#alog').classList.toggle('col'); lt.setAttribute('aria-expanded', !c); return; }
|
|
452
473
|
const b = e.target.closest('[data-p]');
|
|
453
474
|
if (!b || b.disabled || !openR || dlgKind !== 'item') return;
|
|
454
475
|
dlgClick(b, openR);
|
|
455
|
-
}
|
|
476
|
+
};
|
|
477
|
+
/* the conversation and the bar in the switch row take the same presses */
|
|
478
|
+
for (const host of [$('#dBody'), $('#dTabs')]) { host.addEventListener('input', onInput); host.addEventListener('change', onChange); host.addEventListener('click', onClick); }
|
|
479
|
+
const shutSheet = (focus) => { if (!ui.sheet) return; ui.sheet = false; ui.xp = null; paint(focus ? '#iTog' : null); };
|
|
480
|
+
/* the sheet closes on a press outside it, and Escape closes it before the dialog */
|
|
481
|
+
document.addEventListener('pointerdown', (e) => { if (ui.sheet && dlgKind === 'item' && !e.target.closest('#card')) shutSheet(false); });
|
|
482
|
+
addEventListener('keydown', (e) => { if (e.key === 'Escape' && ui.sheet && dlgKind === 'item' && $('#iSheet')) { e.stopImmediatePropagation(); shutSheet(true); } }, true);
|
|
483
|
+
addEventListener('resize', placeSheet);
|
|
484
|
+
/* the bar belongs to the item dialog: it goes when the dialog closes or another dialog takes its place */
|
|
485
|
+
new MutationObserver(() => { if ($('#card') && (!dlgOpen() || dlgKind !== 'item' || !openR || $('#dTitle').textContent !== openR.title)) unmountBar(); })
|
|
486
|
+
.observe($('#dlg'), { attributes: true, attributeFilter: ['class'], childList: true, subtree: true, characterData: true });
|
|
456
487
|
|
|
457
488
|
/* ── Focus and jobs: the bar under the add line, and its dialog ─────────────────────────────────────────────────────────────── */
|
|
458
489
|
const fBody = (f) => ({ key: f.key, title: f.title, why: f.why, item_ids: f.item_ids, job: f.job || null });
|
|
@@ -653,6 +684,6 @@ async function load() {
|
|
|
653
684
|
if (mine && dlgKind === 'item') refreshOpen(); else if (mine) drawFocusDlg();
|
|
654
685
|
}
|
|
655
686
|
setInterval(() => { if (M && M.agents && M.agents.counts.running > 0 && !document.hidden) load(); }, 15000); // an agent's state changes without a press
|
|
656
|
-
|
|
687
|
+
chatAbout('work:this-page', 'My work'); // the rail's Chat opens the Chat page on this page's conversation (premium-chat-page)
|
|
657
688
|
$('#brief').textContent = 'Reading your list.';
|
|
658
689
|
load();
|
|
@@ -2499,6 +2499,24 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
2499
2499
|
.askbar .spad-f .cta{width:auto;height:34px;min-height:34px;padding:0 14px;border-radius:var(--r-chip);display:inline-flex;font-size:var(--fs-2);background:var(--card);color:var(--ink)}
|
|
2500
2500
|
.askbar .spad-f .cta:disabled{opacity:.5;cursor:not-allowed}
|
|
2501
2501
|
@media (max-width:700px){.spad-h span{display:none}.askbar .spad textarea{font-size:var(--fs-4)}.padt{min-height:44px}}
|
|
2502
|
+
/* Item fields at dialog level (PM, 2026-10-20): Edit ▾ and Done sit in the Detail / Conversation row; Edit opens the fields as a sheet over the body,
|
|
2503
|
+
closed by default, so the conversation keeps the whole body. On a wide dialog the switch is not drawn, so the row holds the bar alone. */
|
|
2504
|
+
.dlg.itm:not(.srl-open) #dTabs{display:flex!important;align-items:center;gap:8px;position:relative}
|
|
2505
|
+
.dlg.itm[data-mode="detail"] #dTabs .seg{display:none}
|
|
2506
|
+
@media (min-width:1000px){.dlg.itm[data-mode="split"] #dTabs .seg,.dlg.itm.full #dTabs .seg{display:none}.dlg.itm #dTabs{margin:4px 0 12px}}
|
|
2507
|
+
.ibar{margin-left:auto;display:grid;gap:6px;min-width:0}
|
|
2508
|
+
.ibrow{display:flex;align-items:center;justify-content:flex-end;gap:8px}
|
|
2509
|
+
.ichip{display:inline-flex;align-items:center;gap:7px;height:44px;padding:0 14px;border-radius:var(--r-chip);background:var(--well);color:var(--ink);font-size:var(--fs-2);font-weight:600;min-width:0;transition:box-shadow .25s}
|
|
2510
|
+
.ichip:hover,.ichip[aria-expanded="true"]{box-shadow:inset 0 0 0 1.5px var(--b3)}
|
|
2511
|
+
.ichip svg{width:17px;height:17px;flex:none}.ichip .isum{font-style:normal;font-weight:400;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:340px}
|
|
2512
|
+
.ichip .isum:empty{display:none}.ichip .isum::before{content:'· '}
|
|
2513
|
+
.ichip .i:last-child{transition:transform .25s var(--ease)}.ichip[aria-expanded="true"] .i:last-child{transform:rotate(180deg)}
|
|
2514
|
+
.ibar .fdone{width:auto;height:44px;padding:0 18px;font-size:var(--fs-2)}
|
|
2515
|
+
.isheet{position:absolute;z-index:6;right:0;top:calc(100% + 8px);width:min(460px,100%);overflow:auto;display:grid;gap:12px;padding:16px;border-radius:var(--r-in);background:var(--card-solid);box-shadow:inset 0 0 0 1px var(--hair),0 24px 60px -24px rgba(20,24,60,.45);animation:rise .3s var(--ease) both;overscroll-behavior:contain}
|
|
2516
|
+
.isheet[hidden]{display:none}
|
|
2517
|
+
.isheet .fbar{padding-top:10px}
|
|
2518
|
+
.ibar #cardErr{margin:0;text-align:right}
|
|
2519
|
+
@media (max-width:699px){.ichip .isum{display:none}.ichip{padding:0 12px}.ibar .fdone{padding:0 14px}.dlg.itm #dTabs .seg button{padding:0 11px}.isheet{left:0;width:auto}}
|
|
2502
2520
|
/* a compact dialog (the meeting detail) on a phone: a short head, and once the detail scrolls only the title and the tools stay (PM, 2026-10-20) */
|
|
2503
2521
|
@media (max-width:999px){.dlg.cmp #dEye{display:none}
|
|
2504
2522
|
.dlg.cmp .dhead{align-items:center}
|
|
@@ -2525,3 +2543,9 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
2525
2543
|
.pl.pchat:hover .orb{transform:translateX(-50%)}
|
|
2526
2544
|
}
|
|
2527
2545
|
@media (prefers-reduced-motion:reduce){.pchat .orb{transition:none}}
|
|
2546
|
+
|
|
2547
|
+
/* ── premium-chat-page: the Chat page is the chat dialog held open beside the rail. No veil, no close, no full-screen toggle: it is the page. ── */
|
|
2548
|
+
.chatpg .veil{display:none}
|
|
2549
|
+
.chatpg #dClose,.chatpg #dExpand,.chatpg .dlg .grab{display:none}
|
|
2550
|
+
@media (min-width:1000px){.chatpg .dlg.on{left:128px;top:16px;transform:none;width:calc(100% - 144px);height:calc(100% - 32px);max-height:none!important;border-radius:28px;padding:26px 34px 18px}}
|
|
2551
|
+
@media (max-width:999px){.chatpg .dlg.on{left:0;top:0;transform:none;width:100%;height:calc(100% - 118px - env(safe-area-inset-bottom,0px));max-height:none!important;border-radius:0 0 28px 28px;padding:16px 18px 14px}}
|
|
@@ -12,7 +12,7 @@ import { lineItems, behindOf, refreshTargets, whenRead } from './freshness-words
|
|
|
12
12
|
import { consoleReads, briefOf, needsListOf } from './premium-brief.js';
|
|
13
13
|
import { mountDocSheet } from './premium-doc-sheet.js';
|
|
14
14
|
import { momentOf, inText } from './c3-phone-model.js';
|
|
15
|
-
import { $, $$, esc, store, THEME_KEY, RM, AI, S, theme, toast, kv, H, openDlg, closeDlg, setTab, setMode, setFull, CHECK, CHEV, ptx, turnA, turnU, H1, H2, P1, UL, logHtml, loadThread, onScroll, wireRail, pvFeed, setPageGaps, sourcesHook,
|
|
15
|
+
import { $, $$, esc, store, THEME_KEY, RM, AI, S, theme, toast, kv, H, openDlg, closeDlg, setTab, setMode, setFull, CHECK, CHEV, ptx, turnA, turnU, H1, H2, P1, UL, logHtml, loadThread, onScroll, wireRail, pvFeed, setPageGaps, sourcesHook, chatAbout, pvOpenBell, ibState } from './premium-shell.js';
|
|
16
16
|
const ICON = {
|
|
17
17
|
meeting: '<rect x="4" y="5" width="16" height="15" rx="3"/><path d="M4 10h16M9 3v4M15 3v4"/>',
|
|
18
18
|
merge: '<circle cx="6" cy="6" r="2"/><circle cx="6" cy="18" r="2"/><circle cx="18" cy="9" r="2"/><path d="M6 8v8M18 11c0 4-6 3-12 5"/>',
|
|
@@ -1091,7 +1091,7 @@ async function refreshRepos() {
|
|
|
1091
1091
|
let RTIMER = null;
|
|
1092
1092
|
$('#pkw').dataset.park = 'pkPark';
|
|
1093
1093
|
sourcesHook({ html: sourcesHtml, mount: () => { const slot = $('#pkSlot'), w = $('#pkw'); if (slot && w) slot.appendChild(w); }, refresh: refreshRepos });
|
|
1094
|
-
|
|
1094
|
+
chatAbout('src:this-page', 'the Briefing');
|
|
1095
1095
|
$('#brief').textContent = 'Reading the repository.';
|
|
1096
1096
|
load();
|
|
1097
1097
|
mountFirst(); // the "Your first Briefing" card, only when the page was opened with first=<import id> (initiative premium-welcome)
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<i class="ind"></i>
|
|
16
16
|
<button class="pl" data-go="brief"><svg class="i" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>Briefing</button>
|
|
17
17
|
<button class="pl" data-go="work"><svg class="i" viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="16" rx="3"/><path d="m8.5 12 2.5 2.5 4.5-5"/></svg>My work</button>
|
|
18
|
-
<button class="pl pchat" data-go="chat" aria-
|
|
18
|
+
<button class="pl pchat" data-go="chat" aria-label="Chat" title="Chat"><span class="orb"><svg class="i" viewBox="0 0 24 24"><path d="M4 5h16v11h-9l-5 4v-4H4z"/><path d="M12 7.6l.8 1.9 1.9.8-1.9.8-.8 1.9-.8-1.9-1.9-.8 1.9-.8z"/></svg><i class="cdot" hidden></i></span>Chat</button>
|
|
19
19
|
<button class="pl" data-go="init" aria-current="page"><svg class="i" viewBox="0 0 24 24"><path d="M12 3 3 8l9 5 9-5z"/><path d="m3 13 9 5 9-5"/></svg>Board</button>
|
|
20
20
|
<button class="pl" data-go="rep"><svg class="i" viewBox="0 0 24 24"><path d="M4 20V10M10 20V4M16 20v-8M22 20H2"/></svg>Insights</button>
|
|
21
21
|
</nav>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="pmos-nonce" content="" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
|
7
|
+
<title>PMOS · Chat</title>
|
|
8
|
+
<!-- The premium Chat page (initiative premium-chat-page). The rail's middle place: the session list, the conversation and the viewer as a page of
|
|
9
|
+
its own, not a popup. It is the chat dialog of the other premium pages, held open and placed beside the rail. ?about=<key>&label=<name> opens
|
|
10
|
+
the conversation of the page the PM came from; without it, the PM's own chat (chat:main). -->
|
|
11
|
+
<link rel="preload" href="/vendor/geist-var.woff2" as="font" type="font/woff2" crossorigin />
|
|
12
|
+
<link rel="stylesheet" href="/pm/premium.css" />
|
|
13
|
+
</head>
|
|
14
|
+
<body class="chatpg">
|
|
15
|
+
<div class="sky"><i class="a"></i><i class="b"></i><i class="c"></i></div>
|
|
16
|
+
<nav class="rail glass" aria-label="Places">
|
|
17
|
+
<i class="ind"></i>
|
|
18
|
+
<button class="pl" data-go="brief"><svg class="i" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>Briefing</button>
|
|
19
|
+
<button class="pl" data-go="work"><svg class="i" viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="16" rx="3"/><path d="m8.5 12 2.5 2.5 4.5-5"/></svg>My work</button>
|
|
20
|
+
<button class="pl pchat" data-go="chat" aria-current="page" aria-label="Chat" title="Chat"><span class="orb"><svg class="i" viewBox="0 0 24 24"><path d="M4 5h16v11h-9l-5 4v-4H4z"/><path d="M12 7.6l.8 1.9 1.9.8-1.9.8-.8 1.9-.8-1.9-1.9-.8 1.9-.8z"/></svg><i class="cdot" hidden></i></span>Chat</button>
|
|
21
|
+
<button class="pl" data-go="init"><svg class="i" viewBox="0 0 24 24"><path d="M12 3 3 8l9 5 9-5z"/><path d="m3 13 9 5 9-5"/></svg>Board</button>
|
|
22
|
+
<button class="pl" data-go="rep"><svg class="i" viewBox="0 0 24 24"><path d="M4 20V10M10 20V4M16 20v-8M22 20H2"/></svg>Insights</button>
|
|
23
|
+
</nav>
|
|
24
|
+
|
|
25
|
+
<h1 class="vh">Chat</h1>
|
|
26
|
+
<div class="veil" id="veil"></div>
|
|
27
|
+
<div class="dlg" id="dlg" role="dialog" aria-modal="true" aria-labelledby="dTitle" tabindex="-1" data-mode="split" inert>
|
|
28
|
+
<div class="grab"></div>
|
|
29
|
+
<div class="dhead"><div class="dht"><p class="label" id="dEye"></p><h2 id="dTitle"></h2><p class="dsub" id="dSub"></p></div>
|
|
30
|
+
<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>
|
|
31
|
+
<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>
|
|
32
|
+
<div class="dgrid" id="dGrid" data-tab="out"><section class="pane p-work" id="dBody" aria-label="Conversation"></section>
|
|
33
|
+
<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>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="toast glass" id="toast" role="status"></div>
|
|
36
|
+
<noscript>This page needs JavaScript.</noscript>
|
|
37
|
+
<script type="module" src="/pm/premium-chat.js"></script>
|
|
38
|
+
</body>
|
|
39
|
+
</html>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<i class="ind"></i>
|
|
16
16
|
<button class="pl" data-go="brief"><svg class="i" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>Briefing</button>
|
|
17
17
|
<button class="pl" data-go="work"><svg class="i" viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="16" rx="3"/><path d="m8.5 12 2.5 2.5 4.5-5"/></svg>My work</button>
|
|
18
|
-
<button class="pl pchat" data-go="chat" aria-
|
|
18
|
+
<button class="pl pchat" data-go="chat" aria-label="Chat" title="Chat"><span class="orb"><svg class="i" viewBox="0 0 24 24"><path d="M4 5h16v11h-9l-5 4v-4H4z"/><path d="M12 7.6l.8 1.9 1.9.8-1.9.8-.8 1.9-.8-1.9-1.9-.8 1.9-.8z"/></svg><i class="cdot" hidden></i></span>Chat</button>
|
|
19
19
|
<button class="pl" data-go="init" aria-current="page"><svg class="i" viewBox="0 0 24 24"><path d="M12 3 3 8l9 5 9-5z"/><path d="m3 13 9 5 9-5"/></svg>Board</button>
|
|
20
20
|
<button class="pl" data-go="rep"><svg class="i" viewBox="0 0 24 24"><path d="M4 20V10M10 20V4M16 20v-8M22 20H2"/></svg>Insights</button>
|
|
21
21
|
</nav>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<i class="ind"></i>
|
|
17
17
|
<button class="pl" data-go="brief"><svg class="i" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>Briefing</button>
|
|
18
18
|
<button class="pl" data-go="work"><svg class="i" viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="16" rx="3"/><path d="m8.5 12 2.5 2.5 4.5-5"/></svg>My work</button>
|
|
19
|
-
<button class="pl pchat" data-go="chat" aria-
|
|
19
|
+
<button class="pl pchat" data-go="chat" aria-label="Chat" title="Chat"><span class="orb"><svg class="i" viewBox="0 0 24 24"><path d="M4 5h16v11h-9l-5 4v-4H4z"/><path d="M12 7.6l.8 1.9 1.9.8-1.9.8-.8 1.9-.8-1.9-1.9-.8 1.9-.8z"/></svg><i class="cdot" hidden></i></span>Chat</button>
|
|
20
20
|
<button class="pl" data-go="init"><svg class="i" viewBox="0 0 24 24"><path d="M12 3 3 8l9 5 9-5z"/><path d="m3 13 9 5 9-5"/></svg>Board</button>
|
|
21
21
|
<button class="pl" data-go="rep" aria-current="page"><svg class="i" viewBox="0 0 24 24"><path d="M4 20V10M10 20V4M16 20v-8M22 20H2"/></svg>Insights</button>
|
|
22
22
|
</nav>
|