@floless/app 0.140.0 → 0.141.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/web/aware.js CHANGED
@@ -3279,20 +3279,37 @@
3279
3279
  // and the section speaks to that editor while it is open — the same tabs, by the same code, as the
3280
3280
  // workspace's Model step (web/model-panel-bridge.js).
3281
3281
  let contractEditorApp = null; // the workflow the editor was opened for: Approve bakes that one
3282
- // The regions of #app the overlay covers. Covering them is not enough: Tab from the left panel would still reach
3283
- // the header, canvas and footer under it. Cards drawn above the overlay (#fullscreen-nudge, #ix-ask-menu) are not
3284
- // covered, so they are not listed and stay usable.
3282
+ // The regions of #app the overlay covers. Covering them is not enough: Tab from the Close button or the left panel
3283
+ // would still reach the header, canvas and footer under it, and Enter there runs or compiles the workflow. Cards
3284
+ // drawn above the overlay (#fullscreen-nudge, #ix-ask-menu) are not covered, so they are not listed and stay usable.
3285
+ // A model editor keeps the left panel and its edge above it (OVERLAY_COVERS); every other overlay — the Drawing
3286
+ // Filter, the local 3D viewer, an editor with no Model section — covers the whole window, so those go too (#1445).
3285
3287
  const OVERLAY_COVERS = '#app > header, #canvas-main, #app > .pane-rail-right, #inspect-panel, #whats-new-panel, #instructor, #app > footer';
3288
+ const FULL_WINDOW_COVERS = OVERLAY_COVERS + ', #chat-panel, #app > .pane-rail-left';
3286
3289
  let shellInertBefore = null; // each covered region, with the inert it had before
3287
- function overlayModelPanel(on) {
3288
- document.getElementById('app').classList.toggle('contract-editor-beside', on);
3289
- if (on && !shellInertBefore) {
3290
- shellInertBefore = [...document.querySelectorAll(OVERLAY_COVERS)]
3291
- .map((region) => { const before = region.inert; region.inert = true; return [region, before]; });
3292
- } else if (!on && shellInertBefore) {
3290
+ let overlayOpener = null; // what had focus before the first overlay opened, to give it back on close
3291
+ // Make the regions `covers` names unreachable, or none when it is null. Whatever was covered before is restored
3292
+ // first, so switching from one overlay to another covers exactly the new set and closing leaves nothing inert
3293
+ // that was not inert already. Closing also returns focus to the control that opened the overlay, when it is
3294
+ // still there and reachable — otherwise focus would be left on the page itself.
3295
+ function coverShell(covers) {
3296
+ const opening = covers && !shellInertBefore;
3297
+ if (shellInertBefore) {
3293
3298
  for (const [region, before] of shellInertBefore) region.inert = before;
3294
3299
  shellInertBefore = null;
3295
3300
  }
3301
+ if (opening) overlayOpener = document.activeElement !== document.body ? document.activeElement : null;
3302
+ if (covers) {
3303
+ shellInertBefore = [...document.querySelectorAll(covers)]
3304
+ .map((region) => { const before = region.inert; region.inert = true; return [region, before]; });
3305
+ } else {
3306
+ const opener = overlayOpener;
3307
+ overlayOpener = null;
3308
+ if (opener?.isConnected && !opener.closest('[inert]')) opener.focus?.({ preventScroll: true });
3309
+ }
3310
+ }
3311
+ function overlayModelPanel(on) {
3312
+ document.getElementById('app').classList.toggle('contract-editor-beside', on);
3296
3313
  window.flolessLeftPane?.useOverlayModelFrame(on ? $contractEditorFrame : null);
3297
3314
  }
3298
3315
  function openContractEditor(appId, type) {
@@ -3300,6 +3317,7 @@
3300
3317
  if (!r) return false;
3301
3318
  contractEditorApp = appId;
3302
3319
  overlayModelPanel(!!r.modelPanel);
3320
+ coverShell(r.modelPanel ? OVERLAY_COVERS : FULL_WINDOW_COVERS);
3303
3321
  // The editor bakes the .lock on Approve — that control belongs to an editable contract editor, not
3304
3322
  // the filter view (own Save) nor a view-only renderer. Show it unless the renderer is viewOnly.
3305
3323
  const ap0 = document.getElementById('contract-editor-approve'); if (ap0) ap0.hidden = !!r.viewOnly;
@@ -3324,6 +3342,7 @@
3324
3342
  const r = window.CONTRACT_RENDERERS && window.CONTRACT_RENDERERS[type];
3325
3343
  if (!r || !r.viewerUrl) return false;
3326
3344
  overlayModelPanel(false);
3345
+ coverShell(FULL_WINDOW_COVERS);
3327
3346
  const ap = document.getElementById('contract-editor-approve'); if (ap) ap.hidden = true;
3328
3347
  $contractEditorTitle.replaceChildren(
3329
3348
  Object.assign(document.createElement('span'), { textContent: appId, style: 'color:var(--text);font-weight:600' }),
@@ -3339,6 +3358,7 @@
3339
3358
  // iframe talks to /api/contract directly and Save writes contract.filter.
3340
3359
  function openFilterView(appId) {
3341
3360
  overlayModelPanel(false);
3361
+ coverShell(FULL_WINDOW_COVERS);
3342
3362
  // The filter view has its own Save; the overlay's "Approve & bake lock" (editor-only) would
3343
3363
  // be a confusing no-op here, so hide it. openContractEditor restores it.
3344
3364
  const ap = document.getElementById('contract-editor-approve'); if (ap) ap.hidden = true;
@@ -3366,10 +3386,55 @@
3366
3386
  }
3367
3387
  $contractEditor.hidden = true;
3368
3388
  overlayModelPanel(false); // the left Model section goes back to the workspace
3389
+ // Unhook the focus-on-load first: about:blank loading would otherwise pull focus into the now-hidden frame,
3390
+ // away from the shell the next line hands back.
3391
+ $contractEditorFrame.onload = null;
3392
+ coverShell(null); // and the shell under the overlay is reachable again
3369
3393
  $contractEditorFrame.src = 'about:blank'; // tear down the editor session + its draft listeners
3370
3394
  }
3371
3395
  document.getElementById('contract-editor-close').onclick = closeContractEditor;
3372
3396
 
3397
+ // Esc closes the overlay (#1571) — the Instructor has always said so (`shell.editor-close`, "Also: Esc") and
3398
+ // nothing did. Through closeContractEditor, never around it, so the Drawing Filter's unsaved question still asks.
3399
+ // `overlayEscClosing` makes a second Esc while that question is up a no-op instead of a second question.
3400
+ let overlayEscClosing = false;
3401
+ async function closeOverlayOnEscape() {
3402
+ if ($contractEditor.hidden || overlayEscClosing) return false;
3403
+ overlayEscClosing = true;
3404
+ try { await closeContractEditor(); } finally { overlayEscClosing = false; }
3405
+ return true;
3406
+ }
3407
+ // Focus in the shell: only while it sits on the overlay's own bar (Close, Approve) or on nothing at all. Focus in
3408
+ // the left panel beside a model editor is that panel's, and its Esc is its own. Bound on window, so it runs after
3409
+ // every document-level Esc handler, and a press one of them already used (preventDefault) is left alone. A keydown
3410
+ // inside the editor's iframe never arrives here; that half is web/overlay-escape.js, which calls the hook below.
3411
+ // Several shell dialogs, the menu and the find bar close on Esc WITHOUT marking it (app.js, the routines and guide
3412
+ // modals), and by the time this bubble listener runs they are already hidden. So whether one was showing is read in
3413
+ // the capture phase, before any of them acts: that Esc was theirs, and closing the overlay too would be two actions.
3414
+ const SHELL_ESC_OWNERS = '.modal-backdrop.show, #menu.show, #find-overlay.show';
3415
+ let shellEscOwned = false;
3416
+ window.addEventListener('keydown', (e) => {
3417
+ if (e.key === 'Escape') shellEscOwned = !!document.querySelector(SHELL_ESC_OWNERS);
3418
+ }, true);
3419
+ window.addEventListener('keydown', (e) => {
3420
+ if (e.key !== 'Escape' || e.defaultPrevented || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey || e.isComposing) return;
3421
+ if ($contractEditor.hidden || shellEscOwned) return;
3422
+ const ae = document.activeElement;
3423
+ if (ae !== document.body && ae !== null && (!$contractEditor.contains(ae) || ae === $contractEditorFrame)) return;
3424
+ e.preventDefault();
3425
+ closeOverlayOnEscape();
3426
+ });
3427
+ // The iframe's half: an Esc the page left unused. Only the page the overlay is SHOWING may close it — the same
3428
+ // editor embedded in a workspace step, or a stale frame still unloading, gets false and nothing happens.
3429
+ window.__floOverlayEscape = (win) => {
3430
+ if ($contractEditor.hidden || document.querySelector(SHELL_ESC_OWNERS)) return false; // a shell dialog above it goes first
3431
+ let current = null;
3432
+ try { current = $contractEditorFrame.contentWindow; } catch (_) { current = null; }
3433
+ if (!win || win !== current) return false;
3434
+ closeOverlayOnEscape();
3435
+ return true;
3436
+ };
3437
+
3373
3438
  // Export 3D ▸ — render the approved model as an interactive 3D model. Calls the server's
3374
3439
  // export-3d (transform → companion viewer-3d app → compile → run) and paints the returned
3375
3440
  // interactive report in the same viewer a normal run uses. api() throws on any failure (non-2xx
@@ -5453,7 +5518,11 @@
5453
5518
  `<dt>Tekla host</dt><dd>${escapeHtml(proof.hostVersion)} · PID ${escapeHtml(String(proof.hostPid))}</dd>` +
5454
5519
  `<dt>Library used</dt><dd>${escapeHtml(proof.sourcePath)}</dd>` +
5455
5520
  `<dt>Checked</dt><dd>${escapeHtml(proof.verifiedAt)}</dd></dl>` +
5456
- `<p>The generated agent's commands remain unverified.</p></div>`);
5521
+ `<p>The generated agent's commands remain unverified.</p>` +
5522
+ `<button type="button" class="graft-verify-button graft-continue-chat" id="graft-continue-chat" data-command-id="shell.graft-continue-chat">Continue in AI Chat</button></div>`);
5523
+ // Only the successful receipt carries this action. It hands the receipt to Chat as an
5524
+ // editable, unsent draft; opening Chat never re-runs the Tekla read.
5525
+ document.getElementById('graft-continue-chat')?.addEventListener('click', () => { void continueGraftReadInChat(proof); });
5457
5526
  } catch (error) {
5458
5527
  if (generation !== graftGeneration || graftState.preview !== preview || !$graftModal.classList.contains('show') || !result.isConnected || state.commitInFlight) return;
5459
5528
  const message = graftTeklaReadErrorMessage(error);
@@ -5480,6 +5549,29 @@
5480
5549
  }
