create-pmos 0.375.0 → 0.377.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 +30 -30
- 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-calendar-3-test.js +28 -0
- package/workspace/briefing-premium-test.js +7 -9
- package/workspace/changelog.json +29 -0
- package/workspace/guide/briefing-premium.md +17 -4
- package/workspace/lib/chat-files.js +99 -0
- package/workspace/lib/routes-briefing-premium.js +52 -2
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-chat-attach-test.js +147 -0
- package/workspace/premium-chat-viewer-test.js +125 -0
- package/workspace/premium-phone-room-test.js +6 -5
- package/workspace/premium-viewer-test.js +1 -1
- package/workspace/public/pm/premium-attach.js +141 -0
- package/workspace/public/pm/premium-meeting.js +2 -2
- package/workspace/public/pm/premium-shell.js +89 -17
- package/workspace/public/pm/premium-viewer.js +57 -6
- package/workspace/public/pm/premium.css +83 -5
- package/workspace/server.js +2 -0
- package/workspace/test-lists/premium-chat-attach.json +13 -0
- package/workspace/test-lists/premium-chat-viewer.json +9 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/* pm/premium-shell.js — what the premium Briefing and My work pages share: the theme, the toast, the standard dialog and the read-only agent's conversation (initiatives briefing-premium and my-work-premium). */
|
|
2
2
|
import { pmGet, pmPost } from './http.js';
|
|
3
3
|
import { recChipView, STOP_LINE } from './premium-meeting.js';
|
|
4
|
-
import { vwReset } from './premium-viewer.js';
|
|
4
|
+
import { vwReset, vwOn, vwCount } from './premium-viewer.js';
|
|
5
5
|
import { openChatFile, openWebLink } from './premium-vw-file.js';
|
|
6
6
|
import { chipActs, openLive, openFocus, mountRecord, HL_LINE } from './premium-vw-rec.js';
|
|
7
7
|
import { lineItems, behindOf, whenRead } from './freshness-words.js';
|
|
8
8
|
import { splitGoal, shownUser, goalBlockHtml, goalProgressHtml, slashMatches } from './goal-chat.js';
|
|
9
9
|
import { mdHtml, userHtml, toolLine, webKind } from './chat-md.js';
|
|
10
10
|
import { padMarkup, padChipMarkup, mountPad, flushPad } from './premium-pad.js';
|
|
11
|
+
import { attachMarkup, attachRowMarkup, mountAttach, attachNames, clearAttach, syncAttach, dropFiles, splitFiles, filesHtml, openAttachment } from './premium-attach.js';
|
|
11
12
|
import { railModel, railHtml, teaser, menuCount, loudestRow, factsOf, titleOf, endAsks, DOT, WORD } from './session-rail.js';
|
|
12
13
|
export const $ = (s, r = document) => r.querySelector(s);
|
|
13
14
|
export const $$ = (s, r = document) => [...r.querySelectorAll(s)];
|
|
@@ -244,11 +245,12 @@ export function openChatPage(key, label) {
|
|
|
244
245
|
const say = label
|
|
245
246
|
? 'Talk to Claude about ' + label + '. It works in a real Claude Code session: it can read, change files, run commands and take slash commands.'
|
|
246
247
|
: '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.';
|
|
247
|
-
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 });
|
|
248
|
+
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>`, paneEmpty: true, label: label || 'Chat', sessions: true });
|
|
248
249
|
$$('.rail').forEach((x) => { x.inert = false; }); document.documentElement.style.overflow = '';
|
|
249
250
|
$('#veil').classList.remove('on');
|
|
250
251
|
$('#askIn').placeholder = label ? 'Message Claude about ' + label : 'Message Claude, or type /';
|
|
251
252
|
if (desk()) setFull(true); else setTab('chat');
|
|
253
|
+
vwShutPane(); // premium-chat-viewer V1: the conversation has the room until something opens in the viewer
|
|
252
254
|
loadThread(key);
|
|
253
255
|
}
|
|
254
256
|
tbMount(); // the top bar first: the menu holds the Settings, Sessions, Console and Search items the code below wires
|
|
@@ -286,9 +288,12 @@ export function openDlg(o) {
|
|
|
286
288
|
$$('.rail,main.stage,#dock').forEach((x) => { x.inert = true; });
|
|
287
289
|
$('#dlg').inert = false; document.documentElement.style.overflow = 'hidden';
|
|
288
290
|
$('#dEye').textContent = o.eye; $('#dTitle').textContent = o.title; $('#dSub').textContent = o.sub || ''; $('#dSub').hidden = !o.sub;
|
|
289
|
-
$('#oMain').innerHTML = o.pane || `<article class="paper doc">${o.html}</article>`; $('#oLab').textContent = o.label || 'Detail';
|
|
290
|
-
$('#
|
|
291
|
+
$('#oMain').innerHTML = o.pane || `<article class="paper doc">${o.html}</article>`; $('#oLab').textContent = o.label || 'Detail';
|
|
292
|
+
if (o.paneEmpty) $('#oMain').dataset.empty = '1'; else delete $('#oMain').dataset.empty; // a placeholder note is not a tab (premium-chat-viewer V2)
|
|
293
|
+
vwReset(); // extra viewer tabs belong to the dialog that opened them
|
|
294
|
+
$('#dBody').innerHTML = `<div class="stream" role="log">${o.stream || turnA(ptx(o.say))}</div><form class="askbar" id="askF"><div class="slashm" id="slashM" role="listbox" aria-label="Commands" hidden></div>${padMarkup()}${attachRowMarkup()}${attachMarkup()}<textarea id="askIn" rows="1" placeholder="Message Claude, or type /" maxlength="8000" autocomplete="off" enterkeyhint="send" aria-label="A message for Claude" aria-controls="slashM"></textarea><button type="submit" data-act="ask" id="askGo" aria-label="Send to Claude" title="Send to Claude"><svg class="i" viewBox="0 0 24 24"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button></form><div class="askfoot"><p class="fine2" id="askNote">${CHAT_NOTE}</p>${padChipMarkup()}</div>`;
|
|
291
295
|
mountPad({ key: S.key, ws: new URLSearchParams(location.search).get('ws'), input: $('#askIn') });
|
|
296
|
+
mountAttach({ getKey: () => S.key, input: $('#askIn'), note: $('#askNote'), onSlash: () => { const i = $('#askIn'); if (!i.value.startsWith('/')) i.value = '/' + i.value; i.focus(); drawSlash(); growAsk(); }, onPad: () => { const t = $('#sPadT'); if (t && $('#sPad').hidden) t.click(); } });
|
|
292
297
|
quietNote();
|
|
293
298
|
$('#dlg').classList.toggle('cmp', o.compact !== false); $('#dlg').classList.remove('shrunk', 'tfull'); setFocus(false); // compact (every dialog unless it says compact: false): a short head on a phone that shrinks as the detail scrolls
|
|
294
299
|
$('#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
|
|
@@ -326,7 +331,12 @@ export function closeDlg() {
|
|
|
326
331
|
if (lastFocus) { try { lastFocus.focus(); } catch { /* gone */ } }
|
|
327
332
|
}
|
|
328
333
|
export function pillOf(s) { const o = $('button[aria-pressed="true"]', s), p = $('.pill', s); requestAnimationFrame(() => { if (!o || !p) return; p.style.left = o.offsetLeft + 'px'; p.style.width = o.offsetWidth + 'px'; }); }
|
|
329
|
-
export function setTab(t) {
|
|
334
|
+
export function setTab(t) {
|
|
335
|
+
if (chatPage() && innerWidth < 1000) { // premium-chat-viewer V5: the Chat page on a phone has no switch; the viewer is a layer over the conversation
|
|
336
|
+
if (t === 'out') { if (vwCount()) vwOpenPane(); return; }
|
|
337
|
+
vwBack(); t = 'chat';
|
|
338
|
+
}
|
|
339
|
+
$('#dGrid').dataset.tab = t; $$('#dTabs button').forEach((b) => b.setAttribute('aria-pressed', b.dataset.t === t)); pillOf($('#dTabs .seg')); }
|
|
330
340
|
export function setMode(m) {
|
|
331
341
|
$('#dlg').dataset.mode = m;
|
|
332
342
|
const b = $('#dPane'), on = m === 'split';
|
|
@@ -341,6 +351,7 @@ $('#dExpand').onclick = () => setFull(!$('#dlg').classList.contains('full'));
|
|
|
341
351
|
$('#dTabs').addEventListener('click', (e) => { const b = e.target.closest('[data-t]'); if (b) setTab(b.dataset.t); });
|
|
342
352
|
addEventListener('keydown', (e) => {
|
|
343
353
|
if (e.key !== 'Escape' || !$('#dlg').classList.contains('on')) return;
|
|
354
|
+
if (chatPage() && $('#dlg').classList.contains('vw-layer') && !document.querySelector('[data-esc-layer]')) { vwBack(); return; }
|
|
344
355
|
if (document.querySelector('[data-esc-layer]') || chatPage()) return; // a layer open over the dialog (a viewer menu, Present) closes itself first
|
|
345
356
|
if ($('#dlg').classList.contains('full')) { setFull(false); e.stopImmediatePropagation(); return; }
|
|
346
357
|
closeDlg();
|
|
@@ -376,7 +387,8 @@ function quietNote() {
|
|
|
376
387
|
set(); new MutationObserver(set).observe(n, { childList: true, characterData: true, subtree: true });
|
|
377
388
|
}
|
|
378
389
|
const turnAgent = (h) => `<div class="turn a"><i class="av">${AI}</i><div class="tc">${h}</div></div>`;
|
|
379
|
-
|
|
390
|
+
// the PM's words, paste tags gone, line breaks kept; the files a message names (premium-chat-attach) show as chips above the words
|
|
391
|
+
const turnUser = (t) => { const a = splitFiles(t); return `<div class="turn u"><div class="ub">${filesHtml(a.files)}${a.text ? userHtml(a.text) : ''}</div></div>`; };
|
|
380
392
|
export function threadHtml(th) {
|
|
381
393
|
return (th.turns || []).map((t) => turnUser(t.q) + (t.state === 'answered'
|
|
382
394
|
? turnAgent(`<p class="agtag">Earlier read-only answer</p>${mdHtml(t.a)}`)
|
|
@@ -456,6 +468,16 @@ $('#dBody').addEventListener('click', async (e) => {
|
|
|
456
468
|
setTimeout(() => loadThread(S.key), 500);
|
|
457
469
|
});
|
|
458
470
|
/* a file path in Claude's words opens the file read-only as a viewer tab beside the conversation; on a phone the Detail side shows it */
|
|
471
|
+
/* premium-chat-attach: an attached file's chip in the PM's bubble opens it in the viewer; a file dropped on the conversation side is attached */
|
|
472
|
+
$('#dBody').addEventListener('click', (e) => {
|
|
473
|
+
const a = e.target.closest('[data-att]'); if (!a) return;
|
|
474
|
+
e.preventDefault(); openAttachment(a.dataset.att);
|
|
475
|
+
if (innerWidth < 1000) setTab('out');
|
|
476
|
+
});
|
|
477
|
+
const dragFiles = (e) => !!(S.key && e.dataTransfer && [...(e.dataTransfer.types || [])].includes('Files'));
|
|
478
|
+
$('#dBody').addEventListener('dragover', (e) => { if (!dragFiles(e)) return; e.preventDefault(); e.dataTransfer.dropEffect = 'copy'; $('#dBody').classList.add('atdrop'); });
|
|
479
|
+
$('#dBody').addEventListener('dragleave', (e) => { if (!e.relatedTarget || !$('#dBody').contains(e.relatedTarget)) $('#dBody').classList.remove('atdrop'); });
|
|
480
|
+
$('#dBody').addEventListener('drop', (e) => { $('#dBody').classList.remove('atdrop'); if (!dragFiles(e)) return; e.preventDefault(); dropFiles(e.dataTransfer.files); });
|
|
459
481
|
$('#dBody').addEventListener('click', (e) => {
|
|
460
482
|
const f = e.target.closest('[data-file]'); if (!f) return;
|
|
461
483
|
e.preventDefault();
|
|
@@ -473,9 +495,9 @@ const onWebLink = (e) => {
|
|
|
473
495
|
};
|
|
474
496
|
$('#dBody').addEventListener('click', onWebLink); $('#dOut').addEventListener('click', onWebLink);
|
|
475
497
|
/* /goal (slice 2): a chip sends its answer; Start and Cancel are the PM's presses on the goal card; Change something hands the box back. */
|
|
476
|
-
async function sendText(key, text) {
|
|
498
|
+
async function sendText(key, text, files) {
|
|
477
499
|
const go = $('#askGo'); if (go) go.disabled = true; $('#askNote').textContent = 'Sending.';
|
|
478
|
-
const res = await chatPost('ask', { key, text });
|
|
500
|
+
const res = await chatPost('ask', files && files.length ? { key, text, files } : { key, text });
|
|
479
501
|
if (go) go.disabled = false;
|
|
480
502
|
if (!res || res.ok !== true) { $('#askNote').textContent = (res && res.error) || 'The message was not sent.'; return false; }
|
|
481
503
|
$('#askNote').textContent = res.started ? 'Claude is starting a session for this.' : 'Sent.';
|
|
@@ -531,8 +553,10 @@ $('#dBody').addEventListener('submit', async (e) => {
|
|
|
531
553
|
inp.value = ''; $('#askNote').textContent = 'Sent.'; drawSlash(); setTimeout(() => loadSid(id), 400); return;
|
|
532
554
|
}
|
|
533
555
|
if (!key) { $('#askNote').textContent = 'This row has no conversation, so the message was not sent.'; return; }
|
|
534
|
-
|
|
535
|
-
if (
|
|
556
|
+
const files = attachNames();
|
|
557
|
+
if (files === null) { $('#askNote').textContent = 'A file is still saving. Send when its chip shows its size.'; return; }
|
|
558
|
+
if (!text && !files.length) { $('#askNote').textContent = 'Write a message for Claude.'; return; }
|
|
559
|
+
if (await sendText(key, text, files)) { inp.value = ''; inp.placeholder = 'Message Claude, or type /'; clearAttach(); drawSlash(); growAsk(); }
|
|
536
560
|
});
|
|
537
561
|
|
|
538
562
|
/* ── the hero folds into the dock on scroll ─────────────────────────────────────────────────────────────── */
|
|
@@ -1044,7 +1068,7 @@ export async function openSettings() {
|
|
|
1044
1068
|
* any other session its transcript. The writes are a page press each: a message or a key (POST /api/session/say|keys), Stop (/api/session/remove)
|
|
1045
1069
|
* and an answer to a run's question (/api/runs/answer). The Agent sessions popup this replaces is gone; the ⋯ menu's Sessions opens this. */
|
|
1046
1070
|
const R = { rows: [], goals: {}, model: null, sel: null, shut: [], showAll: false, showIdle: false, ending: null, timer: null, asks: {}, ask: null, busy: false, slow: null, err: '', sidTimer: null,
|
|
1047
|
-
railMin: store.get('pmos.srl.rail') === 'min', viewMin: store.get('pmos.srl.view') === 'min' };
|
|
1071
|
+
railMin: store.get('pmos.srl.rail') === 'min', viewMin: store.get('pmos.srl.view') === 'min', autoMin: false };
|
|
1048
1072
|
const SRL_POLL = 3000, BADGE_POLL = 15000;
|
|
1049
1073
|
const desk = () => innerWidth >= 1000;
|
|
1050
1074
|
const railShowing = () => $('#dlg').classList.contains('on') && $('#dlg').classList.contains('srl-on') && ($('#dlg').classList.contains('full') ? desk() : $('#dlg').classList.contains('srl-open'));
|
|
@@ -1053,9 +1077,16 @@ function railMount() {
|
|
|
1053
1077
|
g.insertAdjacentHTML('afterbegin', `<aside class="srl" id="sRail" aria-label="Sessions"><div class="srl-hd"><b>Sessions</b><button type="button" class="srl-fold" id="srlFold" aria-label="Fold the list" title="Fold the list"><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></div><div class="srl-list" id="srlList"></div><div class="srl-lg" aria-hidden="true"><span><i class="sdot2 ready"></i>Ready</span><span><i class="sdot2 run"></i>Running</span><span><i class="sdot2 blk"></i>Maybe blocked</span></div></aside>`);
|
|
1054
1078
|
$('#dlg .dtools').insertAdjacentHTML('afterbegin', '<button type="button" class="stease" id="sTease" aria-haspopup="true" hidden><i class="sdot2" aria-hidden="true"></i><span>Sessions</span><em></em></button>');
|
|
1055
1079
|
const ot = $('#dOut .otop'); if (ot) ot.insertAdjacentHTML('afterbegin', '<button type="button" class="vfold" id="vFold" aria-label="Fold the viewer" title="Fold the viewer"><svg class="i" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="3"/><path d="M15 4v16"/></svg></button>');
|
|
1056
|
-
$('#srlFold').onclick = () => { R.railMin = !R.railMin; store.set('pmos.srl.rail', R.railMin ? 'min' : 'open'); railLayout(); };
|
|
1080
|
+
$('#srlFold').onclick = () => { if (R.autoMin) { R.autoMin = false; railLayout(); return; } R.railMin = !R.railMin; store.set('pmos.srl.rail', R.railMin ? 'min' : 'open'); railLayout(); }; // a list the viewer folded opens again; the PM's own fold is remembered
|
|
1057
1081
|
$('#vFold').onclick = () => { R.viewMin = !R.viewMin; store.set('pmos.srl.view', R.viewMin ? 'min' : 'open'); railLayout(); };
|
|
1058
|
-
$('#dOut').addEventListener('click', (e) => { if (R.viewMin && $('#dlg').classList.contains('full') && desk() && !e.target.closest('#vFold')) $('#vFold').click(); }); // the whole folded strip opens the viewer again
|
|
1082
|
+
$('#dOut').addEventListener('click', (e) => { if (R.viewMin && !chatPage() && $('#dlg').classList.contains('full') && desk() && !e.target.closest('#vFold')) $('#vFold').click(); }); // the whole folded strip opens the viewer again
|
|
1083
|
+
if (chatPage()) { // premium-chat-viewer: on the Chat page the viewer closes (and the head's Viewer pill opens it); on a phone Back returns to the conversation
|
|
1084
|
+
const v = $('#vFold'); v.innerHTML = '<svg class="i" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg>'; v.title = 'Close the viewer'; v.setAttribute('aria-label', v.title); v.onclick = () => vwShutPane();
|
|
1085
|
+
ot.insertAdjacentHTML('afterbegin', '<button type="button" class="vback" id="vBack"><svg class="i" viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg>Chat</button>');
|
|
1086
|
+
$('#vBack').onclick = () => vwBack();
|
|
1087
|
+
$('#sTease').insertAdjacentHTML('afterend', '<button type="button" class="stease vwpill" id="vwPill" hidden><svg class="i" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="3"/><path d="M15 4v16"/></svg><span>Viewer</span><em></em></button>');
|
|
1088
|
+
$('#vwPill').onclick = () => vwOpenPane();
|
|
1089
|
+
}
|
|
1059
1090
|
$('#sTease').onclick = () => {
|
|
1060
1091
|
if (desk()) { setFull(true); railLayout(); railRead(); return; }
|
|
1061
1092
|
$('#dlg').classList.toggle('srl-open'); railDraw(); if ($('#dlg').classList.contains('srl-open')) railRead();
|
|
@@ -1073,12 +1104,50 @@ function railMount() {
|
|
|
1073
1104
|
if (r) pickSession(r.dataset.sid);
|
|
1074
1105
|
};
|
|
1075
1106
|
}
|
|
1107
|
+
/* ── premium-chat-viewer: on the Chat page the viewer is closed until something opens in it (V1, V3, V5) ──────────────────────────────────
|
|
1108
|
+
* Desktop: the class vw-shut takes the viewer's column away, and opening it folds the session list for the time it is open (R.autoMin; the PM's
|
|
1109
|
+
* own fold stays as it was). Phone: vw-layer puts the viewer over the whole page with a Back button. The head's Viewer pill, with the count of
|
|
1110
|
+
* what the viewer holds, opens it again. In any other full-screen dialog an open unfolds a folded viewer (V4). */
|
|
1111
|
+
function vwPill() {
|
|
1112
|
+
const b = $('#vwPill'); if (!b) return;
|
|
1113
|
+
const g = $('#dlg'), n = vwCount(), shut = desk() ? g.classList.contains('vw-shut') : !g.classList.contains('vw-layer');
|
|
1114
|
+
b.hidden = !n || !shut; $('em', b).textContent = String(n);
|
|
1115
|
+
b.setAttribute('aria-label', 'Show the viewer, ' + n + (n === 1 ? ' item' : ' items')); b.title = 'Show the viewer';
|
|
1116
|
+
}
|
|
1117
|
+
function vwOpenPane(keepList) {
|
|
1118
|
+
if (!chatPage()) return;
|
|
1119
|
+
const g = $('#dlg');
|
|
1120
|
+
if (desk()) { if (g.classList.contains('vw-shut')) { g.classList.remove('vw-shut'); R.autoMin = !keepList && !R.railMin; railLayout(); } }
|
|
1121
|
+
else { g.classList.add('vw-layer'); document.body.classList.add('vwlayer'); }
|
|
1122
|
+
vwPill();
|
|
1123
|
+
}
|
|
1124
|
+
function vwShutPane() {
|
|
1125
|
+
if (!chatPage()) return;
|
|
1126
|
+
const g = $('#dlg'); g.classList.add('vw-shut'); g.classList.remove('vw-layer'); document.body.classList.remove('vwlayer');
|
|
1127
|
+
if (R.autoMin) { R.autoMin = false; railLayout(); }
|
|
1128
|
+
vwPill();
|
|
1129
|
+
}
|
|
1130
|
+
function vwBack() {
|
|
1131
|
+
const g = $('#dlg'); if (!g.classList.contains('vw-layer')) return;
|
|
1132
|
+
g.classList.remove('vw-layer'); document.body.classList.remove('vwlayer'); vwPill();
|
|
1133
|
+
const a = $('#askIn'); if (a && desk()) a.focus();
|
|
1134
|
+
}
|
|
1135
|
+
vwOn((kind) => {
|
|
1136
|
+
if (kind === 'open') {
|
|
1137
|
+
if (chatPage()) vwOpenPane();
|
|
1138
|
+
else if (R.viewMin && desk() && $('#dlg').classList.contains('full')) { R.viewMin = false; store.set('pmos.srl.view', 'open'); railLayout(); } // a press never opens a tab nobody can see
|
|
1139
|
+
}
|
|
1140
|
+
if (kind === 'empty' && chatPage()) vwShutPane();
|
|
1141
|
+
vwPill();
|
|
1142
|
+
});
|
|
1143
|
+
addEventListener('resize', () => { if (chatPage()) { if (desk()) { $('#dlg').classList.remove('vw-layer'); document.body.classList.remove('vwlayer'); } vwPill(); } });
|
|
1076
1144
|
function railLayout() {
|
|
1077
1145
|
const d = $('#dlg');
|
|
1078
|
-
|
|
1146
|
+
const min = R.railMin || R.autoMin;
|
|
1147
|
+
d.classList.toggle('srl-min', min); d.classList.toggle('vw-min', R.viewMin && !chatPage());
|
|
1079
1148
|
const f = $('#srlFold'), v = $('#vFold');
|
|
1080
|
-
if (f) { f.title =
|
|
1081
|
-
if (v) { v.title = R.viewMin ? 'Open the viewer' : 'Fold the viewer'; v.setAttribute('aria-label', v.title); v.setAttribute('aria-pressed', String(R.viewMin)); }
|
|
1149
|
+
if (f) { f.title = min ? 'Open the list' : 'Fold the list'; f.setAttribute('aria-label', f.title); f.setAttribute('aria-pressed', String(min)); }
|
|
1150
|
+
if (v && !chatPage()) { v.title = R.viewMin ? 'Open the viewer' : 'Fold the viewer'; v.setAttribute('aria-label', v.title); v.setAttribute('aria-pressed', String(R.viewMin)); }
|
|
1082
1151
|
}
|
|
1083
1152
|
/* premium-session-end: End from the list. The same POST /api/session/remove as the viewer's Stop; an idle row ends at once, any other row asked
|
|
1084
1153
|
* first (R.ending). "End all idle" ends only the folded idle shells, never a goal or a session that needs the PM. A session that has not exited
|
|
@@ -1136,8 +1205,11 @@ function pickSession(id) {
|
|
|
1136
1205
|
const st = $('#dBody .stream'); if (st) clearHtml(st);
|
|
1137
1206
|
$('#askF').hidden = !!r.headless; $('#askIn').value = ''; $('#askIn').placeholder = r.key ? 'Message Claude, or type /' : 'Message this session';
|
|
1138
1207
|
if (r.key) { S.sid = null; S.key = r.key; loadThread(r.key); } else { S.key = null; S.sid = id; loadSid(id); }
|
|
1208
|
+
syncAttach();
|
|
1139
1209
|
sessionCard(r); railDraw();
|
|
1210
|
+
if (!r.key && desk()) vwOpenPane(true); // a session with no conversation of its own: its facts and Stop are in the viewer; the list the PM just used stays open
|
|
1140
1211
|
if (!desk()) setTab('chat');
|
|
1212
|
+
vwPill();
|
|
1141
1213
|
const go = $('#askIn'); if (go && !r.headless && desk()) go.focus();
|
|
1142
1214
|
}
|
|
1143
1215
|
async function loadSid(id) {
|
|
@@ -1153,7 +1225,7 @@ async function loadSid(id) {
|
|
|
1153
1225
|
}
|
|
1154
1226
|
/* the viewer for a session the list opened: its facts, the question a run asks, and Stop (asks first; says so when it has not exited yet) */
|
|
1155
1227
|
async function sessionCard(r) {
|
|
1156
|
-
vwReset(); $('#oLab').textContent = 'Session';
|
|
1228
|
+
delete $('#oMain').dataset.empty; vwReset(); $('#oLab').textContent = 'Session';
|
|
1157
1229
|
if (!r) { $('#oMain').innerHTML = '<article class="paper doc"><p class="note">This session has ended. Pick another from the list.</p></article>'; return; }
|
|
1158
1230
|
const runs = await pmGet('/api/runs').catch(() => null); R.asks = {};
|
|
1159
1231
|
if (runs && runs.ok && runs.cards) for (const [k, c] of Object.entries(runs.cards)) if (c && c.state === 'asking' && c.ask && c.ask.q && Array.isArray(c.ask.options) && c.ask.options.length) R.asks[k] = { request: c.asked || c.ask.id, q: c.ask.q, options: c.ask.options };
|
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
* vwOpen({ id, title, icon?, html | render(el), wire?(el) }) · vwClose(id) · vwShow(id | 'main') · vwReset() (openDlg calls it)
|
|
6
6
|
* vwStyle(name) loads pm/premium-vw-<name>.css once, so each view keeps its rules out of the shared premium.css.
|
|
7
7
|
* vwConfirm(el, { text, yes, no }) puts a confirm card at the top of a view's pane and resolves true or false.
|
|
8
|
-
* The contract for views is /mnt/project-files/premium-viewer-build/frame-contract.md.
|
|
8
|
+
* The contract for views is /mnt/project-files/premium-viewer-build/frame-contract.md.
|
|
9
|
+
* premium-chat-viewer: #oMain with data-empty="1" holds only a placeholder note, so its tab is not drawn and closing the last other tab empties
|
|
10
|
+
* the viewer. vwOn(fn) hears fn('open', id), fn('show', id) and fn('empty'): the Chat page opens and closes its viewer on them. Tabs that do not
|
|
11
|
+
* fit fold, oldest first, into a "+N" button that lists them; the current tab always shows. */
|
|
9
12
|
const MAX = 4;
|
|
10
13
|
const IC = {
|
|
11
14
|
doc: 'M6 3h9l4 4v14H6zM14 3v5h5M9 12h7M9 16h5', cal: 'M3.5 5h17v15h-17zM3.5 10h17M8 3v4M16 3v4', notes: 'M6 3h9l4 4v14H6zM14 3v5h5M9 12h7M9 16h5',
|
|
@@ -15,6 +18,13 @@ const svg = (k) => `<svg class="i" viewBox="0 0 24 24"><path d="${IC[k] || IC.do
|
|
|
15
18
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
16
19
|
const V = { items: [], on: 'main' };
|
|
17
20
|
const q = (s) => document.querySelector(s);
|
|
21
|
+
const subs = [];
|
|
22
|
+
/** fn(kind, id): 'open' when a tab opens or is opened again, 'show' when the current tab changes, 'empty' when nothing is left to show. */
|
|
23
|
+
export function vwOn(fn) { subs.push(fn); }
|
|
24
|
+
const emit = (kind, id) => subs.forEach((f) => { try { f(kind, id); } catch { /* a listener's fault stays its own */ } });
|
|
25
|
+
const mainReal = () => { const m = q('#oMain'); return !!m && m.dataset.empty !== '1'; };
|
|
26
|
+
/** What the viewer holds: its tabs, counting the dialog's own detail only when it is more than a placeholder. */
|
|
27
|
+
export const vwCount = () => V.items.length + (mainReal() ? 1 : 0);
|
|
18
28
|
|
|
19
29
|
function strip() {
|
|
20
30
|
let t = q('#vTabs');
|
|
@@ -27,26 +37,65 @@ function draw() {
|
|
|
27
37
|
t.hidden = !many; if (lab) lab.hidden = many;
|
|
28
38
|
if (!many) { t.innerHTML = ''; return; }
|
|
29
39
|
const tab = (id, title, icon, x) => `<div class="vtab" role="tab" tabindex="${V.on === id ? 0 : -1}" aria-selected="${V.on === id}" data-vw="${esc(id)}">${svg(icon)}<span>${esc(title)}</span>${x ? `<button type="button" class="vx" data-vx="${esc(id)}" aria-label="Close ${esc(title)}" title="Close"><svg class="i" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button>` : ''}</div>`;
|
|
30
|
-
t.innerHTML = tab('main', (lab && lab.textContent) || 'Detail', 'doc', false) + V.items.map((it) => tab(it.id, it.title, it.icon, true)).join('');
|
|
40
|
+
t.innerHTML = (mainReal() ? tab('main', (lab && lab.textContent) || 'Detail', 'doc', false) : '') + V.items.map((it) => tab(it.id, it.title, it.icon, true)).join('');
|
|
41
|
+
fit(t);
|
|
42
|
+
}
|
|
43
|
+
/* Tabs that do not fit: the oldest that are not current hide, and a "+N" button lists them (premium-chat-viewer V6). */
|
|
44
|
+
function fit(t) {
|
|
45
|
+
const old = t.querySelector('.vmore'); if (old) old.remove();
|
|
46
|
+
const tabs = [...t.querySelectorAll('.vtab')]; tabs.forEach((x) => { x.hidden = false; });
|
|
47
|
+
if (!t.clientWidth || t.scrollWidth <= t.clientWidth + 1) return;
|
|
48
|
+
const more = document.createElement('button'); more.type = 'button'; more.className = 'vmore'; more.setAttribute('aria-haspopup', 'true'); more.setAttribute('aria-expanded', 'false');
|
|
49
|
+
t.append(more);
|
|
50
|
+
const hid = [];
|
|
51
|
+
for (const x of tabs) {
|
|
52
|
+
if (t.scrollWidth <= t.clientWidth + 1) break;
|
|
53
|
+
if (x.getAttribute('aria-selected') === 'true') continue;
|
|
54
|
+
x.hidden = true; hid.push(x.dataset.vw); more.textContent = '+' + hid.length;
|
|
55
|
+
}
|
|
56
|
+
if (!hid.length) { more.remove(); return; }
|
|
57
|
+
more.dataset.ids = JSON.stringify(hid);
|
|
58
|
+
more.setAttribute('aria-label', hid.length + ' more open ' + (hid.length === 1 ? 'tab' : 'tabs')); more.title = more.getAttribute('aria-label');
|
|
59
|
+
}
|
|
60
|
+
function moreMenu(b) {
|
|
61
|
+
const top = q('#dOut .otop'); let m = q('#vMore');
|
|
62
|
+
if (m) { m.remove(); b.setAttribute('aria-expanded', 'false'); return; }
|
|
63
|
+
const ids = JSON.parse(b.dataset.ids || '[]');
|
|
64
|
+
m = document.createElement('div'); m.id = 'vMore'; m.className = 'vmenu'; m.setAttribute('role', 'menu'); m.dataset.escLayer = '1';
|
|
65
|
+
m.innerHTML = ids.map((id) => { const it = V.items.find((x) => x.id === id); const title = it ? it.title : ((q('#oLab') || {}).textContent || 'Detail'); return `<button type="button" role="menuitem" data-vw="${esc(id)}">${svg(it ? it.icon : 'doc')}<span>${esc(title)}</span></button>`; }).join('');
|
|
66
|
+
m.onclick = (e) => { const x = e.target.closest('[data-vw]'); if (!x) return; m.remove(); vwShow(x.dataset.vw); };
|
|
67
|
+
m.onkeydown = (e) => { if (e.key === 'Escape') { e.stopPropagation(); m.remove(); b.focus(); } };
|
|
68
|
+
top.append(m); b.setAttribute('aria-expanded', 'true');
|
|
69
|
+
const f = m.querySelector('button'); if (f) f.focus();
|
|
70
|
+
setTimeout(() => document.addEventListener('click', function off(e) { if (!e.target.closest('#vMore,.vmore')) { const k = q('#vMore'); if (k) k.remove(); } document.removeEventListener('click', off); }), 0);
|
|
71
|
+
}
|
|
72
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
73
|
+
let ro = null;
|
|
74
|
+
const watch = () => { const t = q('#vTabs'); if (!t || ro) return; ro = new ResizeObserver(() => { if (!t.hidden) fit(t); }); ro.observe(t); };
|
|
75
|
+
if (typeof document !== 'undefined') document.addEventListener('DOMContentLoaded', watch);
|
|
76
|
+
setTimeout(watch, 0);
|
|
77
|
+
vwOn(() => watch());
|
|
31
78
|
}
|
|
32
79
|
function pane(id) { return id === 'main' ? q('#oMain') : document.querySelector(`#dOut .obody.vw[data-vw="${CSS.escape(id)}"]`); }
|
|
33
80
|
export function vwShow(id) {
|
|
34
81
|
if (id !== 'main' && !V.items.some((x) => x.id === id)) id = 'main';
|
|
82
|
+
if (id === 'main' && !mainReal() && V.items.length) id = V.items[V.items.length - 1].id; // the placeholder is never a tab of its own
|
|
35
83
|
V.on = id;
|
|
36
84
|
const m = q('#oMain'); if (m) m.hidden = id !== 'main';
|
|
37
85
|
document.querySelectorAll('#dOut .obody.vw').forEach((p) => { p.hidden = p.dataset.vw !== id; });
|
|
38
86
|
draw();
|
|
39
87
|
const p = q('#dOut'); if (p) p.scrollTop = 0;
|
|
88
|
+
emit('show', id);
|
|
40
89
|
}
|
|
41
90
|
export function vwOpen(it) {
|
|
42
91
|
if (!it || !it.id) return null;
|
|
43
92
|
const was = V.items.find((x) => x.id === it.id);
|
|
44
|
-
if (was) { Object.assign(was, it); fill(was); vwShow(it.id); return pane(it.id); }
|
|
93
|
+
if (was) { Object.assign(was, it); fill(was); vwShow(it.id); emit('open', it.id); return pane(it.id); }
|
|
45
94
|
if (V.items.length >= MAX) vwClose(V.items[0].id, true);
|
|
46
95
|
const el = document.createElement('div'); el.className = 'obody vw'; el.dataset.vw = it.id; el.setAttribute('role', 'tabpanel');
|
|
47
96
|
const at = q('#dOut .tabhint'); if (at) at.before(el); else q('#dOut').append(el);
|
|
48
97
|
const rec = { id: it.id, title: it.title || 'Item', icon: it.icon || 'doc', html: it.html, render: it.render, wire: it.wire };
|
|
49
|
-
V.items.push(rec); fill(rec); vwShow(it.id);
|
|
98
|
+
V.items.push(rec); fill(rec); vwShow(it.id); emit('open', it.id);
|
|
50
99
|
return el;
|
|
51
100
|
}
|
|
52
101
|
function fill(rec) {
|
|
@@ -59,6 +108,7 @@ export function vwClose(id, quiet) {
|
|
|
59
108
|
V.items.splice(i, 1); const p = pane(id); if (p) p.remove();
|
|
60
109
|
if (quiet) return;
|
|
61
110
|
if (V.on === id) vwShow(V.items[i - 1] ? V.items[i - 1].id : V.items[i] ? V.items[i].id : 'main'); else draw();
|
|
111
|
+
if (!V.items.length && !mainReal()) emit('empty');
|
|
62
112
|
}
|
|
63
113
|
export function vwReset() {
|
|
64
114
|
V.items.forEach((it) => { const p = pane(it.id); if (p) p.remove(); });
|
|
@@ -68,11 +118,12 @@ export function vwReset() {
|
|
|
68
118
|
}
|
|
69
119
|
export const vwState = () => ({ on: V.on, ids: V.items.map((x) => x.id) });
|
|
70
120
|
function onTab(e) {
|
|
121
|
+
const mb = e.target.closest('.vmore'); if (mb) { e.stopPropagation(); moreMenu(mb); return; }
|
|
71
122
|
const x = e.target.closest('[data-vx]'); if (x) { e.stopPropagation(); vwClose(x.dataset.vx); return; }
|
|
72
123
|
const t = e.target.closest('[data-vw]'); if (t) vwShow(t.dataset.vw);
|
|
73
124
|
}
|
|
74
125
|
function onKey(e) {
|
|
75
|
-
const tabs = [...document.querySelectorAll('#vTabs .vtab')], i = tabs.indexOf(document.activeElement); if (i < 0) return;
|
|
126
|
+
const tabs = [...document.querySelectorAll('#vTabs .vtab:not([hidden])')], i = tabs.indexOf(document.activeElement); if (i < 0) return;
|
|
76
127
|
let n = -1;
|
|
77
128
|
if (e.key === 'ArrowRight') n = (i + 1) % tabs.length; else if (e.key === 'ArrowLeft') n = (i - 1 + tabs.length) % tabs.length;
|
|
78
129
|
else if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); vwShow(tabs[i].dataset.vw); return; }
|
|
@@ -94,4 +145,4 @@ export function vwConfirm(el, o) {
|
|
|
94
145
|
el.prepend(c); const f = c.querySelector('[data-a="1"]'); if (f) f.focus();
|
|
95
146
|
});
|
|
96
147
|
}
|
|
97
|
-
if (typeof window !== 'undefined') window.__premiumViewer = { vwOpen, vwClose, vwShow, vwReset, vwState, vwStyle, vwConfirm };
|
|
148
|
+
if (typeof window !== 'undefined') window.__premiumViewer = { vwOpen, vwClose, vwShow, vwReset, vwState, vwStyle, vwConfirm, vwCount };
|
|
@@ -1729,14 +1729,16 @@ button.m3-stc{min-height:44px;margin:-7px 0}button.m3-stc:hover{background:var(-
|
|
|
1729
1729
|
.rp-sc{display:flex;justify-content:space-between;font:500 var(--t-micro) var(--mono);color:var(--ink-3);margin-top:6px}
|
|
1730
1730
|
.rpv .m3-lgd .ring{width:11px;height:11px;border-radius:50%;background:none;box-shadow:inset 0 0 0 1.5px var(--ember-ink);vertical-align:-1px}
|
|
1731
1731
|
.rpv .m3-now{margin:0 0 10px}.rpv .m3-now .chp{margin-left:auto}.rpv .m3-now .chp~.mtg-b{margin-left:0}
|
|
1732
|
-
.rp-g{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr);gap:10px;align-items:
|
|
1732
|
+
.rp-g{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr);gap:10px;align-items:stretch;margin-bottom:10px}
|
|
1733
1733
|
.rp-box{padding:14px 16px;border-radius:14px;box-shadow:inset 0 0 0 1.5px var(--b3);margin-bottom:10px;min-width:0}.rp-g .rp-box{margin-bottom:0}
|
|
1734
1734
|
.rp-cap{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:8px}.rp-cap .note{margin:0 0 0 auto}
|
|
1735
|
-
.rp-none{padding:36px 12px;text-align:center;border-radius:14px;background:var(--well)}
|
|
1735
|
+
.rp-none{padding:36px 12px;text-align:center;border-radius:14px;background:var(--well);max-width:none;margin:0}
|
|
1736
1736
|
.rp-ts{display:flex;flex-wrap:wrap;gap:4px;margin-top:8px}.rp-ts .mtg-b{font-family:var(--mono)}.rp-ts .mtg-b[aria-pressed="true"]{box-shadow:inset 0 0 0 1.5px var(--ink);color:var(--ink)}
|
|
1737
|
-
|
|
1737
|
+
/* the conversation is as tall as the On screen card beside it (contain:size keeps its own length out of the row height), never under 460 px; its list scrolls */
|
|
1738
|
+
.rp-cv{display:flex;flex-direction:column;contain:size;min-height:460px}
|
|
1738
1739
|
.rp-cvh .seg2 .mtg-b{min-width:44px;justify-content:center}.rp-cvh{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding-bottom:8px;border-bottom:1px solid var(--hair)}.rp-cvh .rp-cap{margin:0}
|
|
1739
|
-
|
|
1740
|
+
/* a block list, not a grid: a grid squeezed into the scroll box drew long lines over the next rows (Wawan, 2026-10-21); each row is as tall as its words */
|
|
1741
|
+
.rp-cv .m3-ftr{display:block;flex:1;overflow:auto;min-height:160px;margin:6px 0}.rp-cv .m3-ftr>*{width:100%}.rp-cv .m3-ftr>*+*{margin-top:4px}
|
|
1740
1742
|
.rp-cv .m3-ln{grid-template-columns:48px 64px minmax(0,1fr)}.m3-ln.pm b{color:var(--ink-2)}.m3-ln.pm.fut,.rp-cv .m3-ln.fut{opacity:.55}
|
|
1741
1743
|
.rp-kt{font-style:normal;font-size:var(--t-micro);font-weight:600;color:var(--ember-ink);margin-right:6px;text-transform:uppercase;letter-spacing:.04em}
|
|
1742
1744
|
.rp-q{display:flex;align-items:center;gap:6px;min-height:44px;padding:0 12px;border-radius:12px;background:var(--well);color:var(--ink-3)}.rp-q input{flex:1;min-width:0;min-height:44px;border:0;background:none;color:var(--ink);font:inherit}.rp-q input:focus-visible{outline:none}.rp-q:focus-within{box-shadow:inset 0 0 0 2px var(--ink)}
|
|
@@ -1746,7 +1748,7 @@ button.m3-stc{min-height:44px;margin:-7px 0}button.m3-stc:hover{background:var(-
|
|
|
1746
1748
|
.rp-kc .need{box-shadow:inset 3px 0 0 var(--ember)}
|
|
1747
1749
|
.rp-tg{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px;font-size:var(--t-small);color:var(--ink-3)}.rp-tg .warn{color:var(--ember-ink)}
|
|
1748
1750
|
@media (hover:hover){.rp-mk:hover>span{background:var(--well)}}
|
|
1749
|
-
@media (max-width:1000px){.rp-g,.rp-kc{grid-template-columns:minmax(0,1fr)}.rp-cv{
|
|
1751
|
+
@media (max-width:1000px){.rp-g,.rp-kc{grid-template-columns:minmax(0,1fr)}.rp-cv{contain:none;min-height:0}.rp-cv .m3-ftr{max-height:420px}.rp-clk{justify-items:start}}
|
|
1750
1752
|
@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)}}
|
|
1751
1753
|
|
|
1752
1754
|
/* ---- the premium Welcome page and the first-Briefing card (initiative premium-welcome): the approved mockup's rules (prototype/premium-welcome) ---- */
|
|
@@ -2625,3 +2627,79 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
2625
2627
|
.chatpg.dfocus .dlg.on{height:100%;border-radius:0;padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))}
|
|
2626
2628
|
}
|
|
2627
2629
|
@media (max-width:999px) and (prefers-reduced-motion:reduce){.chatpg .rail{transition:none}}
|
|
2630
|
+
/* premium-chat-attach: the + at the left inside the message box, its menu, the attachment chips, a drop on the conversation, an attachment in the viewer */
|
|
2631
|
+
.askbar:has(.askplus:not([hidden])) textarea{padding-left:50px}
|
|
2632
|
+
.askbar .askplus{position:absolute;left:3px;bottom:5px;z-index:2;width:44px;height:44px;min-height:44px;border-radius:50%;background:transparent;color:var(--ink-2)}
|
|
2633
|
+
.askbar .askplus[hidden]{display:none}
|
|
2634
|
+
.askbar .askplus:hover,.askbar .askplus.on{background:var(--card-solid);color:var(--ink)}
|
|
2635
|
+
.askbar .askplus svg{width:20px;height:20px}
|
|
2636
|
+
.plusm{position:absolute;left:0;bottom:calc(100% - 6px);z-index:3;min-width:min(290px,100%);background:var(--card-solid);border-radius:var(--r-in);box-shadow:var(--card-shadow);padding:6px;display:grid;gap:2px}
|
|
2637
|
+
.plusm[hidden]{display:none}
|
|
2638
|
+
.askbar .plusm>button{display:flex;align-items:center;gap:10px;width:auto;height:auto;min-height:44px;padding:8px 12px;border-radius:12px;background:transparent;color:var(--ink);text-align:left;place-items:initial}
|
|
2639
|
+
.askbar .plusm>button:hover,.askbar .plusm>button:focus-visible{background:var(--well);outline:0}
|
|
2640
|
+
.askbar .plusm>button svg{width:18px;height:18px;flex:none}
|
|
2641
|
+
.plusm span{font-weight:500}
|
|
2642
|
+
.plusm em{margin-left:auto;padding-left:12px;font-style:normal;font-size:var(--fs-1);color:var(--ink-3)}
|
|
2643
|
+
.atrow{flex:1 0 100%;display:flex;gap:6px;flex-wrap:wrap;min-width:0}
|
|
2644
|
+
.atrow[hidden]{display:none}
|
|
2645
|
+
.atc{display:inline-flex;align-items:center;gap:8px;max-width:min(240px,100%);min-width:0;padding:4px 4px 4px 4px;border-radius:12px;background:var(--well);color:var(--ink);font-size:var(--fs-2);text-align:left}
|
|
2646
|
+
.atc.up{opacity:.7}
|
|
2647
|
+
.ath{width:36px;height:36px;border-radius:8px;flex:none;object-fit:cover;background:var(--card-solid)}
|
|
2648
|
+
.atx{display:grid;place-items:center;font-size:var(--fs-1);font-weight:600;letter-spacing:.04em;color:var(--ink-3)}
|
|
2649
|
+
.atn{display:grid;min-width:0}
|
|
2650
|
+
.atn b{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
2651
|
+
.atn em{font-style:normal;font-size:var(--fs-1);color:var(--ink-3)}
|
|
2652
|
+
.askbar .atx-rm{width:44px;height:44px;min-height:44px;margin:-4px -4px -4px -8px;flex:none;border-radius:50%;background:radial-gradient(circle,var(--card-solid) 13px,transparent 14px);color:var(--ink-2);font-size:var(--fs-4);line-height:1}
|
|
2653
|
+
.atrow.sent{margin:0 0 6px}
|
|
2654
|
+
.atrow.sent .atc{background:var(--card-solid);padding-right:10px;cursor:pointer}
|
|
2655
|
+
.atrow.sent .atc:focus-visible{outline:0;box-shadow:0 0 0 2px var(--b3)}
|
|
2656
|
+
@media (max-width:999px){.askbar .atrow{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}.askbar .atc{flex:none;max-width:200px}}
|
|
2657
|
+
#dBody.atdrop{outline:2px dashed var(--b3);outline-offset:-8px;border-radius:var(--r-in)}
|
|
2658
|
+
.atfile .atview{display:block;max-width:100%;height:auto;margin:8px auto;border-radius:8px}
|
|
2659
|
+
.atfile .atpdf{display:block;width:100%;height:max(420px,calc(100dvh - 260px));border:1px solid var(--hair);border-radius:8px}
|
|
2660
|
+
@media (pointer:coarse){.plusm em{display:none}}
|
|
2661
|
+
|
|
2662
|
+
/* ── premium-chat-viewer: the Chat page's viewer is closed until something opens in it. Desktop: vw-shut takes its column away and the
|
|
2663
|
+
conversation is centred; the head's Viewer pill opens it again. Phone: no Detail / Conversation switch; vw-layer puts the viewer over the
|
|
2664
|
+
whole page with a Back button, and the rail steps aside. Tabs that do not fit fold into "+N" (premium-viewer.js). ── */
|
|
2665
|
+
.vmore{flex:none;height:34px;min-width:44px;padding:0 12px;border-radius:var(--r-chip);background:var(--card-solid);font:600 var(--fs-2) var(--mono);color:var(--ink);box-shadow:var(--card-shadow)}
|
|
2666
|
+
.vmore:hover{background:var(--card)}
|
|
2667
|
+
.otop{position:relative}
|
|
2668
|
+
.vmenu{position:absolute;right:8px;top:calc(100% + 4px);z-index:5;min-width:220px;max-width:min(320px,calc(100% - 16px));padding:6px;border-radius:16px;background:var(--card-solid);border:1px solid var(--hair);box-shadow:var(--card-shadow);display:grid;gap:2px}
|
|
2669
|
+
.vmenu button{display:flex;align-items:center;gap:8px;min-height:40px;padding:6px 10px;border-radius:10px;font-size:var(--fs-2);text-align:left}
|
|
2670
|
+
.vmenu button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
2671
|
+
.vmenu button:hover,.vmenu button:focus-visible{background:var(--well)}
|
|
2672
|
+
.vmenu .i{width:14px;height:14px}
|
|
2673
|
+
.vback{display:none}
|
|
2674
|
+
.vwpill[hidden]{display:none}
|
|
2675
|
+
.vwpill .i{width:16px;height:16px}
|
|
2676
|
+
.chatpg .vwpill{order:-1}
|
|
2677
|
+
@media (min-width:1000px){
|
|
2678
|
+
.chatpg .dlg.full.vw-shut .p-out{display:none!important}
|
|
2679
|
+
.chatpg .dlg.full.srl-on.vw-shut .dgrid{grid-template-columns:var(--srw,232px) minmax(0,1fr)}
|
|
2680
|
+
.chatpg .dlg.full.vw-shut:not(.srl-on) .dgrid{grid-template-columns:minmax(0,1fr)}
|
|
2681
|
+
.chatpg .dlg.full.vw-shut #dBody{padding-inline:max(0px,calc((100% - 880px) / 2))}
|
|
2682
|
+
.chatpg .dlg.full #vFold{order:9;margin-left:auto}
|
|
2683
|
+
.chatpg .dlg.full .otop #vTabs{order:1}
|
|
2684
|
+
}
|
|
2685
|
+
@media (max-width:999px){
|
|
2686
|
+
.chatpg #dTabs{display:none!important}
|
|
2687
|
+
.chatpg .dlg .dgrid .p-work{display:flex!important}
|
|
2688
|
+
.chatpg .dlg .dgrid .p-out{display:none!important}
|
|
2689
|
+
.chatpg .dlg.vw-layer .dgrid .p-out{display:flex!important;position:absolute;inset:0;z-index:80;background:var(--card-solid);border-radius:0;padding:calc(10px + env(safe-area-inset-top,0px)) 12px calc(12px + env(safe-area-inset-bottom,0px));overflow:auto}
|
|
2690
|
+
.chatpg .dlg.vw-layer .otop{display:flex;align-items:center;gap:6px;position:sticky;top:0;z-index:2;background:var(--card-solid);padding-bottom:6px}
|
|
2691
|
+
.chatpg .dlg.vw-layer .otop #vTabs{order:1;flex:1}
|
|
2692
|
+
.chatpg .dlg.vw-layer #vBack{display:inline-flex;align-items:center;gap:4px;order:0;min-height:44px;padding:0 12px 0 6px;border-radius:14px;font-weight:600;font-size:var(--fs-3);flex:none}
|
|
2693
|
+
.chatpg .dlg.vw-layer #vBack:hover{background:var(--card)}
|
|
2694
|
+
.chatpg .dlg.vw-layer #vBack .i{width:18px;height:18px}
|
|
2695
|
+
.chatpg .dlg.vw-layer #oLab{order:1;flex:1}
|
|
2696
|
+
.chatpg .dlg.vw-layer .vtab{height:44px}
|
|
2697
|
+
.chatpg .dlg.vw-layer .vmore{height:44px}
|
|
2698
|
+
.chatpg.vwlayer .rail{transform:translate(-50%,calc(100% + 40px));opacity:0;pointer-events:none}
|
|
2699
|
+
.chatpg.vwlayer .dlg.on{height:var(--vvh,100%)}
|
|
2700
|
+
.chatpg .vwpill{height:44px}
|
|
2701
|
+
}
|
|
2702
|
+
@media (min-width:1000px){.chatpg .dlg.full.srl-on:not(.vw-shut) .dgrid{grid-template-columns:var(--srw,232px) minmax(380px,.9fr) minmax(0,1.1fr)}}
|
|
2703
|
+
.vtab[hidden]{display:none}
|
|
2704
|
+
@media (min-width:1000px){.chatpg .dlg.full .otop{flex-wrap:nowrap;align-items:center}.chatpg .dlg.full .otop #vTabs{flex:1 1 0;min-width:0}}
|
|
2705
|
+
.chatpg.vwlayer .dlg.on{border-radius:0}
|
package/workspace/server.js
CHANGED
|
@@ -4112,6 +4112,8 @@ function spawnSessionInner({ name, agent, cwd, ws, origin, initialInput, profile
|
|
|
4112
4112
|
* hooks post to this workspace (lib/routes-hooks.js, loopback only; the session token travels in the PMOS_SESSION env). */
|
|
4113
4113
|
// premium-chat-session U1: a chat panel's session gets the /goal Stop hook (lib/goal-chat.js) instead, so a started goal keeps going until done.
|
|
4114
4114
|
if (agent === 'claude' && /^chat:/.test(String(tag || ''))) argv.push('--settings', JSON.stringify(require('./lib/goal-chat.js').hookSettings(PORT)));
|
|
4115
|
+
// premium-chat-attach A6: the files the PM attaches live in the state folder, added as a directory so Claude reads them without a permission question
|
|
4116
|
+
if (agent === 'claude' && /^chat:/.test(String(tag || ''))) { const cf = require('./lib/chat-files.js').rootOf(STATE); try { fs.mkdirSync(cf, { recursive: true }); argv.push('--add-dir', cf); } catch { /* no folder: an attachment read asks first */ } }
|
|
4115
4117
|
// premium-chat-session L2: a chat keeps one Claude Code conversation id, so the session that replaces an ended one resumes it
|
|
4116
4118
|
if (agent === 'claude' && /^chat:/.test(String(tag || '')) && chatClaude && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(String(chatClaude.id || ''))) argv.push(chatClaude.resume ? '--resume' : '--session-id', String(chatClaude.id));
|
|
4117
4119
|
else if (process.env.PMOS_AGENT_HOOKS === '1' && agent === 'claude') argv.push('--settings', JSON.stringify(require('./lib/routes-hooks.js').settingsFor(PORT)));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Initiative premium-chat-attach: files and photos on a premium chat message (the store and the pure parts, and the + menu, chips, drop and paste on the real page and server).",
|
|
3
|
+
"modules": [
|
|
4
|
+
"premium-chat-attach.test.js"
|
|
5
|
+
],
|
|
6
|
+
"panels": [
|
|
7
|
+
"premium-chat-attach-test.js"
|
|
8
|
+
],
|
|
9
|
+
"seconds": {
|
|
10
|
+
"premium-chat-attach.test.js": 1,
|
|
11
|
+
"premium-chat-attach-test.js": 30
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "The Chat page's viewer opens when something opens in it: closed at rest, folds the session list when open, Viewer pill, a phone layer with Back, +N tabs; a folded viewer in a full-screen dialog unfolds on an open. Real server, 390 and 1280 wide.",
|
|
3
|
+
"seconds": {
|
|
4
|
+
"premium-chat-viewer-test.js": 45
|
|
5
|
+
},
|
|
6
|
+
"panels": [
|
|
7
|
+
"premium-chat-viewer-test.js"
|
|
8
|
+
]
|
|
9
|
+
}
|