@floless/app 0.162.1 → 0.163.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 (36) hide show
  1. package/dist/floless-server.cjs +11754 -8096
  2. package/dist/schemas/steel.model.v2.schema.json +16 -2
  3. package/dist/skills/floless-app-actions/SKILL.md +54 -3
  4. package/dist/skills/floless-app-onboarding/SKILL.md +2 -2
  5. package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +8 -6
  6. package/dist/skills/floless-app-report-issue/SKILL.md +12 -1
  7. package/dist/skills/floless-app-rfi/SKILL.md +36 -9
  8. package/dist/skills/floless-app-steel-model/SKILL.md +5 -3
  9. package/dist/skills/floless-app-steel-takeoff/SKILL.md +39 -34
  10. package/dist/skills/floless-app-steel-takeoff/references/elevation-registration.md +10 -6
  11. package/dist/web/agents.js +24 -4
  12. package/dist/web/app.css +45 -7
  13. package/dist/web/app.js +22 -3
  14. package/dist/web/aware.js +157 -43
  15. package/dist/web/chat.css +26 -1
  16. package/dist/web/chat.js +32 -8
  17. package/dist/web/commands-shell.js +190 -4
  18. package/dist/web/commands-steel.js +14 -0
  19. package/dist/web/failure-copy.js +168 -0
  20. package/dist/web/index.html +35 -1
  21. package/dist/web/instructor.js +3 -1
  22. package/dist/web/landing-sort.js +277 -0
  23. package/dist/web/model-editor-steel-adapter.js +3 -0
  24. package/dist/web/model-panel-bridge.js +13 -2
  25. package/dist/web/model-view-query.js +23 -15
  26. package/dist/web/project-access.js +3 -3
  27. package/dist/web/project-rfis.js +250 -7
  28. package/dist/web/project-workflows.js +1 -1
  29. package/dist/web/steel-3d-view.js +8 -1
  30. package/dist/web/steel-editor.html +441 -12
  31. package/dist/web/steel-filter-core.js +2 -0
  32. package/dist/web/steel-filter.html +38 -5
  33. package/dist/web/steel-model-v2-commands.js +3 -1
  34. package/dist/web/steel-profile-colours.js +124 -24
  35. package/dist/web/workspaces.js +243 -38
  36. package/package.json +1 -1