5481
5550
  }
5482
5551
 
5552
+ async function continueGraftReadInChat(proof) {
5553
+ const receipt = {
5554
+ sourcePath: proof.sourcePath, hostVersion: proof.hostVersion, modelName: proof.modelName,
5555
+ hostPid: proof.hostPid, verifiedAt: proof.verifiedAt, operation: proof.operation,
5556
+ };
5557
+ if (graftState.verifyInFlight || graftState.commitInFlight) return;
5558
+ if (typeof window.flolessChat?.openVerifiedTeklaDraft !== 'function') {
5559
+ showToast('AI Chat is not available right now. Reload FloLess, then verify the model read again.', 'warn');
5560
+ return;
5561
+ }
5562
+ // Close Graft only once Chat holds the draft: a failure keeps the receipt on screen to retry.
5563
+ try {
5564
+ await window.flolessChat.openVerifiedTeklaDraft(receipt);
5565
+ } catch (e) {
5566
+ console.warn('Continue in AI Chat failed', e);
5567
+ showToast(e?.plainEnglish && e.message
5568
+ ? e.message
5569
+ : 'FloLess could not open AI Chat. Open a project or workflow, then verify the model read again.', 'warn');
5570
+ return;
5571
+ }
5572
+ closeGraftModal();
5573
+ }
5574
+
5483
5575
  async function runGraftCommit(force) {
5484
5576
  if (!graftState.stagedRef || graftState.verifyInFlight || graftState.commitInFlight) return;
5485
5577
  const state = graftState;
@@ -5497,6 +5589,11 @@
5497
5589
  verifyButton.disabled = true;
5498
5590
  verifyButton.setAttribute('data-blocked-reason', 'Agent creation is in progress. Wait for it to finish.');
5499
5591
  }
