@floless/app 0.170.0 → 0.171.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.
Files changed (53) hide show
  1. package/dist/floless-server.cjs +33000 -22928
  2. package/dist/schemas/steel.model.v2.schema.json +194 -3
  3. package/dist/skills/floless-app-bridge/SKILL.md +3 -3
  4. package/dist/skills/floless-app-knowledge/SKILL.md +4 -3
  5. package/dist/skills/floless-app-onboarding/SKILL.md +5 -4
  6. package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +0 -3
  7. package/dist/skills/floless-app-queue/SKILL.md +2 -3
  8. package/dist/skills/floless-app-report-issue/SKILL.md +2 -2
  9. package/dist/skills/floless-app-steel-model/SKILL.md +35 -35
  10. package/dist/skills/floless-app-steel-model/references/custom-connections.md +47 -0
  11. package/dist/skills/floless-app-steel-model/references/custom-sections.md +32 -0
  12. package/dist/skills/floless-app-ui/SKILL.md +71 -126
  13. package/dist/web/add-ons.js +407 -0
  14. package/dist/web/analytics.js +1 -1
  15. package/dist/web/app.css +108 -189
  16. package/dist/web/app.js +11 -12
  17. package/dist/web/aware.js +49 -29
  18. package/dist/web/chat.css +6 -1
  19. package/dist/web/chat.js +133 -18
  20. package/dist/web/commands-filter.js +23 -0
  21. package/dist/web/commands-shell.js +39 -67
  22. package/dist/web/commands-steel.js +9 -1
  23. package/dist/web/commands-tekla-parser.js +23 -0
  24. package/dist/web/connections.js +14 -3
  25. package/dist/web/failure-copy.js +1 -0
  26. package/dist/web/guide.js +3 -3
  27. package/dist/web/index.html +29 -56
  28. package/dist/web/instructor.js +2 -2
  29. package/dist/web/kb-categories.js +64 -7
  30. package/dist/web/model-change-findings.js +430 -0
  31. package/dist/web/model-change-review.js +414 -0
  32. package/dist/web/model-editor-steel-adapter.js +2 -2
  33. package/dist/web/project-history.js +7 -1
  34. package/dist/web/revit-editor.css +85 -0
  35. package/dist/web/revit-editor.js +36 -1
  36. package/dist/web/sha256-sync.js +62 -0
  37. package/dist/web/steel-3d-core.js +7 -0
  38. package/dist/web/steel-3d-flo.js +127 -3
  39. package/dist/web/steel-3d-view.js +25 -2
  40. package/dist/web/steel-custom-connection.js +161 -0
  41. package/dist/web/steel-custom-sections.js +1796 -0
  42. package/dist/web/steel-editor.html +279 -41
  43. package/dist/web/steel-filter-usage.js +299 -0
  44. package/dist/web/steel-filter.html +101 -4
  45. package/dist/web/steel-model-v2-client-validation.js +3 -0
  46. package/dist/web/steel-model-v2-commands.js +95 -6
  47. package/dist/web/steel-model-v2-projection.js +1 -1
  48. package/dist/web/steel-read-confidence.js +1 -56
  49. package/dist/web/tekla-editor.html +1 -0
  50. package/dist/web/workspaces.js +263 -28
  51. package/launch.mjs +87 -9
  52. package/package.json +1 -1
  53. package/dist/web/panels.js +0 -831
