@floless/app 0.144.0 → 0.146.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.
@@ -7,7 +7,7 @@ description: >-
7
7
  two-phase Drawing Filter process: first prepare and save the deterministic Filter, then read only the
8
8
  selected evidence into model-global members, registered plan views, observations, and revision history.
9
9
  metadata:
10
- version: 0.60.0
10
+ version: 0.61.0
11
11
  ---
12
12
 
13
13
  # Steel Takeoff — read drawings into `steel.model/v2`
@@ -1121,10 +1121,43 @@ Work in this order:
1121
1121
  candidate yourself; a choice lists heights from lowest to highest and none of them is preferred.
1122
1122
 
1123
1123
  9. **Every plan view you read members from MUST state its own `elevation_mm`.** Without one there is
1124
- nowhere to place an unresolved end, and those members leave the model. If the set does not let you
1125
- establish a plan's elevation, **ask the user for it before you read members from that sheet** — one
1124
+ nowhere to place an unresolved end, and those members leave the model. If the set does not state a
1125
+ plan's elevation outright, **ask the user for it before you read members from that sheet** — one
1126
1126
  question per view, never one per member. A plan with no elevation is a question, not something to
1127
- work around.
1127
+ work around, and you never author `elevation_mm` from your own guess.
1128
+
1129
+ **But do not ask cold for what the set carries: look at the sheets first, and where you can read a
1130
+ level, PROPOSE it**, quoting what you read and the sheet it is on, and author `elevation_mm` only
1131
+ after the user confirms or corrects it. Ask with no proposal only when the whole set is silent — and
1132
+ then name the sheets you checked. Where to look:
1133
+
1134
+ - the `datums[]` you recorded in the design-set knowledge — a level on a building section or frame
1135
+ elevation that this plan's title names (`ROOF FRAMING PLAN` → `ROOF`; a silent `SECOND FLOOR
1136
+ FRAMING PLAN` → `LEVEL 02` on the frame elevations);
1137
+ - a `T.O. STEEL` note that governs the **whole** plan's framing (a general note, `U.N.O.`). One
1138
+ member's callout is **not** the plan's level — it governs its own end (step 8), and a roof's
1139
+ callouts can span over two feet that one plan level would flatten;
1140
+ - the page picture (`…/pages/<pageId>/picture`), for a level that is drawn rather than written.
1141
+
1142
+ Put what you read to the server, which checks it and writes the question:
1143
+ `POST …/revision-requests/<id>/plan-elevation-proposal` with
1144
+ `{ plan: { viewId, sourceHash, pageId }, readings: [...] }`. `viewId` is the plan's id in the
1145
+ project's `plans[]` — the checkpoint shell's on a first read; for a plan a revised set adds, the
1146
+ id you will give it (the question then says the view is not registered yet). The question names a
1147
+ view by its sheet, so a sheet carrying **more than one** plan view is refused: ask about each of
1148
+ those views with no proposal, naming the view yourself. Each reading is `{ value, asRead, page: { sourceHash, pageId, sheet }, quote,
1149
+ elementIds }` when the sheet's text carries it, or `{ value, asRead, page, near }` when it is drawn
1150
+ — `value` is your conversion of `asRead` to world millimetres. A quote its cited elements do not
1151
+ carry is refused. **Relay the returned `proposal.ask` verbatim**: it names the sheet, quotes the
1152
+ drawing beside the converted value (so the person can check your conversion) and attributes every
1153
+ value to your reading, never to the drawings as fact, says when a reading
1154
+ was read off the picture and not checked, and asks whether THIS plan is at that level. Readings
1155
+ that disagree come back as a choice from lowest to highest with none preferred — never pick one.
1156
+
1157
+ **Propose only what you READ.** Never another plan's elevation, the plan's cut plane, or
1158
+ arithmetic — the server cannot tell a guess from a reading once you type it, so a guess must never
1159
+ reach the person dressed as one. Unlike an end's height (step 8), a plan's elevation is yours to
1160
+ write once the user has answered in the chat: it has always been the reader's field.
1128
1161
 
1129
1162
  ### Model-global members
1130
1163
 
package/dist/web/app.css CHANGED
@@ -2122,6 +2122,41 @@
2122
2122
  font-size: 13px; padding: 6px 0 0; font-family: var(--ui); }
2123
2123
  .lib-update-link:hover { text-decoration: underline; }
2124
2124
 
2125
+ /* ========== REPORT AN ISSUE — failed-import details (#1757) ========== */
2126
+ /* Deliberately NOT a .modal-field: that rule stretches every input to 100% width with text padding,
2127
+ which would turn the consent checkbox into a bar. Same surface vocabulary as .integrations-hint. */
2128
+ .ri-import {
2129
+ margin-bottom: 12px;
2130
+ padding: 10px 12px;
2131
+ background: var(--surface-2);
2132
+ border: 1px solid var(--border);
2133
+ border-radius: 4px;
2134
+ }
2135
+ .ri-import-head {
2136
+ font-size: 10px;
2137
+ text-transform: uppercase;
2138
+ letter-spacing: 0.14em;
2139
+ color: var(--text-muted);
2140
+ margin-bottom: 8px;
2141
+ }
2142
+ .ri-import-list {
2143
+ display: grid;
2144
+ grid-template-columns: max-content minmax(0, 1fr);
2145
+ gap: 4px 12px;
2146
+ margin: 0 0 10px;
2147
+ font-size: 11px;
2148
+ }
2149
+ .ri-import-list dt { color: var(--text-dim); }
2150
+ .ri-import-list dd { margin: 0; color: var(--text); font-family: var(--mono); overflow-wrap: anywhere; }
2151
+ .ri-import-include {
2152
+ display: inline-flex;
2153
+ align-items: center;
2154
+ gap: 8px;
2155
+ font-size: 12px;
2156
+ color: var(--text);
2157
+ cursor: pointer;
2158
+ }
2159
+
2125
2160
  /* ========== INTEGRATIONS MODAL ========== */
2126
2161
  .modal.integrations { width: 760px; max-height: 86vh; display: flex; flex-direction: column; }
2127
2162
  .integrations-hint {
package/dist/web/aware.js CHANGED
@@ -13333,6 +13333,12 @@
13333
13333
  let riAwareVersion = ''; // the versions the modal promises ("sent automatically: …")
13334
13334
  let riReturnFocus = null;
13335
13335
  let riReturnToIntegration = false;
13336
+ // #1757: the failed import this report is about, set only by a failed card's "Report this problem".
13337
+ // Its details are attached only while the consent box is checked, and the SERVER re-reads them.
13338
+ let riImport = null;
13339
+ const $riImport = document.getElementById('ri-import');
13340
+ const $riImportList = document.getElementById('ri-import-list');
13341
+ const $riImportInclude = document.getElementById('ri-import-include');
13336
13342
 
13337
13343
  const riSyncSend = () => { $riSend.disabled = !($riTitle.value.trim() && $riDesc.value.trim()); };
13338
13344
  function riHideAndRestoreFocus() {
@@ -13411,6 +13417,10 @@
13411
13417
  riSetCategory('bug');
13412
13418
  riAppVersion = '';
13413
13419
  riAwareVersion = '';
13420
+ riImport = null;
13421
+ if ($riImport) $riImport.hidden = true;
13422
+ if ($riImportList) $riImportList.replaceChildren();
13423
+ if ($riImportInclude) $riImportInclude.checked = true;
13414
13424
  $riSend.disabled = true;
13415
13425
  $riSend.textContent = 'Send report';
13416
13426
  // Auto-attached diagnostics line — versions + the open workflow, read fresh from health.
@@ -13435,6 +13445,55 @@
13435
13445
  riSyncSend();
13436
13446
  });
13437
13447
 
13448
+ // Plain labels for the fields the server's reportDetails() returns — nothing else is ever listed.
13449
+ const RI_IMPORT_STAGE = { 'waiting-for-aware': 'Starting', converting: 'Converting', validating: 'Checking', publishing: 'Adding to the project' };
13450
+ const RI_IMPORT_KIND = { model: 'The model itself', service: 'A temporary service problem', access: 'Sign-in or access',
13451
+ setup: 'Setup needs repair', busy: 'Another import was running', interrupted: 'FloLess stopped mid-import',
13452
+ superseded: 'Replaced by a newer choice', internal: 'An unexpected FloLess problem' };
13453
+ // Every field the server would send is listed — what the person sees is exactly what they consent to.
13454
+ function riImportRows(details) {
13455
+ const rows = [['Import', details.importer === 'tekla' ? 'Tekla read' : 'Revit import'], ['Reference', details.operationId]];
13456
+ if (details.kind) rows.push(['Kind of problem', RI_IMPORT_KIND[details.kind] || details.kind]);
13457
+ if (details.reason) rows.push(['Why it stopped', details.reason]);
13458
+ if (details.stage) rows.push(['Stopped while', RI_IMPORT_STAGE[details.stage] || details.stage]);
13459
+ if (typeof details.elapsedSeconds === 'number') rows.push(['Time taken', `${details.elapsedSeconds} s`]);
13460
+ if (details.failedAt) rows.push(['Failed at', new Date(details.failedAt).toLocaleString()]);
13461
+ if (details.code) rows.push(['Failure code', details.code]);
13462
+ if (details.providerCode) rows.push(['Service code', details.providerCode]);
13463
+ if (details.diagnosticId) rows.push(['Diagnostic reference', details.diagnosticId]);
13464
+ if (details.awareRunId) rows.push(['Run reference', details.awareRunId]);
13465
+ return rows;
13466
+ }
13467
+ window.addEventListener('floless:report-import-issue', async (event) => {
13468
+ const detail = event.detail || {};
13469
+ const importer = detail.importer === 'tekla' ? 'tekla' : 'revit';
13470
+ if (typeof detail.operationId !== 'string' || !detail.operationId) return;
13471
+ openReportIssue();
13472
+ if (detail.returnFocus instanceof HTMLElement) riReturnFocus = detail.returnFocus;
13473
+ const noun = importer === 'tekla' ? 'Tekla read' : 'Revit import';
13474
+ $riTitle.value = `${noun} failed${detail.title ? `: ${detail.title}` : ''}`.slice(0, 200);
13475
+ $riDesc.value = `My ${noun} failed. FloLess showed: “${detail.title || 'the import failed'}”.`;
13476
+ riSyncSend();
13477
+ const ref = { importer, operationId: detail.operationId };
13478
+ riImport = ref;
13479
+ try {
13480
+ const path = importer === 'tekla' ? 'tekla-imports' : 'model-imports';
13481
+ // The import routes, and the server's re-read on send, sit behind the editor session.
13482
+ await bootstrapEditorSession();
13483
+ const r = await api(`/api/${path}/${encodeURIComponent(ref.operationId)}/report-details`);
13484
+ if (riImport !== ref || !r?.details) return; // the dialog was reopened for something else
13485
+ $riImportList.replaceChildren(...riImportRows(r.details).flatMap(([label, value]) => {
13486
+ const dt = document.createElement('dt'); dt.textContent = label;
13487
+ const dd = document.createElement('dd'); dd.textContent = String(value);
13488
+ return [dt, dd];
13489
+ }));
13490
+ $riImport.hidden = false;
13491
+ } catch {
13492
+ // Nothing to show means nothing is attached: the report still sends with what the person wrote.
13493
+ if (riImport === ref) riImport = null;
13494
+ }
13495
+ });
13496
+
13438
13497
  window.addEventListener('floless:report-revit-setup-issue', (event) => {
13439
13498
  openReportIssue();
13440
13499
  const card = event.detail?.returnFocus;
@@ -13444,7 +13503,7 @@
13444
13503
  riSyncSend();
13445
13504
  });
13446
13505
 
13447
- function riRenderSuccess(ref) {
13506
+ function riRenderSuccess(ref, droppedImportReference = null) {
13448
13507
  const wrap = document.createElement('div');
13449
13508
  wrap.className = 'graft-success';
13450
13509
  const icon = document.createElement('div');
@@ -13457,6 +13516,14 @@
13457
13516
  ? `Received — logged as ${ref} · We'll follow up privately.`
