create-pmos 0.375.0 → 0.376.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 +18 -18
- 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 +17 -0
- package/workspace/guide/briefing-premium.md +4 -4
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- 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-meeting.js +2 -2
- package/workspace/public/pm/premium-shell.js +67 -11
- package/workspace/public/pm/premium-viewer.js +57 -6
- package/workspace/public/pm/premium.css +52 -5
- package/workspace/test-lists/premium-chat-viewer.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.376.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -32,6 +32,23 @@
|
|
|
32
32
|
"audit"
|
|
33
33
|
],
|
|
34
34
|
"pmosChanges": [
|
|
35
|
+
{
|
|
36
|
+
"v": "0.376.0",
|
|
37
|
+
"at": "2026-10-21T07:00:19.034Z",
|
|
38
|
+
"f": 2,
|
|
39
|
+
"prs": [
|
|
40
|
+
{
|
|
41
|
+
"n": 984,
|
|
42
|
+
"t": "Replay conversation rows hold their words",
|
|
43
|
+
"s": "Replay conversation rows hold their words"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"n": 985,
|
|
47
|
+
"t": "Chat page viewer stays closed until something opens in it",
|
|
48
|
+
"s": "Chat page viewer stays closed until something opens in it"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
35
52
|
{
|
|
36
53
|
"v": "0.375.0",
|
|
37
54
|
"at": "2026-10-21T04:39:03.068Z",
|
|
@@ -304,23 +321,6 @@
|
|
|
304
321
|
"s": "Every row has an End button (×) on hover, on focus and always on touch screens."
|
|
305
322
|
}
|
|
306
323
|
]
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
"v": "0.356.0",
|
|
310
|
-
"at": "2026-10-20T09:37:44.880Z",
|
|
311
|
-
"f": 2,
|
|
312
|
-
"prs": [
|
|
313
|
-
{
|
|
314
|
-
"n": 955,
|
|
315
|
-
"t": "Full-screen chat is never blank when the viewer is folded",
|
|
316
|
-
"s": "The panel always shows something."
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
"n": 957,
|
|
320
|
-
"t": "A live premium chat stops blinking beside the viewer",
|
|
321
|
-
"s": "The conversation stays still."
|
|
322
|
-
}
|
|
323
|
-
]
|
|
324
324
|
}
|
|
325
325
|
]
|
|
326
326
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Eval calibration log"
|
|
4
4
|
description: "Append-only record of every PM override of an evaluator verdict."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-21T07:00:16Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Health budgets"
|
|
4
4
|
description: "Closed registry of health-budget anchors (D59), edited only by the PM."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-21T07:00:16Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Discoveries and friction log"
|
|
4
4
|
description: "Append-only record of what runs discovered and where the process rubbed."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-21T07:00:16Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -349,6 +349,34 @@ const RECORDER = () => {
|
|
|
349
349
|
ok('R12 with no initiative linked, Confirm all says so and writes nothing', await until(() => Rn.page.evaluate(() => /Link the note to an initiative first/.test(document.body.textContent))) && Rn.planPosts.length === 0);
|
|
350
350
|
await Rn.ctx.close();
|
|
351
351
|
|
|
352
|
+
/* R13 a long transcript (Wawan, 2026-10-21): each conversation row is as tall as its words, so no line draws over the next, under All and Key points, wide and on a phone */
|
|
353
|
+
const LONG = 'In active development. Okay. So IDP is one. This one I really, really have less kind of, kind of influence because now you are running it automation. I mean, you are running it yourself anyway, right? So I just receiving the information from you.';
|
|
354
|
+
const LR = { ...RICH, lines: Array.from({ length: 14 }, (_, i) => ({ i, t: 5000 + i * 15000, who: i % 3 ? 'You' : 'Dara', text: (i % 2 ? LONG : 'Short line ' + i) + (i % 4 === 1 ? ' ' + LONG : ''), ...(i % 2 ? { key: { k: 'decision', id: 'd1' } } : {}) })),
|
|
355
|
+
shots: Array.from({ length: 19 }, (_, i) => ({ t: 280000 + i * 1000, w: 10, h: 10, why: 'A slide' })) };
|
|
356
|
+
const shotDir13 = process.env.PMOS_SHOTS || '';
|
|
357
|
+
for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
|
|
358
|
+
const P = await open({ w, h, theme: th, replay: LR });
|
|
359
|
+
await press(P.page, 'replay'); await until(() => P.page.evaluate(() => !!document.querySelector('#rpLines .m3-ln')));
|
|
360
|
+
for (const tab of ['a', 'k']) {
|
|
361
|
+
await P.page.click(`#oMain [data-rp="tab"][data-v="${tab}"]`);
|
|
362
|
+
await P.page.click('#rpLines .m3-ln:nth-child(2)');
|
|
363
|
+
const r = await P.page.evaluate(() => {
|
|
364
|
+
const rows = [...document.querySelectorAll('#rpLines .m3-ln')];
|
|
365
|
+
const bad = [];
|
|
366
|
+
rows.forEach((b, i) => {
|
|
367
|
+
const box = b.getBoundingClientRect(), txt = b.querySelector('span').getBoundingClientRect();
|
|
368
|
+
if (txt.bottom > box.bottom + 0.5) bad.push('row ' + i + ' text spills ' + Math.round(txt.bottom - box.bottom) + ' px');
|
|
369
|
+
if (i && box.top < rows[i - 1].getBoundingClientRect().bottom - 0.5) bad.push('row ' + i + ' overlaps the one above');
|
|
370
|
+
});
|
|
371
|
+
return { n: rows.length, bad };
|
|
372
|
+
});
|
|
373
|
+
ok(`R13 at ${w} px (${th}), ${tab === 'a' ? 'All' : 'Key points'}: every row holds its words and none overlaps the next`, r.n > 0 && !r.bad.length, JSON.stringify(r));
|
|
374
|
+
if (tab === 'a') ok(`R13 at ${w} px (${th}) a long spoken line is shown whole, not cut`, await P.page.evaluate((t) => document.querySelector('#rl1').textContent.includes(t), LONG + ' ' + LONG));
|
|
375
|
+
if (shotDir13) await P.page.screenshot({ path: path.join(shotDir13, `replay-long-${tab}-${w}-${th}.png`) });
|
|
376
|
+
}
|
|
377
|
+
await P.ctx.close();
|
|
378
|
+
}
|
|
379
|
+
|
|
352
380
|
/* R8 Topic on material */
|
|
353
381
|
const Tp = await open({ topics: ['Capacity', 'Risks'] });
|
|
354
382
|
await reveal(Tp.page, '#mmAdd'); await Tp.page.click('#mmAdd'); await until(() => Tp.page.evaluate(() => /Roadmap/.test(document.querySelector('#mmSug').textContent)));
|
|
@@ -179,7 +179,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
179
179
|
const draw = await xp.evaluate(() => { const i = document.querySelector('.rail .ind'), r = document.querySelector('.rail'), d = document.querySelector('#dlg'); return { ind: getComputedStyle(i).display, rail: +getComputedStyle(r).zIndex, dlg: +getComputedStyle(d).zIndex }; });
|
|
180
180
|
ok('X1c on the Chat page no grey indicator sits under the Chat button, and the rail is above the dialog so its shadow does not grey the button', draw.ind === 'none' && draw.rail > draw.dlg, JSON.stringify(draw));
|
|
181
181
|
const lay = await until(() => xp.evaluate(() => { const d = document.querySelector('#dlg'), r = document.querySelector('#sRail'); if (!d.classList.contains('full') || !r || !r.offsetWidth || !document.querySelector('#srlList .srl-r')) return null; const o = { rail: Math.round(r.getBoundingClientRect().width), work: Math.round(document.querySelector('#dBody').getBoundingClientRect().width), out: Math.round(document.querySelector('#dOut').getBoundingClientRect().width) }; return o.out > 300 ? o : null; }), 8000) || (await xp.evaluate(() => ({ rail: document.querySelector('#sRail').getBoundingClientRect().width, work: document.querySelector('#dBody').getBoundingClientRect().width, out: document.querySelector('#dOut').getBoundingClientRect().width, cls: document.querySelector('#dlg').className, mode: document.querySelector('#dlg').dataset.mode, w: document.querySelector('#dlg').getBoundingClientRect().width })));
|
|
182
|
-
ok('X2 the Chat page opens the Briefing\'s conversation with
|
|
182
|
+
ok('X2 the Chat page opens the Briefing\'s conversation with the list and the conversation; the viewer is closed until something opens in it (premium-chat-viewer V1)', /Ask about the Briefing/.test(await xp.evaluate(() => document.querySelector('#dTitle').textContent)) && lay && lay.out === 0 && lay.rail > 150 && lay.work > 600 && /vw-shut/.test(lay.cls), JSON.stringify(lay));
|
|
183
183
|
const grpOf = () => xp.evaluate(() => [...document.querySelectorAll('#srlList .srl-g')].map((g) => g.querySelector('.srl-gh span').textContent + ':' + g.querySelectorAll('.srl-r').length + (g.querySelector('.srl-more') ? '+' + g.querySelector('.srl-more').textContent : '')));
|
|
184
184
|
const grp = (await until(async () => { const v = await grpOf(); return v.join('|') === 'Yours:1|Started by PMOS:1+1 more working on their own · Show' ? v : null; }, 8000)) || (await grpOf());
|
|
185
185
|
ok('X3 the list groups by who started each session, exited ones are gone, and PMOS runs that need nothing fold into one line', grp.join('|') === 'Yours:1|Started by PMOS:1+1 more working on their own · Show', grp.join('|'));
|
|
@@ -208,18 +208,16 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
208
208
|
await xp.click('#srlFold');
|
|
209
209
|
const folded = await until(() => xp.evaluate(() => { const w = document.querySelector('#sRail').getBoundingClientRect().width; return w > 0 && w < 70 ? Math.round(w) : 0; }), 4000);
|
|
210
210
|
ok('X12 the list folds to a strip of dots', folded > 0, String(folded));
|
|
211
|
-
await xp.click('#vFold');
|
|
212
|
-
const vf = await until(() => xp.evaluate(() =>
|
|
213
|
-
ok('X13 the viewer
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
await xp.mouse.click(strip.x, strip.y);
|
|
217
|
-
ok('X13b a press anywhere on the folded viewer strip opens the viewer again', !!(await until(() => xp.evaluate(() => document.querySelector('#dOut').getBoundingClientRect().width > 300 && !document.querySelector('#dlg').classList.contains('vw-min')), 4000)));
|
|
211
|
+
await xp.click('#vFold'); // premium-chat-viewer V3: on the Chat page the viewer's button closes it, and the head's Viewer chip opens it again
|
|
212
|
+
const vf = await until(() => xp.evaluate(() => document.querySelector('#dOut').getBoundingClientRect().width === 0 && document.querySelector('#dlg').classList.contains('vw-shut')), 4000);
|
|
213
|
+
ok('X13 the viewer closes and the conversation takes the width', !!vf && (await xp.evaluate(() => document.querySelector('#dBody').getBoundingClientRect().width)) > 800, String(vf));
|
|
214
|
+
await xp.click('#vwPill');
|
|
215
|
+
ok('X13b the head\'s Viewer chip opens the viewer again', !!(await until(() => xp.evaluate(() => document.querySelector('#dOut').getBoundingClientRect().width > 300 && !document.querySelector('#dlg').classList.contains('vw-shut')), 4000)));
|
|
218
216
|
await xp.click('#vFold');
|
|
219
217
|
const shell = await xp.evaluate(() => ({ close: !!document.querySelector('#dClose').offsetParent, expand: !!document.querySelector('#dExpand').offsetParent, rail: !document.querySelector('.rail').inert }));
|
|
220
218
|
await xp.keyboard.press('Escape');
|
|
221
219
|
ok('X13c the Chat page has no close and no full-screen button, its rail stays live, and Escape keeps it open', !shell.close && !shell.expand && shell.rail && await xp.evaluate(() => document.querySelector('#dlg').classList.contains('on') && document.querySelector('#dlg').classList.contains('full')), JSON.stringify(shell));
|
|
222
|
-
await xp.click('#srlFold');
|
|
220
|
+
await xp.click('#srlFold'); // the viewer stays closed: on the Chat page nothing remembers it
|
|
223
221
|
/* the soft warning: silent at 6 working agents, speaks at 7, at the top of the list */
|
|
224
222
|
const before = fake.slice();
|
|
225
223
|
const mk = (n) => Array.from({ length: n }, (_, i) => ({ id: 'w-' + i, name: 'Agent ' + i, agent: 'claude', note: '', cwd: '.', created: new Date().toISOString(), shown: 'working', label: 'working', automatic: false }));
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.376.0",
|
|
4
|
+
"at": "2026-10-21T07:00:19.034Z",
|
|
5
|
+
"f": 2,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 984,
|
|
9
|
+
"t": "Replay conversation rows hold their words",
|
|
10
|
+
"s": "Replay conversation rows hold their words"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"n": 985,
|
|
14
|
+
"t": "Chat page viewer stays closed until something opens in it",
|
|
15
|
+
"s": "Chat page viewer stays closed until something opens in it"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
},
|
|
2
19
|
{
|
|
3
20
|
"v": "0.375.0",
|
|
4
21
|
"at": "2026-10-21T04:39:03.068Z",
|
|
@@ -28,12 +28,12 @@ Every premium page has the same top bar. On the left is where you are. On the ri
|
|
|
28
28
|
|
|
29
29
|
The first line of **Sources** says whether PMOS's background work is running. When everything is on time it reads like "Background on · brief 06:52 · sources 06:49": the time today's morning brief was saved and the time of the last source read. It turns orange when something is late, such as a source that missed its scheduled read by more than an hour, or Git sync that keeps failing. It turns red when something stopped: no morning brief 45 minutes after its time, a source whose last run failed, a session whose prompt was typed but not sent, or background checks that stopped. The line gives the reason in plain words, and other problems are listed under it. The Sources dot takes the same colour, and a stop is also added to the bell, once a day. When the morning brief is due, it first refreshes Calendar, Jira and My work if they are more than 2 hours old, then builds from them. It waits for them for at most 30 minutes.
|
|
30
30
|
|
|
31
|
-
**The Chat page** is the chat as a page of its own. On a desktop it has
|
|
31
|
+
**The Chat page** is the chat as a page of its own. On a desktop it has the session list and the conversation; the viewer is closed until something opens in it, such as a file Claude names. Then the viewer opens beside the conversation and the list folds to its strip of icons for as long as the viewer is open. The **×** at the top of the viewer closes it, and the **Viewer** chip in the head, with the number of things it holds, opens it again. When more tabs are open than fit, the last one is a **+N** menu with the rest. It has no close button; the rail takes you to another place. On a phone it fills the screen above the bar and opens on the conversation; the **Sessions** chip opens the list. It has no Detail switch: the viewer opens over the whole screen, and **‹ Chat** (or Escape) takes you back to the conversation. A chat dialog elsewhere (a row's Conversation tab) still shows the list when it is full screen. The standing note under the message box ("This is a Claude Code session…") shows only while you write in the box; any other note there, such as Sent, an error or Claude is waiting, always shows.
|
|
32
32
|
|
|
33
33
|
- **Groups.** **Goals** holds a chat whose goal is started or waiting on you. **Yours** holds the other sessions you started. **Started by PMOS** holds schedules, the day run, the Driver, the Checker, notes, document syncs and other background runs. A PMOS session shows only when it needs you. The rest fold into one line, "N more working on their own · Show".
|
|
34
34
|
- **Dots.** An orange dot means **Ready**: the session finished its turn and waits for you. A green dot means **Running**. An orange ring means **Maybe blocked**: a call is open and nothing moves, often a permission question. No dot means idle. Ready sessions come first and are bold. Hold the pointer over a row to see its state in words.
|
|
35
35
|
- **Switch.** Press a row to switch the dialog to that session. A chat opens its own conversation. Any other session shows its conversation from Claude Code's record. You can write to it and answer its permission questions, as in a chat. The viewer shows the session's facts, the question a background run asks with the options it offered, and **Stop**. Stop asks first, and if the session has not exited yet it says so and offers Stop again.
|
|
36
|
-
- **Fold.** The button at the top of the list folds it to a strip of icons with dots.
|
|
36
|
+
- **Fold.** The button at the top of the list folds it to a strip of icons with dots. In a full-screen chat dialog on another page, the button at the top of the viewer folds the viewer to a strip, so the conversation gets the width; press anywhere on the strip, or anything that opens in the viewer, to open it again. PMOS remembers both in this browser. When the conversation is hidden, the viewer always shows, so the panel is never empty.
|
|
37
37
|
- **End.** Every row has an **End** button (×) on its right: it shows when the pointer is over the row, and always on a touch screen. An idle session ends at once. A session that is Running, Ready or Maybe blocked asks first, in the row, with **End** and **Keep**. Ending stops the process and removes the row; files it already wrote stay. If it has not exited yet, the toast says so and the row stays.
|
|
38
38
|
- **Idle shells.** A terminal shell with no agent in it and no output for a while folds under **Yours** into one line, "N more idle · Show", with **End all idle**. End all idle ends only those shells, never a goal or a session that needs you. PMOS opens one shell when it starts with no live session; it now checks after your sessions come back, so a restart no longer adds a shell each time.
|
|
39
39
|
- **When the chat is not full screen,** a chip in the dialog's header shows the loudest dot and, for example, "2 ready". Press it to go full screen with the list. On a phone, it opens the list over the dialog, and a tap on a row switches to that session.
|
|
@@ -168,7 +168,7 @@ In **Notes**, each next step has **Make task** when the note is linked to an ini
|
|
|
168
168
|
|
|
169
169
|
**Focus.** The meeting dialog has **Focus** in its **More** menu. Focus shows the meeting as it is now: the state (starts in, recording, paused, ended), a bar of the stretches by topic, the topic now (or the first topic before the start), the last lines of the talk with who said them, the topics, the material and the counts of decisions, next steps and questions. It reads the meeting every 3 seconds while it is open and stops when you leave it. While the note records, PMOS's companion, a read-only Claude run that sends nothing, may read the last minutes of the talk at most every 40 seconds and writes its own notes. The dialog says this before the first read. **Change** lists the topics. A press records one correction on the meeting through the console's route. If the companion is off, has not answered or has failed, Focus says so and shows only the talk. It shows no topic, line or count that the record does not hold.
|
|
170
170
|
|
|
171
|
-
**Replay.** When a recording is kept, the Replay part has a **Replay** press. Replay opens wide and hides the conversation panel; **Back to the meeting** puts both back. The header shows the meeting's day, start and end, length, the number of people, and the position as m:ss and as the time of day. The player plays the note's audio, with Back 10 s and 1x, 1.5x or 2x. Under it is a bar of the stretches by topic and, above the bar, one marker for each decision, next step, question and PMOS note that has a time. A ring marks a point that needs you (a question still open, or a next step with no owner). A shaded part of the bar is a gap where the recording was off. The line under the bar shows the topic being talked about and the key points near the playhead. Below are two panels: **On screen**, with the screen shot kept for that time and a strip of all shots, and **Conversation**, with the transcript and PMOS's notes. Its tabs show all lines, only the key-point lines or only PMOS's notes, and a search box narrows the lines. The key points sit in three columns: decisions, questions and next steps. **Confirm all** makes a task of each next step in the note's initiative, under its first stage; when the note has no initiative, it says to link one first. A press on a marker, stretch, key point, line or shot plays from there, and the current line is marked. A key point with no time has no play press. If no audio was kept, the playhead keeps its own clock.
|
|
171
|
+
**Replay.** When a recording is kept, the Replay part has a **Replay** press. Replay opens wide and hides the conversation panel; **Back to the meeting** puts both back. The header shows the meeting's day, start and end, length, the number of people, and the position as m:ss and as the time of day. The player plays the note's audio, with Back 10 s and 1x, 1.5x or 2x. Under it is a bar of the stretches by topic and, above the bar, one marker for each decision, next step, question and PMOS note that has a time. A ring marks a point that needs you (a question still open, or a next step with no owner). A shaded part of the bar is a gap where the recording was off. The line under the bar shows the topic being talked about and the key points near the playhead. Below are two panels: **On screen**, with the screen shot kept for that time and a strip of all shots, and **Conversation**, with the transcript and PMOS's notes. The Conversation panel is as tall as the On screen panel, and its list scrolls. Each line is shown in full, however long it is. Its tabs show all lines, only the key-point lines or only PMOS's notes, and a search box narrows the lines. The key points sit in three columns: decisions, questions and next steps. **Confirm all** makes a task of each next step in the note's initiative, under its first stage; when the note has no initiative, it says to link one first. A press on a marker, stretch, key point, line or shot plays from there, and the current line is marked. A key point with no time has no play press. If no audio was kept, the playhead keeps its own clock.
|
|
172
172
|
|
|
173
173
|
In the **Add material** sheet, a **Topic** choice ties the item to one of the meeting's topics, so Focus can bring it up. It appears only when the meeting has topics.
|
|
174
174
|
|
|
@@ -418,7 +418,7 @@ The conversation beside every premium dialog is a real Claude Code session. Anyt
|
|
|
418
418
|
- **Stop** shows while Claude works. It presses Esc in the session.
|
|
419
419
|
- **The conversation** is Claude Code's own record, word for word. Claude's answers are formatted as Claude Code formats them: headings, bold, lists, code, tables, quotes and links (links open in a new tab). Your messages keep their line breaks, and a paste shows without the tags Claude Code wraps around it. A run of tool calls shows as one small grey line, for example "Used Read ×2, slack_read_thread". A connector tool shows its short name.
|
|
420
420
|
- **While a session runs**, the panel reads it again every 2 seconds and changes only when there is something new. The messages already on screen stay still, so nothing blinks beside the viewer.
|
|
421
|
-
- **A file Claude names** (a path such as `briefs/drafts/plan.md`, or a link to one) is underlined. Press it to read the file beside the conversation, as a tab in the viewer; on a phone, the Detail side shows it. Markdown shows as a page, an HTML file shows as the page it draws (press **Source** for its code), and other text files show as code. An HTML page runs its own scripts, so its toggles and charts work, but it cannot reach PMOS or the internet: a web font falls back to the system font. It is read-only. While the tab is open it shows the newest version, so a file Claude is still writing stays current. A file outside the workspaces PMOS serves says "Not in a workspace" and is not read.
|
|
421
|
+
- **A file Claude names** (a path such as `briefs/drafts/plan.md`, or a link to one) is underlined. Press it to read the file beside the conversation, as a tab in the viewer; on a phone, the Detail side shows it (on the Chat page, the viewer opens over the conversation). Markdown shows as a page, an HTML file shows as the page it draws (press **Source** for its code), and other text files show as code. An HTML page runs its own scripts, so its toggles and charts work, but it cannot reach PMOS or the internet: a web font falls back to the system font. It is read-only. While the tab is open it shows the newest version, so a file Claude is still writing stays current. A file outside the workspaces PMOS serves says "Not in a workspace" and is not read.
|
|
422
422
|
- **A link to a Google Doc or a Confluence page** opens beside the conversation too, as the viewer shows a copy: the text PMOS has read, or **Read it now**. **A Claude artifact link** opens a tab with **Open in Claude**: claude.ai does not let another site show an artifact inside it. Other links open in a new browser tab.
|
|
423
423
|
- **The session** is also listed in **Sessions** and in the console, where you can open its terminal.
|
|
424
424
|
- **Ending a session ends only its process.** Whether you press End in the session list, or PMOS ends an idle chat, the conversation stays with the row: the panel and the session's own view still show every turn, read from Claude Code's record (in whichever Claude login ran it, such as `~/.claude-personal`). PMOS also keeps a copy in its own state folder (`chat-history/`), so the conversation stays after Claude Code removes old records. Files the session wrote are never touched. Your next message picks up the same conversation.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.376.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.376.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* premium-chat-viewer-test.js — the Chat page's viewer opens when something opens in it (initiative premium-chat-viewer, slice 1).
|
|
4
|
+
* A real server on a scratch repository (c3-scan-fixture.js); the file reads are routed and the conversation is filled in the page.
|
|
5
|
+
* V1 at 1280 the page opens with no viewer column; a file press opens it and folds the session list; closing its last tab closes it again
|
|
6
|
+
* V3 a closed viewer with tabs shows the head's Viewer pill with the count, and the pill opens it
|
|
7
|
+
* V4 in a full-screen dialog on another page, a folded viewer unfolds when something opens in it
|
|
8
|
+
* V5 at 390 there is no Detail / Conversation switch; a file press covers the page with the file and Back; Back and Escape return
|
|
9
|
+
* V6 tabs that do not fit fold into "+N", whose menu opens each
|
|
10
|
+
* Set CHAT_VIEWER_SHOTS=<dir> to save the page at 1280 and 390, light and dark. */
|
|
11
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
12
|
+
require('./test-run').configure({ name: 'premium-chat-viewer' });
|
|
13
|
+
const Fx = require('./c3-scan-fixture.js');
|
|
14
|
+
|
|
15
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
16
|
+
const until = async (fn, ms = 8000, step = 100) => { const t0 = Date.now(); for (;;) { let v; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
17
|
+
const results = [];
|
|
18
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
|
|
19
|
+
let F = null, browser = null;
|
|
20
|
+
const finish = async (code) => {
|
|
21
|
+
if (browser) await browser.close().catch(() => {});
|
|
22
|
+
if (F) F.stop();
|
|
23
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
24
|
+
console.log(`\n${results.length - bad}/${results.length} premium-chat-viewer assertions passed`);
|
|
25
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
26
|
+
};
|
|
27
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
28
|
+
|
|
29
|
+
const MD = '# Sign-up drop\n\nThe **sign-up** rate fell from 41% to 38%.\n';
|
|
30
|
+
const fill = () => {
|
|
31
|
+
const s = document.querySelector('#dBody .stream');
|
|
32
|
+
s.insertAdjacentHTML('beforeend', '<div class="turn a"><div class="tc"><div class="md"><p>I wrote it up in <button type="button" class="fpath" data-file="planning/research/signup-drop.md">planning/research/signup-drop.md</button> and read <button type="button" class="fpath" data-file="planning/prd/signup-fix.md">planning/prd/signup-fix.md</button>.</p></div></div></div>');
|
|
33
|
+
};
|
|
34
|
+
/* the page's own state */
|
|
35
|
+
const look = () => {
|
|
36
|
+
const g = document.querySelector('#dlg'), w = (s) => { const e = document.querySelector(s); return e ? Math.round(e.getBoundingClientRect().width) : 0; }, pill = document.querySelector('#vwPill');
|
|
37
|
+
const out = document.querySelector('#dOut').getBoundingClientRect();
|
|
38
|
+
return { shut: g.classList.contains('vw-shut'), layer: g.classList.contains('vw-layer'), srlMin: g.classList.contains('srl-min'), conv: w('#dBody'), out: Math.round(out.width), outH: Math.round(out.height), vh: innerHeight,
|
|
39
|
+
sw: getComputedStyle(document.querySelector('#dTabs')).display, pill: pill && !pill.hidden ? pill.textContent.trim() : null, back: !!document.querySelector('#vBack') && getComputedStyle(document.querySelector('#vBack')).display !== 'none',
|
|
40
|
+
tabs: [...document.querySelectorAll('#vTabs .vtab')].map((t) => (t.hidden ? '~' : '') + t.textContent.trim()), more: (document.querySelector('#vTabs .vmore') || {}).textContent || null,
|
|
41
|
+
railOff: getComputedStyle(document.querySelector('.rail')).opacity === '0', wide: document.documentElement.scrollWidth > innerWidth + 1 };
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
(async () => {
|
|
45
|
+
const exe = findBrowser();
|
|
46
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
47
|
+
let chromium;
|
|
48
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
49
|
+
F = await Fx.start({ name: 'premium-chat-viewer' });
|
|
50
|
+
browser = await chromium.launch({ executablePath: exe, headless: true, args: ['--no-sandbox'] });
|
|
51
|
+
const shots = process.env.CHAT_VIEWER_SHOTS;
|
|
52
|
+
const chat = `${F.BASE}/premium-chat.html?ws=${encodeURIComponent(F.ws)}`;
|
|
53
|
+
const open = async (width, scheme = 'light') => {
|
|
54
|
+
const ctx = await browser.newContext({ viewport: { width, height: width < 1000 ? 844 : 800 }, colorScheme: scheme, hasTouch: width < 1000 });
|
|
55
|
+
const p = await ctx.newPage(); const errs = []; p.on('pageerror', (e) => errs.push(String(e)));
|
|
56
|
+
await p.route('**/api/doc/locate**', (r) => { const rel = r.request().url().includes('prd') ? 'planning/prd/signup-fix.md' : 'planning/research/signup-drop.md'; r.fulfill({ json: { ok: true, ws: F.ws, rel, name: rel.split('/').pop(), abs: '/x/' + rel, mtime: 1, size: MD.length } }); });
|
|
57
|
+
await p.route('**/api/doc?**', (r) => r.fulfill({ contentType: 'text/plain', headers: { 'X-Doc-Kind': 'markdown' }, body: MD }));
|
|
58
|
+
await p.goto(chat); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && !!document.querySelector('#dBody .stream')));
|
|
59
|
+
await p.evaluate(fill); await sleep(300);
|
|
60
|
+
return { p, ctx, errs };
|
|
61
|
+
};
|
|
62
|
+
const many = (p) => p.evaluate(async () => { const v = await import('/pm/premium-viewer.js'); for (const n of ['funnel-export.csv', 'support-tickets.md', 'pricing-notes.md', 'a-longer-quarterly-plan.md']) v.vwOpen({ id: 'x:' + n, title: n, html: '<article class="paper doc"><p>' + n + '</p></article>' }); });
|
|
63
|
+
|
|
64
|
+
{ const { p, ctx, errs } = await open(1280);
|
|
65
|
+
const s0 = await p.evaluate(look);
|
|
66
|
+
ok('V1 at 1280 the Chat page opens with no viewer column and the conversation wide', s0.shut && s0.out === 0 && s0.conv > 700 && !s0.pill && s0.tabs.length === 0, JSON.stringify(s0));
|
|
67
|
+
await p.click('.fpath >> nth=0');
|
|
68
|
+
const s1 = await until(async () => { const v = await p.evaluate(look); return !v.shut && v.out > 400 ? v : null; }) || await p.evaluate(look);
|
|
69
|
+
ok('V1 a file press opens the viewer beside a conversation of at least 380 px and folds the session list', !s1.shut && s1.out > 400 && s1.conv >= 380 && s1.srlMin, JSON.stringify(s1));
|
|
70
|
+
ok('V2 the placeholder is not a tab: the strip shows only the file', s1.tabs.length === 1 && /signup-drop\.md/.test(s1.tabs[0]), JSON.stringify(s1.tabs));
|
|
71
|
+
await p.click('#vTabs [data-vx]');
|
|
72
|
+
const s2 = await until(async () => { const v = await p.evaluate(look); return v.shut ? v : null; }) || await p.evaluate(look);
|
|
73
|
+
ok('V1 closing the last tab closes the viewer and unfolds the list', s2.shut && s2.out === 0 && !s2.srlMin, JSON.stringify(s2));
|
|
74
|
+
await p.click('.fpath >> nth=0'); await p.click('.fpath >> nth=1'); await sleep(300);
|
|
75
|
+
await p.click('#vFold');
|
|
76
|
+
const s3 = await until(async () => { const v = await p.evaluate(look); return v.shut && v.pill ? v : null; }) || await p.evaluate(look);
|
|
77
|
+
ok('V3 the close button closes the viewer and the head shows "Viewer 2"', s3.shut && /Viewer\s*2/.test(s3.pill || ''), JSON.stringify(s3));
|
|
78
|
+
await p.click('#vwPill');
|
|
79
|
+
const s4 = await until(async () => { const v = await p.evaluate(look); return !v.shut ? v : null; }) || await p.evaluate(look);
|
|
80
|
+
ok('V3 the pill opens it again on the last tab', !s4.shut && !s4.pill && /signup-fix\.md/.test(s4.tabs.find((t) => !t.startsWith('~')) && s4.tabs[s4.tabs.length - 1]), JSON.stringify(s4));
|
|
81
|
+
if (shots) await p.screenshot({ path: `${shots}/chat-viewer-1280-light.png` });
|
|
82
|
+
await many(p); await sleep(400);
|
|
83
|
+
const s5 = await p.evaluate(look);
|
|
84
|
+
ok('V6 tabs that do not fit fold into +N and the current tab shows', /^\+\d$/.test(s5.more || '') && s5.tabs.some((t) => t.startsWith('~')) && !s5.tabs[s5.tabs.length - 1].startsWith('~'), JSON.stringify(s5));
|
|
85
|
+
await p.click('#vTabs .vmore'); await sleep(200);
|
|
86
|
+
const items = await p.evaluate(() => [...document.querySelectorAll('#vMore [data-vw]')].map((b) => b.dataset.vw));
|
|
87
|
+
await p.click('#vMore [data-vw] >> nth=0'); await sleep(200);
|
|
88
|
+
const on = await p.evaluate(() => (document.querySelector('#vTabs .vtab[aria-selected="true"]') || {}).dataset.vw);
|
|
89
|
+
ok('V6 the +N menu lists the hidden tabs and opens one', items.length >= 1 && on === items[0], JSON.stringify({ items, on }));
|
|
90
|
+
ok('F1 no page error and no sideways scroll', !errs.length && !s5.wide, errs.join(' | '));
|
|
91
|
+
await ctx.close(); }
|
|
92
|
+
|
|
93
|
+
for (const scheme of ['light', 'dark']) {
|
|
94
|
+
const { p, ctx, errs } = await open(390, scheme);
|
|
95
|
+
const s0 = await p.evaluate(look);
|
|
96
|
+
ok(`V5 (${scheme}) at 390 there is no Detail / Conversation switch and no viewer`, s0.sw === 'none' && !s0.layer && s0.conv > 300, JSON.stringify(s0));
|
|
97
|
+
await p.click('.fpath >> nth=0');
|
|
98
|
+
const s1 = await until(async () => { const v = await p.evaluate(look); return v.layer && v.outH >= v.vh - 2 ? v : null; }) || await p.evaluate(look);
|
|
99
|
+
ok(`V5 (${scheme}) a file press covers the page with the file, Back shows and the rail steps aside`, s1.layer && s1.outH >= s1.vh - 2 && s1.back && s1.railOff, JSON.stringify(s1));
|
|
100
|
+
if (shots) await p.screenshot({ path: `${shots}/chat-viewer-390-${scheme}.png` });
|
|
101
|
+
await p.click('#vBack');
|
|
102
|
+
const s2 = await until(async () => { const v = await p.evaluate(look); return !v.layer && !v.railOff ? v : null; }) || await p.evaluate(look);
|
|
103
|
+
ok(`V5 (${scheme}) Back returns to the conversation, the pill shows the count`, !s2.layer && /1/.test(s2.pill || '') && !s2.railOff, JSON.stringify(s2));
|
|
104
|
+
await p.click('#vwPill'); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('vw-layer')));
|
|
105
|
+
await p.keyboard.press('Escape');
|
|
106
|
+
const s3 = await until(async () => { const v = await p.evaluate(look); return !v.layer ? v : null; }) || await p.evaluate(look);
|
|
107
|
+
ok(`V5 (${scheme}) Escape returns to the conversation`, !s3.layer, JSON.stringify(s3));
|
|
108
|
+
ok(`F1 (${scheme}) no page error and no sideways scroll at 390`, !errs.length && !s3.wide, errs.join(' | '));
|
|
109
|
+
await ctx.close();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
{ const ctx = await browser.newContext({ viewport: { width: 1280, height: 800 } }); const p = await ctx.newPage();
|
|
113
|
+
await p.addInitScript(() => { try { localStorage.setItem('pmos.srl.view', 'min'); } catch { /* none */ } });
|
|
114
|
+
await p.goto(`${F.BASE}/premium.html?ws=${encodeURIComponent(F.ws)}`); await until(() => p.evaluate(() => !!document.querySelector('.rail')));
|
|
115
|
+
await p.evaluate(async () => { const m = await import('/pm/premium-shell.js'); m.openDlg({ eye: 'Goal', title: 'Check the funnel', html: '<p>detail</p>', say: 'Hello', noteKey: 'work:x' }); m.setFull(true); });
|
|
116
|
+
await sleep(300);
|
|
117
|
+
const before = await p.evaluate(() => document.querySelector('#dlg').classList.contains('vw-min'));
|
|
118
|
+
await p.evaluate(async () => { const v = await import('/pm/premium-viewer.js'); v.vwOpen({ id: 'x:a', title: 'a.md', html: '<p>a</p>' }); });
|
|
119
|
+
await sleep(200);
|
|
120
|
+
const after = await p.evaluate(() => document.querySelector('#dlg').classList.contains('vw-min'));
|
|
121
|
+
ok('V4 a folded viewer in a full-screen dialog unfolds when something opens in it', before && !after, JSON.stringify({ before, after }));
|
|
122
|
+
await ctx.close(); }
|
|
123
|
+
|
|
124
|
+
return finish();
|
|
125
|
+
})();
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/* premium-phone-room-test.js — Focus on a phone (Wawan, 2026-10-21: the scroll area is too small; then "UI broken. Better to have manual CTA to
|
|
4
4
|
* Focus" after the automatic hiding misdrew the page with the keyboard up). A real server on a scratch repository (c3-scan-fixture.js); the
|
|
5
5
|
* conversation is filled in the page.
|
|
6
|
-
* P1 the Chat page at rest · P2 scrolling and typing hide nothing · P3 Focus gives the dialog the screen and moves the rail away · P4 a second
|
|
6
|
+
* P1 the Chat page at rest (no Detail switch since premium-chat-viewer) · P2 scrolling and typing hide nothing · P3 Focus gives the dialog the screen and moves the rail away · P4 a second
|
|
7
7
|
* press brings it all back · P5 a chat dialog on another page takes the screen, the rail class stays off · P6 a desktop has no Focus button
|
|
8
8
|
* Set PHONE_ROOM_SHOTS=<dir> to save the Chat page at 390 wide, light and dark, at rest and in focus. */
|
|
9
9
|
const { findBrowser } = require('./lib/find-browser');
|
|
@@ -50,11 +50,12 @@ const hand = (dy) => { const b = document.querySelector('#dBody'); b.dispatchEve
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
{ const { p, ctx, errs } = await open(390);
|
|
53
|
+
await until(() => p.evaluate(() => document.querySelector('#dlg').getBoundingClientRect().top === 0)); // the dialog's entrance has finished
|
|
53
54
|
const s0 = await p.evaluate(look);
|
|
54
|
-
ok('P1 the Chat page at rest shows the
|
|
55
|
+
ok('P1 the Chat page at rest shows the rail and a Focus button, and no Detail switch (premium-chat-viewer V5: the viewer is a layer)', !s0.tabs && !s0.focus && s0.btn && s0.pressed === 'false' && s0.railTop < s0.vh, JSON.stringify(s0));
|
|
55
56
|
await p.evaluate(hand, 300); await sleep(400); await p.evaluate(hand, -100); await p.focus('#askIn'); await sleep(500);
|
|
56
57
|
const s1 = await p.evaluate(look);
|
|
57
|
-
ok('P2 scrolling and typing hide nothing by themselves',
|
|
58
|
+
ok('P2 scrolling and typing hide nothing by themselves', !s1.focus && s1.railTop < s1.vh && s1.dlgH === s0.dlgH, JSON.stringify(s1));
|
|
58
59
|
await p.evaluate(() => document.querySelector('#askIn').blur());
|
|
59
60
|
if (shots) await p.screenshot({ path: `${shots}/chat-rest-390-light.png` });
|
|
60
61
|
await p.click('#dFocus');
|
|
@@ -63,8 +64,8 @@ const hand = (dy) => { const b = document.querySelector('#dBody'); b.dispatchEve
|
|
|
63
64
|
ok('P3b in focus the conversation gets at least 680 px of the 844 px screen (516 px before)', s2.room >= 680, JSON.stringify(s2));
|
|
64
65
|
if (shots) await p.screenshot({ path: `${shots}/chat-focus-390-light.png` });
|
|
65
66
|
await p.click('#dFocus');
|
|
66
|
-
const s3 = await until(async () => { const v = await p.evaluate(look); return !v.focus && !v.dfocus && v.
|
|
67
|
-
ok('P4 a second press brings the
|
|
67
|
+
const s3 = await until(async () => { const v = await p.evaluate(look); return !v.focus && !v.dfocus && v.railTop < v.vh ? v : null; }) || await p.evaluate(look);
|
|
68
|
+
ok('P4 a second press brings the rail back', !s3.focus && !s3.dfocus && s3.railTop < s3.vh && s3.pressed === 'false', JSON.stringify(s3));
|
|
68
69
|
ok('P4b no page error', errs.length === 0, errs.join(' | '));
|
|
69
70
|
await ctx.close(); }
|
|
70
71
|
|
|
@@ -121,7 +121,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
121
121
|
for (const id of ['a', 'b']) await page.evaluate((x) => window.__premiumViewer.vwOpen({ id: x, title: 'A long item title ' + x, html: `<p>${x}</p>` }), id);
|
|
122
122
|
const m = await page.evaluate(() => {
|
|
123
123
|
const r = (e) => e.getBoundingClientRect();
|
|
124
|
-
const tabs = [...document.querySelectorAll('#vTabs .vtab')], xs = [...document.querySelectorAll('#vTabs .vx')];
|
|
124
|
+
const tabs = [...document.querySelectorAll('#vTabs .vtab:not([hidden])')], xs = [...document.querySelectorAll('#vTabs .vtab:not([hidden]) .vx')]; // tabs past the strip's width sit in the +N menu (premium-chat-viewer V6)
|
|
125
125
|
return { tabH: Math.min(...tabs.map((t) => r(t).height)), xH: Math.min(...xs.map((t) => r(t).height)), xW: Math.min(...xs.map((t) => r(t).width)),
|
|
126
126
|
over: document.documentElement.scrollWidth > window.innerWidth, stripW: r(document.querySelector('#vTabs')).right <= window.innerWidth + 1,
|
|
127
127
|
bg: getComputedStyle(document.querySelector('#vTabs .vtab[aria-selected="true"]')).backgroundColor };
|
|
@@ -308,7 +308,7 @@ export const topicBody = (row, text) => (row && row.id && clip(text, 120) ? { ev
|
|
|
308
308
|
/** The Replay player's model from GET /api/meeting-replay: the lines, the key points, the stretches by topic and the shots, all in meeting time (ms). */
|
|
309
309
|
export function replayModel(rep) {
|
|
310
310
|
if (!rep || rep.ok !== true) return null;
|
|
311
|
-
const lines = (Array.isArray(rep.lines) ? rep.lines : []).filter((l) => l && Number.isFinite(l.t) && String(l.text || '').trim()).map((l, i) => ({ i, t: l.t, who: clip(l.who, 40), text: clip(l.text,
|
|
311
|
+
const lines = (Array.isArray(rep.lines) ? rep.lines : []).filter((l) => l && Number.isFinite(l.t) && String(l.text || '').trim()).map((l, i) => ({ i, t: l.t, who: clip(l.who, 40), text: clip(l.text, 20000) })).sort((a, b) => a.t - b.t);
|
|
312
312
|
const topics = (Array.isArray(rep.topics) ? rep.topics : []).map((t, i) => ({ id: t.id, text: clip(t.text, 120), n: t.n || i + 1 }));
|
|
313
313
|
let len = Number(rep.length_ms) || (rep.audio && Number(rep.audio.ms)) || 0;
|
|
314
314
|
if (!len && lines.length) len = lines[lines.length - 1].t;
|
|
@@ -318,7 +318,7 @@ export function replayModel(rep) {
|
|
|
318
318
|
need: !!k.warn || k.state === 'owner' || k.state === 'open' }));
|
|
319
319
|
const shots = (Array.isArray(rep.shots) ? rep.shots : []).filter((x) => Number.isFinite(x.t)).map((x) => ({ t: x.t, why: clip(x.why, 120) })).sort((a, b) => a.t - b.t);
|
|
320
320
|
/* PMOS's notes (the meeting companion's, from the Focus file), the gaps where the recording was off, and the line each key point was caught from */
|
|
321
|
-
const pmos = (Array.isArray(rep.notes) ? rep.notes : []).filter((x) => x && Number.isFinite(x.t) && String(x.body || '').trim()).map((x) => ({ t: Math.max(0, Math.min(len, x.t)), cat: clip(x.cat, 30), body: clip(x.body,
|
|
321
|
+
const pmos = (Array.isArray(rep.notes) ? rep.notes : []).filter((x) => x && Number.isFinite(x.t) && String(x.body || '').trim()).map((x) => ({ t: Math.max(0, Math.min(len, x.t)), cat: clip(x.cat, 30), body: clip(x.body, 4000) })).sort((a, b) => a.t - b.t);
|
|
322
322
|
const gaps = (Array.isArray(rep.gaps) ? rep.gaps : []).filter((g) => Number.isFinite(g.from_ms) && Number.isFinite(g.to_ms) && g.to_ms > g.from_ms).map((g) => ({ from: g.from_ms, to: Math.min(len, g.to_ms) }));
|
|
323
323
|
const keyOfLine = new Map((Array.isArray(rep.lines) ? rep.lines : []).filter((l) => l && l.key && l.key.k).map((l) => [l.t, l.key.k]));
|
|
324
324
|
lines.forEach((l) => { l.key = keyOfLine.get(l.t) || ''; });
|
|
@@ -1,7 +1,7 @@
|
|
|
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';
|
|
@@ -244,11 +244,12 @@ export function openChatPage(key, label) {
|
|
|
244
244
|
const say = label
|
|
245
245
|
? '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
246
|
: '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 });
|
|
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>`, paneEmpty: true, label: label || 'Chat', sessions: true });
|
|
248
248
|
$$('.rail').forEach((x) => { x.inert = false; }); document.documentElement.style.overflow = '';
|
|
249
249
|
$('#veil').classList.remove('on');
|
|
250
250
|
$('#askIn').placeholder = label ? 'Message Claude about ' + label : 'Message Claude, or type /';
|
|
251
251
|
if (desk()) setFull(true); else setTab('chat');
|
|
252
|
+
vwShutPane(); // premium-chat-viewer V1: the conversation has the room until something opens in the viewer
|
|
252
253
|
loadThread(key);
|
|
253
254
|
}
|
|
254
255
|
tbMount(); // the top bar first: the menu holds the Settings, Sessions, Console and Search items the code below wires
|
|
@@ -286,7 +287,9 @@ export function openDlg(o) {
|
|
|
286
287
|
$$('.rail,main.stage,#dock').forEach((x) => { x.inert = true; });
|
|
287
288
|
$('#dlg').inert = false; document.documentElement.style.overflow = 'hidden';
|
|
288
289
|
$('#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
|
+
$('#oMain').innerHTML = o.pane || `<article class="paper doc">${o.html}</article>`; $('#oLab').textContent = o.label || 'Detail';
|
|
291
|
+
if (o.paneEmpty) $('#oMain').dataset.empty = '1'; else delete $('#oMain').dataset.empty; // a placeholder note is not a tab (premium-chat-viewer V2)
|
|
292
|
+
vwReset(); // extra viewer tabs belong to the dialog that opened them
|
|
290
293
|
$('#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()}<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
294
|
mountPad({ key: S.key, ws: new URLSearchParams(location.search).get('ws'), input: $('#askIn') });
|
|
292
295
|
quietNote();
|
|
@@ -326,7 +329,12 @@ export function closeDlg() {
|
|
|
326
329
|
if (lastFocus) { try { lastFocus.focus(); } catch { /* gone */ } }
|
|
327
330
|
}
|
|
328
331
|
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) {
|
|
332
|
+
export function setTab(t) {
|
|
333
|
+
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
|
|
334
|
+
if (t === 'out') { if (vwCount()) vwOpenPane(); return; }
|
|
335
|
+
vwBack(); t = 'chat';
|
|
336
|
+
}
|
|
337
|
+
$('#dGrid').dataset.tab = t; $$('#dTabs button').forEach((b) => b.setAttribute('aria-pressed', b.dataset.t === t)); pillOf($('#dTabs .seg')); }
|
|
330
338
|
export function setMode(m) {
|
|
331
339
|
$('#dlg').dataset.mode = m;
|
|
332
340
|
const b = $('#dPane'), on = m === 'split';
|
|
@@ -341,6 +349,7 @@ $('#dExpand').onclick = () => setFull(!$('#dlg').classList.contains('full'));
|
|
|
341
349
|
$('#dTabs').addEventListener('click', (e) => { const b = e.target.closest('[data-t]'); if (b) setTab(b.dataset.t); });
|
|
342
350
|
addEventListener('keydown', (e) => {
|
|
343
351
|
if (e.key !== 'Escape' || !$('#dlg').classList.contains('on')) return;
|
|
352
|
+
if (chatPage() && $('#dlg').classList.contains('vw-layer') && !document.querySelector('[data-esc-layer]')) { vwBack(); return; }
|
|
344
353
|
if (document.querySelector('[data-esc-layer]') || chatPage()) return; // a layer open over the dialog (a viewer menu, Present) closes itself first
|
|
345
354
|
if ($('#dlg').classList.contains('full')) { setFull(false); e.stopImmediatePropagation(); return; }
|
|
346
355
|
closeDlg();
|
|
@@ -1044,7 +1053,7 @@ export async function openSettings() {
|
|
|
1044
1053
|
* 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
1054
|
* 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
1055
|
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' };
|
|
1056
|
+
railMin: store.get('pmos.srl.rail') === 'min', viewMin: store.get('pmos.srl.view') === 'min', autoMin: false };
|
|
1048
1057
|
const SRL_POLL = 3000, BADGE_POLL = 15000;
|
|
1049
1058
|
const desk = () => innerWidth >= 1000;
|
|
1050
1059
|
const railShowing = () => $('#dlg').classList.contains('on') && $('#dlg').classList.contains('srl-on') && ($('#dlg').classList.contains('full') ? desk() : $('#dlg').classList.contains('srl-open'));
|
|
@@ -1053,9 +1062,16 @@ function railMount() {
|
|
|
1053
1062
|
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
1063
|
$('#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
1064
|
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(); };
|
|
1065
|
+
$('#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
1066
|
$('#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
|
|
1067
|
+
$('#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
|
|
1068
|
+
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
|
|
1069
|
+
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();
|
|
1070
|
+
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>');
|
|
1071
|
+
$('#vBack').onclick = () => vwBack();
|
|
1072
|
+
$('#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>');
|
|
1073
|
+
$('#vwPill').onclick = () => vwOpenPane();
|
|
1074
|
+
}
|
|
1059
1075
|
$('#sTease').onclick = () => {
|
|
1060
1076
|
if (desk()) { setFull(true); railLayout(); railRead(); return; }
|
|
1061
1077
|
$('#dlg').classList.toggle('srl-open'); railDraw(); if ($('#dlg').classList.contains('srl-open')) railRead();
|
|
@@ -1073,12 +1089,50 @@ function railMount() {
|
|
|
1073
1089
|
if (r) pickSession(r.dataset.sid);
|
|
1074
1090
|
};
|
|
1075
1091
|
}
|
|
1092
|
+
/* ── premium-chat-viewer: on the Chat page the viewer is closed until something opens in it (V1, V3, V5) ──────────────────────────────────
|
|
1093
|
+
* 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
|
|
1094
|
+
* 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
|
|
1095
|
+
* what the viewer holds, opens it again. In any other full-screen dialog an open unfolds a folded viewer (V4). */
|
|
1096
|
+
function vwPill() {
|
|
1097
|
+
const b = $('#vwPill'); if (!b) return;
|
|
1098
|
+
const g = $('#dlg'), n = vwCount(), shut = desk() ? g.classList.contains('vw-shut') : !g.classList.contains('vw-layer');
|
|
1099
|
+
b.hidden = !n || !shut; $('em', b).textContent = String(n);
|
|
1100
|
+
b.setAttribute('aria-label', 'Show the viewer, ' + n + (n === 1 ? ' item' : ' items')); b.title = 'Show the viewer';
|
|
1101
|
+
}
|
|
1102
|
+
function vwOpenPane(keepList) {
|
|
1103
|
+
if (!chatPage()) return;
|
|
1104
|
+
const g = $('#dlg');
|
|
1105
|
+
if (desk()) { if (g.classList.contains('vw-shut')) { g.classList.remove('vw-shut'); R.autoMin = !keepList && !R.railMin; railLayout(); } }
|
|
1106
|
+
else { g.classList.add('vw-layer'); document.body.classList.add('vwlayer'); }
|
|
1107
|
+
vwPill();
|
|
1108
|
+
}
|
|
1109
|
+
function vwShutPane() {
|
|
1110
|
+
if (!chatPage()) return;
|
|
1111
|
+
const g = $('#dlg'); g.classList.add('vw-shut'); g.classList.remove('vw-layer'); document.body.classList.remove('vwlayer');
|
|
1112
|
+
if (R.autoMin) { R.autoMin = false; railLayout(); }
|
|
1113
|
+
vwPill();
|
|
1114
|
+
}
|
|
1115
|
+
function vwBack() {
|
|
1116
|
+
const g = $('#dlg'); if (!g.classList.contains('vw-layer')) return;
|
|
1117
|
+
g.classList.remove('vw-layer'); document.body.classList.remove('vwlayer'); vwPill();
|
|
1118
|
+
const a = $('#askIn'); if (a && desk()) a.focus();
|
|
1119
|
+
}
|
|
1120
|
+
vwOn((kind) => {
|
|
1121
|
+
if (kind === 'open') {
|
|
1122
|
+
if (chatPage()) vwOpenPane();
|
|
1123
|
+
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
|
|
1124
|
+
}
|
|
1125
|
+
if (kind === 'empty' && chatPage()) vwShutPane();
|
|
1126
|
+
vwPill();
|
|
1127
|
+
});
|
|
1128
|
+
addEventListener('resize', () => { if (chatPage()) { if (desk()) { $('#dlg').classList.remove('vw-layer'); document.body.classList.remove('vwlayer'); } vwPill(); } });
|
|
1076
1129
|
function railLayout() {
|
|
1077
1130
|
const d = $('#dlg');
|
|
1078
|
-
|
|
1131
|
+
const min = R.railMin || R.autoMin;
|
|
1132
|
+
d.classList.toggle('srl-min', min); d.classList.toggle('vw-min', R.viewMin && !chatPage());
|
|
1079
1133
|
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)); }
|
|
1134
|
+
if (f) { f.title = min ? 'Open the list' : 'Fold the list'; f.setAttribute('aria-label', f.title); f.setAttribute('aria-pressed', String(min)); }
|
|
1135
|
+
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
1136
|
}
|
|
1083
1137
|
/* 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
1138
|
* 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
|
|
@@ -1137,7 +1191,9 @@ function pickSession(id) {
|
|
|
1137
1191
|
$('#askF').hidden = !!r.headless; $('#askIn').value = ''; $('#askIn').placeholder = r.key ? 'Message Claude, or type /' : 'Message this session';
|
|
1138
1192
|
if (r.key) { S.sid = null; S.key = r.key; loadThread(r.key); } else { S.key = null; S.sid = id; loadSid(id); }
|
|
1139
1193
|
sessionCard(r); railDraw();
|
|
1194
|
+
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
1195
|
if (!desk()) setTab('chat');
|
|
1196
|
+
vwPill();
|
|
1141
1197
|
const go = $('#askIn'); if (go && !r.headless && desk()) go.focus();
|
|
1142
1198
|
}
|
|
1143
1199
|
async function loadSid(id) {
|
|
@@ -1153,7 +1209,7 @@ async function loadSid(id) {
|
|
|
1153
1209
|
}
|
|
1154
1210
|
/* 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
1211
|
async function sessionCard(r) {
|
|
1156
|
-
vwReset(); $('#oLab').textContent = 'Session';
|
|
1212
|
+
delete $('#oMain').dataset.empty; vwReset(); $('#oLab').textContent = 'Session';
|
|
1157
1213
|
if (!r) { $('#oMain').innerHTML = '<article class="paper doc"><p class="note">This session has ended. Pick another from the list.</p></article>'; return; }
|
|
1158
1214
|
const runs = await pmGet('/api/runs').catch(() => null); R.asks = {};
|
|
1159
1215
|
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,48 @@ 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
|
+
|
|
2631
|
+
/* ── premium-chat-viewer: the Chat page's viewer is closed until something opens in it. Desktop: vw-shut takes its column away and the
|
|
2632
|
+
conversation is centred; the head's Viewer pill opens it again. Phone: no Detail / Conversation switch; vw-layer puts the viewer over the
|
|
2633
|
+
whole page with a Back button, and the rail steps aside. Tabs that do not fit fold into "+N" (premium-viewer.js). ── */
|
|
2634
|
+
.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)}
|
|
2635
|
+
.vmore:hover{background:var(--card)}
|
|
2636
|
+
.otop{position:relative}
|
|
2637
|
+
.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}
|
|
2638
|
+
.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}
|
|
2639
|
+
.vmenu button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
2640
|
+
.vmenu button:hover,.vmenu button:focus-visible{background:var(--well)}
|
|
2641
|
+
.vmenu .i{width:14px;height:14px}
|
|
2642
|
+
.vback{display:none}
|
|
2643
|
+
.vwpill[hidden]{display:none}
|
|
2644
|
+
.vwpill .i{width:16px;height:16px}
|
|
2645
|
+
.chatpg .vwpill{order:-1}
|
|
2646
|
+
@media (min-width:1000px){
|
|
2647
|
+
.chatpg .dlg.full.vw-shut .p-out{display:none!important}
|
|
2648
|
+
.chatpg .dlg.full.srl-on.vw-shut .dgrid{grid-template-columns:var(--srw,232px) minmax(0,1fr)}
|
|
2649
|
+
.chatpg .dlg.full.vw-shut:not(.srl-on) .dgrid{grid-template-columns:minmax(0,1fr)}
|
|
2650
|
+
.chatpg .dlg.full.vw-shut #dBody{padding-inline:max(0px,calc((100% - 880px) / 2))}
|
|
2651
|
+
.chatpg .dlg.full #vFold{order:9;margin-left:auto}
|
|
2652
|
+
.chatpg .dlg.full .otop #vTabs{order:1}
|
|
2653
|
+
}
|
|
2654
|
+
@media (max-width:999px){
|
|
2655
|
+
.chatpg #dTabs{display:none!important}
|
|
2656
|
+
.chatpg .dlg .dgrid .p-work{display:flex!important}
|
|
2657
|
+
.chatpg .dlg .dgrid .p-out{display:none!important}
|
|
2658
|
+
.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}
|
|
2659
|
+
.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}
|
|
2660
|
+
.chatpg .dlg.vw-layer .otop #vTabs{order:1;flex:1}
|
|
2661
|
+
.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}
|
|
2662
|
+
.chatpg .dlg.vw-layer #vBack:hover{background:var(--card)}
|
|
2663
|
+
.chatpg .dlg.vw-layer #vBack .i{width:18px;height:18px}
|
|
2664
|
+
.chatpg .dlg.vw-layer #oLab{order:1;flex:1}
|
|
2665
|
+
.chatpg .dlg.vw-layer .vtab{height:44px}
|
|
2666
|
+
.chatpg .dlg.vw-layer .vmore{height:44px}
|
|
2667
|
+
.chatpg.vwlayer .rail{transform:translate(-50%,calc(100% + 40px));opacity:0;pointer-events:none}
|
|
2668
|
+
.chatpg.vwlayer .dlg.on{height:var(--vvh,100%)}
|
|
2669
|
+
.chatpg .vwpill{height:44px}
|
|
2670
|
+
}
|
|
2671
|
+
@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)}}
|
|
2672
|
+
.vtab[hidden]{display:none}
|
|
2673
|
+
@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}}
|
|
2674
|
+
.chatpg.vwlayer .dlg.on{border-radius:0}
|
|
@@ -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
|
+
}
|