@@ -0,0 +1,299 @@
1
+ /**
2
+ * Used lines (2026-11-10 plan, docs/superpowers/specs/2026-11-10-filter-used-lines-overlay-PLAN.md): which Drawing
3
+ * Filter lines the steel model was built from, and which selected lines nothing in the model uses.
4
+ *
5
+ * A view over the record, never a new claim. Every state below is read from what the model already cites:
6
+ * - `member` an ACTIVE member observation cites the line (`plans[].memberObservations[].evidence.source`), or a
7
+ * source-view member's drawing target does (`provisional_members[].geometry.drawingTarget`);
8
+ * - `evidence` something else the model holds cites it: a callout, an elevation reading, a registration control,
9
+ * a detail-size claim (owner ruling F3, 2026-11-10: "used" means member lines plus other evidence);
10
+ * - `superseded` only superseded or archived observations cite it (used before a re-read or a delete);
11
+ * - `unused` the Filter selects it and nothing cites it.
12
+ * A selected line nothing cites is "not used", never "missed": the model does not record why a reader set a line
13
+ * aside (owner ruling F2, 2026-11-10), so this module cannot tell a deliberate skip from an oversight and must not
14
+ * pretend to.
15
+ *
16
+ * Element ids are content-addressed over source, sheet, index and element (server/steel-filter-contract.ts), so a
17
+ * bare id names exactly one Filter element: matching on the id alone is matching on (sourceHash, sheet, element).
18
+ */
19
+ import { textBox } from './steel-filter-core.js';
20
+
21
+ export const USED_STORAGE_KEY = 'floless:filter-used';
22
+ /** Draw order, bottom to top: the state a person must not miss is painted last. */
23
+ export const USAGE_STATES = Object.freeze(['superseded', 'evidence', 'member', 'unused']);
24
+
25
+ const obj = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
26
+ const rows = (v) => (Array.isArray(v) ? v : []);
27
+ const str = (v) => (typeof v === 'string' && v.trim() ? v.trim() : '');
28
+
29
+ /** Keys that name a Filter element wherever they appear in the model (schemas/steel.model.v2.schema.json). */
30
+ const ID_KEYS = new Set(['elementId', 'elementIds', 'sourceElementIds', 'referenceElementId']);
31
+ /**
32
+ * Top-level parts of the model that are not things the model is built from: the Filter itself (every element id is
33
+ * in it), and the server-written records of questions, decisions and notes, where an id names a line ASKED about.
34
+ */
35
+ const NOT_EVIDENCE = new Set(['filter', 'ai_decisions', 'read_notes', 'read_coverage', 'sheet_previews', 'origin', 'environment', 'source']);
36
+
37
+ function addRef(map, id, state, memberIds) {
38
+ const key = str(id);
39
+ if (!key) return;
40
+ let row = map.get(key);
41
+ if (!row) { row = { member: false, evidence: false, superseded: false, memberIds: new Set() }; map.set(key, row); }
42
+ row[state] = true;
43
+ for (const m of memberIds || []) if (str(m)) row.memberIds.add(str(m));
44
+ }
45
+
46
+ /** Every element id cited anywhere under `node`, skipping the subtrees `skip` names. */
47
+ function collectIds(node, out, skip) {
48
+ if (Array.isArray(node)) { for (const v of node) collectIds(v, out, skip); return; }
49
+ if (!obj(node)) return;
50
+ for (const [k, v] of Object.entries(node)) {
51
+ if (skip && skip(node, k)) continue;
52
+ if (ID_KEYS.has(k)) {
53
+ if (typeof v === 'string') out.push(v);
54
+ else if (Array.isArray(v)) for (const id of v) if (typeof id === 'string') out.push(id);
55
+ continue;
56
+ }
57
+ collectIds(v, out, skip);
58
+ }
59
+ }
60
+
61
+ /**
62
+ * The model's citations of Filter elements.
63
+ * @returns {{ byId: Map<string, {member:boolean, evidence:boolean, superseded:boolean, memberIds:Set<string>}>,
64
+ * memberCount: number, cited: number, manual: string[], memberLines: Map<string, Set<string>> }}
65
+ */
66
+ export function usageIndex(contract) {
67
+ const byId = new Map();
68
+ const memberLines = new Map(); // member id → the element ids its ACTIVE observations cite
69
+ const c = obj(contract) ? contract : {};
70
+ for (const plan of rows(c.plans)) {
71
+ if (!obj(plan)) continue;
72
+ for (const o of rows(plan.memberObservations)) {
73
+ if (!obj(o)) continue;
74
+ const id = str(obj(o.evidence) && obj(o.evidence.source) ? o.evidence.source.elementId : '');
75
+ const bound = rows(obj(o.binding) ? o.binding.memberIds : []).map(str).filter(Boolean);
76
+ // The lifecycle lives on the binding (schemas/steel.model.v2.schema.json $defs/observationBinding).
77
+ const active = (obj(o.binding) ? o.binding.status : undefined) === 'active';
78
+ if (id) addRef(byId, id, active ? 'member' : 'superseded', active ? bound : []);
79
+ if (active && id) for (const m of bound) { if (!memberLines.has(m)) memberLines.set(m, new Set()); memberLines.get(m).add(id); }
80
+ if (active && obj(o.evidence)) {
81
+ const more = [];
82
+ collectIds(o.evidence, more, (parent, k) => parent === o.evidence && k === 'source');
83
+ for (const ref of more) addRef(byId, ref, 'evidence');
84
+ }
85
+ }
86
+ const more = [];
87
+ collectIds(plan, more, (parent, k) => parent === plan && k === 'memberObservations');
88
+ for (const ref of more) addRef(byId, ref, 'evidence');
89
+ }
90
+ for (const p of rows(c.provisional_members)) {
91
+ if (!obj(p)) continue;
92
+ const target = obj(p.geometry) && obj(p.geometry.drawingTarget) ? p.geometry.drawingTarget : null;
93
+ const pid = str(p.id);
94
+ if (target && str(target.elementId)) {
95
+ addRef(byId, target.elementId, 'member', pid ? [pid] : []);
96
+ if (pid) { if (!memberLines.has(pid)) memberLines.set(pid, new Set()); memberLines.get(pid).add(str(target.elementId)); }
97
+ }
98
+ }
99
+ for (const [k, v] of Object.entries(c)) {
100
+ if (k === 'plans' || k === 'provisional_members' || NOT_EVIDENCE.has(k)) continue;
101
+ const more = [];
102
+ collectIds(v, more);
103
+ for (const ref of more) addRef(byId, ref, 'evidence');
104
+ }
105
+ const members = rows(c.members).filter(obj);
106
+ const manual = members.filter((m) => m.provenance === 'manual' && !memberLines.has(str(m.id))).map((m) => str(m.id));
107
+ return { byId, memberLines, memberCount: members.length + rows(c.provisional_members).length, cited: byId.size, manual };
108
+ }
109
+
110
+ /**
111
+ * One element's state, or '' for a line the Filter does not select. A filtered-out line is never marked, cited or
112
+ * not: it is not in the selection the model reads, and on a raster sheet it is not even drawn (plan, States).
113
+ */
114
+ export function elementUsage(index, el, selected) {
115
+ if (!selected) return '';
116
+ const row = index && el && index.byId.get(str(el.elementId));
117
+ if (row && row.member) return 'member';
118
+ if (row && row.evidence) return 'evidence';
119
+ if (row && row.superseded) return 'superseded';
120
+ return 'unused';
121
+ }
122
+
123
+ /**
124
+ * Members whose drawing lines are on none of the Filter's sheets: read from an earlier revision of the drawing,
125
+ * whose lines the current Filter does not hold.
126
+ */
127
+ export function membersFromElsewhere(index, sheets) {
128
+ if (!index) return 0;
129
+ const present = new Set();
130
+ for (const sh of rows(sheets)) for (const el of rows(sh && sh.elements)) if (str(el && el.elementId)) present.add(str(el.elementId));
131
+ let n = 0;
132
+ for (const ids of index.memberLines.values()) if (![...ids].some((id) => present.has(id))) n++;
133
+ return n;
134
+ }
135
+
136
+ /** SVG path data that traces one element: its own `d`, a circle, or the box a text run sits in. */
137
+ export function elementPathData(el) {
138
+ if (!el) return '';
139
+ if (el.kind === 'text') {
140
+ const box = textBox(el.bbox);
141
+ if (!box) return '';
142
+ const [x0, y0, x1, y1] = box, pad = 2;
143
+ return `M${x0 - pad} ${y0 - pad}H${x1 + pad}V${y1 + pad}H${x0 - pad}Z`;
144
+ }
145
+ if (typeof el.d === 'string' && el.d.trim()) return el.d;
146
+ if (el.kind === 'circle' && [el.cx, el.cy, el.r].every(Number.isFinite) && el.r > 0) {
147
+ const { cx, cy, r } = el;
148
+ return `M${cx - r} ${cy}a${r} ${r} 0 1 0 ${2 * r} 0a${r} ${r} 0 1 0 ${-2 * r} 0`;
149
+ }
150
+ return '';
151
+ }
152
+
153
+ /**
154
+ * One sheet's marks: path data per state (each state is ONE <path>, so the overlay adds four nodes, not thousands)
155
+ * and the counts the chip shows. `isSelected(el)` is the Filter's own current selection.
156
+ */
157
+ export function sheetUsage(index, elements, isSelected) {
158
+ const parts = { member: [], evidence: [], superseded: [], unused: [] };
159
+ const counts = { member: 0, evidence: 0, superseded: 0, unused: 0 };
160
+ for (const el of rows(elements)) {
161
+ const state = elementUsage(index, el, !!(isSelected && isSelected(el)));
162
+ if (!state) continue;
163
+ counts[state]++;
164
+ const d = elementPathData(el);
165
+ if (d) parts[state].push(d);
166
+ }
167
+ const paths = {};
168
+ for (const k of USAGE_STATES) paths[k] = parts[k].join(' ');
169
+ return { paths, counts };
170
+ }
171
+
172
+ const plural = (n, one, many) => `${n} ${n === 1 ? one : many}`;
173
+
174
+ /**
175
+ * What the chip says. Plain words, and true ones: "not used" rather than "missed", and an empty model says that
176
+ * lines are marked once the model takes them in rather than showing a sheet-wide wall of amber.
177
+ * @returns {{ kind: 'empty'|'none-here'|'counts', used: number, unused: number, lead: string, extras: string[], showUnused: boolean }}
178
+ */
179
+ export function usageChip(index, counts, elsewhere) {
180
+ const used = (counts.member || 0) + (counts.evidence || 0);
181
+ const extras = [];
182
+ if (counts.superseded) extras.push(plural(counts.superseded, 'line used before a re-read', 'lines used before a re-read'));
183
+ if (elsewhere) extras.push(plural(elsewhere, 'member from an earlier drawing revision', 'members from an earlier drawing revision'));
184
+ if (index && index.manual.length) extras.push(plural(index.manual.length, 'member added by hand, with no drawing line', 'members added by hand, with no drawing line'));
185
+ if (!index || (!index.cited && !index.memberCount)) {
186
+ return { kind: 'empty', used: 0, unused: 0, lead: 'No members yet. Lines are marked once the model takes them in.', extras: [], showUnused: false };
187
+ }
188
+ if (!used) return { kind: 'none-here', used: 0, unused: counts.unused || 0, lead: 'Nothing in the model uses a line on this sheet yet.', extras, showUnused: false };
189
+ return { kind: 'counts', used, unused: counts.unused || 0, lead: `${used} used`, extras, showUnused: true };
190
+ }
191
+
192
+ /** The one sentence a screen reader hears. */
193
+ export function usageAnnouncement(chip) {
194
+ if (chip.kind !== 'counts') return 'Used lines: ' + chip.lead;
195
+ return `Used lines: ${chip.used} used, ${chip.unused} not used on this sheet.` + (chip.extras.length ? ' ' + chip.extras.join('. ') + '.' : '');
196
+ }
197
+
198
+ const TOGGLE_TIP = '. Marks the drawing lines the steel model was built from (solid green, or dashed for callouts and other readings) and the selected lines nothing in the model uses yet (dotted amber). It changes nothing in the filter or the model.';
199
+ /** How long after a person asks (the toggle, a sheet switch) the count is said, so a burst of repaints says it once. */
200
+ export const USED_ANNOUNCE_MS = 1500;
201
+
202
+ /**
203
+ * The Used lines overlay on the Drawing Filter stage: the marks, the toggle in the bottom-left bar, and the count
204
+ * chip above it. On by default and remembered on this computer; "Only not used" lasts for this visit only. The page
205
+ * calls `render()` on every repaint (a selection, mode or sheet change); a commit to the model reloads the page, so
206
+ * the marks follow each saved read without a poll of their own.
207
+ */
208
+ export function mountUsedLines(o) {
209
+ const paths = Object.fromEntries(USAGE_STATES.map((k) => [k, o.g.querySelector('.u-' + k)]));
210
+ let on = true;
211
+ try { on = !o.storage || o.storage.getItem(USED_STORAGE_KEY) !== 'off'; } catch { on = true; }
212
+ let onlyUnused = false, chip = null, timer = 0, lastSheet = null, index = null, indexFor = null, elsewhere = 0;
213
+
214
+ function indexNow() {
215
+ const c = o.contract();
216
+ if (index && indexFor === c) return index;
217
+ index = usageIndex(c); indexFor = c;
218
+ elsewhere = membersFromElsewhere(index, o.sheets());
219
+ return index;
220
+ }
221
+ function announce() {
222
+ clearTimeout(timer);
223
+ timer = setTimeout(() => { if (on && chip) o.live.textContent = usageAnnouncement(chip); }, USED_ANNOUNCE_MS);
224
+ }
225
+ function render() {
226
+ if (!o.ready()) { o.chip.hidden = true; o.stage.style.setProperty('--used-chip-h', '0px'); return; }
227
+ // Off costs nothing per repaint: the marks keep their last shape while they fade, and are rebuilt when turned on.
228
+ if (!on) {
229
+ o.g.classList.add('off');
230
+ o.chip.hidden = true;
231
+ o.stage.classList.remove('used-only-unused', 'used-on');
232
+ o.toggle.setAttribute('aria-pressed', 'false');
233
+ o.toggle.dataset.tip = 'Show used lines' + TOGGLE_TIP;
234
+ o.stage.style.setProperty('--used-chip-h', '0px');
235
+ lastSheet = o.active();
236
+ if (o.afterLayout) o.afterLayout();
237
+ return;
238
+ }
239
+ const sheets = o.sheets(), active = o.active();
240
+ const els = (sheets[active] && sheets[active].elements) || [];
241
+ const idx = indexNow();
242
+ const { paths: d, counts } = sheetUsage(idx, els, o.isSelected);
243
+ chip = usageChip(idx, counts, elsewhere);
244
+ // No amber until something on this sheet is used: before a read lands, every selected line would be "not used".
245
+ for (const k of USAGE_STATES) paths[k].setAttribute('d', k === 'unused' && !chip.showUnused ? '' : d[k]);
246
+ const reviewable = chip.showUnused && chip.unused > 0;
247
+ if (!reviewable) onlyUnused = false;
248
+ // Every selected line used: say so in words rather than offer a review switch with nothing to review.
249
+ o.lead.textContent = chip.showUnused && !chip.unused ? chip.lead + ' · none left unused' : chip.lead;
250
+ o.swUsed.hidden = chip.kind !== 'counts';
251
+ o.onlyBtn.hidden = !reviewable;
252
+ o.unusedN.textContent = chip.unused + ' not used';
253
+ o.onlyBtn.setAttribute('aria-pressed', String(onlyUnused));
254
+ o.onlyBtn.dataset.tip = onlyUnused ? 'Show every mark again' : 'Show only the selected lines nothing in the model uses, over a fainter drawing';
255
+ o.extras.textContent = chip.extras.join(' · ');
256
+ o.extras.hidden = !chip.extras.length;
257
+ o.g.classList.toggle('off', !on);
258
+ o.chip.hidden = !on;
259
+ o.stage.classList.toggle('used-only-unused', on && onlyUnused);
260
+ o.stage.classList.toggle('used-on', on);
261
+ o.toggle.setAttribute('aria-pressed', String(on));
262
+ o.toggle.dataset.tip = (on ? 'Hide used lines' : 'Show used lines') + TOGGLE_TIP;
263
+ layout();
264
+ if (lastSheet !== null && lastSheet !== active) announce();
265
+ lastSheet = active;
266
+ if (o.afterLayout) o.afterLayout();
267
+ }
268
+ /**
269
+ * The chip sits just above the bottom-left bar, whatever height the bar has wrapped to, and tells the page its own
270
+ * height so the hover note stacks above it. Called on every render and whenever the bar or the chip resizes.
271
+ */
272
+ function layout() {
273
+ const barH = (o.bar && o.bar.offsetHeight) || 0;
274
+ if (barH) o.chip.style.bottom = (12 + barH + 6) + 'px';
275
+ o.stage.style.setProperty('--used-chip-h', o.chip.hidden ? '0px' : ((o.chip.offsetHeight || 0) + 6) + 'px');
276
+ }
277
+ o.toggle.addEventListener('click', () => {
278
+ on = !on;
279
+ try { if (o.storage) o.storage.setItem(USED_STORAGE_KEY, on ? 'on' : 'off'); } catch { /* private window: this visit only */ }
280
+ if (!on) { onlyUnused = false; clearTimeout(timer); o.live.textContent = ''; }
281
+ render();
282
+ if (on) announce();
283
+ });
284
+ o.onlyBtn.addEventListener('click', () => {
285
+ if (!chip || !chip.showUnused || !chip.unused) return;
286
+ onlyUnused = !onlyUnused;
287
+ render();
288
+ });
289
+ return {
290
+ render,
291
+ layout,
292
+ isOn: () => on,
293
+ /** For a real browser pass to read the outcome; it drives nothing. */
294
+ state: () => ({
295
+ on, onlyUnused, chip: o.chip.hidden ? null : String(o.chip.textContent || '').replace(/\s+/g, ' ').trim(), counts: chip,
296
+ d: Object.fromEntries(USAGE_STATES.map((k) => [k, (paths[k].getAttribute('d') || '').length])), live: o.live.textContent,
297
+ }),
298
+ };
299
+ }
@@ -65,6 +65,10 @@
65
65
  /* The dark --mut, pinned for text ON the stage. The page's --mut turns mid-grey in light theme, and on
66
66
  the always-dark stage that put the hover chip's 11px labels at ~3.7:1 (review finding). */
