create-pmos 0.405.0 → 0.407.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +25 -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-adddoc-test.js +4 -3
- package/workspace/briefing-premium-doc-edit-test.js +3 -5
- package/workspace/briefing-premium-initiative-test.js +46 -27
- package/workspace/changelog.json +24 -0
- package/workspace/guide/home.md +21 -4
- package/workspace/guide/programs.md +1 -0
- package/workspace/lib/engine/boards.js +2 -1
- package/workspace/lib/initiative-writer.js +45 -1
- package/workspace/lib/routes-boards.js +13 -0
- package/workspace/lib/routes-initiatives.js +12 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +2 -2
- package/workspace/premium-core-doc-issue-test.js +4 -1
- package/workspace/premium-vw-backlog-test.js +3 -3
- package/workspace/premium-vw-doc-test.js +4 -6
- package/workspace/premium-vw-item-test.js +1 -1
- package/workspace/premium-vw-jira-test.js +2 -2
- package/workspace/public/pm/bd-ini-panel.js +2 -2
- package/workspace/public/pm/bd-prog-panel.js +15 -5
- package/workspace/public/pm/cozy-home.css +5 -0
- package/workspace/public/pm/cozy-nav.js +4 -0
- package/workspace/public/pm/cozy-today.css +2 -0
- package/workspace/public/pm/cozy-viewer.js +75 -10
- package/workspace/public/pm/cozy-vw-shell.css +20 -1
- package/workspace/public/pm/home-app.js +135 -61
- package/workspace/public/pm/home-ini.css +14 -0
- package/workspace/public/pm/home-ini.js +98 -81
- package/workspace/public/pm/home-task.js +5 -2
- package/workspace/public/pm/home-today.js +7 -5
- package/workspace/public/pm/premium-board.js +21 -2
- package/workspace/public/pm/premium-viewer.js +1 -1
- package/workspace/public/pm/premium-vw-item.js +1 -0
- package/workspace/public/pm/rename-press.js +81 -0
- package/workspace/public/premium.html +1 -1
- package/workspace/rename-test.js +166 -0
- package/workspace/test-lists/rename.json +9 -0
- package/workspace/tk-tasks-test.js +2 -3
|
@@ -58,13 +58,13 @@ const SPRINTS = { ok: true, source: 'jira', readAt: '2026-10-19T09:00:00Z', velo
|
|
|
58
58
|
await page.goto(BASE + '/premium-initiative.html?id=self-serve-v2&ws=w1&board=w1&theme=' + theme);
|
|
59
59
|
// the Board's expand link lands on Home's initiative layout (premium-agreed-design); its Overview has the Sprint press, and the Viewer shows one item at a time
|
|
60
60
|
S.up = await until(() => page.evaluate(() => !!document.querySelector('.hm-card [data-hm-ov]') && !!window.__premiumViewer && !!window.__premiumVwJira), 20000);
|
|
61
|
-
if (S.up) {
|
|
61
|
+
if (S.up) { await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .hi-pgh [data-hi-addtask]', { timeout: 30000 }); })(page); /* ← back to the initiative's page, else its row, else the address again (an initiative the list does not show) */ await page.click('#czViewer .hi-pgh [data-hi-addtask]'); /* the initiative's page (canvas HbC): its + drills into Tasks */ S.up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]'))); }
|
|
62
62
|
S.reads.length = 0;
|
|
63
63
|
return { page, ctx, S };
|
|
64
64
|
};
|
|
65
65
|
const viaMore = async (pg, label) => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); await pg.click(`#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${label}"))`); }; // the Overview's other views, Open the full record and Sprint sit under ⋯ (XvATasks)
|
|
66
66
|
const toSprint = async (page) => {
|
|
67
|
-
if (!(await page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')))) {
|
|
67
|
+
if (!(await page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')))) { await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .hi-pgh [data-hi-addtask]', { timeout: 30000 }); })(page); /* ← back to the initiative's page, else its row, else the address again (an initiative the list does not show) */ await page.click('#czViewer .hi-pgh [data-hi-addtask]'); /* the initiative's page (canvas HbC): its + drills into Tasks */ }
|
|
68
68
|
await until(() => page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')), 5000);
|
|
69
69
|
await viaMore(page, 'Sprint');
|
|
70
70
|
return until(() => page.evaluate(() => !!document.querySelector('#czViewer .obody.vw[data-vw="sprint:w1"] [data-jbl]')), 5000);
|
|
@@ -87,7 +87,7 @@ const SPRINTS = { ok: true, source: 'jira', readAt: '2026-10-19T09:00:00Z', velo
|
|
|
87
87
|
ok('R10 Home loads the initiative with its Overview open', S.up);
|
|
88
88
|
ok('R10 the sprint view has "Open the backlog", and it opens the backlog in the Viewer', await openBacklog(page));
|
|
89
89
|
let s = await read(page);
|
|
90
|
-
ok('R10 the backlog is the Viewer\'s one item, and the initiative is still the
|
|
90
|
+
ok('R10 the backlog is the Viewer\'s one item, and the initiative is still the one open (the address and the chat name it)', s.on === 'backlog:w1' && await page.evaluate(() => new URLSearchParams(location.search).get('ini') === 'self-serve-v2' && /Self-serve onboarding v2/.test(document.querySelector('#hmIn').placeholder)), JSON.stringify(s.on));
|
|
91
91
|
ok('R10 the board is read with its workspace and board', S.reads.length >= 1 && S.reads.every((q) => /board=w1/.test(q) && /ws=w1/.test(q)), JSON.stringify(S.reads));
|
|
92
92
|
ok('R10 the open sprints first, then the Backlog, each with its tickets by key', JSON.stringify(s.secs) === '[["S 14",["P-1","P-2"]],["S 15",[]],["Backlog",["P-3","Q-2"]]]', JSON.stringify(s.secs));
|
|
93
93
|
ok('R10 it says what it leaves out and that Jira owns rank and sprint', /Only the tickets this board's initiatives pushed/.test(s.text) && /Ranking and moving between sprints happen in Jira/.test(s.text));
|
|
@@ -77,11 +77,9 @@ const prop = (o) => Object.assign({ id: 'prop-a', state: 'proposed', prompt: 'ad
|
|
|
77
77
|
return send({ ok: false, error: 'not in this test' }, 404);
|
|
78
78
|
});
|
|
79
79
|
await page.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&theme=' + theme);
|
|
80
|
-
await until(() => page.evaluate(() => !!document.querySelector('
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
// the initiative's Core documents group (in place of the Files group, premium-uncovered-features InDocs) opens every document in the Viewer
|
|
84
|
-
await page.click('#hmList [data-hi-open="docs"]');
|
|
80
|
+
await until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-hi-open="docs"]')), 15000); // the initiative's page (canvas HbC)
|
|
81
|
+
// the page's Documents "Show all N" opens every document in the Viewer
|
|
82
|
+
await page.click('#czViewer [data-hi-open="docs"]');
|
|
85
83
|
await until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-ov-open="planning/prd/self-serve-v2-prd.md"]')), 15000);
|
|
86
84
|
await page.click('#czViewer [data-ov-open="planning/prd/self-serve-v2-prd.md"]'); // the PRD opens as a page
|
|
87
85
|
await until(() => page.evaluate(() => document.querySelector('.vwdoc .cf, .vwdoc .vwempty:not(:empty)') && !/Reading the file/.test(document.querySelector('.vwdoc').textContent)));
|
|
@@ -111,7 +109,7 @@ const prop = (o) => Object.assign({ id: 'prop-a', state: 'proposed', prompt: 'ad
|
|
|
111
109
|
ok('D9 Links show what it is built from and what uses it, from the document library', /Built from · 1.*Onboarding interviews/.test(await txt(p, V + ' .vwmp')) && /Used by · 1.*Self-serve rubric/.test(await txt(p, V + ' .vwmp')) && /Links 2/.test(await txt(p, V + ' .vwmore')));
|
|
112
110
|
await p.click(V + ' [data-vd="open:planning/evals/self-serve-v2-rubric.md"]');
|
|
113
111
|
ok('D9 a linked document opens as a page in the Viewer, in place of this one', await until(() => p.evaluate(() => !!document.querySelector('#czViewer .obody.vw[data-vw="doc:planning/evals/self-serve-v2-rubric.md"]'))));
|
|
114
|
-
await p.click('#
|
|
112
|
+
await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .hi-pgh [data-hi-addtask]', { timeout: 30000 }); })(p); /* ← back to the initiative's page, else its row, else the address again (an initiative the list does not show) */ await p.click('#czViewer [data-hi-open="docs"]'); // back to the PRD: the initiative's row opens its page, and Documents opens it again
|
|
115
113
|
await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-ov-open="planning/prd/self-serve-v2-prd.md"]')), 15000);
|
|
116
114
|
await p.click('#czViewer [data-ov-open="planning/prd/self-serve-v2-prd.md"]');
|
|
117
115
|
await until(() => p.evaluate(() => !!document.querySelector('#czViewer .obody.vw[data-vw="doc:planning/prd/self-serve-v2-prd.md"] .vwdoc .cf')));
|
|
@@ -52,7 +52,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
52
52
|
return { page, ctx, S };
|
|
53
53
|
};
|
|
54
54
|
const viaMore = async (pg, label) => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); await pg.click(`#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${label}"))`); }; // the Overview's other views, Open the full record and Sprint sit under ⋯ (XvATasks)
|
|
55
|
-
const overview = async (page) => {
|
|
55
|
+
const overview = async (page) => { await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .hi-pgh [data-hi-addtask]', { timeout: 30000 }); })(page); /* ← back to the initiative's page, else its row, else the address again (an initiative the list does not show) */ await page.click('#czViewer .hi-pgh [data-hi-addtask]'); /* the initiative's page (canvas HbC): its + drills into Tasks */ return until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-cz-vw="more"]') && !!document.querySelector('#czViewer [data-ov-tk="task:t1"]'))); };
|
|
56
56
|
const cur = (page) => page.evaluate(() => { const p = document.querySelector('#czViewer:not([hidden]) .obody.vw'); return { on: p ? p.dataset.vw : null, title: (document.querySelector('#czVwTitle') || {}).textContent || '', n: document.querySelectorAll('#czViewer .obody.vw').length }; });
|
|
57
57
|
const paneTxt = (page, id) => page.evaluate((k) => { const p = document.querySelector(`#czViewer .obody.vw[data-vw="${CSS.escape(k)}"]`); return p ? p.textContent.replace(/\s+/g, ' ') : ''; }, id);
|
|
58
58
|
const INI = 'item:ini:self-serve-v2';
|
|
@@ -72,7 +72,7 @@ const TICKETS = {
|
|
|
72
72
|
const IMODEL = IP.build(IF.facts());
|
|
73
73
|
// Home's initiative layout (premium-agreed-design): the card's Overview has the Sprint press; the Viewer shows one item at a time
|
|
74
74
|
const viaMore = async (pg, label) => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); await pg.click(`#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${label}"))`); }; // the Overview's other views, Open the full record and Sprint sit under ⋯ (XvATasks)
|
|
75
|
-
const overview = async (pg) => {
|
|
75
|
+
const overview = async (pg) => { await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .hi-pgh [data-hi-addtask]', { timeout: 30000 }); })(pg); /* ← back to the initiative's page, else its row, else the address again (an initiative the list does not show) */ await pg.click('#czViewer .hi-pgh [data-hi-addtask]'); /* the initiative's page (canvas HbC): its + drills into Tasks */ return until(() => pg.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]'))); };
|
|
76
76
|
const openSprint = async (pg) => { if (!(await pg.$('#czViewer:not([hidden]) [data-hi-v]'))) await overview(pg); /* open() already showed the Overview */ await viaMore(pg, 'Sprint'); };
|
|
77
77
|
const open = async ({ w = 1280, h = 900, theme = 'light', sprints = SPRINTS, tickets = TICKETS } = {}) => {
|
|
78
78
|
const ctx = await browser.newContext({ viewport: { width: w, height: h }, colorScheme: theme });
|
|
@@ -138,7 +138,7 @@ const TICKETS = {
|
|
|
138
138
|
&& await p.evaluate(() => [...document.querySelectorAll('#czViewer .obody.vw a[href]')].every((a) => a.href === 'https://acme.atlassian.net/browse/PMOS-142' && a.target === '_blank' && /noopener/.test(a.rel))));
|
|
139
139
|
await p.click('#czViewer .obody.vw [data-jt="PMOS-152"]');
|
|
140
140
|
ok('K6 a linked ticket opens in its own tab', !!(await until(async () => { const t = await paneText(p, 'jira:PMOS-152'); return t && /Release to existing workspaces/.test(t) && /No sprint/.test(t); })));
|
|
141
|
-
|
|
141
|
+
await (async (g) => { const P = '#czViewer:not([hidden]) [data-hi-v="page"]', r = '#hmList [data-hm-sel^="i:"][aria-current="true"]'; for (let i = 0; i < 4 && !(await g.$(P)) && (await g.$('#czViewer:not([hidden]) [data-cz-vw="back"]')); i++) { await g.click('#czViewer [data-cz-vw="back"]'); await g.waitForTimeout(150); } if (await g.$(P)) return; if (await g.$(r)) await g.click(r); else await g.reload(); await g.waitForSelector(P + ' .hi-pgh [data-hi-addtask]', { timeout: 30000 }); })(p); /* ← back to the initiative's page, else its row, else the address again (an initiative the list does not show) */ await p.click('#czViewer .hi-pgh [data-hi-addtask]'); /* the initiative's page (canvas HbC): its + drills into Tasks */
|
|
142
142
|
const k7 = await until(() => p.evaluate((t0) => { const m = document.querySelector('#czViewer:not([hidden]) .cz-vw-body'); return m && m.textContent === t0 ? m.textContent : null; }, mainTxt));
|
|
143
143
|
ok('K7 the Overview comes back with its own facts, as before', !!k7, await p.evaluate(() => ((document.querySelector('#czViewer .cz-vw-body') || {}).textContent || '').slice(0, 300)));
|
|
144
144
|
ok('K8 the views read the two Jira routes only, and wrote nothing', A.posts.filter((x) => !/thread|note|seen/.test(x)).length === 0 && A.reads.every((r) => /^\/api\/(jira\/tickets|boards\/sprints)\?/.test(r)) && A.reads.some((r) => /jira\/tickets\?.*initiative=self-serve-v2/.test(r)), JSON.stringify([A.posts, A.reads]));
|
|
@@ -161,12 +161,12 @@ function wire(body, key) {
|
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
163
|
/** The shell's id of an initiative: its record id, so Discuss in chat names it (?about=init:<id>&vid=<id>) and Home reopens it beside the chat. */
|
|
164
|
-
const vidOf = (r) => (r.id ? String(r.id) : 'bd:' + r.key);
|
|
164
|
+
export const vidOf = (r) => (r.id ? String(r.id) : 'bd:' + r.key);
|
|
165
165
|
export function openIni(r, from) {
|
|
166
166
|
if (!O || !r || !r.track) return;
|
|
167
167
|
// a row with no record id has no chat of its own: its question goes to the board's chat
|
|
168
168
|
VW.open({ kind: 'Initiative', title: r.title, icon: 'flag', id: vidOf(r), url: r.id ? O.pageHref(r) : '', full: true,
|
|
169
|
-
discuss: r.id ? true : () => location.assign(O.askHref(r, '')), more: iniMore(r),
|
|
169
|
+
discuss: r.id ? true : () => location.assign(O.askHref(r, '')), more: iniMore(r), rename: O.rename ? O.rename(r) : null,
|
|
170
170
|
render: (body) => { const x = O.rowOf(r.key) || r; cur = { key: x.key, tk: null }; O.onShow(x.key, from); body.innerHTML = iniBody(x); wire(body, x.key); },
|
|
171
171
|
onClose: () => { if (cur && cur.key === r.key && !cur.tk) { cur = null; O.onHide(); } } });
|
|
172
172
|
}
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* shell A since the second kit (initiative viewer-shell-a, V9): the shell's header, summary card and folding rows in place of the panel's own
|
|
3
3
|
* head and tabs. The content is the same. The shell floats at 560 px over the page's right edge and does not push the page.
|
|
4
4
|
*
|
|
5
|
-
* mount(o) once, from premium-board.js. o: { M() the Board model, programs() GET /api/programs' programs, openIni(id, from) the
|
|
6
|
-
* of a row of this board, close() what the shell shows for the Board, reload() reads the programs again, say(msg) the
|
|
5
|
+
* mount(o) once, from premium-board.js or home-app.js. o: { M() the Board model, programs() GET /api/programs' programs, openIni(id, from) the
|
|
6
|
+
* initiative of a row of this board, close() what the shell shows for the Board, reload() reads the programs again, say(msg) the
|
|
7
|
+
* toast, drill? true keeps the program behind the initiative it opens, so ← comes back to it (Home, canvas HbCProg) }
|
|
7
8
|
*
|
|
8
9
|
* The panel opens on document `bd:program` { id, from? }. A program row of the Board ([data-prog]) and ?program=<id> (Home links there) send
|
|
9
10
|
* that event through pm/bd-prog.js openProgram, the one path that opens it.
|
|
@@ -27,6 +28,7 @@ import { STEPS } from './premium-initiative-head.js';
|
|
|
27
28
|
import * as VW from './cozy-viewer.js';
|
|
28
29
|
import * as Pop from './bd-pop.js';
|
|
29
30
|
import { copyText } from './cozy-xv.js';
|
|
31
|
+
import { programRename } from './rename-press.js';
|
|
30
32
|
|
|
31
33
|
const SV = (d, w) => `<svg viewBox="0 0 24 24" width="${w || 18}" height="${w || 18}" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
32
34
|
const I = {
|
|
@@ -344,12 +346,20 @@ function textOf(p) {
|
|
|
344
346
|
for (const i of st.inis) lines.push('- ' + i.title + ' · ' + ((i.row.track && i.row.track.label) || i.stage || ''));
|
|
345
347
|
return lines.join('\n');
|
|
346
348
|
}
|
|
349
|
+
const titleOf = (p) => p.title + (p.goal ? ' · ' + p.goal : '');
|
|
347
350
|
function openPanel(id, from) {
|
|
348
351
|
if (!O || !O.M() || !progOf(id)) return false;
|
|
349
352
|
const p = progOf(id);
|
|
350
353
|
adding = false; period = null; O._perOpen = false;
|
|
351
|
-
|
|
352
|
-
|
|
354
|
+
// tap the title to rename (canvas RnAProg): the field holds the name only; the goal stays as it is
|
|
355
|
+
const rename = programRename({ pmPost, program: p, onSaved: async (o) => {
|
|
356
|
+
await O.reload(); VW.retitle('program:' + id, titleOf(progOf(id) || { ...p, title: o.title }));
|
|
357
|
+
O.say('Renamed', async () => { const u = await o.undo(); if (!u.ok) { O.say(u.error); return; } await O.reload(); VW.retitle('program:' + id, titleOf(progOf(id) || p)); });
|
|
358
|
+
} });
|
|
359
|
+
rename.save = ((save) => async (title, x) => { const r = await save(title, x); if (!r.ok) return r; p.title = r.title; rename.value = r.title; return { ...r, title: titleOf(p) }; })(rename.save);
|
|
360
|
+
rename.value = p.title;
|
|
361
|
+
VW.open({ kind: 'Program', title: titleOf(p), icon: I.prog, id: 'program:' + id,
|
|
362
|
+
discuss: true, more: moreOf(p), rename,
|
|
353
363
|
render: (body) => {
|
|
354
364
|
cur = { id, from: from && !(VW.body() && VW.body().contains(from)) ? from : (cur && cur.id === id && cur.from) || null };
|
|
355
365
|
body.classList.add('pp-vw');
|
|
@@ -378,7 +388,7 @@ async function press(b) {
|
|
|
378
388
|
else if (a === 'ms' || a === 'itasks') showRow(a);
|
|
379
389
|
else if (a === 'period') { O._perOpen = !O._perOpen; draw(true); }
|
|
380
390
|
else if (a === 'per' || a === 'early') { period = b.dataset.per; O._perOpen = false; draw(); const pb = VW.body() && VW.body().querySelector('[data-pp="period"]'); if (pb) pb.focus(); }
|
|
381
|
-
else if (a === 'ini') { const id = b.dataset.ini, from = document.querySelector(`#ibBody [data-prog="${CSS.escape(p.id)}"]`); VW.close(); O.openIni(id, from); }
|
|
391
|
+
else if (a === 'ini') { const id = b.dataset.ini, from = document.querySelector(`#ibBody [data-prog="${CSS.escape(p.id)}"]`); if (O.drill) VW.drill(); else VW.close(); O.openIni(id, from); }
|
|
382
392
|
else if (a === 'add') { adding = true; draw(); const i = VW.body() && VW.body().querySelector('.pp-add input'); if (i) i.focus(); }
|
|
383
393
|
else if (a === 'charter') openCharter(p);
|
|
384
394
|
else if (a === 'done') {
|
|
@@ -628,3 +628,8 @@ form.hm-box textarea { min-height: 48px; border: 0; background: none; resize: no
|
|
|
628
628
|
.hm-moved td { padding: 8px 0; border-bottom: 1px solid var(--cz-hair); }
|
|
629
629
|
.hm-moved td + td { padding-left: 12px; font-weight: 600; white-space: nowrap; }
|
|
630
630
|
@media (max-width: 760px) { .hm-kpis { grid-template-columns: 1fr; } }
|
|
631
|
+
/* the list stays when there is no room beside the chat (HbCNarrow): the Viewer lies over the chat, at most the room right of the list */
|
|
632
|
+
@media (min-width: 761px) {
|
|
633
|
+
body.cz-home.cz-vw-over .hm-vw { position: absolute; top: 16px; right: 16px; bottom: 16px; z-index: 5; }
|
|
634
|
+
body.cz-home.cz-vw-over .hm-vw .cz-vw { box-shadow: var(--cz-vlift); }
|
|
635
|
+
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* Sources pm/cozy-sources.js: what PMOS reads and how old each reading is, in the Viewer
|
|
10
10
|
* Settings pm/cozy-settings.js: General, Connectors, Workspaces, Updates, What's new
|
|
11
11
|
* A page with features the design does not draw yet passes opts.more (Home): a quiet "More" row then follows Settings.
|
|
12
|
+
* A page that passes opts.here() runs it when its own place is pressed, in place of a reload (Home: Menu > Home closes the page that is open).
|
|
12
13
|
* The counts come from GET /api/news-for-you and GET /api/sources, read when the page opens and every two minutes while it is shown.
|
|
13
14
|
* Nothing here leads to the console, and nothing here writes but the theme (this device).
|
|
14
15
|
*/
|
|
@@ -95,6 +96,9 @@ export function mountNav(here, doc = document, opts = {}) {
|
|
|
95
96
|
// set() redraws the button's icon, so the pressed icon may be gone from the page by now: only a press still on the page closes the menu
|
|
96
97
|
doc.addEventListener('click', (e) => { if (!menu.hidden && e.target.isConnected && !w.contains(e.target)) set(false); });
|
|
97
98
|
menu.addEventListener('click', (e) => {
|
|
99
|
+
// the page you are on, pressed again: a page that passes opts.here goes back to its start without a reload (Home: the list, no page open)
|
|
100
|
+
const a = e.target.closest('a[aria-current="page"]');
|
|
101
|
+
if (a && opts.here && !e.metaKey && !e.ctrlKey && !e.shiftKey) { e.preventDefault(); set(false); opts.here(); return; }
|
|
98
102
|
const b = e.target.closest('button'); if (!b) return;
|
|
99
103
|
if (b.dataset.evTheme) { setTheme(b.dataset.evTheme, doc); return; }
|
|
100
104
|
set(false);
|
|
@@ -267,6 +267,8 @@ body.cz-home .hm-lsc { margin: 0 -12px; padding: 0 12px 4px; }
|
|
|
267
267
|
.hv-pt { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--cz-ink); cursor: pointer; font-family: var(--cz-sans); border-radius: 14px; }
|
|
268
268
|
.hv-pf { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-height: 44px; padding: 0 10px 0 6px; border: 0; background: none; cursor: pointer; font-family: var(--cz-sans); border-radius: 14px; }
|
|
269
269
|
.hv-pf .hv-cv { margin-left: 0; }
|
|
270
|
+
/* the heading whose program or product is open in the Viewer (HbCProg, HbCProduct): its name carries the selection, as a row does */
|
|
271
|
+
.hv-gh.hv-prg.sel .hv-pt { background: var(--cz-bluebg); }
|
|
270
272
|
.hv-msd { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--cz-ink2); white-space: nowrap; }
|
|
271
273
|
.hv-msd.late { color: var(--cz-late); }
|
|
272
274
|
.hv-dm { display: block; width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); background: var(--cz-c-6b4fa3); }
|
|
@@ -20,12 +20,23 @@
|
|
|
20
20
|
* url the item's own address: "Open in a new tab" goes under ⋯ (full: true names it "Open in full")
|
|
21
21
|
* more [{ label, on(moreButton), note?, danger?, icon?, disabled? } | { sep: true }], or a function that returns it: the ⋯ menu; on() gets the ⋯ button as an anchor, in the xvMore order (change it, look back, stop or remove last)
|
|
22
22
|
* discuss true, { href }, or fn(): the quiet "Discuss in chat" icon before ⋯. Never drawn on Home, where the chat is already beside it.
|
|
23
|
+
* rename { save(title, { jira }) → Promise<{ ok, title?, error? }>, max?, value?, jira?: { label, key } }: the title is the rename press
|
|
24
|
+
* (value: the name the field starts from when the title shows more, as a program's "title · goal")
|
|
25
|
+
* (canvas RnATask, RnAIni, RnAProg, RnAPhone). A tap turns it into one field with a check: Enter or the check saves, Esc
|
|
26
|
+
* cancels, an empty or unchanged name saves nothing. jira draws "Rename the Jira … too" under the field, off by default.
|
|
27
|
+
* The caller writes the record and says "Renamed" with Undo; the header shows the saved name at once.
|
|
23
28
|
* true goes to Home with ?about=<kind>:<id>&label=<title>; { href } goes there; fn() runs instead.
|
|
24
29
|
* back true: keep the item shown now, so ← comes back to it. Without back, opening an item forgets what was behind it.
|
|
30
|
+
* keep true: this item takes the place of the one shown now, and what was behind that one stays behind this one (a view switch)
|
|
31
|
+
* add { label, on(button) }: a quiet + before ⋯ (Home's "New session" on an initiative, canvas HbC). Not drawn on a phone.
|
|
25
32
|
* render called with the body element to draw into; html is the same as a string. Neither: the body is left empty for the caller.
|
|
26
33
|
* id optional; current() returns it, so a caller can tell whether its item is the one shown
|
|
27
34
|
* onClose called once when this item leaves the card (Close, Escape, close(), or another open())
|
|
28
35
|
* close() · back() · isOpen() · current() → { id, kind, title, url } | null · body() → the body element or null
|
|
36
|
+
* drill() the next open() keeps the item shown now behind it, as back: true does (a page opens a task or a document from its own
|
|
37
|
+
* rows through a module that does not know it is a drill-in: Home's initiative page, canvas HbCDrill)
|
|
38
|
+
* Overlay (canvas HbCNarrow): a host marked data-cz-vw-overlay keeps its list when there is no room beside the chat; the Viewer then
|
|
39
|
+
* lies over the chat (body.cz-vw-over) instead of folding the list to a rail. Open wide still folds it.
|
|
29
40
|
* placeholder(featureName, { kind?, icon? }) opens the card with czPlaceholder(featureName) in it (cozy-placeholder.js)
|
|
30
41
|
* onChange(fn) → fn({ open, id, kind, title }) after each open and close; document also gets the event 'cz-viewer' with the same detail.
|
|
31
42
|
* czSummary({ line, tone, right, text, meta, primary, also, extra }) → the summary card's markup: one line of state, the words, one quiet meta
|
|
@@ -61,7 +72,7 @@ export const ICONS = {
|
|
|
61
72
|
warn: 'M12 3l9 16H3zM12 10v4M12 17h.01',
|
|
62
73
|
};
|
|
63
74
|
const P = {
|
|
64
|
-
back: 'M14 6l-6 6 6 6', more: 'M5 12h.01M12 12h.01M19 12h.01', close: 'M6 6l12 12M18 6L6 18',
|
|
75
|
+
add: 'M12 5v14M5 12h14', back: 'M14 6l-6 6 6 6', more: 'M5 12h.01M12 12h.01M19 12h.01', close: 'M6 6l12 12M18 6L6 18',
|
|
65
76
|
wide: 'M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7', side: 'M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7',
|
|
66
77
|
chat: 'M5 6.5A2.5 2.5 0 0 1 7.5 4h9A2.5 2.5 0 0 1 19 6.5v7a2.5 2.5 0 0 1-2.5 2.5H11l-4 3.5V16h.5A2.5 2.5 0 0 1 5 13.5z',
|
|
67
78
|
tab: 'M14 4h6v6M20 4l-9 9M18 14v6H4V6h6', chev: 'M10 7l5 5-5 5', down: 'M7 10l5 5 5-5', list: 'M3.5 4.5h17v15h-17zM14 4.5v15',
|
|
@@ -79,11 +90,19 @@ const isPhone = () => typeof innerWidth === 'number' && innerWidth <= PHONE;
|
|
|
79
90
|
const onHome = () => typeof document !== 'undefined' && !!document.body && document.body.classList.contains('cz-home');
|
|
80
91
|
const kindKey = (k) => String(k || 'item').trim().toLowerCase().replace(/^file · .*/, 'file').replace(/[^a-z0-9]+/g, '-').slice(0, 40) || 'item';
|
|
81
92
|
|
|
82
|
-
const V = { el: null, cur: null, back: null, subs: [], stack: [], wide: false, rail: false, w: 0 };
|
|
93
|
+
const V = { el: null, cur: null, back: null, subs: [], stack: [], wide: false, rail: false, w: 0, drill: false, over: false };
|
|
83
94
|
|
|
84
95
|
/** "PRD" over "PRD", or "File · plans/x.md" over "x.md": the kind is left out when it only repeats the title */
|
|
85
96
|
const sameAs = (kind, title) => { const k = String(kind || '').trim().toLowerCase().replace(/^file · /, ''), t = String(title || '').trim().toLowerCase(); return !!t && (k === t || k.split('/').pop() === t || k.split('/').pop().replace(/\.[a-z]+$/, '') === t); };
|
|
86
97
|
const ib = (act, label, d, extra = '') => `<button type="button" class="cz-vw-ib" data-cz-vw="${act}" aria-label="${esc(label)}" title="${esc(label)}"${extra}>${svg(d, 18, act === 'more' ? 3 : 1.8)}</button>`;
|
|
98
|
+
/** The rename field in the title's place (RnATask): the name, a blue check; the Jira box under it when the item has a Jira twin. */
|
|
99
|
+
function renHtml(o) {
|
|
100
|
+
const r = o.rename || {}, max = r.max || 120;
|
|
101
|
+
const j = r.jira && r.jira.label ? `<label class="cz-vw-jt"><input type="checkbox" data-cz-vw-jira${o.renJira ? ' checked' : ''}>${esc(r.jira.label)}${r.jira.key ? `<span class="k">${esc(r.jira.key)}</span>` : ''}</label>` : '';
|
|
102
|
+
const err = o.renError ? `<p class="cz-vw-rnerr" role="alert">${esc(o.renError)}</p>` : '';
|
|
103
|
+
return `<form class="cz-vw-ren" data-cz-vw-ren data-esc-layer><input id="czVwTitle" type="text" value="${esc(o.renValue != null ? o.renValue : o.title || '')}" maxlength="${max}" aria-label="Name" autocomplete="off"${o.renBusy ? ' disabled' : ''}>`
|
|
104
|
+
+ `<button type="submit" class="cz-vw-sv" aria-label="Save the name" title="Save (Enter). Esc cancels."${o.renBusy ? ' disabled' : ''}>${svg('M5 12.5l4.5 4.5L19 7.5', 16, 2.2)}</button></form>` + j + err;
|
|
105
|
+
}
|
|
87
106
|
/** The header's markup for one item; pure, so a unit test can read it. o.canBack: ← is drawn; o.isWide: ⤢ reads "Back to the side". */
|
|
88
107
|
export function headHtml(it) {
|
|
89
108
|
const o = it || {};
|
|
@@ -91,10 +110,11 @@ export function headHtml(it) {
|
|
|
91
110
|
const kind = o.kind && !sameAs(o.kind, o.title) ? `<p class="cz-vw-kind">${esc(o.kind)}</p>` : '';
|
|
92
111
|
const disc = o.discuss && !o.home ? ib('discuss', 'Discuss in chat', P.chat) : '';
|
|
93
112
|
const more = typeof o.more === 'function' || (Array.isArray(o.more) && o.more.some((m) => m && !m.sep)) || o.url ? ib('more', 'More', P.more, ' aria-haspopup="menu" aria-expanded="false"') : '';
|
|
113
|
+
const add = o.add && o.add.label && !phone ? ib('add', o.add.label, P.add) : '';
|
|
94
114
|
return (o.canBack || phone ? ib('back', o.canBack ? 'Back' : 'Close the viewer', P.back) : '')
|
|
95
115
|
+ `<span class="cz-vw-tile" aria-hidden="true">${svg(path(o.icon), 17)}</span>`
|
|
96
|
-
+ `<div class="cz-vw-t">${kind}<h3 class="cz-vw-title" id="czVwTitle">${esc(o.title || '')}</h3></div>`
|
|
97
|
-
+ disc + more
|
|
116
|
+
+ (o.renaming ? renHtml(o) : `<div class="cz-vw-t">${kind}<h3 class="cz-vw-title" id="czVwTitle">${o.rename ? `<button type="button" class="cz-vw-rn" data-cz-vw-rn aria-label="${esc('Rename ' + (o.title || ''))}" title="Rename">${esc(o.title || '')}</button>` : esc(o.title || '')}</h3></div>`)
|
|
117
|
+
+ disc + add + more
|
|
98
118
|
+ (phone ? '' : ib('wide', o.isWide ? 'Back to the side' : 'Open wide', o.isWide ? P.side : P.wide, ` aria-pressed="${o.isWide ? 'true' : 'false'}"`))
|
|
99
119
|
+ (phone ? '' : `<button type="button" class="cz-vw-ib" data-cz-vw="close" aria-label="Close the viewer" title="Close">${svg(P.close, 18)}</button>`);
|
|
100
120
|
}
|
|
@@ -169,7 +189,7 @@ function room() {
|
|
|
169
189
|
const right = inner - (lw ? lw + gap : 0);
|
|
170
190
|
const side = right - gap - CHAT;
|
|
171
191
|
const wideMax = Math.min(Math.round(innerWidth * MAXF), inner - (list ? RAIL + gap : 0) - gap - CHAT);
|
|
172
|
-
return { float: false, def: Math.max(MIN, Math.round(right / 2)), side, wideMax: Math.max(wideMax, side), hasList: !!list };
|
|
192
|
+
return { float: false, def: Math.max(MIN, Math.round(right / 2)), side, wideMax: Math.max(wideMax, side), hasList: !!list, right };
|
|
173
193
|
}
|
|
174
194
|
export const widthOf = (kind) => { const n = parseInt(store.get('cz-vw-w:' + kindKey(kind)) || '', 10); return n > 0 ? n : null; };
|
|
175
195
|
function setRail(on) {
|
|
@@ -210,6 +230,10 @@ function apply(px) {
|
|
|
210
230
|
const el = V.el; if (!el) return;
|
|
211
231
|
if (isPhone()) { el.style.width = ''; el.style.flexBasis = ''; el.classList.remove('cz-vw-w2'); setRail(false); return; }
|
|
212
232
|
let r = room();
|
|
233
|
+
// a host that keeps its list (Home, HbCNarrow): with no room beside the chat the Viewer lies over the chat, at most the room right of the list
|
|
234
|
+
const over = !r.float && r.hasList && r.side < MIN && !V.wide && !!(el.parentNode && el.parentNode.hasAttribute('data-cz-vw-overlay'));
|
|
235
|
+
if (over !== V.over) { V.over = over; document.body.classList.toggle('cz-vw-over', over); }
|
|
236
|
+
if (over) { setRail(false); r = room(); const w = Math.max(Math.min(MIN, r.right), Math.min(Math.round(px || r.def), r.right)); V.w = w; el.style.width = w + 'px'; el.style.flexBasis = w + 'px'; el.classList.toggle('cz-vw-w2', w >= W2); return; }
|
|
213
237
|
if (!r.float && r.hasList && r.side < MIN) { setRail(true); r = room(); } // under 1100 px: the list folds as the Viewer opens
|
|
214
238
|
let w = Math.max(MIN, Math.round(px || r.def));
|
|
215
239
|
if (!r.float) {
|
|
@@ -310,14 +334,20 @@ function mount() {
|
|
|
310
334
|
el.prepend(grip(el));
|
|
311
335
|
el.addEventListener('click', (e) => { // the header's presses, and the folds of czSections in the body
|
|
312
336
|
const f = e.target.closest('[data-czs-fold]'); if (f && el.contains(f)) { toggleFold(f); return; }
|
|
337
|
+
if (e.target.closest('[data-cz-vw-rn]')) { startRename(); return; } // the title is the rename press (RnATask)
|
|
313
338
|
const b = e.target.closest('[data-cz-vw]'); if (!b || b.disabled || !el.querySelector('.cz-vw-hd').contains(b)) return;
|
|
314
339
|
const a = b.dataset.czVw;
|
|
315
340
|
if (a === 'close') close();
|
|
316
341
|
else if (a === 'back') { if (V.stack.length) back(); else close(); }
|
|
317
342
|
else if (a === 'more') moreMenu(b);
|
|
343
|
+
else if (a === 'add') { if (V.cur && V.cur.add && typeof V.cur.add.on === 'function') V.cur.add.on(b); }
|
|
318
344
|
else if (a === 'wide') wide();
|
|
319
345
|
else if (a === 'discuss') discuss();
|
|
320
346
|
});
|
|
347
|
+
el.addEventListener('submit', (e) => { if (e.target.closest('[data-cz-vw-ren]')) { e.preventDefault(); saveRename(); } });
|
|
348
|
+
el.addEventListener('keydown', (e) => { if (e.key === 'Escape' && e.target.closest('[data-cz-vw-ren]')) { e.preventDefault(); e.stopPropagation(); endRename(); } });
|
|
349
|
+
el.addEventListener('input', (e) => { if (e.target.id === 'czVwTitle' && V.cur && V.cur.renaming) V.cur.renValue = e.target.value; });
|
|
350
|
+
el.addEventListener('change', (e) => { if (e.target.matches('[data-cz-vw-jira]') && V.cur) V.cur.renJira = e.target.checked; });
|
|
321
351
|
place(el);
|
|
322
352
|
V.el = el;
|
|
323
353
|
if (typeof ResizeObserver !== 'undefined') new ResizeObserver(() => {
|
|
@@ -345,18 +375,50 @@ function leave() {
|
|
|
345
375
|
function redraw() {
|
|
346
376
|
if (!V.el || !V.cur) return;
|
|
347
377
|
V.ph = isPhone();
|
|
348
|
-
V.el.querySelector('.cz-vw-hd')
|
|
378
|
+
const hd = V.el.querySelector('.cz-vw-hd');
|
|
379
|
+
hd.innerHTML = headHtml({ ...V.cur, canBack: V.stack.length > 0, isWide: V.wide || V.rail, phone: V.ph, home: onHome() });
|
|
380
|
+
hd.classList.toggle('cz-vw-renon', !!V.cur.renaming);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/* ── rename: the title is the press (RnATask) ── */
|
|
384
|
+
function startRename() {
|
|
385
|
+
if (!V.cur || !V.cur.rename || V.cur.renaming) return;
|
|
386
|
+
Object.assign(V.cur, { renaming: true, renValue: V.cur.rename.value != null ? V.cur.rename.value : V.cur.title, renJira: false, renError: '', renBusy: false });
|
|
387
|
+
redraw();
|
|
388
|
+
const i = V.el.querySelector('#czVwTitle'); if (i) { i.focus(); i.select(); }
|
|
389
|
+
}
|
|
390
|
+
function endRename(focusTitle = true) {
|
|
391
|
+
if (!V.cur) return;
|
|
392
|
+
Object.assign(V.cur, { renaming: false, renValue: null, renError: '', renBusy: false });
|
|
393
|
+
redraw();
|
|
394
|
+
if (focusTitle) { const b = V.el.querySelector('[data-cz-vw-rn]'); if (b) b.focus(); }
|
|
395
|
+
}
|
|
396
|
+
async function saveRename() {
|
|
397
|
+
const cur = V.cur; if (!cur || !cur.renaming || cur.renBusy) return;
|
|
398
|
+
const i = V.el.querySelector('#czVwTitle'); const v = String((i && i.value) || '').replace(/\s+/g, ' ').trim();
|
|
399
|
+
if (!v) { if (i) i.focus(); return; } // an empty name is not saved: the field stays
|
|
400
|
+
if (v === (cur.rename.value != null ? cur.rename.value : cur.title)) { endRename(); return; }
|
|
401
|
+
Object.assign(cur, { renValue: v, renBusy: true, renError: '' }); redraw();
|
|
402
|
+
let r = null;
|
|
403
|
+
try { r = await cur.rename.save(v, { jira: !!cur.renJira }); } catch { r = null; }
|
|
404
|
+
if (V.cur !== cur) return; // another item opened while it saved
|
|
405
|
+
if (!r || r.ok !== true) { Object.assign(cur, { renBusy: false, renError: (r && r.error) || 'The name was not saved.' }); redraw(); const j = V.el.querySelector('#czVwTitle'); if (j) j.focus(); return; }
|
|
406
|
+
cur.title = r.title || v; if (cur.rename.value != null && r.title == null) cur.rename.value = v; if (cur.args) cur.args = { ...cur.args, title: cur.title };
|
|
407
|
+
endRename(); emit();
|
|
349
408
|
}
|
|
409
|
+
/** The caller's own rename landed elsewhere (Undo, or a reload): the header shows the name. */
|
|
410
|
+
export function retitle(id, title) { if (V.cur && V.cur.id === String(id) && title) { V.cur.title = title; if (V.cur.args) V.cur.args = { ...V.cur.args, title }; if (!V.cur.renaming) redraw(); emit(); } }
|
|
350
411
|
|
|
351
412
|
/** Show one item in the Viewer, in place of the one shown. Returns the body element the content is in. */
|
|
352
413
|
export function open(it) {
|
|
353
414
|
const o = it || {};
|
|
354
415
|
const el = mount(); place(el);
|
|
355
416
|
if (!V.cur) { const ae = document.activeElement; V.back = ae && ae !== document.body && !el.contains(ae) ? ae : null; }
|
|
356
|
-
if (o.back && V.cur && V.cur.args) V.stack.push(V.cur.args); else if (!o._back) V.stack = [];
|
|
417
|
+
if ((o.back || V.drill) && V.cur && V.cur.args) V.stack.push(V.cur.args); else if (!o._back && !o.keep) V.stack = [];
|
|
418
|
+
V.drill = false;
|
|
357
419
|
const sameKind = V.cur && kindKey(V.cur.kind) === kindKey(o.kind);
|
|
358
420
|
leave();
|
|
359
|
-
V.cur = { id: o.id == null ? null : String(o.id), kind: o.kind || '', title: o.title || '', icon: o.icon, url: o.url || '', full: !!o.full, onClose: o.onClose, more: o.more, discuss: o.discuss, args: o };
|
|
421
|
+
V.cur = { id: o.id == null ? null : String(o.id), kind: o.kind || '', title: o.title || '', icon: o.icon, url: o.url || '', full: !!o.full, onClose: o.onClose, more: o.more, discuss: o.discuss, add: o.add || null, rename: o.rename && typeof o.rename.save === 'function' ? o.rename : null, args: o };
|
|
360
422
|
el.setAttribute('aria-label', 'Viewer: ' + (o.kind || o.title || 'item'));
|
|
361
423
|
redraw();
|
|
362
424
|
const m = el.querySelector('.cz-vw-menu'); if (m) m.remove();
|
|
@@ -371,6 +433,8 @@ export function open(it) {
|
|
|
371
433
|
if (isPhone()) el.focus();
|
|
372
434
|
return body;
|
|
373
435
|
}
|
|
436
|
+
/** The next open() is a drill-in: the item shown now stays behind it, and ← comes back to it. Nothing open: nothing to keep. */
|
|
437
|
+
export function drill() { V.drill = isOpen(); }
|
|
374
438
|
/** ← : the item that was shown before this drill-in, drawn again. With nothing behind, ← closes. */
|
|
375
439
|
export function back() {
|
|
376
440
|
const prev = V.stack.pop();
|
|
@@ -381,7 +445,8 @@ export function back() {
|
|
|
381
445
|
export function close() {
|
|
382
446
|
if (!V.el || V.el.hidden) return;
|
|
383
447
|
leave();
|
|
384
|
-
V.stack = []; V.wide = false;
|
|
448
|
+
V.stack = []; V.wide = false; V.drill = false;
|
|
449
|
+
if (V.over) { V.over = false; document.body.classList.remove('cz-vw-over'); }
|
|
385
450
|
V.el.hidden = true;
|
|
386
451
|
V.el.querySelector('.cz-vw-body').innerHTML = '';
|
|
387
452
|
const m = V.el.querySelector('.cz-vw-menu'); if (m) m.remove();
|
|
@@ -408,4 +473,4 @@ if (typeof window !== 'undefined' && typeof window.addEventListener === 'functio
|
|
|
408
473
|
e.preventDefault(); e.stopImmediatePropagation(); close();
|
|
409
474
|
}, true);
|
|
410
475
|
}
|
|
411
|
-
if (typeof window !== 'undefined') window.czViewer = { open, close, back, isOpen, current, body, onChange, placeholder, czSummary, czSections, widthOf, setWidth, wide, railOn, ICONS };
|
|
476
|
+
if (typeof window !== 'undefined') window.czViewer = { open, close, back, drill, isOpen, current, body, onChange, placeholder, retitle, czSummary, czSections, widthOf, setWidth, wide, railOn, ICONS };
|
|
@@ -13,6 +13,20 @@
|
|
|
13
13
|
.cz-vw-kind { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* say it once: the kind is for a screen reader */
|
|
14
14
|
.cz-vw-title { font-size: 16px; font-weight: 800; }
|
|
15
15
|
.cz-vw-ib { border-radius: 999px; }
|
|
16
|
+
|
|
17
|
+
/* rename (canvas RnATask, RnAIni, RnAProg, RnAPhone): the title is the press; a tap makes it one field with a blue check */
|
|
18
|
+
.cz-vw-rn { font: inherit; color: inherit; background: transparent; border: 0; margin: 0 0 0 -6px; padding: 2px 6px; border-radius: 10px; cursor: text; text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
|
|
19
|
+
.cz-vw-rn:hover { background: var(--cz-well); }
|
|
20
|
+
.cz-vw-rn:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 1px; }
|
|
21
|
+
.cz-vw-hd.cz-vw-renon { flex-wrap: wrap; }
|
|
22
|
+
.cz-vw-ren { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; height: 40px; margin-right: 6px; border-radius: 12px; background: var(--cz-card); box-shadow: 0 0 0 1.5px var(--cz-blue), 0 0 0 5px color-mix(in srgb, var(--cz-blue) 14%, transparent); padding: 0 4px 0 10px; }
|
|
23
|
+
.cz-vw-ren input { flex: 1; min-width: 0; font: inherit; font-size: 16px; font-weight: 800; color: var(--cz-ink); border: 0; background: transparent; outline: 0; padding: 0; }
|
|
24
|
+
.cz-vw-sv { width: 32px; height: 32px; border-radius: 999px; border: 0; background: var(--cz-solid); color: var(--cz-onsolid); display: inline-flex; align-items: center; justify-content: center; flex: none; cursor: pointer; }
|
|
25
|
+
.cz-vw-sv:disabled { opacity: .6; cursor: default; }
|
|
26
|
+
.cz-vw-jt { flex-basis: 100%; display: flex; align-items: center; gap: 10px; margin: 8px 16px 0 46px; font-size: 13px; color: var(--cz-ink2); font-weight: 600; cursor: pointer; }
|
|
27
|
+
.cz-vw-jt input { width: 18px; height: 18px; margin: 0; accent-color: var(--cz-solid); flex: none; }
|
|
28
|
+
.cz-vw-jt .k { color: var(--cz-ink3); font-weight: 700; }
|
|
29
|
+
.cz-vw-rnerr { flex-basis: 100%; margin: 6px 16px 0 46px; font-size: 12.5px; color: var(--cz-red); }
|
|
16
30
|
.cz-vw-ib svg { width: 18px; height: 18px; }
|
|
17
31
|
.cz-vw-ib[aria-pressed="true"] { background: var(--cz-bluebg); color: var(--cz-blueink); }
|
|
18
32
|
.cz-vw-hd [data-cz-vw="back"] { margin-left: -6px; }
|
|
@@ -80,7 +94,7 @@ body.cz-vw-drag, body.cz-vw-drag * { cursor: col-resize !important; user-select:
|
|
|
80
94
|
.czs-it .w span { display: block; font-size: 12.5px; color: var(--cz-ink3); }
|
|
81
95
|
/* a row's leading tile (XvATask): a document glyph on the well, or the Jira J on blue */
|
|
82
96
|
.ut-tki { width: 28px; height: 28px; border-radius: 9px; background: var(--cz-well); color: var(--cz-ink2); display: inline-grid; place-items: center; flex: none; }
|
|
83
|
-
.ut-tki.j { background: var(--cz-
|
|
97
|
+
.ut-tki.j { background: var(--cz-solid); color: var(--cz-onsolid); font-size: 11px; font-weight: 800; }
|
|
84
98
|
.czs-it:has(.ut-tki) { align-items: center; }
|
|
85
99
|
.ut-tki.dash { background: none; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--cz-ink3) 45%, var(--cz-card)); }
|
|
86
100
|
.czs-amb { width: 8px; height: 8px; border-radius: 50%; background: var(--cz-dot-risk); flex: none; align-self: center; margin-left: 8px; }
|
|
@@ -112,6 +126,10 @@ body.cz-vw-rail [data-cz-vw-list] > :not(.cz-vw-railbar), body.cz-vw-rail #hmLis
|
|
|
112
126
|
.cz-vw-grip { display: none; }
|
|
113
127
|
.cz-vw-hd { padding: 8px 4px 0 6px; }
|
|
114
128
|
.cz-vw-hd [data-cz-vw="back"] { margin-left: 0; }
|
|
129
|
+
.cz-vw-rn { min-height: 44px; }
|
|
130
|
+
.cz-vw-ren { height: 44px; }
|
|
131
|
+
.cz-vw-ren input { font-size: 17px; }
|
|
132
|
+
.cz-vw-sv { width: 36px; height: 36px; }
|
|
115
133
|
.cz-vw-body { padding: 4px 16px 16px; }
|
|
116
134
|
.cz-vw-menu { right: 8px; }
|
|
117
135
|
.cz-vw-menu button, .czs-ib { min-height: 44px; }
|
|
@@ -120,6 +138,7 @@ body.cz-vw-rail [data-cz-vw-list] > :not(.cz-vw-railbar), body.cz-vw-rail #hmLis
|
|
|
120
138
|
}
|
|
121
139
|
/* a touch screen wider than a phone (a tablet, a phone held sideways) keeps the 44 px presses too */
|
|
122
140
|
@media (pointer: coarse) {
|
|
141
|
+
.cz-vw-rn { min-height: 44px; }
|
|
123
142
|
.cz-vw-menu button, .czs-ib { min-height: 44px; }
|
|
124
143
|
.czs-pri, .czs-sec2 { height: 44px; min-height: 44px; }
|
|
125
144
|
.czs-ib { width: 44px; }
|