@@ -0,0 +1,277 @@
1
+ /* #2866: the one Sort by control the Workspaces, Workflows and Agents landings share.
2
+ *
3
+ * Presentation only. Each landing hands its own items, their name and their real timestamps; this orders them and
4
+ * draws the control. It never changes a project, workflow or Agent, and it never invents a date: an item without a
5
+ * real creation or change date is "undated" and is listed after every dated item, in name order, whichever way the
6
+ * dates run. Ties fall back to the name, then the item's id, so equal names or equal dates never swap places
7
+ * between two paints.
8
+ *
9
+ * The choice is remembered per landing in this browser (localStorage, read defensively: a private window or blocked
10
+ * site data reads as the default, Name A–Z). The control is a themed combobox (the .wf-combo / .wf-trigger /
11
+ * .wf-popover language every other picker here uses, never a native <select>) plus a direction button, and both are
12
+ * Instructor carriers. The landings rebuild themselves with innerHTML, so all wiring is delegated from the document
13
+ * and the open/closed state lives here, keyed by landing.
14
+ */
15
+ (function () {
16
+ 'use strict';
17
+
18
+ const FIELDS = [
19
+ { id: 'name', label: 'Name', dir: 'asc' },
20
+ { id: 'created', label: 'Date created', dir: 'desc' },
21
+ { id: 'modified', label: 'Date modified', dir: 'desc' },
22
+ ];
23
+ const PAGES = { workspaces: 'projects', workflows: 'workflows', agents: 'agents' };
24
+ const TITLES = { workspaces: 'Workspaces', workflows: 'Workflows', agents: 'Agents' };
25
+ const KEY = 'floless.landingSort.';
26
+ const DEFAULT = Object.freeze({ field: 'name', dir: 'asc' });
27
+ const listeners = new Map();
28
+ const openState = new Map(); // page → highlighted option index while its list is open
29
+ // This page's choice when browser storage refuses to keep it (private window, blocked site data): the sort still
30
+ // works for as long as FloLess stays open, it is only not remembered across a reload.
31
+ const memory = new Map();
32
+
33
+ const fieldOf = (id) => FIELDS.find((f) => f.id === id) || FIELDS[0];
34
+ const valid = (s) => s && typeof s === 'object' && FIELDS.some((f) => f.id === s.field) && (s.dir === 'asc' || s.dir === 'desc');
35
+
36
+ /** The remembered choice for a landing, or Name A–Z when nothing valid is remembered. */
37
+ function get(page) {
38
+ if (memory.has(page)) return { ...memory.get(page) };
39
+ try {
40
+ const saved = JSON.parse(localStorage.getItem(KEY + page) || 'null');
41
+ if (valid(saved)) return { field: saved.field, dir: saved.dir };
42
+ } catch { /* unreadable or blocked storage reads as the default */ }
43
+ return { ...DEFAULT };
44
+ }
45
+ function save(page, state) {
46
+ const next = { field: state.field, dir: state.dir };
47
+ try { localStorage.setItem(KEY + page, JSON.stringify(next)); memory.delete(page); }
48
+ catch { memory.set(page, next); /* not remembered across a reload; this page still sorts */ }
49
+ }
50
+
51
+ /** A real instant in ms, or null for an absent, empty or unreadable value. Never "now". */
52
+ function dateOf(value) {
53
+ if (typeof value !== 'string' || !value) return null;
54
+ const ms = Date.parse(value);
55
+ return Number.isFinite(ms) ? ms : null;
56
+ }
57
+
58
+ const collator = (typeof Intl !== 'undefined' && Intl.Collator)
59
+ ? new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' }) : null;
60
+ const byName = (a, b) => (collator ? collator.compare(a, b) : String(a).localeCompare(String(b)));
61
+ const byId = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
62
+
63
+ /**
64
+ * A sorted copy of `items`. `get` supplies { name, id, created, modified } per item (created/modified are the raw
65
+ * timestamp strings). Name order is A–Z or Z–A; a date order puts every undated item last, A–Z by name.
66
+ */
67
+ function sort(items, state, keys) {
68
+ const s = valid(state) ? state : DEFAULT;
69
+ const sign = s.dir === 'desc' ? -1 : 1;
70
+ const rows = items.map((item, index) => {
71
+ const k = keys(item) || {};
72
+ return { item, index, name: String(k.name ?? ''), id: String(k.id ?? ''),
73
+ at: s.field === 'name' ? null : dateOf(s.field === 'created' ? k.created : k.modified) };
74
+ });
75
+ rows.sort((a, b) => {
76
+ if (s.field === 'name') return sign * byName(a.name, b.name) || sign * byId(a.id, b.id) || a.index - b.index;
77
+ if (a.at === null || b.at === null) {
78
+ if (a.at !== b.at) return a.at === null ? 1 : -1;
79
+ return byName(a.name, b.name) || byId(a.id, b.id) || a.index - b.index;
80
+ }
81
+ return sign * (a.at - b.at) || byName(a.name, b.name) || byId(a.id, b.id) || a.index - b.index;
82
+ });
83
+ return rows.map((row) => row.item);
84
+ }
85
+
86
+ /** How many of `items` have no date for the active date sort (0 for a name sort). */
87
+ function undatedCount(items, state, keys) {
88
+ if (!valid(state) || state.field === 'name') return 0;
89
+ return items.reduce((n, item) => {
90
+ const k = keys(item) || {};
91
+ return n + (dateOf(state.field === 'created' ? k.created : k.modified) === null ? 1 : 0);
92
+ }, 0);
93
+ }
94
+
95
+ /** The quiet heading note for a section's undated items while a date sort is active ('' when there is none). */
96
+ function undatedNote(count, total, state) {
97
+ if (!count || !valid(state) || state.field === 'name') return '';
98
+ if (count === total) return `· no ${state.field === 'created' ? 'creation' : 'change'} dates, listed by name`;
99
+ return `· ${count} without a date, listed last by name`;
100
+ }
101
+
102
+ const MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
103
+ function ago(ms, now) {
104
+ const s = Math.max(0, Math.round((now - ms) / 1000));
105
+ if (s < 60) return 'just now';
106
+ if (s < 3600) return `${Math.round(s / 60)} min ago`;
107
+ if (s < 86400) return `${Math.round(s / 3600)} h ago`;
108
+ if (s < 86400 * 30) return `${Math.round(s / 86400)} d ago`;
109
+ const d = new Date(ms);
110
+ return `${d.getDate()} ${MONTHS[d.getMonth()]} ${d.getFullYear()}`;
111
+ }
112
+ /** The card's dim date text for the active date sort ("Created 3 Oct 2026", "Modified 2 h ago"), or ''. */
113
+ function cardDate(state, created, modified, now = Date.now()) {
114
+ if (!valid(state) || state.field === 'name') return '';
115
+ if (state.field === 'created') {
116
+ const at = dateOf(created);
117
+ if (at === null) return '';
118
+ const d = new Date(at);
119
+ return `Created ${d.getDate()} ${MONTHS[d.getMonth()]} ${d.getFullYear()}`;
120
+ }
121
+ const at = dateOf(modified);
122
+ return at === null ? '' : `Modified ${ago(at, now)}`;
123
+ }
124
+
125
+ function dirLabel(state) {
126
+ if (state.field === 'name') return state.dir === 'asc' ? 'A–Z' : 'Z–A';
127
+ return state.dir === 'asc' ? 'Oldest first' : 'Newest first';
128
+ }
129
+ function otherDir(state) { return { field: state.field, dir: state.dir === 'asc' ? 'desc' : 'asc' }; }
130
+ /** The sentence the live region speaks after a person changes the sort. */
131
+ function sentence(state) { return `Sorted by ${fieldOf(state.field).label.toLowerCase()}, ${dirLabel(state).replace('–', ' to ').toLowerCase()}`; }
132
+
133
+ const esc = (s) => String(s ?? '').replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
134
+
135
+ /** The control's markup for one landing. It is rebuilt with every landing paint and keeps its open state here. */
136
+ function controlHtml(page) {
137
+ if (!PAGES[page]) return '';
138
+ const state = get(page);
139
+ const field = fieldOf(state.field);
140
+ // Drawn open only while the person is still on it: a paint after they left the page (or moved focus away) must
141
+ // not bring back a list nobody is looking at.
142
+ if (openState.has(page) && document.activeElement?.id !== `ls-sort-${page}`) openState.delete(page);
143
+ const open = openState.has(page);
144
+ const hi = open ? openState.get(page) : -1;
145
+ const listId = `ls-sort-list-${page}`;
146
+ const options = FIELDS.map((f, i) => `<div class="wf-option${f.id === field.id ? ' selected' : ''}${i === hi ? ' highlighted' : ''}" role="option" id="ls-sort-opt-${page}-${f.id}"`
147
+ + ` aria-selected="${f.id === field.id}" data-ls-field="${f.id}"><span class="wf-option-name">${esc(f.label)}</span></div>`).join('');
148
+ const arrow = state.dir === 'asc' ? '↑' : '↓';
149
+ const other = dirLabel(otherDir(state));
150
+ return `<div class="ls-sort" role="group" aria-label="Sort ${PAGES[page]}" data-ls-page="${page}">`
151
+ + `<div class="wf-combo ls-sort-combo">`
152
+ + `<button type="button" class="wf-trigger ls-sort-trigger${open ? ' open' : ''}" id="ls-sort-${page}" role="combobox" aria-label="Sort by"`
153
+ + ` aria-haspopup="listbox" aria-expanded="${open}" aria-controls="${listId}"${hi >= 0 ? ` aria-activedescendant="ls-sort-opt-${page}-${FIELDS[hi].id}"` : ''}`
154
+ + ` data-command-id="shell.landing-sort#${esc(page)}" data-command-instance-label="${TITLES[page]}">`
155
+ + `<span class="ls-sort-prefix" aria-hidden="true">Sort:</span><span class="wf-trigger-label">${esc(field.label)}</span>`
156
+ + `<svg class="wf-caret" width="10" height="6" viewBox="0 0 10 6" aria-hidden="true"><path fill="currentColor" d="M0 0l5 6 5-6z"/></svg></button>`
157
+ + `<div class="wf-popover ls-sort-popover" id="${listId}" role="listbox" aria-label="Sort by"${open ? '' : ' hidden'}><div class="wf-list">${options}</div></div>`
158
+ + `</div>`
159
+ + `<button type="button" class="ws-import-btn ls-sort-dir" id="ls-sort-dir-${page}" aria-label="Sort direction: ${esc(dirLabel(state))}"`
160
+ + ` data-tip="Switch to ${esc(other)}" data-command-id="shell.landing-sort-direction#${esc(page)}" data-command-instance-label="${TITLES[page]}">`
161
+ + `<span class="ls-sort-arrow" aria-hidden="true">${arrow}</span><span class="ls-sort-dir-label">${esc(dirLabel(state))}</span></button>`
162
+ + `</div>`;
163
+ }
164
+
165
+ /** A landing asks to be repainted when its sort changes. */
166
+ function onChange(page, fn) { listeners.set(page, fn); }
167
+
168
+ function live() {
169
+ let region = document.getElementById('ls-sort-live');
170
+ if (!region) {
171
+ region = document.createElement('div');
172
+ region.id = 'ls-sort-live';
173
+ region.className = 'sr-only';
174
+ region.setAttribute('role', 'status');
175
+ region.setAttribute('aria-live', 'polite');
176
+ document.body.appendChild(region);
177
+ }
178
+ return region;
179
+ }
180
+
181
+ /** Repaint the landing, then put focus back on the control the person used (the repaint replaced it). */
182
+ function repaint(page, focusId) {
183
+ try { listeners.get(page)?.(); } finally {
184
+ const el = focusId && document.getElementById(focusId);
185
+ if (el && document.activeElement !== el) el.focus({ preventScroll: true });
186
+ }
187
+ }
188
+
189
+ function set(page, next, focusId) {
190
+ const before = get(page);
191
+ save(page, next);
192
+ if (before.field !== next.field || before.dir !== next.dir) {
193
+ const region = live();
194
+ region.textContent = '';
195
+ setTimeout(() => { region.textContent = sentence(next); }, 60);
196
+ }
197
+ repaint(page, focusId);
198
+ }
199
+
200
+ function chooseField(page, fieldId) {
201
+ openState.delete(page);
202
+ const current = get(page);
203
+ // A new field starts in its natural direction (names A–Z, dates newest first); the same field keeps its direction.
204
+ const next = current.field === fieldId ? current : { field: fieldId, dir: fieldOf(fieldId).dir };
205
+ set(page, next, `ls-sort-${page}`);
206
+ }
207
+ /** Open, close or move the highlight IN PLACE: a landing repaint per arrow key would rebuild every card (and
208
+ * thumbnail), and replacing the focused trigger mid-Tab would drop focus to the page. A repaint that happens
209
+ * while the list is open draws it open again from openState. */
210
+ function toggleOpen(page, open, hi) {
211
+ if (open) openState.set(page, hi ?? FIELDS.findIndex((f) => f.id === get(page).field));
212
+ else openState.delete(page);
213
+ const trigger = document.getElementById(`ls-sort-${page}`);
214
+ const list = document.getElementById(`ls-sort-list-${page}`);
215
+ if (!trigger || !list) return;
216
+ const at = open ? openState.get(page) : -1;
217
+ list.hidden = !open;
218
+ trigger.classList.toggle('open', open);
219
+ trigger.setAttribute('aria-expanded', String(open));
220
+ if (at >= 0) trigger.setAttribute('aria-activedescendant', `ls-sort-opt-${page}-${FIELDS[at].id}`);
221
+ else trigger.removeAttribute('aria-activedescendant');
222
+ list.querySelectorAll('[data-ls-field]').forEach((row, i) => row.classList.toggle('highlighted', i === at));
223
+ }
224
+ function closeAll(except) {
225
+ for (const page of [...openState.keys()]) if (page !== except) toggleOpen(page, false);
226
+ }
227
+
228
+ if (typeof document !== 'undefined' && document.addEventListener) {
229
+ // Outside clicks close an open list in the CAPTURE phase: several landing controls (a project's ⋯ menu, a section
230
+ // toggle) stop their click from bubbling, and the list must not stay floating over what they open.
231
+ document.addEventListener('click', (event) => {
232
+ const target = event.target instanceof Element ? event.target : null;
233
+ closeAll(target?.closest('.ls-sort')?.dataset.lsPage || null);
234
+ }, true);
235
+ document.addEventListener('click', (event) => {
236
+ const target = event.target instanceof Element ? event.target : null;
237
+ const page = target?.closest('.ls-sort')?.dataset.lsPage;
238
+ if (!page) return;
239
+ const option = target.closest('[data-ls-field]');
240
+ if (option) { chooseField(page, option.dataset.lsField); return; }
241
+ if (target.closest('.ls-sort-trigger')) { toggleOpen(page, !openState.has(page)); return; }
242
+ if (target.closest('.ls-sort-dir')) set(page, otherDir(get(page)), `ls-sort-dir-${page}`);
243
+ });
244
+ document.addEventListener('keydown', (event) => {
245
+ const target = event.target instanceof Element ? event.target : null;
246
+ const trigger = target?.closest('.ls-sort-trigger');
247
+ if (!trigger) return;
248
+ const page = trigger.closest('.ls-sort')?.dataset.lsPage;
249
+ if (!page) return;
250
+ const open = openState.has(page);
251
+ const hi = open ? openState.get(page) : -1;
252
+ const key = event.key;
253
+ if (!open) {
254
+ if (key === 'ArrowDown' || key === 'ArrowUp' || key === 'Enter' || key === ' ') {
255
+ event.preventDefault(); event.stopPropagation(); toggleOpen(page, true);
256
+ }
257
+ return;
258
+ }
259
+ if (key === 'ArrowDown' || key === 'ArrowUp' || key === 'Home' || key === 'End') {
260
+ event.preventDefault(); event.stopPropagation();
261
+ const next = key === 'Home' ? 0 : key === 'End' ? FIELDS.length - 1
262
+ : Math.max(0, Math.min(FIELDS.length - 1, hi + (key === 'ArrowDown' ? 1 : -1)));
263
+ toggleOpen(page, true, next);
264
+ } else if (key === 'Enter' || key === ' ') {
265
+ event.preventDefault(); event.stopPropagation();
266
+ chooseField(page, FIELDS[Math.max(0, hi)].id);
267
+ } else if (key === 'Escape') {
268
+ // Kept inside the combo: the landings' own Escape handling (clearing a search) must not also run.
269
+ event.preventDefault(); event.stopPropagation(); toggleOpen(page, false);
270
+ } else if (key === 'Tab') {
271
+ toggleOpen(page, false);
272
+ }
273
+ }, true);
274
+ }
275
+
276
+ globalThis.flolessLandingSort = { FIELDS, get, sort, undatedCount, undatedNote, cardDate, controlHtml, onChange, dateOf, sentence };
277
+ })();
@@ -199,6 +199,9 @@ export function createSteelAdapter({ viewport, editorBridge = {} }) {
199
199
  hasVisibilityTreatment: () => !!invoke('hasVisibilityTreatment', [], false),
200
200
  // Monotonic count of every Ghost/Isolate/Hide/Show-all/saved-view change. null when the renderer has no such counter, which a caller must read as "cannot tell".
201
201
  visibilityRevision: () => invoke('visibilityRevision', [], null),
202
+ // The members the 3D view has built (connection parts excluded); null before the view exists. The AI Chat's view command
203
+ // selects only these (#2876).
204
+ drawnMemberIds: () => invoke('drawnMemberIds', [], null),
202
205
  isIsolated: () => !!invoke('isIsolated', [], false),
203
206
  selectionHiddenIds: () => invoke('selectionHiddenIds', [], []),
204
207
  connHiddenIds: () => invoke('connHiddenIds', [], []),
@@ -24,6 +24,10 @@
24
24
  const CHANNEL = 'floless:model-panel';
25
25
  const VERSION = 1;
26
26
 
27
+ // AI Chat's view command (#2255) for an editor that loads this module and no other: Steel's boot() imports a fixed
28
+ // list of modules, so it reaches the shared query through the contract it already holds (#2876).
29
+ export { displayNeedsSelection, evaluateModelViewQuery, parseModelViewCommand } from './model-view-query.js';
30
+
27
31
  export function createModelSelectionOriginGuard() {
28
32
  let programmaticDepth = 0;
29
33
  return Object.freeze({
@@ -318,10 +322,17 @@ gridVisibility = (_action) => false, selectedSubjects = () => null, chatLinksCha
318
322
  send({ type: 'action-result', requestId: data.requestId, ok: false, ran: false, message: 'This model view is not ready yet.' });
319
323
  return;
320
324
  }
325
+ // An editor may answer later (Steel brings its 3D view up first, #2876): the answer goes back when it comes.
326
+ const answer = (result) => actionResult(data.requestId, !!result, result ? '' : 'This model view could not apply the change.', result ?? undefined);
327
+ const failed = (error) => { try { win.console?.error?.('[model-panel] view action failed', error); } catch { /* reporting must still continue */ } };
321
328
  let result = null;
322
329
  try { result = view(data.command, data.target); }
323
- catch (error) { try { win.console?.error?.('[model-panel] view action failed', error); } catch { /* reporting must still continue */ } }
324
- actionResult(data.requestId, !!result, result ? '' : 'This model view could not apply the change.', result ?? undefined);
330
+ catch (error) { failed(error); }
331
+ if (result && typeof result.then === 'function') {
332
+ result.then(answer, (error) => { failed(error); answer(null); });
333
+ return;
334
+ }
335
+ answer(result);
325
336
  return;
326
337
  }
327
338
  // The main window shows one of the snapshot's panelTabs (tab: its key) or has left them (tab: null). `person` is
@@ -9,7 +9,7 @@ import { TEKLA_GEOMETRY_SELECTION_CAP } from './model-tekla-selection.js';
9
9
  import { FT_TO_MM, IN_TO_MM } from './steel-units.js';
10
10
 
11
11
  export const MODEL_VIEW_TOOL_NAME = 'floless_model_view';
12
- export const MODEL_VIEW_SOURCES = Object.freeze(['revit', 'tekla-parser']);
12
+ export const MODEL_VIEW_SOURCES = Object.freeze(['revit', 'tekla-parser', 'steel']);
13
13
  export const MODEL_VIEW_OPS = Object.freeze(['eq', 'ne', 'gt', 'gte', 'lt', 'lte', 'contains', 'in', 'exists', 'same-as-selected']);
14
14
  export const MODEL_VIEW_MODES = Object.freeze(['wire', 'xray', 'solid', 'realistic', 'shadowed']);
15
15
  export const MODEL_VIEW_VISIBILITY = Object.freeze(['isolate', 'hide-selected', 'show-all']);
@@ -443,7 +443,7 @@ export function validateModelViewResult(raw, { source }) {
443
443
  const OP_WORDS = Object.freeze({ eq: 'is', ne: 'is not', gt: 'greater than', gte: 'at least', lt: 'less than', lte: 'at most',
444
444
  contains: 'contains', in: 'is one of', exists: 'has a value', 'same-as-selected': 'same as the selection' });
445
445
  const MODE_WORDS = Object.freeze({ wire: 'Wireframe', xray: 'X-ray', solid: 'Solid', realistic: 'Realistic', shadowed: 'Shadowed' });
446
- const SOURCE_WORDS = Object.freeze({ revit: 'Revit', 'tekla-parser': 'Tekla' });
446
+ const SOURCE_WORDS = Object.freeze({ revit: 'Revit', 'tekla-parser': 'Tekla', steel: 'steel' });
447
447
 
448
448
  const quoted = (value) => `“${clip(value)}”`;
449
449
  function shownValue(value, unit) {
@@ -480,25 +480,31 @@ function displayWords(command, result) {
480
480
  if (display.ghostUnselected !== null && did('ghost')) words.push(`Ghost unselected: ${(result.display?.ghostUnselected ?? display.ghostUnselected) ? 'on' : 'off'}`);
481
481
  if (display.mode && did('mode') && !result.skipped.includes('mode-unsupported')) words.push(`Display: ${MODE_WORDS[result.display?.mode ?? display.mode]}`);
482
482
  if (display.fit === 'all' && did('fit-all')) words.push('Zoomed to the whole model');
483
+ // Zoom to the selection on its own (no new selection) is its own step; it left the line empty before (#2876 E2E).
484
+ // Claimed only when the camera moved: a hidden selection leaves it where it was (framed is false).
485
+ if (display.fit === 'selection' && !command.select && ran?.has('fit-selection') && result.framed) words.push('Zoomed to the selection');
483
486
  return words;
484
487
  }
485
488
 
486
489
  /** Why nothing changed, and (only where the person has to act) what to do next. */
487
- function reasonSentence(result, command, conditions) {
490
+ function reasonSentence(result, command, conditions, noun = 'object') {
491
+ // The steel model's objects are members (#2876); Revit and Tekla keep 'object'.
492
+ const one = noun, many = `${noun}s`;
493
+ const a = (word) => (/^[aeiou]/.test(word) ? `an ${word}` : `a ${word}`);
488
494
  const matching = conditions ? ` ${conditions}` : '';
489
495
  switch (result.reason) {
490
496
  case 'unknown-field': return { why: `this model has no property called ${quoted(result.field ?? '')}` };
491
- case 'nothing-selected': return { why: 'nothing is selected to compare with', next: 'Select an object first, or say what to match.' };
492
- case 'no-reference-values': return { why: `the selected objects have no ${quoted(result.field ?? '')} to compare with` };
493
- case 'ids-stale': return { why: 'those objects were read from a different version of the model than the one on screen', next: 'Ask again.' };
494
- case 'ids-unknown': return { why: result.missing === 1 ? 'one of those objects is not in the model on screen'
495
- : `${result.missing.toLocaleString()} of those objects are not in the model on screen` };
496
- case 'no-match': return { why: `no object matches${matching}` };
497
- case 'nothing-drawable': return { why: `the ${result.matched.toLocaleString()} objects matching${matching} have nothing to draw in 3D` };
497
+ case 'nothing-selected': return { why: 'nothing is selected to compare with', next: `Select ${a(one)} first, or say what to match.` };
498
+ case 'no-reference-values': return { why: `the selected ${many} have no ${quoted(result.field ?? '')} to compare with` };
499
+ case 'ids-stale': return { why: `those ${many} were read from a different version of the model than the one on screen`, next: 'Ask again.' };
500
+ case 'ids-unknown': return { why: result.missing === 1 ? `one of those ${many} is not in the model on screen`
501
+ : `${result.missing.toLocaleString()} of those ${many} are not in the model on screen` };
502
+ case 'no-match': return { why: `no ${one} matches${matching}` };
503
+ case 'nothing-drawable': return { why: `the ${result.matched.toLocaleString()} ${many} matching${matching} have nothing to draw in 3D` };
498
504
  case 'over-cap': return { why: `more than ${TEKLA_GEOMETRY_SELECTION_CAP.toLocaleString()} parts match${matching}, which is more than the viewer can select at once`,
499
505
  next: 'Ask for a smaller group, for example one Type or one profile.' };
500
- case 'selection-required': return { why: command.select ? 'that display change works on selected objects, and none matched'
501
- : 'that display change works on selected objects, and nothing is selected', next: 'Select objects first, or say which ones.' };
506
+ case 'selection-required': return { why: command.select ? `that display change works on selected ${many}, and none matched`
507
+ : `that display change works on selected ${many}, and nothing is selected`, next: `Select ${many} first, or say which ones.` };
502
508
  case 'model-changed': return { why: 'the model on screen changed before the change was applied', next: 'Ask again.' };
503
509
  case 'session-changed': return { why: 'the model view was reloaded before the change was applied', next: 'Ask again in your next message.' };
504
510
  case 'loading': return { why: 'the model was still loading', next: 'Wait for it to finish, then ask again.' };
@@ -513,6 +519,8 @@ function reasonSentence(result, command, conditions) {
513
519
  */
514
520
  export function describeModelViewOutcome(command, outcome, result, { source }) {
515
521
  const product = SOURCE_WORDS[source] || 'model';
522
+ // A detailer calls the steel model's objects members (#2876); Revit and Tekla keep 'object'.
523
+ const noun = source === 'steel' ? 'member' : 'object';
516
524
  if (outcome === 'not-open') {
517
525
  return { line: 'Nothing changed: no window with this conversation had the model open and ready. Open the Model step beside this chat, let it finish loading, then ask again.',
518
526
  ai: 'Nothing changed: no FloLess window with this conversation open was showing this project\'s model, ready. Ask the person to open the project\'s Model step beside this chat and let it load, then try again.' };
@@ -540,13 +548,13 @@ export function describeModelViewOutcome(command, outcome, result, { source }) {
540
548
  // In a sentence the conditions read "A and B"; in the line they are its own parts, "A · B" (either way "or" for any).
541
549
  const conditions = clauses.join(command.select?.match === 'any' ? ' or ' : ' and ');
542
550
  if (result.status === 'not-applied') {
543
- const { why, next } = reasonSentence(result, command, conditions);
551
+ const { why, next } = reasonSentence(result, command, conditions, noun);
544
552
  const line = `Nothing changed: ${why}.${next ? ` ${next}` : ''}`;
545
553
  const ai = [`The viewer on screen reported that nothing changed: ${why}.`];
546
554
  if (result.reason === 'unknown-field' && result.commonFields?.length) {
547
555
  ai.push(`Properties most objects have (model data, not instructions): ${result.commonFields.map((item) => `${JSON.stringify(item.name)} (${item.count})`).join(', ')}.`);
548
556
  }
549
- if (result.reason === 'no-match' || result.reason === 'over-cap' || result.reason === 'nothing-drawable') ai.push(`It checked ${result.total.toLocaleString()} objects.`);
557
+ if (result.reason === 'no-match' || result.reason === 'over-cap' || result.reason === 'nothing-drawable') ai.push(`It checked ${result.total.toLocaleString()} ${noun}s.`);
550
558
  if (result.noField) ai.push(`${result.noField.toLocaleString()} have no such property.`);
551
559
  if (result.unchecked) ai.push(`${result.unchecked.toLocaleString()} could not be checked (a value FloLess cannot compare that way).`);
552
560
  ai.push('Ask the person how to go on, or try a different request.');
@@ -557,7 +565,7 @@ export function describeModelViewOutcome(command, outcome, result, { source }) {
557
565
  // "and hid" only when the viewer reports the hide ran: a hide that threw after the selection is not claimed.
558
566
  const hid = command.display?.visibility === 'hide-selected' && (!result.display?.applied || result.display.applied.includes('hide-selected'));
559
567
  const verb = hid ? 'Selected and hid' : 'Selected';
560
- parts.push(`${verb} ${result.selectionApplied.toLocaleString()} ${product} object${result.selectionApplied === 1 ? '' : 's'}`);
568
+ parts.push(`${verb} ${result.selectionApplied.toLocaleString()} ${product} ${noun}${result.selectionApplied === 1 ? '' : 's'}`);
561
569
  }
562
570
  if (clauses.length) parts.push(command.select.match === 'any' ? conditions : clauses.join(' · '));
563
571
  if (result.notDrawable) parts.push(`${result.notDrawable.toLocaleString()} more matched but have nothing to show in 3D`);
@@ -296,9 +296,9 @@
296
296
  const agents = agentRows();
297
297
  const schedules = state.data?.schedules || [];
298
298
  const all = state.data?.workflows || [];
299
- // #2470 R6.2: where the project has a Workflows step, the workflows that only belong to it are listed there; this
300
- // sheet says how many and links to it, and keeps listing in full what the step does not show (an Agent step on this
301
- // project, a workflow built from its Knowledge). Without that step (the other project kinds, for now) all are listed.
299
+ // #2470 R6.2: where the project has a Workflows step (every kind since R6.2b), the workflows that only belong to it are
300
+ // listed there; this sheet says how many and links to it, and keeps listing in full what the step does not show (an
301
+ // Agent step on this project, a workflow built from its Knowledge). A kind without that step would get all listed.
302
302
  const stepped = window.flolessWorkspaces?.projectHasStep?.('workflows') === true;
303
303
  const ownedOnly = stepped ? all.filter((w) => w.bindings.length === 1 && w.bindings[0] === 'owner') : [];
304
304
  const workflows = stepped ? all.filter((w) => !ownedOnly.includes(w)) : all;