67
67
  --stage-mut:hsl(215 20.2% 65.1%);
68
+ /* Used lines (2026-11-10): the dark --ok and --warn, pinned for marks ON the stage for the same reason as
69
+ --stage-mut. The light theme's --ok #15803d and --warn #b45309 are darkened for white panels and fall to about
70
+ 3:1 on the always-dark stage. Same hues as the page's own state colours, so no new colour. */
71
+ --stage-ok:hsl(142 71% 45%);--stage-warn:hsl(38 92% 50%);
68
72
  --banner-shadow:0 -4px 18px rgba(0,0,0,.45); /* the conflict bar, thrown UPWARD from the page foot */
69
73
  }
70
74
  /* Light — the same slate/blue ramp as the shell's [data-theme="light"] (web/app.css), re-expressed
@@ -448,6 +452,33 @@ footer{margin-top:auto;border-top:1px solid var(--line);padding-top:12px}
448
452
  assert the halo's `d` equals the hovered element's. No dasharray on the clone: a casing with gaps
449
453
  in it reads as two highlights. */
450
454
  #hot path,#hot text,#hot rect{stroke:var(--stage-text);stroke-opacity:.42;stroke-width:7;vector-effect:non-scaling-stroke;stroke-linecap:round;stroke-linejoin:round;fill:none;pointer-events:none}
