create-pmos 0.646.0 → 0.647.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 +14 -14
- package/payload/KIT-VERSION +1 -1
- package/payload/design-system/ui/components/Suggestion/README.md +8 -0
- package/payload/design-system/ui/components/Timeline/README.md +8 -0
- package/payload/design-system/ui/components/bundle.css +38 -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 +13 -0
- package/workspace/design-system/ui/components/Suggestion/README.md +8 -0
- package/workspace/design-system/ui/components/Timeline/README.md +8 -0
- package/workspace/design-system/ui/components/bundle.css +38 -0
- package/workspace/guide/layout.md +10 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/bd-backlog.js +21 -11
- package/workspace/public/pm/bd-ds.css +0 -7
- package/workspace/public/pm/bd-span.js +10 -5
- package/workspace/public/pm/bd-stands.js +165 -0
- package/workspace/public/pm/bd-work-ds.css +107 -0
- package/workspace/public/pm/bd-work.css +8 -77
- package/workspace/public/pm/bd-work.js +79 -46
- package/workspace/public/pm/komorebi.css +39 -0
- package/workspace/public/pm/premium-board.js +57 -10
- package/workspace/public/pm/readonly.js +3 -0
- package/workspace/public/premium-board.html +4 -1
|
@@ -62,7 +62,8 @@ import { setSay } from './cozy-xv.js';
|
|
|
62
62
|
import { narrowForm } from './pn-narrow.js';
|
|
63
63
|
import * as BP2 from './bd-pane.js';
|
|
64
64
|
import * as WV from './bd-work.js'; // Work, one view on a desk (slice 4 of the six-place navigation, initiative work-one-view)
|
|
65
|
-
import * as BK from './bd-backlog.js';
|
|
65
|
+
import * as BK from './bd-backlog.js';
|
|
66
|
+
import * as ST from './bd-stands.js'; // Where it stands, its Suggestion and the Next milestones line (initiative work-design-system-blocks, WorkDS) // the Backlog beside Initiatives in Work: every task in one list (initiative work-backlog)
|
|
66
67
|
import * as LS from './load-shapes.js'; // the skeleton and the slow-case line while the board is read (page-open-speed, SpD) // the Board as the first panel: fit(), the rows that open beside, the open row's mark
|
|
67
68
|
import * as SWN from './cozy-status-when.js'; // the day a status move really happened, in the toast (round 3 point 18)
|
|
68
69
|
|
|
@@ -616,18 +617,55 @@ const wkGoalOf = (r) => { if (!GOALS) return ''; const k = (GOALS.of || {})[Stri
|
|
|
616
617
|
const wkProgOf = (r) => { const p = programOf(PGS, r.ws || (M && M.board.ws) || '', r.id); return p ? p.title || p.id : ''; };
|
|
617
618
|
function drawWork(L) {
|
|
618
619
|
const pk = prodKey((M.board && (M.board.product || M.board.name)) || ''), lay = SO.layout();
|
|
619
|
-
|
|
620
|
+
// WorkDS: Where it stands (a Summary block and one Suggestion), the Initiatives table, then the Next milestones date line on the table's scale
|
|
621
|
+
const list = WV.listHtml(L, { tpx: WK_TPX, many: wkMany(), sel: peek && peek.kind === 'ini' ? peek.key : null, rowOf, bar: wkBar,
|
|
620
622
|
product: wkProduct, goalOf: wkGoalOf, programOf: wkProgOf, order: (rows) => sortInis(pk, rows, lay, INI_ACC),
|
|
621
623
|
goalGroups: (rows) => (GOALS ? GL.asGroups(rows, GOALS, (rs) => sortInis(pk, rs, lay, INI_ACC)) : null),
|
|
622
624
|
canMove: (r) => !ROC && !!(r.track && r.acts && (r.acts.stages || []).length > 1) });
|
|
625
|
+
const W = WV.lastWindow(), vis = WV.filterRows(L, { product: wkProduct, programOf: wkProgOf });
|
|
626
|
+
return ST.standsHtml(vis, { sug: !ROC }) + list + (W && WV.read().tl !== false ? ST.dlineHtml(ST.nextMilestones(vis), W, { sub: 'all initiatives', ro: ROC, lw: ($('#ibBody').clientWidth || innerWidth) - 120 }) : '');
|
|
627
|
+
}
|
|
628
|
+
/** The Suggestion's answers (WorkDS): Yes keeps the proposal (POST /api/proposals/keep, Undo in the toast), No drops it (POST
|
|
629
|
+
* /api/proposals/drop), the pencil opens the initiative, where its proposals can be changed before they are kept. */
|
|
630
|
+
async function sugPress(b) {
|
|
631
|
+
const r = rowOf(b.dataset.key); if (!r) return;
|
|
632
|
+
const at = { ws: r.ws || M.board.ws || undefined, board: r.boardId || M.board.id };
|
|
633
|
+
if (b.dataset.wksug === 'edit') { openIni(r, b); return; }
|
|
634
|
+
b.disabled = true;
|
|
635
|
+
if (b.dataset.wksug === 'yes') {
|
|
636
|
+
const res = await pmPost('/api/proposals/keep', { ...at, initiative: b.dataset.ini, ids: [b.dataset.pid] }).catch(() => null);
|
|
637
|
+
if (!res || !res.ok) { b.disabled = false; say((res && res.error) || 'It did not land. The server did not say why.'); return; }
|
|
638
|
+
say(res.said || 'Done.', res.batch ? async () => { const u = await pmPost('/api/proposals/undo', { ...at, batch: res.batch }).catch(() => null); say(u && u.ok ? 'Put back.' : (u && u.error) || 'The undo did not land.'); load(); } : null);
|
|
639
|
+
} else {
|
|
640
|
+
const res = await pmPost('/api/proposals/drop', { ...at, initiative: b.dataset.ini, sig: b.dataset.sig }).catch(() => null);
|
|
641
|
+
if (!res || !res.ok) { b.disabled = false; say((res && res.error) || 'It did not land. The server did not say why.'); return; }
|
|
642
|
+
say('PMOS will not suggest this again.');
|
|
643
|
+
}
|
|
644
|
+
load();
|
|
645
|
+
}
|
|
646
|
+
/* the timeline scrolls sideways (WorkDS): a trackpad's sideways swipe or a drag on the timeline; no scrollbar. A drag that moved does not
|
|
647
|
+
* also press what is under it. */
|
|
648
|
+
{
|
|
649
|
+
const body = $('#ibBody'); let drag = null, raf = 0, moved = false;
|
|
650
|
+
const pxDays = () => { const W = WV.lastWindow(), x = $('#ibBody .wk-i .wk-bw') || $('#ibBody .wk-tl'); const w = x ? x.getBoundingClientRect().width : 0; return W && w ? (W.to - W.from) / 864e5 / w : 0; };
|
|
651
|
+
const redraw = () => { if (raf) return; raf = requestAnimationFrame(() => { raf = 0; drawInit(); }); };
|
|
652
|
+
body.addEventListener('wheel', (e) => {
|
|
653
|
+
if (curView() !== 'work' || !e.target.closest('.wk-x, .pm-dline') || Math.abs(e.deltaX) <= Math.abs(e.deltaY)) return;
|
|
654
|
+
e.preventDefault(); const k = pxDays(); if (!k) return; WV.scrollBy(e.deltaX * k); redraw();
|
|
655
|
+
}, { passive: false });
|
|
656
|
+
body.addEventListener('pointerdown', (e) => { if (curView() !== 'work' || e.button !== 0 || !e.target.closest('.wk-x, .pm-dline') || e.target.closest('button')) return; drag = { x: e.clientX, k: pxDays() }; moved = false; });
|
|
657
|
+
addEventListener('pointermove', (e) => { if (!drag || !drag.k) return; const dx = e.clientX - drag.x; if (!moved && Math.abs(dx) < 5) return; moved = true; document.body.classList.add('wk-drag'); WV.scrollBy(-dx * drag.k); drag.x = e.clientX; redraw(); });
|
|
658
|
+
addEventListener('pointerup', () => { if (!drag) return; drag = null; document.body.classList.remove('wk-drag'); if (moved) setTimeout(() => { moved = false; }, 0); });
|
|
659
|
+
body.addEventListener('click', (e) => { if (moved) { e.stopImmediatePropagation(); e.preventDefault(); } }, true);
|
|
623
660
|
}
|
|
624
661
|
/** One row's bar on Work: the Board's own (pm/bd-span.js rowBar, Wawan's round 2): done, now, planned, every milestone ◇ with its popup, the
|
|
625
662
|
* gap line, the late line. W: Work's window { from, to }. The track's width is measured once drawn, so close ◇s merge at about 40 px. */
|
|
626
663
|
let WK_TPX = 0;
|
|
627
664
|
function wkBar(r, W) {
|
|
628
665
|
const span = +W.to - +W.from || 1, X = (d) => ((+d - +W.from) / span) * 100;
|
|
629
|
-
const px = WK_TPX || Math.max(320, Math.round(innerWidth * 0.4))
|
|
630
|
-
|
|
666
|
+
const px = WK_TPX || Math.max(320, Math.round(innerWidth * 0.4));
|
|
667
|
+
// milestones less than 8 days apart merge into one numbered mark (WorkDS)
|
|
668
|
+
return rowBar(r, X, new Date(), { pxPct: px / 100, reach: 8, mode: 'all', label: false, endIn: true });
|
|
631
669
|
}
|
|
632
670
|
const wkMeasure = () => { const x = $('#ibBody .wk-i .wk-bw'); const w = x ? Math.round(x.getBoundingClientRect().width) : 0; if (w && Math.abs(w - WK_TPX) > 40) { WK_TPX = w; return true; } return false; };
|
|
633
671
|
/** A press in the list that is Work's own (a column title, the span, the timeline's hide, a Stage cell, a bar, the closed line). → true when handled. */
|
|
@@ -636,9 +674,10 @@ function workPress(e) {
|
|
|
636
674
|
if (p.kind === 'inside') return true; // a press in the open stage card stays there
|
|
637
675
|
if (p.kind === 'spanmenu') { spanMenu(); return true; }
|
|
638
676
|
if (p.kind === 'stage') { if (!ROC) stageMenu(rowOf(p.key), p.el); return true; }
|
|
677
|
+
if (p.kind === 'menu') { toggleWorkMenu(p.el); return true; }
|
|
639
678
|
if (!WV.apply(p)) return false;
|
|
640
679
|
drawInit(); wkCount(); if (WK_MENU) drawWorkMenu();
|
|
641
|
-
const f = p.kind === 'sort' ? `[data-wksort="${p.k}"]` : p.kind === 'span' ?
|
|
680
|
+
const f = p.kind === 'sort' ? `[data-wksort="${p.k}"]` : p.kind === 'span' ? `[data-wkspick="${p.span}"]` : p.kind === 'nav' ? `[data-wknav="${p.dir}"]` : p.kind === 'timeline' ? (p.on ? '[data-wktl="off"]' : '[data-wktl="on"]') : p.kind === 'closed' ? '[data-wkclosed]' : null;
|
|
642
681
|
const n = f && $('#ibBody ' + f); if (n) n.focus();
|
|
643
682
|
return true;
|
|
644
683
|
}
|
|
@@ -733,7 +772,7 @@ function drawWorkMenu(focus) {
|
|
|
733
772
|
const was = focus || (WK_MENU.contains(document.activeElement) ? wkSel(document.activeElement) : null);
|
|
734
773
|
const sc = WK_MENU.firstElementChild ? WK_MENU.firstElementChild.scrollTop : 0;
|
|
735
774
|
WK_MENU.innerHTML = WV.menuHtml({ many: wkMany(), sprint: ROC ? null : (M && M.jira && M.jira.sprint) || null, ro: ROC });
|
|
736
|
-
const m = WK_MENU.firstElementChild, b =
|
|
775
|
+
const m = WK_MENU.firstElementChild, b = wkBtnOf().getBoundingClientRect();
|
|
737
776
|
const top = Math.round(b.bottom + 8);
|
|
738
777
|
m.style.top = top + 'px'; m.style.left = Math.max(8, Math.round(b.right - m.offsetWidth)) + 'px';
|
|
739
778
|
m.style.maxHeight = Math.max(240, innerHeight - top - 12) + 'px'; // it scrolls inside the window; Filter's title and Clear stay on top
|
|
@@ -751,10 +790,12 @@ const wkSel = (el) => {
|
|
|
751
790
|
for (const a of ['wkgroup', 'wkcolsw', 'wkx']) if (d[a]) return `[data-${a}="${d[a]}"]`;
|
|
752
791
|
return x.hasAttribute('data-wktlsw') ? '[data-wktlsw]' : x.hasAttribute('data-wkcols') ? '[data-wkcols]' : x.hasAttribute('data-wkclear') ? '[data-wkcols]' : '[data-wkcols]';
|
|
753
792
|
};
|
|
754
|
-
|
|
793
|
+
/** The button the menu opened from, as drawn now: the Initiatives block's Choose columns is drawn again with the list. */
|
|
794
|
+
const wkBtnOf = () => (WK_MENU && $(WK_MENU.__sel)) || WK_MENU.__btn;
|
|
795
|
+
function closeWorkMenu(back) { if (!WK_MENU) return; const b = wkBtnOf(); WK_MENU.remove(); WK_MENU = null; b.setAttribute('aria-expanded', 'false'); b.classList.remove('on'); if (back) b.focus(); }
|
|
755
796
|
function toggleWorkMenu(btn) {
|
|
756
797
|
if (WK_MENU) { closeWorkMenu(true); return; }
|
|
757
|
-
WK_MENU = document.createElement('div'); WK_MENU.__btn = btn; document.body.appendChild(WK_MENU);
|
|
798
|
+
WK_MENU = document.createElement('div'); WK_MENU.__btn = btn; WK_MENU.__sel = btn.matches('[data-wkmenu]') ? '#ibBody [data-wkmenu]' : '#bdFilter'; document.body.appendChild(WK_MENU);
|
|
758
799
|
btn.setAttribute('aria-expanded', 'true'); btn.classList.add('on');
|
|
759
800
|
drawWorkMenu();
|
|
760
801
|
const f = WK_MENU.querySelector('[data-wkgroup].on') || WK_MENU.querySelector('button'); if (f) f.focus();
|
|
@@ -767,7 +808,7 @@ function toggleWorkMenu(btn) {
|
|
|
767
808
|
WV.wireDrag(WK_MENU, (k) => { drawInit(); drawWorkMenu(k ? `[data-wkcolsw="${k}"]` : null); });
|
|
768
809
|
}
|
|
769
810
|
// a press inside the menu draws it again, so its target may have left the page by now: that is not a press outside
|
|
770
|
-
document.addEventListener('click', (e) => { if (WK_MENU && e.target.isConnected && !WK_MENU.contains(e.target) && !e.target.closest('#bdFilter')) closeWorkMenu(); });
|
|
811
|
+
document.addEventListener('click', (e) => { if (WK_MENU && e.target.isConnected && !WK_MENU.contains(e.target) && !e.target.closest('#bdFilter, [data-wkmenu]')) closeWorkMenu(); });
|
|
771
812
|
function workExtra(k, btn) {
|
|
772
813
|
if (k === 'jira') { refreshJira(null).then(() => { drawWorkMore(); drawWorkMenu(); }); drawWorkMore(); return; }
|
|
773
814
|
if (k === 'you') { if (F.chips.has('you')) F.chips.delete('you'); else F.chips.add('you'); drawInit(); drawWorkMore(); return; }
|
|
@@ -820,6 +861,7 @@ function drawInit() {
|
|
|
820
861
|
if (fk) { const n = $$('#ibBody [data-key]').find((x) => x.dataset.key === fk); if (n) n.focus({ preventScroll: true }); }
|
|
821
862
|
if (v === 'time') TL.mount(body);
|
|
822
863
|
if (v === 'work' && wkMeasure()) { drawInit(); return; } // the bars' ◇s merge by the track's real width: once measured, draw again
|
|
864
|
+
if (v === 'work' && WK_MENU) { const b = $(WK_MENU.__sel); if (b) { b.setAttribute('aria-expanded', 'true'); b.classList.add('on'); } }
|
|
823
865
|
$('#bdShowing').innerHTML = showingHtml(L.length); $('#bdShowing').hidden = !$('#bdShowing').innerHTML;
|
|
824
866
|
drawViewMenu();
|
|
825
867
|
document.body.dataset.bdView = v;
|
|
@@ -845,7 +887,12 @@ $('#bdShowing').addEventListener('click', (e) => {
|
|
|
845
887
|
});
|
|
846
888
|
function setSpan(s) { span = s; store.set(SPAN_KEY, span); drawChips(); drawInit(); }
|
|
847
889
|
$('#ibBody').addEventListener('click', (e) => {
|
|
848
|
-
if (curView() === 'work'
|
|
890
|
+
if (curView() === 'work') {
|
|
891
|
+
const op = e.target.closest('[data-wkopen]'); if (op) { e.preventDefault(); openIni(rowOf(op.dataset.wkopen), op); return; }
|
|
892
|
+
const sg = e.target.closest('[data-wksug]'); if (sg) { sugPress(sg); return; }
|
|
893
|
+
const dl = e.target.closest('[data-wkdl]'); if (dl) { WV.apply({ kind: 'nav', dir: dl.dataset.wkdl === 'back' ? 'back' : 'on' }); drawInit(); const n = $(`#ibBody [data-wkdl="${dl.dataset.wkdl}"]`) || $('#ibBody [data-wknav="today"]'); if (n) n.focus(); return; }
|
|
894
|
+
if (workPress(e)) return;
|
|
895
|
+
}
|
|
849
896
|
if (e.target.closest('#fold, [data-mefold]')) { foldOpen = !foldOpen; drawInit(); const f = $('#fold') || $('#ibBody [data-mefold]'); if (f) f.focus(); return; }
|
|
850
897
|
const gf = e.target.closest('[data-fold]'); if (gf) { const k = gf.dataset.fold; PG.fold(k); drawInit(); const b = $$('#ibBody [data-fold]').find((x) => x.dataset.fold === k); if (b) b.focus(); return; }
|
|
851
898
|
const pc = e.target.closest('[data-pcat]'); if (pc) { const k = pc.dataset.pcat; V.togglePcat(k); drawInit(); const b = $$('#ibBody [data-pcat]').find((x) => x.dataset.pcat === k); if (b) b.focus(); return; }
|
|
@@ -33,6 +33,9 @@ export const VIEW_CONTROLS = [
|
|
|
33
33
|
// Work, one view (shared-copy brief Part A 3, Part B i): a column's sort, the span and its menu, hide and show the timeline, the closed fold,
|
|
34
34
|
// a row (opens its popup), a bar (its stage card) and the card itself, Show all; the find field and the tune panel's filter and sort
|
|
35
35
|
'.wk-hd', '[data-wkspan]', '[data-wkspick]', '[data-wktl]', '[data-wkclosed]', '.wk-i[data-key]', '[data-wkbar] .tg-bar', '[data-wkbar] .wk-bar', '.wk-card', '[data-wkclear]',
|
|
36
|
+
// WorkDS (initiative work-ds-initiatives): Where it stands' names (open the initiative), the scale tabs, Earlier / Go to today / Later,
|
|
37
|
+
// Choose columns (the copy's filter and sort), the timeline switch in it, the Next milestones line's +N marks
|
|
38
|
+
'[data-wkopen]', '[data-wknav]', '[data-wkmenu]', '.wk-menu [data-wktlsw]', '[data-wkdl="on"]', '[data-wkdl="back"]',
|
|
36
39
|
'#bdFind', '#roFind', '#bdFilter', '.wk-menu [data-wkf]', '.wk-menu [data-wkmore]', '.wk-menu [data-wksortp]', '.wk-menu [data-wksortx]', '.wk-menu [data-wkreset]',
|
|
37
40
|
// the popup of a row, read only (Part A 4): its close and its edge, Details, a stage's fold, the done and far folds
|
|
38
41
|
'.cz-pop [data-pop="close"]', '.pw [data-pw-details]', '.pw [data-pw-fold]', '.pw [data-pw-more]', '.pw [data-pw-grip]', '.pw [data-pw-done]', '.pw [data-pw-far]', '.pw [data-pw-tl]', '.pw [data-pw-span]', '.hi-pop [data-sp]',
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
<link rel="stylesheet" href="/pm/bd-work.css" />
|
|
25
25
|
<link rel="stylesheet" href="/pm/bd-backlog.css" />
|
|
26
26
|
<link rel="stylesheet" href="/pm/bd-ds.css" />
|
|
27
|
+
<!-- Work from the system's parts (WorkDS): this sheet only places them, so it loads last -->
|
|
28
|
+
<link rel="stylesheet" href="/pm/bd-work-ds.css" />
|
|
27
29
|
</head>
|
|
28
30
|
<body class="cz bd-page pm-ds">
|
|
29
31
|
<!-- The Board has no dialog, dock, toast or hero of the old shell: pm/premium-shell.js binds to a detached copy when #dlg is absent. Its panels
|
|
@@ -36,7 +38,8 @@
|
|
|
36
38
|
(Publish a read-only copy, Cancelled and archived). Theme, Sources and Settings live in Settings, one press away in the place menu.
|
|
37
39
|
No workflow chips: the Board does not pick a workflow (bd-wf.js). -->
|
|
38
40
|
<div class="bd-hd">
|
|
39
|
-
|
|
41
|
+
<!-- the path (WorkDS): Work › the product, whose chip switches the product -->
|
|
42
|
+
<nav class="pm-path wk-path" aria-label="Where you are"><span>Work</span><svg class="pm-ic" width="14" height="14" viewBox="0 0 24 24" aria-hidden="true"><path d="M10 8l4 4-4 4"/></svg><div id="crumbHost" class="bd-pickw"></div></nav>
|
|
40
43
|
<!-- the View chip: the four views, the span and the Columns on the timeline, Shared with me -->
|
|
41
44
|
<span class="bd-grpw2 bd-vieww" id="bdVieww"><button type="button" class="bd-chip bd-vbtn" id="bdView" aria-haspopup="true" aria-expanded="false" aria-controls="bdViewMenu" aria-label="View. Change view" title="View"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01"/></svg><svg class="bd-chv" viewBox="0 0 24 24" aria-hidden="true"><path d="M7 10l5 5 5-5"/></svg></button><span class="bd-grpm bd-viewm" id="bdViewMenu" role="group" aria-label="View" hidden></span></span>
|
|
42
45
|
<!-- what needs a look: one pill of dots and numbers, and its (i): the timeline's legend, the sprints and releases, the Jira read -->
|