@floless/app 0.159.0 → 0.160.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.
@@ -2113,6 +2113,7 @@
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
+ 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.' });
2116
2117
  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.' });
2117
2118
 
2118
2119
  /* Ask AI */
package/dist/web/guide.js CHANGED
@@ -855,9 +855,12 @@
855
855
  const paintCard = () => {
856
856
  const focusBack = card.contains(document.activeElement);
857
857
  card.replaceChildren();
858
+ // #2678: AI Chat's one line for a hidden card says it still waits while the suggestion is open (set below), not after.
859
+ delete card.dataset.waits; delete card.dataset.waitsSays;
858
860
  const aside = setAsideFor(moveKey, move);
859
861
  if (aside) {
860
862
  moveKey = aside.key;
863
+ card.setAttribute('aria-label', `Not now: ${text.title}`);
861
864
  const line = el('div', 'ai-chat-connection-collapsed');
862
865
  const undo = el('button', '', 'Undo');
863
866
  undo.type = 'button';
@@ -891,11 +894,13 @@
891
894
  const tick = el('span', '', '✓ '); tick.setAttribute('aria-hidden', 'true');
892
895
  head.lastChild.append(tick, document.createTextNode(`${move.toolName} installed`));
893
896
  card.classList.add('is-connected');
897
+ card.dataset.waits = 'done'; // #2678: installed, so AI Chat folds it to one line by itself
894
898
  card.append(head, el('p', 'ai-chat-filter-note', 'Ready to use.'), status);
895
899
  if (focusBack) { card.tabIndex = -1; card.focus({ preventScroll: true }); }
896
900
  return;
897
901
  }
898
902
  card.classList.remove('is-connected');
903
+ card.dataset.waits = 'you';
899
904
  const head = el('div', 'ai-chat-filter-card-head');
900
905
  head.append(el('span', 'guide-move-eyebrow', 'Suggested'), el('strong', '', text.title));
901
906
  card.append(head);
@@ -1000,6 +1005,7 @@
1000
1005
  if (update?.state === 'building') {
1001
1006
  // The card stays in the Guide for days, so it says what happened, not that the AI is still working.
1002
1007
  card.setAttribute('aria-label', `Draft created: ${workflowName}`);
1008
+ card.dataset.waits = 'done'; // #2678: built in its own chat, so AI Chat folds this card by itself
1003
1009
  head.append(el('span', 'guide-move-eyebrow', 'Draft created'), el('strong', '', workflowName));
1004
1010
  card.append(head, el('p', 'ai-chat-filter-why', 'It is built in the workflow’s own chat. You can leave and come back.'));
1005
1011
  const open = button('Open workflow', 'shell.guide-move-open-workflow', 'Opens this workflow’s build conversation. If the AI never got its first message, this sends it again.', 'ai-chat-filter-apply');
@@ -1007,6 +1013,7 @@
1007
1013
  actions.append(open); first = open;
1008
1014
  card.append(actions, status);
1009
1015
  } else if (update?.state === 'failed') {
1016
+ card.dataset.waits = 'you'; card.dataset.waitsSays = 'Not started. Expand it to try again or open the draft.';
1010
1017
  card.setAttribute('aria-label', `Not started: ${workflowName}`);
1011
1018
  head.append(el('span', 'guide-move-eyebrow', 'Not started'), el('strong', '', `“${workflowName}” is saved as a draft, but its chat didn’t start`));
1012
1019
  card.append(head);
@@ -1030,6 +1037,7 @@
1030
1037
  actions.append(retry, open); first = retry;
1031
1038
  card.append(actions, status);
1032
1039
  } else {
1040
+ card.dataset.waits = 'you';
1033
1041
  card.setAttribute('aria-label', `Suggestion: ${text.title}`);
1034
1042
  head.append(el('span', 'guide-move-eyebrow', 'Suggested'), el('strong', '', text.title));
1035
1043
  card.append(head);
@@ -135,16 +135,11 @@
135
135
  <span class="ws-access-label">Project access</span><span class="ws-access-count" id="ws-access-count" hidden></span>
136
136
  </button>
137
137
  <span class="ctl-sep" aria-hidden="true"></span>
138
+ <!-- #2521 row 5: what the approved head and the working copy rest on, when either is a Quick model. -->
139
+ <span id="ws-quick" class="ws-quick-chips" hidden></span>
138
140
  <button data-command-id="shell.approve" id="ws-approve" type="button" class="primary"
139
141
  data-tip="Review every pending change before signing off.">Review &amp; approve</button>
140
142
  </div>
141
- <!-- Per-workflow onboarding beacon. Pulses "✨ Start here" while this workflow is
142
- new to the user (no first Run completed, not dismissed); calms to a quiet
143
- "❔ Guide" after — always clickable for re-reference. Hidden until an app loads. -->
144
- <button data-command-id="guide.open" id="guide-beacon" class="guide-beacon" type="button" hidden aria-haspopup="dialog" data-tip="New here? See what this workflow does and how to run it.">
145
- <span class="guide-beacon-ico" aria-hidden="true">✦</span>
146
- <span class="guide-beacon-label">Start here</span>
147
- </button>
148
143
  <span class="run-state" id="run-state" role="status" aria-live="polite" aria-atomic="true"></span>
149
144
  <!-- Restore + Customize: shown for a MAINTAINED (publisher:floless, non-forked) app. Restore
150
145
  appears only when its logic drifted (re-installs the official version); Customize (fork) is
@@ -293,8 +288,9 @@
293
288
  <!-- One toolbar under the message box: attach, the conversation's scope, access and units, then Send. -->
294
289
  <div class="ai-chat-scope-controls" id="chat-scope-controls" hidden>
295
290
  <button type="button" id="chat-scope-toggle" data-command-id="shell.chat-scope-open" aria-expanded="false" aria-controls="chat-scope-picker">Scope</button>
296
- <button type="button" id="chat-access-explanation" data-command-id="shell.chat-access-explanation#hidden" aria-expanded="false" aria-controls="chat-scope-disclosure" aria-label="Explain Read only access" data-tip="Show what this access level allows."><span class="sr-only">Access · </span><strong>Read only</strong><span class="ai-chat-access-chevron" aria-hidden="true">⌄</span></button>
297
- <span id="chat-scope-disclosure" aria-live="polite" hidden></span>
291
+ <!-- A quick switch, like the AI terminals' own: the four levels, each with its one-line note (web/chat.js). -->
292
+ <button type="button" id="chat-access-chip" data-command-id="shell.chat-access-open" aria-haspopup="menu" aria-expanded="false" aria-controls="chat-access-menu" aria-label="Access: Read only. Change access"><span class="sr-only">Access · </span><strong>Read only</strong><span class="ai-chat-access-chevron" aria-hidden="true">⌄</span></button>
293
+ <div class="ai-chat-access-menu" id="chat-access-menu" role="menu" aria-labelledby="chat-access-menu-head" hidden></div>
298
294
  <section class="ai-chat-picker ai-chat-scope-picker" id="chat-scope-picker" role="dialog" aria-label="Conversation scope" hidden></section>
299
295
  </div>
300
296
  <!-- #1890: once a workspace conversation's units are chosen, a units chip ("ft-in ⌄") with a two-item menu. -->
@@ -450,6 +446,7 @@
450
446
  <button data-command-id="shell.workspace-step#history" type="button" data-step="history" role="tab" aria-selected="false">History</button>
451
447
  <button data-command-id="shell.workspace-step#pages" type="button" data-step="pages" role="tab" aria-selected="false">Pages</button>
452
448
  <button data-command-id="shell.workspace-step#workflows" type="button" data-step="workflows" role="tab" aria-selected="false" hidden>Workflows</button>
449
+ <button data-command-id="shell.workspace-step#rfis" type="button" data-step="rfis" role="tab" aria-selected="false" hidden>RFIs</button>
453
450
  <button data-command-id="shell.workspace-step#modules" type="button" data-step="modules" role="tab" aria-selected="false" hidden>Modules</button>
454
451
  </div>
455
452
  <span class="ws-step-end">
@@ -515,6 +512,9 @@
515
512
  <!-- #2470 R6.2: Workflows = a SHELL-rendered pane: the workflows this project owns.
516
513
  project-workflows.js fills it on step-switch (flolessProjectWorkflows.render). -->
517
514
  <div class="ws-pages ws-workflows" id="ws-workflows" hidden></div>
515
+ <!-- #2470 R6.6: RFIs = a SHELL-rendered pane: a General project's questions for the engineer, client or architect.
516
+ project-rfis.js fills it on step-switch (flolessProjectRfis.render). -->
517
+ <div class="ws-pages ws-rfis" id="ws-rfis" hidden></div>
518
518
  <!-- #2470 R6.7: Modules = a SHELL-rendered pane: the module projects linked to a General project.
519
519
  project-modules.js fills it on step-switch (flolessProjectModules.render). -->
520
520
  <div class="ws-pages ws-modules" id="ws-modules" hidden></div>
@@ -1259,7 +1259,7 @@
1259
1259
  </div>
1260
1260
  <div class="report-actions">
1261
1261
  <button data-command-id="shell.report-stop" id="report-stop" class="ghost report-stop" hidden data-tip="Stop this workflow run">■ Stop run</button>
1262
- <button data-command-id="shell.report-share" id="report-share" class="ghost" hidden data-tip="Share this report as a link anyone can view — hosted on floless.io">↗ Share</button>
1262
+ <button data-command-id="shell.report-share" id="report-share" class="ghost" hidden data-tip="Share this report as a link anyone can view, hosted on floless.io. When the run made a Page version, this shares the workflow’s Page, whose link keeps updating.">↗ Share</button>
1263
1263
  <button data-command-id="shell.report-download" id="report-download" class="ghost" hidden data-tip="Download the complete read-only model property report">↓ Download complete report</button>
1264
1264
  <button data-command-id="shell.report-watch" id="report-watch" type="button" class="ghost" hidden data-tip="Play the video this run rendered">▶ Watch video</button>
1265
1265
  <button data-command-id="shell.report-open-file" id="report-open-file" class="ghost" hidden data-tip="Open the saved file in its default app">⧉ Open file</button>
@@ -1537,6 +1537,17 @@
1537
1537
 
1538
1538
  <!-- Save-on-switch confirmation — shown when switching workflows with unsaved
1539
1539
  input changes. Reuses the shared modal styling; no new backdrop look. -->
1540
+ <!-- New RFI (project-rfis.js, #2470 R6.6): the Project access sheet's chrome; its body is the form or the Cite picker. -->
1541
+ <div class="modal-backdrop pa-backdrop pm-backdrop pr-backdrop" id="project-rfi-sheet" role="dialog" aria-modal="true" aria-labelledby="pr-title" aria-describedby="pr-sub">
1542
+ <aside class="pa-sheet pr-sheet" tabindex="-1">
1543
+ <header class="pa-head">
1544
+ <div><h2 class="pa-title" id="pr-title">New RFI</h2><p class="pa-subtitle" id="pr-sub"></p></div>
1545
+ <button type="button" class="pa-close" id="pr-close" aria-label="Close" data-tip="Close" data-command-id="shell.project-rfi-sheet-close">✕</button>
1546
+ </header>
1547
+ <div class="pa-body" id="pr-body"></div>
1548
+ <footer class="pa-foot pr-foot" id="pr-foot"></footer>
1549
+ </aside>
1550
+ </div>
1540
1551
  <!-- Add a module / Link an existing project (project-modules.js, #2470 R6.7): the Project access sheet's chrome. -->
1541
1552
  <div class="modal-backdrop pa-backdrop pm-backdrop" id="project-modules-sheet" role="dialog" aria-modal="true" aria-labelledby="pm-title" aria-describedby="pm-sub">
1542
1553
  <aside class="pa-sheet pm-sheet" tabindex="-1">
@@ -1775,37 +1786,6 @@
1775
1786
  </div>
1776
1787
  </div>
1777
1788
 
1778
- <!-- Per-workflow onboarding "Start here" guide. Surfaces the workflow's plain-English
1779
- description + a live "Set inputs → Compile → Run" checklist (ticks from real state),
1780
- and relays a "walk me through it" ask to the terminal AI. A styled modal — never a
1781
- native dialog; body (#guide-body) is rendered per-open in aware.js. -->
1782
- <div class="modal-backdrop" id="guide-modal">
1783
- <div class="modal guide" role="dialog" aria-modal="true" aria-labelledby="guide-title" tabindex="-1">
1784
- <div class="guide-eyebrow" id="guide-eyebrow">✦ Start here</div>
1785
- <div class="modal-title" id="guide-title">Workflow</div>
1786
- <div class="modal-sub">What this workflow does, and how to go through it.</div>
1787
- <div id="guide-body"></div>
1788
- <div class="modal-actions">
1789
- <button data-command-id="shell.guide-dismiss" id="guide-got-it">Got it</button>
1790
- <button data-command-id="shell.guide-walk" id="guide-walk" class="primary">Walk me through it →</button>
1791
- </div>
1792
- </div>
1793
- </div>
1794
-
1795
- <!-- One-time first-open spotlight: dims the canvas and points at the "Start here"
1796
- beacon, then collapses into it. Shown once per workflow; Esc / click-away / either
1797
- button dismiss it. The beacon gets .spotlit so it sits above the dim. The bubble is
1798
- positioned next to the beacon at open time (aware.js). -->
1799
- <div id="guide-spotlight" class="guide-spotlight" hidden>
1800
- <div class="guide-spotlight-bubble" role="dialog" aria-modal="false" aria-label="New workflow tip" tabindex="-1">
1801
- <div class="guide-spotlight-text">New to this workflow? <strong>Start here</strong> — see what it does and how to run it.</div>
1802
- <div class="guide-spotlight-actions">
1803
- <button data-command-id="shell.guide-dismiss" type="button" id="guide-spotlight-got" class="ghost">Got it</button>
1804
- <button data-command-id="shell.guide-walk" type="button" id="guide-spotlight-show" class="primary">Show me</button>
1805
- </div>
1806
- </div>
1807
- </div>
1808
-
1809
1789
  <!-- Routines — scheduled .flo runs. The list; the add/edit form is its own modal. -->
1810
1790
  <div class="modal-backdrop" id="routines-modal">
1811
1791
  <div class="modal routines">
@@ -2130,8 +2110,10 @@
2130
2110
  <script src="agents.js"></script>
2131
2111
  <script src="project-access.js"></script>
2132
2112
  <script src="pages.js"></script>
2113
+ <script src="run-history.js"></script>
2133
2114
  <script src="project-workflows.js"></script>
2134
2115
  <script src="project-modules.js"></script>
2116
+ <script src="project-rfis.js"></script>
2135
2117
  <script src="guide.js"></script>
2136
2118
  <script src="connections.js"></script>
2137
2119
  <script src="local-discovery.js"></script>
@@ -130,7 +130,14 @@
130
130
  var tone = 'idle';
131
131
  var chip = wf.statusLabel || 'Ready';
132
132
 
133
- if (wf.runState === 'drift') {
133
+ if (wf.runState === 'locked') {
134
+ // #2644: a Drawing Checker or Steel Model workflow this account's plan does not include. Its sentence (what is
135
+ // missing and how to get it) comes from the server; nothing of the workflow opens.
136
+ tone = 'blocked';
137
+ chip = 'Locked';
138
+ parts.push(wf.name);
139
+ parts.push(wf.reason || 'is part of a module this account’s plan does not include');
140
+ } else if (wf.runState === 'drift') {
134
141
  tone = 'blocked';
135
142
  chip = 'Run blocked';
136
143
  parts.push(wf.name);
@@ -326,8 +333,10 @@
326
333
  if (!el || el === document.body) return null;
327
334
  // A semantic divider is not a control. Only focusable separators (the panel
328
335
  // resize handles) belong in Instructor's interaction stream.
329
- // A registered drag handle that is not a button (the left pane's section headers) is a control too.
330
- var target = el.closest('button, summary, [role="button"], [role="treeitem"], [role="separator"][tabindex], a[href], input, select, textarea, [draggable="true"][data-command-id]');
336
+ // A registered drag handle that is not a button (the left pane's section headers) is a control too, and so is a
337
+ // registered element a keyboard can reach (`tabindex="0"`): a label such as the Quick model pill (#2521 row 5)
338
+ // has nothing to press but is exactly what `?` should explain.
339
+ var target = el.closest('button, summary, [role="button"], [role="treeitem"], [role="separator"][tabindex], a[href], input, select, textarea, [draggable="true"][data-command-id], [tabindex="0"][data-command-id]');
331
340
  /* A switch paints `.rtn-toggle-track` over an input that is `opacity:0; width:0;
332
341
  height:0`, so the pointer NEVER lands on the input — it lands on the track, or
333
342
  on the <label> around it, and neither is in the list above. Hovering "Start on
@@ -856,7 +865,7 @@
856
865
  // #2046: the ways into the Guide on the empty pages, and its first-launch question.
857
866
  'Getting started', 'In the Guide question',
858
867
  'In the Workspace directory dialog', 'In Tekla source selection', 'In the new project dialog', 'In the project workspace', 'In the Revit workspace', 'In the Tekla Parser workspace', 'In the Drawing Checker profile', 'In Company knowledge',
859
- 'In the project History', 'In the revision note', 'In the Pages list', 'In a project’s Workflows step', 'In a project’s Modules step',
868
+ 'In the project History', 'In the revision note', 'In the Pages list', 'In a project’s Workflows step', 'In a project’s RFIs step', 'In a project’s Modules step',
860
869
  'On the workflow canvas', 'In workflow setup dialogs',
861
870
  // The Informed by row sits at the top of the canvas column, so it is read right after the canvas.
862
871
  // #1998: the approval notices sit above the canvas with the Informed by row.
@@ -865,7 +874,7 @@
865
874
  'At the left edge of the workspace', 'At the edge of the left or Inspect panel', 'In the left panel', 'Between AI Chat and Model', 'In the Model section of the left panel', 'In the Grid object in the Model section',
866
875
  'In AI Chat', 'In AI Chat history', 'In AI Chat settings', 'In the node Inspect panel', 'In the Instructor strip',
867
876
  'In the ≡ menu', 'In the account menu', 'In the footer',
868
- 'In the contract editor', 'In the report viewer', 'In the Page viewer', 'In My shared links', 'In the video player', 'In the Knowledge Base viewer', 'In the guide',
877
+ 'In the contract editor', 'In the report viewer', 'In the Page viewer', 'In My shared links', 'In the video player', 'In the Knowledge Base viewer',
869
878
  'In the Tools library', 'In Discover local tools', 'In the requests list', 'In the revision review', 'In the run request dialog', 'In the Integrations dialog', 'In the Routines dialog', 'In the Automatic tool updates dialog', 'In the terminal requests dialog',
870
879
  'In the Report an issue dialog', 'In the Build a tool dialog', 'In the Bake dialog', 'In the CAD send review',
871
880
  'In the FloLess dialogs', 'On the FloLess has stopped screen',
package/dist/web/pages.js CHANGED
@@ -103,13 +103,29 @@
103
103
  ${canDelete ? `<button type="button" class="ghost pg-row-delete" data-command-id="shell.page-delete-unreadable#${esc(p.id)}" data-home="${esc(home)}" data-page="${esc(p.id)}">Delete</button>` : ''}
104
104
  </div>`;
105
105
  }
106
- const meta = [...(view.lead || [sourceText(p.source)]), versionsText(p.versionCount), p.sequence ? 'Has an order' : '', `Updated ${ago(p.updatedAt)}`].filter(Boolean).join(' · ');
106
+ if (typeof p.locked === 'string' && p.locked) {
107
+ // #2644: made by a Drawing Checker or Steel Model workflow this account's plan does not include. It stays listed
108
+ // by name and says why it does not open, in the module's own words; nothing of it is read.
109
+ // Housekeeping stays: Delete, and Cancel publishing while a link is still going out (the viewer that holds them
110
+ // does not open). The landing's owner and Archived context lead the sentence, as on any other row.
111
+ const lead = (view.lead || []).filter(Boolean).join(' · ');
112
+ const cancel = p.shareState === 'pending-publish'
113
+ ? `<button type="button" class="ghost pg-row-locked-act" data-locked-act="cancel" data-command-id="shell.page-share-cancel-locked#${esc(p.id)}" data-command-instance-label="${esc(p.title)}" data-home="${esc(home)}" data-page="${esc(p.id)}">Cancel publishing</button>` : '';
114
+ return `<div class="pg-row pg-row-locked" role="listitem" aria-disabled="true" data-blocked-reason="${esc(p.locked)}">
115
+ <div class="pg-row-text"><span class="pg-row-line"><span class="pg-row-title">${esc(p.title)}</span><span class="wf-fork-badge wf-lock-badge" data-tip="${esc(p.locked)}">${globalThis.FLOLESS_LOCK_ICON_SVG || ''}Locked</span></span>
116
+ <span class="pg-row-meta">${esc(lead ? `${lead} · ${p.locked}` : p.locked)}</span></div>
117
+ ${cancel}<button type="button" class="ghost pg-row-locked-act" data-locked-act="delete" data-command-id="shell.page-delete-locked#${esc(p.id)}" data-command-instance-label="${esc(p.title)}" data-home="${esc(home)}" data-page="${esc(p.id)}">Delete</button>
118
+ </div>`;
119
+ }
120
+ const meta = [...(view.lead || [sourceText(p.source)]), versionsText(p.versionCount), p.sequence ? 'Has an order' : ''].filter(Boolean).join(' · ');
121
+ // #2702: "Updated N min ago" is its own element so a quiet clock tick (retimeLists) can keep it true without a re-read.
122
+ const updated = `Updated <span class="pg-ago" data-at="${esc(p.updatedAt)}">${esc(ago(p.updatedAt))}</span>`;
107
123
  // Only an order FloLess did not read is flagged on the row; a read one is the plain "Has an order".
108
124
  const seqChip = p.sequence && (p.sequence !== 'read' || p.sequencePartial) ? `<span class="pg-seq-chip is-warn">${esc(seqLabel({ order: p.sequence, partial: p.sequencePartial }))}</span>` : '';
109
125
  return `<div class="pg-row" role="listitem">
110
126
  <button type="button" class="pg-row-open" data-command-id="shell.page-open#${esc(p.id)}" data-command-instance-label="${esc(p.title)}" data-home="${esc(home)}" data-page="${esc(p.id)}">
111
127
  <span class="pg-row-line"><span class="pg-row-title">${esc(p.title)}</span>${p.aiMade ? '<span class="pg-ai-badge">AI-made</span>' : ''}${seqChip}${p.shareState && p.shareState !== 'revoked' ? `<span class="sl-chip" data-state="${esc(p.shareState)}">${esc(LIST_CHIP[p.shareState] || 'Shared')}</span>` : ''}</span>
112
- <span class="pg-row-meta" data-tip="${esc(when(p.updatedAt))}">${esc(meta)}</span>
128
+ <span class="pg-row-meta" data-tip="${esc(when(p.updatedAt))}">${esc(meta)}${meta ? ' · ' : ''}${updated}</span>
113
129
  </button>
114
130
  </div>`;
115
131
  }
@@ -135,7 +151,9 @@
135
151
  for (const e of lists) if (e.container === container) lists.delete(e);
136
152
  lists.add(entry);
137
153
  const token = (container.dataset.pagesToken = String(Math.random()));
138
- if (!opts.hideWhenEmpty) container.innerHTML = `${opts.headHtml || ''}<p class="pg-loading-line">Loading Pages…</p>`;
154
+ // A re-read for a change (opts.quiet) keeps the rows on screen until the new ones arrive, so the list never flashes.
155
+ const keepRows = opts.quiet && container.querySelector('.pg-list, .pg-empty');
156
+ if (!opts.hideWhenEmpty && !keepRows) container.innerHTML = `${opts.headHtml || ''}<p class="pg-loading-line">Loading Pages…</p>`;
139
157
  let body;
140
158
  try {
141
159
  body = await api(`/api/pages?home=${encodeURIComponent(home)}`);
@@ -163,7 +181,7 @@
163
181
  }
164
182
  // Landing rows remain usable during loading: preserve the person's latest row, not the
165
183
  // one focused when the request began. Other surfaces replace rows with Loading immediately.
166
- if (opts.hideWhenEmpty) focusedPageCommand = container.contains(document.activeElement) ? document.activeElement?.getAttribute('data-command-id') : null;
184
+ if (opts.hideWhenEmpty || opts.quiet) focusedPageCommand = container.contains(document.activeElement) ? document.activeElement?.getAttribute('data-command-id') : null;
167
185
  const own = pages.length ? `<div class="pg-list" role="list" aria-label="${esc(opts.label || 'Pages')}">${pages.map((p) => rowHtml(body.home || home, p)).join('')}</div>` : '';
168
186
  const workflows = fromWorkflows.length || workflowsNote ? `<div class="pg-group-label">From workflows</div>
169
187
  ${workflowsNote ? `<p class="pg-empty">${esc(workflowsNote)}</p>` : ''}
@@ -279,19 +297,41 @@
279
297
  window.dispatchEvent(new CustomEvent('floless:page-deleted', { detail: { home, id } }));
280
298
  }
281
299
 
282
- function refreshLists() {
300
+ function refreshLists(quiet = false) {
283
301
  for (const e of [...lists]) {
284
302
  if (!e.container.isConnected) { lists.delete(e); continue; }
285
303
  if (e.kind === 'workflows') renderWorkflowsList(e.container, e.opts);
286
- else renderList(e.container, e.home, e.opts);
304
+ else renderList(e.container, e.home, quiet ? { ...e.opts, quiet: true } : e.opts);
287
305
  }
288
306
  }
289
307
 
308
+ // #2702: a Page changed anywhere (chat, workflow run, viewer share/publish/revoke, delete) — the server says so on the
309
+ // event stream it already has open, and every open list re-reads. Bursts (a run adding versions) become one re-read.
310
+ let pagesChangedTimer = null;
311
+ window.addEventListener('floless:pages-changed', () => {
312
+ if (pagesChangedTimer) return;
313
+ pagesChangedTimer = setTimeout(() => { pagesChangedTimer = null; refreshLists(true); }, 250);
314
+ });
315
+
316
+ /** Keep "Updated N min ago" true on an open list with no request: re-word it from the time already on the row. */
317
+ function retimeLists() {
318
+ for (const el of document.querySelectorAll('.pg-ago[data-at]')) {
319
+ const text = ago(el.getAttribute('data-at'));
320
+ if (text && el.textContent !== text) el.textContent = text;
321
+ }
322
+ }
323
+ const retimeTick = () => { if (!document.hidden) retimeLists(); const t = setTimeout(retimeTick, 30_000); t?.unref?.(); };
324
+ retimeTick();
325
+ document.addEventListener('visibilitychange', () => { if (!document.hidden) retimeLists(); });
326
+
290
327
  document.addEventListener('click', (event) => {
291
328
  const open = event.target.closest?.('.pg-row-open');
292
329
  if (open) { openViewer(open.dataset.home, open.dataset.page, null, open); return; }
293
330
  const del = event.target.closest?.('.pg-row-delete');
294
331
  if (del) { deleteUnreadable(del.dataset.home, del.dataset.page, del); return; }
332
+ // #2644: a locked Page's housekeeping, from its row (its viewer does not open).
333
+ const lockedAct = event.target.closest?.('.pg-row-locked-act');
334
+ if (lockedAct) { void lockedPageAction(lockedAct.dataset.lockedAct, lockedAct.dataset.home, lockedAct.dataset.page, lockedAct); return; }
295
335
  const act = event.target.closest?.('.pg-wf-act');
296
336
  const owner = act && [...lists].find((e) => e.kind === 'workflows' && e.container.contains(act));
297
337
  if (!owner) return;
@@ -316,6 +356,37 @@
316
356
  refreshLists();
317
357
  }
318
358
 
359
+ /** #2644: Delete, or Cancel publishing, a locked Page from its row. Each asks first, as the viewer's buttons do. */
360
+ async function lockedPageAction(act, home, id, button) {
361
+ const page = `/api/pages/${encodeURIComponent(home)}/${encodeURIComponent(id)}`;
362
+ const ok = await bridge.formModal?.(act === 'cancel'
363
+ ? { title: 'Cancel publishing this Page?', sub: 'Its link is not out yet. Cancelling stops it from being published; the Page itself stays.',
364
+ fields: [], okLabel: 'Cancel publishing', danger: false, returnFocusTo: button }
365
+ : { title: 'Delete this Page?', sub: 'Deleting removes its folder and every version in it. This can’t be undone.',
366
+ fields: [], okLabel: 'Delete', danger: true, returnFocusTo: button });
367
+ if (!ok) return;
368
+ try {
369
+ if (act === 'cancel') {
370
+ // Said as the viewer's own Cancel publishing says it: a cancel that found the link already out, or could not reach
371
+ // floless.io, is never reported as cancelled.
372
+ const { outcome } = await api(`${page}/share/cancel`, { method: 'POST' });
373
+ if (outcome === 'cancelled') toast('Publishing cancelled. The link is as it was.', 'ok');
374
+ else if (outcome === 'published') toast('It had already been published, so the link shows it.', 'ok');
375
+ else if (outcome && outcome !== 'nothing-to-do') toast(outcomeSentence(outcome), 'warn');
376
+ } else {
377
+ const body = await api(page, { method: 'DELETE' });
378
+ announceDeleted(home, id);
379
+ // As the viewer's Delete says it: a shared link floless.io could not be told about yet is still online.
380
+ if (body?.revokePending === true) {
381
+ toast('Page deleted. Its link will be revoked as soon as FloLess can reach floless.io; you can see it in My shared links.', 'warn');
382
+ } else toast('Page deleted.', 'ok');
383
+ }
384
+ } catch (err) {
385
+ toast(`FloLess couldn’t ${act === 'cancel' ? 'cancel publishing' : 'delete it'}. ${err?.body?.error || 'Try again in a moment.'}`, 'warn');
386
+ }
387
+ refreshLists();
388
+ }
389
+
319
390
  // ── Viewer ───────────────────────────────────────────────────────────────────────────────────────
320
391
 
321
392
  const $modal = document.getElementById('page-viewer');
@@ -522,7 +593,7 @@
522
593
  $loading.hidden = true;
523
594
  });
524
595
 
525
- async function openViewer(home, id, n, returnFocus) {
596
+ async function openViewer(home, id, n, returnFocus, opts = {}) {
526
597
  const seq = ++view.openSeq;
527
598
  let body;
528
599
  try {
@@ -533,6 +604,14 @@
533
604
  if (['page-damaged', 'page-not-found'].includes(err?.body?.code) && typeof window.flolessWorkspaces?.openPagesHome === 'function') {
534
605
  if (await window.flolessWorkspaces.openPagesHome(home, id, closeViewer)) return true;
535
606
  }
607
+ // #2644: a Page a locked Drawing Checker or Steel Model workflow made does not open. Say why, and go to its row in the
608
+ // Pages list, where its Delete (and Cancel publishing) still are: AI Chat's delete hands the person this screen.
609
+ const locked = err?.status === 403 && typeof err.body?.userMessage === 'string' ? err.body.userMessage.trim() : '';
610
+ if (locked) {
611
+ toast(locked, 'warn');
612
+ if (typeof window.flolessWorkspaces?.openPagesHome === 'function' && await window.flolessWorkspaces.openPagesHome(home, id, closeViewer)) return true;
613
+ return false;
614
+ }
536
615
  toast(`FloLess couldn’t open this Page. ${err?.body?.error || 'Try again in a moment.'}`, 'warn');
537
616
  return false;
538
617
  }
@@ -558,7 +637,11 @@
558
637
  if (found === 'known') view.n = n;
559
638
  else note = found === 'gone' ? goneNote(n) : failedNote(n, found);
560
639
  }
561
- view.returnFocus = returnFocus instanceof HTMLElement ? returnFocus : document.activeElement;
640
+ // #2706: a caller that has to close something first (the run viewer) does it here, once the Page is known to open, so a
641
+ // Page that cannot be opened leaves that screen as it was. Focus then returns to whatever the caller put back.
642
+ if (typeof opts.beforeShow === 'function') await opts.beforeShow();
643
+ if (seq !== view.openSeq) return false;
644
+ view.returnFocus = !opts.beforeShow && returnFocus instanceof HTMLElement ? returnFocus : document.activeElement;
562
645
  view.linkAsk = null;
563
646
  view.blocked.clear();
564
647
  view.kept.clear();
@@ -575,7 +658,13 @@
575
658
  $modal.classList.add('show');
576
659
  loadFrame();
577
660
  $close.focus();
578
- void loadShare();
661
+ if (opts.share) {
662
+ // #2706: the run viewer's Share lands here with the share menu open for the version that run made, so it is the
663
+ // same menu, link and confirmation as this viewer's own Share. The menu opens once the link's state is known.
664
+ await loadShare();
665
+ // Not over something the person opened meanwhile (the version list, the site list).
666
+ if (seq === view.openSeq && isOpen() && $versionPop.hidden && $sitesPop.hidden) showSharePop();
667
+ } else void loadShare();
579
668
  return true;
580
669
  }
581
670
 
@@ -1001,7 +1090,7 @@
1001
1090
  parts.push(`<div class="pv-share-row">${`<button type="button" class="ghost" data-command-id="shell.page-share-open-link" data-share-act="open">${esc('Open link')}</button>`}</div>`);
1002
1091
  }
1003
1092
  const shown = view.n;
1004
- // floless.io can't draw the order label yet, so a version whose order FloLess did not read carries it in the title.
1093
+ // Row 6b: floless.io draws the order label beside the link's title; this says so for the version being published.
1005
1094
  const shownVersion = view.known.find((x) => x.n === shown);
1006
1095
  const shownSeq = shownVersion?.sequence;
1007
1096
  // #2262 slice 3c: a whole complete report says what leaves the computer before it is shared.
@@ -1010,9 +1099,11 @@
1010
1099
  ? '<p class="pv-pop-note pv-share-whole-report">This version holds the whole model property report — every property in it will be on the link.</p>'
1011
1100
  : '<p class="pv-pop-note pv-share-whole-report">This version is only a summary of the report, so only the summary will be on the link.</p>');
1012
1101
  }
1013
- if (shownSeq && (shownSeq.order !== 'read' || shownSeq.partial)) {
1014
- const suffix = shownSeq.order === 'read' ? 'order partly read' : shownSeq.order === 'assumed' ? 'order assumed' : shownSeq.order === 'unverified' ? 'order not checked' : 'order unreadable';
1015
- parts.push(`<p class="pv-pop-note pv-share-seq">The shared link’s title will end with “ · ${esc(suffix)}”, because floless.io can’t show the order label yet.</p>`);
1102
+ // #2262 6b: floless.io shows every order as a chip (owner ruling 2026-10-23), so the note says so for every labelled
1103
+ // version; only an order not fully read keeps the warning colour.
1104
+ if (shownSeq) {
1105
+ const fullyRead = shownSeq.order === 'read' && !shownSeq.partial;
1106
+ parts.push(`<p class="pv-pop-note pv-share-seq${fullyRead ? ' is-read' : ''}">Publishing this version shows its order label (${esc(seqLabel(shownSeq))}) on the link.</p>`);
1016
1107
  }
1017
1108
  if (!s || s.state === 'revoked') {
1018
1109
  parts.push(`<div class="pv-share-row">${`<button type="button" class="pv-share-primary" data-command-id="shell.page-share-create" data-share-act="create">${esc(s ? `Share ${verLabel(shown)} again` : `Share ${verLabel(shown)}`)}</button>`}</div>`);
@@ -1293,13 +1384,17 @@
1293
1384
  $share.setAttribute('aria-expanded', 'false');
1294
1385
  }
1295
1386
 
1296
- $share.addEventListener('click', () => {
1297
- if (!$sharePop.hidden) { closePopovers(); return; }
1387
+ function showSharePop() {
1298
1388
  closePopovers();
1299
1389
  paintSharePop();
1300
1390
  $sharePop.hidden = false;
1301
1391
  $share.setAttribute('aria-expanded', 'true');
1302
1392
  ($sharePop.querySelector('.pv-share-primary') || $sharePop.querySelector('button'))?.focus();
1393
+ }
1394
+
1395
+ $share.addEventListener('click', () => {
1396
+ if (!$sharePop.hidden) { closePopovers(); return; }
1397
+ showSharePop();
1303
1398
  });
1304
1399
 
1305
1400
  async function onShareAct(act, button) {
@@ -1404,6 +1499,8 @@
1404
1499
 
1405
1500
  function slRowHtml(row) {
1406
1501
  const chip = row.state ? `<span class="sl-chip" data-state="${esc(row.state)}">${esc(CHIP[row.state] || '')}</span>` : '';
1502
+ // The chip describes the link's own version as floless.io holds it, never the local Page's latest (row 6b).
1503
+ const seq = row.sequence ? `<span class="pg-seq-chip${row.sequence.order !== 'read' || row.sequence.partial ? ' is-warn' : ''}" tabindex="0" data-tip="${esc(row.sequence.sentence)}">${esc(seqLabel(row.sequence))}</span>` : '';
1407
1504
  const ai = row.aiMade ? '<span class="pg-ai-badge" tabindex="0" data-tip="Made by AI. FloLess doesn’t check its figures or statements.">AI-made</span>' : '';
1408
1505
  const titleCell = row.page && !row.deleted
1409
1506
  ? `<button type="button" class="sl-title-open" data-command-id="shell.shared-link-page#${esc(row.title)}" data-sl-act="page" data-home="${esc(row.page.home)}" data-page="${esc(row.page.pageId)}">${esc(row.title || 'Untitled Page')}</button>`
@@ -1414,7 +1511,7 @@
1414
1511
  <button type="button" class="ghost" data-command-id="shell.shared-link-open#${esc(row.title)}" data-sl-act="open" data-url="${esc(row.url)}">Open</button>
1415
1512
  <button type="button" class="ghost sl-revoke" data-command-id="shell.shared-link-revoke#${esc(row.title)}" data-sl-act="revoke" data-token="${esc(row.token)}" data-title="${esc(row.title)}">Revoke</button>` : '';
1416
1513
  return `<div class="pg-row sl-row" role="listitem">
1417
- <div class="pg-row-text sl-row-text"><span class="pg-row-line">${titleCell}${ai}${chip}</span>
1514
+ <div class="pg-row-text sl-row-text"><span class="pg-row-line">${titleCell}${ai}${seq}${chip}</span>
1418
1515
  <span class="pg-row-meta" ${row.when ? `data-tip="${esc(when(row.when))}"` : ''}>${esc(row.meta)}</span></div>
1419
1516
  <div class="sl-actions">${actions}</div></div>`;
1420
1517
  }
@@ -1428,7 +1525,7 @@
1428
1525
  byToken.delete(r.token);
1429
1526
  const state = r.revoked ? 'revoked' : (mine?.share?.state === 'pending-revoke' ? 'pending-revoke' : 'live');
1430
1527
  const kind = r.kind === 'page' ? `Page link · link version ${r.remoteVersion}` : 'Report link';
1431
- return { token: r.token, url: r.url, title: mine?.title || r.title, aiMade: r.aiMade, state, page: mine ? { home: mine.home, pageId: mine.pageId } : null,
1528
+ return { token: r.token, url: r.url, title: r.title || mine?.title, aiMade: r.aiMade, sequence: r.sequence || null, state, page: mine ? { home: mine.home, pageId: mine.pageId } : null,
1432
1529
  deleted: !!mine?.deleted, when: r.updatedAt || r.createdAt, meta: `${kind} · updated ${ago(r.updatedAt || r.createdAt)}` };
1433
1530
  });
1434
1531
  return rows;
@@ -1602,7 +1699,7 @@
1602
1699
  renderWorkflowsList,
1603
1700
  repaintWorkflowsList,
1604
1701
  openSharedLinks: (returnFocus) => openSharedLinks(returnFocus),
1605
- open: (home, id, n) => openViewer(home, id, n ?? null, document.activeElement),
1702
+ open: (home, id, n, opts) => openViewer(home, id, n ?? null, document.activeElement, opts || {}),
1606
1703
  refresh: refreshLists,
1607
1704
  /** The server changed this Page's record (a failed live session's labels): an open copy re-reads it. */
1608
1705
  reloadIfOpen: (home, id) => {
@@ -242,9 +242,19 @@
242
242
  // distinct from "no run yet" — don't tell the user to run something that DID run.
243
243
  const traceUnreadable = (payload) =>
244
244
  !!(payload && typeof payload === 'object' && payload.traceUnreadable === true);
245
+ // #2644: a Drawing Checker or Steel Model workflow this account's plan does not include: its run is not shown, and
246
+ // the panel says why in the module's own words (never "run it", which would not help).
247
+ function moduleRefusedHtml(payload) {
248
+ if (!payload || typeof payload !== 'object' || payload.moduleRefused !== true) return null;
249
+ const sentence = typeof payload.userMessage === 'string' && payload.userMessage.trim() ? payload.userMessage.trim()
250
+ : 'this workflow is part of a module this account’s plan does not include.';
251
+ return placeholderHtml(`Locked: ${sentence}`);
252
+ }
245
253
 
246
254
  function tableHtml(b) {
247
255
  const payload = payloadFor(b.source);
256
+ const locked = moduleRefusedHtml(payload);
257
+ if (locked) return locked;
248
258
  if (traceUnreadable(payload)) {
249
259
  return placeholderHtml(`The last run of “${String(b.source ?? '')}” finished, but its trace couldn’t be read — re-run to refresh this table.`);
250
260
  }
@@ -297,6 +307,8 @@
297
307
  function reportHtml(b) {
298
308
  const payload = payloadFor(b.source);
299
309
  const title = typeof b.title === 'string' && b.title ? b.title : String(b.source ?? 'Report');
310
+ const locked = moduleRefusedHtml(payload);
311
+ if (locked) return locked;
300
312
  if (traceUnreadable(payload)) {
301
313
  return placeholderHtml(`The last run of “${String(b.source ?? '')}” finished, but its trace couldn’t be read — re-run to refresh this report.`);
302
314
  }
@@ -321,6 +333,7 @@
321
333
  let disabled = ' disabled';
322
334
  let tip;
323
335
  if (!gate || gate.state === 'loading') tip = 'Checking workflow state…';
336
+ else if (gate.locked) tip = `Locked: ${gate.locked}`;
324
337
  else if (gate.missing) tip = `Blocked: workflow “${appId}” is not installed.`;
325
338
  else if (!gate.runnable) {
326
339
  // The same stale-lock language the header Run button teaches.
@@ -451,7 +464,12 @@
451
464
  appGate.set(id, { state: 'loading' });
452
465
  api(`/api/app/${encodeURIComponent(id)}`)
453
466
  .then(({ app }) => appGate.set(id, { state: 'ready', runnable: !!app.runnable, runState: app.runState, missing: false }))
454
- .catch(() => appGate.set(id, { state: 'ready', runnable: false, runState: 'uncompiled', missing: true }))
467
+ // #2644: a module workflow this account's plan does not include answers 403 with its own sentence; it is
468
+ // locked, not missing, so the panel says that instead of "not installed".
469
+ .catch((e) => {
470
+ const locked = e?.status === 403 && typeof e.body?.userMessage === 'string' ? e.body.userMessage.trim() : '';
471
+ appGate.set(id, { state: 'ready', runnable: false, runState: 'uncompiled', missing: !locked, locked });
472
+ })
455
473
  .then(() => renderActiveSurfaces());
456
474
  }
457
475
  }