@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.
- package/dist/floless-server.cjs +33000 -22928
- package/dist/schemas/steel.model.v2.schema.json +194 -3
- package/dist/skills/floless-app-bridge/SKILL.md +3 -3
- package/dist/skills/floless-app-knowledge/SKILL.md +4 -3
- package/dist/skills/floless-app-onboarding/SKILL.md +5 -4
- package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +0 -3
- package/dist/skills/floless-app-queue/SKILL.md +2 -3
- package/dist/skills/floless-app-report-issue/SKILL.md +2 -2
- package/dist/skills/floless-app-steel-model/SKILL.md +35 -35
- package/dist/skills/floless-app-steel-model/references/custom-connections.md +47 -0
- package/dist/skills/floless-app-steel-model/references/custom-sections.md +32 -0
- package/dist/skills/floless-app-ui/SKILL.md +71 -126
- package/dist/web/add-ons.js +407 -0
- package/dist/web/analytics.js +1 -1
- package/dist/web/app.css +108 -189
- package/dist/web/app.js +11 -12
- package/dist/web/aware.js +49 -29
- package/dist/web/chat.css +6 -1
- package/dist/web/chat.js +133 -18
- package/dist/web/commands-filter.js +23 -0
- package/dist/web/commands-shell.js +39 -67
- package/dist/web/commands-steel.js +9 -1
- package/dist/web/commands-tekla-parser.js +23 -0
- package/dist/web/connections.js +14 -3
- package/dist/web/failure-copy.js +1 -0
- package/dist/web/guide.js +3 -3
- package/dist/web/index.html +29 -56
- package/dist/web/instructor.js +2 -2
- package/dist/web/kb-categories.js +64 -7
- package/dist/web/model-change-findings.js +430 -0
- package/dist/web/model-change-review.js +414 -0
- package/dist/web/model-editor-steel-adapter.js +2 -2
- package/dist/web/project-history.js +7 -1
- package/dist/web/revit-editor.css +85 -0
- package/dist/web/revit-editor.js +36 -1
- package/dist/web/sha256-sync.js +62 -0
- package/dist/web/steel-3d-core.js +7 -0
- package/dist/web/steel-3d-flo.js +127 -3
- package/dist/web/steel-3d-view.js +25 -2
- package/dist/web/steel-custom-connection.js +161 -0
- package/dist/web/steel-custom-sections.js +1796 -0
- package/dist/web/steel-editor.html +279 -41
- package/dist/web/steel-filter-usage.js +299 -0
- package/dist/web/steel-filter.html +101 -4
- package/dist/web/steel-model-v2-client-validation.js +3 -0
- package/dist/web/steel-model-v2-commands.js +95 -6
- package/dist/web/steel-model-v2-projection.js +1 -1
- package/dist/web/steel-read-confidence.js +1 -56
- package/dist/web/tekla-editor.html +1 -0
- package/dist/web/workspaces.js +263 -28
- package/launch.mjs +87 -9
- package/package.json +1 -1
- package/dist/web/panels.js +0 -831
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Change review S1 (#3352): the Tekla model page's "Changes" tab. Compare two saved states of the model and read what
|
|
3
|
+
* changed, honestly labelled (plan §3). Presentation only: the comparison runs on the server (in AWARE), and this never
|
|
4
|
+
* changes the model or a review. "Show in 3D" asks the page to open the row's saved state and select the object.
|
|
5
|
+
*
|
|
6
|
+
* Copy follows the UX review: plain English for detailers ("saved state", "matched"), never GUID, identity or parser.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { createFindings } from './model-change-findings.js';
|
|
10
|
+
|
|
11
|
+
const STATE_LABEL = {
|
|
12
|
+
'no-inconsistency-detected': 'No inconsistency detected',
|
|
13
|
+
'consistency-unknown': 'Consistency unknown',
|
|
14
|
+
'not-recorded': 'Consistency not recorded',
|
|
15
|
+
};
|
|
16
|
+
const KIND_LABEL = { 'shape-fields': 'Shape fields', placement: 'Placement', properties: 'Properties', relationships: 'Relationships' };
|
|
17
|
+
const STATUS_HEADING = { removed: 'Removed', added: 'Added', changed: 'Changed' };
|
|
18
|
+
|
|
19
|
+
function el(doc, tag, attrs = {}, ...children) {
|
|
20
|
+
const node = doc.createElement(tag);
|
|
21
|
+
for (const [key, value] of Object.entries(attrs)) {
|
|
22
|
+
if (value === undefined || value === null || value === false) continue;
|
|
23
|
+
if (key === 'class') node.className = value;
|
|
24
|
+
else if (key === 'text') node.textContent = value;
|
|
25
|
+
else if (key.startsWith('on')) node.addEventListener(key.slice(2), value);
|
|
26
|
+
else node.setAttribute(key, value === true ? '' : String(value));
|
|
27
|
+
}
|
|
28
|
+
for (const child of children.flat()) if (child) node.append(child);
|
|
29
|
+
return node;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const when = (iso) => {
|
|
33
|
+
if (!iso) return 'save time not known';
|
|
34
|
+
try { return new Date(iso).toLocaleString(undefined, { day: 'numeric', month: 'short', year: 'numeric', hour: '2-digit', minute: '2-digit' }); }
|
|
35
|
+
catch { return iso; }
|
|
36
|
+
};
|
|
37
|
+
const plural = (n, one, many = `${one}s`) => `${Number(n).toLocaleString()} ${n === 1 ? one : many}`;
|
|
38
|
+
const shown = (value) => {
|
|
39
|
+
if (value === null || value === undefined) return '—';
|
|
40
|
+
if (Array.isArray(value)) return value.map((item) => (typeof item === 'number' ? Math.round(item * 10) / 10 : item)).join(', ');
|
|
41
|
+
return typeof value === 'object' ? JSON.stringify(value) : String(value);
|
|
42
|
+
};
|
|
43
|
+
const fieldName = (key) => {
|
|
44
|
+
if (key === 'geometry.bounds') return 'Bounding box (mm)';
|
|
45
|
+
if (key === 'entity.name') return 'Object name';
|
|
46
|
+
if (key === 'entity.type') return 'Object type';
|
|
47
|
+
if (key.startsWith('relationship:')) return 'Connected to';
|
|
48
|
+
const uda = /^uda:(?:text|number):name:(.+)$/.exec(key);
|
|
49
|
+
if (uda) return `UDA ${uda[1]}`;
|
|
50
|
+
// Any other key (native or not) reads as its last part in words, never as the raw comparison key.
|
|
51
|
+
const last = key.split(/[:.]/).filter(Boolean).pop() || key;
|
|
52
|
+
return last.replace(/[-_]+/g, ' ').trim().replace(/^./, (c) => c.toUpperCase());
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* A themed single-choice picker (no native <select>): a button that opens a listbox of saved states.
|
|
57
|
+
*/
|
|
58
|
+
function statePicker(doc, { id, label, states, value, onChange }) {
|
|
59
|
+
const wrap = el(doc, 'div', { class: 'tekla-changes-picker' });
|
|
60
|
+
const labelEl = el(doc, 'span', { class: 'tekla-changes-picker-label', id: `${id}-label`, text: label });
|
|
61
|
+
const current = () => states.find((state) => state.key === value) || null;
|
|
62
|
+
const trigger = el(doc, 'button', { type: 'button', class: 'tekla-changes-trigger', id, 'aria-haspopup': 'listbox', 'aria-expanded': 'false',
|
|
63
|
+
'aria-labelledby': `${id}-label ${id}`, 'data-command-id': 'tekla-parser.change-review-state' });
|
|
64
|
+
const list = el(doc, 'div', { class: 'tekla-changes-options', role: 'listbox', 'aria-labelledby': `${id}-label`, hidden: true });
|
|
65
|
+
const paint = () => {
|
|
66
|
+
const state = current();
|
|
67
|
+
trigger.replaceChildren(el(doc, 'strong', { text: state ? state.label : 'Choose a saved state' }),
|
|
68
|
+
el(doc, 'span', { text: state ? `${when(state.savedAt)} · ${STATE_LABEL[state.capture]}` : '' }));
|
|
69
|
+
};
|
|
70
|
+
const close = () => { list.hidden = true; trigger.setAttribute('aria-expanded', 'false'); };
|
|
71
|
+
for (const state of states) {
|
|
72
|
+
const option = el(doc, 'div', { role: 'option', tabindex: '-1', class: 'tekla-changes-option', 'aria-selected': String(state.key === value),
|
|
73
|
+
'aria-disabled': state.comparable ? null : 'true', 'data-key': state.key },
|
|
74
|
+
el(doc, 'strong', { text: state.label }), el(doc, 'span', { text: `${when(state.savedAt)} · ${STATE_LABEL[state.capture]}` }),
|
|
75
|
+
state.comparable ? null : el(doc, 'span', { class: 'tekla-changes-option-note', text: state.notComparable }));
|
|
76
|
+
const pick = () => {
|
|
77
|
+
if (!state.comparable) return;
|
|
78
|
+
value = state.key; paint(); close();
|
|
79
|
+
list.querySelectorAll('[role=option]').forEach((item) => item.setAttribute('aria-selected', String(item.dataset.key === value)));
|
|
80
|
+
trigger.focus(); onChange(value);
|
|
81
|
+
};
|
|
82
|
+
option.addEventListener('click', pick);
|
|
83
|
+
option.addEventListener('keydown', (event) => {
|
|
84
|
+
if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); pick(); }
|
|
85
|
+
else if (event.key === 'Escape') { close(); trigger.focus(); }
|
|
86
|
+
else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
87
|
+
event.preventDefault();
|
|
88
|
+
const options = [...list.querySelectorAll('[role=option]')];
|
|
89
|
+
options[(options.indexOf(option) + (event.key === 'ArrowDown' ? 1 : -1) + options.length) % options.length]?.focus();
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
list.append(option);
|
|
93
|
+
}
|
|
94
|
+
trigger.addEventListener('click', () => {
|
|
95
|
+
const opening = list.hidden;
|
|
96
|
+
list.hidden = !opening; trigger.setAttribute('aria-expanded', String(opening));
|
|
97
|
+
if (!opening) return;
|
|
98
|
+
// The list hangs below the trigger inside the panel's scroll area; near the bottom of a short panel it
|
|
99
|
+
// would open out of sight. Scroll only that panel, by just the hidden part (never the page around it).
|
|
100
|
+
const panel = wrap.closest('.tekla-changes-host');
|
|
101
|
+
if (panel) {
|
|
102
|
+
const box = list.getBoundingClientRect();
|
|
103
|
+
const view = panel.getBoundingClientRect();
|
|
104
|
+
if (box.bottom > view.bottom) panel.scrollTop += Math.min(box.bottom - view.bottom, box.top - view.top);
|
|
105
|
+
else if (box.top < view.top) panel.scrollTop -= view.top - box.top;
|
|
106
|
+
}
|
|
107
|
+
const chosen = list.querySelector('[aria-selected=true]') || list.querySelector('[role=option]');
|
|
108
|
+
if (!chosen) return;
|
|
109
|
+
// Keep the current choice visible inside the list itself, then focus it without scrolling anything else.
|
|
110
|
+
if (chosen.offsetTop < list.scrollTop) list.scrollTop = chosen.offsetTop;
|
|
111
|
+
else if (chosen.offsetTop + chosen.offsetHeight > list.scrollTop + list.clientHeight) list.scrollTop = chosen.offsetTop + chosen.offsetHeight - list.clientHeight;
|
|
112
|
+
chosen.focus({ preventScroll: true });
|
|
113
|
+
});
|
|
114
|
+
trigger.addEventListener('keydown', (event) => { if (event.key === 'ArrowDown' && list.hidden) { event.preventDefault(); trigger.click(); } });
|
|
115
|
+
doc.addEventListener('pointerdown', (event) => { if (!wrap.contains(event.target)) close(); });
|
|
116
|
+
paint();
|
|
117
|
+
wrap.append(labelEl, trigger, list);
|
|
118
|
+
return { node: wrap, value: () => value };
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** A history row's word on the checks: how many findings, never a claim that a review is clean. */
|
|
122
|
+
function checksNote(item) {
|
|
123
|
+
const c = item.checks;
|
|
124
|
+
if (!c) return '';
|
|
125
|
+
if (c.state !== 'ran') return ' · checks not run';
|
|
126
|
+
const n = c.summary?.findings ?? 0;
|
|
127
|
+
return n ? ` · ${n.toLocaleString()} ${n === 1 ? 'finding' : 'findings'}${c.complete ? '' : ' (not all listed)'}` : ' · no findings in what was checked';
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function mountChangeReview({ host, doc = document, projectId, fetchJson, locate, onStateChanged = () => {}, clipboard = null }) {
|
|
131
|
+
let states = [];
|
|
132
|
+
let reviews = [];
|
|
133
|
+
let review = null;
|
|
134
|
+
let rows = [];
|
|
135
|
+
let unpaired = null;
|
|
136
|
+
let busy = false;
|
|
137
|
+
let picks = { base: null, revised: null };
|
|
138
|
+
let refusal = null;
|
|
139
|
+
let message = null;
|
|
140
|
+
const live = el(doc, 'div', { class: 'tekla-changes-live', role: 'status', 'aria-live': 'polite' });
|
|
141
|
+
// S2 (#3461): what the checks found, and the person's decisions on it.
|
|
142
|
+
const findings = createFindings({ doc, el, api: (path, options) => fetchJson(path, options), projectId, live, locate, clipboard,
|
|
143
|
+
sideState: (side) => sideState(side), rerender: () => render(), focusCompare: () => host.querySelector('.tekla-changes-compare')?.focus() });
|
|
144
|
+
|
|
145
|
+
const api = (path, options) => fetchJson(path, options);
|
|
146
|
+
|
|
147
|
+
async function load() {
|
|
148
|
+
refusal = null; message = null;
|
|
149
|
+
try {
|
|
150
|
+
const listed = await api(`/api/change-review/tekla/${encodeURIComponent(projectId)}/states`);
|
|
151
|
+
if (listed.access && listed.access.allowed === false) {
|
|
152
|
+
refusal = { module: listed.access.module, code: listed.access.code, text: listed.access.userMessage }; states = []; reviews = []; render(); return;
|
|
153
|
+
}
|
|
154
|
+
states = listed.states || [];
|
|
155
|
+
reviews = (await api(`/api/change-review/${encodeURIComponent(projectId)}/reviews`)).reviews || [];
|
|
156
|
+
const comparable = states.filter((state) => state.comparable);
|
|
157
|
+
if (!picks.revised || !comparable.some((state) => state.key === picks.revised)) picks.revised = comparable.at(-1)?.key ?? null;
|
|
158
|
+
if (!picks.base || !comparable.some((state) => state.key === picks.base) || picks.base === picks.revised) {
|
|
159
|
+
picks.base = comparable.filter((state) => state.key !== picks.revised).at(-1)?.key ?? null;
|
|
160
|
+
}
|
|
161
|
+
} catch (error) {
|
|
162
|
+
if (error?.status === 403) refusal = { module: error.body?.module ?? null, code: error.body?.code ?? null, text: error.body?.userMessage || error.message };
|
|
163
|
+
else message = { kind: 'error', text: error?.body?.userMessage || 'The saved states could not be listed. Open the model again, then try once more.' };
|
|
164
|
+
}
|
|
165
|
+
render();
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
let pick = 0;
|
|
169
|
+
let opening = false;
|
|
170
|
+
|
|
171
|
+
async function compare() {
|
|
172
|
+
if (busy || !picks.base || !picks.revised) return;
|
|
173
|
+
busy = true; message = null; render();
|
|
174
|
+
// If the person picks a review before this finishes, the comparison is listed but neither opened, announced nor
|
|
175
|
+
// reported over that review. Only opening a review moves the pick, so nothing is ever left half open.
|
|
176
|
+
const token = pick;
|
|
177
|
+
let focusResult = false;
|
|
178
|
+
live.textContent = 'Comparing the two saved states…';
|
|
179
|
+
try {
|
|
180
|
+
const reply = await api(`/api/change-review/tekla/${encodeURIComponent(projectId)}/compare`, {
|
|
181
|
+
method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ base: picks.base, revised: picks.revised,
|
|
182
|
+
// The revisions the pickers show: a newer copy imported since is refused, never compared in their place.
|
|
183
|
+
baseRevisionId: states.find((state) => state.key === picks.base)?.revisionId,
|
|
184
|
+
revisedRevisionId: states.find((state) => state.key === picks.revised)?.revisionId }),
|
|
185
|
+
});
|
|
186
|
+
reviews = [reply.review, ...reviews.filter((item) => item.reviewId !== reply.review.reviewId)];
|
|
187
|
+
if (token !== pick || !(await openReview(reply.review))) return;
|
|
188
|
+
focusResult = true;
|
|
189
|
+
const s = reply.review.summary;
|
|
190
|
+
live.textContent = !s ? 'Compared.' : reply.review.parserParity === 'differs'
|
|
191
|
+
? `Compared, read by different versions of FloLess: ${s.added} only in the later state, ${s.removed} only in the earlier, ${s.changed} may differ.`
|
|
192
|
+
: `Compared: ${s.added} added, ${s.removed} removed, ${s.changed} changed.`;
|
|
193
|
+
} catch (error) {
|
|
194
|
+
if (token !== pick) return;
|
|
195
|
+
focusResult = true;
|
|
196
|
+
if (error?.status === 403) refusal = { module: error.body?.module ?? null, code: error.body?.code ?? null, text: error.body?.userMessage || error.message };
|
|
197
|
+
else if (error?.body?.code === 'state-changed') { await load(); if (token === pick) message = { kind: 'warning', text: error.body.userMessage }; }
|
|
198
|
+
else message = { kind: 'error', text: error?.body?.userMessage || 'The comparison could not be finished. Try again; if it keeps happening, use Report an issue.' };
|
|
199
|
+
live.textContent = '';
|
|
200
|
+
} finally {
|
|
201
|
+
busy = false; render(); onStateChanged();
|
|
202
|
+
if (focusResult) host.querySelector('.tekla-changes-result-title')?.focus();
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Open a review. Every opening takes the next pick number; only the pick numbered last may fill the panel, and until
|
|
208
|
+
* it does the panel says it is opening, so nothing from the earlier review can be clicked. A later opening always
|
|
209
|
+
* finishes or is itself overtaken, so 'opening' is never left on. Resolves true when this pick is the one on screen.
|
|
210
|
+
*/
|
|
211
|
+
async function openReview(next) {
|
|
212
|
+
const token = ++pick;
|
|
213
|
+
// Nothing said or reported about what was on screen before carries over to this opening, even of the same review.
|
|
214
|
+
live.textContent = ''; message = null;
|
|
215
|
+
review = next; rows = []; unpaired = null; opening = true;
|
|
216
|
+
const findingsLoaded = findings.load(next);
|
|
217
|
+
render();
|
|
218
|
+
let got = []; let gotUnpaired = null; let failedRows = false;
|
|
219
|
+
try {
|
|
220
|
+
const page = await api(`/api/change-review/${encodeURIComponent(projectId)}/reviews/${next.reviewId}/changes?limit=500`);
|
|
221
|
+
got = page.rows || []; gotUnpaired = page.unpaired || null;
|
|
222
|
+
if (page.total > got.length) {
|
|
223
|
+
for (let offset = got.length; offset < Math.min(page.total, 5000); offset += 500) {
|
|
224
|
+
if (token !== pick) return false;
|
|
225
|
+
const more = await api(`/api/change-review/${encodeURIComponent(projectId)}/reviews/${next.reviewId}/changes?limit=500&offset=${offset}`);
|
|
226
|
+
got.push(...(more.rows || []));
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
} catch { failedRows = true; }
|
|
230
|
+
await findingsLoaded;
|
|
231
|
+
if (token !== pick) return false;
|
|
232
|
+
opening = false; rows = got; unpaired = gotUnpaired;
|
|
233
|
+
if (failedRows) message = { kind: 'error', text: 'The list of changes for this review could not be opened. Compare the saved states again.' };
|
|
234
|
+
render();
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function sideState(side) { return states.find((state) => state.revisionId === review?.[side]?.revisionId) || null; }
|
|
239
|
+
|
|
240
|
+
function renderRow(row) {
|
|
241
|
+
const shownPick = pick;
|
|
242
|
+
const detailId = `tekla-change-${row.status}-${row.identity.replace(/[^A-Za-z0-9_-]/g, '_')}`;
|
|
243
|
+
const kinds = (row.kinds || []).map((kind) => el(doc, 'span', { class: 'tekla-changes-chip', text: KIND_LABEL[kind] || kind }));
|
|
244
|
+
const toggle = el(doc, 'button', { type: 'button', class: 'tekla-audit-row tekla-changes-row', 'aria-expanded': 'false', 'aria-controls': detailId,
|
|
245
|
+
'data-command-id': 'tekla-parser.change-review-row' },
|
|
246
|
+
el(doc, 'strong', { text: row.name || row.type || 'Object', 'data-tip': `${row.type} · ${row.name}` }),
|
|
247
|
+
el(doc, 'span', { text: row.type }),
|
|
248
|
+
kinds.length ? el(doc, 'span', { class: 'tekla-changes-chips' }, kinds) : null);
|
|
249
|
+
const side = row.status === 'removed' ? 'base' : 'revised';
|
|
250
|
+
const target = sideState(side);
|
|
251
|
+
const entityId = side === 'base' ? row.entityIdBase : row.entityIdRevised;
|
|
252
|
+
const show = el(doc, 'button', { type: 'button', class: 'tekla-changes-locate', 'data-command-id': 'tekla-parser.change-review-locate',
|
|
253
|
+
'aria-label': `Show ${row.name || row.type} in 3D${row.status === 'removed' ? ' in the earlier saved state' : ''}`,
|
|
254
|
+
text: row.status === 'removed' ? 'Show in earlier state' : 'Show in 3D',
|
|
255
|
+
onclick: async () => {
|
|
256
|
+
if (shownPick !== pick) return;
|
|
257
|
+
if (!target || !entityId) {
|
|
258
|
+
message = { kind: 'error', text: 'That saved state is no longer part of this project, so this object cannot be shown in 3D.' }; render(); return;
|
|
259
|
+
}
|
|
260
|
+
show.disabled = true;
|
|
261
|
+
try { await locate({ state: target, entityId }); }
|
|
262
|
+
catch (error) { if (shownPick === pick) { message = { kind: 'error', text: error?.message || 'That saved state could not be opened in 3D.' }; render(); } }
|
|
263
|
+
finally { show.disabled = false; }
|
|
264
|
+
} });
|
|
265
|
+
const detail = el(doc, 'div', { class: 'tekla-changes-detail', id: detailId, hidden: true });
|
|
266
|
+
if (row.status === 'changed' && Array.isArray(row.fields)) {
|
|
267
|
+
for (const field of row.fields) {
|
|
268
|
+
detail.append(el(doc, 'div', { class: 'tekla-changes-field' },
|
|
269
|
+
el(doc, 'span', { class: 'tekla-changes-field-name', text: `${fieldName(field.key)} · ${KIND_LABEL[field.kind] || field.kind}` }),
|
|
270
|
+
el(doc, 'span', { class: 'tekla-changes-before', text: `Before: ${shown(field.before)}` }),
|
|
271
|
+
el(doc, 'span', { class: 'tekla-changes-after', text: `After: ${shown(field.after)}` })));
|
|
272
|
+
}
|
|
273
|
+
if (row.truncatedFields) detail.append(el(doc, 'p', { class: 'tekla-audit-omissions', text: `${plural(row.truncatedFields, 'more field')} changed and are not listed.` }));
|
|
274
|
+
} else {
|
|
275
|
+
detail.append(el(doc, 'p', { class: 'tekla-audit-omissions', text: row.status === 'added' ? 'This object is in the later saved state only.' : 'This object is in the earlier saved state only.' }));
|
|
276
|
+
}
|
|
277
|
+
detail.append(show);
|
|
278
|
+
toggle.addEventListener('click', () => {
|
|
279
|
+
const open = toggle.getAttribute('aria-expanded') !== 'true';
|
|
280
|
+
toggle.setAttribute('aria-expanded', String(open)); detail.hidden = !open;
|
|
281
|
+
});
|
|
282
|
+
return el(doc, 'div', { class: 'tekla-changes-item' }, toggle, detail);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
function renderResult() {
|
|
286
|
+
const out = [];
|
|
287
|
+
const s = review.summary || {};
|
|
288
|
+
const title = el(doc, 'h3', { class: 'tekla-changes-result-title', tabindex: '-1', text: `Compared ${review.base.label} with ${review.revised.label}.` });
|
|
289
|
+
out.push(title);
|
|
290
|
+
const metrics = el(doc, 'section', { class: 'tekla-audit-summary tekla-changes-metrics', 'aria-label': 'Change counts' });
|
|
291
|
+
// Read by two parser versions, a changed field may be the reading, not the model (plan §2.4): never call it a change.
|
|
292
|
+
const parserDiffers = review.parserParity === 'differs';
|
|
293
|
+
for (const [value, label] of parserDiffers
|
|
294
|
+
? [[s.added, 'Only in later (may be the reading)'], [s.removed, 'Only in earlier (may be the reading)'], [s.changed, 'May differ']]
|
|
295
|
+
: [[s.added, 'Added'], [s.removed, 'Removed'], [s.changed, 'Changed']]) {
|
|
296
|
+
metrics.append(el(doc, 'div', {}, el(doc, 'strong', { text: Number(value || 0).toLocaleString() }), el(doc, 'span', { text: label })));
|
|
297
|
+
}
|
|
298
|
+
out.push(metrics);
|
|
299
|
+
out.push(el(doc, 'p', { class: 'tekla-audit-omissions', text: 'Whose changes: not known. FloLess compares what was saved, not who changed it.' }));
|
|
300
|
+
out.push(el(doc, 'p', { class: 'tekla-audit-omissions',
|
|
301
|
+
text: `${review.base.label}: ${STATE_LABEL[review.base.capture?.label] || STATE_LABEL['not-recorded']}. ${review.revised.label}: ${STATE_LABEL[review.revised.capture?.label] || STATE_LABEL['not-recorded']}.` }));
|
|
302
|
+
const banner = (tone, heading, text) => el(doc, 'section', { class: `tekla-changes-banner ${tone}`, role: 'note', 'aria-label': heading },
|
|
303
|
+
el(doc, 'strong', { text: `⚠ ${heading}` }), el(doc, 'span', { text }));
|
|
304
|
+
if (review.diagnosticReasons?.includes('capture')) {
|
|
305
|
+
out.push(banner('warn', 'Check these results', 'One or both saved states may not have been copied from one clean save, so some differences could be missing or false. Save in Tekla, import the folder again and compare to be sure.'));
|
|
306
|
+
}
|
|
307
|
+
if (review.parserParity === 'differs') {
|
|
308
|
+
out.push(banner('warn', 'Read by different versions', 'These two saved states were read by different versions of FloLess, so small differences may come from the reading, not the model. Import the earlier saved state again to compare them on one version.'));
|
|
309
|
+
}
|
|
310
|
+
if (s.discontinuity) {
|
|
311
|
+
out.push(banner('warn', 'Most objects could not be matched',
|
|
312
|
+
`Only ${Number(s.paired).toLocaleString()} of ${Number(s.base).toLocaleString()} objects could be matched between these saved states. The model may have been rebuilt or its components regenerated, so the lists below are not a list of edits. Compare two saved states that are closer together.`));
|
|
313
|
+
}
|
|
314
|
+
const w = review.witness;
|
|
315
|
+
if (w) out.push(el(doc, 'p', { class: 'tekla-audit-omissions',
|
|
316
|
+
text: w.state === 'agrees' ? 'Tekla’s own save history agrees with these changes.' : w.state === 'disagrees' ? `Tekla’s own save history does not agree: ${w.detail}` : w.detail }));
|
|
317
|
+
const notChecked = el(doc, 'section', { class: 'tekla-changes-unchecked', 'aria-label': 'What was not checked' },
|
|
318
|
+
el(doc, 'strong', { text: 'What was not checked' }), ...(review.unchecked || []).map((line) => el(doc, 'p', { class: 'tekla-audit-omissions', text: line })));
|
|
319
|
+
out.push(...findings.nodes());
|
|
320
|
+
out.push(notChecked);
|
|
321
|
+
const list = el(doc, 'div', { class: 'tekla-audit-list tekla-changes-list', 'aria-label': 'Changes' });
|
|
322
|
+
for (const status of ['changed', 'added', 'removed']) {
|
|
323
|
+
const group = rows.filter((row) => row.status === status);
|
|
324
|
+
const total = s[status] || 0;
|
|
325
|
+
const section = el(doc, 'details', { class: 'tekla-changes-group', open: status === 'changed' ? true : null },
|
|
326
|
+
el(doc, 'summary', { text: !parserDiffers ? `${STATUS_HEADING[status]} (${Number(total).toLocaleString()})`
|
|
327
|
+
: status === 'changed' ? `Differences that may come from the reading, not the model (${Number(total).toLocaleString()})`
|
|
328
|
+
: `Only in the ${status === 'added' ? 'later' : 'earlier'} saved state, which may be the reading (${Number(total).toLocaleString()})` }));
|
|
329
|
+
if (!group.length) {
|
|
330
|
+
const none = !parserDiffers ? `Nothing ${STATUS_HEADING[status].toLowerCase()}.`
|
|
331
|
+
: status === 'changed' ? 'No differences.' : `Nothing only in the ${status === 'added' ? 'later' : 'earlier'} saved state.`;
|
|
332
|
+
section.append(el(doc, 'p', { class: 'tekla-audit-omissions', text: total ? `Not listed: the list is limited to 5,000 ${parserDiffers ? 'differences' : 'changes'}.` : none }));
|
|
333
|
+
}
|
|
334
|
+
for (const row of group) section.append(renderRow(row));
|
|
335
|
+
list.append(section);
|
|
336
|
+
}
|
|
337
|
+
// Added and removed objects grouped by type and name, so a regenerated component reads as one group. A group is
|
|
338
|
+
// a way of showing what could not be matched, never a match.
|
|
339
|
+
const groups = Array.isArray(unpaired?.groups) ? unpaired.groups : [];
|
|
340
|
+
if (groups.length) {
|
|
341
|
+
const section = el(doc, 'details', { class: 'tekla-changes-group' },
|
|
342
|
+
el(doc, 'summary', { text: `Could not be matched, by type and name (${Number(unpaired.groupCount ?? groups.length).toLocaleString()})` }),
|
|
343
|
+
el(doc, 'p', { class: 'tekla-audit-omissions', text: 'Objects only in one saved state, grouped by type and name. A group is not a match: FloLess does not guess which object became which.'
|
|
344
|
+
+ (parserDiffers ? ' These saved states were read by different versions of FloLess, so some of these may come from the reading, not the model.' : '') }));
|
|
345
|
+
for (const g of groups) {
|
|
346
|
+
const removedN = g.removed?.count ?? 0; const addedN = g.added?.count ?? 0;
|
|
347
|
+
section.append(el(doc, 'div', { class: 'tekla-changes-unpaired' },
|
|
348
|
+
el(doc, 'strong', { text: `${g.type || 'Object'} · ${g.name || 'unnamed'}` }),
|
|
349
|
+
el(doc, 'span', { text: `${removedN.toLocaleString()} only in the earlier state, ${addedN.toLocaleString()} only in the later state` })));
|
|
350
|
+
}
|
|
351
|
+
if ((unpaired.groupCount ?? groups.length) > groups.length) section.append(el(doc, 'p', { class: 'tekla-audit-omissions', text: `${(unpaired.groupCount - groups.length).toLocaleString()} more groups are not listed.` }));
|
|
352
|
+
list.append(section);
|
|
353
|
+
}
|
|
354
|
+
const omitted = review.summary?.truncated ? (s.added + s.removed + s.changed) - rows.length : 0;
|
|
355
|
+
const noun = parserDiffers ? 'differences' : 'changes';
|
|
356
|
+
if (omitted > 0) list.append(el(doc, 'p', { class: 'tekla-audit-omissions', text: `${rows.length.toLocaleString()} ${noun} are shown. ${omitted.toLocaleString()} more are not listed.` }));
|
|
357
|
+
out.push(list);
|
|
358
|
+
return out;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
function render() {
|
|
362
|
+
host.replaceChildren();
|
|
363
|
+
host.classList.add('tekla-changes-host');
|
|
364
|
+
if (refusal) {
|
|
365
|
+
// Only a plan without Change Review gets the team-plan panel; any other refusal (Tekla access, a sign-in that
|
|
366
|
+
// needs renewing) is said in its own words, without promising that a plan change fixes it.
|
|
367
|
+
const notInPlan = refusal.module === 'change_review' && refusal.code === 'module-inactive';
|
|
368
|
+
host.append(el(doc, 'div', { class: 'tekla-audit-state tekla-changes-locked' },
|
|
369
|
+
el(doc, 'strong', { text: notInPlan ? 'Change Review is part of the team plan' : 'Change Review can’t be used right now' }),
|
|
370
|
+
notInPlan ? el(doc, 'span', { text: 'It compares two saved states of a model and lists what was added, removed or changed, so you can review changes before they go out.' }) : null,
|
|
371
|
+
notInPlan ? el(doc, 'span', { text: 'It is not in the signed-in FloLess account’s plan.' }) : el(doc, 'span', { text: refusal.text }),
|
|
372
|
+
notInPlan ? el(doc, 'a', { href: 'https://floless.io/contact', target: '_blank', rel: 'noopener', class: 'tekla-changes-contact', 'data-command-id': 'tekla-parser.change-review-contact', text: 'Contact FloLess' }) : null));
|
|
373
|
+
host.append(live);
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
const comparable = states.filter((state) => state.comparable);
|
|
377
|
+
const controls = el(doc, 'section', { class: 'tekla-changes-controls', 'aria-label': 'Choose saved states' });
|
|
378
|
+
if (comparable.length < 2) {
|
|
379
|
+
controls.append(el(doc, 'div', { class: 'tekla-audit-state' },
|
|
380
|
+
el(doc, 'strong', { text: 'You need two saved states to compare' }),
|
|
381
|
+
el(doc, 'span', { text: 'Save your model in Tekla, then import the model folder again. Each import adds a saved state.' }),
|
|
382
|
+
...states.filter((state) => !state.comparable).map((state) => el(doc, 'span', { text: `${state.label}: ${state.notComparable}` }))));
|
|
383
|
+
} else {
|
|
384
|
+
controls.append(
|
|
385
|
+
statePicker(doc, { id: 'teklaChangesBase', label: 'Earlier saved state', states, value: picks.base, onChange: (key) => { picks.base = key; render(); } }).node,
|
|
386
|
+
statePicker(doc, { id: 'teklaChangesRevised', label: 'Later saved state', states, value: picks.revised, onChange: (key) => { picks.revised = key; render(); } }).node,
|
|
387
|
+
el(doc, 'button', { type: 'button', class: 'tekla-changes-compare primary', 'data-command-id': 'tekla-parser.change-review-compare',
|
|
388
|
+
'aria-busy': busy ? 'true' : null, disabled: busy || picks.base === picks.revised ? true : null,
|
|
389
|
+
'aria-label': picks.base === picks.revised ? 'Compare (choose two different saved states)' : 'Compare the two saved states',
|
|
390
|
+
text: busy ? 'Comparing…' : 'Compare', onclick: compare }));
|
|
391
|
+
if (picks.base === picks.revised) controls.append(el(doc, 'p', { class: 'tekla-audit-omissions', text: 'Choose two different saved states to compare.' }));
|
|
392
|
+
}
|
|
393
|
+
host.append(controls, live);
|
|
394
|
+
if (message) host.append(el(doc, 'p', { class: `tekla-changes-message ${message.kind}`, role: message.kind === 'info' ? 'status' : 'alert', text: message.text }));
|
|
395
|
+
if (review) host.append(...(opening ? [el(doc, 'p', { class: 'tekla-audit-omissions tekla-changes-opening', role: 'status', text: 'Opening review…' })] : renderResult()));
|
|
396
|
+
findings.restoreFocus(host);
|
|
397
|
+
if (reviews.length) {
|
|
398
|
+
const history = el(doc, 'details', { class: 'tekla-changes-history' }, el(doc, 'summary', { text: `Earlier reviews (${reviews.length})` }));
|
|
399
|
+
for (const item of reviews) {
|
|
400
|
+
const s = item.summary || {};
|
|
401
|
+
history.append(el(doc, 'button', { type: 'button', class: 'tekla-changes-history-row', 'data-command-id': 'tekla-parser.change-review-history',
|
|
402
|
+
'aria-current': review?.reviewId === item.reviewId ? 'true' : null, onclick: () => openReview(item) },
|
|
403
|
+
el(doc, 'strong', { text: `${item.base.label} → ${item.revised.label}` }),
|
|
404
|
+
el(doc, 'span', { text: item.parserParity === 'differs'
|
|
405
|
+
? `${when(item.createdAt)} · read by different versions of FloLess · ${s.added ?? 0} only in later, ${s.removed ?? 0} only in earlier, ${s.changed ?? 0} may differ`
|
|
406
|
+
: `${when(item.createdAt)} · ${s.added ?? 0} added, ${s.removed ?? 0} removed, ${s.changed ?? 0} changed${item.diagnostic ? ' · check these results' : ''}${checksNote(item)}` })));
|
|
407
|
+
}
|
|
408
|
+
host.append(history);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
render();
|
|
413
|
+
return { load, refresh: load, state: () => ({ states: states.length, review: review?.reviewId ?? null, rows: rows.length, refusal: !!refusal, ...findings.state() }) };
|
|
414
|
+
}
|
|
@@ -411,8 +411,8 @@ const CONTRIBUTIONS = Object.freeze({
|
|
|
411
411
|
{ kind: 'disclosure', cmd: 'steel.flo-card-settings', el: 'floCardDisc', class: 'pl-disclosure', controls: 'floCardScope', label: 'Flo', tip: 'Choose what Flo’s card says about the member Flo hops onto' },
|
|
412
412
|
],
|
|
413
413
|
},
|
|
414
|
-
// How big Flo and its card are drawn
|
|
415
|
-
{ kind: 'range', cmd: 'steel.flo-size', el: 'floSize', valueEl: 'floSizeV', label: 'Flo size', min: 60, max: 200, step: 10, value: 100, ariaLabel: 'Flo size in percent', tip: 'How big Flo and Flo’s card are drawn in 3D.
|
|
414
|
+
// How big Flo and its card are drawn: one setting for both. Flo follows the zoom from this size (#3380); the card keeps it.
|
|
415
|
+
{ kind: 'range', cmd: 'steel.flo-size', el: 'floSize', valueEl: 'floSizeV', label: 'Flo size', min: 60, max: 200, step: 10, value: 100, ariaLabel: 'Flo size in percent', tip: 'How big Flo and Flo’s card are drawn in 3D. Flo gets smaller as you zoom in close and bigger as you zoom out, starting from this size.' },
|
|
416
416
|
{
|
|
417
417
|
kind: 'scope', el: 'floCardScope', class: 'pl-scope', revealBy: 'floCardDisc', hidden: true, items: [
|
|
418
418
|
{ kind: 'note', el: 'floCardNote', class: 'pl-note' },
|
|
@@ -25,14 +25,20 @@
|
|
|
25
25
|
{ key: 'project', label: 'Project', test: (k) => k === 'project-created' },
|
|
26
26
|
{ key: 'knowledge', label: 'Knowledge', test: (k) => k.startsWith('knowledge-') || k.startsWith('design-set-') || k.startsWith('design-issue-') },
|
|
27
27
|
{ key: 'workflows', label: 'Workflows', test: (k) => k.startsWith('workflow-') || k.startsWith('watcher-') },
|
|
28
|
+
// #3415: an Agent run reaching this project (from the Agents tab, or a routine that runs an agent).
|
|
29
|
+
{ key: 'agents', label: 'Agents', test: (k) => k === 'agent-run-started' },
|
|
28
30
|
{ key: 'rfis', label: 'RFIs', test: (k) => k.startsWith('rfi-') },
|
|
29
31
|
{ key: 'linked', label: 'Linked projects', test: (k) => k === 'module-linked' || k === 'module-unlinked' },
|
|
30
32
|
{ key: 'requests', label: 'Requests', test: (k) => k === 'request-changed' },
|
|
31
33
|
];
|
|
32
34
|
const KNOWN = new Set(['project-created', 'knowledge-organized', 'knowledge-source-added', 'knowledge-source-removed',
|
|
35
|
+
// #3415: a connected source (Teams chat, Outlook folder, Trimble Connect project) is project knowledge too.
|
|
36
|
+
'knowledge-connected-added', 'knowledge-connected-synced', 'knowledge-connected-removed', 'knowledge-connected-rebound',
|
|
37
|
+
'knowledge-connected-erase-started', 'knowledge-connected-erased',
|
|
33
38
|
'design-set-registered', 'design-set-cleared', 'design-issue-added', 'design-issue-updated', 'design-issue-withdrawn',
|
|
34
39
|
'design-issue-restored', 'workflow-created', 'workflow-compiled', 'workflow-run-finished', 'rfi-raised', 'rfi-answered',
|
|
35
|
-
'rfi-closed', 'module-linked', 'module-unlinked', 'request-changed', 'watcher-started', 'watcher-reported', 'watcher-stopped'
|
|
40
|
+
'rfi-closed', 'module-linked', 'module-unlinked', 'request-changed', 'watcher-started', 'watcher-reported', 'watcher-stopped',
|
|
41
|
+
'agent-run-started']);
|
|
36
42
|
const OTHER = { key: 'other', label: 'Other activity' };
|
|
37
43
|
const areaOf = (entry) => {
|
|
38
44
|
const kind = String(entry?.event?.kind || '');
|
|
@@ -74,3 +74,88 @@ body:has(.editor-root[data-model-state="empty"]) .read-only-chip{display:none}
|
|
|
74
74
|
.chat-q-failed{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:11px;color:var(--muted)}
|
|
75
75
|
/* #1836: the files a read went without, above the findings they cause. Not sticky: the summary below it is. */
|
|
76
76
|
.tekla-audit-sources{display:block;position:static;padding:4px 9px 6px;border-bottom:1px solid var(--line)}.tekla-audit-sources .tekla-audit-state{padding:6px 0 2px;text-align:left}.tekla-audit-sources .tekla-audit-inspector-item{padding:6px 0}.tekla-audit-sources .tekla-audit-inspector-item p{font-size:11px}
|
|
77
|
+
|
|
78
|
+
/* #3352 Changes tab (Change Review): reuses the Audit tab's language; only what Audit has no equivalent for is new. */
|
|
79
|
+
.tekla-changes-host{overflow:auto;padding:0 0 10px}
|
|
80
|
+
.tekla-changes-controls{display:flex;flex-direction:column;gap:7px;padding:8px 7px;border-bottom:1px solid var(--line);background:var(--panel)}
|
|
81
|
+
.tekla-changes-picker{position:relative;display:flex;flex-direction:column;gap:3px}
|
|
82
|
+
.tekla-changes-picker-label{color:var(--muted);font-size:10px}
|
|
83
|
+
.tekla-changes-trigger{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;min-height:40px;padding:6px 8px;text-align:left}
|
|
84
|
+
.tekla-changes-trigger span,.tekla-changes-option span{color:var(--muted);font-size:10px}
|
|
85
|
+
.tekla-changes-trigger::after{content:'';position:absolute;right:10px;bottom:16px;border:4px solid transparent;border-top-color:var(--muted)}
|
|
86
|
+
.tekla-changes-options{position:absolute;z-index:5;top:100%;left:0;right:0;max-height:240px;overflow:auto;margin-top:3px;padding:4px;border:1px solid var(--line-strong);border-radius:6px;background:var(--panel-2);box-shadow:var(--shadow)}
|
|
87
|
+
.tekla-changes-option{display:flex;flex-direction:column;gap:2px;padding:6px 7px;border-radius:5px;cursor:pointer}
|
|
88
|
+
.tekla-changes-option:hover,.tekla-changes-option:focus{outline:none;background:var(--btn-hover)}
|
|
89
|
+
.tekla-changes-option[aria-selected="true"]{background:var(--accent-soft);color:var(--selected-ink)}
|
|
90
|
+
.tekla-changes-option[aria-disabled="true"]{cursor:default;opacity:.65}
|
|
91
|
+
.tekla-changes-option-note{white-space:normal}
|
|
92
|
+
.tekla-changes-compare{width:100%;min-height:30px;font-weight:600}
|
|
93
|
+
.tekla-changes-result-title{margin:10px 9px 2px;font-size:12px;line-height:1.35}
|
|
94
|
+
.tekla-changes-result-title:focus{outline:2px solid var(--accent);outline-offset:2px}
|
|
95
|
+
.tekla-changes-metrics{position:static;grid-template-columns:1fr 1fr 1fr}
|
|
96
|
+
.tekla-changes-host>.tekla-audit-omissions{padding:3px 9px}
|
|
97
|
+
.tekla-changes-banner{display:flex;flex-direction:column;gap:3px;margin:6px 7px;padding:7px 8px;border:1px solid var(--line);border-left:3px solid var(--danger);border-radius:6px;background:var(--panel-2);font-size:11px;line-height:1.4}
|
|
98
|
+
.tekla-changes-banner span{color:var(--muted)}
|
|
99
|
+
.tekla-changes-unchecked{margin:6px 7px;padding:6px 8px;border:1px dashed var(--line-strong);border-radius:6px}
|
|
100
|
+
.tekla-changes-unchecked strong{font-size:11px}
|
|
101
|
+
.tekla-changes-unchecked .tekla-audit-omissions{padding:3px 0}
|
|
102
|
+
.tekla-changes-list{flex:0 0 auto;min-height:auto;overflow:visible}
|
|
103
|
+
.tekla-changes-group{margin-bottom:6px}
|
|
104
|
+
.tekla-changes-group>summary{cursor:pointer;padding:5px 2px;font-weight:600;font-size:11px}
|
|
105
|
+
.tekla-changes-row{grid-template-columns:minmax(0,1fr);margin-bottom:0}
|
|
106
|
+
.tekla-changes-chips{display:flex;flex-wrap:wrap;gap:3px;margin-top:3px}
|
|
107
|
+
.tekla-changes-chip{padding:1px 6px;border:1px solid var(--line-strong);border-radius:999px;color:var(--muted);font-size:9.5px}
|
|
108
|
+
.tekla-changes-item{margin-bottom:5px}
|
|
109
|
+
.tekla-changes-detail{display:flex;flex-direction:column;gap:5px;padding:6px 8px 8px;border:1px solid var(--line);border-top:0;border-radius:0 0 6px 6px}
|
|
110
|
+
.tekla-changes-field{display:flex;flex-direction:column;gap:1px;font-size:11px;overflow-wrap:anywhere}
|
|
111
|
+
.tekla-changes-field-name{color:var(--muted);font-size:10px}
|
|
112
|
+
.tekla-changes-locate{align-self:flex-start;min-height:26px;padding:3px 8px;font-size:11px}
|
|
113
|
+
.tekla-changes-message{margin:6px 9px;font-size:11px}
|
|
114
|
+
.tekla-changes-message.error{color:var(--danger)}
|
|
115
|
+
.tekla-changes-history{margin:8px 7px}
|
|
116
|
+
.tekla-changes-history>summary{cursor:pointer;padding:5px 2px;font-weight:600;font-size:11px}
|
|
117
|
+
.tekla-changes-history-row{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;margin-top:5px;padding:6px 8px;text-align:left}
|
|
118
|
+
.tekla-changes-history-row span{color:var(--muted);font-size:10px}
|
|
119
|
+
.tekla-changes-history-row[aria-current="true"]{border-color:var(--accent);background:var(--accent-soft)}
|
|
120
|
+
.tekla-changes-locked{text-align:left}
|
|
121
|
+
.tekla-changes-contact{align-self:flex-start;color:var(--accent);font-weight:600}
|
|
122
|
+
.tekla-changes-live:empty{display:none}
|
|
123
|
+
.tekla-changes-live{margin:4px 9px;color:var(--muted);font-size:11px}
|
|
124
|
+
.tekla-changes-unpaired{display:flex;flex-direction:column;gap:2px;padding:6px 8px;margin-bottom:4px;border:1px solid var(--line);border-radius:6px;font-size:11px}
|
|
125
|
+
.tekla-changes-unpaired span{color:var(--muted);font-size:10px}
|
|
126
|
+
/* Change review S2 (#3461): the Findings section of the Changes tab. Existing tokens only, both themes. */
|
|
127
|
+
.tekla-changes-gate.danger{border-left-color:var(--danger)}.tekla-changes-gate.accent{border-left-color:var(--accent)}.tekla-changes-gate.neutral{border-left-color:var(--line-strong)}
|
|
128
|
+
.tekla-changes-gate .tekla-changes-locate,.tekla-changes-gate .tekla-changes-linkbtn{align-self:flex-start;margin-top:3px}
|
|
129
|
+
.tekla-changes-finding-filters{border-bottom:0;padding:2px 7px 4px}
|
|
130
|
+
.tekla-changes-findings{padding:2px 7px 4px}
|
|
131
|
+
.tekla-changes-coverage ul{margin:2px 0 4px;padding:0 7px 0 22px;list-style:disc}.tekla-changes-coverage li{margin:3px 0}
|
|
132
|
+
.tekla-changes-finding-head{display:flex;flex-direction:column;align-items:flex-start;gap:2px}
|
|
133
|
+
.tekla-changes-finding-head>strong{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
134
|
+
.tekla-changes-finding-head>span:nth-child(2){color:var(--muted);font-size:11px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
135
|
+
.tekla-changes-finding-head[aria-expanded="true"]{border-color:var(--line-strong);border-radius:6px 6px 0 0}
|
|
136
|
+
.tekla-changes-finding-note{color:var(--muted);font-size:10.5px}
|
|
137
|
+
.tekla-changes-chip{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
138
|
+
.tekla-changes-chip.danger{border-color:var(--danger);color:var(--danger)}
|
|
139
|
+
.tekla-changes-chip.accent{border-color:var(--accent);background:var(--accent-soft);color:var(--selected-ink)}
|
|
140
|
+
.tekla-changes-finding-detail{gap:7px}
|
|
141
|
+
.tekla-changes-finding-text{margin:0;font-size:11px;line-height:1.45}.tekla-changes-finding-text.muted{color:var(--muted)}
|
|
142
|
+
.tekla-changes-finding-ask{font-size:11px;margin-top:2px}
|
|
143
|
+
.tekla-changes-finding-record{margin:0;font-size:11px;line-height:1.45}.tekla-changes-finding-record q{font-style:italic}
|
|
144
|
+
.tekla-changes-finding-meta{margin:0;color:var(--muted);font-size:10px;line-height:1.4}
|
|
145
|
+
.tekla-changes-choice-wrap{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:6px;background:var(--panel-2)}
|
|
146
|
+
.tekla-changes-choice{display:flex;flex-direction:column;align-items:flex-start;gap:1px;width:100%;min-height:36px;padding:6px 8px;border:0;border-radius:6px;text-align:left;background:transparent}
|
|
147
|
+
.tekla-changes-choice strong{font-size:11px}.tekla-changes-choice span{color:var(--muted);font-size:10px}
|
|
148
|
+
.tekla-changes-choice[aria-expanded="true"]{border-bottom:1px solid var(--line);border-radius:6px 6px 0 0}
|
|
149
|
+
.tekla-changes-choice-body{display:flex;flex-direction:column;gap:6px;padding:7px 8px 8px}
|
|
150
|
+
.tekla-changes-choice-body button.primary,.tekla-changes-gate button.primary{align-self:flex-start;min-height:28px;padding:4px 10px;border-color:var(--accent);background:var(--accent-soft);color:var(--selected-ink);font-weight:600;font-size:11px}
|
|
151
|
+
.tekla-changes-input{width:100%;box-sizing:border-box;min-height:30px;padding:5px 8px;color:var(--text);background:var(--bg);border:1px solid var(--line);border-radius:6px;font:inherit;font-size:11px}
|
|
152
|
+
.tekla-changes-input::placeholder{color:var(--muted)}
|
|
153
|
+
.tekla-changes-input:focus-visible{outline:2px solid var(--accent);outline-offset:1px;border-color:var(--accent)}
|
|
154
|
+
.tekla-changes-textarea{min-height:64px;resize:vertical;line-height:1.4}
|
|
155
|
+
.tekla-changes-count{align-self:flex-end;color:var(--muted);font-size:10px}.tekla-changes-count.limit{color:var(--danger)}
|
|
156
|
+
.tekla-changes-request{max-height:180px;overflow:auto;margin:0;padding:7px;border:1px solid var(--line);border-radius:5px;background:var(--bg);color:var(--muted);font:10px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
|
|
157
|
+
.tekla-changes-linkbtn{min-height:24px;padding:2px 0;border:0;background:transparent;color:var(--accent);font-size:11px;font-weight:600}
|
|
158
|
+
.tekla-changes-linkbtn:hover{background:transparent;text-decoration:underline}
|
|
159
|
+
.tekla-changes-cancel{min-height:26px;padding:3px 8px;font-size:11px}
|
|
160
|
+
.tekla-changes-finding-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:4px}.tekla-changes-finding-actions>span{flex:1 1 100%;color:var(--muted);font-size:10.5px}
|
|
161
|
+
.tekla-changes-gone-heading{display:block;margin:6px 2px 3px;font-size:10.5px;color:var(--muted)}
|
package/dist/web/revit-editor.js
CHANGED
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
MODEL_EXPLORER_ENTITY_CAP, MODEL_EXPLORER_GROUP_CAP, assertModelViewerRowBudget,
|
|
27
27
|
preflightModelJsonReceipt, readModelBinaryArtifact, readModelJsonArtifact, readModelJsonDocument,
|
|
28
28
|
} from './model-artifact-loader.js';
|
|
29
|
+
import { mountChangeReview } from './model-change-review.js';
|
|
29
30
|
import { createModelPanelBridge, createModelSelectionOriginGuard, createPanelHost, expandModelPanelGroup, selectModelPanelGroup, serializeModelPanelNodes } from './model-panel-bridge.js';
|
|
30
31
|
import { mountModelDisplayUnits } from './model-display-units.js';
|
|
31
32
|
import { formatModelProperty, teklaObjectFields, teklaObjectLabel, teklaPropertyGroups, teklaTypeGroups } from './model-property-display.js';
|
|
@@ -1817,11 +1818,39 @@ async function loadRevision(state, authority, spatialCandidate) {
|
|
|
1817
1818
|
const REVIT_PANEL_TABS = Object.freeze([
|
|
1818
1819
|
Object.freeze({ key: 'clips', label: 'Clips', tip: 'Clips — the planes and boxes cutting the model: select, rename, switch on or off, remove' }),
|
|
1819
1820
|
...(isTeklaParser ? [Object.freeze({ key: 'audit', label: 'Audit', tip: 'Audit — model properties, hierarchy, shape or placement that could not be fully verified' })] : []),
|
|
1821
|
+
// #3352: Change Review — what was added, removed or changed between two saved states.
|
|
1822
|
+
...(isTeklaParser ? [Object.freeze({ key: 'changes', label: 'Changes', tip: 'Changes — what was added, removed or changed between two saved states' })] : []),
|
|
1820
1823
|
]);
|
|
1821
1824
|
// Held, not looked up: once shown, the Clips tab lives in the main window's frame, where $() cannot find it.
|
|
1822
1825
|
const revitClipListHost = $('revitClipListHost');
|
|
1823
1826
|
const teklaAuditHost = $('teklaAuditHost');
|
|
1824
|
-
const
|
|
1827
|
+
const teklaChangesHost = $('teklaChangesHost');
|
|
1828
|
+
const revitPanelHost = createPanelHost({ win: window, root: $('revitPanelTabs'), bodies: { clips: revitClipListHost, ...(teklaAuditHost ? { audit: teklaAuditHost } : {}), ...(teklaChangesHost ? { changes: teklaChangesHost } : {}) }, install: installTooltips });
|
|
1829
|
+
let changeReview = null;
|
|
1830
|
+
/**
|
|
1831
|
+
* #3352: open the saved state a change-review row belongs to (any approved version or the working snapshot), then select
|
|
1832
|
+
* the object. The authority toggle shows neither button pressed while a reviewed state other than those two is shown.
|
|
1833
|
+
*/
|
|
1834
|
+
async function locateChangeReviewObject(state, { state: saved, entityId }) {
|
|
1835
|
+
if (!saved?.handle || !entityId) throw new Error('This object cannot be shown in 3D.');
|
|
1836
|
+
if (loadedRevisionId !== saved.handle.revisionId) {
|
|
1837
|
+
const host = $('authorityChoices');
|
|
1838
|
+
const key = saved.handle.revisionId === state.draft?.revisionId ? 'draft' : saved.handle.revisionId === state.approved?.revisionId ? 'approved' : 'reviewState';
|
|
1839
|
+
if (key === 'reviewState') state.reviewState = { ...saved.handle, projectUuid: state.projectUuid };
|
|
1840
|
+
let candidate = null;
|
|
1841
|
+
try {
|
|
1842
|
+
candidate = await prepareSpatialForRevision(state, state[key]);
|
|
1843
|
+
if (!await loadRevision(state, key, candidate)) return;
|
|
1844
|
+
} catch (error) {
|
|
1845
|
+
console.error(error);
|
|
1846
|
+
throw new Error(`${saved.label} couldn’t be opened in 3D. The model shown before is still shown.`);
|
|
1847
|
+
} finally { candidate?.dispose(); }
|
|
1848
|
+
host?.querySelectorAll('button').forEach((button) => button.setAttribute('aria-pressed', String(button.dataset.commandInstanceLabel === key)));
|
|
1849
|
+
toast(`Showing ${saved.label}.`, 4000);
|
|
1850
|
+
}
|
|
1851
|
+
if (!entityById.has(entityId)) throw new Error('This object is not drawn in that saved state.');
|
|
1852
|
+
selectTeklaObjects(entityId, [entityId]);
|
|
1853
|
+
}
|
|
1825
1854
|
|
|
1826
1855
|
function mountPanels() {
|
|
1827
1856
|
inspector = mountInspectorShell({ panel: $('inspectorBody'), doc: document, win: window, placement: 'docked', readOnly: true, emptyMessage: 'Select an object to see its imported properties.' });
|
|
@@ -2112,6 +2141,12 @@ async function boot() {
|
|
|
2112
2141
|
const authority = authorityButtons(state); const initialSpatial = await prepareSpatialForRevision(state, state[authority]);
|
|
2113
2142
|
try { await loadRevision(state, authority, initialSpatial); } finally { initialSpatial.dispose(); }
|
|
2114
2143
|
mountSharedModelTools();
|
|
2144
|
+
if (isTeklaParser && teklaChangesHost) {
|
|
2145
|
+
changeReview = mountChangeReview({ host: teklaChangesHost, doc: document, projectId, fetchJson: json,
|
|
2146
|
+
locate: (target) => locateChangeReviewObject(state, target),
|
|
2147
|
+
onStateChanged: () => { window.__revitInstructorState = { ...(window.__revitInstructorState || {}), changeReview: changeReview?.state() }; window.__instructor?.notifyChanged(); } });
|
|
2148
|
+
void changeReview.load();
|
|
2149
|
+
}
|
|
2115
2150
|
refreshChatLinks(false); window.addEventListener('focus', () => refreshChatLinks(false));
|
|
2116
2151
|
const releasePointerCoordinates = viewport.onPointerWorld((renderPoint) => {
|
|
2117
2152
|
lastCursorCoordinates = renderPoint && spatialTools ? spatialTools.coordinates(viewport.renderToCanonicalPoint(renderPoint)) : null;
|