13458
13517
  : "Received · We'll follow up privately.";
13459
13518
  wrap.append(icon, msg);
13519
+ // #1757: the person chose to include the import details, but FloLess could not attach them (the
13520
+ // import is no longer readable to this session). Say so, and give them the reference to pass on.
13521
+ if (droppedImportReference) {
13522
+ const note = document.createElement('div');
13523
+ note.className = 'modal-sub';
13524
+ note.textContent = `The import details could not be attached. If we ask, the import reference is ${droppedImportReference}.`;
13525
+ wrap.append(note);
13526
+ }
13460
13527
  const actions = document.createElement('div');
13461
13528
  actions.className = 'modal-actions';
13462
13529
  const done = riButton('ri-done', 'Done', true, () => riClose());
@@ -13506,9 +13573,11 @@
13506
13573
  awareVersion: riAwareVersion || null,
13507
13574
  };
13508
13575
  try {
13509
- const r = await api('/api/report-issue', { method: 'POST', body: JSON.stringify({ category: riCategory, title, body, context }) });
13576
+ // Consent is the checked box on a list that is actually showing; the server re-reads the details.
13577
+ const importFailure = riImport && $riImport && !$riImport.hidden && $riImportInclude?.checked ? riImport : undefined;
13578
+ const r = await api('/api/report-issue', { method: 'POST', body: JSON.stringify({ category: riCategory, title, body, context, importFailure }) });
13510
13579
  riSubmitting = false; // response in hand — Done / Escape / backdrop may close
13511
- riRenderSuccess(r.ref || '');
13580
+ riRenderSuccess(r.ref || '', importFailure && r.importDetailsAttached === false ? importFailure.operationId : null);
13512
13581
  } catch (e) {
13513
13582
  riSubmitting = false;
13514
13583
  const err = (e && e.body && e.body.error) || '';
package/dist/web/chat.css CHANGED
@@ -1105,14 +1105,29 @@
1105
1105
  .ai-chat-compose-hint.working { display: inline-flex; align-items: center; min-height: 16px; padding-left: 4px; }
1106
1106
  .ai-chat-compose-context { min-height: 12px; padding: 5px 0 0 30px; color: var(--text-dim); font: 8px/1.3 var(--mono); overflow-wrap: anywhere; }
1107
1107
  .ai-chat-compose-context strong { color: var(--text-muted); font-weight: 600; }
1108
- .ai-chat-send, .ai-chat-stop { flex: none; min-width: 48px; padding: 6px 9px; font-size: 10px; font-weight: 600; }
1108
+ /* Send and Stop are icon-only circles: the composer's primary actions, set apart from the square
1109
+ utility buttons. Stop is deliberately neutral, not red: it sits beside Send whenever a follow-up can
1110
+ be queued mid-response, and the filled-square glyph already says "stop" without shouting. */
1111
+ .ai-chat-compose-actions svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
1112
+ .ai-chat-send, .ai-chat-stop { flex: none; width: 28px; height: 28px; min-width: 0; padding: 0; display: grid; place-items: center; border-radius: 50%; }
1113
+ .ai-chat-send:not(:disabled):active, .ai-chat-stop:not(:disabled):active { transform: scale(.94); }
1114
+ /* The paper plane's point sits top-right of its box; nudge it so it reads centred in the circle. */
1115
+ .ai-chat-send svg { width: 14px; height: 14px; stroke-width: 2.25; transform: translate(-1px, 1px); }
1116
+ .ai-chat-stop svg { fill: currentColor; stroke: none; }
1109
1117
  .ai-chat-compose-actions .ai-chat-stop { margin-left: auto; }
1110
1118
  .ai-chat-compose-actions .ai-chat-stop[hidden] + .ai-chat-send { margin-left: auto; }
1111
1119
  .ai-chat-send { border-color: var(--accent); background: var(--accent); color: #fff; }
1112
1120
  .ai-chat-send:hover { filter: brightness(1.08); }
1113
1121
  .ai-chat-send:disabled, .ai-chat-stop:disabled, .ai-chat-icon:disabled, .ai-chat-start-provider:disabled { cursor: default; opacity: .45; filter: none; }
1114
- .ai-chat-stop { border-color: color-mix(in srgb, var(--err) 50%, var(--border)); color: var(--err); }
1122
+ .ai-chat-stop { border-color: var(--border-strong); background: var(--surface-3); color: var(--text); }
1123
+ .ai-chat-stop:not(:disabled):hover { background: color-mix(in srgb, var(--surface-3) 88%, var(--text)); }
1115
1124
  .ai-chat-stop[hidden] { display: none; }
1125
+ /* Attach is a quiet ghost so the blue Send stays the row's one strong accent. */
1126
+ #chat-attach { border-color: transparent; background: transparent; color: var(--text-muted); }
1127
+ #chat-attach:not(:disabled):hover { background: var(--surface-2); color: var(--text); }
1128
+ @media (prefers-reduced-motion: reduce) {
1129
+ .ai-chat-send:not(:disabled):active, .ai-chat-stop:not(:disabled):active { transform: none; }
1130
+ }
1116
1131
 
1117
1132
  @media (max-width: 900px) {
1118
1133
  .ai-chat-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
package/dist/web/chat.js CHANGED
@@ -586,7 +586,8 @@
586
586
  prefix.textContent = 'Sharing with AI: ';
587
587
  ui.contextNote.replaceChildren(prefix, document.createTextNode(shared));
588
588
  }
589
- ui.send.dataset.tip = ui.contextNote.textContent;
589
+ // Send is icon-only, so its tooltip names the action before saying what goes with the message.
590
+ ui.send.dataset.tip = `Send message · ${ui.contextNote.textContent}`;
590
591
  // Leaving or returning to the Drawing Filter changes whether a suggestion can be applied.
591
592
  refreshFilterCards();
592
593
  }
@@ -2525,11 +2526,14 @@
2525
2526
  ui.attach.setAttribute('aria-label', `Attach ${kinds} · ${imageCount} of ${MAX_IMAGES_PER_MESSAGE} images`);
2526
2527
  }