455
+ #stage.used-on #hot path,#stage.used-on #hot rect{stroke-width:9}
456
+ /* USED LINES (2026-11-10 plan): which lines the steel model was built from, as a halo UNDER the line, in #under
457
+ beside the hover casing and for the same reasons. The line keeps its own layer colour, so the mark reads the same
458
+ on a grey drawing and on one coloured by layer, where a recolour could not say "used". One <path> per state
459
+ (steel-filter-usage.js), so the stage gains four nodes at most, whatever the sheet holds. The state never rests on
460
+ colour alone: member lines are solid, other evidence dashed, lines used only before a re-read long-dashed, and
461
+ selected lines nothing uses dotted. A line is drawn 2.2px wide, so a mark must be well wider to show beside it;
462
+ the hover casing is painted over them and stays wider still (9px while Used lines is on, see #stage.used-on). */
463
+ #used path{fill:none;vector-effect:non-scaling-stroke;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
464
+ #used{transition:opacity .2s ease}
465
+ #used.off{opacity:0}
466
+ #used .u-member{stroke:var(--stage-ok);stroke-opacity:.6;stroke-width:6.5}
467
+ #used .u-evidence{stroke:var(--stage-ok);stroke-opacity:.6;stroke-width:6.5;stroke-dasharray:7 3;stroke-linecap:butt}
468
+ #used .u-superseded{stroke:var(--stage-mut);stroke-opacity:.5;stroke-width:5.5;stroke-dasharray:12 5;stroke-linecap:butt}
469
+ #used .u-unused{stroke:var(--stage-warn);stroke-opacity:.8;stroke-width:6.5;stroke-dasharray:.5 7}
470
+ /* "Only not used": the review pass. Everything used steps back, and so does the drawing behind it. */
471
+ #stage.used-only-unused #used .u-member,#stage.used-only-unused #used .u-evidence,#stage.used-only-unused #used .u-superseded{display:none}
472
+ #stage.used-only-unused #under image.bg{opacity:.16}
473
+ #stage.used-only-unused #canvas #overlay{opacity:.4}
474
+ @media (prefers-reduced-motion:reduce){#used{transition:none}}
475
+ /* Forced colours drop the hues; the dash patterns carry the state, painted in system colours. */
476
+ @media (forced-colors:active){
477
+ #used path,#usedChip .uc-sw line{forced-color-adjust:none}
478
+ #used .u-member,#used .u-evidence,#usedChip .uc-sw .u-member{stroke:Highlight}
479
+ #used .u-unused,#usedChip .uc-sw .u-unused{stroke:CanvasText}
480
+ #used .u-superseded{stroke:GrayText}
481
+ }
451
482
  /* Raster-less baked sheets cannot retain the confidential background. Keep their full vector sheet as
452
483
  an explicit, non-interactive fallback; raster-backed sheets mount selected vectors only. */
453
484
  #canvas .el.is-context{opacity:.2;pointer-events:none}
@@ -459,6 +490,7 @@ footer{margin-top:auto;border-top:1px solid var(--line);padding-top:12px}
459
490
  so on a light theme it was a dark pill floating on a light pane, an artifact of two correct
460
491
  decisions meeting. `~` and not a descendant selector: they are siblings inside #stage. */
461
492
  #empty.show ~ #zoombar,
493
+ #empty.show ~ #usedChip,
462
494
  #empty.show ~ #hoverbar,
463
495
  #empty.show ~ #hoverNote{display:none}
464
496
  #empty>div{max-width:44ch}
@@ -473,6 +505,7 @@ body.publication-blocked #canvas,
473
505
  body.publication-blocked #under,
474
506
  body.publication-blocked #zoombar,
475
507
  body.publication-blocked #hoverbar,
508
+ body.publication-blocked #usedChip,
476
509
  body.publication-blocked #hoverNote{display:none}
477
510
  body.publication-blocked #stage{display:flex}
478
511
  body.publication-blocked #empty{position:static;flex:1}
@@ -645,8 +678,27 @@ body.publication-blocked #empty{position:static;flex:1}
645
678
  alone carries the amber: the title stays --stage-text, because the light theme's --warn is too dark
646
679
  to read as text on this panel (which is dark on both themes). `bottom` is set by syncHoverNote from
647
680
  #zoombar's real height, so the note sits directly above the Hover info toggle it qualifies. */
648
- #hoverNote{position:absolute;left:12px;bottom:58px;max-width:min(360px, calc(100% - 24px));background:var(--stage-panel);border:1px solid var(--stage-line);border-left:3px solid var(--warn);border-radius:0 8px 8px 0;padding:8px 10px;box-shadow:var(--stage-shadow);color:var(--stage-mut);font-size:12px;line-height:1.5;pointer-events:none;z-index:30}
681
+ #hoverNote{position:absolute;left:12px;bottom:calc(58px + var(--used-chip-h, 0px));max-width:min(360px, calc(100% - 24px));background:var(--stage-panel);border:1px solid var(--stage-line);border-left:3px solid var(--warn);border-radius:0 8px 8px 0;padding:8px 10px;box-shadow:var(--stage-shadow);color:var(--stage-mut);font-size:12px;line-height:1.5;pointer-events:none;z-index:30}
649
682
  #hoverNote[hidden]{display:none}
683
+ /* The Used lines count, stacked just above #zoombar (12px + the bar's 40px + 6px), so it reads as the legend of the
684
+ toggle beside Flo. #hoverNote moves up by its height (--used-chip-h, set from script) rather than sharing a box. The
685
+ two swatches ARE the legend: the same stroke and dash as the marks on the sheet. */
686
+ #usedChip{position:absolute;left:12px;bottom:58px;max-width:min(440px, calc(100% - 24px));display:flex;flex-wrap:wrap;align-items:center;gap:2px 8px;background:var(--stage-panel);border:1px solid var(--stage-line);border-radius:8px;padding:4px 8px;box-shadow:var(--stage-shadow);color:var(--stage-mut);font-size:12px;line-height:1.4;z-index:30}
687
+ #usedChip[hidden]{display:none}
688
+ #usedChip .uc-used{display:inline-flex;align-items:center;gap:6px;color:var(--stage-text)}
689
+ #usedChip .uc-sw{width:18px;height:8px;flex:none;display:block}
690
+ #usedChip .uc-sw line{fill:none;stroke-linecap:round}
691
+ #usedChip .uc-sw .u-member{stroke:var(--stage-ok);stroke-width:3}
692
+ #usedChip .uc-sw .u-unused{stroke:var(--stage-warn);stroke-width:3.5;stroke-dasharray:.5 4.5}
693
+ #usedChip .uc-extra{flex-basis:100%;color:var(--stage-mut)}
694
+ #usedChip .uc-extra[hidden],#usedChip .uc-used[hidden],#usedOnlyUnused[hidden],#usedChip .uc-sw[hidden]{display:none}
695
+ /* "N not used" is the review switch: #zoombar's pressed language (brand outline, 12% brand fill), sized to text. */
696
+ #usedOnlyUnused{display:inline-flex;align-items:center;gap:6px;min-width:0;min-height:0;padding:2px 6px;margin:-2px 0;background:transparent;border:1px solid transparent;border-radius:6px;box-shadow:none;color:var(--stage-text);font:inherit}
697
+ #usedOnlyUnused:hover{background:var(--stage-btn-hover)}
698
+ #usedOnlyUnused[aria-pressed="true"]{background:color-mix(in srgb,var(--brand) 12%,transparent);border-color:var(--brand)}
699
+ #usedOnlyUnused[aria-pressed="true"]:hover{background:color-mix(in srgb,var(--brand) 20%,transparent)}
700
+ @media (forced-colors:active){#usedOnlyUnused[aria-pressed="true"]{outline:2px solid currentColor;outline-offset:-3px}}
701
+ #usedToggle[aria-pressed="true"] svg.zb-off{display:none}
650
702
  #hoverNote b{display:block;color:var(--stage-text);font-weight:600;margin-bottom:2px}
651
703
  /* #2926: Flo, showing which part of the drawing the AI is reading (web/steel-filter-flo.js). Stage furniture
652
704
  only: the stage tokens, the brand outline #focusPlace already draws, and #hoverNote's amber rail for "waiting
@@ -873,6 +925,8 @@ body.publication-blocked #empty{position:static;flex:1}
873
925
  linework and the line keeps its own colour (see #under's CSS for why it is a separate SVG).
874
926
  It sits OUTSIDE #overlay, so buildOverlay()'s replaceChildren() never removes the group;
875
927
  buildOverlay empties it on purpose, via hoverClear(). -->
928
+ <!-- Used lines: the model's marks, one path per state, under the hover casing so the casing stays on top. -->
929
+ <g id="used" aria-hidden="true"><path class="u-superseded"/><path class="u-evidence"/><path class="u-member"/><path class="u-unused"/></g>
876
930
  <g id="hot" fill="none" aria-hidden="true"></g>
877
931
  </svg>
878
932
  <svg id="canvas" preserveAspectRatio="xMidYMid meet">
@@ -924,7 +978,14 @@ body.publication-blocked #empty{position:static;flex:1}
924
978
  bare noun read as a category, not a command. data-tip (never title=) carries the full
925
979
  sentence. -->
926
980
  <div id="placebar" role="status" aria-live="polite" hidden><span id="placebarText"></span><button id="placebarClear" type="button" data-command-id="filter.place-clear" data-tip="Remove the marked place from this drawing">Clear</button></div>
927
- <div id="zoombar"><button id="fit2" type="button" data-command-id="filter.fit" aria-label="Fit" data-tip="Fit the whole page in view"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 6V2h4M14 6V2h-4M2 10v4h4M14 10v4h-4"/></svg></button><button id="zoomsteel2" type="button" data-command-id="filter.zoom-steel" aria-label="Zoom steel" data-tip="Zoom to fit the steel elements on this sheet"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 5V2h3M14 5V2h-3M2 11v3h3M14 11v3h-3"/><path d="M5.4 5.4h5.2M5.4 10.6h5.2M8 5.4v5.2" stroke-width="1.4"/></svg></button><span class="zb-sep" aria-hidden="true"></span><button id="hoverInfo" type="button" aria-pressed="false" aria-label="Hover info" data-command-id="filter.hover-info" data-tip="Hover info. Point at any line or label, shown or switched off, to read its layer, thickness and colour — and light up its rows in the Filters panel. Click a switched-off line to see what to tick to bring it back. Background-only linework, on layers the drawing read never picked up, can’t be read by pointing; click an empty spot to ask the original drawing what is there, where the original drawing is available."><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.2 2.4 3.2 12l2.6-2.4 1.8 4 1.7-.8-1.8-3.9 3.6-.1z"/><path d="M11.6 3.4h2.6M11.6 5.6h1.6" stroke-width="1.4"/></svg></button><button id="floToggle" type="button" aria-pressed="true" aria-label="Show Flo" hidden data-command-id="filter.flo-toggle" data-tip="Hide Flo. While a drawing read runs, Flo shows which part of the drawing the AI is reading and says when it is waiting for your answer. Drag Flo to move it."><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4.2 6.6a3.8 3.8 0 0 1 7.6 0M3 6.6h10"/><path d="M4.6 6.6v2a3.4 3.4 0 0 0 6.8 0v-2"/><path d="M6.5 8.7h.01M9.5 8.7h.01" stroke-width="2"/></svg><svg class="zb-off" viewBox="0 0 16 16" aria-hidden="true"><path d="M2.6 13.4 13.4 2.6" stroke-width="1.5"/></svg></button></div>
981
+ <div id="zoombar"><button id="fit2" type="button" data-command-id="filter.fit" aria-label="Fit" data-tip="Fit the whole page in view"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 6V2h4M14 6V2h-4M2 10v4h4M14 10v4h-4"/></svg></button><button id="zoomsteel2" type="button" data-command-id="filter.zoom-steel" aria-label="Zoom steel" data-tip="Zoom to fit the steel elements on this sheet"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 5V2h3M14 5V2h-3M2 11v3h3M14 11v3h-3"/><path d="M5.4 5.4h5.2M5.4 10.6h5.2M8 5.4v5.2" stroke-width="1.4"/></svg></button><span class="zb-sep" aria-hidden="true"></span><button id="hoverInfo" type="button" aria-pressed="false" aria-label="Hover info" data-command-id="filter.hover-info" data-tip="Hover info. Point at any line or label, shown or switched off, to read its layer, thickness and colour — and light up its rows in the Filters panel. Click a switched-off line to see what to tick to bring it back. Background-only linework, on layers the drawing read never picked up, can’t be read by pointing; click an empty spot to ask the original drawing what is there, where the original drawing is available."><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.2 2.4 3.2 12l2.6-2.4 1.8 4 1.7-.8-1.8-3.9 3.6-.1z"/><path d="M11.6 3.4h2.6M11.6 5.6h1.6" stroke-width="1.4"/></svg></button><button id="floToggle" type="button" aria-pressed="true" aria-label="Show Flo" hidden data-command-id="filter.flo-toggle" data-tip="Hide Flo. While a drawing read runs, Flo shows which part of the drawing the AI is reading and says when it is waiting for your answer. Drag Flo to move it."><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4.2 6.6a3.8 3.8 0 0 1 7.6 0M3 6.6h10"/><path d="M4.6 6.6v2a3.4 3.4 0 0 0 6.8 0v-2"/><path d="M6.5 8.7h.01M9.5 8.7h.01" stroke-width="2"/></svg><svg class="zb-off" viewBox="0 0 16 16" aria-hidden="true"><path d="M2.6 13.4 13.4 2.6" stroke-width="1.5"/></svg></button><button id="usedToggle" type="button" aria-pressed="true" aria-label="Used lines" data-command-id="filter.used-lines" data-tip="Hide used lines"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2.5 13.5 8.5 7.5"/><path d="M9.6 4.4l1.7 1.7 3.2-3.4"/><path d="M2.5 9.5h3.2M10.3 13.5h3.2" stroke-width="1.4" stroke-dasharray=".5 2.6"/></svg><svg class="zb-off" viewBox="0 0 16 16" aria-hidden="true"><path d="M2.6 13.4 13.4 2.6" stroke-width="1.5"/></svg></button></div>
982
+ <!-- Used lines: the count and legend for the marks, shown while the Used lines toggle is on. -->
983
+ <div id="usedChip" hidden>
984
+ <span class="uc-used" id="usedUsed"><svg class="uc-sw" id="usedSwUsed" viewBox="0 0 18 8" aria-hidden="true"><line class="u-member" x1="2" y1="4" x2="16" y2="4"/></svg><span id="usedLead"></span></span>
985
+ <button type="button" id="usedOnlyUnused" aria-pressed="false" data-command-id="filter.used-only-unused" data-tip="Show only the selected lines nothing in the model uses"><svg class="uc-sw" viewBox="0 0 18 8" aria-hidden="true"><line class="u-unused" x1="2" y1="4" x2="16" y2="4"/></svg><span id="usedUnusedN"></span></button>
986
+ <span class="uc-extra" id="usedExtras" hidden></span>
987
+ </div>
988
+ <div id="usedLive" class="sr-only" role="status" aria-live="polite"></div>
928
989
  <!-- The hover readout, anchored at the line it names (see #hoverbar's CSS for why it is not docked).
929
990
  Hidden until the pointer is on a line with the mode on; hidden again when it leaves the line, or
930
991
  when a click opens the popover (which then says the same thing).
@@ -1011,6 +1072,7 @@ import { checkpointStandard } from './checkpoint-standard.js';
1011
1072
  import { filterAiBlockedLayerKeys, filterAiTouchesUnreadLayer, parseFilterAiProposal } from './filter-ai-proposal.js';
1012
1073
  import { hitIndexBuilder, hitTest, textRunRect } from './steel-filter-hit.js';
1013
1074
  import { mountFilterFlo } from './steel-filter-flo.js';
1075
+ import { mountUsedLines } from './steel-filter-usage.js';
1014
1076
  // #2926: Flo's overlay, mounted at the end of this module. Declared first because setVB() calls it on every view change.
1015
1077
  let filterFlo = null;
1016
1078
 
@@ -2843,6 +2905,9 @@ function syncFacetChecks(){
2843
2905
  }
2844
2906
  }
2845
2907
 
2908
+ // Set once the Used lines overlay is mounted (end of this module). Declared beside apply() so the harnesses that
2909
+ // lift this block of the page carry it too, unset.
2910
+ let onFilterPainted = null;
2846
2911
  function apply(){
2847
2912
  // Every selection, mode, sheet and contract repaint runs through here; AI Chat re-checks with it.
2848
2913
  notifyFilterAi();
@@ -2864,6 +2929,8 @@ function apply(){
2864
2929
  html += ' · <b>' + sa + '</b> of <b>' + ta + '</b> total (' + sheets.length + ' sheets)';
2865
2930
  }
2866
2931
  countEl.innerHTML = html;
2932
+ // Used lines (steel-filter-usage.js) repaints with every selection, mode and sheet change.
2933
+ onFilterPainted?.();
2867
2934
  const dims = new Set(modeDims(mode));
2868
2935
  document.getElementById('facet-layers').classList.toggle('dim', !dims.has('layer'));
2869
2936
  document.getElementById('facet-thicknesses').classList.toggle('dim', !dims.has('thickness'));
@@ -3459,7 +3526,8 @@ function syncHoverNote(){
3459
3526
  function placeHoverNote(){
3460
3527
  const box = document.getElementById('hoverNote'), bar = document.getElementById('zoombar');
3461
3528
  if(!box || box.hidden || !bar || !bar.offsetHeight) return;
3462
- box.style.bottom = (12 + bar.offsetHeight + 6) + 'px';
3529
+ // Above the Used lines chip too, when it shows: the page keeps its height in --used-chip-h.
3530
+ box.style.bottom = 'calc(' + (12 + bar.offsetHeight + 6) + 'px + var(--used-chip-h, 0px))';
3463
3531
  }
3464
3532
  if(typeof ResizeObserver === 'function' && document.getElementById('zoombar')){
3465
3533
  new ResizeObserver(placeHoverNote).observe(document.getElementById('zoombar'));
@@ -4956,7 +5024,9 @@ boot();
4956
5024
  clearTop: () => { const pb = $('placebar'); return pb && !pb.hidden ? pb.offsetTop + pb.offsetHeight + 8 : 12; },
4957
5025
  clearBottom: () => {
4958
5026
  const note = $('hoverNote');
4959
- return 12 + (zoombar ? zoombar.offsetHeight : 0) + 6 + (note && !note.hidden && note.offsetHeight ? note.offsetHeight + 6 : 0);
5027
+ const usedChip = $('usedChip');
5028
+ return 12 + (zoombar ? zoombar.offsetHeight : 0) + 6 + (note && !note.hidden && note.offsetHeight ? note.offsetHeight + 6 : 0)
5029
+ + (usedChip && !usedChip.hidden && usedChip.offsetHeight ? usedChip.offsetHeight + 6 : 0);
4960
5030
  },
4961
5031
  ask: () => { try { if(window.parent !== window) window.parent.dispatchEvent(new CustomEvent('floless:filter-flo-answer')); } catch { /* no shell */ } },
