create-pmos 0.658.0 → 0.659.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.658.0",
3
+ "version": "0.659.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": {
@@ -34,20 +34,14 @@
34
34
  ],
35
35
  "pmosChanges": [
36
36
  {
37
- "v": "0.658.0",
38
- "at": "2026-11-22T03:38:17.292Z",
37
+ "v": "0.659.0",
38
+ "at": "2026-11-22T03:48:36.791Z",
39
39
  "f": 4,
40
40
  "prs": [
41
41
  {
42
- "n": 1441,
43
- "t": "Goals is built from the design system's blocks",
44
- "s": "Goals is built from the design system's blocks",
45
- "k": "new"
46
- },
47
- {
48
- "n": 1443,
49
- "t": "Events is built from the design system's blocks",
50
- "s": "Events is built from the design system's blocks",
42
+ "n": 1444,
43
+ "t": "Library is built from the design system's blocks",
44
+ "s": "Library is built from the design system's blocks",
51
45
  "k": "new"
52
46
  }
53
47
  ]
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@c6e6eef1
1
+ kernel-source: pmos@d9579e83
2
2
  assembled: 2026-11-22
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-22T03:38:13Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T03:48:33Z"}
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-22T03:38:13Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T03:48:33Z"}
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-22T03:38:13Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T03:48:33Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,19 +1,13 @@
1
1
  [
2
2
  {
3
- "v": "0.658.0",
4
- "at": "2026-11-22T03:38:17.292Z",
3
+ "v": "0.659.0",
4
+ "at": "2026-11-22T03:48:36.791Z",
5
5
  "f": 4,
6
6
  "prs": [
7
7
  {
8
- "n": 1441,
9
- "t": "Goals is built from the design system's blocks",
10
- "s": "Goals is built from the design system's blocks",
11
- "k": "new"
12
- },
13
- {
14
- "n": 1443,
15
- "t": "Events is built from the design system's blocks",
16
- "s": "Events is built from the design system's blocks",
8
+ "n": 1444,
9
+ "t": "Library is built from the design system's blocks",
10
+ "s": "Library is built from the design system's blocks",
17
11
  "k": "new"
18
12
  }
19
13
  ]
@@ -195,7 +195,7 @@ A Jira date and the planned finish of an initiative get no ✓: PMOS cannot writ
195
195
 
196
196
  ## Library
197
197
 
198
- **Library** in the navigation is a catalogue of everything that was made for your work, from every product: documents, links, meeting notes and prototypes. Each thing is one row with the same columns: **Name**, **Kind**, **Product**, **About**, **By**, **State** and **Updated**. Reports are not here: a report repeats, so it lives in Routine.
198
+ **Library** in the navigation is a catalogue of everything that was made for your work, from every product: documents, links, meeting notes and prototypes. Each thing is one row: its kind icon, its name, a grey line with its kind, product (when you have two or more), what it is about, who made it and the day, and its state when it is not Final. Reports are not here: a report repeats, so it lives in Routine.
199
199
 
200
200
  - **Kind** says what the thing is: PRD, Strategic brief, Design brief, Done test, Meeting notes, Prototype, Link · Confluence, and so on. PMOS reads it from the file's `type` first, then from its title ("Brief: …") and its file name. When the title only repeats the kind, the name leaves it out: "Brief: Scarlet lucky draw" shows as "Scarlet lucky draw", Kind Strategic brief.
201
201
  - **About** is the program and the initiative ("Project Ascent › Tender new CIAM"). It is empty when it repeats the name.
@@ -205,13 +205,13 @@ A Jira date and the planned finish of an initiative get no ✓: PMOS cannot writ
205
205
  - Grouped by New, the checks PMOS keeps for one initiative (done test, rubric, retro) fold into one **Checks** row.
206
206
 
207
207
  1. To narrow the list, use the chips at the top: **Kind** (a family, such as Briefs, or one kind inside it), the product, program and project chip, and **State**. Each shows how many rows it has. When a chip hides rows, a grey line says how many; press **Show all** to clear the chips.
208
- 2. To group the list, press the tune button and pick **New** (this week, earlier this month, older), **Work** (each program and initiative is a shelf, with one row per kind in the order of the work), **Kind** or **Product**. Press a shelf to fold it.
208
+ 2. To group the list, press the **Group** chip and pick **New** (this week, earlier this month, older), **Work** (each program and initiative is a shelf, with one row per kind in the order of the work), **Kind** or **Product**. Press a shelf to fold it.
209
209
  3. To find a thing, type in **Find in Library**, or press `/`. Titles that match show at once. Under them, **Also about this** lists the documents and notes that are about your words by meaning, each with the passage that matched and the idea in bold. PMOS reads them for meaning in a normal PMOS session; until it answers, or when it cannot, they are ranked by shared words and the line says so.
210
210
  4. A meeting note with no title shows the name PMOS gave it, with ✦. Press ✦ to keep the name or type another. A note with no work shows ✦ and the initiative it talks about: press it to link the note to that work.
211
211
  5. To add a file, a link or a new document, press **+**. Ask PMOS opens with "Add to Library" in the box. Say what to add; PMOS fills its kind, product and work and shows you the record.
212
- 6. To open a thing, press its row. It opens in the popup with the chat about it. On a screen 1600 px or wider, the first press shows the record at the right: every field, the first lines, the files that link to it and its editions. Press again, press Enter or press the open button to open it. A link opens in a new browser tab.
212
+ 6. To open a thing, press its row. It opens in the popup with the chat about it. On a screen 1200 px or wider, the first press shows the record at the right: every field, the first lines, the files that link to it and its editions. Press again, press Enter or press the open button to open it. A link opens in a new browser tab.
213
213
 
214
- The Library is drawn with the PMOS design system: the list is one table card, the row you picked is lit, and the record at the right is a card with its fields. On a phone the table shows the kind, the name and the day only. While the list loads, three soft lines stand in for it. When the list cannot be read, one line says why, with **Retry**.
214
+ The Library is built from the PMOS design system's blocks. The top line is the path, the product chip, then **+** and **More** (Show all, Read the Library again). The search box is always shown. The list is one card of rows, the row you picked is lit, and the record at the right is a card with its fields. On a phone a row shows the kind, the name and the day only. While the list loads, three soft lines stand in for it. When the list cannot be read, one line says why, with **Retry**.
215
215
 
216
216
  The notes of a held meeting look the same wherever you open them: a short summary, the decisions, the tasks that came out of it, and your notes. On the right, **The meeting** says when it was held, what it is about, who was there and what the notes were written from. Press a task to open its initiative. When some tasks are not in the initiative's Work breakdown, PMOS suggests adding them: press ✓ to add them, or ✕. Press the recording, or **Transcript and more**, for the replay, the transcript and the material.
217
217
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.658.0",
3
+ "version": "0.659.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.658.0",
9
+ "version": "0.659.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.658.0",
3
+ "version": "0.659.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -1,22 +1,19 @@
1
- /* cozy-library.css — Library (initiative library-place; slice 7 of the six-place navigation, Library round 2), drawn with the PMOS design
2
- * system (Komorebi, workspace/design-system/ui/; pm/komorebi.css). Layout Main + open item: the catalogue is a List block holding a Table
3
- * (pm-block list + pm-table), the record at the right on a screen 1600 px or wider is a Detail block (pm-block + pm-field). This sheet
4
- * holds only what the parts leave to the page: the column widths, where the blocks sit, and the narrow-screen columns. Colours, corners,
5
- * space and shadow are the system's tokens (brand.css, komorebi.css), light and dark. The filter chips and their menus are the shared
6
- * picker (cozy-pick.css), the same as the product, program and project chip beside them. */
1
+ /* cozy-library.css — Library (initiative library-place; slice 7 of the six-place navigation), rebuilt from Komorebi blocks
2
+ * (library-ds-page, board LibraryDS on Exploring 3). Layout Main + open item: the top line (Path, the scope chip, icon buttons), the search
3
+ * Input with its key, the filter chips, one List block of ListRows, and the open item as a Detail block at the right on a desk. The parts
4
+ * draw themselves (pm/komorebi.css); this sheet only places them, plus the shared picker's menus under their chips. Colours, corners,
5
+ * space and shadow are the system's tokens (brand.css, komorebi.css), light and dark. */
7
6
  .lb-page .vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
8
7
 
9
- /* the bar: filters, the search field (the Input part, with its icon inside), Group by and + */
8
+ /* the top line, the search and the chips */
10
9
  .lb-bar { display: flex; align-items: center; gap: var(--space-8); min-height: 44px; }
11
- .lb-fl { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; min-width: 0; }
12
- .lb-chip.on, .lb-fl .scp-chip:not([aria-label$=": all"]) { background: var(--blue-tint); color: var(--blue); }
13
- .lb-chip .ppk-nmc em { font-style: normal; color: var(--muted); }
10
+ .lb-bar .sp, .lb-fl .sp { flex: 1; }
11
+ .lb-find { flex-wrap: nowrap; margin-top: var(--space-12); }
12
+ .lb-find .pm-input { flex: 1; min-width: 0; }
13
+ .lb-find .pm-input::-webkit-search-cancel-button { cursor: pointer; }
14
+ .lb-fl { margin-top: var(--space-12); }
15
+ .lb-chip.on, .lb-sc .scp-chip:not([aria-label$=": all"]) { background: var(--blue-tint); color: var(--blue); }
14
16
  .lb-chip .pm-ic { width: 14px; height: 14px; }
15
- .lb-find { margin-left: auto; display: flex; align-items: center; gap: var(--space-8); height: 40px; width: 380px; max-width: 46vw; padding: 0 var(--space-12); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--card); color: var(--muted); flex: none; }
16
- .lb-find input { all: unset; flex: 1; min-width: 0; font: inherit; font-size: var(--fs-body); color: var(--ink); }
17
- .lb-find input::placeholder { color: var(--muted); }
18
- .lb-find input::-webkit-search-cancel-button { cursor: pointer; }
19
- .lb-find:focus-within { box-shadow: var(--glow); }
20
17
  .lb-hid { margin: var(--space-8) var(--space-4) 0; }
21
18
  .lb-hid:empty { display: none; }
22
19
  .lb-hid button, .lb-retry { all: unset; cursor: pointer; color: var(--blue); font-weight: var(--fw-strong); }
@@ -27,41 +24,30 @@
27
24
  .lb-main { flex: 1 1 auto; min-width: 0; max-width: 1400px; display: flex; flex-direction: column; gap: var(--space-16); }
28
25
  #lbBody { display: flex; flex-direction: column; gap: var(--space-16); }
29
26
 
30
- /* the catalogue: a Table inside a List block, with set column widths so a wide screen does not stretch the Name past reading */
31
- .lb-t { table-layout: fixed; }
32
- .lb-t th, .lb-t td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
33
- .lb-t thead th { background: var(--well); }
34
- .lb-t thead th:nth-child(1) { width: 40px; }
35
- .lb-t thead th:nth-child(3) { width: 140px; }
36
- .lb-t thead th:nth-child(4) { width: 130px; }
37
- .lb-t thead th:nth-child(5) { width: 220px; }
38
- .lb-t thead th:nth-child(6) { width: 110px; }
39
- .lb-t thead th:nth-child(7) { width: 100px; }
40
- .lb-t thead th:nth-child(8) { width: 88px; }
41
- .lb-t tr:last-child td { border-bottom: 0; }
42
- .lb-i { cursor: pointer; }
43
- .lb-i .c { color: var(--muted); }
44
- .lb-i td.ic { color: var(--muted); }
45
- .lb-i td.ic .pm-ic { display: block; }
46
- .lb-i.sub .lb-nw { padding-left: var(--space-16); }
47
- .lb-i.sub .lb-nb { font-weight: var(--fw-regular); }
48
- .lb-t .lb-g th { padding: 0; border-bottom: 1px solid var(--line); }
49
- .lb-g .pm-group em { font-style: normal; font-weight: var(--fw-regular); }
50
- .lb-s .pm-group { width: 100%; border: 0; font: inherit; font-size: var(--fs-meta); font-weight: var(--fw-strong); cursor: pointer; text-align: left; }
51
- .lb-s .pm-group b { color: var(--ink); }
52
- .lb-s .pm-group:focus-visible { outline: none; box-shadow: var(--glow); }
53
- .lb-s .pm-group .pm-ic { width: 14px; height: 14px; }
27
+ /* the List block: group heads span the block; a row is pressable as a whole */
28
+ .lb-blk .rows { padding-top: var(--space-4); }
29
+ .lb-blk > .pm-group + .rows, .lb-blk > .lb-s + .rows { padding-top: var(--space-4); }
30
+ .lb-blk > .head + .pm-group { margin-top: 0; }
31
+ .lb-s { width: 100%; border: 0; font: inherit; font-size: var(--fs-meta); text-align: left; cursor: pointer; }
32
+ .lb-s b { color: var(--ink); }
33
+ .lb-s em, .lb-blk .pm-group em { font-style: normal; font-weight: var(--fw-regular); }
34
+ .lb-s:focus-visible { outline: none; box-shadow: var(--glow); }
35
+ .lb-i, .lb-mr { cursor: pointer; }
36
+ .lb-mi { display: inline-flex; color: var(--muted); }
54
37
  .lb-nw { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
55
38
  .lb-nb { all: unset; cursor: pointer; font-weight: var(--fw-strong); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
56
39
  .lb-nb:focus-visible { box-shadow: var(--glow); border-radius: var(--radius-sm); }
40
+ .pm-li.nest .lb-nb { font-weight: var(--fw-regular); }
41
+ .lb-sp { display: inline-flex; }
42
+ .lb-sp .pm-ic { width: 14px; height: 14px; }
57
43
  .lb-old { border: 0; flex: none; cursor: pointer; font: inherit; font-size: var(--fs-meta); color: var(--muted); }
58
44
  .lb-old[aria-expanded="true"] { background: var(--blue-tint); color: var(--blue); }
59
45
  .lb-old:focus-visible { outline: none; box-shadow: var(--glow); }
60
- .lb-nw .lb-sp { color: var(--blue); width: 28px; height: 28px; }
61
- .lb-nm .pm-row { flex-wrap: nowrap; }
46
+ .lb-acts { display: flex; gap: 2px; }
47
+ .lb-nm { flex-wrap: nowrap; }
62
48
  .lb-nm .pm-input { height: 32px; font-weight: var(--fw-strong); }
63
- .lb-sg { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-4); max-width: 100%; color: var(--blue); }
64
- .lb-sg span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
49
+ .lb-sg { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-4); color: var(--blue); }
50
+ .lb-sg .pm-ic { width: 14px; height: 14px; }
65
51
  .lb-sg:focus-visible { box-shadow: var(--glow); border-radius: var(--radius-sm); }
66
52
  .lb-n { margin: 0 var(--space-4); }
67
53
  .lb-none { margin: 0; padding: var(--space-24) var(--space-16); }
@@ -72,18 +58,19 @@
72
58
  .lb-sk i:nth-child(2) { width: 55%; }
73
59
  .lb-sk i:nth-child(3) { width: 62%; }
74
60
 
75
- /* search by meaning: a List block under the title matches, each row with its passage and the idea in bold */
61
+ /* Also about this: each row with its passage, the idea in bold */
62
+ .lb-m .head { padding-top: var(--space-4); }
76
63
  .lb-m .lb-mq { margin: 0 var(--space-16) var(--space-8); }
77
- .lb-m .lb-mr { align-items: flex-start; padding-top: var(--space-8); padding-bottom: var(--space-8); cursor: pointer; }
64
+ .lb-mr { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
65
+ .lb-mr .lb-mi { padding-top: 2px; }
78
66
  .lb-mr .lb-nb { display: block; }
79
- .lb-mi { display: inline-flex; padding-top: 2px; }
80
- .lb-ps { margin-top: var(--space-4); white-space: normal; color: var(--ink); }
67
+ .lb-ps { margin-top: var(--space-4); font-size: var(--fs-meta); line-height: var(--lh-meta); white-space: normal; }
81
68
  .lb-ps b { font-weight: var(--fw-strong); }
82
69
  .lb-mq { margin: 0 var(--space-4); }
83
70
 
84
- /* the menus: Kind (families open to their kinds), State, Group by (the Tabs part) */
71
+ /* the menus under the chips: Kind (families open to their kinds), State, Group (the Tabs part); More is the Menu part */
85
72
  .lb-cw { position: relative; display: inline-flex; flex: none; }
86
- .lb-menu { position: absolute; left: 0; top: calc(100% + 8px); }
73
+ .lb-menu { position: absolute; left: 0; top: calc(100% + 8px); z-index: 20; }
87
74
  .lb-cwr .lb-menu { left: auto; right: 0; }
88
75
  .lb-menu .ppk-mi { min-height: 44px; }
89
76
  .lb-menu .ppk-nm { flex-direction: row; align-items: baseline; gap: var(--space-8); }
@@ -99,32 +86,24 @@
99
86
  .lb-pl .pm-tab:focus-visible { outline: none; box-shadow: var(--glow); }
100
87
  .lb-gm { width: 320px; }
101
88
 
102
- /* the open item: a Detail block, 1600 px and wider */
103
- .lb-pv { flex: 0 0 360px; position: sticky; top: var(--space-12); max-height: calc(100vh - 120px); overflow: auto; }
89
+ /* the open item: a Detail block, on a desk */
90
+ .lb-pv { flex: 0 0 420px; position: sticky; top: var(--space-12); max-height: calc(100vh - 120px); overflow: auto; }
104
91
  .lb-pv[hidden] { display: none; }
105
- .lb-pv.pm-block .head { align-items: flex-start; }
106
92
  .lb-pv .head .pm-h { flex: 1; min-width: 0; overflow-wrap: anywhere; }
107
- .lb-pv .pm-field { margin: 0; }
93
+ .lb-pv .pm-field, .lb-pv .lb-pvh { margin: 0; }
108
94
  .lb-pv .pm-field dd { overflow-wrap: anywhere; }
109
- .lb-pv .pm-h-sm { margin-top: var(--space-4); }
95
+ .lb-pvk { margin: var(--space-4) 0 0; font-weight: var(--fw-regular); }
110
96
  .lb-pvl p { margin: 0 0 var(--space-4); font-size: var(--fs-meta); line-height: var(--lh-meta); }
111
- .lb-pv ul { margin: 0; padding-left: 18px; font-size: var(--fs-meta); }
97
+ .lb-pv ul { margin: 0; padding-left: 18px; font-size: var(--fs-meta); line-height: var(--lh-meta); }
112
98
  .lb-pv li { margin: 0 0 var(--space-4); }
113
- .lb-pv li .lb-nb { font-weight: var(--fw-regular); white-space: normal; }
114
- @media (max-width: 1599px) { .lb-pv { display: none; } }
99
+ .lb-pv li .lb-nb { font-weight: var(--fw-regular); white-space: normal; color: var(--blue); }
100
+ @media (max-width: 1199px) { .lb-pv { display: none; } }
115
101
 
116
- /* fewer columns: the table sizes itself (a hidden column cannot keep a set width), and the Name takes what is left */
117
- @media (max-width: 1180px) {
118
- .lb-t { table-layout: auto; }
119
- .lb-t td.n { width: 100%; max-width: 0; }
120
- .lb-t td.c { max-width: 160px; }
121
- .lb-t tr > :nth-child(6), .lb-t tr > :nth-child(7) { display: none; }
122
- }
123
- /* a phone: the Table becomes a List (the kind, the name, the day) */
102
+ /* a phone: the chips scroll sideways; the menus rise from the bottom */
124
103
  @media (max-width: 760px) {
125
- .lb-bar { flex-wrap: wrap; }
126
- .lb-fl { flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
127
- .lb-find { order: 3; width: 100%; max-width: none; margin-left: 0; }
128
- .lb-t tr > :nth-child(n+3):not(:last-child):not([colspan]) { display: none; }
104
+ .lb-page .lb-fl { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
105
+ .lb-bar #lbMore { display: none; } /* the phone's own ⋯ sits here; Show all stays in the hidden line */
106
+ .lb-fl .sp { display: none; }
107
+ .lb-find .pm-kbd { display: none; }
129
108
  .lb-menu, .lb-cwr .lb-menu { position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 80vh; border-radius: var(--radius-panel) var(--radius-panel) 0 0; padding: 18px 12px 28px; }
130
109
  }
@@ -5,10 +5,14 @@
5
5
  * (pm/scope-chip.js, the same control as on Events and Work) and the State chip, each with its counts; when a filter hides rows one grey
6
6
  * line says how many, with Show all. The tune button groups the rows by New (default), Work (program and initiative shelves, the work in its
7
7
  * order), Kind or Product. Editions fold under the newest; grouped by New, an initiative's gate records fold into one "Checks · N" row.
8
+ * Built from Komorebi blocks (library-ds-page, board LibraryDS): the top line is the Path, the product, program and project chip, + and More
9
+ * (Show all, Read the Library again); the search Input with its / key; the Kind, State and Group chips; one List block of ListRows (kind
10
+ * icon, name, a why line, the state Badge), with the part's group heads and folds. With a search the block heads "Names with …", then
11
+ * "Also about this" by meaning.
8
12
  * A note with no title shows the name PMOS gave it with ✦ until the PM accepts or renames it; a note with no work offers ✦ the work it
9
13
  * talks about. Finding is the main job: the search field always shows (/ puts the cursor in it); a title match is instant, and the items
10
14
  * about the question by meaning arrive under it ("Also about this · 6", lib/library-find.js), each with its passage and the idea in bold.
11
- * On a screen 1600 px or wider a press shows the record at the right (all fields, the first lines, where it is linked from, its editions);
15
+ * On a desk (1200 px or wider) a press shows the record at the right as a Detail block (all fields, the first lines, where it is linked from, its editions);
12
16
  * a second press or Enter opens it in the one popup with the chat about it (pm/library-open.js). A link opens a new tab.
13
17
  * Writes only what the PM accepts: a note's name (POST /api/notes/save) and a note's work (POST /api/notes/link). The group and the Kind
14
18
  * and State filters are remembered on this device (localStorage 'pmos.lib.view'). The + asks PMOS to add a file, a link or a document. */
@@ -21,7 +25,7 @@ import './cozy-popup.js'; // the one popup: window.czOpenChat for the rail's c
21
25
  import { readPick } from './cozy-pick.js';
22
26
  import * as SC from './scope-chip.js';
23
27
  const { scopeChipHtml, openScope, matches: scopeMatches, narrowed, scopeWords, whenNames } = SC;
24
- import { COLUMNS, FAMILIES, GROUPS, STATES, view, counts, passes, matches, aboutText, stateText, dayText, when, noteOf, hiddenText } from './library-model.js';
28
+ import { FAMILIES, GROUPS, STATES, view, counts, passes, matches, aboutText, stateText, dayText, when, noteOf, hiddenText } from './library-model.js';
25
29
  import { openItem } from './library-open.js';
26
30
 
27
31
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
@@ -33,6 +37,7 @@ const ICON = {
33
37
  proto: 'M4 5h16v12H4zM9 20h6',
34
38
  checks: 'M4 6.5l2 2 3.5-3.5M4 13.5l2 2 3.5-3.5M13 7h7M13 14h7M13 19h7',
35
39
  };
40
+ const PEN = 'M4 20h4L18.5 9.5a2.1 2.1 0 0 0-3-3L5 17zM13.5 6.5l3 3', CLEAR = 'M4 6h16M7 12h10M10 18h4', RELOAD = 'M20 12a8 8 0 1 1-2.3-5.7M20 4v5h-5';
36
41
  const CHEV_D = 'M6 9l6 6 6-6', CHEV_R = 'M9 6l6 6-6 6', TICK = 'M5 12.5l4.5 4.5L19 7.5', X = 'M6 6l12 12M18 6L6 18', PART = 'M7 12h10';
37
42
  const SPARK = 'M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z', OPEN = 'M14 4h6v6M20 4l-9 9M18 14v5H5V6h5';
38
43
  const store = { get(k) { try { return JSON.parse(localStorage.getItem(k) || 'null'); } catch { return null; } }, set(k, v) { try { localStorage.setItem(k, JSON.stringify(v)); } catch { /* a private window */ } } };
@@ -46,13 +51,13 @@ const S = {
46
51
  shown: [],
47
52
  };
48
53
  const remember = () => store.set('pmos.lib.view', { kinds: S.kinds, states: S.states, group: S.group });
49
- const wide = () => typeof matchMedia === 'function' && matchMedia('(min-width: 1600px)').matches;
54
+ const wide = () => typeof matchMedia === 'function' && matchMedia('(min-width: 1200px)').matches;
50
55
 
51
56
  mountNav('library', document, { scope: () => ({ name: 'Library', hits: (q) => libHits(q) }) });
52
57
  mountLivePill();
53
58
 
54
59
  const $ = (id) => document.getElementById(id);
55
- const filters = $('lbFilters'), body = $('lbBody'), note = $('lbNote'), qBox = $('lbQ'), hid = $('lbHid'), pv = $('lbPv');
60
+ const filters = $('lbFilters'), scopeW = $('lbScopeW'), body = $('lbBody'), note = $('lbNote'), qBox = $('lbQ'), hid = $('lbHid'), pv = $('lbPv');
56
61
 
57
62
  /* ── the filters ── */
58
63
  const F = () => ({ kinds: S.kinds, states: S.states, scope: (tokens) => scopeMatches(tokens, S.P, S.sel) });
@@ -68,17 +73,18 @@ function scopeGroups() {
68
73
  projects: [...byIni.values()].sort((a, b) => a.name.localeCompare(b.name)),
69
74
  };
70
75
  }
71
- const chip = (id, label, on, n) => `<span class="lb-cw"><button type="button" class="ppk-chip lb-chip${on ? ' on' : ''}" id="${id}" aria-haspopup="menu" aria-expanded="false"><span class="ppk-all ppk-nmc">${esc(label)}${n ? ` <em>${n}</em>` : ''}</span>${svg(CHEV_D)}</button></span>`;
72
- function kindLabel() {
73
- if (!S.kinds.length) return 'Every kind';
76
+ const chip = (id, label, on, n, cls = '') => `<span class="lb-cw${cls}"><button type="button" class="ppk-chip lb-chip${on ? ' on' : ''}" id="${id}" aria-haspopup="menu" aria-expanded="false"><span class="ppk-all ppk-nmc">${esc(label)}${n ? ` <em>${n}</em>` : ''}</span>${svg(CHEV_D)}</button></span>`;
77
+ function kindLabel(n) {
78
+ if (!S.kinds.length) return 'Kind: all' + (n ? ' ' + n : '');
74
79
  const names = S.kinds.map((k) => (k.startsWith('f:') ? (FAMILIES.find(([f]) => 'f:' + f === k) || [, k.slice(2)])[1] : k.slice(2)));
75
80
  return names[0] + (names.length > 1 ? ` +${names.length - 1}` : '');
76
81
  }
77
- const stateLabel = () => (!S.states.length ? 'Any state' : S.states[0] + (S.states.length > 1 ? ` +${S.states.length - 1}` : ''));
82
+ const stateLabel = () => (!S.states.length ? 'State: all' : S.states[0] + (S.states.length > 1 ? ` +${S.states.length - 1}` : ''));
78
83
  function drawFilters() {
79
- filters.innerHTML = chip('lbKind', kindLabel(), S.kinds.length > 0)
80
- + scopeChipHtml(S.P, S.sel, { id: 'lbScope', groups: scopeGroups() })
81
- + chip('lbState', stateLabel(), S.states.length > 0);
84
+ const n = (S.items || []).filter((x) => passes(x, { states: S.states, scope: F().scope })).length;
85
+ filters.innerHTML = chip('lbKind', kindLabel(n), S.kinds.length > 0) + chip('lbState', stateLabel(), S.states.length > 0)
86
+ + '<span class="sp"></span>' + chip('lbGroup', 'Group: ' + (GROUPS.find(([k]) => k === S.group) || [, 'New'])[1], false, 0, ' lb-cwr');
87
+ scopeW.innerHTML = scopeChipHtml(S.P, S.sel, { id: 'lbScope', groups: scopeGroups() });
82
88
  }
83
89
 
84
90
  /* ── a menu under a chip: one at a time (the Kind, State and Group by menus; the scope chip has its own) ── */
@@ -104,7 +110,7 @@ function openMenu(id, draw, press, cls = '') {
104
110
  closeMenu();
105
111
  const c = $(id); if (!c) return;
106
112
  const el = document.createElement('div');
107
- el.className = 'ppk-menu lb-menu ' + cls; el.setAttribute('role', 'menu'); el.setAttribute('data-esc-layer', '');
113
+ el.className = (/\bpm-menu\b/.test(cls) ? '' : 'ppk-menu ') + 'lb-menu ' + cls; el.setAttribute('role', 'menu'); el.setAttribute('data-esc-layer', '');
108
114
  // the menu stands under its chip inside the chip's own wrapper (CSS places it; nothing is written into a style)
109
115
  (c.closest('.lb-cw') || document.body).append(el);
110
116
  menu = { id, el, draw, press };
@@ -172,24 +178,33 @@ function statePress(b) {
172
178
  const groupMenu = () => `<p class="scp-h" role="presentation">Group by</p><div class="pm-tabs lb-pl" role="radiogroup" aria-label="Group by">${GROUPS.map(([k, n]) => `<button type="button" role="radio" aria-checked="${k === S.group}" class="pm-tab" data-lg="${k}">${esc(n)}</button>`).join('')}</div>`;
173
179
  function groupPress(b) { if (!b.dataset.lg) return false; S.group = b.dataset.lg; remember(); draw(); return `[data-lg="${S.group}"]`; }
174
180
 
175
- /* ── the table ── */
176
- const head = () => `<thead><tr><th scope="col" class="ic"><span class="vh">Kind of item</span></th>${COLUMNS.map((c) => `<th scope="col">${c}</th>`).join('')}</tr></thead>`;
177
- const SPAN = COLUMNS.length + 1;
178
- function nameCell(x, extra = '') {
181
+ /* ── the list: one List block of ListRows (kind icon, name, a why line, the state Badge) ── */
182
+ const multi = () => new Set((S.items || []).map((x) => x.product).filter(Boolean)).size > 1;
183
+ function badge(r) {
184
+ const x = r.x, t = stateText(r);
185
+ if (!t || (x.state === 'Final' && t === 'Final')) return ''; // Final is the usual state: zero is silence
186
+ return `<span class="pm-badge${x.state === 'Issued' ? ' blue' : ''}">${esc(t)}</span>`;
187
+ }
188
+ function whyOf(x, shelf) {
189
+ if (x.named) return `Note with no title · PMOS named it from what it says · ${dayText(when(x))}`;
190
+ return [x.kindText, multi() ? x.product : '', shelf ? '' : aboutText(x), x.by, dayText(when(x))].filter(Boolean).join(' · ');
191
+ }
192
+ function nameHtml(x, older) {
179
193
  if (S.naming === x.id) {
180
- return `<td class="n lb-nm"><span class="pm-row"><input class="pm-input" id="lbNameIn" value="${esc(x.name)}" aria-label="The note's name" maxlength="120" />`
194
+ return `<span class="pm-row lb-nm"><input class="pm-input" id="lbNameIn" value="${esc(x.name)}" aria-label="The note's name" maxlength="120" />`
181
195
  + `<button type="button" class="pm-btn" data-lb-name-ok aria-label="Keep this name" title="Keep this name">${svg(TICK)}</button>`
182
- + `<button type="button" class="pm-btn" data-lb-name-no aria-label="Cancel" title="Cancel">${svg(X)}</button></span></td>`;
196
+ + `<button type="button" class="pm-btn" data-lb-name-no aria-label="Cancel" title="Cancel">${svg(X)}</button></span>`;
183
197
  }
184
- const spark = x.named ? `<button type="button" class="pm-btn pm-star lb-sp" data-lb-name="${esc(x.id)}" aria-label="PMOS named this note. Keep the name or rename it" title="PMOS named this note: keep or rename">${svg(SPARK)}</button>` : '';
185
- return `<td class="n"><span class="lb-nw"><button type="button" class="lb-nb" data-lb-open>${esc(x.name)}</button>${spark}${extra}</span></td>`;
198
+ const spark = x.named ? `<span class="pm-star lb-sp" title="PMOS named this note">${svg(SPARK)}</span>` : '';
199
+ return `<span class="lb-nw">${spark}<button type="button" class="t lb-nb" data-lb-open>${esc(x.name)}</button>${older}</span>`;
186
200
  }
187
- function aboutCell(x) {
188
- const a = aboutText(x);
189
- if (!a && x.kind === 'meeting' && x.suggest) {
190
- return `<td class="c"><button type="button" class="lb-sg" data-lb-link="${esc(x.id)}" title="PMOS suggests: this note is about ${esc(x.suggest.title)}. Press to link it">${svg(SPARK, 'pm-star')}<span>${esc(x.suggest.title)}</span></button></td>`;
201
+ function actsHtml(x) {
202
+ // a pending question stays in sight: keep or rename PMOS's name; link the work PMOS thinks a note is about
203
+ if (x.named && S.naming !== x.id) {
204
+ return `<span class="lb-acts"><button type="button" class="pm-btn" data-lb-keep="${esc(x.id)}" aria-label="Keep the name PMOS gave it" title="Keep this name">${svg(TICK)}</button>`
205
+ + `<button type="button" class="pm-btn" data-lb-name="${esc(x.id)}" aria-label="Rename the note" title="Rename">${svg(PEN)}</button></span>`;
191
206
  }
192
- return `<td class="c" title="${esc(a)}">${esc(a)}</td>`;
207
+ return '';
193
208
  }
194
209
  function rowHtml(r, i, sub = false, shelf = '') {
195
210
  const x = r.x;
@@ -197,39 +212,45 @@ function rowHtml(r, i, sub = false, shelf = '') {
197
212
  const same = !!shelf && (bare(x.name) === bare(shelf) || (bare(shelf).length >= 4 && bare(x.name).startsWith(bare(shelf))));
198
213
  const older = r.older && r.older.length ? `<button type="button" class="pm-chip lb-old" data-lb-ed="${esc(x.id)}" aria-expanded="${S.ed.has(x.id)}">${r.older.length} earlier</button>` : '';
199
214
  const label = `${x.name}${x.state ? ', ' + x.state : ''}. ${x.kindText}${aboutText(x) ? '. About ' + aboutText(x) : ''}${x.open && x.open.url ? '. Opens in a new tab' : ''}`;
200
- return `<tr class="lb-i${sub ? ' sub' : ''}${S.pick === x.id ? ' sel' : ''}" data-lb-i="${i}" aria-label="${esc(label)}">`
201
- + `<td class="ic">${svg(ICON[x.kind] || ICON.doc)}</td>${nameCell(same ? { ...x, name: x.kindText } : x, older)}`
202
- + `<td class="c">${same ? '' : esc(x.kindText)}</td><td class="c">${esc(x.product || '')}</td>${shelf ? '<td class="c"></td>' : aboutCell(x)}`
203
- + `<td class="c">${esc(x.by || '')}</td><td class="c q">${esc(stateText(r))}</td>`
204
- + `<td class="c">${esc(dayText(when(x)))}</td></tr>`;
215
+ const shown = same ? { ...x, name: x.kindText, named: false } : x;
216
+ let why = esc(whyOf(shown, shelf));
217
+ if (!aboutText(x) && x.kind === 'meeting' && x.suggest) {
218
+ why += ` · <button type="button" class="lb-sg" data-lb-link="${esc(x.id)}" title="PMOS suggests: this note is about ${esc(x.suggest.title)}. Press to link it">${svg(SPARK, 'pm-star')}<span>${esc(x.suggest.title)}?</span></button>`;
219
+ }
220
+ return `<div class="pm-li lb-i${sub ? ' nest' : ''}${S.pick === x.id ? ' now' : ''}" role="listitem" data-lb-i="${i}" aria-label="${esc(label)}">`
221
+ + `<span class="pm-meta lb-mi">${svg(ICON[x.kind] || ICON.doc)}</span>`
222
+ + `<span class="txt">${nameHtml(shown, older)}<span class="w">${why}</span></span>${badge(r)}${actsHtml(x)}</div>`;
205
223
  }
206
224
  function checksHtml(r) {
207
225
  const open = S.ck.has(r.key), a = r.about || {};
208
226
  const newest = r.checks.reduce((m, x) => (String(when(x)) > String(when(m)) ? x : m), r.checks[0]);
209
- let h = `<tr class="lb-i lb-ck"><td class="ic">${svg(ICON.checks)}</td>`
210
- + `<td class="n"><span class="lb-nw"><button type="button" class="lb-nb" data-lb-ck="${esc(r.key)}" aria-expanded="${open}">Checks · ${r.checks.length}</button></span></td>`
211
- + `<td class="c">${esc([...new Set(r.checks.map((x) => x.kindText))].join(', '))}</td><td class="c">${esc(a.product || '')}</td>`
212
- + `<td class="c">${esc([a.programTitle, a.title].filter(Boolean).join(' › '))}</td><td class="c">PMOS</td><td class="c"></td>`
213
- + `<td class="c">${esc(dayText(when(newest)))}</td></tr>`;
227
+ const why = [[...new Set(r.checks.map((x) => x.kindText))].join(', '), multi() ? a.product : '', [a.programTitle, a.title].filter(Boolean).join(' › '), 'PMOS', dayText(when(newest))].filter(Boolean).join(' · ');
228
+ let h = `<div class="pm-li lb-i lb-ck" role="listitem"><span class="pm-meta lb-mi">${svg(ICON.checks)}</span>`
229
+ + `<span class="txt"><span class="lb-nw"><button type="button" class="t lb-nb" data-lb-ck="${esc(r.key)}" aria-expanded="${open}">Checks · ${r.checks.length}</button></span><span class="w">${esc(why)}</span></span></div>`;
214
230
  if (open) for (const x of r.checks) { h += rowHtml({ x, older: [] }, S.shown.length, true); S.shown.push(x); }
215
231
  return h;
216
232
  }
217
- function tableHtml(groups) {
218
- let h = `<div class="pm-block list lb-blk"><table class="pm-table lb-t" aria-label="Library">${head()}<tbody>`;
233
+ function rowsHtml(groups) {
234
+ // with a search, grouped by New, the names that match stand as one list (the head says what they match)
235
+ const flat = !!S.q && S.group === 'new';
236
+ let h = '';
219
237
  for (const g of groups) {
220
238
  if (g.level === 2) {
221
- h += `<tr class="lb-g lb-s"><th scope="rowgroup" colspan="${SPAN}"><button type="button" class="pm-group" data-lb-fold="${esc(g.key)}" aria-expanded="${!g.folded}">${svg(g.folded ? CHEV_R : CHEV_D)}<b>${esc(g.label)}</b><em>${g.n}</em></button></th></tr>`;
239
+ h += `<button type="button" class="pm-group lb-s" data-lb-fold="${esc(g.key)}" aria-expanded="${!g.folded}">${svg(g.folded ? CHEV_R : CHEV_D)}<b>${esc(g.label)}</b><em>${g.n}</em></button>`;
222
240
  if (g.folded) continue;
223
- } else h += `<tr class="lb-g"><th scope="rowgroup" colspan="${SPAN}"><div class="pm-group">${esc(g.label)}${S.group === 'work' ? ` <em>${g.n}</em>` : ''}</div></th></tr>`;
241
+ } else if (!flat) h += `<div class="pm-group" role="presentation">${esc(g.label)}${S.group === 'work' ? ` <em>${g.n}</em>` : ''}</div>`;
224
242
  const shelf = g.level === 2 && g.key !== 'w:none' ? g.label : '';
243
+ let rows = '';
225
244
  for (const r of g.rows) {
226
- if (r.checks) { h += checksHtml(r); continue; }
227
- h += rowHtml(r, S.shown.length, false, shelf); S.shown.push(r.x);
228
- if (r.older.length && S.ed.has(r.x.id)) for (const o of r.older) { h += rowHtml({ x: o, older: [] }, S.shown.length, true, shelf); S.shown.push(o); }
245
+ if (r.checks) { rows += checksHtml(r); continue; }
246
+ rows += rowHtml(r, S.shown.length, false, shelf); S.shown.push(r.x);
247
+ if (r.older.length && S.ed.has(r.x.id)) for (const o of r.older) { rows += rowHtml({ x: o, older: [] }, S.shown.length, true, shelf); S.shown.push(o); }
229
248
  }
249
+ h += `<div class="rows" role="list">${rows}</div>`;
230
250
  }
231
- return h + '</tbody></table></div>';
251
+ return h;
232
252
  }
253
+ const headHtml = (title, meta) => `<div class="head"><h2 class="pm-h-sm">${title}</h2><span class="pm-meta">${esc(meta)}</span><span class="sp"></span></div>`;
233
254
 
234
255
  /* ── search by meaning ── */
235
256
  const bare = (s) => String(s || '').toLowerCase().replace(/…$/, '').replace(/[^a-z0-9]+/g, ' ').trim();
@@ -248,14 +269,14 @@ function meaningHtml(titled) {
248
269
  const list = (M.results || []).map((r) => ({ ...r, x: byId.get(r.id) })).filter((r) => r.x && !seen.has(r.id) && passes(r.x, F()));
249
270
  const line = M.busy ? 'PMOS is reading them for meaning…' : !M.ranked && M.why ? 'Ranked by shared words: ' + M.why + '.' : '';
250
271
  if (!list.length) return M.busy && !M.results ? `<p class="pm-meta lb-mq">${esc(line || 'PMOS is reading for meaning…')}</p>` : '';
251
- let h = `<section class="pm-block list lb-m" aria-label="${titled.length ? 'Also about this' : 'About this'}"><div class="head"><h2 class="pm-h">${titled.length ? 'Also about this' : 'About this'}</h2><span class="pm-meta">${list.length}</span></div>`
272
+ let h = `<div class="lb-m" role="group" aria-label="${titled.length ? 'Also about this' : 'About this'}">${headHtml(titled.length ? 'Also about this' : 'About this', 'by meaning · ' + list.length)}`
252
273
  + `${line ? `<p class="pm-meta lb-mq">${esc(line)}</p>` : ''}<div class="rows" role="list">`;
253
274
  for (const r of list) {
254
275
  const x = r.x, i = S.shown.length; S.shown.push(x);
255
- h += `<div class="pm-li lb-mr" role="listitem" data-lb-i="${i}"><span class="pm-meta lb-mi">${svg(ICON[x.kind] || ICON.doc)}</span><span class="txt"><button type="button" class="t lb-nb" data-lb-open>${esc(x.name)}</button>`
256
- + `<span class="w">${esc([x.kindText, x.product, aboutText(x)].filter(Boolean).join(' · '))}</span><span class="lb-ps">${bolded(r.passage || '', r.idea, r.words)}</span></span></div>`;
276
+ h += `<div class="pm-li lb-mr${S.pick === x.id ? ' now' : ''}" role="listitem" data-lb-i="${i}"><span class="pm-meta lb-mi">${svg(ICON[x.kind] || ICON.doc)}</span><span class="txt"><button type="button" class="t lb-nb" data-lb-open>${esc(x.name)}</button>`
277
+ + `<span class="w">${esc([x.kindText, multi() ? x.product : '', aboutText(x), dayText(when(x))].filter(Boolean).join(' · '))}</span>${r.passage ? `<span class="lb-ps">“${bolded(r.passage, r.idea, r.words)}”</span>` : ''}</span></div>`;
257
278
  }
258
- return h + '</div></section>';
279
+ return h + '</div></div>';
259
280
  }
260
281
  let findT = null, findN = 0;
261
282
  function findByMeaning() {
@@ -279,7 +300,7 @@ function findByMeaning() {
279
300
  }, 450);
280
301
  }
281
302
 
282
- /* ── the record preview (≥ 1600 px) ── */
303
+ /* ── the open item: a Detail block at the right (a desk, ≥ 1200 px) ── */
283
304
  function field(k, v) { return v ? `<dt>${esc(k)}</dt><dd>${esc(v)}</dd>` : ''; }
284
305
  async function drawPreview() {
285
306
  const x = S.pick && (S.items || []).find((i) => i.id === S.pick);
@@ -288,14 +309,15 @@ async function drawPreview() {
288
309
  const older = (S.items || []).filter((o) => o.ed && o.ed === x.ed && o.id !== x.id).sort((a, b) => (b.v || 0) - (a.v || 0) || String(when(b)).localeCompare(String(when(a))));
289
310
  const p = x.open && x.open.doc ? S.peek.get(x.id) : null;
290
311
  const lines = x.kind === 'meeting' ? x.gist || [] : p && p.head ? p.head : [];
291
- pv.innerHTML = `<div class="head"><span class="pm-meta lb-mi">${svg(ICON[x.kind] || ICON.doc)}</span><h2 class="pm-h">${esc(x.name)}</h2>`
292
- + `<button type="button" class="pm-btn" data-lb-pv-open aria-label="Open ${esc(x.name)}" title="Open">${svg(OPEN)}</button>`
293
- + `<button type="button" class="pm-btn" data-lb-pv-close aria-label="Close the preview" title="Close">${svg(X)}</button></div>`
294
- + `<dl class="pm-field">${field('Kind', x.kindText)}${field('Product', x.product)}${field('About', aboutText(x) || (x.about && x.about.title))}${field('By', x.by)}${field('State', stateText({ x, older }))}`
312
+ pv.innerHTML = `<div class="head"><span class="lb-mi">${svg(ICON[x.kind] || ICON.doc)}</span><h2 class="pm-h">${esc(x.name)}</h2>`
313
+ + `<button type="button" class="pm-btn" data-lb-pv-open aria-label="Open ${esc(x.name)}, with the chat about it" title="Open, with the chat about it">${svg(OPEN)}</button>`
314
+ + `<button type="button" class="pm-btn" data-lb-pv-close aria-label="Close the record" title="Close">${svg(X)}</button></div>`
315
+ + `<p class="pm-meta lb-pvh">Press again or Enter to open it as the full popup</p>`
316
+ + `<dl class="pm-field">${field('Kind', x.kindText)}${field('Product', x.product)}${field('About', aboutText(x) || (x.about && x.about.title))}${field('By', x.by)}${stateText({ x, older }) ? `<dt>State</dt><dd><span class="pm-badge${x.state === 'Issued' ? ' blue' : ''}">${esc(stateText({ x, older }))}</span></dd>` : ''}`
295
317
  + `${field(x.kind === 'meeting' ? 'Held' : 'Updated', dayText(when(x)))}${field('Came out of it', x.came)}${field('Title', x.sub)}${field('File', x.path)}</dl>`
296
- + (lines.length ? `<h3 class="pm-h-sm">First lines</h3><div class="lb-pvl">${lines.map((l) => `<p>${esc(l)}</p>`).join('')}</div>` : x.open && x.open.doc && !p ? '<p class="pm-meta">Reading the first lines…</p>' : '')
297
- + (p && p.from && p.from.length ? `<h3 class="pm-h-sm">Linked from</h3><ul>${p.from.map((f) => `<li>${esc(f.title)}</li>`).join('')}</ul>` : '')
298
- + (older.length ? `<h3 class="pm-h-sm">Editions</h3><ul>${older.map((o) => `<li><button type="button" class="lb-nb" data-lb-pv-ed="${esc(o.id)}">${esc(o.name)}${o.v ? ' · v' + o.v : ''}</button> <span class="pm-meta">${esc(dayText(when(o)))}</span></li>`).join('')}</ul>` : '');
318
+ + (lines.length ? `<h3 class="pm-meta lb-pvk">First lines</h3><div class="lb-pvl">${lines.map((l) => `<p>${esc(l)}</p>`).join('')}</div>` : x.open && x.open.doc && !p ? '<p class="pm-meta">Reading the first lines…</p>' : '')
319
+ + (p && p.from && p.from.length ? `<h3 class="pm-meta lb-pvk">Linked from</h3><ul>${p.from.map((f) => `<li>${esc(f.title)}</li>`).join('')}</ul>` : '')
320
+ + (older.length ? `<h3 class="pm-meta lb-pvk">Editions</h3><ul>${older.map((o) => `<li><button type="button" class="lb-nb" data-lb-pv-ed="${esc(o.id)}">${esc(o.name)}${o.v ? ' · v' + o.v : ''}</button> <span class="pm-meta">${esc(dayText(when(o)))}</span></li>`).join('')}</ul>` : '');
299
321
  if (x.open && x.open.doc && !p) {
300
322
  const r = await pmGet('/api/library-items/peek?ws=' + encodeURIComponent(x.open.doc.ws) + '&path=' + encodeURIComponent(x.open.doc.path)).catch(() => null);
301
323
  S.peek.set(x.id, r && r.ok ? r : { head: [], from: [] });
@@ -312,16 +334,18 @@ function draw() {
312
334
  S.shown = [];
313
335
  const filtered = S.kinds.length || S.states.length || narrowed(S.P, S.sel);
314
336
  if (filtered && V.hidden) {
315
- const words = [kindLabel(), S.states.join(', '), narrowed(S.P, S.sel) ? scopeWords(S.P, S.sel, scopeGroups()) : ''].filter((w) => w && w !== 'Every kind');
337
+ const words = [S.kinds.length ? kindLabel() : '', S.states.join(', '), narrowed(S.P, S.sel) ? scopeWords(S.P, S.sel, scopeGroups()) : ''].filter(Boolean);
316
338
  hid.innerHTML = `${esc(words.length ? 'Showing ' + words.join(' · ') + ' only. ' : '')}${esc(hiddenText(V.hidden))} <button type="button" data-lb-all>Show all</button>`;
317
339
  } else hid.innerHTML = '';
318
340
  let h = '';
319
341
  if (!V.groups.length) {
320
342
  // zero is silence: one quiet line, no empty table
321
343
  h = S.q && S.meaning && S.meaning.q === S.q && (S.meaning.busy || (S.meaning.results || []).length) ? '' : `<p class="pm-meta lb-none">${esc(S.q ? 'No title in the Library matches "' + S.q + '".' : filtered ? 'Nothing here fits the filters.' : 'Nothing was made yet. Documents, meeting notes and prototypes show here as they are made.')}</p>`;
322
- } else h = tableHtml(V.groups);
344
+ } else h = rowsHtml(V.groups);
323
345
  const titled = S.shown.map((x) => x.id);
324
- body.innerHTML = h + meaningHtml(titled);
346
+ const m = meaningHtml(titled);
347
+ const head = S.q && V.groups.length ? headHtml(`Names with “${esc(S.q)}”`, String(titled.length)) : '';
348
+ body.innerHTML = V.groups.length || /lb-m"/.test(m) ? `<section class="pm-block list lb-blk" aria-label="Library">${head}${h}${m}</section>` : h + m;
325
349
  note.textContent = noteOf(S.q, S.group);
326
350
  if (S.naming) { const i = $('lbNameIn'); if (i) { i.focus(); i.select(); } }
327
351
  if (S.pick) drawPreview();
@@ -357,15 +381,22 @@ filters.onclick = (e) => {
357
381
  const b = e.target.closest('button'); if (!b) return;
358
382
  if (b.id === 'lbKind') openMenu('lbKind', kindMenu, kindPress);
359
383
  else if (b.id === 'lbState') openMenu('lbState', stateMenu, statePress);
360
- else if (b.id === 'lbScope') { closeMenu(); openScope(b, { P: S.P, groups: scopeGroups(), sel: S.sel, unit: 'items', onApply: async (next) => { S.sel = { programs: next.programs, projects: next.projects }; S.P = (await readPick().catch(() => null)) || S.P; draw(); } }); }
384
+ else if (b.id === 'lbGroup') openMenu('lbGroup', groupMenu, groupPress, 'lb-gm');
361
385
  };
362
- $('lbTune').onclick = () => openMenu('lbTune', groupMenu, groupPress, 'lb-gm');
363
- hid.onclick = async (e) => {
364
- if (!e.target.closest('[data-lb-all]')) return;
386
+ scopeW.onclick = (e) => {
387
+ const b = e.target.closest('button'); if (!b) return;
388
+ if (b.id === 'lbScope') { closeMenu(); openScope(b, { P: S.P, groups: scopeGroups(), sel: S.sel, unit: 'items', onApply: async (next) => { S.sel = { programs: next.programs, projects: next.projects }; S.P = (await readPick().catch(() => null)) || S.P; draw(); } }); }
389
+ };
390
+ async function showAll() {
365
391
  S.kinds = []; S.states = []; S.sel = { programs: [], projects: [] }; remember();
366
392
  if (S.P && S.P.products && S.P.products.some((p) => !p.on)) { const { savePick } = await import('./cozy-pick.js'); await savePick(S.P.products.map((p) => p.ws)); }
367
393
  draw();
368
- };
394
+ }
395
+ hid.onclick = (e) => { if (e.target.closest('[data-lb-all]')) showAll(); };
396
+ // More: what the top line does not show (Show all clears every filter; Read again fetches the Library now)
397
+ const moreMenu = () => `<button type="button" role="menuitem" data-lm="all">${svg(CLEAR)}Show all</button><button type="button" role="menuitem" data-lm="load">${svg(RELOAD)}Read the Library again</button>`;
398
+ function morePress(b) { if (!b.dataset.lm) return false; closeMenu(); if (b.dataset.lm === 'all') showAll(); else load(); return false; }
399
+ $('lbMore').onclick = () => openMenu('lbMore', moreMenu, morePress, 'pm-menu lb-mm');
369
400
  addEventListener('pp:changed', (e) => { if (e.detail && e.detail.products) { S.P = e.detail; draw(); } });
370
401
  function press(x) {
371
402
  if (!x) return;
@@ -391,6 +422,7 @@ body.onclick = async (e) => {
391
422
  if ((b = t.closest('[data-lb-ed]'))) { const k = b.dataset.lbEd; if (S.ed.has(k)) S.ed.delete(k); else S.ed.add(k); draw(); return; }
392
423
  if ((b = t.closest('[data-lb-ck]'))) { const k = b.dataset.lbCk; if (S.ck.has(k)) S.ck.delete(k); else S.ck.add(k); draw(); return; }
393
424
  if ((b = t.closest('[data-lb-name]'))) { S.naming = b.dataset.lbName; draw(); return; }
425
+ if ((b = t.closest('[data-lb-keep]'))) { const x = (S.items || []).find((i) => i.id === b.dataset.lbKeep); if (x) saveName(x.id, x.name); return; }
394
426
  if (t.closest('[data-lb-name-ok]')) { const i = $('lbNameIn'); saveName(S.naming, i ? i.value : ''); return; }
395
427
  if (t.closest('[data-lb-name-no]')) { S.naming = null; draw(); return; }
396
428
  if (t.closest('#lbNameIn')) return;
@@ -5,11 +5,11 @@
5
5
  <meta name="pmos-nonce" content="" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
7
7
  <title>PMOS · Library</title>
8
- <!-- Library (initiative library-place; slice 7 of the six-place navigation, Library round 2). A catalogue of everything that was made, from
9
- every product: Name, Kind, Product, About, By, State, Updated. One filter row (Kind, product/program/project, State), the search field (a
10
- title match at once, the items about it by meaning under it), the tune button (Group by New, Work, Kind or Product) and the + (PMOS adds a
11
- file, a link or a document). A press opens the item in the one popup (pm/cozy-popup.js) with the chat about it; on a screen 1600 px or wider
12
- the first press shows the record at the right. It reads GET /api/library-items (lib/routes-library.js). -->
8
+ <!-- Library (initiative library-place; slice 7 of the six-place navigation; rebuilt from Komorebi blocks in library-ds-page). Everything
9
+ that was made, from every product. The top line: the path, the product, program and project chip, + (PMOS adds a file, a link or a
10
+ document) and More. The search Input is always shown (/ focuses it): names that match first, then "Also about this" by meaning. The Kind
11
+ and State chips (with counts) and Group (New, Work, Kind or Product). A press shows the Detail at the right; a second press or Enter opens
12
+ the item in the one popup (pm/cozy-popup.js) with the chat about it. It reads GET /api/library-items (lib/routes-library.js). -->
13
13
  <link rel="preload" href="/vendor/plus-jakarta-sans-var.woff2" as="font" type="font/woff2" crossorigin />
14
14
  <link rel="stylesheet" href="/pm/cozy.css" />
15
15
  <link rel="stylesheet" href="/pm/cozy-pick.css" />
@@ -18,18 +18,22 @@
18
18
  <link rel="stylesheet" href="/pm/komorebi.css" />
19
19
  <link rel="stylesheet" href="/pm/cozy-library.css" />
20
20
  </head>
21
- <!-- Drawn with the PMOS design system (Komorebi, workspace/design-system/ui/): layout Main + open item, blocks List (the catalogue, as a
22
- Table block) and Detail (the record at the right). The filter chips and their menus stay the shared picker (pm/cozy-pick.css) that the
23
- product, program and project chip beside them uses. -->
21
+ <!-- Drawn with the PMOS design system (Komorebi, workspace/design-system/ui/), board LibraryDS on Exploring 3: layout Main + open item.
22
+ Main: the top line (Path, the scope chip, icon buttons), the search Input with its key, the filter chips, and one List block of ListRows
23
+ (group heads, folds, the meaning passages). The open item: a Detail block (pm-field). The chips and their menus are the shared picker
24
+ (pm/cozy-pick.css), the same as the product, program and project chip. -->
24
25
  <body class="cz pm-ds lb-page">
25
26
  <main class="stage cz-panel lb" id="stage">
26
27
  <h1 class="vh">Library</h1>
27
28
  <div class="lb-bar">
28
- <span class="lb-fl" id="lbFilters" role="group" aria-label="Filters"></span>
29
- <label class="lb-find"><svg class="pm-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M11 4.5a6.5 6.5 0 1 0 0 13a6.5 6.5 0 1 0 0-13M16 16l4 4"/></svg><span class="vh">Find in Library</span><input id="lbQ" type="search" autocomplete="off" spellcheck="false" placeholder="Find in Library" /></label>
30
- <span class="lb-cw lb-cwr"><button type="button" class="pm-btn lb-tune" id="lbTune" aria-haspopup="menu" aria-expanded="false" aria-label="Group by" title="Group by"><svg class="pm-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 7h10M18 7h2M4 17h4M12 17h8M16 5v4M10 15v4"/></svg></button></span>
29
+ <nav class="pm-path" aria-label="Path"><b>Library</b></nav>
30
+ <span class="lb-sc" id="lbScopeW"></span>
31
+ <span class="sp"></span>
31
32
  <button type="button" class="pm-btn lb-add" id="lbAdd" aria-label="Add a file, a link or a new document" title="Add a file, a link or a new document"><svg class="pm-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg></button>
33
+ <span class="lb-cw lb-cwr"><button type="button" class="pm-btn" id="lbMore" aria-haspopup="menu" aria-expanded="false" aria-label="More" title="More"><svg class="pm-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12h.01M12 12h.01M19 12h.01"/></svg></button></span>
32
34
  </div>
35
+ <div class="pm-row lb-find"><input class="pm-input" id="lbQ" type="search" autocomplete="off" spellcheck="false" placeholder="Find in Library" aria-label="Find in Library" /><span class="pm-kbd" aria-hidden="true">/</span></div>
36
+ <div class="pm-row lb-fl" id="lbFilters" role="group" aria-label="Filters"></div>
33
37
  <p class="pm-meta lb-hid" id="lbHid" aria-live="polite"></p>
34
38
  <div class="lb-wrap">
35
39
  <div class="lb-main">