@floless/app 0.174.0 → 0.175.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/autostart.mjs +117 -10
- package/dist/floless-server.cjs +2 -2
- package/dist/pdf-engine/floless_pdf/__init__.py +53 -0
- package/dist/pdf-engine/floless_pdf/backend_pdfium.py +823 -0
- package/dist/pdf-engine/floless_pdf/backend_pymupdf.py +245 -0
- package/dist/pdf-engine/floless_pdf/geometry.py +115 -0
- package/dist/pdf-engine/floless_pdf/images.py +75 -0
- package/dist/pdf-engine/floless_pdf/pages.py +136 -0
- package/dist/pdf-engine/floless_pdf/textrules.py +200 -0
- package/dist/schemas/steel.model.v2.schema.json +45 -1
- package/dist/skills/floless-app-approval/SKILL.md +28 -3
- package/dist/skills/floless-app-knowledge/SKILL.md +3 -2
- package/dist/skills/floless-app-sketches/SKILL.md +71 -0
- package/dist/skills/floless-app-sketches/references/steel-plate.md +15 -0
- package/dist/skills/floless-app-steel-model/SKILL.md +14 -1
- package/dist/skills/floless-app-steel-model/references/elements.md +90 -23
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +18 -7
- package/dist/skills/floless-app-tweak-contract/SKILL.md +3 -2
- package/dist/web/agents.js +1 -1
- package/dist/web/app.css +120 -15
- package/dist/web/app.js +89 -38
- package/dist/web/aware-hold.js +10 -0
- package/dist/web/aware.js +405 -51
- package/dist/web/boot-watchdog.js +249 -0
- package/dist/web/card-details.js +88 -0
- package/dist/web/chat.css +29 -0
- package/dist/web/chat.js +430 -128
- package/dist/web/commands-connection-design.js +23 -0
- package/dist/web/commands-revit.js +3 -0
- package/dist/web/commands-shell.js +226 -10
- package/dist/web/commands-steel.js +95 -5
- package/dist/web/commands-tekla-parser.js +21 -1
- package/dist/web/connection-design-editor.html +71 -0
- package/dist/web/connection-design-editor.js +794 -61
- package/dist/web/connection-design-handles.js +9 -3
- package/dist/web/element-approval.js +74 -0
- package/dist/web/element-context.js +76 -6
- package/dist/web/element-geometry.js +8 -2
- package/dist/web/element-holds.js +68 -5
- package/dist/web/element-type-actions.js +22 -3
- package/dist/web/element-types.js +12 -5
- package/dist/web/element-words.js +15 -11
- package/dist/web/grid-place.js +51 -0
- package/dist/web/guide.js +2 -0
- package/dist/web/index.html +13 -16
- package/dist/web/instructor.js +5 -2
- package/dist/web/missed-routines.js +6 -1
- package/dist/web/model-change-findings.js +147 -32
- package/dist/web/model-change-review.js +435 -32
- package/dist/web/model-clash-check.css +100 -0
- package/dist/web/model-clash-check.js +681 -0
- package/dist/web/model-clip-box.js +204 -0
- package/dist/web/model-clip-list.js +153 -3
- package/dist/web/model-clip-session.js +3 -3
- package/dist/web/model-clip-three-overlay.js +135 -25
- package/dist/web/model-editor.css +2 -0
- package/dist/web/model-elements.js +273 -18
- package/dist/web/model-fit-checks.js +354 -0
- package/dist/web/model-spatial-panel.js +9 -3
- package/dist/web/model-spatial-tools.js +12 -3
- package/dist/web/model-tekla-selection.js +74 -0
- package/dist/web/model-view-query.js +70 -14
- package/dist/web/model-viewport-revit-adapter.js +8 -7
- package/dist/web/model-viewport-toolbar.js +8 -4
- package/dist/web/pages.js +78 -1
- package/dist/web/project-history.js +31 -1
- package/dist/web/revit-editor.css +34 -1
- package/dist/web/revit-editor.js +176 -55
- package/dist/web/run-history.js +8 -0
- package/dist/web/sketch-editor.js +141 -2
- package/dist/web/sketches.js +192 -6
- package/dist/web/start-place.js +46 -0
- package/dist/web/steel-3d-core.js +70 -0
- package/dist/web/steel-3d-view.js +288 -47
- package/dist/web/steel-change-review.css +29 -0
- package/dist/web/steel-custom-connection.js +6 -0
- package/dist/web/steel-editor.html +532 -33
- package/dist/web/steel-filter.html +8 -3
- package/dist/web/steel-model-checks.css +76 -0
- package/dist/web/steel-model-commands.js +1 -1
- package/dist/web/steel-model-v2-commands.js +17 -0
- package/dist/web/steel-view-generation.js +6 -2
- package/dist/web/teams.js +259 -19
- package/dist/web/tekla-editor.html +1 -0
- package/dist/web/terminal-requests.js +6 -0
- package/dist/web/vendor/connection-engine.js +890 -89
- package/dist/web/workspaces.js +630 -48
- package/package.json +4 -1
- package/preferences-file.mjs +27 -0
package/dist/web/index.html
CHANGED
|
@@ -9,17 +9,8 @@
|
|
|
9
9
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg?v=2" />
|
|
10
10
|
<link rel="icon" type="image/x-icon" href="/favicon.ico?v=2" />
|
|
11
11
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=2" />
|
|
12
|
-
<script>
|
|
13
|
-
|
|
14
|
-
// workflow pane cannot flash while the workspace shell and Revit frame are still starting.
|
|
15
|
-
try {
|
|
16
|
-
const savedMode = localStorage.getItem('floless:mode');
|
|
17
|
-
if (savedMode === 'workspaces') document.documentElement.classList.add('mode-workspaces-boot');
|
|
18
|
-
// #2007: Agents has no workflow canvas or Inspector either; same reason, same early class.
|
|
19
|
-
if (savedMode === 'agents') document.documentElement.classList.add('mode-agents-boot');
|
|
20
|
-
}
|
|
21
|
-
catch { /* private or locked-down storage falls back to the normal boot path */ }
|
|
22
|
-
</script>
|
|
12
|
+
<script src="start-place.js"></script>
|
|
13
|
+
<script src="boot-watchdog.js"></script>
|
|
23
14
|
<link rel="stylesheet" href="app.css">
|
|
24
15
|
<link rel="stylesheet" href="chat.css">
|
|
25
16
|
<!-- The FloLess window (Electron shell): puts `desktop` on <html> before first paint when the shell's bridge is present. -->
|
|
@@ -51,9 +42,7 @@
|
|
|
51
42
|
canvas + Run). Segmented control, Ctrl+1/Ctrl+2 — the shortcuts follow POSITION, so
|
|
52
43
|
they swap with the tabs (#623). See docs/superpowers/specs/
|
|
53
44
|
2026-07-03-workspaces-two-mode-shell-design.md.
|
|
54
|
-
|
|
55
|
-
OPENS in is unchanged — that is the remembered `floless:mode`, defaulting to
|
|
56
|
-
Workflows. -->
|
|
45
|
+
A fresh window opens the Workspaces landing. A restarted window can resume from its URL. -->
|
|
57
46
|
<div class="mode-switch" id="mode-switch" role="tablist" aria-label="Mode">
|
|
58
47
|
<!-- Each tab carries its part's icon in its part's colour, the same drawings Flo builds on the chat's
|
|
59
48
|
start screens (web/chat-landing-scene.js): stacked sheets, joined steps, Flo in its hard hat. -->
|
|
@@ -485,7 +474,8 @@
|
|
|
485
474
|
<div class="ws-source-title" tabindex="-1">This project's source drawing</div>
|
|
486
475
|
<div class="ws-source-sub">The lines on the Traced tab were read from the drawing you imported. Use “Attach revised drawings…” above to re-trace a newer one as a new version.</div>
|
|
487
476
|
<!-- #1754: when the import of the Revit model on screen left out an element with no Revit id, or FloLess
|
|
488
|
-
could not check, it says so here (paintRevitLeftOut in workspaces.js)
|
|
477
|
+
could not check, it says so here (paintRevitLeftOut in workspaces.js); #4008: so does a Tekla model read
|
|
478
|
+
with its properties only, because nothing in it can be drawn yet. It sits inside the pane's own
|
|
489
479
|
live region, so it has no role of its own. -->
|
|
490
480
|
<div class="ws-source-note" id="ws-source-note" hidden>
|
|
491
481
|
<p class="ws-source-note-lead"></p>
|
|
@@ -1113,6 +1103,11 @@
|
|
|
1113
1103
|
<input type="checkbox" id="startup-toggle" role="switch">
|
|
1114
1104
|
<span class="rtn-toggle-track"></span>
|
|
1115
1105
|
</label>
|
|
1106
|
+
<span id="startup-status" role="status" tabindex="-1" hidden>Status unknown</span>
|
|
1107
|
+
<div class="theme-toggle startup-choices" id="startup-choices" role="group" aria-label="Start with Windows" aria-describedby="startup-status" hidden>
|
|
1108
|
+
<button type="button" class="startup-btn" id="startup-on" data-command-id="shell.startup-on" data-tip="Start FloLess when you sign in to Windows">Turn on</button>
|
|
1109
|
+
<button type="button" class="startup-btn" id="startup-off" data-command-id="shell.startup-off" data-tip="Keep FloLess from starting when you sign in to Windows">Turn off</button>
|
|
1110
|
+
</div>
|
|
1116
1111
|
</div>
|
|
1117
1112
|
<!-- The FloLess window (web/desktop-window.js): where FloLess opens next time, and whether it stays in the tray. Both are shared
|
|
1118
1113
|
preferences (web/shared-prefs.js). "Open FloLess in" shows once the window is installed (always inside it); the tray switch
|
|
@@ -2107,7 +2102,7 @@
|
|
|
2107
2102
|
<div class="modal-title">Routines</div>
|
|
2108
2103
|
<div class="modal-sub">Run a workflow automatically — on a schedule, or on a live trigger (e.g. whenever your model changes) — exactly like clicking ▶ Run workflow. Or start an agent on a schedule: nobody watches that run, so anything that would ask you is declined and listed for you on the Agents page.</div>
|
|
2109
2104
|
<!-- #2062: never read as always-on. The link shows only where the start-on-login setting exists (app.js). -->
|
|
2110
|
-
<p class="rtn-local-note" id="rtn-local-note">Routines run only while FloLess is running on this computer. A run that falls while it is closed is noted as missed, and FloLess asks you once whether to run it when it starts again. <button type="button" class="rtn-link" id="rtn-startup-link" data-start-on-login-link data-command-id="shell.routines-start-on-login" data-tip="Closes Routines and shows the Start with Windows
|
|
2105
|
+
<p class="rtn-local-note" id="rtn-local-note">Routines run only while FloLess is running on this computer. A run that falls while it is closed is noted as missed, and FloLess asks you once whether to run it when it starts again. <button type="button" class="rtn-link" id="rtn-startup-link" data-start-on-login-link data-command-id="shell.routines-start-on-login" data-tip="Closes Routines and shows the Start with Windows setting in the menu" hidden>Start FloLess when you sign in…</button></p>
|
|
2111
2106
|
<!-- Owner ruling 2026-11-06: what still waits on the missed-runs card (missed-routines.js); Review shows it again. -->
|
|
2112
2107
|
<p class="rtn-missed-note" id="rtn-missed-note" role="status" hidden><span id="rtn-missed-text"></span> <button type="button" class="rtn-link" id="rtn-missed-review" data-command-id="shell.missed-routines-review" data-tip="Closes Routines and shows the card that asks whether to run them now">Review…</button></p>
|
|
2113
2108
|
<div class="rtn-quota" id="rtn-quota"></div>
|
|
@@ -2404,6 +2399,7 @@
|
|
|
2404
2399
|
<div class="add-ons-body">
|
|
2405
2400
|
<div class="add-ons-side">
|
|
2406
2401
|
<div id="sketches-list" class="add-ons-list" aria-label="Sketches"></div>
|
|
2402
|
+
<div id="sketches-converted" class="sketches-converted" hidden></div>
|
|
2407
2403
|
</div>
|
|
2408
2404
|
<div id="sketches-detail" class="add-ons-detail" aria-live="polite"></div>
|
|
2409
2405
|
</div>
|
|
@@ -2488,6 +2484,7 @@
|
|
|
2488
2484
|
<script src="left-pane.js"></script>
|
|
2489
2485
|
<script src="chat-question-card.js"></script>
|
|
2490
2486
|
<script src="card-acknowledgements.js"></script>
|
|
2487
|
+
<script src="card-details.js"></script>
|
|
2491
2488
|
<script src="pdf-reading-note.js"></script>
|
|
2492
2489
|
<script src="pdf-reader-card.js"></script>
|
|
2493
2490
|
<script src="chat.js"></script>
|
package/dist/web/instructor.js
CHANGED
|
@@ -944,8 +944,8 @@
|
|
|
944
944
|
render time from what is actually on screen (see onScreen/sheetEntries) —
|
|
945
945
|
a static array cannot express that, because "active" is runtime state. */
|
|
946
946
|
var GROUP_ORDER = [
|
|
947
|
-
// the shell
|
|
948
|
-
'In the header', 'In the workflow picker', 'In the project picker', 'In the project list',
|
|
947
|
+
// the shell; the startup recovery card covers the whole window when a start stalls, so it comes first
|
|
948
|
+
'On the startup recovery card', 'In the header', 'In the workflow picker', 'In the project picker', 'In the project list',
|
|
949
949
|
// #2732: the warning that Export in the project list opens for a project too big for one archive.
|
|
950
950
|
'In the project export warning',
|
|
951
951
|
// #2866: Sort by sits in the header of the Workspaces, Workflows and Agents pages.
|
|
@@ -991,6 +991,7 @@
|
|
|
991
991
|
rows under one heading, which is a scroll rather than a list. */
|
|
992
992
|
'In the steel editor header', 'On the steel canvas', 'On the drawing canvas', 'In the Copy panel', 'In the Copy array panel', 'In the 2D view toolbar',
|
|
993
993
|
'In the 3D toolbar',
|
|
994
|
+
'In the Clips list', // the steel 3D view's clip list: a clip box's angle fields and Reset rotation
|
|
994
995
|
// #3643: the Sketch mode band across the 3D view, then the size chip by the shape being drawn.
|
|
995
996
|
'In the 3D model band', 'In the sketch corner chip',
|
|
996
997
|
'In the label menus', 'On the select bar', 'On the snap bar',
|
|
@@ -1007,6 +1008,8 @@
|
|
|
1007
1008
|
'In the Connections dialog', 'In the Frames dialog', 'In the reference-model dialogs', 'In the connection-import dialog',
|
|
1008
1009
|
'In the confidence report', 'In the Ask AI panel', 'In the Ask AI dialog', 'In the Favourites dialog',
|
|
1009
1010
|
'In the Review changes panel', // #3537: the drawer beside the steel model, opened from the ⋯ menu
|
|
1011
|
+
'In the Check for clashes dialog', 'In the Clashes panel', // #4029: the clash check settings dialog and its result drawer
|
|
1012
|
+
'In the Model checks panel', // #3690 E1d: the fit drawer beside the steel model, opened from the ⋯ menu (Model checks)
|
|
1010
1013
|
// the read-only Revit model editor
|
|
1011
1014
|
'In the Revit model header', 'In the Revit model toolbar', 'In the Revit Saved views panel', 'In the Revit model coordinate HUD', 'In the Revit model selection bar', 'In the Revit model snapping bar', 'In the Revit spatial controls',
|
|
1012
1015
|
'In the Tekla Parser header', 'In the Tekla Parser hierarchy', 'In the Tekla Parser model toolbar', 'In the Tekla Parser Saved views panel', 'In the Tekla Parser coordinate HUD', 'In the Tekla Parser selection bar', 'In the Tekla Parser snapping bar', 'In the Tekla Parser spatial controls', 'In the Tekla Parser Audit pane', 'In the Tekla Parser Changes pane',
|
|
@@ -190,12 +190,17 @@
|
|
|
190
190
|
state.answered.add(o.offerId);
|
|
191
191
|
try {
|
|
192
192
|
if (kind === 'run') {
|
|
193
|
-
|
|
193
|
+
// #2470 R6.8 slice 4 (review R3): through the page's ask helper, so a run's own questions (Teams channel reading,
|
|
194
|
+
// another FloLess) are asked here as on Run now, and a Run anyway is sent with the question id.
|
|
195
|
+
await ctx.postRun(`/api/routines/${encodeURIComponent(o.routineId)}/run`, { missedOfferId: o.offerId }, o.routineId);
|
|
194
196
|
} else {
|
|
195
197
|
await ctx.api(`/api/routines/${encodeURIComponent(o.routineId)}/missed-offer/skip`, { method: 'POST', body: JSON.stringify({ expectedOfferId: o.offerId }) });
|
|
196
198
|
}
|
|
197
199
|
done.push(o.name);
|
|
198
200
|
} catch (error) {
|
|
201
|
+
// The person cancelled one of the run's questions: nothing ran, and the question stays for when they are ready. Keyed
|
|
202
|
+
// on the ask helper's own flag: any other not-run answer (FloLess closing, say) is the server's, and is said (review R4 #2).
|
|
203
|
+
if (error?.body?.elsewhereStopped) { state.answered.delete(o.offerId); continue; }
|
|
199
204
|
if (error?.body?.running) alreadyRunning.push(o.name);
|
|
200
205
|
else if (error?.body?.code === 'no-missed-offer') gone.push(o.name);
|
|
201
206
|
else { state.answered.delete(o.offerId); ctx.reportErr(error, kind === 'run' ? `run “${o.name}”` : `skip “${o.name}”`); }
|
|
@@ -62,6 +62,8 @@ const CLASH_REASON = {
|
|
|
62
62
|
'ply-not-in-group': 'the part is no longer bolted by that bolt group',
|
|
63
63
|
'stack-still-split': 'the bolt stack is still split',
|
|
64
64
|
'bolt-head-size-assumed': 'the bolt head size is assumed, because the bolt catalogue gives none',
|
|
65
|
+
'plane-cut-side-assumed': 'which side its plane cuts remove is assumed, because the Tekla version that saved it doesn’t record it',
|
|
66
|
+
'cut-sliver-uncleaned': 'it is drawn as computed, but a sliver a cut left could not be cleaned',
|
|
65
67
|
interpenetrates: 'they pass into each other, but the overlap check did not run',
|
|
66
68
|
'rule-not-applicable-in-base': 'the check did not apply to them in the earlier saved state',
|
|
67
69
|
};
|
|
@@ -147,7 +149,7 @@ const WORDS = {
|
|
|
147
149
|
stateGone: 'That saved state is no longer part of this project, so this object cannot be shown in 3D.',
|
|
148
150
|
notOpened: 'The 3D view did not finish opening that saved state, so nothing is shown yet. Try again.',
|
|
149
151
|
notDrawn: 'is not drawn in that saved state, so it is not shown.',
|
|
150
|
-
locateFailed: () => 'That saved state could not be opened in 3D. Open the Model tab and try again.',
|
|
152
|
+
locateFailed: (error) => (typeof error?.said === 'string' && error.said ? error.said : 'That saved state could not be opened in 3D. Open the Model tab and try again.'),
|
|
151
153
|
fixRecorded: (chat) => `${chat ? 'AI Chat recorded that this will be fixed in Tekla' : 'You said you’d fix this in Tekla'}`,
|
|
152
154
|
fixCheck: 'To check it, save in Tekla, import the model folder again and compare with the same earlier saved state.',
|
|
153
155
|
newerState: 'Decided while the model had a newer saved state than the one reviewed.',
|
|
@@ -160,9 +162,9 @@ const WORDS = {
|
|
|
160
162
|
},
|
|
161
163
|
steel: {
|
|
162
164
|
fixing: 'Being fixed in the model',
|
|
163
|
-
// A steel review
|
|
165
|
+
// A steel review made before the steel clash check (#3550) compared and matched only.
|
|
164
166
|
noChecksTitle: 'This review compares the two versions only',
|
|
165
|
-
noChecks: '
|
|
167
|
+
noChecks: 'It was made before FloLess checked the steel model for clash. Compare the versions again to run the check.',
|
|
166
168
|
fixPending: (n) => `${n} being fixed in the model`,
|
|
167
169
|
nextFix: 'Fix them in the model, then compare the same earlier version with the current draft to check them.',
|
|
168
170
|
movedOn: ['The model has changed since this review', 'Decisions here apply to the versions this review compared, not the model as it is now. Compare again to check the latest.'],
|
|
@@ -184,10 +186,30 @@ const WORDS = {
|
|
|
184
186
|
},
|
|
185
187
|
};
|
|
186
188
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
189
|
+
/**
|
|
190
|
+
* `endpoints`, `words`, `items` and `locateView` let another panel reuse the finding cards over its own routes (#4029, the
|
|
191
|
+
* clash check of the current model): `endpoints.load(id)` is the path a load reads and `endpoints.act(id, name)` the
|
|
192
|
+
* path a decision posts to (`name` is `decisions`, `accept` or `withdraw`); `words` replaces any of the source's words;
|
|
193
|
+
* `items(reply)` reads the list of findings from a loaded reply; `locateView(view)` shows one in 3D and resolves the
|
|
194
|
+
* sentence to announce. Left out, a review's own routes, words and Show in 3D apply, exactly as before.
|
|
195
|
+
*/
|
|
196
|
+
export function createFindings({ doc, el, api, projectId, live, locate, sideState, parseEntity = null, rerender, focusCompare, clipboard = null, source = 'tekla', zones = () => [],
|
|
197
|
+
locateSays = (text) => { live.textContent = text; }, shownNow = () => {},
|
|
198
|
+
cid = (name) => `tekla-parser.change-review-${name}`, endpoints = null, words = null, items = null, locateView = null }) {
|
|
199
|
+
const W = words ? { ...(WORDS[source] || WORDS.tekla), ...words } : (WORDS[source] || WORDS.tekla);
|
|
190
200
|
const steel = source === 'steel';
|
|
201
|
+
/**
|
|
202
|
+
* What a finding calls one of its objects, in the card title's words (#4018). A steel member has no name of its own: it
|
|
203
|
+
* reads as its kind and its own id ("Beam B3"), the first in a pair capitalised and the next one not ("beam T1").
|
|
204
|
+
*/
|
|
205
|
+
const called = (p, index = 0) => {
|
|
206
|
+
if (typeof p?.name === 'string' && p.name.trim()) return p.name;
|
|
207
|
+
const parsed = steel && parseEntity ? parseEntity(p?.entityIdRevised ?? p?.entityIdBase) : null;
|
|
208
|
+
if (!parsed) return named(p);
|
|
209
|
+
const kind = p?.type || 'Object';
|
|
210
|
+
return `${index ? kind.charAt(0).toLowerCase() + kind.slice(1) : kind} ${parsed.id}`;
|
|
211
|
+
};
|
|
212
|
+
const calledAll = (list) => list.map((p, index) => called(p, index)).join(' and ');
|
|
191
213
|
const copyText = (text) => (clipboard ? clipboard(text) : doc.defaultView.navigator.clipboard.writeText(text));
|
|
192
214
|
let data = null;
|
|
193
215
|
let reviewId = null;
|
|
@@ -220,7 +242,7 @@ export function createFindings({ doc, el, api, projectId, live, locate, sideStat
|
|
|
220
242
|
const id = review?.reviewId ?? null;
|
|
221
243
|
reviewId = id; data = null; failed = null; loading = Boolean(id);
|
|
222
244
|
if (!id) return true;
|
|
223
|
-
const path = `${base()}/findings`;
|
|
245
|
+
const path = endpoints ? endpoints.load(id) : `${base()}/findings`;
|
|
224
246
|
// A reply for a load that is no longer the latest is dropped, error or not.
|
|
225
247
|
try { const reply = await api(path); if (g === gen) data = reply; }
|
|
226
248
|
catch (error) { if (g === gen) failed = error?.body?.userMessage || W.findingsFailed; }
|
|
@@ -228,7 +250,7 @@ export function createFindings({ doc, el, api, projectId, live, locate, sideStat
|
|
|
228
250
|
return g === gen;
|
|
229
251
|
}
|
|
230
252
|
|
|
231
|
-
function views() { return data?.view?.findings ?? []; }
|
|
253
|
+
function views() { return (items ? items(data) : data?.view?.findings) ?? []; }
|
|
232
254
|
|
|
233
255
|
function counts() {
|
|
234
256
|
const out = {};
|
|
@@ -246,7 +268,7 @@ export function createFindings({ doc, el, api, projectId, live, locate, sideStat
|
|
|
246
268
|
if (busy || !current(shown)) return;
|
|
247
269
|
busy = true;
|
|
248
270
|
try {
|
|
249
|
-
const url = path.startsWith('/') ? path : `${project()}/reviews/${shown.reviewId}/${path}`;
|
|
271
|
+
const url = path.startsWith('/') ? path : endpoints ? endpoints.act(shown.reviewId, path) : `${project()}/reviews/${shown.reviewId}/${path}`;
|
|
250
272
|
const reply = await api(url, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) });
|
|
251
273
|
// If the person opened a review meanwhile (even this one again), nothing about this decision is said or shown over it.
|
|
252
274
|
if (shown.gen !== gen) return;
|
|
@@ -254,11 +276,11 @@ export function createFindings({ doc, el, api, projectId, live, locate, sideStat
|
|
|
254
276
|
const left = counts().decide;
|
|
255
277
|
const text = typeof said === 'function' ? said(reply) : said;
|
|
256
278
|
live.textContent = failed
|
|
257
|
-
? `${text} The findings could not be shown again: reload the review to see where they stand
|
|
279
|
+
? `${text} ${W.reloadFailed || 'The findings could not be shown again: reload the review to see where they stand.'}`
|
|
258
280
|
: typeof said === 'function' ? text : `${text}${left ? ` ${plural(left, 'finding')} still ${left === 1 ? 'needs' : 'need'} a decision.` : ''}`;
|
|
259
281
|
if (key) { openKey = key; delete openChoice[key]; focusAfter = key; }
|
|
260
282
|
} catch (error) {
|
|
261
|
-
if (shown.gen === gen) live.textContent = error?.body?.userMessage || 'That could not be recorded. Reload the review and try again.';
|
|
283
|
+
if (shown.gen === gen) live.textContent = error?.body?.userMessage || W.recordFailed || 'That could not be recorded. Reload the review and try again.';
|
|
262
284
|
} finally { busy = false; rerender(); }
|
|
263
285
|
}
|
|
264
286
|
|
|
@@ -272,9 +294,9 @@ export function createFindings({ doc, el, api, projectId, live, locate, sideStat
|
|
|
272
294
|
if (failed) return [banner('danger', true, 'The findings could not be opened', failed)];
|
|
273
295
|
const checks = data?.checks ?? null;
|
|
274
296
|
if (!checks) {
|
|
275
|
-
// A review with no checks (
|
|
276
|
-
|
|
277
|
-
|
|
297
|
+
// A review with no checks (made before its source was checked) still says what became of the firm's standards:
|
|
298
|
+
// never a silent gap.
|
|
299
|
+
return [banner('neutral', false, W.noChecksTitle || 'No checks were run on this review', W.noChecks),
|
|
278
300
|
...standardsBanners(data?.standards)];
|
|
279
301
|
}
|
|
280
302
|
if (checks.state === 'not-run') return [banner('neutral', false, 'No checks were run on this review', NOT_RUN[checks.reason] || NOT_RUN['check-failed'])];
|
|
@@ -310,7 +332,11 @@ export function createFindings({ doc, el, api, projectId, live, locate, sideStat
|
|
|
310
332
|
out.push(banner('accent', false, parts.join(', '), `${next}${fromChat ? ` ${plural(fromChat, 'of these decisions was', 'of these decisions were')} recorded from AI Chat, not by you.` : ''}`));
|
|
311
333
|
} else if (g.kind === 'proceeds-on-assumptions') out.push(banner('neutral', false, `Proceeds on ${plural(g.count, 'stated assumption')}`, 'Each assumption is recorded with the finding below.'));
|
|
312
334
|
// S3: the clash banner is one pure function (clashGate, below); with any clash limit it replaces "No open findings".
|
|
313
|
-
|
|
335
|
+
// A steel review says what its clash check covered in the server's own sentence, shown as it is: never a general
|
|
336
|
+
// "no clash" line, and never the Tekla banner's words (S6, #3550).
|
|
337
|
+
const statement = steel && typeof data.clashStatement?.line === 'string' ? data.clashStatement : null;
|
|
338
|
+
const clashBanner = statement ? { title: 'What the clash check covered', detail: statement.line }
|
|
339
|
+
: clashGate({ clashState: data.clashState, clash: data.clash, noFindings: g.kind === 'no-open-findings' });
|
|
314
340
|
const outcomes = data.ruleOutcomes || [];
|
|
315
341
|
// "Some objects could not be checked" is true of any check that could not judge some of its objects: one that found
|
|
316
342
|
// nothing in the rest (partial) and one that found problems in the rest alike. A check with nothing to check, or one
|
|
@@ -367,34 +393,46 @@ export function createFindings({ doc, el, api, projectId, live, locate, sideStat
|
|
|
367
393
|
|
|
368
394
|
function showButton(view) {
|
|
369
395
|
const forReview = renderingFor;
|
|
396
|
+
if (locateView) {
|
|
397
|
+
// The panel's own Show in 3D (the clash check's typed locator): it says what it showed, this announces it.
|
|
398
|
+
const both = (view.locate?.ids?.length ?? 0) > 1;
|
|
399
|
+
return button({ class: 'tekla-changes-locate', 'data-command-id': both ? cid('finding-locate-both') : cid('finding-locate'), 'aria-label': `${both ? 'Show both in 3D' : 'Show in 3D'}: ${view.words.title}` },
|
|
400
|
+
both ? 'Show both in 3D' : 'Show in 3D', async () => {
|
|
401
|
+
if (!current(forReview)) return;
|
|
402
|
+
let said = null;
|
|
403
|
+
try { said = await locateView(view); }
|
|
404
|
+
catch (error) { console.warn('[change-review] Show in 3D failed:', error); said = W.locateFailed(error); }
|
|
405
|
+
if (forReview.gen === gen && typeof said === 'string' && said) locateSays(said);
|
|
406
|
+
});
|
|
407
|
+
}
|
|
370
408
|
const all = view.finding.participants;
|
|
371
409
|
// A pair is shown together (S3); a part with nothing drawn (a bolt group) is left out and the line says so.
|
|
372
410
|
const drawn = all.filter((p) => p?.entityIdRevised && !(all.length > 1 && BOLT_TYPES.has(p.type) && view.finding.ruleId === 'clash.bolted-plies-apart'));
|
|
373
411
|
const p = drawn[0] ?? all[0];
|
|
374
412
|
const both = drawn.length > 1;
|
|
375
|
-
const
|
|
376
|
-
const label = both ? `Show ${names} in 3D` : `Show ${p?.name || p?.type || 'the object'} in 3D`;
|
|
413
|
+
const label = both ? `Show ${calledAll(drawn)} in 3D` : `Show ${steel && p ? called(p) : p?.name || p?.type || 'the object'} in 3D`;
|
|
377
414
|
return button({ class: 'tekla-changes-locate', 'data-command-id': both ? cid('finding-locate-both') : cid('finding-locate'), 'aria-label': label },
|
|
378
415
|
both ? 'Show both in 3D' : 'Show in 3D', async () => {
|
|
379
416
|
if (!current(forReview)) return;
|
|
380
417
|
const state = sideState('revised');
|
|
381
|
-
if ((!state && !steel) || !p?.entityIdRevised) {
|
|
418
|
+
if ((!state && !steel) || !p?.entityIdRevised) { locateSays(W.stateGone); return; }
|
|
382
419
|
try {
|
|
383
420
|
const selected = await locate({ state, entityId: p.entityIdRevised, entityIds: drawn.map((q) => q.entityIdRevised) });
|
|
384
421
|
// Announce only what the 3D view really selected: a part not drawn in that saved state is named as left out.
|
|
385
422
|
const shownIds = Array.isArray(selected) ? selected : [];
|
|
386
423
|
const shown = drawn.filter((q) => shownIds.includes(q.entityIdRevised));
|
|
387
424
|
const missing = all.filter((q) => !shown.includes(q));
|
|
425
|
+
if (forReview.gen === gen && shown.length) shownNow();
|
|
388
426
|
if (forReview.gen === gen && all.length > 1) {
|
|
389
|
-
|
|
390
|
-
: shown.length > 1 ? `Showing ${shown
|
|
391
|
-
: !drawn.includes(missing[0]) && BOLT_TYPES.has(missing[0]?.type) ? `Showing ${
|
|
392
|
-
: `Showing ${
|
|
427
|
+
locateSays(!shown.length ? W.notOpened
|
|
428
|
+
: shown.length > 1 ? `Showing ${calledAll(shown)} in 3D.`
|
|
429
|
+
: !drawn.includes(missing[0]) && BOLT_TYPES.has(missing[0]?.type) ? `Showing ${called(p)} in 3D. The bolt group has no solid of its own, so only the part is shown.`
|
|
430
|
+
: `Showing ${called(shown[0] ?? p)} in 3D. ${calledAll(missing)} ${W.notDrawn}`);
|
|
393
431
|
}
|
|
394
432
|
}
|
|
395
433
|
catch (error) {
|
|
396
434
|
console.warn('[change-review] Show in 3D failed:', error);
|
|
397
|
-
if (forReview.gen === gen)
|
|
435
|
+
if (forReview.gen === gen) locateSays(W.locateFailed(error));
|
|
398
436
|
}
|
|
399
437
|
});
|
|
400
438
|
}
|
|
@@ -407,9 +445,14 @@ export function createFindings({ doc, el, api, projectId, live, locate, sideStat
|
|
|
407
445
|
() => act(forReview, 'withdraw', { decisionId: d.decisionId }, `${label === 'Undo' ? 'Undone' : 'Withdrawn'}. “${view.words.title}” needs a decision again.`, key));
|
|
408
446
|
const lines = [];
|
|
409
447
|
if (d.kind === 'fix') lines.push(el(doc, 'p', { class: 'tekla-changes-finding-record', text: `${W.fixRecorded(viaChat(d))} (${who(d)}, ${day(d.at)}). ${W.fixCheck}` }), withdraw('Undo'));
|
|
410
|
-
if (d.kind === 'rfi') lines.push(el(doc, 'p', { class: 'tekla-changes-finding-record', text:
|
|
448
|
+
if (d.kind === 'rfi') lines.push(el(doc, 'p', { class: 'tekla-changes-finding-record', text: `${/^rfi\b/i.test(d.rfiReference) ? '' : 'RFI '}${d.rfiReference} raised (${who(d)}, ${day(d.at)}).` }), withdraw('Withdraw'));
|
|
411
449
|
if (d.kind === 'accept') lines.push(el(doc, 'p', { class: 'tekla-changes-finding-record' }, el(doc, 'span', { text: 'Going ahead on this assumption: ' }), el(doc, 'q', { text: d.assumption })),
|
|
412
|
-
el(doc, 'p', { class: 'tekla-changes-finding-meta', text: `Recorded by you, ${day(d.at)}. The review now says it proceeds on this assumption
|
|
450
|
+
el(doc, 'p', { class: 'tekla-changes-finding-meta', text: `Recorded by you, ${day(d.at)}. ${W.acceptRecorded || 'The review now says it proceeds on this assumption.'}` }),
|
|
451
|
+
// #4029: a clash acceptance made under other settings names them, so the person sees what they accepted under.
|
|
452
|
+
// Change Review items carry no `decidedUnder`, so their cards are unchanged.
|
|
453
|
+
...(view.decidedUnder?.sameSettings === false && typeof view.decidedUnder.settingsLine === 'string' && view.decidedUnder.settingsLine
|
|
454
|
+
? [el(doc, 'p', { class: 'tekla-changes-finding-meta ccx-decided-under', text: `Accepted under: ${view.decidedUnder.settingsLine}` })] : []),
|
|
455
|
+
withdraw('Withdraw'));
|
|
413
456
|
if (d.live?.matchesReviewed === 'different') lines.push(el(doc, 'p', { class: 'tekla-changes-finding-meta', text: W.newerState }));
|
|
414
457
|
return lines;
|
|
415
458
|
}
|
|
@@ -424,7 +467,7 @@ export function createFindings({ doc, el, api, projectId, live, locate, sideStat
|
|
|
424
467
|
el(doc, 'p', { class: 'tekla-changes-finding-text', text: words.fix }),
|
|
425
468
|
button({ class: 'primary', 'data-command-id': cid('finding-fix-record') }, W.fixButton,
|
|
426
469
|
() => act(forReview, 'decisions', { correspondenceKey: key, evidenceFingerprint: f.evidenceFingerprint, kind: 'fix' }, W.fixSaid(words.title), key)),
|
|
427
|
-
el(doc, 'p', { class: 'tekla-changes-finding-meta', text: 'This records that you are fixing it; only a later review can show it fixed.' }),
|
|
470
|
+
el(doc, 'p', { class: 'tekla-changes-finding-meta', text: W.fixMeta || 'This records that you are fixing it; only a later review can show it fixed.' }),
|
|
428
471
|
]),
|
|
429
472
|
choice(key, 'rfi', 'Raise an RFI', 'Ask the design team, then record the RFI number here.', () => {
|
|
430
473
|
const ref = drafts.rfi[key] ?? '';
|
|
@@ -485,7 +528,7 @@ export function createFindings({ doc, el, api, projectId, live, locate, sideStat
|
|
|
485
528
|
paint();
|
|
486
529
|
return [
|
|
487
530
|
el(doc, 'label', { class: 'tekla-changes-picker-label', for: areaId, text: 'What are you assuming?' }), area, countEl,
|
|
488
|
-
el(doc, 'p', { class: 'tekla-changes-finding-meta', text: 'This is written into the review as your assumption, with your name and the time.' }), slot,
|
|
531
|
+
el(doc, 'p', { class: 'tekla-changes-finding-meta', text: W.acceptMeta || 'This is written into the review as your assumption, with your name and the time.' }), slot,
|
|
489
532
|
];
|
|
490
533
|
}),
|
|
491
534
|
];
|
|
@@ -504,11 +547,12 @@ export function createFindings({ doc, el, api, projectId, live, locate, sideStat
|
|
|
504
547
|
if (openKey && openKey !== key && (drafts.assumption[openKey] || drafts.rfi[openKey])) { openKey = key; rerender(); return; }
|
|
505
548
|
openKey = open ? null : key; focusAfter = key; rerender();
|
|
506
549
|
});
|
|
507
|
-
const line = view.words.line || objectLine(f);
|
|
550
|
+
const line = view.words.line || (steel ? calledAll(f.participants) : objectLine(f));
|
|
508
551
|
head.append(el(doc, 'strong', { text: view.words.title, 'data-tip': view.words.title }), el(doc, 'span', { text: line, 'data-tip': line }),
|
|
509
552
|
...(view.note ? [el(doc, 'span', { class: 'tekla-changes-finding-note', text: `• ${NOTE[view.note]}` })] : []),
|
|
510
553
|
el(doc, 'span', { class: 'tekla-changes-chips' }, chip(statusText, status.tone, statusText),
|
|
511
|
-
|
|
554
|
+
// A check of one model has nothing to be new against: `words.presenceChip: false` leaves the chip out.
|
|
555
|
+
W.presenceChip === false ? null : chip(f.presence === 'introduced' ? 'New in this change' : f.presence === 'unknown' ? 'Not known if new' : W.alreadyThere, 'neutral',
|
|
512
556
|
f.presence === 'unknown' ? (view.presenceNote && String(f.ruleId).startsWith('firm.') ? view.presenceNote : W.presenceUnknown) : undefined),
|
|
513
557
|
...(f.evidence?.approximate === true ? [chip('Approximate geometry', 'neutral', 'One of these parts is not drawn exactly (for example, its cuts or holes were not applied or its bolt head size is assumed), so the measurement may differ from the real part.')] : [])));
|
|
514
558
|
const detail = open ? el(doc, 'div', { class: 'tekla-changes-detail tekla-changes-finding-detail', id: detailId },
|
|
@@ -543,7 +587,7 @@ export function createFindings({ doc, el, api, projectId, live, locate, sideStat
|
|
|
543
587
|
section.append(el(doc, 'div', { class: 'tekla-changes-unpaired' },
|
|
544
588
|
// A pair's title already names both parts as they were; a one-object finding names its object.
|
|
545
589
|
el(doc, 'strong', { text: `${transition === 'not-rechecked' ? 'Not checked again: ' : ''}${entry.words.title}${entry.participants.length > 1 ? '' : ` — ${wasLine(entry)}`}` }),
|
|
546
|
-
transition === 'not-rechecked' ? el(doc, 'span', { text: W.say(NOT_RECHECKED[entry.reason] || NOT_RECHECKED['not-evaluated']) }) : null));
|
|
590
|
+
transition === 'not-rechecked' ? el(doc, 'span', { text: entry.note ? entry.note : W.say(NOT_RECHECKED[entry.reason] || NOT_RECHECKED['not-evaluated']) }) : null));
|
|
547
591
|
}
|
|
548
592
|
}
|
|
549
593
|
return section;
|
|
@@ -553,6 +597,61 @@ export function createFindings({ doc, el, api, projectId, live, locate, sideStat
|
|
|
553
597
|
|
|
554
598
|
/** S3: the parts and pairs the clash check could not use, by reason (plan §5; UX review 2026-11-12). */
|
|
555
599
|
function notCheckedForClash() {
|
|
600
|
+
if (steel) {
|
|
601
|
+
// The server's own list of what the steel clash check left out, with its scope: nothing here is reworded.
|
|
602
|
+
const statement = data?.clashStatement;
|
|
603
|
+
// Connection zones: where two members meet at their work point through a connection. Each is listed in its own
|
|
604
|
+
// words with a way to see it, as something that was not checked: never counted or styled as clean.
|
|
605
|
+
const forReview = renderingFor;
|
|
606
|
+
const zoneList = zones();
|
|
607
|
+
const zoneLabels = new Set(zoneList.map((zone) => zone.label));
|
|
608
|
+
// #3550: each connection that is not fully built, named with why: none of its parts was checked. The kind is said
|
|
609
|
+
// the way a detailer says it ("shear tab"), in id order so the list reads the same between reviews.
|
|
610
|
+
const kindWords = (kind) => (/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(kind) ? kind.replace(/-/g, ' ') : kind);
|
|
611
|
+
const notBuilt = (Array.isArray(data?.steel?.clashConnections?.notFullyBuilt) ? data.steel.clashConnections.notFullyBuilt : [])
|
|
612
|
+
.filter((c) => c && typeof c.id === 'string' && typeof c.why === 'string')
|
|
613
|
+
.sort((a, b) => a.id.localeCompare(b.id, undefined, { numeric: true }))
|
|
614
|
+
.map((c) => `Connection ${c.id}${typeof c.kind === 'string' && c.kind ? ` (${kindWords(c.kind)})` : ''} was not checked for clash: ${c.why.replace(/\.+$/, '')}.`);
|
|
615
|
+
// #3997/#4011: shear plate placement warnings, grouped under the server's own heading for their kind, in its order.
|
|
616
|
+
const placement = (Array.isArray(data?.steel?.clashConnections?.placement) ? data.steel.clashConnections.placement : [])
|
|
617
|
+
.filter((c) => c && typeof c.id === 'string' && typeof c.heading === 'string' && typeof c.text === 'string')
|
|
618
|
+
.map((c, i) => ({ ...c, i }))
|
|
619
|
+
.sort((a, b) => a.id.localeCompare(b.id, undefined, { numeric: true }) || a.i - b.i);
|
|
620
|
+
const placementGroup = (heading) => {
|
|
621
|
+
const items = placement.filter((c) => c.heading === heading);
|
|
622
|
+
return el(doc, 'details', { class: 'tekla-changes-group', open: true },
|
|
623
|
+
el(doc, 'summary', { text: `${heading} (${items.length})` }),
|
|
624
|
+
el(doc, 'ul', { class: 'tekla-audit-omissions' }, ...items.map((c) => el(doc, 'li', { text: `Connection ${c.id}: ${c.text}` }))));
|
|
625
|
+
};
|
|
626
|
+
const reasons = [...notBuilt, ...(Array.isArray(statement?.notChecked) ? statement.notChecked : []).map((entry) => entry?.reason)
|
|
627
|
+
.filter((text) => typeof text === 'string' && text && !zoneLabels.has(text))];
|
|
628
|
+
const headings = [...new Map([...placement].sort((a, b) => a.i - b.i).map((c) => [c.heading, 1])).keys()];
|
|
629
|
+
const differently = headings.length ? el(doc, 'div', {}, ...headings.map(placementGroup)) : null;
|
|
630
|
+
if (!statement && !zoneList.length) return differently;
|
|
631
|
+
if (!reasons.length && !zoneList.length && !statement.scope) return differently;
|
|
632
|
+
const total = reasons.length + zoneList.length;
|
|
633
|
+
const zoneItem = (zone) => el(doc, 'li', { class: 'crv-zone' }, el(doc, 'span', { text: zone.label }),
|
|
634
|
+
zone.entityIds.length ? button({ class: 'tekla-changes-locate', 'data-command-id': cid('zone-locate'), 'aria-label': `Show in 3D: ${zone.label}` }, 'Show in 3D', async () => {
|
|
635
|
+
if (!current(forReview)) return;
|
|
636
|
+
try {
|
|
637
|
+
const selected = await locate({ state: sideState('revised'), entityId: zone.entityIds[0], entityIds: zone.entityIds });
|
|
638
|
+
if (forReview.gen !== gen) return;
|
|
639
|
+
const n = Array.isArray(selected) ? selected.length : 0;
|
|
640
|
+
if (n) shownNow();
|
|
641
|
+
locateSays(!n ? W.notOpened : n < zone.entityIds.length ? 'Showing the one member of this connection that is in the current model.' : 'Showing the members that meet at this connection in 3D.');
|
|
642
|
+
} catch (error) {
|
|
643
|
+
console.warn('[change-review] Show in 3D failed:', error);
|
|
644
|
+
if (forReview.gen === gen) locateSays(W.locateFailed(error));
|
|
645
|
+
}
|
|
646
|
+
}) : null);
|
|
647
|
+
// Open when there is a zone (its Show in 3D is the way to look at what was not checked) or a connection that was
|
|
648
|
+
// not checked: a gap is never folded away.
|
|
649
|
+
const unchecked = el(doc, 'details', { class: 'tekla-changes-group tekla-changes-clash-unchecked', open: zoneList.length || notBuilt.length ? true : null },
|
|
650
|
+
el(doc, 'summary', { text: total ? `Not checked for clash (${total})` : 'How clashes were checked' }),
|
|
651
|
+
el(doc, 'ul', { class: 'tekla-audit-omissions' }, ...zoneList.map(zoneItem), ...reasons.map((text) => el(doc, 'li', { text })),
|
|
652
|
+
statement?.scope ? el(doc, 'li', { text: statement.scope }) : null));
|
|
653
|
+
return differently ? el(doc, 'div', {}, differently, unchecked) : unchecked;
|
|
654
|
+
}
|
|
556
655
|
const c = data?.clash;
|
|
557
656
|
if (!c || data?.clashState !== 'ran') return null;
|
|
558
657
|
const rows = [];
|
|
@@ -581,7 +680,7 @@ export function createFindings({ doc, el, api, projectId, live, locate, sideStat
|
|
|
581
680
|
const lines = [];
|
|
582
681
|
if (s) {
|
|
583
682
|
// The groups can overlap (a changed object can also be re-checked), so no total is claimed.
|
|
584
|
-
lines.push(`Looked at ${plural(s.added, 'added object')} and ${plural(s.changed, 'changed object')}${s.focus ? `, and re-checked ${plural(s.focus, 'object')} from earlier findings` : ''}: ${plural(s.evaluated, 'object was', 'objects were')} checked.`);
|
|
683
|
+
lines.push(`Looked at ${plural(s.added, 'added object')} and ${plural(s.changed, 'changed object')}${s.notCompared ? ` (${s.notCompared})` : ''}${s.focus ? `, and re-checked ${plural(s.focus, 'object')} from earlier findings` : ''}: ${plural(s.evaluated, 'object was', 'objects were')} checked.`);
|
|
585
684
|
if (s.notApplicable) lines.push(`${plural(s.notApplicable, 'object was', 'objects were')} not the kind these checks apply to.`);
|
|
586
685
|
if (s.excluded) lines.push(`${plural(s.excluded, 'object was', 'objects were')} left out of the checks.`);
|
|
587
686
|
}
|
|
@@ -662,5 +761,21 @@ export function createFindings({ doc, el, api, projectId, live, locate, sideStat
|
|
|
662
761
|
target?.focus();
|
|
663
762
|
}
|
|
664
763
|
|
|
665
|
-
|
|
764
|
+
/**
|
|
765
|
+
* #4029: the cards of `list` (findings of the loaded reply), in the panel's own sections, needing-a-decision first.
|
|
766
|
+
* Every control belongs to the load on screen, exactly as the review's own cards do.
|
|
767
|
+
*/
|
|
768
|
+
function cards(list) {
|
|
769
|
+
if (!reviewId || loading) return [];
|
|
770
|
+
renderingFor = { reviewId, gen };
|
|
771
|
+
return [...list].sort((a, b) => ORDER[a.status] - ORDER[b.status]).map(card);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
/** #4029: take a reply the panel already has (a check just run) as a load, without reading it again. */
|
|
775
|
+
function adopt(id, reply) {
|
|
776
|
+
gen += 1; reviewId = id ?? null; data = reply ?? null; failed = null; loading = false;
|
|
777
|
+
return gen;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
return { load, nodes, cards, adopt, data: () => data, failed: () => failed, restoreFocus, reset: () => { data = null; reviewId = null; failed = null; filter = null; openKey = null; }, state: () => ({ findings: views().length, gate: data?.view?.gate?.kind ?? data?.checks?.state ?? null }) };
|
|
666
781
|
}
|