2527
2528
 
2528
- /* #1653: the Steel Model objects selected when a question is sent are attached to it. The pill shows what
2529
+ /* #1653: the model objects selected when a question is sent are attached to it — Steel Model objects, or the
2530
+ objects of a model in the snapshot viewer (Revit, Tekla Parser). The pill shows what
2529
2531
  would go with the next NEW question — never with a follow-up to a running response, never on the Drawing
2530
2532
  Filter, never in a workflow's conversation — and one click leaves them out until the selection changes. */
2531
2533
  const MAX_LISTED_SUBJECTS = 200;
2532
2534
  const MAX_SUBJECT_SAMPLE = 50;
2535
+ // What each model calls its objects, one and many; an unknown one still reads as plain English.
2536
+ const SUBJECT_NOUNS = { steel: ['Steel object', 'Steel objects', 'Steel Model object', 'Steel Model objects'], revit: ['Revit element', 'Revit elements', 'Revit element', 'Revit elements'], 'tekla-parser': ['Tekla object', 'Tekla objects', 'Tekla object', 'Tekla objects'] };
2533
2537
 
2534
2538
  function subjectsKey(selection) {
2535
2539
  return selection ? `${selection.source}|${selection.key || selection.items.map((item) => `${item.kind}:${item.id}`).sort().join('\n')}` : '';
@@ -2540,7 +2544,7 @@
2540
2544
  if (filterSurface().state !== 'off') return null;
2541
2545
  let selection = null;
2542
2546
  try { selection = window.flolessLeftPane?.readSelection?.() || null; } catch { selection = null; }
2543
- if (!selection || selection.source !== 'steel' || !selection.items?.length) return null;
2547
+ if (!selection || !Object.hasOwn(SUBJECT_NOUNS, selection.source) || !selection.items?.length) return null;
2544
2548
  if (state.subjectsDismissed && state.subjectsDismissed === subjectsKey(selection)) return null;
2545
2549
  return selection;
2546
2550
  }
