@floless/app 0.163.0 → 0.165.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.
@@ -241,6 +241,41 @@
241
241
  guidance: 'on-demand',
242
242
  });
243
243
 
244
+ // #2926: Flo on the stage while a drawing read runs. It shows only what FloLess saw the AI do: the sheet pictures
245
+ // it asked for, and its own progress sentence.
246
+ def('filter.flo-toggle', {
247
+ label: 'Show Flo',
248
+ actsOn: 'Shows or hides Flo, who marks the part of the drawing the AI is reading',
249
+ group: 'On the Drawing Filter canvas',
250
+ persistence: 'local',
251
+ interaction: 'instant',
252
+ risk: [],
253
+ guidance: 'on-demand',
254
+ why: 'While a drawing read runs, Flo stands beside the part of the sheet the AI asked FloLess to show it, and says what the AI is doing. When the AI has asked you something, Flo moves to the corner and says it is waiting for your answer. It is on until you turn it off, and stays off on this computer. It changes nothing in the filter.',
255
+ });
256
+
257
+ def('filter.flo-show-sheet', {
258
+ label: 'Show the sheet Flo is reading',
259
+ actsOn: 'Opens the sheet the AI is reading now',
260
+ group: 'On the Drawing Filter canvas',
261
+ persistence: 'local',
262
+ interaction: 'instant',
263
+ risk: [],
264
+ guidance: 'on-demand',
265
+ why: 'Shown in Flo’s bubble while the AI reads a sheet you are not looking at. The view never changes by itself: this is the way to follow it. Your filter is untouched.',
266
+ });
267
+
268
+ def('filter.flo-answer', {
269
+ label: 'Answer in AI Chat',
270
+ actsOn: 'Opens the AI’s question in AI Chat',
271
+ group: 'On the Drawing Filter canvas',
272
+ persistence: 'none',
273
+ interaction: 'instant',
274
+ risk: [],
275
+ guidance: 'on-demand',
276
+ why: 'Shown in Flo’s bubble while the drawing read waits for your answer in AI Chat. It opens that conversation, where the question is; it answers nothing for you.',
277
+ });
278
+
244
279
  def('filter.place-clear', {
245
280
  label: 'Clear the marked place',
246
281
  actsOn: 'Removes the outline of a place AI Chat opened on this drawing',
@@ -2894,19 +2894,25 @@
2894
2894
  why: 'A question sent with objects selected is linked to them, so selecting one later shows the question and opens it in chat.',
2895
2895
  });
2896
2896
  // #2438: @-mentions — the list of members and sheets, its rows, and the chips that go with the next message.
2897
+ // #2874: RFIs and Knowledge pages too, and each item of a sent message's Mentioned line opens what it names.
2897
2898
  def('shell.chat-mention-pick', {
2898
- label: 'Mention a member or sheet', actsOn: 'Adds {instance} to your next message as a mention; FloLess tells the AI exactly which member or sheet it is',
2899
- anyInstance: 'a member or sheet in the @ list', group: 'In AI Chat', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand',
2900
- why: 'Two members can share a mark. A mention names the one you picked, so the AI does not have to guess.',
2899
+ label: 'Mention something in this project', actsOn: 'Adds {instance} to your next message as a mention; FloLess tells the AI exactly which member, sheet, RFI or Knowledge page it is',
2900
+ anyInstance: 'a member, sheet, RFI or Knowledge page in the @ list', group: 'In AI Chat', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand',
2901
+ why: 'Two members can share a mark, and a page title can read like a mark. A mention names the one you picked, so the AI does not have to guess.',
2901
2902
  });
2902
2903
  def('shell.chat-mention-retry', {
2903
- label: 'List members and sheets again', actsOn: 'Asks FloLess again for the project\'s members and sheets after it could not list them',
2904
+ label: 'List what you can mention again', actsOn: 'Asks FloLess again for the project\'s members, sheets, RFIs and Knowledge pages after it could not list them',
2904
2905
  group: 'In AI Chat', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand',
2905
2906
  });
2906
2907
  def('shell.chat-mention', {
2907
- label: 'Mention in the next message', actsOn: 'Says which member or sheet {instance} is, and that it goes with your next message',
2908
+ label: 'Mention in the next message', actsOn: 'Says which member, sheet, RFI or Knowledge page {instance} is, and that it goes with your next message',
2908
2909
  anyInstance: 'a mention above the message box', group: 'In AI Chat', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand',
2909
2910
  });
2911
+ def('shell.chat-mention-open', {
2912
+ label: 'Open what a message mentioned', actsOn: 'Opens {instance}: a member in the model, an RFI on the RFIs step, a sheet\'s picture, or a Knowledge page at the version mentioned',
2913
+ anyInstance: 'an item of a sent message\'s Mentioned line', group: 'In AI Chat', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand',
2914
+ why: 'It shows what the message named, as FloLess recorded it. A Knowledge page that changed since is said, never shown as the one mentioned.',
2915
+ });
2910
2916
  def('shell.chat-mention-remove', {
2911
2917
  label: 'Leave a mention out', actsOn: 'Sends your next message without {instance}',
2912
2918
  anyInstance: 'a mention above the message box', group: 'In AI Chat', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand',
@@ -3655,10 +3661,16 @@
3655
3661
  group: 'In AI Chat', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand',
3656
3662
  });
3657
3663
  def('shell.chat-cite-assume', {
3658
- label: 'Go on with a claim as an assumption', actsOn: 'Records, with your name and the date, that you chose to go on with a claim that has no source; the claim is labelled Assumption and the AI is told with your next message. Nothing is typed or sent now',
3664
+ label: 'Record a claim as an assumption', actsOn: 'Saves, with your name and the date, your decision to go on with a claim that has no source; the claim is labelled Assumption and the AI receives it with your next message. Nothing runs, and nothing is typed or sent now',
3659
3665
  group: 'In AI Chat', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand',
3660
3666
  why: 'Going on is always your choice, and only you can make it: the record stays with the answer after a reload, and the claim still shows no source, because an assumption is not one.',
3661
3667
  });
