create-pmos 0.713.0 → 0.715.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 +45 -39
- package/payload/KIT-VERSION +1 -1
- package/payload/design-system/ui/interactions.md +8 -0
- 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/changelog.json +44 -0
- package/workspace/design-system/ui/interactions.md +8 -0
- package/workspace/guide/breakdown.md +11 -0
- package/workspace/guide/layout.md +19 -0
- package/workspace/lib/backlog.js +3 -1
- package/workspace/lib/board-premium.js +1 -1
- package/workspace/lib/engine/boards.js +9 -2
- package/workspace/lib/moments.js +41 -3
- package/workspace/lib/routes-boards.js +19 -5
- package/workspace/lib/routes-moments.js +1 -1
- package/workspace/lib/task-store.js +1 -1
- package/workspace/lib/use-log.js +27 -3
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-vw-doc-test.js +2 -0
- package/workspace/public/pm/action-keys.js +234 -0
- package/workspace/public/pm/bd-backlog-ds.js +9 -3
- package/workspace/public/pm/bd-backlog.js +20 -1
- package/workspace/public/pm/bd-pop-ds.js +6 -1
- package/workspace/public/pm/bd-work-ds.css +1 -1
- package/workspace/public/pm/cozy-ev.css +8 -0
- package/workspace/public/pm/cozy-nav.js +2 -0
- package/workspace/public/pm/cozy-pop-work.js +38 -0
- package/workspace/public/pm/ini-view-model.js +1 -1
- package/workspace/public/pm/inline-fields.js +64 -0
- package/workspace/public/pm/page-chat.js +16 -0
- package/workspace/public/pm/pop-work-model.js +1 -1
- package/workspace/public/pm/premium-insights.js +2 -2
- package/workspace/public/pm/quiet-place.js +15 -2
- package/workspace/public/pm/state-blocks.js +31 -0
- package/workspace/public/pm/use-log.js +9 -0
- package/workspace/test-lists/action-keys.json +9 -0
- package/workspace/test-lists/inline-sprint-priority.json +9 -0
|
@@ -5,8 +5,12 @@
|
|
|
5
5
|
* quietPlace(place, stage) follows the menu's read of GET /api/moments (the event 'cz:moments' from pm/cozy-nav.js): while the place is
|
|
6
6
|
* quiet, the page's panel shows only its line; the moment it opens, the page is back as it was
|
|
7
7
|
* quietLine(place) the line while that place is quiet, else '' (Intelligence's reports panel uses it for its empty state)
|
|
8
|
+
* quietNext(place) the one next step that fills the place, as state-blocks.js next() draws it, else '' (initiative
|
|
9
|
+
* empty-page-next-action: Make initiatives from the Jira epics PMOS read · Draft from the strategy · Paste a list)
|
|
8
10
|
* A published (read-only) copy is never quiet. Quiet only applies when every workspace on this computer is new and none has reached that
|
|
9
11
|
* place, so a PMOS already in use never loses a page. */
|
|
12
|
+
import { next } from './state-blocks.js';
|
|
13
|
+
|
|
10
14
|
let last = null;
|
|
11
15
|
if (typeof document !== 'undefined') document.addEventListener('cz:moments', (e) => { last = e.detail || null; });
|
|
12
16
|
|
|
@@ -16,14 +20,23 @@ export const quietLine = (place) => {
|
|
|
16
20
|
return p && p.quiet ? String(p.line || '') : '';
|
|
17
21
|
};
|
|
18
22
|
|
|
23
|
+
export const quietNext = (place) => {
|
|
24
|
+
if (!quietLine(place)) return '';
|
|
25
|
+
const p = last.places[place];
|
|
26
|
+
return next(p && p.next);
|
|
27
|
+
};
|
|
28
|
+
|
|
19
29
|
export function quietPlace(place, stage, doc = document) {
|
|
20
30
|
if (!stage || (typeof window !== 'undefined' && window.PMOS_READONLY)) return;
|
|
21
31
|
const draw = () => {
|
|
22
32
|
const line = quietLine(place);
|
|
23
33
|
let el = stage.querySelector(':scope > .qp-line');
|
|
24
34
|
if (!line) { stage.classList.remove('qp-on'); if (el) el.remove(); return; }
|
|
25
|
-
if (!el) { el = doc.createElement('
|
|
26
|
-
|
|
35
|
+
if (!el) { el = doc.createElement('div'); el.className = 'qp-line'; stage.prepend(el); }
|
|
36
|
+
const p = doc.createElement('p'); p.setAttribute('role', 'status'); p.textContent = line;
|
|
37
|
+
el.replaceChildren(p);
|
|
38
|
+
const step = quietNext(place);
|
|
39
|
+
if (step) el.insertAdjacentHTML('beforeend', step);
|
|
27
40
|
stage.classList.add('qp-on');
|
|
28
41
|
};
|
|
29
42
|
doc.addEventListener('cz:moments', () => setTimeout(draw, 0));
|
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
* error(line, { retry }) one line in words that says what failed, and Retry when the page can try again.
|
|
7
7
|
* `retry` is the data attribute the page listens for, e.g. 'data-vc-retry'.
|
|
8
8
|
*
|
|
9
|
+
* next(step) the one next step of a page with nothing in it yet (initiative empty-page-next-action): the Komorebi
|
|
10
|
+
* Suggestion part, ✦ and step.say, with one icon-only primary button. step = { id, say, ask } from
|
|
11
|
+
* lib/moments.js nextOf; null draws nothing. A press puts step.ask in the one chat, unsent (Home's own box
|
|
12
|
+
* on Home, else page-chat.js ask), so the person reads it and sends it: nothing is kept without their yes.
|
|
13
|
+
* The button's first data attribute is data-sb-next, the name the local use log counts it under.
|
|
14
|
+
*
|
|
9
15
|
* `line` and `what` are plain text and are escaped here. `step` is trusted HTML the page built (a button or a link).
|
|
10
16
|
* The look lives in ui/components/bundle.css (.pm-state), so a Komorebi token change reaches every state on every page.
|
|
11
17
|
* An error writes one [state-block] line per distinct failure, so a responder can find it in the console. */
|
|
@@ -13,6 +19,7 @@
|
|
|
13
19
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
14
20
|
const ATTR = /^data-[a-z0-9-]+(="[^"<>]*")?$/; // a page's own press mark, nothing else
|
|
15
21
|
const RETRY = '<svg class="pm-ic" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/></svg>';
|
|
22
|
+
const SEND = '<svg class="pm-ic" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg>';
|
|
16
23
|
const said = new Set();
|
|
17
24
|
|
|
18
25
|
export function empty(line, { step = '' } = {}) {
|
|
@@ -34,3 +41,27 @@ export function error(line, { retry = '' } = {}) {
|
|
|
34
41
|
const btn = mark ? `<button type="button" class="pm-btn" aria-label="Try again" title="Try again" ${mark}>${RETRY}</button>` : '';
|
|
35
42
|
return `<p class="pm-state error" role="alert"><span>${esc(text)}</span>${btn}</p>`;
|
|
36
43
|
}
|
|
44
|
+
|
|
45
|
+
export function next(step) {
|
|
46
|
+
if (!step || !step.say || !step.ask) return '';
|
|
47
|
+
const name = 'Write it in the chat for you to send';
|
|
48
|
+
return `<div class="pm-sug pm-state-next"><span class="pm-star" aria-hidden="true">✦</span><span class="say">${esc(step.say)}</span>`
|
|
49
|
+
+ `<button type="button" data-sb-next="${esc(step.ask)}" class="pm-btn primary" aria-label="${name}" title="${name}">${SEND}</button></div>`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The step's words go in the one chat, not sent: Home's own box on Home, else the chat over this page. */
|
|
53
|
+
async function askInChat(text) {
|
|
54
|
+
const box = document.getElementById('hmIn');
|
|
55
|
+
if (box) { box.value = text; box.dispatchEvent(new Event('input', { bubbles: true })); box.focus(); return; }
|
|
56
|
+
let ws; try { ws = new URLSearchParams(location.search).get('ws') || undefined; } catch { ws = undefined; }
|
|
57
|
+
const M = await import('./page-chat.js');
|
|
58
|
+
await M.ask(text, { ws });
|
|
59
|
+
}
|
|
60
|
+
if (typeof document !== 'undefined' && document.addEventListener) {
|
|
61
|
+
document.addEventListener('click', (e) => {
|
|
62
|
+
const b = e.target && e.target.closest ? e.target.closest('[data-sb-next]') : null;
|
|
63
|
+
if (!b) return;
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
askInChat(b.getAttribute('data-sb-next') || '').catch(() => null);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* a script drives (navigator.webdriver: a test or a crawler is not the user's own use).
|
|
6
6
|
* controlOf(el) PURE: the name a pressed element is logged under, or '' to log nothing
|
|
7
7
|
* deviceOf(width) PURE: phone (≤ 760 px), tablet (≤ 1100 px) or desk
|
|
8
|
+
* noteUse(control) note one use a page names itself (pm/action-keys.js counts its key presses as key-<action> or key-miss)
|
|
8
9
|
*
|
|
9
10
|
* HIDE THE BUTTONS NOBODY PRESSES (idea A454; the rule and the store are lib/unused-controls.js). startUseLog also:
|
|
10
11
|
* at load hides this page's hidden buttons (GET /api/use-log/hidden, one style rule per id, so a button drawn later is hidden too);
|
|
@@ -56,6 +57,14 @@ function note(ev) {
|
|
|
56
57
|
Q.push({ ...ev, page: pageNow(), device: deviceNow(), t: Date.now() });
|
|
57
58
|
}
|
|
58
59
|
|
|
60
|
+
/** Note one use the page names itself (pm/action-keys.js: `key-approve`, `key-miss`). The name must be a plain id; anything else is dropped.
|
|
61
|
+
* Nothing is noted before startUseLog runs, so a browser a script drives notes nothing here either. */
|
|
62
|
+
export function noteUse(control) {
|
|
63
|
+
if (!started || !ID_RE.test(String(control || ''))) return false;
|
|
64
|
+
note({ kind: 'use', control: String(control) });
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
|
|
59
68
|
export function startUseLog(doc = typeof document !== 'undefined' ? document : null) {
|
|
60
69
|
if (started || !doc) return false;
|
|
61
70
|
if (botNow()) return false; // a browser driven by a script (a test, a crawler) is not the user's own use: nothing is noted
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "One key each for the top five actions (bet A477, initiative action-keys, done test planning/done-tests/action-keys.md K1-K8): the words each key presses, the keys it leaves alone, the target in the item under the pointer on a small fake page, the hover hint, the ? list, the local use-log count, and the menu's mount. No server, network or browser.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"action-keys.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"action-keys.test.js": 2
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Set a task's sprint and priority in place (idea A469, initiative inline-sprint-priority, done test planning/done-tests/inline-sprint-priority.md S1-S8): the task-priority line and its fold, the edit route's priority and sprint, the items and the Backlog carrying them, the Sprint and Priority lists, the row buttons and their wiring. A scratch repository; no server, network or browser.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"inline-fields.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"inline-fields.test.js": 4
|
|
8
|
+
}
|
|
9
|
+
}
|