@@ -2549,10 +2553,12 @@
2549
2553
  function subjectsPayload(selection) {
2550
2554
  if (!selection) return null;
2551
2555
  const pick = (item) => ({ kind: item.kind, id: item.id, label: item.label });
2556
+ // A snapshot model's objects travel with the source file they were read from; Steel's carry no such field.
2557
+ const identity = typeof selection.sourceDigest === 'string' ? { sourceDigest: selection.sourceDigest } : {};
2552
2558
  if (selection.total > MAX_LISTED_SUBJECTS) {
2553
- return { source: selection.source, revision: selection.revision, group: { count: selection.total, sample: selection.items.slice(0, MAX_SUBJECT_SAMPLE).map(pick) } };
2559
+ return { source: selection.source, revision: selection.revision, ...identity, group: { count: selection.total, sample: selection.items.slice(0, MAX_SUBJECT_SAMPLE).map(pick) } };
2554
2560
  }
2555
- return { source: selection.source, revision: selection.revision, items: selection.items.slice(0, MAX_LISTED_SUBJECTS).map(pick) };
2561
+ return { source: selection.source, revision: selection.revision, ...identity, items: selection.items.slice(0, MAX_LISTED_SUBJECTS).map(pick) };
2556
2562
  }
2557
2563
 
2558
2564
  function subjectLabels(items, total, shown = 3) {
@@ -2567,13 +2573,15 @@
2567
2573
  const listed = Array.isArray(subjects.items) ? subjects.items : Array.isArray(subjects.group?.sample) ? subjects.group.sample : [];
2568
2574
  const count = Array.isArray(subjects.items) ? subjects.items.length : Number(subjects.group?.count) || listed.length;
2569
2575
  if (!count) return '';
2570
- return `About ${count} Steel object${count === 1 ? '' : 's'}${listed.length ? `: ${subjectLabels(listed, count)}` : ''}`;
2576
+ const nouns = Object.hasOwn(SUBJECT_NOUNS, subjects.source) ? SUBJECT_NOUNS[subjects.source] : ['object', 'objects'];
2577
+ return `About ${count} ${count === 1 ? nouns[0] : nouns[1]}${listed.length ? `: ${subjectLabels(listed, count)}` : ''}`;
2571
2578
  }