3668
+ // #2930: the AI named a model member that exists the wrong way, and its answer ended before it corrected it.
3669
+ def('shell.chat-cite-correct', {
3670
+ label: 'Ask the AI to correct a reference', actsOn: 'Sends a message now asking the AI to answer again with a member reference it named wrongly corrected; the earlier answer stays as it is',
3671
+ group: 'In AI Chat', persistence: 'external', interaction: 'instant', risk: ['costs-time', 'costs-money'], guidance: 'on-demand',
3672
+ why: 'Correcting a reference is the AI’s job, not yours: FloLess found the member, and the AI has to name it the right way.',
3673
+ });
3662
3674
  // #2643: the person names the source of a claim the AI gave none for: a sheet or model member FloLess finds in the project.
3663
3675
  def('shell.chat-cite-choose', {
3664
3676
  label: 'Choose the source of a claim', actsOn: 'Opens a list of the project’s sheets, model members and Knowledge pages, and the files sent in this conversation, to pick the one a claim with no source comes from; nothing is typed or sent',
@@ -3693,11 +3705,16 @@
3693
3705
  why: 'A person chose this source. No AI read is recorded for this choice, and nothing checked the claim. A sheet whose picture changed since is shown from its source drawing and says so.',
3694
3706
  });
3695
3707
  def('shell.chat-cite-close', {
3696
- label: 'Close the cited source', actsOn: 'Closes the sheet, Knowledge page, member or file an answer cited and returns to the conversation',
3708
+ label: 'Close the source you are viewing', actsOn: 'Closes the sheet, Knowledge page, member or file an answer cited, you chose or a message mentioned, and returns to the conversation',
3697
3709
  group: 'In AI Chat', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand',
3698
3710
  });
3699
3711
  def('shell.chat-cite-open-knowledge', {
3700
- label: 'Open a cited page in Knowledge', actsOn: 'Opens the project’s Knowledge on the page the answer cited, at the version it cited',
3712
+ label: 'Open the page in Knowledge', actsOn: 'Opens the project’s Knowledge on the page an answer cited, you chose or a message mentioned, at that version',
3713
+ group: 'In AI Chat', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand',
3714
+ });
3715
+ // #2874: a mentioned page FloLess no longer holds at that version opens as it is now, and says so.
3716
+ def('shell.chat-mention-open-current-knowledge', {
3717
+ label: 'Open the current page in Knowledge', actsOn: 'Opens the project’s Knowledge on the page a message mentioned, as it is now, because FloLess no longer holds the version that was mentioned',
3701
3718
  group: 'In AI Chat', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand',
3702
3719
  });
3703
3720
  // #2471: a cited member, shown in the project's model; a cited file, opened in the app it belongs to.
@@ -5554,7 +5571,7 @@
5554
5571
 
5555
5572
  def('shell.project-rfi-cite', {
5556
5573
  label: 'Cite…',
5557
- actsOn: 'Lists this project’s Knowledge pages and the saved sheets of the projects linked on its Modules step, to cite',
5574
+ actsOn: 'Lists this project’s Knowledge pages to cite and, on a General project, the saved sheets of the projects linked on its Modules step',
5558
5575
  group: RFIS_STEP,
5559
5576
  persistence: 'none',
5560
5577
  interaction: 'dialog',
@@ -6363,7 +6380,7 @@
6363
6380
  interaction: 'instant',
6364
6381
  risk: [],
6365
6382
  guidance: 'on-demand',
6366
- why: 'FloLess never sees your password. For Google Workspace, Gmail sending is always asked for so RFIs can be emailed; the Drive file list is asked for only when it is ticked. When offered, Connect first switches this computer to FloLess’s own Google sign-in, which stays even if you cancel.',
6383
+ why: 'FloLess never sees your password. For Google Workspace, Gmail sending is always asked for so RFIs can be emailed; the Drive file list is asked for only when it is ticked. When offered, Connect first switches this computer to FloLess’s own Google sign-in, which stays even if you cancel. Microsoft 365 switches to FloLess’s own Microsoft sign-in unless your own Microsoft app is already set up. The switch stays if you cancel, and other Microsoft accounts signed in before it need Reconnect.',
6367
6384
  });
6368
6385
 
