@floless/app 0.172.0 → 0.172.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/floless-server.cjs +16893 -12178
- package/dist/schemas/drawing-check.profile.v1.schema.json +7 -1
- package/dist/skills/floless-app-steel-model/SKILL.md +2 -2
- package/dist/skills/floless-app-steel-model/references/elements.md +45 -5
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +6 -2
- package/dist/web/app.css +62 -0
- package/dist/web/aware.js +34 -3
- package/dist/web/chat.js +19 -1
- package/dist/web/commands-drawing-check.js +2 -0
- package/dist/web/commands-shell.js +34 -0
- package/dist/web/commands-steel.js +50 -0
- package/dist/web/drawing-check-editor.html +9 -0
- package/dist/web/drawing-check-editor.js +127 -14
- package/dist/web/element-plan.js +98 -0
- package/dist/web/index.html +24 -0
- package/dist/web/instructor.js +1 -0
- package/dist/web/model-elements.js +256 -15
- package/dist/web/pdf-active-content.js +38 -0
- package/dist/web/steel-3d-view.js +5 -1
- package/dist/web/steel-ai-marks.js +19 -3
- package/dist/web/steel-catalog-picker.js +7 -2
- package/dist/web/steel-editor.html +164 -14
- package/dist/web/steel-profile-card-state.js +378 -0
- package/dist/web/steel-profile-card.js +778 -0
- package/dist/web/steel-shape-sketch-core.js +380 -0
- package/dist/web/steel-shape-sketcher.js +595 -0
- package/dist/web/workspaces.js +340 -26
- package/package.json +2 -1
|
@@ -286,10 +286,11 @@ export function mainPartHtml(it, { touched = false, note = '', locatedOn = false
|
|
|
286
286
|
* bare number (only then can it change a reading); '' otherwise. `bareInchSeen` says what the references showed.
|
|
287
287
|
* @param {any} lengths @param {{ touched?: boolean, note?: string }} [opts]
|
|
288
288
|
*/
|
|
289
|
-
export function bareInchHtml(lengths, { touched = false, note = '' } = {}) {
|
|
289
|
+
export function bareInchHtml(lengths, { touched = false, note = '', holeNote = '', seenOpen = false } = {}) {
|
|
290
290
|
if (!lengths || lengths.system !== 'imperial' || lengths.unitless) {
|
|
291
291
|
// No control here, but a choice saved on such a checklist (applied again after it changed) still says what it did.
|
|
292
|
-
|
|
292
|
+
const said = [note, holeNote].filter(Boolean).map((n) => `<p class="note" role="status">${esc(n)}</p>`).join('');
|
|
293
|
+
return said ? `<section class="tb" aria-labelledby="dim-h"><h3 id="dim-h">Lengths</h3>${said}</section>` : '';
|
|
293
294
|
}
|
|
294
295
|
const on = lengths.bareInchValues === true, seen = lengths.bareInchSeen;
|
|
295
296
|
const plural = (n, one, many) => `${n} ${n === 1 ? one : many}`;
|
|
@@ -309,11 +310,53 @@ export function bareInchHtml(lengths, { touched = false, note = '' } = {}) {
|
|
|
309
310
|
const why = `${does} ${source}`;
|
|
310
311
|
const opt = (v, isOn, words) => `<button type="button" role="radio" aria-checked="${isOn}" tabindex="${isOn ? 0 : -1}" data-bare-inches="${esc(v)}" data-command-id="drawing-check.bare-inches#${esc(v)}" data-command-instance-label="${esc(words)}">${esc(words)}</button>`;
|
|
311
312
|
// A setting of the whole checklist, not of one item: a section of its own, as the title block and the part list.
|
|
312
|
-
return `<section class="tb" aria-labelledby="dim-h"><h3 id="dim-h">
|
|
313
|
+
return `<section class="tb" aria-labelledby="dim-h"><h3 id="dim-h">Lengths</h3><div class="clear-panel">
|
|
313
314
|
<p class="clear-head"><span id="bare-inch-h">Does this client write inches without a mark, such as 4 or 6 1/2?</span> <span class="chip">${esc(chip)}</span></p>
|
|
314
315
|
<div class="seg" role="radiogroup" aria-labelledby="bare-inch-h" aria-describedby="bare-inch-note">${opt('yes', on, 'Yes, read them as inches')}${opt('no', !on, 'No, say couldn’t tell')}</div>
|
|
315
316
|
<p class="note" id="bare-inch-note">${esc(why)} It applies to dimension values only.</p>
|
|
316
|
-
${note ? `<p class="note" role="status">${esc(note)}</p>` : ''}</div
|
|
317
|
+
${note ? `<p class="note" role="status">${esc(note)}</p>` : ''}</div>${bareNoteHtml(lengths, holeNote, seenOpen)}</section>`;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* “Hole and bolt notes: inches without a mark” (#2459 ACC): whether a size written alone in a hole or bolt note, such as
|
|
321
|
+
* 15/16 HOLE, is read as inches. Never learned: the references only count the notes for and against and suggest it,
|
|
322
|
+
* and only the person turns it on. One turned on from chat (`bareNoteBy: 'chat'`) changes no reading and shows as
|
|
323
|
+
* waiting for them, with neither answer chosen, so choosing Yes is the confirmation. `bareNoteSeen` is the count.
|
|
324
|
+
* @param {any} lengths @param {string} [note] @param {boolean} [seenOpen] the list of notes is open (kept across a repaint)
|
|
325
|
+
*/
|
|
326
|
+
export function bareNoteHtml(lengths, note = '', seenOpen = false) {
|
|
327
|
+
const seen = lengths.bareNoteSeen, by = lengths.bareNoteBy;
|
|
328
|
+
const mine = by === 'person', fromChat = by === 'chat' && lengths.bareNoteInches === true;
|
|
329
|
+
const on = mine && lengths.bareNoteInches === true;
|
|
330
|
+
const plural = (n, one, many) => `${n} ${n === 1 ? one : many}`;
|
|
331
|
+
const notes = seen ? `${plural(seen.for, 'bolt note', 'bolt notes')} like this on ${plural(seen.sheets, 'sheet', 'sheets')}` : '';
|
|
332
|
+
const chip = fromChat ? 'from chat, not yet confirmed by you' : mine ? 'set by you'
|
|
333
|
+
: !seen ? 'not counted yet' : seen.proposed ? 'suggested by the references' : seen.against ? 'written both ways in the references'
|
|
334
|
+
: seen.for ? 'too few seen in the references' : 'none found in the references';
|
|
335
|
+
const does = on ? 'FloLess reads a size written alone in a hole or bolt note as inches: fractions and whole numbers in the usual range for a bolt or its hole, never decimals.'
|
|
336
|
+
: 'FloLess does not guess: a size written alone in a hole or bolt note is reported as couldn’t tell.';
|
|
337
|
+
const shown = !seen ? 'FloLess has not counted these on your references yet: proposing again from the references counts them.'
|
|
338
|
+
: seen.proposed ? `Your references show ${notes}, and none written another way.`
|
|
339
|
+
: seen.against ? `Your references show ${notes}, and also ${plural(seen.against, 'note', 'notes')} written another way, so FloLess does not suggest it.`
|
|
340
|
+
: seen.for ? `Your references show only ${notes}. FloLess suggests it at 4 bolt notes on 2 sheets.`
|
|
341
|
+
: 'FloLess found no such bolt notes on your references.';
|
|
342
|
+
const source = fromChat ? 'It was turned on from chat, so it changes no reading until you choose Yes here.'
|
|
343
|
+
: mine ? `You set this; proposing again keeps it. ${shown}` : `${shown} Choose Yes if this client writes them that way.`;
|
|
344
|
+
const opt = (v, isOn, focus, words) => `<button type="button" role="radio" aria-checked="${isOn}" tabindex="${focus ? 0 : -1}" data-bare-note="${esc(v)}" data-command-id="drawing-check.bare-note-inches#${esc(v)}" data-command-instance-label="${esc(words)}">${esc(words)}</button>`;
|
|
345
|
+
const ex = (seen && seen.examples) || [];
|
|
346
|
+
const rows = (side) => ex.filter((e) => e.side === side).map((e) => `<li>${esc(e.drawing)} · p. ${esc(e.page)}: “${esc(e.text)}”, ${esc(e.read)}</li>`).join('');
|
|
347
|
+
const listed = (side, n, head) => {
|
|
348
|
+
const r = rows(side), shownN = ex.filter((e) => e.side === side).length;
|
|
349
|
+
return r ? `<p class="note">${esc(head)}${n > shownN ? ` (${shownN} of ${n} shown)` : ''}</p><ul>${r}</ul>` : '';
|
|
350
|
+
};
|
|
351
|
+
const evidence = ex.length ? `<div class="wording"><details data-bare-note-seen${seenOpen ? ' open' : ''}><summary id="bare-note-seen" data-command-id="drawing-check.bare-note-seen">What the references show: ${esc(plural(seen.for, 'note', 'notes'))} for, ${esc(String(seen.against))} against</summary>
|
|
352
|
+
${listed('for', seen.for, 'Written as inches without a mark')}${listed('against', seen.against, 'Written another way')}</details></div>` : '';
|
|
353
|
+
return `<div class="clear-panel">
|
|
354
|
+
<p class="clear-head"><span id="bare-note-h">Hole and bolt notes: inches without a mark</span> <span class="chip${fromChat ? ' warn' : ''}">${esc(chip)}</span></p>
|
|
355
|
+
<p class="note" id="bare-note-q">Does this client write hole and bolt sizes with no unit mark, such as 15/16 HOLE or 7/8 DIA x 0’-2 A325N?</p>
|
|
356
|
+
${fromChat ? '<div class="band ask-band" role="note"><span>Turned on from chat, not yet confirmed by you. Choose Yes to read them as inches, or No to turn it off.</span></div>' : ''}
|
|
357
|
+
<div class="seg" role="radiogroup" aria-labelledby="bare-note-h bare-note-q" aria-describedby="bare-note-note">${opt('yes', on, on || fromChat, 'Yes, read them as inches')}${opt('no', !on && !fromChat, !on && !fromChat, 'No, say couldn’t tell')}</div>
|
|
358
|
+
<p class="note" id="bare-note-note">${esc(`${does} ${source}`)} It applies to hole and bolt notes only.</p>
|
|
359
|
+
${evidence}${note ? `<p class="note" role="status">${esc(note)}</p>` : ''}</div>`;
|
|
317
360
|
}
|
|
318
361
|
/** The largest line break a checklist may set, pt (server `MAX_LINE_BREAK_PT`). */
|
|
319
362
|
export const MAX_LINE_BREAK_PT = 3;
|
|
@@ -369,7 +412,7 @@ export function clientFieldHtml(client) {
|
|
|
369
412
|
// ── keeping keyboard focus across a re-render (pure, exported for server/drawing-check-ui.test.ts) ─
|
|
370
413
|
|
|
371
414
|
/** The attributes that name a control stably across re-renders, in the order they are tried. */
|
|
372
|
-
const FOCUS_KEYS = ['data-main-row', 'data-bare-inches', 'data-tb-label', 'data-tb-required', 'data-tb-remove', 'data-typed-label', 'data-typed-use', 'data-type-label', 'data-item', 'data-tab', 'data-conv-summary', 'data-conv-cites-summary', 'data-act', 'id'];
|
|
415
|
+
const FOCUS_KEYS = ['data-main-row', 'data-bare-inches', 'data-bare-note','data-tb-label', 'data-tb-required', 'data-tb-remove', 'data-typed-label', 'data-typed-use', 'data-type-label', 'data-item', 'data-tab', 'data-conv-summary', 'data-conv-cites-summary', 'data-act', 'id'];
|
|
373
416
|
const attrEsc = (v) => String(v).replace(/["\\]/g, '\\$&');
|
|
374
417
|
/**
|
|
375
418
|
* A selector that finds "the same control" in freshly rendered markup, or null. A read-mode button is
|
|
@@ -1056,7 +1099,7 @@ function boot() {
|
|
|
1056
1099
|
tab: null, loadError: '', uploadNote: '', newSinceApproval: 0, checklistError: '', conflict: false, titleNote: '', titleNoteField: '', tbSaving: false, tbChanges: [], typed: {},
|
|
1057
1100
|
running: null, run: null, sheet: 0, selectedN: null, itemNote: '', exportCard: null, runError: '',
|
|
1058
1101
|
// #2459 slice 1b: a note under Check drawings (the AI Chat detour), and whether the wording disclosure is open.
|
|
1059
|
-
runNote: '', wordingOpen: false,
|
|
1102
|
+
runNote: '', wordingOpen: false, noteSeenOpen: false,
|
|
1060
1103
|
// Decisions recorded but not yet shown by a refresh, per run id (see stillPending). Only the run on screen writes
|
|
1061
1104
|
// it; it is kept per run so that coming back to a run whose decisions still cannot be read never brings back the
|
|
1062
1105
|
// actions that would record one twice (defect A).
|
|
@@ -1275,7 +1318,7 @@ function boot() {
|
|
|
1275
1318
|
if (!res.ok) throw new Error('This profile could not be read. Reload to try again.');
|
|
1276
1319
|
const draft = await res.json(), etag = res.headers.get('ETag');
|
|
1277
1320
|
if (stale()) return 'stale';
|
|
1278
|
-
S.clearNote = ''; S.mainNote = ''; S.bareNote = ''; S.breakNote = ''; S.breakError = ''; S.breakTyped = null; // a note about the last change says nothing true about a draft read afresh
|
|
1321
|
+
S.clearNote = ''; S.mainNote = ''; S.bareNote = ''; S.holeNote = ''; S.breakNote = ''; S.breakError = ''; S.breakTyped = null; // a note about the last change says nothing true about a draft read afresh
|
|
1279
1322
|
const same = etag === S.saved.etag && S.complete;
|
|
1280
1323
|
adopt({ draft, etag });
|
|
1281
1324
|
return same ? 'same' : 'adopted';
|
|
@@ -1436,6 +1479,7 @@ function boot() {
|
|
|
1436
1479
|
sayRefsChange();
|
|
1437
1480
|
refsDrawnKey = refsKey();
|
|
1438
1481
|
const refs = references();
|
|
1482
|
+
askRefActive(refs);
|
|
1439
1483
|
const drop = (compact) => `<button type="button" class="drop${compact ? ' compact' : ''}" data-act="pick-refs" data-command-id="drawing-check.add-references">
|
|
1440
1484
|
<b>${compact ? 'Add more reference drawings' : 'Drop the shop drawings this client already signed off'}</b>
|
|
1441
1485
|
<span>${compact ? 'Drop PDFs here, or choose files' : 'PDF files. The checklist is proposed from what these drawings have in common.'}</span></button>`;
|
|
@@ -1456,6 +1500,7 @@ function boot() {
|
|
|
1456
1500
|
const dsUrl = `/api/projects/${encodeURIComponent(PROJECT)}/design-set`;
|
|
1457
1501
|
let designSetSeq = 0;
|
|
1458
1502
|
async function loadDesignSet() {
|
|
1503
|
+
askRefActive(references(), true);
|
|
1459
1504
|
const my = ++designSetSeq;
|
|
1460
1505
|
// Only the latest read is shown: an answer that a newer read has overtaken would put an older design set back.
|
|
1461
1506
|
try { const { body } = await call(dsUrl, { signal: AbortSignal.timeout(READ_TIMEOUT_MS) }); if (my === designSetSeq) { S.designSet = body; S.designSetError = ''; } }
|
|
@@ -1467,15 +1512,46 @@ function boot() {
|
|
|
1467
1512
|
return Number.isFinite(t) ? new Date(t).toLocaleDateString('en-GB', { day: 'numeric', month: 'short', year: 'numeric', timeZone: 'UTC' }) : (d || '');
|
|
1468
1513
|
};
|
|
1469
1514
|
const referenceDrift = (r) => referenceDriftText(r, S.designSetError ? null : S.designSet);
|
|
1515
|
+
// #3646: what each reference PDF carries besides its drawings. The references live in the draft, which this page saves
|
|
1516
|
+
// back as it is, so their answers are asked for here: once per PDF, and again when the server says one changed (its
|
|
1517
|
+
// `knowledge-changed` re-reads the design set, above) for any whose answer can still change. A row shows the answer
|
|
1518
|
+
// it had until the new one is in.
|
|
1519
|
+
const refActive = new Map(); // sha256 -> { view, asking }
|
|
1520
|
+
const refActiveFinal = (v) => !!v && (v.state === 'none' || (v.state === 'found' && v.complete === true));
|
|
1521
|
+
const refActiveShown = (v) => (globalThis.flolessActiveContent?.shows(v) ? `${v.label}|${v.note}` : '');
|
|
1522
|
+
function askRefActive(refs, again = false) {
|
|
1523
|
+
if (!PROJECT) return;
|
|
1524
|
+
for (const r of refs) {
|
|
1525
|
+
const sha = String(r.sha256 || '');
|
|
1526
|
+
const had = refActive.get(sha);
|
|
1527
|
+
if (!/^[0-9a-f]{64}$/.test(sha) || (had && (had.asking || !again || refActiveFinal(had.view)))) continue;
|
|
1528
|
+
refActive.set(sha, { view: had && had.view, asking: true });
|
|
1529
|
+
call(`/api/projects/${encodeURIComponent(PROJECT)}/sources/${sha}/active-content`, { signal: AbortSignal.timeout(READ_TIMEOUT_MS) })
|
|
1530
|
+
.then(({ body }) => body, (e) => { console.warn('drawing check: could not ask what a reference PDF carries', String((e && e.message) || e)); return had && had.view; })
|
|
1531
|
+
.then((view) => {
|
|
1532
|
+
const before = refActive.get(sha);
|
|
1533
|
+
refActive.set(sha, { view, asking: false });
|
|
1534
|
+
if (refActiveShown(before && before.view) !== refActiveShown(view) && S.tab === 'references' && !S.run) renderKeepingScroll();
|
|
1535
|
+
});
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1470
1538
|
function referenceRow(r) {
|
|
1471
1539
|
const d = r.designIssue;
|
|
1472
1540
|
const drift = referenceDrift(r);
|
|
1473
1541
|
const kept = S.kept.has(r.sha256);
|
|
1474
1542
|
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>` : '';
|
|
1475
1543
|
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>`;
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1544
|
+
// #3646: what this PDF carries besides its drawings (scripts and the like), with its sentence on a line of its own:
|
|
1545
|
+
// FloLess keeps the drawing unchanged and only says what it found. Nothing shows for one that carries none.
|
|
1546
|
+
const ac = globalThis.flolessActiveContent;
|
|
1547
|
+
const acBody = refActive.get(r.sha256)?.view;
|
|
1548
|
+
const acShown = !!(ac && ac.shows(acBody));
|
|
1549
|
+
const acFinding = acShown && ac.isFinding(acBody);
|
|
1550
|
+
const acChip = acShown ? `<span class="chip${acFinding ? ' warn' : ''}" data-tip="${esc(acBody.tip || acBody.note)}">${esc(acBody.label)}</span>` : '';
|
|
1551
|
+
const acLine = acShown ? `<p class="note active-note${acFinding ? '' : ' unchecked'}">${esc(acBody.note)}</p>` : '';
|
|
1552
|
+
const head = `<span class="grow">${esc(r.name)}</span>${chip}${acChip}<span class="meta">${r.pages} page${r.pages === 1 ? '' : 's'}</span>${remove}`;
|
|
1553
|
+
if (!drift) return acShown ? `<div class="has-active">${head}${acLine}</div>` : `<div>${head}</div>`;
|
|
1554
|
+
return `<div class="drift${acShown ? ' has-active' : ''}">${head}${acLine}<div class="drift-body"><p class="warn-line">${esc(drift)}</p>
|
|
1479
1555
|
<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>
|
|
1480
1556
|
<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>
|
|
1481
1557
|
${kept ? '<span class="note">Keeping the approved copy. Runs still check against it.</span>' : ''}</div></div></div>`;
|
|
@@ -1772,7 +1848,7 @@ function boot() {
|
|
|
1772
1848
|
${band}
|
|
1773
1849
|
${S.checklistError ? `<p class="err-line" role="alert">${esc(S.checklistError)}</p>` : ''}
|
|
1774
1850
|
${list.length ? `<div class="list">${rows}</div>` : '<p class="note">No items yet. Propose them from the reference drawings.</p>'}
|
|
1775
|
-
${bareInchHtml(S.draft && S.draft.lengths, { touched: ((S.draft && S.draft.touched) || []).includes('lengths.bareInchValues'), note: S.bareNote })}
|
|
1851
|
+
${bareInchHtml(S.draft && S.draft.lengths, { touched: ((S.draft && S.draft.touched) || []).includes('lengths.bareInchValues'), note: S.bareNote, holeNote: S.holeNote, seenOpen: S.noteSeenOpen })}
|
|
1776
1852
|
${titleBlockHtml(S.draft && S.draft.titleBlock, { pages, note: S.titleNote, noteField: S.titleNoteField, saving: S.tbSaving, typed: S.typed })}
|
|
1777
1853
|
${partListHtml(S.draft && S.draft.partList, { proposed: list.length > 0 })}
|
|
1778
1854
|
${S.reviewError ? `<p class="note">${esc(S.reviewError)}</p>` : ''}
|
|
@@ -1962,6 +2038,32 @@ function boot() {
|
|
|
1962
2038
|
redo: () => putBareInches(bareInches),
|
|
1963
2039
|
});
|
|
1964
2040
|
}
|
|
2041
|
+
// “Hole and bolt notes: inches without a mark” (#2459 ACC). A choice in this window is the person's (the server says
|
|
2042
|
+
// so too: no action made the request), so choosing Yes on one turned on from chat is its confirmation.
|
|
2043
|
+
function putBareNoteInches(bareNoteInches) {
|
|
2044
|
+
S.checklistError = ''; S.holeNote = '';
|
|
2045
|
+
const l0 = S.draft && S.draft.lengths;
|
|
2046
|
+
const was = !!(l0 && l0.bareNoteInches === true && l0.bareNoteBy === 'person');
|
|
2047
|
+
return choose({
|
|
2048
|
+
key: 'bare-note-inches', family: 'bare-note-inches',
|
|
2049
|
+
what: `Set hole and bolt notes without a mark to “${bareNoteInches ? 'read them as inches' : 'say couldn’t tell'}”`,
|
|
2050
|
+
url: `${base}/bare-note-inches`, body: { bareNoteInches },
|
|
2051
|
+
apply: (d) => {
|
|
2052
|
+
if (!d.lengths) return false;
|
|
2053
|
+
d.lengths.bareNoteInches = bareNoteInches; d.lengths.bareNoteBy = 'person';
|
|
2054
|
+
d.touched = [...new Set([...(d.touched || []), 'lengths.bareNoteInches', 'lengths.bareNoteBy'])];
|
|
2055
|
+
return true;
|
|
2056
|
+
},
|
|
2057
|
+
parts: (b) => ({ lengths: b.lengths, touched: [...new Set([...withTouched('lengths.bareNoteInches'), 'lengths.bareNoteBy'])] }),
|
|
2058
|
+
answered: (b, newest, fresh) => {
|
|
2059
|
+
if (!newest || !fresh) return;
|
|
2060
|
+
const said = bareNoteInches ? (was ? 'is still read as inches' : 'is now read as inches')
|
|
2061
|
+
: was ? 'is no longer read: it is reported as couldn’t tell' : 'is still reported as couldn’t tell, now as your answer';
|
|
2062
|
+
S.holeNote = b.warning ? b.warning : `A size without a mark in a hole or bolt note ${said}. The checklist has to be approved again.`;
|
|
2063
|
+
},
|
|
2064
|
+
redo: () => putBareNoteInches(bareNoteInches),
|
|
2065
|
+
});
|
|
2066
|
+
}
|
|
1965
2067
|
/** One item edit: ticked or not, removed, or added (from the Add item dialog, which keeps it if it is held). */
|
|
1966
2068
|
function putItems(edits, { dialog = false } = {}) {
|
|
1967
2069
|
S.checklistError = '';
|
|
@@ -2113,8 +2215,8 @@ function boot() {
|
|
|
2113
2215
|
// and it carries only part of the draft: the whole draft is read after it (adopt).
|
|
2114
2216
|
const sent = { ...sending(), cond: false };
|
|
2115
2217
|
const { body } = await call(`${base}/propose`, { method: 'POST' });
|
|
2116
|
-
S.newSinceApproval = 0; S.bareNote = '';
|
|
2117
|
-
// The lengths it learned afresh, or none: the
|
|
2218
|
+
S.newSinceApproval = 0; S.bareNote = ''; S.holeNote = '';
|
|
2219
|
+
// The lengths it learned afresh, or none: the Lengths section never shows the previous references' setting.
|
|
2118
2220
|
adoptAnswer(sent, { items: body.items, titleBlock: body.titleBlock ?? null, partList: body.partList ?? null, lengths: body.lengths ?? null, ...(body.client ? { client: body.client } : {}) }, body.etag);
|
|
2119
2221
|
if (body.unreadable && body.unreadable.length) S.checklistError = `Couldn’t read ${body.unreadable.join(', ')}; the other drawings were used.`;
|
|
2120
2222
|
await loadReview();
|
|
@@ -3185,7 +3287,7 @@ function boot() {
|
|
|
3185
3287
|
// ── events ──
|
|
3186
3288
|
// The wording disclosure stays as the person left it when the side panel is drawn again (#2459 slice 1b); toggle
|
|
3187
3289
|
// does not bubble, so it is caught on the way down.
|
|
3188
|
-
root.addEventListener('toggle', (e) => { if (e.target instanceof HTMLDetailsElement && e.target.matches('[data-wording]')) S.wordingOpen = e.target.open; }, true);
|
|
3290
|
+
root.addEventListener('toggle', (e) => { if (e.target instanceof HTMLDetailsElement && e.target.matches('[data-wording]')) S.wordingOpen = e.target.open; if (e.target instanceof HTMLDetailsElement && e.target.matches('[data-bare-note-seen]')) S.noteSeenOpen = e.target.open; }, true);
|
|
3189
3291
|
// A proposal's versions are read when its disclosure is first opened (#2459 1e).
|
|
3190
3292
|
root.addEventListener('toggle', (e) => {
|
|
3191
3293
|
const d = e.target;
|
|
@@ -3280,6 +3382,17 @@ function boot() {
|
|
|
3280
3382
|
refocusIfLost(document, root, '[data-bare-inches][aria-checked="true"]');
|
|
3281
3383
|
return;
|
|
3282
3384
|
}
|
|
3385
|
+
if (t.dataset.bareNote) {
|
|
3386
|
+
const l = S.draft && S.draft.lengths, want = t.dataset.bareNote === 'yes';
|
|
3387
|
+
// Saved unless the answer shown is already the person's: one from chat, or proposed, becomes theirs.
|
|
3388
|
+
if (l && ((l.bareNoteInches === true) !== want || l.bareNoteBy !== 'person')) {
|
|
3389
|
+
const saving = putBareNoteInches(want);
|
|
3390
|
+
root.querySelector(`[data-bare-note="${want ? 'yes' : 'no'}"]`)?.focus();
|
|
3391
|
+
await saving;
|
|
3392
|
+
}
|
|
3393
|
+
refocusIfLost(document, root, '[data-bare-note][aria-checked="true"]');
|
|
3394
|
+
return;
|
|
3395
|
+
}
|
|
3283
3396
|
if (t.dataset.tbRemove) { await putTitleBlock({ remove: t.dataset.tbRemove }); return; }
|
|
3284
3397
|
const act = t.dataset.act;
|
|
3285
3398
|
if (act === 'add-field') { addFieldDialog(); return; }
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Walls, slabs and footings on a plan (#3296 E1b, plan 2026-11-17-s3-e1b-sinks-PLAN.md §4 and rev 2 §6).
|
|
3
|
+
*
|
|
4
|
+
* The server works each element out (`/elements/evaluate?footprints=1`: one entry per drawable element, its prisms in
|
|
5
|
+
* world mm, with its words and status). This module only decides which of them a plan shows and turns their outlines
|
|
6
|
+
* into the plan's own drawing pixels through the transform the caller passes (the sheet's registration). It computes no
|
|
7
|
+
* geometry of its own.
|
|
8
|
+
*
|
|
9
|
+
* - A plan shows an element whose vertical range meets its cut range: the plan's level − 1500 mm to its level +
|
|
10
|
+
* 1500 mm, ends included (a slab whose top is at the level counts).
|
|
11
|
+
* - A plan with no level, or whose registration does not hold, shows none and says why, never a guess.
|
|
12
|
+
* - An elevation or section shows none and says so: a cut through them is not drawn yet.
|
|
13
|
+
* - Holes are drawn as holes (one even-odd path per element); stacked prisms with one outline draw once.
|
|
14
|
+
* - An element FloLess does not count is drawn hatched and dashed, its reason in its tooltip: never as checked.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// The note's wording, fit label included, is model-elements.js's, so the plan and the other surfaces say it alike.
|
|
18
|
+
export { elementPlanNote } from './model-elements.js';
|
|
19
|
+
|
|
20
|
+
/** How far above and below a plan's level its cut reaches, in mm. */
|
|
21
|
+
export const PLAN_CUT_REACH_MM = 1500;
|
|
22
|
+
export const NOT_SHOWN_NO_LEVEL = 'Walls, slabs and footings are not shown in this plan: it has no level registration. Give the sheet its floor level (Enter a level… on the floor-level notice) to show them.';
|
|
23
|
+
export const NOT_SHOWN_REGISTRATION = 'Walls, slabs and footings are not shown in this plan: FloLess cannot line this sheet up with the model (its registration does not hold). Ask your terminal AI to correct the sheet’s registration.';
|
|
24
|
+
export const NOT_SHOWN_ELEVATION = 'Walls, slabs and footings are not shown in elevations and sections yet. Open a plan or the 3D view to see them.';
|
|
25
|
+
|
|
26
|
+
const fin = (n) => typeof n === 'number' && Number.isFinite(n);
|
|
27
|
+
const r3 = (n) => Math.round(n * 1000) / 1000;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* "Wall W-1 · Wall 200, C30/37 · quantities worked out by FloLess from its type". One FloLess does not count leads with
|
|
31
|
+
* why, before its type, so
|
|
32
|
+
* the first thing it says is that it is not counted.
|
|
33
|
+
*/
|
|
34
|
+
function tipOf(item) {
|
|
35
|
+
const name = `${item.word ?? 'Element'} ${item.mark ? `${item.mark} (${item.id})` : item.id}`;
|
|
36
|
+
const parts = item.counted ? [name, item.typeName, item.label] : [name, item.label, item.typeName];
|
|
37
|
+
return parts.filter((s) => typeof s === 'string' && s).join(' · ');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The shapes a plan draws for the elements, and the one sentence it says when it draws none for a reason.
|
|
42
|
+
* @param {any[]|null|undefined} items the server's footprints: { id, word, mark?, typeName?, label, counted, prisms: [{ outline, holes, bottomZ, topZ }] }
|
|
43
|
+
* @param {any} plan the plan being drawn: its `elevation_mm` (level) and whether it is an elevation (`elevationView`)
|
|
44
|
+
* @param {(x: number, y: number) => [number, number]} toPx world mm → this plan's drawing pixels; throws when it cannot
|
|
45
|
+
* @returns {{ shapes: { id: string, d: string, held: boolean, tip: string }[], note: string | null, outOfCut: number,
|
|
46
|
+
* bounds: { x0: number, y0: number, x1: number, y1: number } | null }} `bounds`: the drawn outlines in plan pixels
|
|
47
|
+
*/
|
|
48
|
+
export function elementPlanShapes(items, plan, toPx) {
|
|
49
|
+
const list = Array.isArray(items) ? items.filter((i) => i && typeof i.id === 'string' && Array.isArray(i.prisms) && i.prisms.length) : [];
|
|
50
|
+
const out = { shapes: [], note: null, outOfCut: 0, bounds: null };
|
|
51
|
+
if (!list.length) return out;
|
|
52
|
+
if (plan && plan.elevationView) { out.note = NOT_SHOWN_ELEVATION; return out; }
|
|
53
|
+
const level = plan ? plan.elevation_mm : undefined;
|
|
54
|
+
if (!fin(level)) { out.note = NOT_SHOWN_NO_LEVEL; return out; }
|
|
55
|
+
const lo = level - PLAN_CUT_REACH_MM; const hi = level + PLAN_CUT_REACH_MM;
|
|
56
|
+
try {
|
|
57
|
+
for (const item of list) {
|
|
58
|
+
const bottoms = item.prisms.map((p) => p.bottomZ).filter(fin); const tops = item.prisms.map((p) => p.topZ).filter(fin);
|
|
59
|
+
if (!bottoms.length || !tops.length) continue;
|
|
60
|
+
if (Math.max(...tops) < lo || Math.min(...bottoms) > hi) { out.outOfCut += 1; continue; }
|
|
61
|
+
const seen = new Set(); let d = '';
|
|
62
|
+
for (const p of item.prisms) {
|
|
63
|
+
const rings = [p.outline, ...(Array.isArray(p.holes) ? p.holes : [])].filter((r) => Array.isArray(r) && r.length >= 3);
|
|
64
|
+
const key = JSON.stringify(rings);
|
|
65
|
+
if (!rings.length || seen.has(key)) continue;
|
|
66
|
+
seen.add(key);
|
|
67
|
+
for (const ring of rings) {
|
|
68
|
+
d += ring.map((q, i) => {
|
|
69
|
+
const [x, y] = toPx(q[0], q[1]);
|
|
70
|
+
const b = out.bounds ?? (out.bounds = { x0: Infinity, y0: Infinity, x1: -Infinity, y1: -Infinity });
|
|
71
|
+
b.x0 = Math.min(b.x0, r3(x)); b.y0 = Math.min(b.y0, r3(y)); b.x1 = Math.max(b.x1, r3(x)); b.y1 = Math.max(b.y1, r3(y));
|
|
72
|
+
return `${i ? 'L' : 'M'}${r3(x)},${r3(y)}`;
|
|
73
|
+
}).join('') + 'Z';
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (d) out.shapes.push({ id: item.id, d, held: !item.counted, tip: tipOf(item) });
|
|
77
|
+
}
|
|
78
|
+
} catch {
|
|
79
|
+
return { shapes: [], note: NOT_SHOWN_REGISTRATION, outOfCut: 0, bounds: null };
|
|
80
|
+
}
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The plan's view extent grown to hold the elements it draws, so the first view, Fit and Home frame them with the
|
|
86
|
+
* steel and the grid; null when they already fit (the extent never shrinks).
|
|
87
|
+
* @param {[number, number, number, number]} extent the view's current [x0, y0, x1, y1] in plan pixels
|
|
88
|
+
* @param {{ x0: number, y0: number, x1: number, y1: number } | null | undefined} bounds the drawn outlines (`elementPlanShapes().bounds`)
|
|
89
|
+
* @returns {[number, number, number, number] | null}
|
|
90
|
+
*/
|
|
91
|
+
export function planExtentWith(extent, bounds) {
|
|
92
|
+
if (!bounds || ![bounds.x0, bounds.y0, bounds.x1, bounds.y1].every(fin)) return null;
|
|
93
|
+
const [x0, y0, x1, y1] = extent;
|
|
94
|
+
if (bounds.x0 >= x0 && bounds.y0 >= y0 && bounds.x1 <= x1 && bounds.y1 <= y1) return null;
|
|
95
|
+
// Padded like the members' own fallback extent, so an outline never sits on the canvas edge.
|
|
96
|
+
const pad = Math.max(20, 0.05 * Math.max(bounds.x1 - bounds.x0, bounds.y1 - bounds.y0));
|
|
97
|
+
return [Math.min(x0, bounds.x0 - pad), Math.min(y0, bounds.y0 - pad), Math.max(x1, bounds.x1 + pad), Math.max(y1, bounds.y1 + pad)];
|
|
98
|
+
}
|
package/dist/web/index.html
CHANGED
|
@@ -464,6 +464,9 @@
|
|
|
464
464
|
<!-- Revision-read status card, ABOVE the filter iframe (chrome around it, never inside — the
|
|
465
465
|
filter owns its own layout). Shown only on Drawings, and only when there is one. -->
|
|
466
466
|
<div class="ws-revision-card" id="ws-revision-card" role="status" aria-live="polite" aria-atomic="true" hidden></div>
|
|
467
|
+
<!-- #3646: the read's PDFs that carry scripts or other active content (or could not be checked), under the card
|
|
468
|
+
while the read is active. Its own strip, so the card's rail keeps saying where the read stands. -->
|
|
469
|
+
<div class="ws-revision-active" id="ws-revision-active" role="note" hidden></div>
|
|
467
470
|
<!-- Two lazily-srced iframes so switching steps never reloads the editor's 3D state.
|
|
468
471
|
Same-origin like #contract-editor-frame (they call /api/contract directly). -->
|
|
469
472
|
<iframe id="ws-frame-model" class="ws-frame" title="Project model editor" hidden></iframe>
|
|
@@ -1679,6 +1682,23 @@
|
|
|
1679
1682
|
</div>
|
|
1680
1683
|
</div>
|
|
1681
1684
|
|
|
1685
|
+
<!-- Epic #3382 P1h: what a Tekla send does with the model's custom and parametric sections. Bespoke like the profile
|
|
1686
|
+
window above: each section is a card with what Tekla answered (same shape, same name with another shape, no such
|
|
1687
|
+
shape, or not checked) and the choices that answer offers, bound to what the person sees here. -->
|
|
1688
|
+
<div class="modal-backdrop" id="customsections-modal" role="dialog" aria-modal="true" aria-labelledby="customsections-title" aria-describedby="customsections-sub customsections-source">
|
|
1689
|
+
<div class="modal revreview customsections" tabindex="-1">
|
|
1690
|
+
<div class="modal-title" id="customsections-title">Custom sections and Tekla</div>
|
|
1691
|
+
<div class="modal-sub" id="customsections-sub"></div>
|
|
1692
|
+
<div class="pm-source" id="customsections-source" role="status" aria-live="polite"></div>
|
|
1693
|
+
<div class="revreview-body pm-body cs-body" id="customsections-body" tabindex="0" role="region" aria-label="Custom sections to send" data-command-id="shell.custom-sections-table"></div>
|
|
1694
|
+
<div class="pm-note" id="customsections-note"></div>
|
|
1695
|
+
<div class="modal-actions">
|
|
1696
|
+
<button type="button" id="customsections-cancel" data-command-id="shell.dialog-cancel#the custom sections review">Cancel</button>
|
|
1697
|
+
<button type="button" id="customsections-apply" class="primary" data-command-id="shell.custom-sections-continue">Continue</button>
|
|
1698
|
+
</div>
|
|
1699
|
+
</div>
|
|
1700
|
+
</div>
|
|
1701
|
+
|
|
1682
1702
|
<!-- Approval is a mandatory review, never a one-click mutation. The server supplies every group
|
|
1683
1703
|
and all plain-English copy; this surface only records an explicit decision for each group. -->
|
|
1684
1704
|
<div class="modal-backdrop" id="approval-review-modal" role="dialog" aria-modal="true" aria-labelledby="approval-review-title" aria-describedby="approval-review-sub approval-review-impact">
|
|
@@ -1981,6 +2001,9 @@
|
|
|
1981
2001
|
</div>
|
|
1982
2002
|
</div>
|
|
1983
2003
|
<div class="request-help-note" id="request-help-note">FloLess cannot start the first read automatically yet: your terminal AI must create the starting project checkpoint, then wait for you to review and save the Drawing Filter. After you save, tell the terminal AI to continue.</div>
|
|
2004
|
+
<!-- #3646: what the attached PDFs carry besides their drawings (scripts and the like), filled in once the server
|
|
2005
|
+
has checked them. Always in the tree so a screen reader hears the note when it arrives. -->
|
|
2006
|
+
<div class="request-help-active" id="request-help-active" role="status" aria-live="polite"></div>
|
|
1984
2007
|
<div class="request-help-chat-meta" id="request-help-chat-meta" hidden></div>
|
|
1985
2008
|
<div class="modal-actions">
|
|
1986
2009
|
<button data-command-id="shell.request-help-copy" id="request-help-copy" hidden>Copy instruction</button>
|
|
@@ -2367,6 +2390,7 @@
|
|
|
2367
2390
|
<script src="filter-guidance.js"></script>
|
|
2368
2391
|
<script src="kb-categories.js"></script>
|
|
2369
2392
|
<script src="pdf-view.js"></script>
|
|
2393
|
+
<script src="pdf-active-content.js"></script>
|
|
2370
2394
|
<script src="workspaces.js"></script>
|
|
2371
2395
|
<script src="left-pane.js"></script>
|
|
2372
2396
|
<script src="chat-question-card.js"></script>
|
package/dist/web/instructor.js
CHANGED
|
@@ -973,6 +973,7 @@
|
|
|
973
973
|
'In the Report an issue dialog', 'In the Build a tool dialog', 'In the Bake dialog', 'In the CAD send review',
|
|
974
974
|
// #3312: the profile mapping window opens from the CAD send review, so it is read right after it.
|
|
975
975
|
'In the profile mapping window',
|
|
976
|
+
'In the custom sections window',
|
|
976
977
|
'While FloLess is not answering', 'In the FloLess dialogs', 'On the FloLess has stopped screen',
|
|
977
978
|
// #2381: the first-run setup card, which covers the whole window until AWARE is ready.
|
|
978
979
|
'On the setup card',
|