create-pmos 0.718.0 → 0.719.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 +26 -14
- package/payload/KIT-VERSION +2 -2
- 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/payload/state/log.md +1 -1
- package/workspace/changelog.json +25 -0
- package/workspace/fixtures/premium-viewer-fixtures.js +10 -5
- package/workspace/guide/home.md +1 -1
- package/workspace/guide/layout.md +4 -2
- package/workspace/lib/pinned-views.js +26 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/cozy-nav.js +14 -3
- package/workspace/public/pm/palette-all.js +101 -0
- package/workspace/public/pm/pinned-views.css +17 -0
- package/workspace/public/pm/pinned-views.js +130 -0
- package/workspace/public/pm/premium-board.js +53 -3
- package/workspace/public/premium-board.html +1 -0
- package/workspace/test-lists/palette-all.json +9 -0
- package/workspace/test-lists/pinned-filter-views.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.719.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": {
|
|
@@ -33,6 +33,31 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.719.0",
|
|
38
|
+
"at": "2026-11-23T00:11:29.887Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1594,
|
|
43
|
+
"t": "Meeting test stand-in answers the week the page asks for",
|
|
44
|
+
"s": "Meeting test stand-in answers the week the page asks for",
|
|
45
|
+
"k": "fix"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"n": 1596,
|
|
49
|
+
"t": "Pin a filter as a view beside the product switcher (job #1558)",
|
|
50
|
+
"s": "Pin a filter as a view beside the product switcher (job #1558)",
|
|
51
|
+
"k": "new"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"n": 1595,
|
|
55
|
+
"t": "Ctrl+K reaches every page, item and action (job #1562)",
|
|
56
|
+
"s": "Ctrl+K reaches every page, item and action (job #1562)",
|
|
57
|
+
"k": "new"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
36
61
|
{
|
|
37
62
|
"v": "0.718.0",
|
|
38
63
|
"at": "2026-11-22T23:44:48.503Z",
|
|
@@ -471,19 +496,6 @@
|
|
|
471
496
|
"k": "fix"
|
|
472
497
|
}
|
|
473
498
|
]
|
|
474
|
-
},
|
|
475
|
-
{
|
|
476
|
-
"v": "0.683.0",
|
|
477
|
-
"at": "2026-11-22T08:20:39.884Z",
|
|
478
|
-
"f": 4,
|
|
479
|
-
"prs": [
|
|
480
|
-
{
|
|
481
|
-
"n": 1494,
|
|
482
|
-
"t": "Acceptance criteria on each ticket, written from the done test",
|
|
483
|
-
"s": "Acceptance criteria on each ticket, written from the done test",
|
|
484
|
-
"k": "new"
|
|
485
|
-
}
|
|
486
|
-
]
|
|
487
499
|
}
|
|
488
500
|
]
|
|
489
501
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
kernel-source: pmos@
|
|
2
|
-
assembled: 2026-11-
|
|
1
|
+
kernel-source: pmos@147e078f
|
|
2
|
+
assembled: 2026-11-23
|
|
3
3
|
mode: vendor
|
|
@@ -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-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-23T00:11:26Z"}
|
|
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-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-23T00:11:26Z"}
|
|
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-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-23T00:11:26Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/payload/state/log.md
CHANGED
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.719.0",
|
|
4
|
+
"at": "2026-11-23T00:11:29.887Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1594,
|
|
9
|
+
"t": "Meeting test stand-in answers the week the page asks for",
|
|
10
|
+
"s": "Meeting test stand-in answers the week the page asks for",
|
|
11
|
+
"k": "fix"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"n": 1596,
|
|
15
|
+
"t": "Pin a filter as a view beside the product switcher (job #1558)",
|
|
16
|
+
"s": "Pin a filter as a view beside the product switcher (job #1558)",
|
|
17
|
+
"k": "new"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"n": 1595,
|
|
21
|
+
"t": "Ctrl+K reaches every page, item and action (job #1562)",
|
|
22
|
+
"s": "Ctrl+K reaches every page, item and action (job #1562)",
|
|
23
|
+
"k": "new"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
2
27
|
{
|
|
3
28
|
"v": "0.718.0",
|
|
4
29
|
"at": "2026-11-22T23:44:48.503Z",
|
|
@@ -18,14 +18,19 @@ function world(now = new Date()) {
|
|
|
18
18
|
const RAIL = new Date(minute + 30 * 60000), RAIL_END = new Date(RAIL.getTime() + 30 * 60000);
|
|
19
19
|
const LIVE = new Date(Math.max(mid.getTime(), minute - 12 * 60000)), LIVE_END = new Date(LIVE.getTime() + 30 * 60000);
|
|
20
20
|
const lvl = { kind: 'initiative', id: 'viewer', ws: 'w1', name: 'Viewer' };
|
|
21
|
-
|
|
21
|
+
// the week that holds `date` ('YYYY-MM-DD', as the page asks for it), like the real route: late on a Sunday "Rail review" (now + 30 min) falls
|
|
22
|
+
// in next week, and the page asks for that week by date. Answering this week instead left the meeting without its calendar row.
|
|
23
|
+
const week = (date) => {
|
|
24
|
+
const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(date || '');
|
|
25
|
+
const wk = m ? new Date(+m[1], +m[2] - 1, +m[3]) : new Date(mon);
|
|
26
|
+
if (m) wk.setDate(wk.getDate() - ((wk.getDay() + 6) % 7));
|
|
22
27
|
const cells = [];
|
|
23
|
-
for (let i = 0; i < 7; i++) { const d = new Date(
|
|
28
|
+
for (let i = 0; i < 7; i++) { const d = new Date(wk.getFullYear(), wk.getMonth(), wk.getDate() + i); cells.push({ key: dayKey(d), start: dayKey(d), end: dayKey(d), events: [] }); }
|
|
24
29
|
const cell = (d) => cells.find((c) => c.key === dayKey(d));
|
|
25
|
-
cell(SYNC).events.push({ id: 'ev-sync', at: iso(SYNC), end: iso(SYNC_END), title: 'Viewer sync', attendees: ['Ana', 'Dita', 'Wawan'], series: 'viewer-sync' });
|
|
30
|
+
if (cell(SYNC)) cell(SYNC).events.push({ id: 'ev-sync', at: iso(SYNC), end: iso(SYNC_END), title: 'Viewer sync', attendees: ['Ana', 'Dita', 'Wawan'], series: 'viewer-sync' });
|
|
26
31
|
if (cell(RAIL)) cell(RAIL).events.push({ id: 'ev-rail', at: iso(RAIL), end: iso(RAIL_END), title: 'Rail review', attendees: ['Sam', 'Wawan'] });
|
|
27
32
|
if (cell(LIVE)) cell(LIVE).events.push({ id: 'ev-live', at: iso(LIVE), end: iso(LIVE_END), title: 'Design crit', attendees: ['Ana', 'Wawan'] });
|
|
28
|
-
for (let i = 0; i < 5; i++) { const d = new Date(
|
|
33
|
+
for (let i = 0; i < 5; i++) { const d = new Date(wk.getFullYear(), wk.getMonth(), wk.getDate() + i, 15, 0); if (dayKey(d) !== dayKey(mid)) cell(d).events.push({ id: 'ev-1on1-' + i, at: iso(d), end: iso(new Date(d.getTime() + 30 * 60000)), title: '1:1 with Dita', attendees: ['Dita'] }); }
|
|
29
34
|
return { ok: true, view: 'week', range: { start: cells[0].key, end: cells[6].key }, cells, events_source: 'calendar-memory', today: dayKey(now), context: { 'ev-sync': { level: lvl }, 'ev-rail': { level: lvl } }, link_boards: [{ id: 'b1', ws: 'w1', name: 'Growth' }], gantt: [] };
|
|
30
35
|
};
|
|
31
36
|
const NOTE = {
|
|
@@ -73,7 +78,7 @@ function install(page, o = {}) {
|
|
|
73
78
|
if (S.scene === 'prep' || o.noLive) delete S.store.n2;
|
|
74
79
|
const notesRows = () => S.rows;
|
|
75
80
|
return Promise.all([
|
|
76
|
-
page.route('**/api/calendar-views*', (r) => json(r, W.week())),
|
|
81
|
+
page.route('**/api/calendar-views*', (r) => { const u = new URL(r.request().url()).searchParams; return json(r, W.week(u.get('view') === 'week' ? u.get('date') : '')); }),
|
|
77
82
|
page.route(/\/api\/notes(\?.*)?$/, (r) => (r.request().method() === 'GET' ? json(r, { ok: true, notes: notesRows(), series_open: { 'viewer-sync': { open: 2, carried: true } } }) : json(r, { ok: true }))),
|
|
78
83
|
page.route('**/api/notes/one*', (r) => {
|
|
79
84
|
const id = new URL(r.request().url()).searchParams.get('id'), n = S.store[id];
|
package/workspace/guide/home.md
CHANGED
|
@@ -174,7 +174,7 @@ Some features, such as Notes, open as a plain card in the Viewer. Each one works
|
|
|
174
174
|
## Search, Guide and Settings
|
|
175
175
|
|
|
176
176
|
- **Guide** (the **?** icon in the menu) opens this guide in the Viewer.
|
|
177
|
-
- **Search** (Ctrl K or ⌘K, or `/`) finds initiatives, documents, sessions and files in your work. It always reads the repository and all its worktrees, so it has no worktree picker.
|
|
177
|
+
- **Search** (Ctrl K or ⌘K, or `/`) finds initiatives, documents, sessions and files in your work. It always reads the repository and all its worktrees, so it has no worktree picker. It also reaches every page, each Settings section, the themes and the actions of the item you last pointed at: type "lib" to go to Library, or "conn" for Settings › Connectors.
|
|
178
178
|
- **Dates** show the year only when the year is not this year, for example "Jun 23 ’27". New for you shows a due date as "due 25 Nov".
|
|
179
179
|
- **Settings** holds the workspace settings. **General** holds the theme (Light, Dark or Auto) and **Product**, which names the product the page reads. **Connectors** shows when PMOS last read each source. A source that is old or failed has an amber dot and ↻ to read it again. ↻ in the Connectors header reads every source again. While a source is old, an amber box at the top of Settings names it, with ↻.
|
|
180
180
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Layout and first run: the places, the navigation, the Viewer, the launcher and Adler"
|
|
4
4
|
description: "The places, the navigation at the left, the Viewer, the keys and the phone; the first run; when features appear; the PMOS app; and Adler."
|
|
5
|
-
timestamp: 2026-11-
|
|
5
|
+
timestamp: 2026-11-23
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Layout and first run
|
|
@@ -100,6 +100,8 @@ On a computer, Work is built from the parts of the PMOS design system. The top l
|
|
|
100
100
|
- **Initiatives.** A table with the columns you choose (the tune icon also sorts and filters). Press a column heading to sort by it. The timeline shows done in green, now in blue and planned in grey, with a red line for today. A milestone is a diamond on its initiative's row; a late one is red. Milestones less than 8 days apart are one numbered diamond: point at it to see them. Pick the scale with **Week**, **Month**, **Quarter**, **Year** or **Full**. Move the timeline with the arrows, with a sideways swipe on a trackpad, or by dragging it; the middle arrow goes back to today. A late date has a red badge, for example "8 days late". Closed initiatives fold into one line at the end.
|
|
101
101
|
- **Next milestones.** The next ten milestones of all initiatives on one line, each with its date, its name and its initiative. The line has its own time range, apart from the table: it starts at today (or at a milestone that became late in the last 30 days) and ends at the last of the ten, so they all show across the full width without scrolling. Labels never cover each other: a label that is too close moves down a row, and a label near the right end reads to the left of its diamond. Scroll sideways on the line (or drag it) to move only the line. A milestone outside the line is in a **+N** mark at the end: press it to move the line there. After the line moves, the button at the top right puts it back at today. Press a diamond to open the milestone.
|
|
102
102
|
|
|
103
|
+
**Pinned views.** When a filter is on, the line "Showing …" over the table has a pin button. Press it to keep the filter as a view, named by what it shows (for example "Blocked · Acme, Globex"). Pinned views sit after the products at the top. Press one to open it: it replaces the filter that is on. Point at a view and press × to unpin it, with **Undo**. When you use the same filter a third time, PMOS suggests pinning it: ✓ pins it, ✕ means PMOS does not suggest that filter again. Pinned views follow you to your other browsers, as your other view choices do.
|
|
104
|
+
|
|
103
105
|
**Backlog** is the open work outside the sprint, in one rank across initiatives.
|
|
104
106
|
|
|
105
107
|
- **Where it stands.** A few lines: how many items wait, how many are ready to pull into the next sprint and from which initiatives, how many have not changed in 60 days, and how many have no initiative. An item is ready when it has an initiative and an owner, is not started, and PMOS is not working on it. Under it, PMOS suggests pulling the top ready items into the next sprint. ✓ gives the PMOS tasks the next sprint's dates (with Undo) and lists the Jira tickets for you to add in Jira, because PMOS does not change Jira. The pencil ticks the items on the **Ready** tab so you can change the pick first, and ✕ says not now.
|
|
@@ -271,7 +273,7 @@ When the words you type in Search point clearly to one thing, the first row is t
|
|
|
271
273
|
|
|
272
274
|
| Key | What it does |
|
|
273
275
|
|---|---|
|
|
274
|
-
| ⌘K (Ctrl-K) or / | Open Search from any page. A second press focuses the box. |
|
|
276
|
+
| ⌘K (Ctrl-K) or / | Open Search from any page. A second press focuses the box. Search also reaches pages (**Go to**), Settings sections, themes, the Guide and the calendar (**Do**), and the actions of the item you last pointed at (**On this item**): type "sprint" to move that item to the next sprint. |
|
|
275
277
|
| Esc | Close Search or the menu, then the Viewer. |
|
|
276
278
|
| ↑ ↓ and Enter | Move through Search results and open one. |
|
|
277
279
|
| Y | Say yes to what PMOS proposes on the item you point at. |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* pinned-views.js — the health number of pinned filter views (bet A395, initiative pinned-filter-views; the page side is
|
|
4
|
+
* public/pm/pinned-views.js). A pinned view's chip is a button whose first data attribute is data-pvw, so the local use log
|
|
5
|
+
* (lib/use-log.js, bet A466) notes each open. Nothing here writes anything.
|
|
6
|
+
*
|
|
7
|
+
* opens(lines, now) → n PURE. Presses of a pinned view (control data-pvw) in the use log, last 14 days.
|
|
8
|
+
* CLI: node lib/pinned-views.js count → opens of the last 14 days on its last line (the health number); other lines say [pinned-views] */
|
|
9
|
+
const OPEN_DAYS = 14;
|
|
10
|
+
const CONTROL = 'data-pvw';
|
|
11
|
+
|
|
12
|
+
function opens(lines, now = Date.now()) {
|
|
13
|
+
const cut = now - OPEN_DAYS * 864e5;
|
|
14
|
+
return (lines || []).filter((l) => l && l.kind === 'use' && l.control === CONTROL && Date.parse(l.at) >= cut && Date.parse(l.at) <= now + 864e5).length;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
module.exports = { OPEN_DAYS, CONTROL, opens };
|
|
18
|
+
|
|
19
|
+
if (require.main === module) {
|
|
20
|
+
if (process.argv[2] !== 'count') { console.error('usage: node lib/pinned-views.js count (opens of a pinned view in the last ' + OPEN_DAYS + ' days)'); process.exit(2); }
|
|
21
|
+
const UL = require('./use-log.js');
|
|
22
|
+
const dir = require('./state-root.js').defaultRoot({ env: process.env });
|
|
23
|
+
const lines = UL.readLines(dir);
|
|
24
|
+
console.log(`[pinned-views] ${lines.length} use-log lines in ${dir}`);
|
|
25
|
+
console.log(String(opens(lines)));
|
|
26
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.719.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.719.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
* Routine are not in the phone menu for now (their pages still open from a link). Ask PMOS on a phone is Today's page with ?chats=1 (today.html?chats=1; Home is gone, job #1540), which
|
|
39
39
|
* lists the chats by work (pm/phone-ask.js). The page's own ⋯ (the phone chat) opens the same menu; its own rows are not added on a phone.
|
|
40
40
|
*/
|
|
41
|
-
import { esc, svg, ICON, wsQ } from './cozy-evui.js';
|
|
41
|
+
import { esc, svg, ICON, wsQ, wsParam } from './cozy-evui.js';
|
|
42
42
|
import { fabLabel, bannerOf } from './cozy-evmodel.js';
|
|
43
43
|
import { mountToastFaces, loadPrefs } from './cozy-adler.js';
|
|
44
44
|
import './draft-keep.js'; // forms-keep-drafts: every text box on every page keeps a draft until sent, saved or cleared
|
|
@@ -284,7 +284,7 @@ export function mountNav(here, doc = document, opts = {}) {
|
|
|
284
284
|
if ('czLive' in b.dataset) { doc.dispatchEvent(new CustomEvent('cz:live-open')); return; }
|
|
285
285
|
if ('czChat' in b.dataset && N.rail && typeof window.czOpenChat === 'function') { window.czOpenChat(); return; } // the popup with the chat (slice 2)
|
|
286
286
|
if ('czChat' in b.dataset) { if (opts.chat) opts.chat(); else import('./page-chat.js').then((M) => M.openCos({ here: opts.where ? opts.where() : PLACES.find((p) => p.key === here) ? PLACES.find((p) => p.key === here).label : '' })); }
|
|
287
|
-
else if ('czSearch' in b.dataset)
|
|
287
|
+
else if ('czSearch' in b.dataset) search();
|
|
288
288
|
// a stale source opens Settings at Connectors, the stale one first (FmA3Settings: open where it matters)
|
|
289
289
|
else if ('czGuide' in b.dataset) import('./premium-vw-open.js').then((M) => M.openGuide('index'));
|
|
290
290
|
// a phone opens its one-screen Settings (Ph2_more, pm/cozy-phone-settings.js); a computer the full dialog
|
|
@@ -298,8 +298,19 @@ export function mountNav(here, doc = document, opts = {}) {
|
|
|
298
298
|
if (!k && !(e.key === '/' && !e.ctrlKey && !e.metaKey && !e.altKey && !typing)) return;
|
|
299
299
|
if (t && t.closest && t.closest('.xterm')) return; // a terminal keeps its keys
|
|
300
300
|
e.preventDefault(); e.stopImmediatePropagation();
|
|
301
|
-
|
|
301
|
+
search();
|
|
302
302
|
}, true);
|
|
303
|
+
// Search also reaches every page, the actions, and the item last pointed at or focused (bet A315, pm/palette-all.js withEverything)
|
|
304
|
+
let lastAt = null;
|
|
305
|
+
const note = (e) => { if (!e.target || !e.target.closest || !e.target.closest('#czNav, #evSearch')) lastAt = e.target; };
|
|
306
|
+
doc.addEventListener('pointerover', note, { capture: true, passive: true });
|
|
307
|
+
doc.addEventListener('focusin', note, true);
|
|
308
|
+
const chat = () => { if (N.rail && typeof window.czOpenChat === 'function') window.czOpenChat(); else if (opts.chat) opts.chat(); else import('./page-chat.js').then((M) => M.openCos({ here: opts.where ? opts.where() : PLACES.find((p) => p.key === here) ? PLACES.find((p) => p.key === here).label : '' })); };
|
|
309
|
+
function search() {
|
|
310
|
+
const item = lastAt && lastAt.isConnected ? lastAt : null;
|
|
311
|
+
Promise.all([import('./cozy-search.js'), import('./palette-all.js')]).then(([M, P]) => M.openSearch({ ...(opts.search ? { go: opts.search() } : {}),
|
|
312
|
+
scope: P.withEverything(opts.scope ? opts.scope() : null, { places: PLACES, here, item, doc, ws: wsParam(), wsq: wsQ, chat, setTheme: (k) => setTheme(k, doc) }) }));
|
|
313
|
+
}
|
|
303
314
|
const read = async () => {
|
|
304
315
|
if (doc.hidden) return;
|
|
305
316
|
const [n, s, mo] = await Promise.all([getj('/api/news-for-you' + wsQ()), getj('/api/sources' + wsQ()), getj('/api/moments')]);
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* pm/palette-all.js — Ctrl K reaches every page, item and action (bet A315, initiative palette-reaches-everything,
|
|
2
|
+
* done test planning/done-tests/palette-reaches-everything.md P1-P9).
|
|
3
|
+
*
|
|
4
|
+
* Search (pm/cozy-search.js) finds work: initiatives, documents, slides, reports, artifacts, meetings and chats. This adds what a person
|
|
5
|
+
* otherwise hunts for in the rail, the menus and the panels, as three groups drawn with a page's own hits (the U2 scope hook, so Search
|
|
6
|
+
* itself is not changed):
|
|
7
|
+
* On this item the item last pointed at or focused: its own buttons for the five action-key actions (pm/action-keys.js targetOf),
|
|
8
|
+
* so a pick presses the button the item already has. No new action and no new route.
|
|
9
|
+
* Go to every place of the rail, plus Intelligence and Workflows; the place you are on is left out
|
|
10
|
+
* Do Ask PMOS, the Guide, the calendar, notes, a new note, each Settings section, and the three themes
|
|
11
|
+
* A query word matches the start of a word in a row's name or its other names ("sett conn" → Settings › Connectors). Under two letters
|
|
12
|
+
* there is nothing, as in Search. Each pick is noted on this computer only (pm/use-log.js noteUse): palette-page, palette-action or
|
|
13
|
+
* palette-item, no text and no value.
|
|
14
|
+
*
|
|
15
|
+
* paletteGroups(q, ctx) PURE (but for the item's buttons, read from the page): [{ label, rows: [{ id, title, sub?, tag?, icon, open() }] }]
|
|
16
|
+
* withEverything(scope, ctx) a Search scope ({ name, hits(q) }): the page's own groups first, then paletteGroups
|
|
17
|
+
* ctx: { places: [{ key, label, href }], here, item?, doc?, wsq?(prefix) → '?ws=…' | '', chat?(), setTheme?(pick), go?(url) } */
|
|
18
|
+
import { KEYS, targetOf, wordsOf } from './action-keys.js';
|
|
19
|
+
import { SECTIONS } from './set-ds.js';
|
|
20
|
+
import { noteUse } from './use-log.js';
|
|
21
|
+
|
|
22
|
+
/* pages that are not in the rail but are a page of their own */
|
|
23
|
+
const MORE_PAGES = [
|
|
24
|
+
{ key: 'intelligence', label: 'Intelligence', href: '/premium-intelligence.html', also: 'charts reports metrics' },
|
|
25
|
+
{ key: 'workflows', label: 'Workflows', href: '/premium-workflows.html', also: 'automations' },
|
|
26
|
+
];
|
|
27
|
+
const PAGE_ALSO = { home: 'home day', board: 'board backlog sprint', insights: 'okrs objectives key results', events: 'calendar meetings', library: 'documents docs files', routine: 'schedule recurring' };
|
|
28
|
+
const SECTION_ALSO = { general: 'theme time role', claude: 'autonomy decides', connectors: 'sources jira slack google', account: 'sign in profile', updates: 'version upgrade' };
|
|
29
|
+
const ITEM_ALSO = { approve: 'yes accept', open: 'view', sprint: 'move next sprint', park: 'hold later', undo: 'revert back' };
|
|
30
|
+
|
|
31
|
+
const words = (s) => String(s || '').toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);
|
|
32
|
+
/** Every query word starts a word of the row's name or its other names. */
|
|
33
|
+
export function matches(q, ...texts) {
|
|
34
|
+
const want = words(q); if (!want.length) return false;
|
|
35
|
+
const have = texts.flatMap(words);
|
|
36
|
+
return want.every((w) => have.some((h) => h.startsWith(w)));
|
|
37
|
+
}
|
|
38
|
+
/** Rows whose own name matches come before rows found only by their other names. */
|
|
39
|
+
const byName = (q) => (a, b) => Number(matches(q, b.title)) - Number(matches(q, a.title));
|
|
40
|
+
const pick = (control, fn) => () => { noteUse(control); return fn(); };
|
|
41
|
+
const go = (ctx, href) => () => { const url = href + (ctx.wsq ? ctx.wsq(href.includes('?') ? '&' : '?') : ''); if (ctx.go) ctx.go(url); else location.assign(url); };
|
|
42
|
+
|
|
43
|
+
function pageRows(q, ctx) {
|
|
44
|
+
const places = (ctx.places || []).filter((p) => p && p.href).map((p) => ({ ...p, also: PAGE_ALSO[p.key] || '' }));
|
|
45
|
+
const known = new Set(places.map((p) => p.href));
|
|
46
|
+
return places.concat(MORE_PAGES.filter((p) => !known.has(p.href)))
|
|
47
|
+
.filter((p) => p.key !== ctx.here && matches(q, p.label, p.also))
|
|
48
|
+
.map((p) => ({ id: 'page:' + p.key, title: p.label, sub: 'Page', icon: 'open', open: pick('palette-page', go(ctx, p.href)) }))
|
|
49
|
+
.sort(byName(q));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const lazy = (path, fn) => () => import(path).then(fn).catch(() => {});
|
|
53
|
+
function actionRows(q, ctx) {
|
|
54
|
+
const A = [
|
|
55
|
+
{ id: 'chat', title: 'Ask PMOS', also: 'chat talk', icon: 'chat', run: () => (ctx.chat ? ctx.chat() : null) },
|
|
56
|
+
{ id: 'guide', title: 'Open the Guide', also: 'help how', icon: 'guide', run: lazy('./premium-vw-open.js', (M) => M.openGuide('index')) },
|
|
57
|
+
{ id: 'calendar', title: 'Open the calendar', also: 'events meetings', icon: 'cal', run: lazy('./premium-vw-open.js', (M) => M.openCalendar({ ws: ctx.ws || '' })) },
|
|
58
|
+
{ id: 'notes', title: 'Open notes', also: 'meeting notes', icon: 'doc', run: lazy('./premium-vw-open.js', (M) => M.openNotes({ ws: ctx.ws || '' })) },
|
|
59
|
+
{ id: 'note', title: 'New note', also: 'write capture', icon: 'doc', run: lazy('./premium-vw-open.js', (M) => M.newNote(ctx.ws || '')) },
|
|
60
|
+
...SECTIONS.map(([k, l]) => ({ id: 'settings:' + k, title: 'Settings › ' + l, also: SECTION_ALSO[k] || '', icon: 'settings', run: lazy('./cozy-settings.js', (M) => M.openSettings(k)) })),
|
|
61
|
+
...[['light', 'Light theme'], ['dark', 'Dark theme'], ['auto', 'Theme follows the computer']].map(([k, l]) => ({ id: 'theme:' + k, title: l, also: 'theme appearance colour color', icon: 'theme', run: () => (ctx.setTheme ? ctx.setTheme(k) : null) })),
|
|
62
|
+
];
|
|
63
|
+
return A.filter((a) => (a.id !== 'chat' || ctx.chat) && (!a.id.startsWith('theme:') || ctx.setTheme) && matches(q, a.title, a.also))
|
|
64
|
+
.map((a) => ({ id: 'act:' + a.id, title: a.title, sub: 'Action', icon: a.icon, open: pick('palette-action', a.run) }))
|
|
65
|
+
.sort(byName(q));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const short = (s, n = 60) => { const t = String(s || '').replace(/\s+/g, ' ').trim(); return t.length > n ? t.slice(0, n - 1) + '…' : t; };
|
|
69
|
+
function itemRows(q, ctx) {
|
|
70
|
+
if (!ctx.item) return [];
|
|
71
|
+
const out = [];
|
|
72
|
+
for (const k of KEYS) {
|
|
73
|
+
let el = null; try { el = targetOf(k.act, ctx.item, ctx.doc); } catch { el = null; }
|
|
74
|
+
if (!el) continue;
|
|
75
|
+
const said = short(wordsOf(el));
|
|
76
|
+
if (!matches(q, k.say, said, ITEM_ALSO[k.act])) continue;
|
|
77
|
+
out.push({ id: 'item:' + k.act, title: k.say, sub: said, tag: k.key.toUpperCase(), icon: 'check', open: pick('palette-item', () => el.click()) });
|
|
78
|
+
}
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** The groups for a query: On this item, Go to, Do; a group with no row is left out. */
|
|
83
|
+
export function paletteGroups(q, ctx = {}) {
|
|
84
|
+
const s = String(q || '').trim();
|
|
85
|
+
if (s.length < 2) return [];
|
|
86
|
+
return [['On this item', itemRows(s, ctx)], ['Go to', pageRows(s, ctx).slice(0, 6)], ['Do', actionRows(s, ctx).slice(0, 6)]]
|
|
87
|
+
.filter(([, rows]) => rows.length).map(([label, rows]) => ({ label, rows }));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** A Search scope: the page's own groups first (a page scope that throws gives none), then the palette's. */
|
|
91
|
+
export function withEverything(scope, ctx = {}) {
|
|
92
|
+
const own = scope && typeof scope.hits === 'function' ? scope : null;
|
|
93
|
+
return {
|
|
94
|
+
name: own ? own.name : 'pages and actions',
|
|
95
|
+
hits(q) {
|
|
96
|
+
let mine = [];
|
|
97
|
+
if (own) { try { mine = own.hits(q) || []; } catch { mine = []; } }
|
|
98
|
+
return mine.concat(paletteGroups(q, ctx));
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* pm/pinned-views.css — pinned filter views beside the product switcher (bet A395, initiative pinned-filter-views; pm/pinned-views.js).
|
|
2
|
+
* Design-system parts carry the look (pm-chip, pm-btn, pm-sug); this places them. Tokens only. */
|
|
3
|
+
.pvw-host:empty { display: none; }
|
|
4
|
+
.pvw { display: inline-flex; align-items: center; gap: var(--space-4); overflow-x: auto; scrollbar-width: none; max-width: 48vw; }
|
|
5
|
+
.pvw::-webkit-scrollbar { display: none; }
|
|
6
|
+
.pvw-i { display: inline-flex; align-items: center; flex: none; }
|
|
7
|
+
.pvw-b { border: 0; cursor: pointer; color: var(--cz-ink); white-space: nowrap; }
|
|
8
|
+
.pvw-b:focus-visible { background: var(--cz-bluebg); }
|
|
9
|
+
.pvw-b[aria-pressed="true"] { background: var(--cz-bluebg); color: var(--cz-blue); }
|
|
10
|
+
.pvw-x { all: unset; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: var(--radius-pill); color: var(--cz-ink3); cursor: pointer; }
|
|
11
|
+
.pvw-x:focus-visible { background: var(--cz-well); }
|
|
12
|
+
.pvw-pin { margin-left: var(--space-4); }
|
|
13
|
+
.pvw-sug { margin: var(--space-8) 0; }
|
|
14
|
+
@media (hover: hover) {
|
|
15
|
+
.pvw-b:hover { background: var(--cz-bluebg); }
|
|
16
|
+
.pvw-x:hover { background: var(--cz-well); }
|
|
17
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/* pm/pinned-views.js — pin a filter as a view beside the product switcher (bet A395, initiative pinned-filter-views; done test
|
|
2
|
+
* planning/done-tests/pinned-filter-views.md). Work's filter (pm/bd-work.js: its facets and Find's words) is kept as a view, pinned as a chip
|
|
3
|
+
* after the product switcher, and opened again with one press. The third time the same filter is settled, PMOS proposes to pin it.
|
|
4
|
+
*
|
|
5
|
+
* sigOf(state) → string PURE. One signature per filter, whatever order its values were turned on in; '' for an empty filter.
|
|
6
|
+
* stateOf(facets, q) → state PURE. { f: { <facet>: [values on] }, q } from bd-work.js facetsOf(...) and query().
|
|
7
|
+
* nameOf(state) → string PURE. What the view shows in the Filter menu's own words, at most 40 characters.
|
|
8
|
+
* readPins(store) / writePins(store, pins) the pins in the page store (premium-shell.js store); junk or a throwing store reads as []
|
|
9
|
+
* pin(pins, state, now) / unpin(pins, id) PURE. A new list: a filter is pinned once, at most MAX, the oldest goes.
|
|
10
|
+
* apply(state, W) clears W's filter, then turns on exactly the view's values and words (W: bd-work.js's own setters)
|
|
11
|
+
* noteUse(store, state, pins) → boolean counts a settled filter; true on its third use when it is not pinned and was not refused
|
|
12
|
+
* dismiss(store, sig) No on the proposal: PMOS never proposes that filter again
|
|
13
|
+
* pinsHtml(pins, curSig) · pinBtnHtml(on) · sugHtml(name) PURE markup, design-system parts only (pm-chip, pm-btn, pm-sug, pm-ic)
|
|
14
|
+
*
|
|
15
|
+
* The pins (KEY, under pmos.board.) are a view choice, so lib/prefs-sync.js lets them follow the person to another browser; the use counter (USE_KEY) stays here.
|
|
16
|
+
* Each open is a press of a button whose first data attribute is data-pvw, so the local use log (pm/use-log.js) counts it: the health
|
|
17
|
+
* number is `node workspace/lib/pinned-views.js count`. Log lines say [pinned-views]. Nothing here names a product. */
|
|
18
|
+
|
|
19
|
+
export const KEY = 'pmos.board.pins';
|
|
20
|
+
export const USE_KEY = 'pmos.pinuse'; // outside pmos.board., so it stays in this browser
|
|
21
|
+
export const MAX = 8;
|
|
22
|
+
const MAX_NAME = 40;
|
|
23
|
+
const PROPOSE_AT = 3;
|
|
24
|
+
const MAX_USES = 50; // the counter keeps the most recent filters only
|
|
25
|
+
|
|
26
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
27
|
+
const NEED = { you: 'Waits on you', late: 'Late', risk: 'At risk', blocked: 'Blocked' };
|
|
28
|
+
// the order a name reads in: what the rows need and where they are, then whose they are, then the words
|
|
29
|
+
const ORDER = ['need', 'stage', 'status', 'sprint', 'product', 'program', 'owner', 'origin'];
|
|
30
|
+
const log = (msg) => { try { console.info('[pinned-views] ' + msg); } catch { /* no console */ } };
|
|
31
|
+
|
|
32
|
+
function clean(state) {
|
|
33
|
+
const f = {}, src = (state && state.f) || {};
|
|
34
|
+
for (const k of Object.keys(src).sort()) {
|
|
35
|
+
const vals = [...new Set((Array.isArray(src[k]) ? src[k] : []).map(String))].sort();
|
|
36
|
+
if (vals.length) f[k] = vals;
|
|
37
|
+
}
|
|
38
|
+
return { f, q: String((state && state.q) || '').trim() };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function sigOf(state) {
|
|
42
|
+
if (!state) return '';
|
|
43
|
+
const c = clean(state);
|
|
44
|
+
return Object.keys(c.f).length || c.q ? JSON.stringify(c) : '';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function stateOf(facets, q) {
|
|
48
|
+
const f = {};
|
|
49
|
+
for (const x of facets || []) { const on = (x.vals || []).filter((v) => v.on).map((v) => String(v.v)); if (on.length) f[x.k] = on; }
|
|
50
|
+
return { f, q: String(q || '').trim() };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function nameOf(state) {
|
|
54
|
+
const c = clean(state), keys = [...ORDER.filter((k) => c.f[k]), ...Object.keys(c.f).filter((k) => !ORDER.includes(k))];
|
|
55
|
+
const NK = Object.keys(NEED), needPos = (v) => (NK.includes(v) ? NK.indexOf(v) : NK.length);
|
|
56
|
+
const parts = keys.map((k) => (k === 'need' ? c.f[k].slice().sort((a, b) => needPos(a) - needPos(b)).map((v) => NEED[v] || v) : c.f[k]).join(', '));
|
|
57
|
+
if (c.q) parts.push('“' + c.q + '”');
|
|
58
|
+
const s = parts.join(' · ') || 'View';
|
|
59
|
+
return s.length > MAX_NAME ? s.slice(0, MAX_NAME - 1).trimEnd() + '…' : s;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function readJson(store, key, fallback) {
|
|
63
|
+
try { const v = JSON.parse(store.get(key) || 'null'); return v == null ? fallback : v; } catch { return fallback; }
|
|
64
|
+
}
|
|
65
|
+
function writeJson(store, key, v) { try { store.set(key, JSON.stringify(v)); } catch { /* no storage: the view lives for this page */ } }
|
|
66
|
+
|
|
67
|
+
const isPin = (p) => p && typeof p === 'object' && typeof p.id === 'string' && typeof p.name === 'string' && typeof p.sig === 'string' && p.sig && p.state && typeof p.state === 'object';
|
|
68
|
+
export function readPins(store) { const v = readJson(store, KEY, []); return Array.isArray(v) ? v.filter(isPin).slice(-MAX) : []; }
|
|
69
|
+
export function writePins(store, pins) { writeJson(store, KEY, pins); }
|
|
70
|
+
|
|
71
|
+
export function pin(pins, state, now = Date.now()) {
|
|
72
|
+
const sig = sigOf(state); if (!sig) return pins.slice();
|
|
73
|
+
if (pins.some((p) => p.sig === sig)) return pins.slice();
|
|
74
|
+
const c = clean(state);
|
|
75
|
+
return [...pins, { id: 'v' + Number(now).toString(36) + pins.length, name: nameOf(c), sig, state: c, at: new Date(now).toISOString() }].slice(-MAX);
|
|
76
|
+
}
|
|
77
|
+
export const unpin = (pins, id) => pins.filter((p) => p.id !== id);
|
|
78
|
+
|
|
79
|
+
export function apply(state, W) {
|
|
80
|
+
const c = clean(state);
|
|
81
|
+
W.clearFilter();
|
|
82
|
+
for (const k of Object.keys(c.f)) for (const v of c.f[k]) W.setFilter(k, v);
|
|
83
|
+
W.setQuery(c.q);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function noteUse(store, state, pins) {
|
|
87
|
+
const sig = sigOf(state); if (!sig) return false;
|
|
88
|
+
if ((pins || []).some((p) => p.sig === sig)) return false;
|
|
89
|
+
const U = readJson(store, USE_KEY, {}); if (!U || typeof U !== 'object' || Array.isArray(U)) return false;
|
|
90
|
+
const no = Array.isArray(U.no) ? U.no : [], n = (U.n && typeof U.n === 'object') ? U.n : {};
|
|
91
|
+
if (no.includes(sig)) return false;
|
|
92
|
+
n[sig] = (Number(n[sig]) || 0) + 1;
|
|
93
|
+
const keep = Object.fromEntries(Object.entries(n).slice(-MAX_USES));
|
|
94
|
+
writeJson(store, USE_KEY, { n: keep, no });
|
|
95
|
+
return n[sig] === PROPOSE_AT;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function dismiss(store, sig) {
|
|
99
|
+
const U = readJson(store, USE_KEY, {}), no = Array.isArray(U && U.no) ? U.no : [], n = (U && U.n && typeof U.n === 'object') ? U.n : {};
|
|
100
|
+
if (sig && !no.includes(sig)) no.push(sig);
|
|
101
|
+
writeJson(store, USE_KEY, { n, no: no.slice(-MAX_USES) });
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* ── markup: design-system parts only ── */
|
|
105
|
+
const icon = (d) => `<svg class="pm-ic" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
106
|
+
const PIN = 'M9 4h6l-1 6 3 3v2H7v-2l3-3zM12 15v5';
|
|
107
|
+
const X = 'M7 7l10 10M17 7L7 17';
|
|
108
|
+
const YES = 'M5 12.5l4.5 4.5L19 7.5';
|
|
109
|
+
const STAR = '<svg class="pm-ic pm-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z"/></svg>';
|
|
110
|
+
|
|
111
|
+
export function pinsHtml(pins, curSig) {
|
|
112
|
+
if (!pins || !pins.length) return '';
|
|
113
|
+
const items = pins.map((p) => `<span class="pvw-i"><button type="button" data-pvw="${esc(p.id)}" class="pm-chip pvw-b" aria-pressed="${p.sig === curSig}" title="${esc('Open the view: ' + p.name)}">${esc(p.name)}</button>`
|
|
114
|
+
+ `<button type="button" data-pvwx="${esc(p.id)}" class="pvw-x" aria-label="${esc('Unpin ' + p.name)}" title="${esc('Unpin ' + p.name)}">${icon(X)}</button></span>`).join('');
|
|
115
|
+
return `<div class="pvw" role="group" aria-label="Pinned views">${items}</div>`;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function pinBtnHtml(on) {
|
|
119
|
+
const say = on ? 'This view is pinned' : 'Pin this filter as a view';
|
|
120
|
+
return `<button type="button" data-pvwpin class="pm-btn ghost pvw-pin" aria-pressed="${!!on}" aria-label="${say}" title="${say}"${on ? ' disabled' : ''}>${icon(PIN)}</button>`;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function sugHtml(name) {
|
|
124
|
+
return `<div class="pm-sug" role="group" aria-label="PMOS suggests"><span title="You used this filter three times.">${STAR}</span>`
|
|
125
|
+
+ `<span class="say">Pin “${esc(name)}” beside the products, so it is one press away?</span>`
|
|
126
|
+
+ `<button type="button" data-pvwsug="yes" class="pm-btn primary" aria-label="Yes, pin it" title="Yes, pin it">${icon(YES)}</button>`
|
|
127
|
+
+ `<button type="button" data-pvwsug="no" class="pm-btn outline" aria-label="No, do not suggest it again" title="No, do not suggest it again">${icon(X)}</button></div>`;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export const say = log;
|
|
@@ -23,6 +23,7 @@ import { pmPost } from './http.js';
|
|
|
23
23
|
import { followDoc } from './doc-follow.js';
|
|
24
24
|
import { $, $$, esc, store, chatAbout, setPageGaps } from './premium-shell.js';
|
|
25
25
|
import * as PK from './cozy-pick.js';
|
|
26
|
+
import * as PV from './pinned-views.js'; // pin a filter as a view beside the product switcher (bet A395, initiative pinned-filter-views)
|
|
26
27
|
import * as SW from './product-switcher.js'; // the product switcher row beside the chip, on a desktop (bet A381)
|
|
27
28
|
import { productName, whenNames } from './scope-chip.js'; // the products' display names ("IDPF", not "pmos-idpf") // the one product picker Home, Board and Insights share (batch 12 item 5)
|
|
28
29
|
import { mountNav } from './cozy-nav.js';
|
|
@@ -238,8 +239,9 @@ const dotsPick = (P) => (P ? { ...P, products: P.products.map((p) => ({ ...p, ne
|
|
|
238
239
|
function drawPick() {
|
|
239
240
|
const P = shownPick(), host = $('#crumbHost'); if (!host) return;
|
|
240
241
|
const desk = !matchMedia('(max-width: 760px)').matches;
|
|
241
|
-
host.innerHTML = P ? PK.chipHtml(P, { id: 'bdPick', label: 'Products', names: desk }) + (desk ? SW.switcherHtml(dotsPick(P)) : '') : `<span class="crpg">${esc(M.board.name || 'Board')}</span
|
|
242
|
-
|
|
242
|
+
host.innerHTML = (P ? PK.chipHtml(P, { id: 'bdPick', label: 'Products', names: desk }) + (desk ? SW.switcherHtml(dotsPick(P)) : '') : `<span class="crpg">${esc(M.board.name || 'Board')}</span>`) + '<span id="pvwHost" class="pvw-host"></span>';
|
|
243
|
+
drawPins();
|
|
244
|
+
host.onclick = (e) => { if (pinPress(e)) return; const b = e.target.closest('[data-psw]'); if (!b) return; e.stopPropagation(); SW.press(dotsPick(shownPick()), b.dataset.psw).then((r) => { if (!r.ok) say(r.error); }); };
|
|
243
245
|
if (P && desk && !DOTS) { DOTS = {}; SW.readDots().then((r) => { if (r) { DOTS = Object.fromEntries(r.products.map((p) => [p.ws, p.needs])); drawPick(); } }).catch(() => null); }
|
|
244
246
|
const chip = $('#bdPick'); if (!chip) return;
|
|
245
247
|
// a product's line: its open initiatives on this page (zero is silence)
|
|
@@ -267,6 +269,53 @@ async function resolvePick() {
|
|
|
267
269
|
return true;
|
|
268
270
|
}
|
|
269
271
|
|
|
272
|
+
/* ── pinned views (bet A395, initiative pinned-filter-views; pm/pinned-views.js): Work's filter kept as a view, a chip after the product
|
|
273
|
+
* switcher, one press to open it. The pin button sits on Work's "Showing …" line; the third time the same filter is settled (the Filter menu
|
|
274
|
+
* closes with it on), PMOS proposes to pin it under that line. Work on a desk only: the phone and classic views keep their own chips. ── */
|
|
275
|
+
let PINS = PV.readPins(store), PV_SUG = null; // PV_SUG: the filter PMOS proposes to pin, until Yes or No
|
|
276
|
+
const pvState = () => PV.stateOf(M ? WV.facetsOf(M.initiatives.list.rows || [], { product: wkProduct, programOf: wkProgOf }) : [], WV.query());
|
|
277
|
+
function drawPins() {
|
|
278
|
+
const h = $('#pvwHost'); if (!h) return;
|
|
279
|
+
const on = !!M && workOn() && !ROC, cur = on ? PV.sigOf(pvState()) : '';
|
|
280
|
+
h.innerHTML = on ? PV.pinsHtml(PINS, cur) : '';
|
|
281
|
+
const sh = on && $('#ibBody .wk-showing');
|
|
282
|
+
if (sh && !sh.querySelector('[data-pvwpin]')) sh.insertAdjacentHTML('beforeend', PV.pinBtnHtml(PINS.some((p) => p.sig === cur)));
|
|
283
|
+
const old = $('#ibBody .pvw-sug'); if (old) old.remove();
|
|
284
|
+
if (on && PV_SUG && PV.sigOf(PV_SUG) === cur) { const at = $('#ibBody .wk-showing'); if (at) at.insertAdjacentHTML('afterend', '<div class="pvw-sug">' + PV.sugHtml(PV.nameOf(PV_SUG)) + '</div>'); }
|
|
285
|
+
}
|
|
286
|
+
function pinNow(state) {
|
|
287
|
+
const was = PINS.length; PINS = PV.pin(PINS, state); PV.writePins(store, PINS); PV_SUG = null;
|
|
288
|
+
if (PINS.length !== was || PINS.some((p) => p.sig === PV.sigOf(state))) { PV.say('pinned ' + PINS.length); say('Pinned beside the products.'); }
|
|
289
|
+
drawPins();
|
|
290
|
+
}
|
|
291
|
+
/** A press on a pin, its Unpin, the pin button or the proposal. → true when it was one. */
|
|
292
|
+
function pinPress(e) {
|
|
293
|
+
const t = e.target;
|
|
294
|
+
let b = t.closest('[data-pvw]');
|
|
295
|
+
if (b) { e.stopPropagation(); const p = PINS.find((x) => x.id === b.dataset.pvw); if (!p) return true; PV.apply(p.state, WV); PV.say('opened'); drawInit(); wkCount(); return true; }
|
|
296
|
+
if ((b = t.closest('[data-pvwx]'))) {
|
|
297
|
+
e.stopPropagation(); const gone = PINS.find((x) => x.id === b.dataset.pvwx); if (!gone) return true;
|
|
298
|
+
const before = PINS; PINS = PV.unpin(PINS, gone.id); PV.writePins(store, PINS); PV.say('unpinned ' + PINS.length); drawPins();
|
|
299
|
+
say('Unpinned “' + gone.name + '”.', () => { PINS = before; PV.writePins(store, PINS); drawPins(); say('Pinned again.'); });
|
|
300
|
+
return true;
|
|
301
|
+
}
|
|
302
|
+
if (t.closest('[data-pvwpin]')) { e.stopPropagation(); pinNow(pvState()); return true; }
|
|
303
|
+
if ((b = t.closest('[data-pvwsug]'))) {
|
|
304
|
+
e.stopPropagation();
|
|
305
|
+
if (b.dataset.pvwsug === 'yes' && PV_SUG) pinNow(PV_SUG);
|
|
306
|
+
else { if (PV_SUG) PV.dismiss(store, PV.sigOf(PV_SUG)); PV.say('proposal refused'); PV_SUG = null; drawPins(); }
|
|
307
|
+
return true;
|
|
308
|
+
}
|
|
309
|
+
return false;
|
|
310
|
+
}
|
|
311
|
+
/** The Filter menu closed: count the filter that is on; on its third use PMOS proposes to pin it. */
|
|
312
|
+
function pinSettled() {
|
|
313
|
+
if (!M || !workOn() || ROC) return;
|
|
314
|
+
const st = pvState();
|
|
315
|
+
if (PV.noteUse(store, st, PINS)) { PV_SUG = st; PV.say('proposed'); drawPins(); } else drawPins();
|
|
316
|
+
}
|
|
317
|
+
$('#ibBody').addEventListener('click', (e) => { if (e.target.closest('[data-pvwpin],[data-pvwsug]')) pinPress(e); }, true);
|
|
318
|
+
|
|
270
319
|
/* ── the toolbar: picker, chips ───────────────────────────────────────────────────────────────────────────────────── */
|
|
271
320
|
let crumbed = false;
|
|
272
321
|
function drawHead() {
|
|
@@ -812,7 +861,7 @@ const wkSel = (el) => {
|
|
|
812
861
|
};
|
|
813
862
|
/** The button the menu opened from, as drawn now: the Initiatives block's Choose columns is drawn again with the list. */
|
|
814
863
|
const wkBtnOf = () => (WK_MENU && $(WK_MENU.__sel)) || WK_MENU.__btn;
|
|
815
|
-
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(); }
|
|
864
|
+
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(); pinSettled(); }
|
|
816
865
|
function toggleWorkMenu(btn) {
|
|
817
866
|
if (WK_MENU) { closeWorkMenu(true); return; }
|
|
818
867
|
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);
|
|
@@ -884,6 +933,7 @@ function drawInit() {
|
|
|
884
933
|
if (v === 'work' && WK_MENU) { const b = $(WK_MENU.__sel); if (b) { b.setAttribute('aria-expanded', 'true'); b.classList.add('on'); } }
|
|
885
934
|
$('#bdShowing').innerHTML = showingHtml(L.length); $('#bdShowing').hidden = !$('#bdShowing').innerHTML;
|
|
886
935
|
drawViewMenu();
|
|
936
|
+
drawPins();
|
|
887
937
|
document.body.dataset.bdView = v;
|
|
888
938
|
$('#stage').dataset.bdDesk = view; // what fit() measures: the desktop's view, so the narrow form never flips it back and forth
|
|
889
939
|
markOpen();
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
<link rel="stylesheet" href="/pm/komorebi.css" />
|
|
21
21
|
<link rel="stylesheet" href="/pm/ds-bridge.css" />
|
|
22
22
|
<link rel="stylesheet" href="/pm/cozy-pick.css" />
|
|
23
|
+
<link rel="stylesheet" href="/pm/pinned-views.css" />
|
|
23
24
|
<link rel="stylesheet" href="/pm/cozy-board.css" />
|
|
24
25
|
<link rel="stylesheet" href="/pm/changed-mark.css" />
|
|
25
26
|
<link rel="stylesheet" href="/pm/load-shapes.css" />
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Ctrl K reaches every page, item and action (bet A315, initiative palette-reaches-everything, done test planning/done-tests/palette-reaches-everything.md P1-P7): the Go to, Do and On this item groups on a small fake page, word-start matching, the page scope wrap, the local use-log health read, and the menu's hook. No server, network or browser.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"palette-all.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"palette-all.test.js": 2
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Pin a filter as a view beside the product switcher (bet A395, initiative pinned-filter-views, done test planning/done-tests/pinned-filter-views.md V1-V8): the signature, name, pin and unpin, opening a view, the third-use proposal, the system parts, the health number over a temporary use log, and the view-preferences allowlist. No browser, server or network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"pinned-views.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"pinned-views.test.js": 2
|
|
8
|
+
}
|
|
9
|
+
}
|