6369
6386
  def('shell.integrations-google-drive-choice', {
@@ -6379,7 +6396,7 @@
6379
6396
 
6380
6397
  def('shell.integrations-account-reconnect', {
6381
6398
  label: 'Reconnect this account',
6382
- actsOn: 'Opens the sign-in again for {instance} only. The first switch to FloLess’s own Google sign-in moves every account that has no sign-in file of its own',
6399
+ actsOn: 'Opens the sign-in again for {instance} only. The first switch to FloLess’s own Google or Microsoft sign-in moves every account of that service that has no sign-in file of its own',
6383
6400
  group: 'In the Integrations dialog',
6384
6401
  persistence: 'external',
6385
6402
  interaction: 'instant',
@@ -2113,6 +2113,12 @@
2113
2113
  def('steel.profile-colours', { label: 'Profile colours', actsOn: 'Opens the key of section colours for the whole model, and lets you change any of them', group: 'In the 3D toolbar', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'It only changes how members are DRAWN — no geometry, no sections, nothing that reaches the lock.' });
2114
2114
  def('steel.structure-stats', { label: 'Structure numbers', actsOn: 'Expands the members and weight for the active plan sheet, or for the whole model while the 3D view is active', group: 'In the steel editor header', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'The header states the total; opening it shows what the total is made of, and changes nothing.' });
2115
2115
  def('steel.quality-stats', { label: 'Quality numbers', actsOn: 'Expands what is unresolved on this sheet — RFI, duplicates, member ends and read confidence', group: 'In the steel editor header', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'The header states how many issues there are; opening it says which kinds, and changes nothing.' });
2116
+ /* #2521 row 6: what in a Quick model rests on an AI decision. The switch only hides the canvas and 3D marks; the strip
2117
+ and the Inspect note stay, because they carry "unmarked members may still rest on AI decisions". */
2118
+ def('steel.show-ai-decisions', { label: 'Show AI decisions', actsOn: 'Shows or hides the marks on member ends and connections that rest on an AI decision, in 2D and 3D', group: 'In the ⋯ menu — Display', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'An open square marks a member end whose height the AI chose; a ring marks a connection the AI assumed. The row is only there when a member end or connection is marked. The AI decisions strip and the Properties note stay either way.' });
2119
+ def('steel.ai-decisions-note', { label: 'AI decisions details', actsOn: 'Opens the list of AI decisions that bear on the whole model, and what the marks and the label each describe', group: 'On the steel canvas', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'A mark is what FloLess can trace. Members without one may still rest on AI decisions it cannot trace, such as the Drawing Filter or the model origin.' });
2120
+ def('steel.ai-decision-view-note', { label: 'AI-chosen view setup', actsOn: 'Says that the AI decided the scale or level of {instance}', anyInstance: 'a drawing view', group: 'On the steel canvas', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Every member drawn on that view rests on the choice, so it is a note on the view rather than a mark on each member. Not reviewed.' });
2121
+ def('steel.inspector-ai-decisions', { label: 'Rests on AI decisions', actsOn: 'Lists each AI decision the selected member rests on: what the AI chose, and why', group: 'In the Properties panel', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'None of these decisions is reviewed, and the member may still rest on others FloLess cannot trace.' });
2116
2122
  def('steel.quick-model-chip', { label: 'Quick model label', actsOn: 'Says that the model, as last saved, was built by the AI deciding where it would have asked you', group: 'In the steel editor header', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'A Quick model is fine for a tender or an estimate but is not precise. The label describes the model as last saved; "Possibly Quick" means FloLess could not read which AI decisions it rests on.' });
2117
2123
  def('steel.confidence-report', { label: 'Open confidence report', actsOn: 'Opens the recorded drawing-confidence review', group: 'In the steel editor header', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Shows current field-level read evidence without changing the model.' });
2118
2124
 
@@ -2336,6 +2342,9 @@
2336
2342
  def('steel.rfi-status-filter', { label: 'Status', actsOn: 'Filters the RFI list to {instance}', group: 'In a steel project’s RFIs step', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Open means anything still waiting on somebody — raised, sent or answered. Closed ones stay listed so a settled question can be looked up later.' });
2337
2343
  def('steel.rfi-copy', { label: 'Copy whole RFI', actsOn: 'Copies {instance} as text, ready to paste into an email', group: 'In a steel project’s RFIs step', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'This copies the same complete question FloLess sends through Gmail. If the clipboard cannot be reached, the text is shown instead so you can copy it by hand.' });
2338
2344
  def('steel.rfi-quick-refile', { label: 'Try filing again', actsOn: 'Files the questions {instance} keeps that the AI could not file yet', anyInstance: 'a Quick model version', group: 'In a steel project’s RFIs step', persistence: 'external', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'A Quick model keeps the questions the AI could not settle with the version it published. When the RFI file could not take them, this files them, marked as the AI’s. Anything already filed is not filed twice, and nothing is sent to anyone.' });
2345
+ def('steel.rfi-read-raise', { label: 'Raise an RFI', actsOn: 'Files the question “{instance}” from the drawing read as an open RFI. Nothing is sent', anyInstance: 'a question from the drawing read', group: 'In a steel project’s RFIs step', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'A drawing read can publish its model with questions nobody filed. They wait under From the read, not filed until somebody raises them. This files one as an open RFI. It sends nothing, and a question already filed is not filed twice.' });
2346
+ def('steel.rfi-read-raise-all', { label: 'Raise one RFI for all', actsOn: 'Files every question of {instance} from the drawing read as one grouped RFI (more than one when there are over 64). Nothing is sent', anyInstance: 'a kind of read question', group: 'In a steel project’s RFIs step', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Many questions of one kind, such as the heights a read assumed, are one conversation with the engineer. This files them as one grouped RFI, or as several when there are more than 64. It sends nothing.' });
2347
+ def('steel.rfi-read-toggle', { label: 'Show questions', actsOn: 'Shows or hides the questions of {instance} from the drawing read', group: 'In a steel project’s RFIs step', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'A kind with many questions opens on request, so it does not bury the RFIs below it.' });
2339
2348
  def('steel.rfi-group-toggle', { label: 'Show occurrences', actsOn: 'Expands or collapses the ordered occurrences in {instance}', group: 'In a steel project’s RFIs step', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'A grouped question remains one RFI. Expanding it reveals each occurrence’s own status, drawing destination and scoped actions without creating duplicate rows.' });
2340
2349
  def('steel.rfi-group-elsewhere', { label: 'Show elsewhere in this RFI', actsOn: 'Reveals occurrences from {instance} that are not on the current sheet', group: 'In a steel project’s RFIs step', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'The sheet filter keeps a grouped RFI indivisible. Matching occurrences stay first; this disclosure reveals the rest without pretending they belong to the current sheet.' });
2341
2350
  def('steel.rfi-technical', { label: 'Technical details', actsOn: 'Shows the stored technical identity for {instance}', group: 'In a steel project’s RFIs step', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'The internal gap key is useful for diagnosis but is not a user-facing action selector, so it stays behind this disclosure.' });
@@ -202,6 +202,8 @@ export function createSteelAdapter({ viewport, editorBridge = {} }) {
202
202
  // The members the 3D view has built (connection parts excluded); null before the view exists. The AI Chat's view command
203
203
  // selects only these (#2876).
204
204
  drawnMemberIds: () => invoke('drawnMemberIds', [], null),
205
+ // #2521 row 6: the member ends and connections that rest on an AI decision; null clears them.
206
+ setAiMarks: (spec) => invoke('setAiMarks', [spec]),
205
207
  isIsolated: () => !!invoke('isIsolated', [], false),
206
208
  selectionHiddenIds: () => invoke('selectionHiddenIds', [], []),
207
209
  connHiddenIds: () => invoke('connHiddenIds', [], []),
@@ -1,6 +1,7 @@
1
1
  /*
2
- * A General project's RFIs step (#2470 R6.6): the project's questions for the engineer, client or architect. Each RFI
3
- * may cite a page of this project's Knowledge or a saved sheet of a project linked on its Modules step; FloLess sends
2
+ * A project's RFIs step (#2470 R6.6 General; R6.6d Trace, Revit, Tekla and Drawing Checker): the project's questions for
3
+ * the engineer, client or architect. Each RFI may cite a page of this project's Knowledge or, on a General project, a
4
+ * saved sheet of a project linked on its Modules step (only General links projects); FloLess sends
4
5
  * it through the connected Gmail account (R6.6b, the same delivery engine as Steel's) or gives the email text for the
5
6
  * person to send, and keeps what was sent, answered and closed.
6
7
  *
@@ -10,6 +11,8 @@
10
11
  */
11
12
  (() => {
12
13
  const bridge = () => window.flolessBridge || {};
14
+ /** Only a General project links other projects (its Modules step), so only it can cite their sheets (#2470 R6.6d). */
15
+ const linksProjects = (project) => !!project && (project.templateId || project.app) === 'floless-general';
13
16
  const api = (path, init) => {
14
17
  if (typeof bridge().api === 'function') return bridge().api(path, init);
15
18
  return fetch(path, { headers: { 'Content-Type': 'application/json' }, ...init }).then(async (res) => {
@@ -330,7 +333,7 @@
330
333
  drifted ? `<button type="button" class="ghost" data-pr-again="${id}" data-command-id="shell.project-rfi-file-again#${esc(rfi.id)}" ${label}
331
334
  data-tip="Opens New RFI with this title and question and the items that still match">File again from this…</button>` : '',
332
335
  ].join('');
333
- return `<div class="pg-row pr-row" role="listitem"${(state.form?.busy && state.form.rfiId === rfi.id) || recovering ? ' aria-busy="true"' : ''}>
336
+ return `<div class="pg-row pr-row${state.mentioned === rfi.id ? ' is-mentioned' : ''}" role="listitem"${(state.form?.busy && state.form.rfiId === rfi.id) || recovering ? ' aria-busy="true"' : ''}>
334
337
  <div class="pg-row-line"><span class="pg-row-title" tabindex="-1" data-pr-title="${id}">${id} · ${esc(rfi.title)}</span>
335
338
  <span class="pw-chip${rfi.status === 'closed' ? ' is-muted' : ''}">${esc(STATUS[rfi.status] || rfi.status)}</span>${pending ? `<span class="pw-chip is-muted">${d.status === 'prepared' ? 'Unfinished' : 'Not confirmed'}</span>` : ''}</div>
336
339
  <span class="pg-row-meta">${meta.join(' · ')}</span>
@@ -411,6 +414,7 @@
411
414
  mine.view = { status: 'ready', data, error: null };
412
415
  if (mine.form && !data.rfis.some((r) => r.id === mine.form.rfiId)) mine.form = null;
413
416
  paint();
417
+ settleWant();
414
418
  if (data.store === 'ok') {
415
419
  const n = data.rfis.length;
416
420
  if (!mine.quietLoad) announce(n === 0 ? 'No RFIs in this project yet' : `${n} RFI${n === 1 ? '' : 's'}`);
@@ -422,6 +426,7 @@
422
426
  mine.view = { status: gone ? 'gone' : 'failed', data: null,
423
427
  error: said(error, 'FloLess couldn’t read them just now. Check that FloLess is still running, then try again.') };
424
428
  paint();
429
+ settleWant();
425
430
  announce(gone ? 'FloLess couldn’t find this project any more.' : 'FloLess couldn’t load this project’s RFIs.');
426
431
  } finally {
427
432
  mine.inflight = false;
@@ -429,12 +434,60 @@
429
434
  }
430
435
  }
431
436
 
437
+ /**
438
+ * #2874: show one RFI a chat message mentioned. Settles once this project's RFIs are read: the filter widens to All
439
+ * when it hides the RFI, and its row title is focused and outlined. Every outcome is `{ok, said?}`, never a throw; a
440
+ * later request, or the pane drawn again for another project, answers an earlier one `{superseded:true}`.
441
+ */
442
+ function focus(projectId, rfiId) {
443
+ if (!state || state.project.id !== projectId) return Promise.resolve({ ok: false, said: `The RFIs step is not showing this project, so ${rfiId} was not shown.` });
444
+ state.want?.resolve({ superseded: true });
445
+ return new Promise((resolve) => {
446
+ state.want = { rfiId, resolve };
447
+ if (state.view.status !== 'loading' && !state.inflight) settleWant();
448
+ });
449
+ }
450
+
451
+ function settleWant() {
452
+ const want = state?.want;
453
+ if (!want) return;
454
+ state.want = null;
455
+ const { rfiId } = want;
456
+ // A failure is shown on this pane, where the person is looking, as well as returned for the chat's own line.
457
+ const resolve = (outcome) => { if (outcome.ok === false) toast(outcome.said, 'warn'); want.resolve(outcome); };
458
+ const data = state.view.status === 'ready' ? state.view.data : null;
459
+ if (!data || data.store !== 'ok') { resolve({ ok: false, said: `FloLess couldn’t read this project’s RFIs just now, so ${rfiId} was not shown. Click the mention again in a moment.` }); return; }
460
+ const rfi = data.rfis.find((r) => r.id === rfiId);
461
+ if (!rfi) { resolve({ ok: false, reason: 'missing', said: `${rfiId} is no longer one of this project’s RFIs. The list on screen shows the RFIs it has now.` }); return; }
462
+ const widened = !visible([rfi], state.filter).length;
463
+ if (widened) state.filter = 'all';
464
+ state.focusAfter = `[data-pr-title="${CSS.escape(rfiId)}"]`;
465
+ // Outlined for a moment, through any repaint meanwhile (a readiness check, a background read).
466
+ const mine = state;
467
+ mine.mentioned = rfiId;
468
+ if (mine.form) readDraft(); // an open form keeps what was typed across the repaint
469
+ paint();
470
+ const row = state.pane.querySelector(`[data-pr-title="${CSS.escape(rfiId)}"]`)?.closest('.pr-row');
471
+ if (!row) { mine.mentioned = null; resolve({ ok: false, said: `${rfiId} could not be shown. Choose All and find it there.` }); return; }
472
+ row.scrollIntoView?.({ block: 'center' });
473
+ setTimeout(() => {
474
+ if (mine.mentioned !== rfiId) return;
475
+ mine.mentioned = null;
476
+ mine.pane.querySelector(`[data-pr-title="${CSS.escape(rfiId)}"]`)?.closest('.pr-row')?.classList.remove('is-mentioned');
477
+ }, 2400);
478
+ resolve(widened ? { ok: true, said: `Showing all RFIs, so ${rfiId} is in view.` } : { ok: true });
479
+ }
480
+
432
481
  function render(pane, project) {
433
482
  if (!pane || !project) return;
434
483
  const same = state && state.pane === pane && state.project.id === project.id;
484
+ // The same project drawn again (the step shown again while its list loads) keeps the RFI a mention asked for, and
485
+ // shows it once this read is in; another project answers that request as overtaken.
486
+ const want = same ? state.want : null;
487
+ if (!same) state?.want?.resolve({ superseded: true });
435
488
  state = { pane, project, generation: (state?.generation || 0) + 1, view: { status: 'loading', data: null },
436
489
  filter: same ? state.filter : 'open', form: null, inflight: false, again: false, focusAfter: null,
437
- readiness: { status: 'loading' }, recovering: null, alertFor: null };
490
+ readiness: { status: 'loading' }, recovering: null, alertFor: null, want: want ?? null };
438
491
  paint();
439
492
  void load();
440
493
  void checkReadiness();
@@ -895,7 +948,7 @@
895
948
  <div class="pr-field"><span>Cited</span>
896
949
  <div class="pr-cites" role="list" aria-label="Cited items">${chips || '<span class="pg-row-meta">Nothing cited yet. You can cite up to 5 items.</span>'}</div>
897
950
  <p><button type="button" class="ghost" data-pr-cite="1" aria-haspopup="listbox" data-command-id="shell.project-rfi-cite"
898
- data-tip="${full ? 'You can cite up to 5 items. Remove one to cite another.' : 'Cite a page of this project’s Knowledge or a saved sheet of a linked project'}"${full || sheet.uncertain ? ' aria-disabled="true"' : ''}>Cite…</button></p></div>
951
+ data-tip="${full ? 'You can cite up to 5 items. Remove one to cite another.' : linksProjects(state?.project) ? 'Cite a page of this project’s Knowledge or a saved sheet of a linked project' : 'Cite a page of this project’s Knowledge'}"${full || sheet.uncertain ? ' aria-disabled="true"' : ''}>Cite…</button></p></div>
899
952
  <label class="pr-field">To (optional)<input type="email" class="pr-input" data-pr-field="to" value="${esc(sheet.to)}" autocomplete="email" data-command-id="shell.project-rfi-to"${ro}>
900
953
  <span class="pg-row-meta">Only needed to record who you sent it to.</span></label>`;
901
954
  $foot.innerHTML = sheet.uncertain
@@ -936,19 +989,24 @@
936
989
  function paintPicker() {
937
990
  const mine = sheet;
938
991
  $title.textContent = 'Cite';
939
- $sub.textContent = 'A page of this project’s Knowledge, or a saved sheet of a project linked on its Modules step.';
992
+ $sub.textContent = linksProjects(state?.project) ? 'A page of this project’s Knowledge, or a saved sheet of a project linked on its Modules step.'
993
+ : 'A page of this project’s Knowledge.';
940
994
  const picks = mine.picks;
941
995
  const search = `<input type="search" class="ws-landing-search pr-search" data-pr-search="1" placeholder="Filter" aria-label="Filter what can be cited" value="${esc(mine.query)}" data-command-id="shell.project-rfi-cite-search">`;
942
996
  let groups = '';
997
+ // Nothing to filter (no Knowledge pages and no linked project): the Filter box is left out rather than shown idle.
998
+ let filterable = true;
943
999
  if (mine.pickerError) groups = `<p class="pm-note pr-alert" role="alert">${esc(mine.pickerError)}</p>`;
944
1000
  else if (!mine.citable) groups = '<p class="pg-loading-line">Loading…</p>';
945
1001
  else {
946
1002
  const k = mine.citable.knowledge;
947
1003
  const kOptions = k.state === 'ok' ? k.pages.map((p) => ({ kind: 'knowledge-page', generationId: k.generationId, slug: p.slug, title: p.title })) : [];
948
1004
  const kBody = k.state === 'ok' ? (kOptions.length ? kOptions.map((c) => optionHtml(c, picks.has(citeKey(c)))).join('') : '<p class="pm-note">No page matches.</p>')
949
- : k.state === 'none' ? '<p class="pm-note">This project has no published Knowledge pages yet.</p>'
1005
+ // #2470 R6.6d: on a Trace, Revit, Tekla or Drawing Checker project this is the only group, so it says how to get pages.
1006
+ : k.state === 'none' ? '<p class="pm-note">This project has no Knowledge pages yet. Add references on the Knowledge step and choose Organize, then cite them here.</p>'
950
1007
  : '<p class="pm-note">FloLess couldn’t list this project’s Knowledge just now.</p>';
951
1008
  groups = `<div role="group" aria-labelledby="pr-g-k"><p class="pr-group" id="pr-g-k">This project’s Knowledge</p>${kBody}</div>`;
1009
+ filterable = k.state !== 'none' || mine.citable.linked.length > 0 || !!mine.query;
952
1010
  mine.citable.linked.forEach((l, i) => {
953
1011
  const options = (l.sheets || []).map((s) => ({ kind: 'linked-drawing', linkedProjectUuid: l.projectUuid, linkedProjectName: l.name, pageId: s.pageId, sourceHash: s.sourceHash, sheet: s.sheet, pageNumber: s.pageNumber }));
954
1012
  const body = l.state === 'ok' ? (options.length ? options.map((c) => optionHtml(c, picks.has(citeKey(c)))).join('') : '<p class="pm-note">No sheet matches.</p>')
@@ -960,7 +1018,7 @@
960
1018
  mine.options = new Map([...kOptions, ...mine.citable.linked.flatMap((l) => (l.sheets || []).map((s) => ({ kind: 'linked-drawing', linkedProjectUuid: l.projectUuid, linkedProjectName: l.name, pageId: s.pageId, sourceHash: s.sourceHash, sheet: s.sheet, pageNumber: s.pageNumber })))].map((c) => [citeKey(c), c]));
961
1019
  }
962
1020
  const hadFocus = document.activeElement?.hasAttribute?.('data-pr-search');
963
- $body.innerHTML = `${search}<p class="sr-only pr-pick-live" role="status" aria-live="polite"></p><div class="pr-options" role="listbox" aria-multiselectable="true" aria-label="What can be cited">${groups}</div>`;
1021
+ $body.innerHTML = `${filterable ? search : ''}<p class="sr-only pr-pick-live" role="status" aria-live="polite"></p><div class="pr-options" role="listbox" aria-multiselectable="true" aria-label="What can be cited">${groups}</div>`;
964
1022
  if (hadFocus) { const input = $body.querySelector('[data-pr-search]'); input?.focus(); input?.setSelectionRange?.(mine.query.length, mine.query.length); }
965
1023
  $foot.innerHTML = `<button type="button" class="ghost" data-pr-pick-back="1" data-command-id="shell.project-rfi-cite-back">← Back to the RFI</button>
966
1024
  <button type="button" class="primary" data-pr-pick-done="1" data-command-id="shell.project-rfi-cite-done">${picks.size ? `Cite ${picks.size}` : 'Cite none'}</button>`;
@@ -1174,7 +1232,7 @@
1174
1232
  });
1175
1233
 
1176
1234
  /**
1177
- * The sentence a Duplicate or Import adds about a General project's RFIs (#2470 R6.6). Null when there is nothing to
1235
+ * The sentence a Duplicate or Import adds about a project's RFIs-step RFIs (#2470 R6.6; any kind that keeps them, R6.6d). Null when there is nothing to
1178
1236
  * say. A source that could not be carried is said, never turned into silence.
1179
1237
  */
1180
1238
  function transferNote(raw, operation = 'duplicate') {
@@ -1193,5 +1251,5 @@
1193
1251
  window.addEventListener('floless:projects-changed', refresh);
1194
1252
  // Back from Integrations (or any window): a send that waited on Google may be possible now.
1195
1253
  window.addEventListener('focus', () => { if (state && shown(state.pane) && state.readiness?.status !== 'ready' && !state.form?.busy) void checkReadiness(); });
1196
- window.flolessProjectRfis = { render, refresh, html, transferNote };
1254
+ window.flolessProjectRfis = { render, refresh, html, transferNote, focus };
1197
1255
  })();
@@ -907,6 +907,7 @@ function renderSteelFrame() {
907
907
  controls.update();
908
908
  refreshCameraClipping();
909
909
  sizeEndpoints();
910
+ sizeAiMarks();
910
911
  sizeClipHandles();
911
912
  clipCreationPreview?.resize();
912
913
  sizeFrameHandle();
@@ -5448,6 +5449,7 @@ function rebuildEndpoints() {
5448
5449
  const g = geoOf(m); if (!g) continue;
5449
5450
  addEndpoint(g.line[0], epMatStart, id, 0); addEndpoint(g.line[1], epMatEnd, id, 1);
5450
5451
  }
5452
+ applyAiMarks(); // #2521 row 6: the AI-decision marks follow the same visibility
5451
5453
  }
5452
5454
  function addEndpoint(p, mat, id, end) {
5453
5455
  const s = new THREE.Mesh(epGeom, mat);
@@ -5470,6 +5472,155 @@ function sizeEndpoints() {
5470
5472
  }
5471
5473
  }
5472
5474
 
5475
+ // ---- #2521 row 6: what rests on an AI decision ----
5476
+ // A Quick model's member ends whose height the AI chose (an open square) and its connections the AI assumed (a ring),
5477
+ // pushed by the editor through setAiMarks. Plan: docs/superpowers/specs/2026-10-29-quick-model-row6-PLAN.md (R9, R10,
5478
+ // V3, V4). Member materials are never touched, so selection, hover and the amber "needs review" lift keep their
5479
+ // meaning. The SPEC lives here, not on meshes, so every rebuild re-draws it (rebuildEndpoints calls applyAiMarks).
5480
+ const AI_JOINT_OFFSET_PX = 36; // a ring at a member end sits this far along the member on screen, clear of the end's labels
5481
+ const AI_MARK_PX = 13; // on-screen size of a mark, held in both cameras by pxToWorldAt (sizeAiMarks)
5482
+ let aiMarkSpec = null; // { ends: [[memberId, end]], joints: [{ jointId, memberIds, main }] } | null
5483
+ let aiMarkGroup = null;
5484
+ let aiMarkMats = null; // { key, square, ring }: owned, disposed only on a theme change or teardown
5485
+ function aiMarkMaterials() {
5486
+ const css = getComputedStyle(document.documentElement);
5487
+ const warn = css.getPropertyValue('--warn').trim() || '#fbbf24', panel = css.getPropertyValue('--panel').trim() || '#111827';
5488
+ const key = warn + '|' + panel;
5489
+ if (aiMarkMats && aiMarkMats.key === key) return aiMarkMats;
5490
+ disposeAiMarkMats();
5491
+ const make = (draw) => {
5492
+ const S = 64, c = document.createElement('canvas'); c.width = c.height = S;
5493
+ const g = c.getContext('2d'); g.lineWidth = 7; g.strokeStyle = warn; g.fillStyle = panel; draw(g, S);
5494
+ const tex = new THREE.CanvasTexture(c); tex.colorSpace = THREE.SRGBColorSpace;
5495
+ return new THREE.SpriteMaterial({ map: tex, transparent: true, depthTest: false, depthWrite: false });
5496
+ };
5497
+ aiMarkMats = {
5498
+ key,
5499
+ square: make((g, S) => { g.globalAlpha = 0.85; g.fillRect(12, 12, S - 24, S - 24); g.globalAlpha = 1; g.strokeRect(12, 12, S - 24, S - 24); }),
5500
+ ring: make((g, S) => { g.beginPath(); g.arc(S / 2, S / 2, S / 2 - 8, 0, Math.PI * 2); g.stroke(); }),
5501
+ };
5502
+ return aiMarkMats;
5503
+ }
5504
+ function disposeAiMarkMats() {
5505
+ if (!aiMarkMats) return;
5506
+ for (const m of [aiMarkMats.square, aiMarkMats.ring]) { m.map?.dispose(); m.dispose(); }
5507
+ aiMarkMats = null;
5508
+ }
5509
+ /** Where a joint's ring goes: the main member's end its `at` names; else the end of a secondary member nearest the main
5510
+ * member's line (where it frames in); else the middle of the main member. The same order as the 2D ring. */
5511
+ function aiJointPoint(j, byId) {
5512
+ const main = j.main ? byId.get(j.main) : null, mg = main && geoOf(main);
5513
+ const others = j.memberIds.filter((id) => id !== j.main).map((id) => byId.get(id)).filter(Boolean);
5514
+ if (!mg || !mg.line) { // main member gone: the ring still lands on the joint's members, at the first one's middle
5515
+ const g = others.map(geoOf).find((x) => x && x.line);
5516
+ return g ? g.line[0].map((v, i) => (v + g.line[1][i]) / 2) : null;
5517
+ }
5518
+ if (j.mainEnd === 0 || j.mainEnd === 1) {
5519
+ // At the member end its `at` names, set off along the member by AI_JOINT_OFFSET_PX on screen (sizeAiMarks), so the
5520
+ // ring never hides under the joint's own dimension label drawn at that end (a base plate's "e 1 9/16\"", QA run).
5521
+ const end = mg.line[j.mainEnd], other = mg.line[1 - j.mainEnd];
5522
+ const along = new THREE.Vector3(...other).sub(new THREE.Vector3(...end));
5523
+ const len = along.length(); // the offset never passes the member's middle, so a short member keeps its ring on it
5524
+ return len > 0 ? { at: end, along: along.normalize(), half: len / 2 } : end;
5525
+ }
5526
+ const a = new THREE.Vector3(...mg.line[0]), b = new THREE.Vector3(...mg.line[1]), seg = new THREE.Line3(a, b), q = new THREE.Vector3();
5527
+ let best = null, bestD = Infinity;
5528
+ for (const m of others) {
5529
+ const g = geoOf(m); if (!g || !g.line) continue;
5530
+ for (const p of g.line) { const v = new THREE.Vector3(...p); seg.closestPointToPoint(v, true, q); const d = q.distanceTo(v); if (d < bestD) { bestD = d; best = p; } }
5531
+ }
5532
+ return best || mg.line[0].map((v, i) => (v + mg.line[1][i]) / 2);
5533
+ }
5534
+ function applyAiMarks() {
5535
+ if (!scene) return;
5536
+ if (!aiMarkGroup) { aiMarkGroup = new THREE.Group(); aiMarkGroup.name = 'ai-decision-marks'; scene.add(aiMarkGroup); }
5537
+ // Sprite geometry is SHARED by every THREE.Sprite in the page: never dispose it (Codex plan review, round 2).
5538
+ for (const c of [...aiMarkGroup.children]) aiMarkGroup.remove(c);
5539
+ if (!aiMarkSpec) return;
5540
+ const mats = aiMarkMaterials();
5541
+ // ONE lookup per redraw: memberById scans the list, and this runs on every selection change.
5542
+ const byId = new Map(((api && api.allMembers && api.allMembers()) || members()).map((m) => [m.id, m]));
5543
+ const shown = (id) => { const mesh = meshById.get(id); return !!mesh && mesh.visible !== false; }; // hidden, isolated away or a hidden group: no mark
5544
+ const add = (p, mat, data) => {
5545
+ const sp = new THREE.Sprite(mat);
5546
+ sp.position.set(p[0], p[1], p[2]); sp.renderOrder = 997; sp.raycast = () => {}; sp.userData = data; // never a pick target
5547
+ aiMarkGroup.add(sp);
5548
+ return sp;
5549
+ };
5550
+ for (const [id, end] of aiMarkSpec.ends) {
5551
+ if (!shown(id)) continue;
5552
+ const m = byId.get(id), g = m && geoOf(m), p = g && g.line && g.line[end];
5553
+ if (p) add(p, mats.square, { aiMark: 'end', id, end });
5554
+ }
5555
+ for (const j of aiMarkSpec.joints) {
5556
+ if (!j.memberIds.some(shown)) continue;
5557
+ const p = aiJointPoint(j, byId);
5558
+ // A plain point is an array, and arrays have their own `.at` method: test for the offset form, never `p.at`.
5559
+ if (p && !Array.isArray(p)) { const sp = add(p.at, mats.ring, { aiMark: 'joint', id: j.jointId }); sp.userData.anchor = p.at; sp.userData.along = p.along; sp.userData.half = p.half; }
5560
+ else if (p) add(p, mats.ring, { aiMark: 'joint', id: j.jointId });
5561
+ }
5562
+ sizeAiMarks();
5563
+ }
5564
+ /** World distance along `dir` from `a` that covers `px` on screen, never past `cap`. Searched, not estimated: in
5565
+ * perspective a member running into the depth covers fewer pixels per unit the further it goes, so a one-step rate is
5566
+ * wrong over 36 px. Along a member in front of the camera the screen distance from its end only grows, so bisection is
5567
+ * exact; a point behind the near plane counts as too far. A member that never reaches `px` (seen end-on) moves `cap`. */
5568
+ function worldAlongForPx(a, dir, px, cap) {
5569
+ if (!camera || !canvasEl || !(cap > 0)) return Math.max(0, Math.min(cap, pxToWorldAt(px, a)));
5570
+ camera.updateMatrixWorld();
5571
+ const behind = (v) => v.clone().applyMatrix4(camera.matrixWorldInverse).z > -camera.near;
5572
+ // The end itself behind the camera (orbiting inside the model): nothing on screen to measure from, so the ring takes
5573
+ // the whole cap, where the member is most likely in view, rather than staying behind the camera unseen (Codex R6).
5574
+ if (behind(a)) return cap;
5575
+ const w = canvasEl.clientWidth / 2, h = canvasEl.clientHeight / 2, p0 = a.clone().project(camera), q = new THREE.Vector3();
5576
+ const screenAt = (t) => { // px from the anchor at distance t, or Infinity behind the near plane
5577
+ q.copy(a).addScaledVector(dir, t);
5578
+ if (behind(q)) return Infinity;
5579
+ q.project(camera);
5580
+ return Math.hypot((q.x - p0.x) * w, (q.y - p0.y) * h);
5581
+ };
5582
+ if (screenAt(cap) < px) return cap;
5583
+ let lo = 0, hi = cap;
5584
+ for (let k = 0; k < 40; k++) { const mid = (lo + hi) / 2; if (screenAt(mid) < px) lo = mid; else hi = mid; }
5585
+ return lo;
5586
+ }
5587
+ function sizeAiMarks() {
5588
+ if (!aiMarkGroup) return;
5589
+ for (const c of aiMarkGroup.children) {
5590
+ const { anchor, along, half } = c.userData;
5591
+ if (anchor && along) {
5592
+ // Measured on screen, not in world units: a member foreshortened by the view would otherwise barely move its ring.
5593
+ const a = new THREE.Vector3(...anchor);
5594
+ c.position.copy(a).addScaledVector(along, worldAlongForPx(a, along, AI_JOINT_OFFSET_PX, half));
5595
+ }
5596
+ c.scale.setScalar(pxToWorldAt(AI_MARK_PX, c.position));
5597
+ }
5598
+ }
5599
+ /** The editor's push: the latest spec replaces the last; null clears (the switch off, or nothing to mark). */
5600
+ function setAiMarks(spec) {
5601
+ aiMarkSpec = spec && Array.isArray(spec.ends) && Array.isArray(spec.joints)
5602
+ ? { ends: spec.ends.map((e) => [String(e[0]), e[1] === 1 ? 1 : 0]), joints: spec.joints.map((j) => ({ jointId: String(j.jointId), memberIds: (j.memberIds || []).map(String), main: j.main == null ? null : String(j.main), ...(j.mainEnd === 0 || j.mainEnd === 1 ? { mainEnd: j.mainEnd } : {}) })) }
5603
+ : null;
5604
+ applyAiMarks();
5605
+ }
5606
+ /** For tests and the E2E: what is drawn, and each mark's on-screen size in px. */
5607
+ function aiMarksProbe() {
5608
+ const h = (canvasEl && canvasEl.clientHeight) || 1;
5609
+ return (aiMarkGroup ? aiMarkGroup.children : []).map((c) => {
5610
+ const { anchor, along, half, ...data } = c.userData, r = canvasEl ? canvasEl.getBoundingClientRect() : null;
5611
+ const toScreen = (pos) => { const v = pos.clone().project(camera); return [r.left + (v.x + 1) / 2 * r.width, r.top + (1 - v.y) / 2 * r.height]; };
5612
+ return {
5613
+ ...data, screen: r ? toScreen(c.position) : null, anchorScreen: r && anchor ? toScreen(new THREE.Vector3(...anchor)) : null, sizePx: c.scale.x / Math.max(1e-12, pxToWorldAt(1, c.position)), material: c.material === aiMarkMats?.square ? 'square' : 'ring', viewportH: h,
5614
+ };
5615
+ });
5616
+ }
5617
+ if (typeof window !== 'undefined' && window.matchMedia) {
5618
+ // A theme change re-colours the marks: the next apply sees a new key and remakes the two materials.
5619
+ const retheme = () => { if (aiMarkSpec) applyAiMarks(); };
5620
+ try { new MutationObserver(retheme).observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme', 'class'] }); } catch (_) {}
5621
+ try { window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', retheme); } catch (_) {}
5622
+ }
5623
+
5473
5624
  // ---- placed 3D dimensions ----
5474
5625
  // 45° CAD terminator ticks at each end of a placed dim line (p1,p2 world arrays). The tick lies in the plane
5475
5626
  // of the line and world-up — perpendicular biased to vertical (or world-X when the line is itself vertical) —
@@ -9047,6 +9198,7 @@ function setInputActive(on) { inputActive = on !== false; viewportController?.se
9047
9198
  function isReady() { return built; }
9048
9199
 
9049
9200
  function disposeSteel() {
9201
+ if (aiMarkGroup) { scene?.remove(aiMarkGroup); aiMarkGroup = null; } disposeAiMarkMats(); // #2521 row 6 (the spec is kept: a re-init redraws it)
9050
9202
  clipGesture?.dispose(); clipGesture = null;
9051
9203
  sharedClipList?.destroy?.(); sharedClipList = null; releaseClipGestureInput?.(); releaseClipGestureInput = null; releaseClipOverlayInput?.(); releaseClipOverlayInput = null;
9052
9204
  releaseClipSession?.(); releaseClipSession = null; releaseClipSpatial?.(); releaseClipSpatial = null;
@@ -9338,6 +9490,8 @@ window.Steel3DView = {
9338
9490
  // Re-state the review lift on an already-built scene — the review state can move without the geometry
9339
9491
  // moving (a sign-off elsewhere, or the client re-deriving after its own edit), and neither rebuilds.
9340
9492
  setConnReview,
9493
+ // #2521 row 6: the member ends and connections that rest on an AI decision (the editor's ⋯ Display switch).
9494
+ setAiMarks, aiMarksProbe,
9341
9495
  // Reference models (#278) — an editor-only layer. `setReferences` takes the geometry the editor
9342
9496
  // fetched from the reference route; nothing here ever passes through contractToScene, which is what
9343
9497
  // keeps borrowed geometry out of every export by construction rather than by filtering.