@floless/app 0.156.0 → 0.157.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/cli-actions.mjs +21 -5
- package/dist/floless-server.cjs +70965 -43326
- package/dist/schemas/drawing-check.profile.v1.schema.json +15 -2
- package/dist/schemas/steel.model.v2.schema.json +25 -1
- package/dist/skills/floless-app-actions/SKILL.md +79 -17
- package/dist/skills/floless-app-knowledge/SKILL.md +21 -2
- package/dist/skills/floless-app-new-workflow/SKILL.md +23 -7
- package/dist/skills/floless-app-onboarding/SKILL.md +31 -1
- package/dist/skills/floless-app-report-issue/SKILL.md +3 -3
- package/dist/skills/floless-app-rfi/SKILL.md +40 -6
- package/dist/skills/floless-app-routines/SKILL.md +9 -2
- package/dist/skills/floless-app-steel-model/SKILL.md +1 -1
- package/dist/skills/floless-app-steel-model/references/detail-from-a-screenshot.md +4 -2
- package/dist/skills/floless-app-tweak-contract/SKILL.md +25 -5
- package/dist/skills/floless-app-workflows/SKILL.md +46 -10
- package/dist/skills/floless-app-workflows/references/agent-steps.md +119 -0
- package/dist/web/agent-steps.js +864 -47
- package/dist/web/agents.js +28 -8
- package/dist/web/app.css +478 -3
- package/dist/web/app.js +110 -11
- package/dist/web/aware-update-client.js +1 -0
- package/dist/web/aware.js +685 -170
- package/dist/web/chat-landing-scene.js +372 -0
- package/dist/web/chat.css +245 -1
- package/dist/web/chat.js +2466 -78
- package/dist/web/commands-drawing-check.js +17 -0
- package/dist/web/commands-shell.js +820 -3
- package/dist/web/commands-steel.js +6 -0
- package/dist/web/connections.js +1 -0
- package/dist/web/drawing-check-editor.html +33 -5
- package/dist/web/drawing-check-editor.js +538 -22
- package/dist/web/drawing-check-overlay.js +13 -0
- package/dist/web/flo-avatar.js +28 -3
- package/dist/web/guide.js +7 -2
- package/dist/web/index.html +119 -6
- package/dist/web/instructor.js +3 -3
- package/dist/web/model-view-query.js +12 -2
- package/dist/web/pages.js +865 -34
- package/dist/web/panels.js +5 -2
- package/dist/web/parser-setup-recovery.js +12 -4
- package/dist/web/project-access.js +549 -0
- package/dist/web/report-files.js +50 -0
- package/dist/web/startup-admission.js +132 -0
- package/dist/web/steel-3d-core.js +9 -0
- package/dist/web/steel-editor.html +642 -22
- package/dist/web/steel-model-v2-commands.js +63 -5
- package/dist/web/step-rename.js +287 -0
- package/dist/web/terminal-requests.js +59 -10
- package/dist/web/tool-updates.js +1 -0
- package/dist/web/workspace-root-management.js +39 -0
- package/dist/web/workspaces.js +1667 -63
- package/launch.mjs +9 -7
- package/package.json +3 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// the person's ticks, starts a run the server performs with fixed code, and draws the stored result with
|
|
6
6
|
// the SAME overlay module the run report uses (drawing-check-overlay.js), so the two cannot disagree.
|
|
7
7
|
// Wording rule: FloLess "looked at" a sheet; only a person marks one checked.
|
|
8
|
-
import { DEFAULT_COLOURS, hatchDefs, overlaySvg, withAccepted } from './drawing-check-overlay.js';
|
|
8
|
+
import { DEFAULT_COLOURS, hatchDefs, overlaySvg, shortDigests, withAccepted } from './drawing-check-overlay.js';
|
|
9
9
|
|
|
10
10
|
// ── pure helpers (exported for server/drawing-check-ui.test.ts) ─────────────────────────────────
|
|
11
11
|
|
|
@@ -84,8 +84,98 @@ export function countsLine(s) {
|
|
|
84
84
|
return parts.join(' · ');
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
/** The sheet a run warning points at ("E6 · E6-0.pdf · page 1"), with its drawing number when the run read one. */
|
|
88
|
+
export function warningWhere(w, sheets) {
|
|
89
|
+
if (!w || !w.where) return '';
|
|
90
|
+
const { drawing, page } = w.where;
|
|
91
|
+
const sheet = (sheets || []).find((s) => s.drawing === drawing && (page === undefined || s.page === page));
|
|
92
|
+
const number = sheet && sheet.sheetLabel && !sheet.sheetLabel.startsWith(`${drawing} · `) ? sheet.sheetLabel : '';
|
|
93
|
+
return [number, shortDigests(drawing), page ? `page ${page}` : ''].filter(Boolean).join(' · ');
|
|
94
|
+
}
|
|
95
|
+
|
|
87
96
|
const esc = (v) => String(v ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
88
97
|
|
|
98
|
+
// ── references from the design set (epic #2399 0d-dc): the pure parts, exported for drawing-check-ui.test.ts ──
|
|
99
|
+
/**
|
|
100
|
+
* What is true NOW of a picked reference's issue and file, when it is no longer as picked; null when it is, or when
|
|
101
|
+
* the reference was uploaded. `designSet` is the design-set status view (null when it could not be read).
|
|
102
|
+
*/
|
|
103
|
+
export function referenceDriftText(ref, designSet) {
|
|
104
|
+
const d = ref && ref.designIssue;
|
|
105
|
+
if (!d) return null;
|
|
106
|
+
if (!designSet || designSet.status === 'unknown') return `FloLess could not read the design set just now, so it could not check whether ${d.label} changed.`;
|
|
107
|
+
const issue = (designSet.issues || []).find((i) => i.issueId === d.issueId);
|
|
108
|
+
if (!issue) return `${d.label} is no longer in this profile’s design set.`;
|
|
109
|
+
if (issue.withdrawnAt) return `${issue.label} is now withdrawn from the design set.`;
|
|
110
|
+
const f = (issue.files || [])[d.file];
|
|
111
|
+
if (!f || f.blobSha256 !== ref.sha256) return `${issue.label} no longer holds this file as it was picked.`;
|
|
112
|
+
if (f.withdrawnAt) return `It is now withdrawn from ${issue.label}.`;
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ── keeping the open page current (#2482) ──
|
|
117
|
+
/**
|
|
118
|
+
* What a server event, relayed by the workspace (workspaces.js tellModelFrame), means for the profile on screen: which
|
|
119
|
+
* of its reads to repeat, or null when it is not about it. The design set changes in Knowledge, in AI Chat or in
|
|
120
|
+
* another window (`knowledge-changed`); the draft, and so its references, changes through any contract write
|
|
121
|
+
* (`contract-changed`, with the new `etag`, so this page's own write coming back is recognised). The stream has no
|
|
122
|
+
* replay, so after it reconnects (`resync`) frames may have been missed and both are read again.
|
|
123
|
+
*/
|
|
124
|
+
export function liveRefreshFor(frame, { app, project }) {
|
|
125
|
+
if (!frame || typeof frame !== 'object' || !project) return null;
|
|
126
|
+
if (frame.type === 'resync') return { designSet: true, draft: true };
|
|
127
|
+
if (frame.type === 'knowledge-changed') return frame.projectId === project ? { designSet: true } : null;
|
|
128
|
+
if (frame.type === 'contract-changed' && frame.appId === app && (frame.project || '') === project) {
|
|
129
|
+
return { draft: true, etag: typeof frame.etag === 'string' && frame.etag ? frame.etag : null };
|
|
130
|
+
}
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* The status line for reference drawings that changed under the page (#2482): added, taken out, or showing a warning
|
|
135
|
+
* they did not show before. '' when nothing a person would notice changed. `before`/`after` are { refs, designSet }
|
|
136
|
+
* (designSet null when it could not be read: a reference then shows "could not read", which is not news).
|
|
137
|
+
*/
|
|
138
|
+
export function referencesChangeNote(before, after) {
|
|
139
|
+
const had = new Map((before.refs || []).map((r) => [r.sha256, r]));
|
|
140
|
+
const has = new Set((after.refs || []).map((r) => r.sha256));
|
|
141
|
+
const added = (after.refs || []).filter((r) => !had.has(r.sha256));
|
|
142
|
+
const gone = (before.refs || []).filter((r) => !has.has(r.sha256));
|
|
143
|
+
const warned = after.designSet ? (after.refs || []).filter((r) => {
|
|
144
|
+
if (!had.has(r.sha256)) return false;
|
|
145
|
+
const now = referenceDriftText(r, after.designSet);
|
|
146
|
+
return !!now && now !== referenceDriftText(had.get(r.sha256), before.designSet);
|
|
147
|
+
}) : [];
|
|
148
|
+
const n = added.length + gone.length + warned.length;
|
|
149
|
+
if (!n) return '';
|
|
150
|
+
if (n === 1) {
|
|
151
|
+
if (added.length) return `Reference drawing added: ${added[0].name}.`;
|
|
152
|
+
if (gone.length) return `Reference drawing taken out: ${gone[0].name}.`;
|
|
153
|
+
return `${warned[0].name}: ${referenceDriftText(warned[0], after.designSet)} See the warning on its row.`;
|
|
154
|
+
}
|
|
155
|
+
const parts = [];
|
|
156
|
+
if (added.length) parts.push(`${added.length} added`);
|
|
157
|
+
if (gone.length) parts.push(`${gone.length} taken out`);
|
|
158
|
+
if (warned.length) parts.push(`${warned.length} with a new warning`);
|
|
159
|
+
return `Reference drawings updated: ${parts.join(', ')}.`;
|
|
160
|
+
}
|
|
161
|
+
/** One file of an issue in the picker: a tickable row when it can be added, else a note saying why not. */
|
|
162
|
+
export function pickerFileRow(f, plan, ticked) {
|
|
163
|
+
if (f.selectable) {
|
|
164
|
+
const extra = f.status === 'already-reference' ? ` — already a reference (${f.alreadyReference.name}); tick to record that it came from ${plan.label}`
|
|
165
|
+
: f.withdrawn ? ` — withdrawn from ${plan.label}; include anyway` : f.status === 'not-checked' ? ' — checked when added' : '';
|
|
166
|
+
return `<label class="choice"><input type="checkbox" value="${esc(String(f.index))}"${ticked ? ' checked' : ''} data-command-id="drawing-check.design-set-file#${esc(String(f.index))}" data-command-instance-label="${esc(f.filename)}">`
|
|
167
|
+
+ `<span>${esc(f.filename)}${extra ? `<span class="note">${esc(extra)}</span>` : ''}</span></label>`;
|
|
168
|
+
}
|
|
169
|
+
const why = f.status === 'already-reference' ? `already a reference${f.alreadyReference && f.alreadyReference.fromIssue ? `, from ${f.alreadyReference.fromIssue}` : ''}` : f.reason;
|
|
170
|
+
return `<div class="note" style="padding:4px 0 4px 23px">${esc(f.filename)} — ${esc(why)}</div>`;
|
|
171
|
+
}
|
|
172
|
+
/** The picker's count: how many are ticked, and the per-add limit when more are. */
|
|
173
|
+
export function pickerCountLine(plan, ticks) {
|
|
174
|
+
const n = ticks.size;
|
|
175
|
+
const over = n > plan.limits.files ? ` One add takes ${plan.limits.files} at most; add the rest next.` : '';
|
|
176
|
+
return n ? `${n} of ${plan.files.filter((f) => f.selectable).length} selected.${over}` : 'Tick at least one drawing.';
|
|
177
|
+
}
|
|
178
|
+
|
|
89
179
|
/** One number tag the export could not place, worded exactly as the cover page lists it. */
|
|
90
180
|
export function tagFailureNote(f) {
|
|
91
181
|
return `Item ${f.n} on page ${f.page}: number could not be placed${f.why ? ` (${f.why})` : ''}`;
|
|
@@ -95,6 +185,38 @@ export function tagFailureNote(f) {
|
|
|
95
185
|
* The client this checklist is for, editable at the top of the Checklist tab. Proposing fills it from the
|
|
96
186
|
* CLIENT on the reference drawings; a person corrects it here. Every sheet naming another client asks.
|
|
97
187
|
*/
|
|
188
|
+
// The hole-size check's clearance table, read-only (editing rows is a later task): what it allows, where each row
|
|
189
|
+
// came from, and the person's own choice to fill it from a standard (owner ruling 3: never applied silently).
|
|
190
|
+
export function clearancesHtml(it, note = '') {
|
|
191
|
+
const rows = Array.isArray(it.rule.clearances) ? it.rule.clearances : [];
|
|
192
|
+
const starter = rows.some((r) => r.source === 'standard');
|
|
193
|
+
const src = (r) => r.source === 'standard' ? '<span class="chip warn">starter value</span>'
|
|
194
|
+
: r.source === 'person' ? '<span class="chip">set by you</span>'
|
|
195
|
+
: `<span class="chip">${typeof r.support === 'number' ? `learned · ${Math.round(r.support * 100)}% of pairs` : 'learned'}</span>`;
|
|
196
|
+
const table = rows.length
|
|
197
|
+
? `<div class="clear-rows" role="table" aria-label="Bolt clearances">${rows.map((r) => `<div role="row"><span role="cell" class="clear-bolt">${esc(boltRange(r))}</span><span role="cell" class="clear-kind">${esc(KIND_WORDS[r.kind] || r.kind)}</span><span role="cell" class="clear-val">${esc(clearanceText(r.clearance))}</span><span role="cell">${src(r)}</span></div>`).join('')}</div>`
|
|
198
|
+
: '<div class="band ask-band"><span>No bolt clearances yet. Until there are some, every hole note shows “couldn’t tell”, because FloLess has no size to compare it with. Fill the table from a standard below, or propose again from reference drawings that show holes with their bolts.</span></div>';
|
|
199
|
+
const tip = rows.length ? 'Replaces the rows above with starter values' : 'Adds starter values';
|
|
200
|
+
return `<div class="clear-panel" role="group" aria-label="Bolt clearances for ${esc(it.label)}">
|
|
201
|
+
<p class="clear-head">Bolt clearances: how much bigger than its bolt each hole may be</p>
|
|
202
|
+
${starter ? '<p class="warn-line">Starter values: confirm against your design standard.</p>' : ''}
|
|
203
|
+
${table}
|
|
204
|
+
${note ? `<p class="note" role="status">${esc(note)}</p>` : ''}
|
|
205
|
+
<p class="clear-head">Fill from a standard</p>
|
|
206
|
+
<div class="row-actions"><button type="button" data-act="fill-clearances" data-standard="us" data-tip="${tip}" data-command-id="drawing-check.fill-clearances#us" data-command-instance-label="US practice (AISC)">US practice (AISC J3.3 standard holes)</button>
|
|
207
|
+
<button type="button" data-act="fill-clearances" data-standard="en1090" data-tip="${tip}" data-command-id="drawing-check.fill-clearances#en1090" data-command-instance-label="EN 1090-2">EN 1090-2 (normal round holes)</button></div></div>`;
|
|
208
|
+
}
|
|
209
|
+
export const KIND_WORDS = { standard: 'standard holes', oversize: 'oversize holes', 'short-slot': 'short slots', 'long-slot': 'long slots' };
|
|
210
|
+
export const STANDARD_NAMES = { us: 'US practice (AISC J3.3, standard holes)', en1090: 'EN 1090-2 (normal round holes)' };
|
|
211
|
+
function lenText(l) {
|
|
212
|
+
if (!l) return '';
|
|
213
|
+
if (l.unit === 'mm') return `${Number((l.num / l.den).toFixed(2))} mm`;
|
|
214
|
+
const whole = Math.floor(l.num / l.den), rem = l.num % l.den;
|
|
215
|
+
return `${whole || !rem ? whole : ''}${whole && rem ? ' ' : ''}${rem ? `${rem}/${l.den}` : ''}"`;
|
|
216
|
+
}
|
|
217
|
+
const boltText = (l) => (l.unit === 'mm' && l.den === 1 ? `M${l.num}` : lenText(l));
|
|
218
|
+
const boltRange = (r) => `${boltText(r.boltFrom)}${JSON.stringify(r.boltFrom) === JSON.stringify(r.boltTo) ? '' : ` – ${boltText(r.boltTo)}`} bolts`;
|
|
219
|
+
const clearanceText = (c) => (c && c.width ? `+${lenText(c.width)} wide, +${lenText(c.length)} long` : `+${lenText(c)}`);
|
|
98
220
|
export function clientFieldHtml(client) {
|
|
99
221
|
return `<label class="field client-field"><span>Client</span><input type="text" id="client-name" value="${esc(client)}" maxlength="200" autocomplete="off" spellcheck="false" data-command-id="drawing-check.client" data-tip="Sheets naming another client ask before they are checked"></label>`;
|
|
100
222
|
}
|
|
@@ -112,6 +234,11 @@ export function focusKey(el) {
|
|
|
112
234
|
if (!el || !el.getAttribute) return null;
|
|
113
235
|
if (el.hasAttribute('data-tb-read')) return `[data-tb-read="${attrEsc(el.getAttribute('data-tb-read'))}"][data-mode="${attrEsc(el.getAttribute('data-mode'))}"]`;
|
|
114
236
|
if (el.hasAttribute('data-answer')) return `[data-answer="${attrEsc(el.getAttribute('data-answer'))}"][data-choice="${attrEsc(el.getAttribute('data-choice'))}"]`;
|
|
237
|
+
// A row's action is named with its row: every reference row has its own "Take out" (#2482: a refresh repaints them).
|
|
238
|
+
if (el.hasAttribute('data-act')) {
|
|
239
|
+
const row = ['data-sha', 'data-finding', 'data-issue', 'data-run'].find((k) => el.hasAttribute(k));
|
|
240
|
+
if (row) return `[data-act="${attrEsc(el.getAttribute('data-act'))}"][${row}="${attrEsc(el.getAttribute(row))}"]`;
|
|
241
|
+
}
|
|
115
242
|
for (const k of FOCUS_KEYS) if (el.hasAttribute(k)) return `[${k}="${attrEsc(el.getAttribute(k))}"]`;
|
|
116
243
|
return null;
|
|
117
244
|
}
|
|
@@ -439,9 +566,26 @@ function boot() {
|
|
|
439
566
|
decisions: NO_DECISIONS, decisionsError: '', carryNote: null, pendingByRun: {},
|
|
440
567
|
// The run bar's status line (runStatusHtml): leaving a run that is still saving, or why it is still shown.
|
|
441
568
|
runStatus: null,
|
|
569
|
+
// "Reference drawings in approved version N: …" for the run on screen (epic #2399 0d-dc), from the run route.
|
|
570
|
+
runReferences: '',
|
|
571
|
+
// The profile's own design set (status view) for the reference rows and the picker; references a person chose to
|
|
572
|
+
// keep after their issue changed, for this visit only (the warning stays: the record still says what changed).
|
|
573
|
+
designSet: null, designSetError: '', kept: new Set(),
|
|
574
|
+
// What changed in the reference drawings since the page last showed them, when the change came from elsewhere
|
|
575
|
+
// (Knowledge, AI Chat, another window): said on the Reference drawings tab until the next such change (#2482).
|
|
576
|
+
liveNote: '',
|
|
442
577
|
};
|
|
443
578
|
|
|
579
|
+
// This page's own writes still waiting for their answer: a refresh waits for them (refreshNow), so what the page
|
|
580
|
+
// just did is never read back as a change made elsewhere. `ownWriteSeq` counts every write that started, so a
|
|
581
|
+
// refresh already reading when the person makes a change knows its answer may hold that change (QA E2E, #2482).
|
|
582
|
+
let ownWrites = 0, ownWriteSeq = 0;
|
|
444
583
|
async function call(path, opts = {}) {
|
|
584
|
+
const write = !!opts.method && opts.method !== 'GET';
|
|
585
|
+
if (write) { ownWrites++; ownWriteSeq++; }
|
|
586
|
+
try { return await callOnce(path, opts); } finally { if (write) ownWrites--; }
|
|
587
|
+
}
|
|
588
|
+
async function callOnce(path, opts) {
|
|
445
589
|
let res;
|
|
446
590
|
try { res = await fetch(path, { credentials: 'same-origin', ...opts }); }
|
|
447
591
|
catch { const e = new Error('FloLess could not be reached. Check that it is still running, then try again.'); e.status = 0; throw e; }
|
|
@@ -457,6 +601,7 @@ function boot() {
|
|
|
457
601
|
|
|
458
602
|
// ── loading ──
|
|
459
603
|
async function loadDraft() {
|
|
604
|
+
S.clearNote = ''; // a note about the last fill says nothing true about a draft read afresh
|
|
460
605
|
const res = await fetch(`/api/contract/${encodeURIComponent(APP)}?project=${encodeURIComponent(PROJECT)}&quietMissing=1`, { credentials: 'same-origin' });
|
|
461
606
|
if (res.status === 204) { S.draft = null; S.etag = null; return; }
|
|
462
607
|
if (res.status === 404) throw new Error('This profile could not be found. It may have been archived; open it again from Workspaces.');
|
|
@@ -510,7 +655,7 @@ function boot() {
|
|
|
510
655
|
async function loadAll() {
|
|
511
656
|
S.accessError = '';
|
|
512
657
|
// allSettled, not all: every read must land before the page decides which failure to explain.
|
|
513
|
-
const settled = await Promise.allSettled([loadDraft(), loadReview(), loadRuns(), loadColours()]);
|
|
658
|
+
const settled = await Promise.allSettled([loadDraft(), loadReview(), loadRuns(), loadColours(), loadDesignSet()]);
|
|
514
659
|
const failed = settled.find((r) => r.status === 'rejected');
|
|
515
660
|
S.loadError = failed ? (failed.reason && failed.reason.message) || 'This profile could not be read. Reload to try again.' : '';
|
|
516
661
|
// A module refusal (no Drawing Checker access) is the one answer that explains every other failure,
|
|
@@ -553,9 +698,233 @@ function boot() {
|
|
|
553
698
|
<p class="lede">Drawings this client has already accepted. FloLess reads what they have in common and proposes a checklist from it.</p>
|
|
554
699
|
${S.newSinceApproval && approvedVersion() !== null ? `<div class="band">${S.newSinceApproval} new drawing${S.newSinceApproval === 1 ? ' isn’t' : 's aren’t'} in version ${approvedVersion()}. Propose again on the Checklist to include ${S.newSinceApproval === 1 ? 'it' : 'them'}.</div>` : ''}
|
|
555
700
|
${S.uploadNote ? `<p class="note" role="status">${esc(S.uploadNote)}</p>` : ''}
|
|
556
|
-
${
|
|
701
|
+
${S.liveNote ? `<p class="note" role="status" id="refs-live-note">${esc(S.liveNote)}</p>` : ''}
|
|
702
|
+
<div class="row-actions"><button type="button" data-act="use-design-set" data-command-id="drawing-check.use-design-set" data-tip="Add drawings from an issue in this project’s Knowledge">Use the design set…</button></div>
|
|
703
|
+
${refs.length ? `<div class="list" style="margin-bottom:14px">${refs.map(referenceRow).join('')}</div>${drop(true)}` : drop(false)}
|
|
557
704
|
<input type="file" id="ref-file" accept=".pdf,application/pdf" multiple hidden></div>`;
|
|
558
705
|
}
|
|
706
|
+
|
|
707
|
+
// ── references from the design set (epic #2399 0d-dc) ──
|
|
708
|
+
// A pull: the picker reads this profile's own design set (Knowledge) and the server copies the chosen files into the
|
|
709
|
+
// references, each recording the issue it came from. The design set is never written from here.
|
|
710
|
+
const dsUrl = `/api/projects/${encodeURIComponent(PROJECT)}/design-set`;
|
|
711
|
+
async function loadDesignSet() {
|
|
712
|
+
try { const { body } = await call(dsUrl); S.designSet = body; S.designSetError = ''; }
|
|
713
|
+
catch (e) { S.designSet = null; S.designSetError = (e && e.message) || 'The design set could not be read.'; }
|
|
714
|
+
}
|
|
715
|
+
/** "12 Oct 2026" from YYYY-MM-DD or an ISO time; the input as it is when it is neither. */
|
|
716
|
+
const shortDate = (d) => {
|
|
717
|
+
const t = d ? Date.parse(/^\d{4}-\d{2}-\d{2}$/.test(d) ? `${d}T00:00:00Z` : d) : NaN;
|
|
718
|
+
return Number.isFinite(t) ? new Date(t).toLocaleDateString('en-GB', { day: 'numeric', month: 'short', year: 'numeric', timeZone: 'UTC' }) : (d || '');
|
|
719
|
+
};
|
|
720
|
+
const referenceDrift = (r) => referenceDriftText(r, S.designSetError ? null : S.designSet);
|
|
721
|
+
function referenceRow(r) {
|
|
722
|
+
const d = r.designIssue;
|
|
723
|
+
const drift = referenceDrift(r);
|
|
724
|
+
const kept = S.kept.has(r.sha256);
|
|
725
|
+
const chip = d ? `<span class="chip${drift ? ' warn' : ''}" data-tip="Picked from ${esc(d.label)} on ${esc(shortDate(d.pickedAt))}.">from ${esc(d.label)}</span>` : '';
|
|
726
|
+
const remove = `<button type="button" class="link" data-act="remove-ref" data-sha="${esc(r.sha256)}" data-command-id="drawing-check.remove-reference#${esc(r.sha256)}" data-command-instance-label="${esc(r.name)}" aria-label="Take ${esc(r.name)} out of the reference drawings">Take out</button>`;
|
|
727
|
+
const head = `<span class="grow">${esc(r.name)}</span>${chip}<span class="meta">${r.pages} page${r.pages === 1 ? '' : 's'}</span>${remove}`;
|
|
728
|
+
if (!drift) return `<div>${head}</div>`;
|
|
729
|
+
return `<div class="drift">${head}<div class="drift-body"><p class="warn-line">${esc(drift)}</p>
|
|
730
|
+
<div class="row-actions"><button type="button" data-act="keep-copy" data-sha="${esc(r.sha256)}" aria-pressed="${kept}" data-command-id="drawing-check.keep-approved-copy#${esc(r.sha256)}" data-command-instance-label="${esc(r.name)}">Keep the approved copy</button>
|
|
731
|
+
<button type="button" class="link" data-act="pick-again" data-sha="${esc(r.sha256)}" data-issue="${esc(d.issueId)}" data-command-id="drawing-check.pick-again#${esc(r.sha256)}" data-command-instance-label="${esc(r.name)}">Pick again from the design set</button>
|
|
732
|
+
${kept ? '<span class="note">Keeping the approved copy. Runs still check against it.</span>' : ''}</div></div></div>`;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
/** Take one reference out of the draft, after the person confirms. Approved versions and runs keep it. */
|
|
736
|
+
function removeReferenceDialog(sha, returnFocus) {
|
|
737
|
+
const ref = references().find((r) => r.sha256 === sha);
|
|
738
|
+
if (!ref) return;
|
|
739
|
+
showDialog({
|
|
740
|
+
title: 'Take this drawing out?', returnFocus,
|
|
741
|
+
body: `<p><b>${esc(ref.name)}</b> leaves the reference drawings of this checklist draft. Approved versions and earlier checks keep it, and FloLess keeps its stored copy.</p>
|
|
742
|
+
<p class="note">What was proposed from it stays until you propose the checklist again. The checklist then has to be approved again.</p>
|
|
743
|
+
<p class="err-line" id="rr-err" role="alert" hidden></p>`,
|
|
744
|
+
foot: '<button type="button" data-dlg="cancel" data-command-id="drawing-check.cancel-remove-reference">Cancel</button><button type="button" class="primary" data-dlg="remove" data-command-id="drawing-check.confirm-remove-reference">Take it out</button>',
|
|
745
|
+
onOpen: (scrim) => {
|
|
746
|
+
scrim.querySelector('[data-dlg="remove"]').focus();
|
|
747
|
+
scrim.addEventListener('click', async (e) => {
|
|
748
|
+
const b = e.target.closest('[data-dlg]');
|
|
749
|
+
if (!b) return;
|
|
750
|
+
if (b.dataset.dlg === 'cancel') { closeDialog(); return; }
|
|
751
|
+
b.disabled = true;
|
|
752
|
+
try {
|
|
753
|
+
const { body } = await call(`${base}/references/${encodeURIComponent(sha)}`, { method: 'DELETE', headers: S.etag ? { 'if-match': S.etag } : {} });
|
|
754
|
+
S.draft.references = body.references; S.etag = body.etag; S.kept.delete(sha);
|
|
755
|
+
S.uploadNote = `${ref.name} was taken out of the reference drawings. Propose again on the Checklist to update what was learned from it.`;
|
|
756
|
+
closeDialog(false);
|
|
757
|
+
try { await Promise.all([loadDraft(), loadReview()]); }
|
|
758
|
+
catch { S.uploadNote += ' Saved, but the page could not refresh. Reload the profile to see the latest.'; }
|
|
759
|
+
render(); document.querySelector('[data-act="use-design-set"]')?.focus();
|
|
760
|
+
} catch (err) {
|
|
761
|
+
b.disabled = false;
|
|
762
|
+
const line = scrim.querySelector('#rr-err');
|
|
763
|
+
line.textContent = err.status === 412 || err.status === 428
|
|
764
|
+
? 'The checklist changed in another window. Close this, reload the profile, and try again.'
|
|
765
|
+
: (err.message || 'It could not be taken out just now. Try again.');
|
|
766
|
+
line.hidden = false;
|
|
767
|
+
}
|
|
768
|
+
});
|
|
769
|
+
},
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
/**
|
|
774
|
+
* "Use the design set": step 1 picks an issue, step 2 ticks its files (counted here; the server is asked only on
|
|
775
|
+
* confirm, with the plan key — a changed design set comes back as a stale answer and the files are checked again).
|
|
776
|
+
*/
|
|
777
|
+
function designSetDialog(returnFocus, startIssueId) {
|
|
778
|
+
const st = { step: 'issues', issueId: startIssueId || null, showWithdrawn: false, plan: null, ticks: new Set(), note: '', busy: false };
|
|
779
|
+
const scrim = showDialog({ title: 'Use the design set', returnFocus, body: '<p class="note"><span class="spin" aria-hidden="true"></span> Reading this profile’s design set…</p>',
|
|
780
|
+
foot: '<button type="button" data-dlg="cancel" data-command-id="drawing-check.design-set-cancel">Cancel</button>' });
|
|
781
|
+
const live = document.createElement('p'); live.className = 'sr-only'; live.setAttribute('role', 'status'); live.setAttribute('aria-live', 'polite');
|
|
782
|
+
scrim.querySelector('.dialog').appendChild(live);
|
|
783
|
+
const bodyEl = scrim.querySelector('.body'); const footEl = scrim.querySelector('.foot'); const titleEl = scrim.querySelector('#dlg-title');
|
|
784
|
+
const cancel = '<button type="button" data-dlg="cancel" data-command-id="drawing-check.design-set-cancel">Cancel</button>';
|
|
785
|
+
const openKnowledge = (primary) => `<button type="button"${primary ? ' class="primary"' : ''} data-dlg="knowledge" data-command-id="drawing-check.design-set-open-knowledge">Open Knowledge</button>`;
|
|
786
|
+
const issues = () => ((S.designSet && S.designSet.issues) || []);
|
|
787
|
+
const paint = (title, body, foot, focusSel) => {
|
|
788
|
+
titleEl.textContent = title; bodyEl.innerHTML = body; footEl.innerHTML = foot;
|
|
789
|
+
const el = focusSel && scrim.querySelector(focusSel);
|
|
790
|
+
(el || titleEl).focus?.();
|
|
791
|
+
};
|
|
792
|
+
titleEl.tabIndex = -1;
|
|
793
|
+
|
|
794
|
+
function paintIssues() {
|
|
795
|
+
st.step = 'issues';
|
|
796
|
+
if (S.designSetError || (S.designSet && S.designSet.status === 'unknown')) {
|
|
797
|
+
paint('Use the design set', `<p class="err-line" role="alert">FloLess couldn’t read this profile’s design set just now. You can still drop PDFs on Reference drawings.</p>`,
|
|
798
|
+
`${cancel}${openKnowledge(false)}<button type="button" class="primary" data-dlg="retry" data-command-id="drawing-check.design-set-retry">Try again</button>`, '[data-dlg="retry"]');
|
|
799
|
+
return;
|
|
800
|
+
}
|
|
801
|
+
const all = issues();
|
|
802
|
+
const shown = all.filter((i) => st.showWithdrawn || !i.withdrawnAt);
|
|
803
|
+
const hidden = all.filter((i) => i.withdrawnAt).length;
|
|
804
|
+
if (!all.length) {
|
|
805
|
+
paint('Use the design set', '<div class="band">This profile’s design set has no issues yet. Add the drawings as an issue in Knowledge, or drop the PDFs on Reference drawings instead.</div>',
|
|
806
|
+
`${cancel}${openKnowledge(true)}`, '[data-dlg="knowledge"]');
|
|
807
|
+
return;
|
|
808
|
+
}
|
|
809
|
+
if (!st.issueId || !shown.some((i) => i.issueId === st.issueId)) st.issueId = (shown.find((i) => i.issueId === S.designSet.current) || shown[0] || {}).issueId || null;
|
|
810
|
+
const row = (i) => `<label class="choice"><input type="radio" name="ds-issue" value="${esc(i.issueId)}"${i.issueId === st.issueId ? ' checked' : ''} data-command-id="drawing-check.design-set-issue#${esc(i.issueId)}" data-command-instance-label="${esc(i.label)}">
|
|
811
|
+
<span><b>${esc(i.label)}</b>${i.issueId === S.designSet.current ? '<span class="suggested">Current</span>' : ''}${i.withdrawnAt ? '<span class="suggested">Withdrawn</span>' : ''}
|
|
812
|
+
<span class="note" style="display:block">${i.issuedOn ? `Issued ${esc(shortDate(i.issuedOn))} · ` : ''}${(i.files || []).length} file${(i.files || []).length === 1 ? '' : 's'}</span></span></label>`;
|
|
813
|
+
paint('Use the design set',
|
|
814
|
+
`<p class="note">Choose an issue from this profile’s design set in Knowledge, then pick which of its drawings to add as references.</p>
|
|
815
|
+
<fieldset style="border:0;padding:0;margin:8px 0 0"><legend class="sr-only">Issue</legend>${shown.map(row).join('') || '<p class="note">Every issue is withdrawn.</p>'}</fieldset>
|
|
816
|
+
${hidden && !st.showWithdrawn ? `<button type="button" class="link" data-dlg="show-withdrawn" data-command-id="drawing-check.design-set-show-withdrawn">Show withdrawn issues (${hidden})</button>` : ''}`,
|
|
817
|
+
`${cancel}${st.issueId ? '<button type="button" class="primary" data-dlg="files" data-command-id="drawing-check.design-set-choose-files">Choose files</button>' : ''}`,
|
|
818
|
+
'input[name="ds-issue"]:checked');
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
async function loadPlan(keepTicks) {
|
|
822
|
+
paint(titleEl.textContent, '<p class="note"><span class="spin" aria-hidden="true"></span> Checking the files of this issue…</p>', cancel);
|
|
823
|
+
try {
|
|
824
|
+
const { body } = await call(`${base}/references/design-issue-plan?issueId=${encodeURIComponent(st.issueId)}`);
|
|
825
|
+
const prev = st.ticks;
|
|
826
|
+
st.plan = body;
|
|
827
|
+
st.ticks = new Set(body.files.filter((f) => f.selectable && (keepTicks ? prev.has(f.index) : f.ticked)).map((f) => f.index));
|
|
828
|
+
paintFiles();
|
|
829
|
+
} catch (e) {
|
|
830
|
+
paint('Use the design set', `<p class="err-line" role="alert">${esc(e.message || 'The files of this issue could not be checked just now.')}</p>`,
|
|
831
|
+
`${cancel}<button type="button" data-dlg="back" data-command-id="drawing-check.design-set-back">Back</button>`, '[data-dlg="back"]');
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
const countLine = () => pickerCountLine(st.plan, st.ticks);
|
|
836
|
+
function paintFoot() {
|
|
837
|
+
const n = st.ticks.size;
|
|
838
|
+
footEl.innerHTML = `<span class="note">${esc(countLine())}</span><button type="button" data-dlg="back" data-command-id="drawing-check.design-set-back">Back</button>`
|
|
839
|
+
+ (n ? `<button type="button" class="primary" data-dlg="add" data-command-id="drawing-check.design-set-add"${st.busy ? ' disabled' : ''}>${st.busy ? 'Adding…' : `Add ${n} drawing${n === 1 ? '' : 's'}`}</button>` : '');
|
|
840
|
+
}
|
|
841
|
+
function paintFiles() {
|
|
842
|
+
st.step = 'files';
|
|
843
|
+
const p = st.plan;
|
|
844
|
+
const fileRow = (f) => pickerFileRow(f, p, st.ticks.has(f.index));
|
|
845
|
+
const usable = p.files.filter((f) => f.selectable || f.status === 'already-reference');
|
|
846
|
+
const other = p.files.filter((f) => !f.selectable && f.status !== 'already-reference');
|
|
847
|
+
paint(`${p.label}${p.issuedOn ? ` · ${shortDate(p.issuedOn)}` : ''}`,
|
|
848
|
+
`<button type="button" class="link" data-dlg="back" data-command-id="drawing-check.design-set-back">← All issues</button>
|
|
849
|
+
${st.note ? `<div class="band" role="alert" style="margin-top:10px">${esc(st.note)}</div>` : ''}
|
|
850
|
+
${p.issueWithdrawn ? `<div class="band" style="margin-top:10px">${esc(p.label)} is withdrawn from the design set. Tick its files only if you mean to use them anyway.</div>` : ''}
|
|
851
|
+
<div class="ds-files" tabindex="0" aria-label="Files of ${esc(p.label)}" style="margin-top:10px">${usable.map(fileRow).join('') || '<p class="note">No file of this issue can be added.</p>'}
|
|
852
|
+
${other.length ? `<p class="where" style="margin-top:8px">Not available</p>${other.map(fileRow).join('')}` : ''}</div>`,
|
|
853
|
+
'', 'input[type="checkbox"]');
|
|
854
|
+
paintFoot();
|
|
855
|
+
live.textContent = countLine();
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
async function addPicked() {
|
|
859
|
+
if (st.busy || !st.ticks.size) return;
|
|
860
|
+
st.busy = true; paintFoot(); live.textContent = 'Adding…';
|
|
861
|
+
const p = st.plan;
|
|
862
|
+
try {
|
|
863
|
+
const { body } = await call(`${base}/references/design-issue`, jsonOpts('POST',
|
|
864
|
+
{ issueId: p.issueId, files: [...st.ticks].sort((a, b) => a - b), planKey: p.planKey, expected: p.expected },
|
|
865
|
+
p.draftEtag ? { 'if-match': p.draftEtag } : {}));
|
|
866
|
+
S.draft = S.draft || { references: [] };
|
|
867
|
+
S.draft.references = body.references; if (body.etag) S.etag = body.etag;
|
|
868
|
+
if (body.added.length) S.newSinceApproval += body.added.length;
|
|
869
|
+
const parts = [];
|
|
870
|
+
if (body.added.length) parts.push(`${body.added.length} drawing${body.added.length === 1 ? '' : 's'} added from ${body.label}.`);
|
|
871
|
+
for (const r of body.recorded) parts.push(`Recorded that ${r.name} came from ${body.label}.`);
|
|
872
|
+
if (!body.added.length && !body.recorded.length) parts.push(`Nothing changed: the chosen drawings are already references.`);
|
|
873
|
+
if (body.notAdded.length) parts.push(`${body.notAdded.length} not added: ${body.notAdded.map((n) => `${n.filename} (${n.reason})`).join('; ')}.`);
|
|
874
|
+
closeDialog(false);
|
|
875
|
+
try { await Promise.all([loadDraft(), loadReview(), loadDesignSet()]); }
|
|
876
|
+
catch { parts.push('Saved, but the page could not refresh. Reload the profile to see the latest.'); }
|
|
877
|
+
S.uploadNote = parts.join(' ');
|
|
878
|
+
render(); document.querySelector('[data-act="use-design-set"]')?.focus();
|
|
879
|
+
} catch (e) {
|
|
880
|
+
st.busy = false;
|
|
881
|
+
const code = e.body && e.body.code;
|
|
882
|
+
if (code === 'design-set-changed' || e.status === 412 || e.status === 428) {
|
|
883
|
+
st.note = code === 'design-set-changed' ? 'The design set changed — check the files again.' : 'The checklist changed in another window — check the files again.';
|
|
884
|
+
await Promise.all([loadDraft(), loadDesignSet()]).catch(() => {});
|
|
885
|
+
if (code === 'design-set-changed' && e.body.plan) {
|
|
886
|
+
const prev = st.ticks; st.plan = e.body.plan;
|
|
887
|
+
st.ticks = new Set(st.plan.files.filter((f) => f.selectable && prev.has(f.index)).map((f) => f.index));
|
|
888
|
+
paintFiles();
|
|
889
|
+
} else await loadPlan(true);
|
|
890
|
+
} else {
|
|
891
|
+
st.note = e.message || 'The drawings could not be added just now. Try again.';
|
|
892
|
+
paintFiles();
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
scrim.addEventListener('change', (e) => {
|
|
898
|
+
const t = e.target;
|
|
899
|
+
if (t.name === 'ds-issue') { st.issueId = t.value; return; }
|
|
900
|
+
if (st.step === 'files' && t.type === 'checkbox') {
|
|
901
|
+
const n = Number(t.value);
|
|
902
|
+
if (t.checked) st.ticks.add(n); else st.ticks.delete(n);
|
|
903
|
+
paintFoot(); live.textContent = countLine();
|
|
904
|
+
}
|
|
905
|
+
});
|
|
906
|
+
scrim.addEventListener('click', async (e) => {
|
|
907
|
+
const b = e.target.closest('[data-dlg]');
|
|
908
|
+
if (!b) return;
|
|
909
|
+
const what = b.dataset.dlg;
|
|
910
|
+
if (what === 'cancel') { closeDialog(); return; }
|
|
911
|
+
if (what === 'knowledge') {
|
|
912
|
+
try { parent.postMessage({ type: 'floless:open-knowledge', projectId: PROJECT }, location.origin); } catch { /* standalone tab */ }
|
|
913
|
+
closeDialog(); return;
|
|
914
|
+
}
|
|
915
|
+
if (what === 'retry') { await loadDesignSet(); paintIssues(); return; }
|
|
916
|
+
if (what === 'show-withdrawn') { st.showWithdrawn = true; paintIssues(); return; }
|
|
917
|
+
if (what === 'files') { st.note = ''; await loadPlan(false); return; }
|
|
918
|
+
if (what === 'back') { st.note = ''; paintIssues(); return; }
|
|
919
|
+
if (what === 'add') { await addPicked(); }
|
|
920
|
+
});
|
|
921
|
+
(async () => {
|
|
922
|
+
await loadDesignSet();
|
|
923
|
+
if (!openDialog || openDialog.scrim !== scrim) return;
|
|
924
|
+
if (startIssueId && issues().some((i) => i.issueId === startIssueId)) { if (issues().find((i) => i.issueId === startIssueId).withdrawnAt) st.showWithdrawn = true; await loadPlan(false); }
|
|
925
|
+
else paintIssues();
|
|
926
|
+
})();
|
|
927
|
+
}
|
|
559
928
|
async function uploadReferences(files) {
|
|
560
929
|
const pdfs = [...files].filter((f) => /\.pdf$/i.test(f.name) || f.type === 'application/pdf');
|
|
561
930
|
const skipped = files.length - pdfs.length;
|
|
@@ -596,7 +965,7 @@ function boot() {
|
|
|
596
965
|
return `<label class="check-row"><input type="checkbox" data-item="${esc(it.id)}" data-command-id="drawing-check.tick-item#${esc(it.id)}" data-command-instance-label="${esc(it.label)}"${it.enabled ? ' checked' : ''}>
|
|
597
966
|
<span class="lbl">${esc(it.label)}<span class="origin">${esc(origin)}</span></span>
|
|
598
967
|
${pct !== null ? `<span class="freq${pct < 50 ? ' rare' : ''}" data-tip="How often this held on the reference drawings"><span class="bar"><i style="width:${pct}%"></i></span>${pct}%</span>` : '<span></span>'}
|
|
599
|
-
<span class="kind">by code</span></label
|
|
968
|
+
<span class="kind">by code</span></label>${it.rule && it.rule.type === 'hole-bolt' ? clearancesHtml(it, S.clearNote) : ''}`;
|
|
600
969
|
}).join('');
|
|
601
970
|
return `<div class="wrap"><h2>Checklist</h2>
|
|
602
971
|
<p class="lede">Common doesn’t mean required. Tick only what this client needs.</p>
|
|
@@ -612,6 +981,54 @@ function boot() {
|
|
|
612
981
|
${changed && anyTicked ? `<div class="sticky-foot"><span class="note">${S.tbChanges && S.tbChanges.length ? 'Title block changed · ' : ''}${list.filter((i) => i.enabled).length} of ${list.length} items ticked. Runs use the approved checklist only.</span><span class="sp"></span>
|
|
613
982
|
<button type="button" class="primary" data-act="approve" data-command-id="drawing-check.approve">Approve checklist…</button></div>` : ''}</div>`;
|
|
614
983
|
}
|
|
984
|
+
function fillClearancesDialog(standard, returnFocus) {
|
|
985
|
+
const hole = items().find((i) => i.rule && i.rule.type === 'hole-bolt');
|
|
986
|
+
const n = hole && Array.isArray(hole.rule.clearances) ? hole.rule.clearances.length : 0;
|
|
987
|
+
if (!n) { putClearances(standard); return; }
|
|
988
|
+
const mine = hole.rule.clearances.filter((r) => r.source === 'person').length;
|
|
989
|
+
const learned = hole.rule.clearances.filter((r) => r.source === 'learned').length;
|
|
990
|
+
showDialog({
|
|
991
|
+
title: 'Replace the clearance table?',
|
|
992
|
+
body: `<p>This replaces the ${n} row${n === 1 ? '' : 's'} now in the table${mine ? `, ${mine} of them set by you,` : ''} with starter values from ${esc(STANDARD_NAMES[standard])}.${learned ? ` That includes ${learned} row${learned === 1 ? '' : 's'} learned from your drawings.` : ''}</p>
|
|
993
|
+
<p class="note">The checklist then has to be approved again.</p>`,
|
|
994
|
+
foot: `<button type="button" data-dlg="cancel">Cancel</button><button type="button" class="primary" data-dlg="replace">Replace with ${standard === 'us' ? 'US' : 'EN 1090-2'} starter values</button>`,
|
|
995
|
+
returnFocus,
|
|
996
|
+
onOpen: (scrim) => {
|
|
997
|
+
scrim.querySelector('[data-dlg="replace"]').focus();
|
|
998
|
+
scrim.addEventListener('click', (e) => {
|
|
999
|
+
const act = e.target.closest('[data-dlg]')?.dataset.dlg;
|
|
1000
|
+
if (act === 'cancel') closeDialog();
|
|
1001
|
+
if (act === 'replace') { closeDialog(); putClearances(standard); }
|
|
1002
|
+
});
|
|
1003
|
+
},
|
|
1004
|
+
});
|
|
1005
|
+
}
|
|
1006
|
+
// Rides the checklist queue: one draft, one etag, one PUT at a time.
|
|
1007
|
+
function putClearances(standard) {
|
|
1008
|
+
itemsInFlight++;
|
|
1009
|
+
return itemsQueue(async () => {
|
|
1010
|
+
S.checklistError = ''; S.clearNote = '';
|
|
1011
|
+
try {
|
|
1012
|
+
const { body } = await call(`${base}/clearances`, jsonOpts('PUT', { standard }, S.etag ? { 'if-match': S.etag } : {}));
|
|
1013
|
+
S.etag = body.etag;
|
|
1014
|
+
const filled = (body.items.find((i) => i.rule && i.rule.type === 'hole-bolt')?.rule.clearances || []).length;
|
|
1015
|
+
S.clearNote = `Filled with ${filled} starter row${filled === 1 ? '' : 's'} from ${STANDARD_NAMES[standard]}.`;
|
|
1016
|
+
// As putItems: only the LAST answer repaints the list, so ticks queued behind this fill never flick back.
|
|
1017
|
+
if (itemsInFlight === 1) { S.draft.items = body.items; await loadReview(); render(); }
|
|
1018
|
+
else {
|
|
1019
|
+
// Not the last answer: keep the filled rows (the table must match the note), leave the rest of the list as it stands.
|
|
1020
|
+
const mine = S.draft.items.find((i) => i.rule && i.rule.type === 'hole-bolt');
|
|
1021
|
+
const theirs = body.items.find((i) => i.rule && i.rule.type === 'hole-bolt');
|
|
1022
|
+
if (mine && theirs) mine.rule.clearances = theirs.rule.clearances;
|
|
1023
|
+
}
|
|
1024
|
+
} catch (e) {
|
|
1025
|
+
if (e.status === 412 || e.status === 428) S.conflict = true;
|
|
1026
|
+
else S.checklistError = e.message;
|
|
1027
|
+
await loadDraft().catch(() => {});
|
|
1028
|
+
render();
|
|
1029
|
+
} finally { itemsInFlight--; }
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
615
1032
|
// Checklist edits go out ONE AT A TIME. Two quick ticks used to send the second PUT with the etag the
|
|
616
1033
|
// page held before the first answered, which the server rightly refused (412) — shown as "changed in
|
|
617
1034
|
// another window" and the tick reverted. Each queued PUT reads S.etag when it actually goes out.
|
|
@@ -706,7 +1123,7 @@ function boot() {
|
|
|
706
1123
|
}
|
|
707
1124
|
|
|
708
1125
|
async function propose() {
|
|
709
|
-
S.checklistError = ''; S.uploadNote = '';
|
|
1126
|
+
S.checklistError = ''; S.uploadNote = ''; S.clearNote = '';
|
|
710
1127
|
const btn = root.querySelector('[data-act="propose"]'); if (btn) { btn.disabled = true; btn.textContent = 'Reading the reference drawings…'; }
|
|
711
1128
|
try {
|
|
712
1129
|
const { body } = await call(`${base}/propose`, { method: 'POST' });
|
|
@@ -750,7 +1167,13 @@ function boot() {
|
|
|
750
1167
|
openDialog = null; scrim.remove();
|
|
751
1168
|
if (!restore) return;
|
|
752
1169
|
if (returnFocus && returnFocus.isConnected) returnFocus.focus();
|
|
753
|
-
else {
|
|
1170
|
+
else {
|
|
1171
|
+
// The page was repainted under the dialog (a refresh, #2482): the same control's successor, found the way
|
|
1172
|
+
// paintKeepingFocus finds it, else the fallbacks the dialog named.
|
|
1173
|
+
const key = returnFocus && returnFocus.getAttribute ? focusKey(returnFocus) : null;
|
|
1174
|
+
const next = (key && root.querySelector(key)) || again.map((sel) => document.querySelector(sel)).find(Boolean);
|
|
1175
|
+
if (next) next.focus();
|
|
1176
|
+
}
|
|
754
1177
|
}
|
|
755
1178
|
|
|
756
1179
|
function addItemDialog() {
|
|
@@ -872,14 +1295,19 @@ function boot() {
|
|
|
872
1295
|
}
|
|
873
1296
|
|
|
874
1297
|
/** Store each picked PDF where a run can read it (the same visual-input store the workflow inputs use). */
|
|
1298
|
+
/**
|
|
1299
|
+
* Stage each picked file and return its stored path with the name the person knows it by. The store names the
|
|
1300
|
+
* copy by its digest, so the run is told the file's own name beside it (#2481).
|
|
1301
|
+
*/
|
|
875
1302
|
async function storeDrawings(files) {
|
|
876
|
-
const paths = [];
|
|
1303
|
+
const paths = [], names = [];
|
|
877
1304
|
for (const f of files) {
|
|
878
1305
|
const dataUrl = await new Promise((resolve, reject) => { const r = new FileReader(); r.onload = () => resolve(r.result); r.onerror = () => reject(new Error(`${f.name} could not be read.`)); r.readAsDataURL(f); });
|
|
879
1306
|
const { body } = await call('/api/visual-input', jsonOpts('POST', { appId: APP, name: 'drawings', dataUrl }));
|
|
880
1307
|
paths.push(body.path);
|
|
1308
|
+
names.push(f.name);
|
|
881
1309
|
}
|
|
882
|
-
return paths;
|
|
1310
|
+
return { paths, names };
|
|
883
1311
|
}
|
|
884
1312
|
/**
|
|
885
1313
|
* The latest approved checklist was made by a newer FloLess (owner ruling 7: it asks, it does not stop): say
|
|
@@ -947,18 +1375,18 @@ function boot() {
|
|
|
947
1375
|
if (!pdfs.length) return;
|
|
948
1376
|
S.runError = '';
|
|
949
1377
|
S.running = `Checking ${pdfs.length} drawing${pdfs.length === 1 ? '' : 's'}…`; render();
|
|
950
|
-
let paths;
|
|
951
|
-
try { paths = await storeDrawings(pdfs); }
|
|
1378
|
+
let paths, names;
|
|
1379
|
+
try { ({ paths, names } = await storeDrawings(pdfs)); }
|
|
952
1380
|
catch (e) { S.running = null; S.runError = e.message; render(); return; }
|
|
953
1381
|
let warnings = [];
|
|
954
1382
|
let version; // undefined: the latest approved version; a number: the earlier one the person chose
|
|
955
|
-
try { warnings = (await call(`${base}/preflight`, jsonOpts('POST', { drawings: paths }))).body.warnings || []; }
|
|
1383
|
+
try { warnings = (await call(`${base}/preflight`, jsonOpts('POST', { drawings: paths, names }))).body.warnings || []; }
|
|
956
1384
|
catch (e) {
|
|
957
1385
|
S.running = null; render();
|
|
958
1386
|
version = await fallbackDialog(e);
|
|
959
1387
|
if (version === null) { S.runError = e.message; render(); return; }
|
|
960
1388
|
S.running = `Checking ${pdfs.length} drawing${pdfs.length === 1 ? '' : 's'} against version ${version}…`; render();
|
|
961
|
-
try { warnings = (await call(`${base}/preflight`, jsonOpts('POST', { drawings: paths, version }))).body.warnings || []; }
|
|
1389
|
+
try { warnings = (await call(`${base}/preflight`, jsonOpts('POST', { drawings: paths, names, version }))).body.warnings || []; }
|
|
962
1390
|
catch (e2) { S.running = null; S.runError = e2.message; render(); return; }
|
|
963
1391
|
}
|
|
964
1392
|
let decisions = {};
|
|
@@ -966,10 +1394,20 @@ function boot() {
|
|
|
966
1394
|
S.running = null; render();
|
|
967
1395
|
decisions = await preflightDialog(warnings, pdfs.length);
|
|
968
1396
|
if (!decisions) return;
|
|
1397
|
+
// "Review the references first" (a reference's design-set issue changed): nothing is checked; the person goes
|
|
1398
|
+
// to Reference drawings instead. Their choice, not a stop — checking again offers the same question.
|
|
1399
|
+
if (Object.entries(decisions).some(([k, v]) => k.startsWith('reference-issue-changed:') && v === 'review')) {
|
|
1400
|
+
S.running = null;
|
|
1401
|
+
S.uploadNote = 'You chose to review the reference drawings first, so nothing was checked. Check the drawings again when you are ready.';
|
|
1402
|
+
await loadDesignSet();
|
|
1403
|
+
await showTab('references');
|
|
1404
|
+
document.getElementById('tab-references')?.focus();
|
|
1405
|
+
return;
|
|
1406
|
+
}
|
|
969
1407
|
S.running = `Checking ${pdfs.length} drawing${pdfs.length === 1 ? '' : 's'}…`; render();
|
|
970
1408
|
}
|
|
971
1409
|
try {
|
|
972
|
-
const { body } = await call(`${base}/runs`, jsonOpts('POST', { drawings: paths, decisions, ...(version !== undefined ? { version } : {}) }));
|
|
1410
|
+
const { body } = await call(`${base}/runs`, jsonOpts('POST', { drawings: paths, names, decisions, ...(version !== undefined ? { version } : {}) }));
|
|
973
1411
|
S.running = null;
|
|
974
1412
|
await loadRuns();
|
|
975
1413
|
await checkFinished(body.runId);
|
|
@@ -979,8 +1417,8 @@ function boot() {
|
|
|
979
1417
|
function preflightDialog(warnings, count) {
|
|
980
1418
|
return new Promise((resolve) => {
|
|
981
1419
|
const groups = warnings.map((w, gi) => {
|
|
982
|
-
const where = w
|
|
983
|
-
return `<fieldset><legend>${esc(w.message)}</legend>${where ? `<p class="where">${esc(where)}</p>` : ''}
|
|
1420
|
+
const where = warningWhere(w, []);
|
|
1421
|
+
return `<fieldset><legend>${esc(shortDigests(w.message))}</legend>${where ? `<p class="where">${esc(where)}</p>` : ''}
|
|
984
1422
|
${w.choices.map((c) => `<label class="choice"><input type="radio" name="w${gi}" value="${esc(c.id)}"${c.id === w.defaultChoice ? ' checked' : ''}><span>${esc(c.label)}${c.id === w.defaultChoice ? '<span class="suggested">Suggested</span>' : ''}</span></label>`).join('')}</fieldset>`;
|
|
985
1423
|
}).join('');
|
|
986
1424
|
let settled = false;
|
|
@@ -1077,7 +1515,7 @@ function boot() {
|
|
|
1077
1515
|
// A way out chosen later wins: this run arriving, or its wait ending, after it changes nothing.
|
|
1078
1516
|
if (my !== navSeq || !await leaveRun('open the other run') || my !== navSeq) return;
|
|
1079
1517
|
if (S.run) closeDialog(false);
|
|
1080
|
-
S.run = body.result; S.runLabels = body.labels || {}; S.sheet = 0; S.selectedN = null; S.itemNote = ''; S.exportCard = null; S.tab = 'runs';
|
|
1518
|
+
S.run = body.result; S.runLabels = body.labels || {}; S.runReferences = typeof body.referencesLine === 'string' ? body.referencesLine : ''; S.sheet = 0; S.selectedN = null; S.itemNote = ''; S.exportCard = null; S.tab = 'runs';
|
|
1081
1519
|
// Pending decisions are NOT cleared: they belong to their run, and only a refresh that shows them clears them.
|
|
1082
1520
|
S.carryNote = null; S.runStatus = null; lastFailed = false;
|
|
1083
1521
|
// This open's read is now the latest for the run.
|
|
@@ -1109,7 +1547,12 @@ function boot() {
|
|
|
1109
1547
|
if (S.run) closeDialog(false);
|
|
1110
1548
|
S.run = null; S.runStatus = null; lastFailed = false;
|
|
1111
1549
|
}
|
|
1550
|
+
const again = tab === 'references' && S.tab !== 'references';
|
|
1551
|
+
// The status line belongs to Reference drawings: leaving it clears it; a change read while away is said on coming back.
|
|
1552
|
+
if (tab !== 'references') S.liveNote = '';
|
|
1112
1553
|
S.tab = tab; render();
|
|
1554
|
+
// Opening Reference drawings reads them again: a change made elsewhere shows even if its event was missed (#2482).
|
|
1555
|
+
if (again) refreshSoon({ designSet: true, draft: true });
|
|
1113
1556
|
return true;
|
|
1114
1557
|
}
|
|
1115
1558
|
|
|
@@ -1327,13 +1770,13 @@ function boot() {
|
|
|
1327
1770
|
const strip = r.sheets.map((sh, i) => {
|
|
1328
1771
|
const f = sh.items.filter((x) => x.status === 'fail').length, q = sh.items.filter((x) => x.status === 'dont-know').length;
|
|
1329
1772
|
const sum = sh.status !== 'checked' ? 'Not looked at' : [f ? `${f} wrong` : '', q ? `${q} couldn’t tell` : ''].filter(Boolean).join(' · ') || 'All fine';
|
|
1330
|
-
return `<button type="button" class="sheet-btn" data-sheet="${i}" data-command-id="drawing-check.sheet" aria-current="${i === S.sheet}"><span class="sl">${esc(sh.sheetLabel || `${sh.drawing} p${sh.page}`)}</span><span class="ss">${esc(sum)}</span>${checkedFor(sh) ? '<span class="done">Checked</span>' : ''}</button>`;
|
|
1773
|
+
return `<button type="button" class="sheet-btn" data-sheet="${i}" data-command-id="drawing-check.sheet" aria-current="${i === S.sheet}"><span class="sl" data-tip="${esc(`${sh.drawing} · page ${sh.page}`)}">${esc(shortDigests(sh.sheetLabel || `${sh.drawing} p${sh.page}`))}</span><span class="ss">${esc(sum)}</span>${checkedFor(sh) ? '<span class="done">Checked</span>' : ''}</button>`;
|
|
1331
1774
|
}).join('');
|
|
1332
1775
|
const colours = statusColours(S.colours);
|
|
1333
1776
|
const legend = ['pass', 'fail', 'dont-know'].map((k) => `<span><svg width="18" height="8" aria-hidden="true"><line x1="1" y1="4" x2="17" y2="4" stroke="${esc(colours[k])}" stroke-width="${LINE[k].w + 0.6}" ${LINE[k].dash ? `stroke-dasharray="${LINE[k].dash}"` : ''}/></svg>${STATUS_WORD[k]}</span>`).join('')
|
|
1334
1777
|
+ `<span id="lg-accepted">${acceptedLegendHtml(colours)}</span>`
|
|
1335
1778
|
+ '<span><i class="hatched" aria-hidden="true"></i>FloLess doesn’t check</span>';
|
|
1336
|
-
return `<div class="runbar"><button type="button" data-act="back" data-command-id="drawing-check.back-to-runs">← Runs</button><span class="title">${esc(when)}</span><span class="note">${esc(r.profile.client)} · v${r.profile.version}</span
|
|
1779
|
+
return `<div class="runbar"><button type="button" data-act="back" data-command-id="drawing-check.back-to-runs">← Runs</button><span class="title">${esc(when)}</span><span class="note">${esc(r.profile.client)} · v${r.profile.version}</span>${S.runReferences ? `<span class="note" id="run-references">${esc(S.runReferences)}</span>` : ''}
|
|
1337
1780
|
${r.warnings.length ? `<button type="button" class="chip warn" data-act="warnings" data-command-id="drawing-check.show-decisions">${r.warnings.length} decision${r.warnings.length === 1 ? '' : 's'}</button>` : ''}
|
|
1338
1781
|
<span id="rb-sign">${unsignedChipHtml(r)}</span>
|
|
1339
1782
|
<span class="note" id="run-status" role="status" aria-live="polite" style="display:inline-flex;align-items:center;gap:6px">${runStatusHtml(S.runStatus)}</span>
|
|
@@ -1359,7 +1802,7 @@ function boot() {
|
|
|
1359
1802
|
const checked = checkedFor(s);
|
|
1360
1803
|
const open = s.items.filter((x) => x.status !== 'pass').length;
|
|
1361
1804
|
let out = auto ? `<div class="band">FloLess made ${auto} choice${auto === 1 ? '' : 's'} for you on safe defaults. <button type="button" class="link" data-act="warnings" data-command-id="drawing-check.show-decisions">See them</button></div>` : '';
|
|
1362
|
-
out += `<div class="sheet-head"><div class="grow"><div class="t">Sheet ${S.sheet + 1} of ${r.sheets.length} · ${esc(s.sheetLabel || s.drawing)}</div><div class="s">${esc(s.drawing)}
|
|
1805
|
+
out += `<div class="sheet-head"><div class="grow"><div class="t">Sheet ${S.sheet + 1} of ${r.sheets.length} · ${esc(shortDigests(s.sheetLabel || s.drawing))}</div><div class="s"><span class="nm" data-tip="${esc(s.drawing)}">${esc(shortDigests(s.drawing))}</span><span class="pg"> · page ${s.page}</span></div></div>
|
|
1363
1806
|
${checked ? `<span class="marked" role="status">Checked by ${esc(checked.by)} · ${esc(new Date(checked.at).toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' }))}</span>` : `<button type="button" data-act="mark" data-command-id="drawing-check.mark-checked">Mark checked, by me</button>`}</div>`;
|
|
1364
1807
|
if (!checked && open) out += `<p class="note">${open} item${open === 1 ? ' is' : 's are'} still open. You can still mark it checked.</p>`;
|
|
1365
1808
|
if (s.labels && s.labels.length) out += s.labels.map((l) => `<p class="note">${esc(l)}</p>`).join('');
|
|
@@ -1566,7 +2009,8 @@ function boot() {
|
|
|
1566
2009
|
title: 'Decisions in this run',
|
|
1567
2010
|
body: r.warnings.map((w) => {
|
|
1568
2011
|
const chosen = (w.choices.find((c) => c.id === (w.decided ?? w.defaultChoice)) || {}).label || w.decided || w.defaultChoice;
|
|
1569
|
-
|
|
2012
|
+
const where = warningWhere(w, r.sheets);
|
|
2013
|
+
return `<fieldset><legend>${esc(shortDigests(w.message))}</legend>${where ? `<p class="where">${esc(where)}</p>` : ''}<p class="where">${esc(w.decided === null ? 'FloLess applied the safe default:' : 'You chose:')} ${esc(chosen)}</p></fieldset>`;
|
|
1570
2014
|
}).join(''),
|
|
1571
2015
|
foot: '<button type="button" class="primary" data-dlg="close">Close</button>',
|
|
1572
2016
|
onOpen: (sc) => { sc.querySelector('[data-dlg="close"]').focus(); sc.addEventListener('click', (e) => { if (e.target.closest('[data-dlg]')) closeDialog(); }); },
|
|
@@ -1656,10 +2100,16 @@ function boot() {
|
|
|
1656
2100
|
first?.focus({ preventScroll: true });
|
|
1657
2101
|
return;
|
|
1658
2102
|
}
|
|
1659
|
-
|
|
2103
|
+
// A refresh waits for this load (refreshNow awaits `loaded`), so a change announced while it runs is read after it.
|
|
2104
|
+
if (act === 'reload') { S.conflict = false; S.checklistError = ''; await (loaded = loadAll()); return; }
|
|
1660
2105
|
if (act === 'pick-refs') { document.getElementById('ref-file')?.click(); return; }
|
|
2106
|
+
if (act === 'use-design-set') { designSetDialog(t); return; }
|
|
2107
|
+
if (act === 'pick-again') { designSetDialog(t, t.dataset.issue); return; }
|
|
2108
|
+
if (act === 'remove-ref') { removeReferenceDialog(t.dataset.sha, t); return; }
|
|
2109
|
+
if (act === 'keep-copy') { const sha = t.dataset.sha; if (S.kept.has(sha)) S.kept.delete(sha); else S.kept.add(sha); render(); document.querySelector(`[data-act="keep-copy"][data-sha="${sha}"]`)?.focus(); return; }
|
|
1661
2110
|
if (act === 'propose') { await propose(); return; }
|
|
1662
2111
|
if (act === 'add-item') { addItemDialog(); return; }
|
|
2112
|
+
if (act === 'fill-clearances') { fillClearancesDialog(t.dataset.standard, t); return; }
|
|
1663
2113
|
if (act === 'approve') { approveDialog(); return; }
|
|
1664
2114
|
if (act === 'check') { document.getElementById('run-file')?.click(); return; }
|
|
1665
2115
|
if (act === 'back') { await backToRuns(); return; }
|
|
@@ -1764,8 +2214,74 @@ function boot() {
|
|
|
1764
2214
|
window.contractSaveState = contractSaveState; window.flushContract = flushContract;
|
|
1765
2215
|
window.addEventListener('beforeunload', (e) => { if (inFlight.size) { e.preventDefault(); e.returnValue = ''; } });
|
|
1766
2216
|
|
|
2217
|
+
// ── keeping the page current (#2482) ──
|
|
2218
|
+
// The design set and the references can change while this page is open: in the project's Knowledge step, from an
|
|
2219
|
+
// AI Chat card, in another window. The page reads them again when the server says so (relayed by the workspace,
|
|
2220
|
+
// liveRefreshFor), when the person comes back to the Checker step, and when they open Reference drawings — the last
|
|
2221
|
+
// two also cover a missed event. Reads are coalesced and go out on the checklist queue, so they never interleave with a checklist PUT.
|
|
2222
|
+
let want = {}, refreshTimer = null, loaded = null;
|
|
2223
|
+
function refreshSoon(what) {
|
|
2224
|
+
if (what.designSet) want.designSet = true;
|
|
2225
|
+
if (what.draft) {
|
|
2226
|
+
want.draft = true;
|
|
2227
|
+
// A contract change names its etag; anything else (a reconnect, coming back) reads the draft whatever it holds.
|
|
2228
|
+
// Two different etags in one burst also read it: the page may hold the newer one from its own write (Propose
|
|
2229
|
+
// adopts it without re-reading the references) while the other came from elsewhere.
|
|
2230
|
+
if (!what.etag || (want.etag && want.etag !== what.etag)) want.anyDraft = true;
|
|
2231
|
+
else want.etag = what.etag;
|
|
2232
|
+
}
|
|
2233
|
+
clearTimeout(refreshTimer);
|
|
2234
|
+
refreshTimer = setTimeout(refreshNow, 200);
|
|
2235
|
+
}
|
|
2236
|
+
function refreshNow() {
|
|
2237
|
+
// Wait for this page's own writes: their answer brings the new etag, so their echo is not read as news.
|
|
2238
|
+
if (ownWrites) { refreshTimer = setTimeout(refreshNow, 300); return; }
|
|
2239
|
+
const w = want; want = {};
|
|
2240
|
+
void itemsQueue(async () => {
|
|
2241
|
+
if (loaded) await loaded; // what was read before the page first painted is not a change
|
|
2242
|
+
if (S.loadError) return; // the page shows why it could not load, with Reload
|
|
2243
|
+
const draft = !!w.draft && (!!w.anyDraft || w.etag !== S.etag);
|
|
2244
|
+
if (!draft && !w.designSet) return;
|
|
2245
|
+
const was = { refs: references(), designSet: S.designSetError ? null : S.designSet };
|
|
2246
|
+
const seq = ownWriteSeq;
|
|
2247
|
+
const before = JSON.stringify([S.draft, S.etag, S.designSet, S.designSetError, S.review]);
|
|
2248
|
+
let failed = false;
|
|
2249
|
+
await Promise.all([
|
|
2250
|
+
w.designSet ? loadDesignSet() : null,
|
|
2251
|
+
draft ? loadDraft().then(loadReview).catch(() => { failed = true; }) : null,
|
|
2252
|
+
]);
|
|
2253
|
+
if (before === JSON.stringify([S.draft, S.etag, S.designSet, S.designSetError, S.review]) && !failed) return;
|
|
2254
|
+
const note = referencesChangeNote(was, { refs: references(), designSet: S.designSetError ? null : S.designSet });
|
|
2255
|
+
if (failed) S.liveNote = 'This page could not read the latest reference drawings just now. Reload the profile to see them.';
|
|
2256
|
+
// A write of this page's own that started while these reads were out may be what they found: it is shown, but
|
|
2257
|
+
// not announced as a change made elsewhere (the page says what its own changes did).
|
|
2258
|
+
else if (note && !ownWrites && ownWriteSeq === seq) S.liveNote = note;
|
|
2259
|
+
// The run on screen does not show the references or the design set: it is left alone, and the next paint shows
|
|
2260
|
+
// what was read.
|
|
2261
|
+
if (S.tab === 'runs' && S.run) return;
|
|
2262
|
+
const scroller = root.querySelector('section[role=tabpanel]');
|
|
2263
|
+
const top = scroller ? scroller.scrollTop : 0;
|
|
2264
|
+
render();
|
|
2265
|
+
const again = root.querySelector('section[role=tabpanel]');
|
|
2266
|
+
if (again && top) again.scrollTop = top;
|
|
2267
|
+
});
|
|
2268
|
+
}
|
|
2269
|
+
// The workspace relays what changed (from its own event stream; this page opens none, see tellModelFrame in
|
|
2270
|
+
// workspaces.js) and says when the Checker step is shown again (setStep). Only from the workspace that holds this
|
|
2271
|
+
// page, and only for this profile.
|
|
2272
|
+
window.addEventListener('message', (e) => {
|
|
2273
|
+
const m = e.data;
|
|
2274
|
+
if (e.origin !== location.origin || e.source !== window.parent || !m || m.projectId !== PROJECT) return;
|
|
2275
|
+
if (m.type === 'floless:step-shown') { refreshSoon({ designSet: true, draft: true }); return; }
|
|
2276
|
+
if (m.type !== 'floless:project-event') return;
|
|
2277
|
+
const what = liveRefreshFor(m.frame, { app: APP, project: PROJECT });
|
|
2278
|
+
if (what) refreshSoon(what);
|
|
2279
|
+
});
|
|
2280
|
+
|
|
1767
2281
|
if (!PROJECT) { root.innerHTML = '<section role="tabpanel"><p class="err-line">Open this page from a Drawing Checker project.</p></section>'; return; }
|
|
1768
|
-
|
|
2282
|
+
// The listener above is already in place, so a change made while the page loads is not missed; a refresh waits for
|
|
2283
|
+
// the load (refreshNow).
|
|
2284
|
+
loaded = loadAll();
|
|
1769
2285
|
}
|
|
1770
2286
|
|
|
1771
2287
|
if (typeof document !== 'undefined' && document.getElementById('dc-root')) boot();
|