2572
2579
 
2573
2580
  // A question was saved with objects: the model editor's object card reads its links again.
2574
2581
  function subjectLinksSaved(subjects) {
2575
2582
  if (!subjects) return;
2576
- try { window.flolessLeftPane?.chatLinksChanged?.(); } catch { /* the card refreshes on its next read */ }
2583
+ // The card still refreshes on its next read; the cause is kept for whoever debugs a card that stayed stale.
2584
+ try { window.flolessLeftPane?.chatLinksChanged?.(); } catch (error) { console.warn('[chat] the model card was not told about the new question', error); }
2577
2585
  }
2578
2586
 
2579
2587
  function paintSubjectsPill() {
@@ -2585,7 +2593,8 @@
2585
2593
  label.dataset.tip = count > MAX_LISTED_SUBJECTS
2586
2594
  ? `More than ${MAX_LISTED_SUBJECTS} objects are selected, so FloLess attaches them to your next question as one set instead of listing each one.`
2587
2595
  : `${subjectLabels(selection.items, count, 5)}. Attached to your next question.`;
2588
- label.setAttribute('aria-label', `${count} Steel Model object${count === 1 ? '' : 's'} selected, attached to your next question`);
2596
+ const nouns = SUBJECT_NOUNS[selection.source];
2597
+ label.setAttribute('aria-label', `${count} ${count === 1 ? nouns[2] : nouns[3]} selected, attached to your next question`);
2589
2598
  label.addEventListener('click', () => { announce(label.dataset.tip); });
2590
2599
  const remove = button('×', 'shell.chat-subjects-remove');
2591
2600
  remove.setAttribute('aria-label', 'Leave the selected objects out of your next question');
@@ -3657,7 +3666,10 @@
3657
3666
 
3658
3667
  function autosize() {
3659
3668
  ui.input.style.height = 'auto';
3660
- ui.input.style.height = `${Math.min(132, ui.input.scrollHeight)}px`;
3669
+ // The box is border-box, so it must hold its border as well as the text, or overflow-y:auto
3670
+ // draws a scrollbar on a single line (#1763).
3671
+ const border = ui.input.offsetHeight - ui.input.clientHeight;
3672
+ ui.input.style.height = `${Math.min(132, ui.input.scrollHeight + border)}px`;
3661
3673
  }
3662
3674
 
3663
3675
  function draftFitsStorage(owner, draft) {
@@ -43,5 +43,11 @@
43
43
  def('revit.open-model', { label: 'Open Model tab', actsOn: 'Opens the just-imported model on the Model tab', group: 'In the Revit workspace', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
44
44
  def('revit.replace-import', { label: 'Replace RVT', actsOn: 'Chooses a new RVT while keeping the current model available until replacement succeeds', group: 'In the Revit workspace', persistence: 'working', interaction: 'dialog', risk: [], guidance: 'on-demand' });
45
45
  def('revit.retry-import', { label: 'Retry Revit import', actsOn: 'Retries reading the already stored RVT source', group: 'In the Revit workspace', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
46
+ def('revit.report-import-failure', { label: 'Report this problem', actsOn: 'Opens Report an issue for this failed import, listing the failure details you can choose to include', group: 'In the Revit workspace', persistence: 'none', interaction: 'dialog', risk: [], guidance: 'on-demand' });
46
47
  def('revit.cancel-import', { label: 'Cancel Revit import', actsOn: 'Cancels the in-progress Revit import without removing the current model', group: 'In the Revit workspace', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
48
+ // Questions in chat (#1653): the card in the Properties panel, worded as the Steel Model's (web/model-chat-questions.js).
49
+ def('revit.chat-question-show', { label: 'Show in chat', actsOn: 'Opens AI Chat at the question “{instance}”', anyInstance: 'a question asked about this object', group: 'In the Properties panel', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'A question stays linked to the objects selected when it was asked, and to the objects the AI’s answer named.' });
50
+ def('revit.chat-questions-more', { label: 'Show more questions', actsOn: 'Shows the older questions asked in AI Chat about the selection', group: 'In the Properties panel', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
51
+ def('revit.chat-questions-orphans', { label: 'Questions about objects not in the model', actsOn: 'Shows AI Chat questions about objects this model does not have now, with the name each was linked under', group: 'In the Properties panel', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'A question is never moved to another object, even one with the same name.' });
52
+ def('revit.chat-questions-retry', { label: 'Retry loading questions', actsOn: 'Reads the questions asked in AI Chat about this project again', group: 'In the Properties panel', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
47
53
  })();
@@ -2653,6 +2653,17 @@
2653
2653
  why: 'Steps to reproduce are what turn a report into a fix.',
2654
2654
  });
2655
2655
 
2656
+ def('shell.issue-include-import', {
2657
+ label: 'Include import details',
2658
+ actsOn: 'Attaches the listed details of the failed import to this report',
2659
+ group: 'In the Report an issue dialog',
2660
+ persistence: 'none',
2661
+ interaction: 'instant',
2662
+ risk: [],
2663
+ guidance: 'on-demand',
2664
+ why: 'Only shown when you report a failed import. It sends exactly the listed references and codes — never your file, its name or its location. Untick it to send the report without them.',
2665
+ });
2666
+
2656
2667
  def('shell.issue-send', {
2657
2668
  label: 'Send the report',
2658
2669
  actsOn: 'Sends it to the FloLess team',
@@ -44,5 +44,11 @@
44
44
  def('tekla-parser.audit-finding', { label: 'Show import finding', actsOn: 'Selects and frames {instance} when verified geometry is available', group: 'In the Tekla Parser Audit pane', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
45
45
  def('tekla-parser.open-model', { label: 'Open Model tab', actsOn: 'Opens the new read-only snapshot on the Model tab', group: 'In the Tekla Parser workspace', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
46
46
  def('tekla-parser.replace-source', { label: 'Choose or replace Tekla source', actsOn: 'Chooses a Tekla model folder or ZIP; an existing snapshot stays available until replacement succeeds', group: 'In the Tekla Parser workspace', persistence: 'working', interaction: 'dialog', risk: [], guidance: 'on-demand' });
47
+ def('tekla-parser.report-import-failure', { label: 'Report this problem', actsOn: 'Opens Report an issue for this failed read, listing the failure details you can choose to include', group: 'In the Tekla Parser workspace', persistence: 'none', interaction: 'dialog', risk: [], guidance: 'on-demand' });
47
48
  def('tekla-parser.cancel-import', { label: 'Cancel Tekla read', actsOn: 'Cancels the in-progress read without removing the current snapshot', group: 'In the Tekla Parser workspace', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
49
+ // Questions in chat (#1653): the card in the Properties panel, worded as the Steel Model's (web/model-chat-questions.js).
50
+ def('tekla-parser.chat-question-show', { label: 'Show in chat', actsOn: 'Opens AI Chat at the question “{instance}”', anyInstance: 'a question asked about this object', group: 'In the Properties panel', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'A question stays linked to the objects selected when it was asked, and to the objects the AI’s answer named.' });
51
+ def('tekla-parser.chat-questions-more', { label: 'Show more questions', actsOn: 'Shows the older questions asked in AI Chat about the selection', group: 'In the Properties panel', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
52
+ def('tekla-parser.chat-questions-orphans', { label: 'Questions about objects not in the model', actsOn: 'Shows AI Chat questions about objects this snapshot does not have now, with the name each was linked under', group: 'In the Properties panel', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'A question is never moved to another object, even one with the same name.' });
53
+ def('tekla-parser.chat-questions-retry', { label: 'Retry loading questions', actsOn: 'Reads the questions asked in AI Chat about this project again', group: 'In the Properties panel', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
48
54
  })();
@@ -42,6 +42,12 @@ export function readOnlyFilterContext(snapshot, instruction, scope) {
42
42
  scope,
43
43
  ('Current sheet: '+(snapshot.sheet || 'not loaded')+'; mode: '+(snapshot.mode || 'not loaded')+'. Checked properties must all match.').slice(0,500),
44
44
  ];
45
+ // Two facts are ALWAYS appended after the control loop -- the sheet's text sample and the
46
+ // "Controls listed" count -- and those two are the honest ones. Reserve their slots here: filling
47
+ // the budget with controls used to push the message to 201 or 202 facts, over the server's limit,
48
+ // and the whole question was then refused. To the person that reads as the AI failing rather than
49
+ // as a control list that was too long to send.
50
+ const CONTROL_FACT_LIMIT = MAX_FACTS - 2;
45
51
  const controls = snapshot.controls || [];
46
52
  let represented = 0, part = '';
47
53
  for (const row of controls) {
@@ -50,11 +56,11 @@ export function readOnlyFilterContext(snapshot, instruction, scope) {
50
56
  if (part && part.length + entry.length + 2 > MAX_FACT_CHARS) {
51
57
  facts.push(part); part = '';
52
58
  }
53
- if (facts.length >= MAX_FACTS) break;
59
+ if (facts.length >= CONTROL_FACT_LIMIT) break;
54
60
  part += (part ? '; ' : '') + entry;
55
61
  represented++;
56
62
  }
57
- if (part && facts.length < MAX_FACTS) facts.push(part);
63
+ if (part && facts.length < CONTROL_FACT_LIMIT) facts.push(part);
58
64
  const samples = snapshot.sheetTextSamples || [];
59
65
  let sampleCount = 0, sampleFact = 'Text on this sheet: ';
60
66
  for (const row of samples) {
@@ -217,10 +217,10 @@
217
217
  <p class="ai-chat-composer-disclosure" id="chat-composer-disclosure" hidden>Messages and attachments are sent to Claude or Codex through your account.</p>
218
218
  <div class="ai-chat-compose-actions">
219
219
  <input data-command-id="shell.chat-attach-input" id="chat-file" type="file" accept="image/png,image/jpeg,image/webp,application/pdf" multiple hidden>
220
- <button data-command-id="shell.chat-attach" type="button" class="ai-chat-icon" id="chat-attach" data-tip="Attach image or PDF" aria-label="Attach image or PDF">+</button>
220
+ <button data-command-id="shell.chat-attach" type="button" class="ai-chat-icon" id="chat-attach" data-tip="Attach image or PDF" aria-label="Attach image or PDF"><svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"/></svg></button>
221
221
  <span class="ai-chat-compose-hint" id="chat-compose-hint">Enter to send · Shift+Enter for a new line</span>
222
- <button data-command-id="shell.chat-stop" type="button" class="ai-chat-stop" id="chat-stop" hidden>Stop</button>
223
- <button data-command-id="shell.chat-send" type="button" class="ai-chat-send" id="chat-send">Send</button>
222
+ <button data-command-id="shell.chat-stop" type="button" class="ai-chat-stop" id="chat-stop" aria-label="Stop response" data-tip="Stop response" hidden><svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><rect x="5" y="5" width="14" height="14" rx="2.5"/></svg></button>
223
+ <button data-command-id="shell.chat-send" type="button" class="ai-chat-send" id="chat-send" aria-label="Send message"><svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"/><path d="m21.854 2.147-10.94 10.939"/></svg></button>
224
224
  </div>
225
225
  <!-- What goes with each message is the Send tooltip, and is read to screen readers, rather than a
226
226
  line of text under the composer. -->
@@ -379,6 +379,7 @@
379
379
  <button type="button" id="ws-revit-open-model" class="primary" data-command-id="revit.open-model" data-tip="Show the imported model on the Model tab. It stays a draft until approved." hidden>Open Model tab</button>
380
380
  <button type="button" id="ws-revit-replace" class="btn-mini" data-command-id="revit.replace-import" data-tip="Choose a new RVT. The current model remains available until the replacement is ready.">Replace RVT…</button>
381
381
  <button type="button" id="ws-revit-retry" class="btn-mini" data-command-id="revit.retry-import" data-tip="Try importing the already stored RVT again." hidden>Try import again</button>
382
+ <button type="button" id="ws-import-report" class="btn-mini" data-command-id="revit.report-import-failure" data-tip="Send this import’s failure details to the FloLess team. You see exactly what is included before sending." hidden>Report this problem</button>
382
383
  <button type="button" id="ws-revit-cancel" class="btn-mini" data-command-id="revit.cancel-import" data-tip="Cancel this import. The existing model remains unchanged." hidden>Cancel import</button>
383
384
  </div>
384
385
  <div class="ws-source-reassure" id="ws-source-reassure" role="status" aria-live="polite" hidden>The current model remains unchanged until this import finishes.</div>
@@ -1489,6 +1490,16 @@
1489
1490
  <label for="ri-desc">Description</label>
1490
1491
  <textarea data-command-id="shell.issue-description" id="ri-desc" placeholder="What happened? What did you expect? Steps to reproduce if it's a bug."></textarea>
1491
1492
  </div>
1493
+ <!-- #1757: shown only when the dialog was opened from a failed import's "Report this problem".
1494
+ Lists exactly what would be attached; the checkbox is the consent. -->
1495
+ <div class="ri-import" id="ri-import" hidden>
1496
+ <div class="ri-import-head">Import details to include</div>
1497
+ <dl class="ri-import-list" id="ri-import-list"></dl>
1498
+ <label class="ri-import-include">
1499
+ <input type="checkbox" id="ri-import-include" data-command-id="shell.issue-include-import" checked>
1500
+ <span>Include these import details</span>
1501
+ </label>
1502
+ </div>
1492
1503
  <div class="integrations-hint" id="ri-context"></div>
1493
1504
  <div class="modal-actions">
1494
1505
  <button data-command-id="shell.dialog-cancel#the issue report" id="ri-cancel">Cancel</button>
@@ -250,7 +250,10 @@
250
250
  label: typeof item.label === 'string' ? item.label : item.id })) : [];
251
251
  const total = Number.isSafeInteger(subjects.total) && subjects.total >= items.length ? subjects.total : items.length;
252
252
  if (!total || !items.length) return null;
253
- return Object.freeze({ source: subjects.source, revision: Number.isSafeInteger(subjects.revision) ? subjects.revision : null,
253
+ // A Steel revision is an integer; a snapshot model's is the 64-hex revision id, with the digest of its source file.
254
+ const hex = (value) => typeof value === 'string' && /^[0-9a-f]{64}$/.test(value);
255
+ const revision = Number.isSafeInteger(subjects.revision) || hex(subjects.revision) ? subjects.revision : null;
256
+ return Object.freeze({ source: subjects.source, revision, ...(hex(subjects.sourceDigest) ? { sourceDigest: subjects.sourceDigest } : {}),
254
257
  total, key: typeof subjects.key === 'string' && subjects.key.length <= 64 ? subjects.key : null, items: Object.freeze(items) });
255
258
  }
256
259
  let selectionKey = 'null';