4962
5032
  storage: (() => { try { return window.localStorage; } catch { return null; } })(),
@@ -4964,6 +5034,33 @@ boot();
4964
5034
  handle: $('floAvatar'),
4965
5035
  });
4966
5036
  window.flolessFilterFlo = (state) => filterFlo.update(state);
5037
+ // Used lines: which lines the steel model was built from (2026-11-10 plan). An optional overlay, so a fault in it
5038
+ // is logged and never stops a repaint (apply() calls it mid-way) or the rest of this block.
5039
+ try {
5040
+ const usedLines = mountUsedLines({
5041
+ g: $('used'), toggle: $('usedToggle'), chip: $('usedChip'), onlyBtn: $('usedOnlyUnused'), lead: $('usedLead'),
5042
+ swUsed: $('usedSwUsed'), unusedN: $('usedUnusedN'), extras: $('usedExtras'), live: $('usedLive'), stage, bar: $('zoombar'),
5043
+ contract: () => C, sheets: () => sheets, active: () => active, ready: () => !!(C && sel),
5044
+ isSelected: (el) => matchesActive(el, mode, sel),
5045
+ afterLayout: () => filterFlo.place(true),
5046
+ storage: (() => { try { return window.localStorage; } catch { return null; } })(),
5047
+ });
5048
+ onFilterPainted = () => {
5049
+ try { usedLines.render(); } catch(error){ console.error('[filter] the used-lines marks could not be drawn', error); }
5050
+ };
5051
+ onFilterPainted();
5052
+ // The bar wraps on a narrow stage and the chip wraps with its extras: keep the chip on the bar and the note above it.
5053
+ if(typeof ResizeObserver === 'function'){
5054
+ new ResizeObserver(() => { try { usedLines.layout(); } catch { /* drawn again on the next repaint */ } placeHoverNote(); })
5055
+ .observe($('usedChip'));
5056
+ new ResizeObserver(() => { try { usedLines.layout(); } catch { /* drawn again on the next repaint */ } })
5057
+ .observe($('zoombar'));
5058
+ }
5059
+ // For a real browser pass to read the outcome; it drives nothing.
5060
+ window.__filterTest.used = () => usedLines.state();
5061
+ } catch(error){
5062
+ console.error('[filter] the used-lines marks could not be set up', error);
5063
+ }
4967
5064
  // For a real browser pass to read the outcome; it drives nothing.