5592
+ const continueButton = document.getElementById('graft-continue-chat');
5593
+ if (continueButton) {
5594
+ continueButton.disabled = true;
5595
+ continueButton.setAttribute('data-blocked-reason', 'Agent creation is in progress. Wait for it to finish.');
5596
+ }
5500
5597
  try {
5501
5598
  const body = { stagedRef: graftState.stagedRef };
5502
5599
  if (force) body.force = true;
@@ -5529,6 +5626,10 @@
5529
5626
  } finally {
5530
5627
  state.commitInFlight = false;
5531
5628
  for (const control of [$graftPrimary, $graftBack, $graftCancel]) control.removeAttribute('data-blocked-reason');
5629
+ if (continueButton?.isConnected) {
5630
+ continueButton.disabled = false;
5631
+ continueButton.removeAttribute('data-blocked-reason');
5632
+ }
5532
5633
  if (verifyButton?.isConnected) {
5533
5634
  verifyButton.disabled = false;
5534
5635
  verifyButton.removeAttribute('data-blocked-reason');
@@ -8672,6 +8773,52 @@
8672
8773
  // response must not turn an arbitrary terminal state into an implied "resume" instruction.
8673
8774
  const RESUMABLE_RUN_STATES = new Set(['needs-you', 'stopped', 'interrupted', 'contract-violation', 'exited-unresolved']);
8674
8775
 
8776
+ /**
8777
+ * A Drawing Filter answer's proposal when it passes the same strict shape AI Chat uses; null when it
8778
+ * cannot be shown. Requests has no current filter or allowed-control snapshot, so it cannot claim a
8779
+ * proposal still applies: it only mirrors the structural boundary and shows it for reference.
8780
+ */
8781
+ function filterGuideProposal(answer) {
8782
+ if (typeof answer !== 'string' || answer.length > 8_000) return null;
8783
+ let suggestion;
8784
+ try { suggestion = JSON.parse(answer); } catch { return null; }
8785
+ if (!suggestion || typeof suggestion !== 'object' || Array.isArray(suggestion)
8786
+ || Object.keys(suggestion).sort().join(',') !== 'changes,explanation,mode'
8787
+ || typeof suggestion.explanation !== 'string' || !suggestion.explanation.trim() || suggestion.explanation.length > 500
8788
+ || !Array.isArray(suggestion.changes) || suggestion.changes.length > 30
8789
+ || (suggestion.mode !== null && (typeof suggestion.mode !== 'string' || !suggestion.mode
8790
+ || suggestion.mode !== ['thickness', 'layer', 'color'].filter(dim => suggestion.mode.split('+').includes(dim)).join('+')))) return null;
8791
+ const seen = new Set();
8792
+ for (const item of suggestion.changes) {
8793
+ if (!item || typeof item !== 'object' || Array.isArray(item)
8794
+ || Object.keys(item).sort().join(',') !== 'dimension,on,value'
8795
+ || !['layer', 'thickness', 'color'].includes(item.dimension) || typeof item.on !== 'boolean'
8796
+ || (item.dimension === 'thickness' ? typeof item.value !== 'number' || !Number.isFinite(item.value)
8797
+ : typeof item.value !== 'string')) return null;
8798
+ // Match the filter core's facetKey identity: case-sensitive layers, two-decimal line
8799
+ // weights, and case-insensitive colours. A generic lowercase key mislabels both cases.
8800
+ const canonical = item.dimension === 'thickness' ? Number(item.value.toFixed(2))
8801
+ : item.dimension === 'color' ? item.value.toLowerCase() : item.value;
8802
+ const identity = `${item.dimension}\0${String(canonical)}`;
8803
+ if (seen.has(identity)) return null;
8804
+ seen.add(identity);
8805
+ }
8806
+ return suggestion;
8807
+ }
8808
+
8809
+ // Question and change share one path, so only a proposal with ticks or a match mode is a suggestion.
8810
+ function filterGuideSuggestionHtml(answer) {
8811
+ const suggestion = filterGuideProposal(answer);
8812
+ if (!suggestion) return `<div class="req-run-answer">AI's answer could not be shown. Nothing was applied or saved. Open the Drawing Filter and ask again in AI Chat.</div>`;
8813
+ const rows = suggestion.changes.map((item) => {
8814
+ const value = item.dimension === 'thickness' ? `line weight ${item.value} pt` : `${item.dimension} ${item.value}`;
8815
+ return `<li>${escapeHtml(`${item.on ? 'Include' : 'Exclude'} ${value}`)}</li>`;
8816
+ });
8817
+ if (suggestion.mode) rows.push(`<li>${escapeHtml(`Match on ${suggestion.mode.replaceAll('+', ', ')}`)}</li>`);
8818
+ if (!rows.length) return `<div class="req-run-answer"><p>${escapeHtml(suggestion.explanation)}</p></div>`;
8819
+ return `<div class="req-run-answer"><p>${escapeHtml(suggestion.explanation)}</p><ul>${rows.join('')}</ul><p>For reference only. To apply a suggestion, open the Drawing Filter and ask again in AI Chat; nothing was saved.</p></div>`;
8820
+ }
8821
+
8675
8822
  async function copyResumeCommand(command, stillOwned = () => true) {
8676
8823
  if (!command) return 'empty';
8677
8824
  if (!stillOwned()) return 'stale';
@@ -8680,14 +8827,14 @@
8680
8827
  return copied ? 'ok' : 'denied';
8681
8828
  }
8682
8829
 
8683
- function runStatusHtml(run, stampedResumeCommand, desktopHandoffs, requestId, commandInstance, ownRecoverySurface) {
8830
+ function runStatusHtml(run, stampedResumeCommand, desktopHandoffs, requestId, commandInstance, ownRecoverySurface, filterGuide = null) {
8684
8831
  if (!run || !run.state) return '';
8685
8832
  const v = RUN_VIEW[run.state] || { badge: String(run.state), cls: 'muted', note: () => '' };
8686
8833
  const rt = runtimeLabel(run.runtime);
8687
8834
  // `resumeCommand` belongs to the SERVER'S request view, not persisted `run` metadata: the
8688
8835
  // store deliberately carries only runtime/session identity, while terminal-runtime.ts owns argv.
8689
- const resumeCommand = RESUMABLE_RUN_STATES.has(run.state) ? stampedResumeCommand : null;
8690
- const handoffs = desktopHandoffs && RESUMABLE_RUN_STATES.has(run.state) ? desktopHandoffs : null;
8836
+ const resumeCommand = !filterGuide && RESUMABLE_RUN_STATES.has(run.state) ? stampedResumeCommand : null;
8837
+ const handoffs = !filterGuide && desktopHandoffs && RESUMABLE_RUN_STATES.has(run.state) ? desktopHandoffs : null;
8691
8838
  const claim = handoffs && handoffs.claim;
8692
8839
  const providers = handoffs && handoffs.preferredProvider === 'claude' ? ['claude', 'codex'] : ['codex', 'claude'];
8693
8840
  const availableProviders = handoffs ? providers.filter((provider) => handoffs[provider].available) : [];
@@ -8726,7 +8873,18 @@
8726
8873
  // read is waiting on Save in Drawing Filter, not on an answer to a stopped session. So those rows
8727
8874
  // keep the note master gives them. The refusal below keeps its own separate test: having a next
8728
8875
  // action is why the generic "can't be continued" is withheld there, not a reason to state it.
8729
- const note = v.note(rt, !noRecovery || !!ownRecoverySurface);
8876
+ // An unreadable answer claims nothing is available: its body below already says it could not be shown.
8877
+ const proposal = filterGuide === 'change' && run.state === 'answered' ? filterGuideProposal(run.answer) : null;
8878
+ // A waiting Drawing Filter row already says its answer is being prepared and where it will appear
8879
+ // (filterGuideRequestNote); the generic running note beside it would say the same thing twice.
8880
+ const filterWaiting = filterGuide && ['queued', 'running', 'starting'].includes(run.state);
8881
+ const note = filterGuide && run.state === 'answered'
8882
+ ? (filterGuide !== 'change' ? 'AI answer available here for reference. No selection was changed by this question.'
8883
+ : !proposal ? ''
8884
+ : proposal.changes.length || proposal.mode ? 'AI suggestion available here for reference. Nothing was applied or saved.'
8885
+ : 'AI answer available here for reference. Nothing was applied or saved.')
8886
+ : filterWaiting ? ''
8887
+ : v.note(rt, !noRecovery || !!ownRecoverySurface);
8730
8888
  // The refusal answers "why is there no button", so it is owed whenever the recovery is missing —
8731
8889
  // never conditioned on the folder, which is the one part of this row that may legitimately be
8732
8890
  // absent. A run with neither would otherwise show the same dead end with even less to read.
@@ -8748,7 +8906,8 @@
8748
8906
  <span class="req-run-badge req-run-badge-${v.cls}">${escapeHtml(v.badge)}</span>
8749
8907
  </div>
8750
8908
  ${note ? `<p class="req-run-note">${escapeHtml(note)}</p>` : ''}
8751
- ${run.state === 'answered' && typeof run.answer === 'string' ? `<div class="req-run-answer">${escapeHtml(run.answer)}</div>` : ''}
8909
+ ${run.state === 'answered' && typeof run.answer === 'string' && filterGuide === 'change' ? filterGuideSuggestionHtml(run.answer) : ''}
8910
+ ${run.state === 'answered' && typeof run.answer === 'string' && filterGuide !== 'change' ? `<div class="req-run-answer">${escapeHtml(run.answer)}</div>` : ''}
8752
8911
  ${run.question ? `<p class="req-run-question">${escapeHtml(run.question)}</p>` : ''}
8753
8912
  ${desktop}
8754
8913
  ${terminalFallback}
@@ -8929,6 +9088,9 @@
8929
9088
  showModal($m);
8930
9089
  const shell = $m.querySelector('.modal.request-help');
8931
9090
  if (shell) { try { shell.focus(); } catch { /* not focusable */ } }
9091
+ // Only a read that begins after this point may move the handoff (see loadRequests), and the
9092
+ // caller's own refreshes began before it — so ask for one, or the handoff could keep a stale Start.
9093
+ void loadRequests();
8932
9094
  // Detection is a fetch, and this modal is opened synchronously by the caller. Reveal the split
8933
9095
  // when the answer lands rather than blocking the modal on it — and only if THIS request is
8934
9096
  // still the one on screen, since a second queue can land while the first fetch is in flight.
@@ -8976,7 +9138,7 @@
8976
9138
  : canStartUpdatedRead
8977
9139
  ? '<div class="request-help-step"><span>1</span><p>Choose Start automatically below. FloLess will run the Drawing Filter preparation with your terminal AI.</p></div>'
8978
9140
  + '<div class="request-help-step"><span>2</span><p>Keep FloLess open. You can do other work while the updated drawing is prepared.</p></div>'
8979
- + '<div class="request-help-step"><span>3</span><p>When it stops, open Drawing Filter, review the selected lines, then press Save filter in the top-right corner. After Save, return to the same terminal AI and tell it to continue the drawing read.</p></div>'
9141
+ + '<div class="request-help-step"><span>3</span><p>When it stops, open Drawing Filter. Check steel, member marks, grids, dimensions, and relevant callouts; ask in AI Chat on the left if you are unsure. Then press Save filter in the top-right corner. After Save, return to the same terminal AI and tell it to continue the drawing read.</p></div>'
8980
9142
  : isRevisionRead && !isPendingRevisionRead
8981
9143
  ? req.status === 'staged'
8982
9144
  ? '<div class="request-help-step"><span>1</span><p>This drawing read is complete. Open Requests and choose Review changes.</p></div>'
@@ -8988,7 +9150,7 @@
8988
9150
  : isRevisionRead
8989
9151
  ? '<div class="request-help-step"><span>1</span><p>Open Claude Code, Codex, or OpenCode in your project folder.</p></div>'
8990
9152
  + `<div class="request-help-step"><span>2</span><p>Paste the copied request. It will read the ${allPdf ? 'PDF' : 'drawing file'} and prepare the Drawing Filter.</p></div>`
8991
- + '<div class="request-help-step"><span>3</span><p>When it stops, open Drawing Filter, review the selected lines, then press Save filter in the top-right corner. After Save, return to the same terminal AI and tell it to continue the drawing read.</p></div>'
9153
+ + '<div class="request-help-step"><span>3</span><p>When it stops, open Drawing Filter. Check steel, member marks, grids, dimensions, and relevant callouts; ask in AI Chat on the left if you are unsure. Then press Save filter in the top-right corner. After Save, return to the same terminal AI and tell it to continue the drawing read.</p></div>'
8992
9154
  : '<div class="request-help-step"><span>1</span><p>Open Claude Code, Codex, or OpenCode in your project folder.</p></div>'
8993
9155
  + '<div class="request-help-step"><span>2</span><p>Paste the copied request and let your terminal AI apply it.</p></div>'
8994
9156
  + '<div class="request-help-step"><span>3</span><p>Return here to check the result in FloLess.</p></div>';
@@ -9159,13 +9321,27 @@
9159
9321
  // has not been delivered — cleared only once it has actually flashed on a visible list, or once the
9160
9322
  // request it names is gone.
9161
9323
  let pendingRevealId = null;
9162
- let requestFetchEpoch = 0;
9324
+ // One read in flight and at most one queued behind it. Every call made during a read joins the
9325
+ // queued one, which starts only after that read is applied, so it sees whatever changed since and
9326
+ // responses land in order. Keeping only the newest response instead starved the open list and the
9327
+ // header count whenever calls (SSE, ~25 call sites) arrived faster than a read returned.
9328
+ let requestLoadInFlight = null;
9329
+ let requestLoadQueued = null;
9163
9330
  let publishedAnswerChatIds = null;
9164
9331
  async function loadRequests() {
9332
+ if (requestLoadInFlight) {
9333
+ requestLoadQueued ||= requestLoadInFlight.then(() => { requestLoadQueued = null; return loadRequests(); });
9334
+ return requestLoadQueued;
9335
+ }
9336
+ let settled;
9337
+ requestLoadInFlight = new Promise((resolve) => { settled = resolve; });
9338
+ // Every response is applied now, including one that began before the upload handoff opened. Such a
9339
+ // read predates the request, so its absence proves nothing about it — only a later read may move it.
9340
+ const helpEpochAtStart = requestHelpEpoch;
9165
9341
  try {
9166
- const epoch = ++requestFetchEpoch;
9167
- const { requests, chatPublications = [] } = await api('/api/requests');
9168
- if (epoch !== requestFetchEpoch) return;
9342
+ // Bounded: every later read waits behind this one, so a response that never arrives must not
9343
+ // freeze the list for good. The route's own lock waits give up after 60 s.
9344
+ const { requests, chatPublications = [] } = await api('/api/requests', { signal: AbortSignal.timeout(90_000) });
9169
9345
  reconcileActiveInstructorRuns(requests, chatPublications);
9170
9346
  pendingRequests = requests;
9171
9347
  const nextPublishedChatIds = new Set(chatPublications.map((publication) => publication?.chatId).filter(Boolean));
@@ -9183,7 +9359,7 @@
9183
9359
  // staged, failed, or disappears. Move to the live row, which already renders every lifecycle state.
9184
9360
  const help = requestHelpReq;
9185
9361
  const helpModal = document.getElementById('request-help-modal');
9186
- if (help && helpModal && helpModal.classList.contains('show')) {
9362
+ if (help && helpModal && helpModal.classList.contains('show') && requestHelpEpoch === helpEpochAtStart) {
9187
9363
  const fresh = requests.find((request) => request && request.id === help.id) || null;
9188
9364
  if (!fresh || requestHelpStateKey(fresh) !== requestHelpStateKey(help)) {
9189
9365
  const returnFocus = requestHelpReturnFocus;
@@ -9225,7 +9401,10 @@
9225
9401
  previousRequestIds = ids;
9226
9402
  const $rm = document.getElementById('requests-modal');
9227
9403
  if ($rm && $rm.classList.contains('show')) renderRequests(); // keep an open list live
9228
- } catch { /* non-fatal */ }
9404
+ } catch { /* non-fatal */ } finally {
9405
+ requestLoadInFlight = null;
9406
+ settled();
9407
+ }
9229
9408
  }
9230
9409
 
9231
9410
  // What the Requests window is scoped to right now: the open Workspaces project, else the open
@@ -9317,6 +9496,9 @@
9317
9496
  }
9318
9497
 
9319
9498
  function requestLabel(r) {
9499
+ if (isFilterAiGuideRequest(r))
9500
+ // One path for a question and a change, so a waiting message is never labelled a suggestion.
9501
+ return r.instructorContext.commandId === 'filter.ask-ai-change' ? 'filter answer' : 'filter question';
9320
9502
  if (r.type === 'revision-read') return (!r.baseVersion || r.baseVersion <= 0) ? 'initial drawing read' : 'updated drawing read';
9321
9503
  return r.type === 'use-template' ? 'template' : r.type === 'ui-customize' ? 'dashboard' : r.type === 'rebake' ? 're-bake' : r.type === 'guide' ? 'guide' : r.type === 'new-workflow' ? 'new workflow' : r.type === 'knowledge-organize' ? 'organize' : r.type === 'knowledge-adjust' ? 'adjust' : r.type === 'knowledge-consult' ? 'knowledge' : r.type === 'tweak-contract' ? 'contract' : 'tweak';
9322
9504
  }
@@ -9342,10 +9524,17 @@
9342
9524
  && (r.status !== 'pending' || revisionReadHasTerminalOwner(r) || requestHasActiveRun(r));
9343
9525
  }
9344
9526
 
9345
- // Once the terminal AI has prepared the Drawing Filter, copying or automatically starting the
9346
- // original request would launch a second reader against the same project. The existing terminal
9347
- // session owns the continuation; Requests must point the user back to that checkpoint instead.
9527
+ // Filter AI requests are reference-only in Requests. A copied instruction cannot restore a
9528
+ // proposal's current-sheet and current-selection checks in the Drawing Filter.
9529
+ function isFilterAiGuideRequest(r) {
9530
+ return r?.type === 'guide' && r.instructorContext?.surface === 'steel-filter'
9531
+ && ['filter.ask-ai-question', 'filter.ask-ai-change'].includes(r.instructorContext.commandId);
9532
+ }
9533
+
9348
9534
  function requestCanCopy(r) {
9535
+ // The Drawing Filter's read-only AI protocol (sent from AI Chat) must never turn into a terminal copy/retry path,
9536
+ // even when an older Requests response still carries canCopy: true.
9537
+ if (isFilterAiGuideRequest(r)) return false;
9349
9538
  // Current servers own this lifecycle decision together with automatic Retry and the manifest
9350
9539
  // route. The fallback is only for an older server response already cached in this tab.
9351
9540
  if (typeof r?.canCopy === 'boolean') return r.canCopy;
@@ -9465,6 +9654,15 @@
9465
9654
  }
9466
9655
 
9467
9656
  /** The sentence a steel detailer needs first; the exact API handoff stays available below it. */
9657
+ function savedDrawingFilterNextStep(r) {
9658
+ const continuation = r?.filterSaveContinuation;
9659
+ if (continuation?.state === 'queued') return 'FloLess will continue the drawing read in the linked AI Chat when that conversation is ready.';
9660
+ if (continuation?.state === 'continuing') return 'FloLess sent the saved filter to the linked AI Chat. Follow that conversation for the drawing read.';
9661
+ if (continuation?.state === 'completed') return 'The linked AI Chat finished its response. Review its result in that conversation.';
9662
+ if (continuation?.nextAction) return continuation.nextAction;
9663
+ return 'Return to the same terminal AI session that prepared it and tell it to continue the drawing read.';
9664
+ }
9665
+
9468
9666
  function requestSummary(r) {
9469
9667
  if (!r || r.type !== 'revision-read') return '';
9470
9668
  if (r.preparationState === 'blocked') {
@@ -9473,10 +9671,13 @@
9473
9671
  if (r.preparationState === 'manifest-published' && !r.prepassReady) {
9474
9672
  return 'Drawing preparation is complete and the prepared data is saved. Return to the same terminal AI session and tell it to continue creating the Drawing Filter. Do not start or copy this request again.';
9475
9673
  }
9674
+ if (r.status === 'pending' && r.filterSaveContinuation?.state === 'recovery-needed') {
9675
+ return `Drawing Filter needs attention. ${savedDrawingFilterNextStep(r)}`;
9676
+ }
9476
9677
  if (r.status === 'pending' && r.prepassReady) {
9477
9678
  return r.filterCheckpointCurrent
9478
- ? 'Drawing Filter saved. Return to the same terminal AI session that prepared it and tell it to continue the drawing read.'
9479
- : 'Drawing Filter ready. Review the selected lines, then press Save filter in the top-right corner.';
9679
+ ? `Drawing Filter saved. ${savedDrawingFilterNextStep(r)}`
9680
+ : 'Drawing Filter ready. Check steel, member marks, grids, dimensions, and relevant callouts, then press Save filter in the top-right corner.';
9480
9681
  }
9481
9682
  if (r.preparationRetryable) {
9482
9683
  const active = r.run && (r.run.state === 'queued' || r.run.state === 'running');
@@ -9510,7 +9711,7 @@
9510
9711
  return 'This drawing read uses a status this version of FloLess does not recognize. Update FloLess, then open Requests again. If it still appears, clear it and attach the drawing set again.';
9511
9712
  }
9512
9713
  if (r.filterCheckpointCurrent) {
9513
- return 'Drawing Filter saved. Return to the same terminal AI session that prepared it and tell it to continue the drawing read.';
9714
+ return `Drawing Filter saved. ${savedDrawingFilterNextStep(r)}`;
9514
9715
  }
9515
9716
  return (!r.baseVersion || r.baseVersion <= 0)
9516
9717
  ? 'Read the attached drawing and create the first steel model for this project.'
@@ -9641,11 +9842,16 @@
9641
9842
  if (r.preparationState === 'manifest-published' && !r.prepassReady) {
9642
9843
  return 'Drawing preparation is complete and saved. Return to the same terminal AI session and tell it to continue creating the Drawing Filter. Do not start or copy this request again.';
9643
9844
  }
9845
+ if (r.filterSaveContinuation?.state === 'recovery-needed') {
9846
+ return `Next step: ${savedDrawingFilterNextStep(r)} Do not start the request again.`;
9847
+ }
9644
9848
  if (r.filterCheckpointCurrent) {
9645
- return 'Next step: return to the same terminal AI session that prepared this Drawing Filter and tell it to continue the drawing read. Do not start the request again.';
9849
+ return `Next step: ${savedDrawingFilterNextStep(r)} Do not start the request again.`;
9646
9850
  }
9647
9851
  if (r.prepassReady) {
9648
- return 'Next step: return to Drawing Filter, review the selected lines, then press Save filter in the top-right corner. After Save, return to the terminal AI that prepared it and tell it to continue. Do not start the drawing read again.';
9852
+ return r.chatConversation?.executionOwner === 'chat'
9853
+ ? 'Next step: return to Drawing Filter, check steel, member marks, grids, dimensions, and relevant callouts, then press Save filter in the top-right corner. FloLess will continue the drawing read in this linked AI Chat. Do not start it again.'
9854
+ : 'Next step: return to Drawing Filter, check steel, member marks, grids, dimensions, and relevant callouts, then press Save filter in the top-right corner. After Save, return to the terminal AI that prepared it and tell it to continue. Do not start the drawing read again.';
9649
9855
  }
9650
9856
  if (r.preparationRetryable) {
9651
9857
  const active = r.run && (r.run.state === 'queued' || r.run.state === 'running');
@@ -9658,7 +9864,7 @@
9658
9864
  const start = r.canRun && headlessReady()
9659
9865
  ? 'copy this request into Claude Code, Codex, or OpenCode, or press Start'
9660
9866
  : 'copy this request into Claude Code, Codex, or OpenCode';
9661
- return `Next step: ${start}. When the Drawing Filter is ready, review the selected lines and press Save filter in the top-right corner.`;
9867
+ return `Next step: ${start}. When the Drawing Filter is ready, check steel, member marks, grids, dimensions, and relevant callouts, then press Save filter in the top-right corner.`;
9662
9868
  }
9663
9869
 
9664
9870
  /** Prefer an active checkpoint, then an initial read, while skipping terminal rows in either group. */
@@ -9743,6 +9949,21 @@
9743
9949
  return { atomic: !filterActive && !keep.length && painted.length === all.length, keep, drop };
9744
9950
  }
9745
9951
 
9952
+ function filterGuideRequestNote(request) {
9953
+ if (request.filterAiAdmissionUnconfirmed) {
9954
+ return 'FloLess could not confirm whether AI started. A late answer may appear here or in AI Chat. If none appears, clear this request and ask again in AI Chat while the Drawing Filter is open.';
9955
+ }
9956
+ // Every Drawing Filter message takes one path, question or change alike, so the row never calls it
9957
+ // a suggestion: a plain question gets an answer with no card.
9958
+ if (request.status === 'pending' && request.run && ['queued', 'running', 'starting'].includes(request.run.state)) {
9959
+ return 'This answer is being prepared. It will appear in AI Chat.';
9960
+ }
9961
+ if (request.status === 'pending' && !request.run) {
9962
+ return 'FloLess is checking whether AI started. If an answer arrives, it will appear in AI Chat.';
9963
+ }
9964
+ return 'For reference only. It cannot be applied here; ask again in AI Chat while the Drawing Filter is open.';
9965
+ }
9966
+
9746
9967
  // The Requests window: every queued change in a list, with only the actions the server says are
9747
9968
  // currently safe, plus bulk actions over the available rows. The server-composed prompt (which embeds file-derived
9748
9969
  // appId/nodeId/instruction) is rendered via textContent-equivalent escaping — which matters MORE
@@ -9906,13 +10127,14 @@
9906
10127
  // `canRun` is server-owned policy, but persisted request JSON can outlive or be newer than this
9907
10128
  // client. A revision lifecycle this build cannot name must never gain Start through a stale or
9908
10129
  // malformed response; only the exact queued state is safe to launch.
10130
+ const filterGuide = isFilterAiGuideRequest(r);
9909
10131
  const chatExecutionOwner = r.chatConversation?.executionOwner || null;
9910
10132
  const canRunNow = headlessReady() && r.canRun && (!chatExecutionOwner || chatExecutionOwner === 'discussion')
9911
10133
  && (r.type !== 'revision-read' || r.status === 'pending')
9912
10134
  && !revisionReadHasTerminalOwner(r) && !inFlight && !desktopHandoffs && !resumeCommand;
9913
10135
  const runBtn = inFlight
9914
10136
  ? `<button class="req-stop" data-id="${escapeAttr(r.id)}" data-command-id="shell.requests-stop#${escapeAttr(r.id)}" data-command-instance-label="${escapeAttr(commandInstance)}" data-tip="Stop this run" aria-label="Stop this run">■</button>`
9915
- : canRunNow
10137
+ : canRunNow && !filterGuide
9916
10138
  ? r.preparationRetryable
9917
10139
  ? `<button class="req-run" data-id="${escapeAttr(r.id)}" data-command-id="shell.requests-retry#${escapeAttr(r.id)}" data-command-instance-label="${escapeAttr(commandInstance)}" aria-label="Retry preparation" data-tip="Retry Steel Filter preparation with the attached drawings">▶</button>`
9918
10140
  : `<button class="req-run" data-id="${escapeAttr(r.id)}" data-command-id="shell.requests-run#${escapeAttr(r.id)}" data-command-instance-label="${escapeAttr(commandInstance)}" aria-label="Start this request in the background" data-tip="Start this request in the background with your terminal AI">▶</button>`
@@ -9925,7 +10147,7 @@
9925
10147
  const discussBtn = chatProvider && inChatScope
9926
10148
  ? `<button class="req-chat-action" data-request-chat="discuss" data-id="${escapeAttr(r.id)}" data-command-id="shell.requests-discuss#${escapeAttr(r.id)}" data-command-instance-label="${escapeAttr(commandInstance)}" aria-label="${hasLinkedChat ? 'Open' : 'Discuss'} ${escapeAttr(chatLabel)} in AI Chat" data-tip="${hasLinkedChat ? 'Open the linked conversation in AI Chat' : 'Open this request in AI Chat without starting the AI'}">${hasLinkedChat ? 'Open AI Chat' : 'Discuss in AI Chat'}</button>`
9927
10149
  : '';
9928
- const startChatBtn = chatProvider && inChatScope && canRunNow
10150
+ const startChatBtn = chatProvider && inChatScope && canRunNow && !filterGuide
9929
10151
  ? `<button class="req-chat-action primary" data-request-chat="start" data-id="${escapeAttr(r.id)}" data-command-id="shell.requests-start-chat#${escapeAttr(r.id)}" data-command-instance-label="${escapeAttr(commandInstance)}" aria-label="Start ${escapeAttr(chatLabel)} in AI Chat" data-tip="Start this request in AI Chat and continue there">Start in AI Chat</button>`
9930
10152
  : '';
9931
10153
  const chatMeta = chatProvider && inChatScope
@@ -9939,9 +10161,13 @@
9939
10161
  <div class="req-head"><span class="${badgeCls}">${label}</span> ${owner ? `<span class="req-owner">${highlightQuery(owner, normalizedRequestQuery)}</span>` : ''}${time}</div>
9940
10162
  ${r.type === 'revision-read'
9941
10163
  ? `<div class="req-instruction req-summary">${highlightQuery(requestSummary(r), normalizedRequestQuery)}</div><details class="req-technical"${normalizedRequestQuery && `${instructionFor(r)} ${r.preparationDiagnostic || ''}`.toLowerCase().includes(normalizedRequestQuery.toLowerCase()) ? ' open' : ''}><summary data-command-id="shell.requests-technical#${escapeAttr(r.id)}" data-command-instance-label="${escapeAttr(commandInstance)}">Show detailed instructions</summary><div class="req-technical-body">${highlightQuery(`${instructionFor(r)}${r.preparationDiagnostic ? `\n\n${r.preparationDiagnostic}` : ''}`, normalizedRequestQuery)}</div></details>`
10164
+ : filterGuide
10165
+ ? `<div class="req-instruction req-summary">${highlightQuery(r.instructorContext.subject || 'Drawing Filter AI request', normalizedRequestQuery)}</div><p class="req-run-note">${escapeHtml(filterGuideRequestNote(r))}</p><details class="req-technical"><summary data-command-id="shell.requests-technical#${escapeAttr(r.id)}" data-command-instance-label="${escapeAttr(commandInstance)}">Show detailed instructions</summary><div class="req-technical-body">${highlightQuery(instructionFor(r), normalizedRequestQuery)}</div></details>`
9942
10166
  : `<div class="req-instruction">${highlightQuery(instructionFor(r), normalizedRequestQuery) || 'This request has no instructions to send. Remove it and create the request again.'}</div>`}
9943
10167
  ${r.snapshots && r.snapshots.length ? `<div class="req-thumbs">${r.snapshots.map((sp, i) => { const pdf = /\.pdf$/i.test(String(sp)); return `<button type="button" class="req-thumb" data-id="${escapeAttr(r.id)}" data-n="${i}" aria-label="View ${pdf ? 'PDF' : 'screenshot'} ${i + 1}">${pdf ? '<span class="req-thumb-pdf">PDF</span>' : `<img src="/api/requests/${encodeURIComponent(r.id)}/snapshot/${i}" alt="">`}</button>`; }).join('')}</div>` : ''}
9944
- ${runStatusHtml(run, resumeCommand, desktopHandoffs, r.id, commandInstance, ownRecoverySurface)}
10168
+ ${runStatusHtml(run, resumeCommand, desktopHandoffs, r.id, commandInstance, ownRecoverySurface,
10169
+ filterGuide
10170
+ ? (r.instructorContext.commandId === 'filter.ask-ai-change' ? 'change' : 'question') : null)}
9945
10171
  ${r.status === 'pending' && !revisionReadHasTerminalOwner(r) && !r.canRun && r.runWhy && (anyRunnable || r.type === 'revision-read') ? `<div class="req-why-not">Why there is no automatic start: ${escapeHtml(r.runWhy)}</div>` : ''}
9946
10172
  ${auditRefusalHtml(r)}
9947
10173
  </div>
@@ -11045,6 +11271,31 @@
11045
11271
  }).join('')}</div>`;
11046
11272
  }
11047
11273
 
11274
+ // An OAuth row's endpoint list stays on one clipped line (reference detail, not something the
11275
+ // person must read to act), but a clipped line must never be a dead end (#1524): when it
11276
+ // actually overflows it carries the full text as a themed data-tip and becomes focusable, so
11277
+ // hover AND keyboard reach the rest. A line that fits gets neither — no redundant tip, no
11278
+ // extra tab stop. It measures live layout, so its callers run it only while the modal is shown.
11279
+ function offerClippedScopeLines(root) {
11280
+ root.querySelectorAll('.int-scopes:not(.int-setup-detail)').forEach((line) => {
11281
+ if (line.scrollWidth > line.clientWidth) {
11282
+ line.setAttribute('data-tip', line.textContent);
11283
+ line.setAttribute('tabindex', '0');
11284
+ } else {
11285
+ line.removeAttribute('data-tip');
11286
+ line.removeAttribute('tabindex');
11287
+ }
11288
+ });
11289
+ }
11290
+ // A line's clip changes with the list's width (a narrower window squeezes the modal), not only
11291
+ // on render, so re-measure when the list resizes. The list lives for the whole page, so this
11292
+ // observer does too; a hidden modal measures as zero width and is skipped — opening it re-renders.
11293
+ if (typeof ResizeObserver === 'function') {
11294
+ new ResizeObserver(() => {
11295
+ if ($integrationsModal.classList.contains('show')) offerClippedScopeLines($integrationsList);
11296
+ }).observe($integrationsList);
11297
+ }
11298
+
11048
11299
  renderIntegrations = function renderIntegrationsReal() {
11049
11300
  if (integrationsLoadState === 'loading' || integrationsLoadState === 'idle') {
11050
11301
  $integrationsList.innerHTML = '<div class="empty-state">Checking integrations…</div>';
@@ -11088,16 +11339,19 @@
11088
11339
  : 'Revit model access is not included for this account. Ask the account owner to add it.';
11089
11340
  const checkLabel = needsAttention ? 'Try setup again' : needsAccount ? 'Choose account'
11090
11341
  : ready ? 'Check status' : 'Check access again';
11091
- return `<div class="int-item int-${escapeAttr(i.status)}" data-integration-id="xeorvt" tabindex="-1"${missingReader ? ' aria-describedby="xeorvt-setup-detail"' : ''}>
11342
+ // The Revit detail is always a sentence the person must finish reading (#1524), so it
11343
+ // always wraps (int-setup-detail) and always describes the card — never the one-line clip
11344
+ // the OAuth rows' endpoint list uses.
11345
+ return `<div class="int-item int-${escapeAttr(i.status)}" data-integration-id="xeorvt" tabindex="-1" aria-describedby="xeorvt-setup-detail">
11092
11346
  <div class="int-icon">R</div><div class="int-info">
11093
11347
  <div class="int-name">${escapeHtml(i.name)}</div>
11094
11348
  <div class="int-kind">Revit project integration · provided by FloLess</div>
11095
- <div class="int-scopes${missingReader ? ' int-setup-detail' : ''}"${missingReader ? ' id="xeorvt-setup-detail"' : ''}>${escapeHtml(detail)}</div>
11349
+ <div class="int-scopes int-setup-detail" id="xeorvt-setup-detail">${escapeHtml(detail)}</div>
11096
11350
  <div class="int-row"><span class="int-badge int-badge-${ready ? 'connected' : needsAttention ? 'expired' : 'disconnected'}">${badge}</span>
11097
11351
  <span class="int-recovery-actions">
11098
11352
  ${ready ? '<button class="int-action" data-xeorvt-action="open">Open Revit projects</button>' : ''}
11099
11353
  ${missingReader ? '<button class="int-action" data-xeorvt-action="report" data-command-id="shell.revit-report-setup-issue" aria-label="Report issue: missing Revit reader" aria-describedby="xeorvt-setup-detail">Report issue</button>' : ''}
11100
- <button class="int-action" data-xeorvt-action="${needsAccount ? 'account' : 'check'}" data-xeorvt-retry="${needsAttention ? 'true' : 'false'}">${checkLabel}</button>
11354
+ <button class="int-action" data-xeorvt-action="${needsAccount ? 'account' : 'check'}" data-xeorvt-retry="${needsAttention ? 'true' : 'false'}"${needsAttention ? ' aria-describedby="xeorvt-setup-detail"' : ''}>${checkLabel}</button>
11101
11355
  </span></div></div></div>`;
11102
11356
  }
11103
11357
  const action = i.status === 'connected' ? 'Disconnect' : i.status === 'expired' ? 'Reconnect' : 'Connect';
@@ -11124,6 +11378,7 @@
11124
11378
  </div>
11125
11379
  </div>`;
11126
11380
  }).join('');
11381
+ offerClippedScopeLines($integrationsList);
11127
11382
  $integrationsList.querySelectorAll('[data-xeorvt-action]').forEach((btn) => {
11128
11383
  btn.onclick = async () => {
11129
11384
  if (btn.dataset.xeorvtAction === 'open') {
@@ -12831,6 +13086,10 @@
12831
13086
 
12832
13087
  window.flolessBridge = {
12833
13088
  api,
13089
+ requestScopeLabel(projectId) {
13090
+ return wsRequestScope?.kind === 'project' && wsRequestScope.project === projectId
13091
+ ? wsRequestScope.label : null;
13092
+ },
12834
13093
  // Open report HTML in the existing sandboxed HTML Viewer (same modal + srcdoc
12835
13094
  // iframe the canvas report node uses — no new sandbox surface). `savedPath` is
12836
13095
  // optional: pass the run's saved_path so a dashboard-panel run surfaces the same