4968
5065
  window.__filterTest.flo = () => ({
4969
5066
  shown: !$('floFx').hidden, on: filterFlo.isOn(), waiting: $('floBubble').classList.contains('waiting'),
@@ -15,6 +15,7 @@ export { validateSchemaSubset };
15
15
  import { parseSpacings } from './grid-core.js';
16
16
  import { positionBasisIssue,POSITION_BASIS_CAPABILITY_VERSION } from './steel-3d-core.js';
17
17
  import { rawPlanViewId } from './steel-plan-view-id.js';
18
+ import { customSectionIssues } from './steel-custom-sections.js';
18
19
  export const POSITION_BASIS_CLIENT_VALIDATION_VERSION=POSITION_BASIS_CAPABILITY_VERSION;
19
20
 
20
21
  const rows = (v) => Array.isArray(v) ? v : [];
@@ -187,5 +188,7 @@ export function validateClientSteelModelV2(doc, schema) {
187
188
  for (const member of members) if (!presented.has(member?.id) && member?.role !== 'column') {
188
189
  issues.push(`member-unpresented at $.members[${member?.id || '?'}]`);
189
190
  }
191
+ // The server's own custom-section checks, from the one shared module, so the two cannot disagree.
192
+ for (const issue of customSectionIssues(doc)) issues.push(`${issue.code} at ${issue.path}`);
190
193
  return issues;
191
194
  }