@floless/app 0.109.3 → 0.110.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.
@@ -2,7 +2,7 @@
2
2
  name: floless-app-steel-model
3
3
  description: The front-door guide for turning a structural steel drawing SET into an editable model in floless.app — the "Steel Model" flow. This skill orchestrates the whole pipeline — set up a project folder, learn the set into plain-English knowledge files, provision the right AWARE agents (region-specific steel detailer plus any bake targets), confirm which sheets are plans / elevations / details, then hand off to the Steel Takeoff reader to read each plan into a steel.takeoff/v1 contract — with explicit confirm gates between stages. Use it when a user wants to model steel from a drawing SET or asks things like "model this steel job from the drawings", "take off this whole set", "start a steel takeoff project", "turn these structural drawings into a model", "I have a PDF set of framing plans", or "/floless-app-steel-model". It is re-runnable — resume at any stage. For a single already-isolated framing plan the Steel Takeoff reader (floless-app-steel-takeoff) can be used directly; this guide is for driving a real job end to end.
4
4
  metadata:
5
- version: 0.2.0
5
+ version: 0.3.0
6
6
  ---
7
7
 
8
8
  # Steel Model — guide a steel drawing set into an editable model
@@ -162,7 +162,7 @@ the user at the editor:
162
162
  callouts, finish requirements). Carry them verbatim; they are not decoration, and floless surfaces
163
163
  them on every end that uses the detail.
164
164
 
165
- A row with a `recipe` is what lets a member end carrying that callout be **built** (issue #386). A row
165
+ A row with a `recipe` is what lets a member end carrying that callout be **built**. A row
166
166
  read from the drawing but whose schedule sheet was missing must be left WITHOUT a schedule and said so —
167
167
  an invented size band is worse than an end that honestly refuses to build.
168
168
  - **Bind callouts to member ends where the drawing shows it.** A detail bubble on a plan has a leader
@@ -182,6 +182,117 @@ to `~/.floless/exports/steel-model/steel-model-bom.{csv,xlsx}` automatically eve
182
182
  is Run** (two `file/write` export steps at the end of the chain). Tell the user they can **freeze**
183
183
  those export steps (right-click → Freeze) once the BOM is right, so a re-Run won't overwrite the files.
184
184
 
185
+ ### 7. Match each detail to a connection TYPE that models it — or refuse
186
+
187
+ **Before building anything from a detail, decide what KIND of connection it is, and confirm the tool you
188
+ are about to use actually models that kind.** A detail forced into the wrong type produces geometry that is
189
+ dimensionally perfect and physically nonsense — and it renders, and it *exports*.
190
+
191
+ The tell is never in the numbers. It is in the **topology**: what is welded to what, what laps what, which
192
+ member is supported and which is supporting. Ask, per detail:
193
+
194
+ - **What does the plate attach to, and where on it?** Welded to a supporting member's *web* is a different
195
+ connection from welded to its *face* — the two anchor points can be tens of millimetres apart, and a tool
196
+ built for one will place the plate nowhere near the other.
197
+ - **How many plies, and on which sides?** One plate lapping a member is not the same connection as a plate
198
+ **each side** with the member between them in double shear — different part count, different bolt grip.
199
+ - **Which member gets cut, and back to what?** A member meeting a wide face needs far more setback than one
200
+ meeting a thin web, and the amount grows with the skew of the crossing.
201
+ - **What does the detail dimension that the type cannot hold?** A work-point drop, a plate that follows the
202
+ supporting member's depth, a fabrication note. Anything unexpressible must be recorded, not dropped.
203
+
204
+ **If no available type matches, STOP and say so.** An honest "this connection type does not exist yet" is
205
+ worth more than an approximation: a connection attached to nothing looks plausible in the model, passes
206
+ every dimensional check, and is worse than an absent one because nobody knows to question it.
207
+
208
+ **Signals you are forcing a fit** — any one of these means stop and re-examine the type, not the numbers:
209
+
210
+ - you set a parameter to a value the drawing never states, so that some *other* number comes out right;
211
+ - the "supporting" member you must name is not the member the detail says the plate is welded to;
212
+ - the connection builds, but you cannot point at the two faces that bear on each other;
213
+ - each fix makes one dimension correct and leaves the assembly wrong — the surest sign the *type* is wrong.
214
+
215
+ ### 8. Check every built connection for CLASH and exact placement — every time
216
+
217
+ **A connection that matches every dimension on its detail can still be unbuildable.** Size fidelity and
218
+ *fit* are two different questions, and passing the first tells you nothing about the second. Ask both,
219
+ on every detail you build — not once at the end.
220
+
221
+ The failure this exists to stop: a gusset reproduced its drawing to a thousandth of an inch — plate
222
+ thickness, bolt diameter, gauge, edge distance, weld leg, all exact — while the plate ran **through** the
223
+ angle leg, the nut floated inside the member instead of bearing on its far face, and the bolt was sized
224
+ from a grip that counted only the plate. Every number checked out. Nothing touched.
225
+
226
+ **After building a connection, verify each of these — numerically, in world coordinates:**
227
+
228
+ - **Bearing faces meet: zero overlap, zero gap.** A lapped plate's inner face sits ON the *actual face* of
229
+ the ply it laps — a real surface of the real section, never a nominal, a default or zero. Careful here:
230
+ a symmetric web straddles the member's centre, so its two faces sit half a thickness either side — but
231
+ an angle's leg or a channel's web lies **entirely to one side**, and its two faces are not mirror images
232
+ of each other. "Half the thickness from the centre" is a special case, not the rule; find the face.
233
+ - **Nothing interpenetrates** — no connection part inside a member, no part inside another part.
234
+ - **Fasteners bear on real faces.** Head on the outer ply, nut on the far ply's actual face — never on a
235
+ work plane or a centroidal axis.
236
+ - **Grip = the plies actually clamped**, so the bolt length that falls out of it is right. A grip that
237
+ omits a ply yields a short bolt, and the drawing will never tell you.
238
+ - **Welds lie on the joint line the detail draws them on**, not merely at the right leg size.
239
+
240
+ **Check WHICH face, not just how far.** A connection can be the right size, the right distance from the
241
+ member's centre, and still be attached to the wrong part of it — or to nothing. Name the exact face the
242
+ plate bears on and prove the plate is on it:
243
+
244
+ - **The bearing ply must present a BROAD face to the plate** — the leg or web that runs alongside it. A
245
+ section usually has another part that is only edge-on (an angle's other leg is a few millimetres of
246
+ tip); landing on that, or on the air beside it, measures identically to landing correctly.
247
+ - **The bearing ply must cover the connection's full height.** If the plate is taller than the ply it
248
+ bears on, part of it is unsupported — a check that catches "right face, wrong extent".
249
+ - **Signs matter and hide.** A section is drawn in its own axes and then ROLLED to sit in the model, so
250
+ which way a face points depends on that roll. Get the sign wrong and the part lands on the far side of
251
+ the member — with every dimension, distance and thickness still perfect. Derive the mapping from the
252
+ code that actually places the geometry; do not reason it out.
253
+
254
+ **Do BOTH — measure it AND look at it. They catch different failures.**
255
+
256
+ - **Measure** what the eye cannot see: a few millimetres of overlap is invisible at any sensible zoom, so
257
+ contact, grip and bearing have to be computed and compared, never judged from a picture.
258
+ - **Look** at what the numbers do not flag: **zoom in on the built connection every time**. A dimension
259
+ table cannot tell you a plate is absurd for the member it sits on — a 15" plate on a 4" angle reads as
260
+ "plate depth 15.0", perfectly correct against the drawing it was copied from, and is obviously wrong
261
+ the instant you see it. Gross proportion and placement errors are found by eye in one second and can
262
+ survive every numeric check you write.
263
+
264
+ Passing one is not passing the other. A connection is right when the numbers *and* the picture agree.
265
+
266
+ **A check that reuses the thing it is checking proves nothing.** If the measurement repeats the same
267
+ assumption the geometry was built on, it will confirm a wrong answer with impressive precision — a bolt
268
+ "passing through" a leg that it actually misses, because both the code and the check placed that leg the
269
+ same wrong way. Derive the check from an INDEPENDENT source: the renderer's own transform, the drawing,
270
+ the section tables — something that does not share the suspect assumption. When a check and a drawing
271
+ disagree, the drawing wins.
272
+
273
+ **Check the whole assembly, not only the connection.** A connection can be perfect while the members it
274
+ joins are wrong: a brace that runs into the beam it frames into, a member never cut back from the support
275
+ it lands on. Member ends are usually placed at WORK POINTS, which sit on the support's centreline — deep
276
+ inside it — so a member must be trimmed back to the support's actual face plus its erection gap, and that
277
+ distance grows with the skew of the crossing. Verify the trim, not just the joint.
278
+
279
+ **Where this class of bug hides: nominal-vs-real section data.** A designation carries its thickness
280
+ (an angle's leg, a tube's wall) and that token is easy to drop on the way to geometry — leaving a guessed
281
+ or zero thickness behind, which silently misplaces everything that references it. If a placement depends
282
+ on a member's thickness, confirm that thickness came from the designation rather than an assumption.
283
+
284
+ **Never carry a dimension across from the member the detail happens to be DRAWN against.** A typical
285
+ detail is drawn on a representative member, and some of what it shows belongs to *that* member rather
286
+ than to the connection: a gusset drawn filling a beam's clear web depth is sized by that beam, not by the
287
+ rule. Copy it onto a different member and you get a plate several times its host. **Only transfer what
288
+ the detail actually DIMENSIONS.** For anything it merely draws, derive the value from a rule it does
289
+ state — a single bolt row with "1 1/2" TYP" edge distance gives a 3" deep plate — or leave it to the
290
+ engine's own derivation and say in the notes that the detail never dimensioned it.
291
+
292
+ **Report what does not fit, in the connection's `notes[]`, in the same breath as reporting the
293
+ dimensions.** "Every dimension matches" is a misleading statement on its own; a user detailing real steel
294
+ needs to know what bears and what does not.
295
+
185
296
  ---
186
297
 
187
298
  ## Guardrails
@@ -200,3 +311,7 @@ those export steps (right-click → Freeze) once the BOM is right, so a re-Run w
200
311
  - **Tekla (or any platform) component INSERTION at bake is deferred** — the connection library +
201
312
  per-end references + scoring are editor-verifiable today; native component placement is a later,
202
313
  Tekla-gated step. Don't promise it.
314
+ - **Never report a connection as done on its dimensions alone.** Stages 7-8 are not an optional last pass:
315
+ clash and exact placement are checked on *every* detail built, and whatever does not bear is said out
316
+ loud. This is detailing — "the numbers match" is not the same claim as "it fits", and only one of them
317
+ is what the user is actually asking for.
package/dist/web/app.css CHANGED
@@ -3101,7 +3101,36 @@ body {
3101
3101
  border-top: 1px solid var(--border);
3102
3102
  border-bottom: 1px solid var(--border);
3103
3103
  }
3104
- .relnotes-actions { padding: 12px 16px; display: flex; gap: 8px; align-items: center; }
3104
+ /* This is a scroll container (max-height + overflow-y), so it needs the dark scrollbar like every
3105
+ other one — an unthemed one renders the native white bar straight through the dark theme. It had
3106
+ none; caught while adding the note block below, which makes the popover taller and so more likely
3107
+ to scroll. Same treatment as .fm-note above. */
3108
+ .relnotes-body { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
3109
+ .relnotes-body::-webkit-scrollbar { width: 9px; }
3110
+ .relnotes-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
3111
+ .relnotes-body::-webkit-scrollbar-track { background: transparent; }
3112
+
3113
+ /* Why this build can't update itself, shown for the channels that cannot self-apply. Sits between
3114
+ the header and the notes body so the async notes fetch (which replaces .relnotes-body) can never
3115
+ wipe it — the instruction has to outlive the request that failed or lagged. */
3116
+ .relnotes-note {
3117
+ padding: 10px 16px 12px;
3118
+ font-size: 12px;
3119
+ line-height: 1.45;
3120
+ color: var(--text-muted);
3121
+ }
3122
+ .relnotes-note code {
3123
+ font-family: var(--mono);
3124
+ font-size: 11px;
3125
+ color: var(--text);
3126
+ background: var(--bg);
3127
+ border: 1px solid var(--border);
3128
+ border-radius: 4px;
3129
+ padding: 1px 5px;
3130
+ /* A command is the one thing here the user must be able to read in full and select by hand. */
3131
+ word-break: break-all;
3132
+ }
3133
+ .relnotes-actions { padding: 12px 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
3105
3134
 
3106
3135
  /* Typed change bullets — REUSED verbatim by the what's-new panel (one renderer). */
3107
3136
  .relnotes-group { margin-bottom: 12px; }
@@ -3176,7 +3205,28 @@ body {
3176
3205
  transition: background 0.15s, border-color 0.15s, color 0.15s;
3177
3206
  }
3178
3207
  .relnotes-changelog:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-muted); }
3208
+
3209
+ /* Same shape as .relnotes-changelog, one step brighter because it is the RECOMMENDED way out of
3210
+ the no-self-update state, while "Full changelog" is incidental.
3211
+ Not optional styling: without it the anchor rendered at the browser's default #0000EE against
3212
+ the dark theme — caught in the browser pass, and exactly the "no browser default may leak
3213
+ through" rule. It also does NOT take `margin-left:auto`; that belongs to the changelog link
3214
+ alone, which must stay pushed to the right edge as the trailing item. */
3215
+ .relnotes-desktop {
3216
+ background: transparent;
3217
+ border: 1px solid transparent;
3218
+ color: var(--text-muted);
3219
+ padding: 7px 10px;
3220
+ border-radius: 4px;
3221
+ font-size: 12px;
3222
+ text-decoration: none;
3223
+ cursor: pointer;
3224
+ white-space: nowrap;
3225
+ transition: background 0.15s, border-color 0.15s, color 0.15s;
3226
+ }
3227
+ .relnotes-desktop:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
3179
3228
  .relnotes-update:focus-visible,
3229
+ .relnotes-desktop:focus-visible,
3180
3230
  .relnotes-changelog:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
3181
3231
 
3182
3232
  /* Either footer version label becomes a notes affordance once its changelog resolves
package/dist/web/aware.js CHANGED
@@ -4191,7 +4191,9 @@
4191
4191
  if (_notesEscHandler) { document.removeEventListener('keydown', _notesEscHandler, true); _notesEscHandler = null; }
4192
4192
  if (_notesOutsideHandler) { document.removeEventListener('mousedown', _notesOutsideHandler, true); _notesOutsideHandler = null; }
4193
4193
  if (_notesOriginEl && _notesOriginEl !== anchorEl) { _notesOriginEl.setAttribute('aria-expanded', 'false'); _notesOriginEl.removeAttribute('aria-controls'); }
4194
- const compLabel = component === 'aware' ? 'AWARE' : 'floless.app';
4194
+ // "FloLess", never "floless.app" — the product name is the brand; the domain is internal-only
4195
+ // and must not appear in the UI. This string is the popover's visible title AND its aria-label.
4196
+ const compLabel = component === 'aware' ? 'AWARE' : 'FloLess';
4195
4197
  $notesPopover.setAttribute('aria-label', compLabel + ' v' + version + ' release notes');
4196
4198
 
4197
4199
  // Build the "full notes" link, component-aware:
@@ -4214,10 +4216,81 @@
4214
4216
  + `<div class="relnotes-actions">${updateHtml}${changelogHtml}</div>`;
4215
4217
  $notesPopover.hidden = false;
4216
4218
 
4219
+ // ── Channels that cannot self-apply ──────────────────────────────────────────────────────────
4220
+ // Only the desktop (Velopack) build owns Update.exe. The pill carries the server's answer; an
4221
+ // absent value (the AWARE pill) leaves everything below untouched.
4222
+ //
4223
+ // Built with DOM calls and textContent rather than more innerHTML: the command string is the one
4224
+ // piece of server-supplied text rendered here, and textContent cannot be parsed as markup at all.
4225
+ const ds = (anchorEl && anchorEl.dataset) || {};
4226
+ const chan = ds.channel || '';
4227
+ const cannotSelfApply = !!onUpdate && chan !== '' && chan !== 'desktop';
4228
+ const cmdText = ds.command || 'npm i -g @floless/app@latest';
4229
+ // Windows-only, because the desktop build is Windows-only. HIDDEN when unavailable rather than
4230
+ // shown-disabled, per the app's "hide, never show a dead control" rule — offering a download that
4231
+ // does not exist for your OS would repeat the very defect this fixes.
4232
+ const offerDesktop = cannotSelfApply && !!ds.desktop && !!webBase;
4233
+
4234
+ if (cannotSelfApply) {
4235
+ // The explanation belongs HERE, not in a toast: a toast is textContent-only (so it cannot carry
4236
+ // the download link) and auto-dismisses, which is no vessel for an instruction to act on. This
4237
+ // sits between header and body, so the async notes fetch — which replaces .relnotes-body — can
4238
+ // never wipe it, and it stays readable while the user goes and runs the command.
4239
+ const note = document.createElement('div');
4240
+ note.className = 'relnotes-note';
4241
+ const code = document.createElement('code');
4242
+ code.textContent = cmdText;
4243
+ if (ds.transient) {
4244
+ // "close it and open it again", never "restart": the stale code is in the background service,
4245
+ // so refreshing the page — the obvious reading of "restart" inside a browser — changes nothing.
4246
+ note.append('This copy of FloLess is temporary (it was started with ');
4247
+ const npx = document.createElement('code'); npx.textContent = 'npx';
4248
+ note.append(npx, '), so it can’t update itself. ',
4249
+ offerDesktop ? 'Get the desktop app for one-click updates from now on, or run ' : 'Run ',
4250
+ code, ' to make it a permanent install — then close FloLess and open it again.');
4251
+ } else {
4252
+ note.append('This build updates from your terminal. Run ', code,
4253
+ ', then close FloLess and open it again.'
4254
+ + (offerDesktop ? ' Or get the desktop app to update in one click from now on.' : ''));
4255
+ }
4256
+ $notesPopover.querySelector('.relnotes-header').insertAdjacentElement('afterend', note);
4257
+
4258
+ // Label the button for what it ACTUALLY does. "Update now" on a build that cannot update itself
4259
+ // is the reported defect: it was clicked, a command flashed past, nothing updated, and the pill
4260
+ // kept asking. A control may only promise what its channel can deliver.
4261
+ const $btn = $notesPopover.querySelector('.relnotes-update');
4262
+ if ($btn) $btn.textContent = 'Copy update command';
4263
+
4264
+ if (offerDesktop) {
4265
+ // A real anchor, so ctrl/middle-click and copy-link-address behave — not a button faking one.
4266
+ const a = document.createElement('a');
4267
+ a.className = 'relnotes-desktop';
4268
+ a.target = '_blank';
4269
+ a.rel = 'noopener';
4270
+ // `/dashboard/download`, NOT `/download` — the site is a Vite SPA whose only download route is
4271
+ // nested under the authenticated /dashboard, so `/download` falls through to its catch-all
4272
+ // 404. Review caught this, and it is worth spelling out WHY it slipped: a plain HTTP check
4273
+ // "verified" `/download` as 200, but an SPA serves index.html for every path and renders the
4274
+ // 404 client-side, so a status code proves nothing here. Sign-in is an acceptable bounce —
4275
+ // every FloLess user has an account (the app is seat-licensed) — and this is the page that
4276
+ // actually serves the installer.
4277
+ a.href = webBase + '/dashboard/download';
4278
+ a.textContent = 'Get the desktop app ↗';
4279
+ a.setAttribute('data-tip', 'One-click updates from then on — no terminal needed');
4280
+ const actions = $notesPopover.querySelector('.relnotes-actions');
4281
+ if (actions) actions.insertBefore(a, actions.querySelector('.relnotes-changelog'));
4282
+ }
4283
+ }
4284
+
4217
4285
  // Wire Update now — it never waits on the notes fetch.
4218
4286
  const $update = $notesPopover.querySelector('.relnotes-update');
4219
4287
  if ($update && onUpdate) {
4220
- $update.onclick = () => { closeNotesPopover(); onUpdate(version); };
4288
+ // Deliberately does NOT close for a copy-only channel: the toast alone cannot carry the whole
4289
+ // instruction, so the note must stay on screen while the user acts on it. Closing is right for
4290
+ // the desktop path, where the click really does start the update.
4291
+ $update.onclick = cannotSelfApply
4292
+ ? () => { onUpdate(version); }
4293
+ : () => { closeNotesPopover(); onUpdate(version); };
4221
4294
  }
4222
4295
 
4223
4296
  // Position relative to the anchor: hang above it (footer is at the bottom), and
@@ -4234,7 +4307,9 @@
4234
4307
  try { $notesPopover.focus(); } catch { /* container is tabindex=-1 */ }
4235
4308
 
4236
4309
  // Tab cycles only the (up to 2) action controls; Escape closes + restores focus.
4237
- const focusables = () => Array.from($notesPopover.querySelectorAll('.relnotes-update, .relnotes-changelog'));
4310
+ // `.relnotes-desktop` is in the list or the Tab cycle would skip a control that is reachable by
4311
+ // mouse — keyboard users would never get to the download link.
4312
+ const focusables = () => Array.from($notesPopover.querySelectorAll('.relnotes-update, .relnotes-desktop, .relnotes-changelog'));
4238
4313
  _notesEscHandler = (e) => {
4239
4314
  if (e.key === 'Escape') { e.preventDefault(); closeNotesPopover(); return; }
4240
4315
  if (e.key === 'Tab') {
@@ -4405,12 +4480,27 @@
4405
4480
  // branch verbatim: npm copies the command; desktop confirms → relaunch.
4406
4481
  async function applyAppUpdate(version) {
4407
4482
  if (!$appUpdate) return;
4408
- // npm channel can't self-apply (no Update.exe) — copy the command for the user's terminal.
4409
- if ($appUpdate.dataset.channel === 'npm') {
4483
+ // ONLY the desktop (Velopack) build can self-apply — it is the one with Update.exe. Everything
4484
+ // else copies a command for the user's terminal.
4485
+ //
4486
+ // Tested as "is it desktop" rather than the old "is it npm", and that inversion is the fix, not
4487
+ // a tidy-up: adding the npx channel made an `=== 'npm'` test fall through to the Velopack path,
4488
+ // so a build with no Update.exe would have tried to self-update and failed. Naming the ONE
4489
+ // channel that CAN self-apply fails safe for every channel, including ones added later.
4490
+ if ($appUpdate.dataset.channel !== 'desktop') {
4410
4491
  const cmd = $appUpdate.dataset.command || 'npm i -g @floless/app@latest';
4411
- // Best-effort copy — fire-and-forget so the toast never blocks on clipboard permission.
4412
- if (navigator.clipboard) navigator.clipboard.writeText(cmd).catch(() => {});
4413
- showToast('Update in your terminal — ' + cmd, 'info');
4492
+ // The toast is now a CONFIRMATION — the popover note carries the actual instruction — so it
4493
+ // must report what really happened. It used to claim the command was copied unconditionally,
4494
+ // including when navigator.clipboard was absent (no copy attempted) or the write rejected. If
4495
+ // the copy did not happen, the toast has to show the command AND stay put ('warn' lingers with
4496
+ // a dismiss ×; 'ok' auto-dismisses in 2.5s) so it can still be selected by hand.
4497
+ const copied = () => showToast('Copied — run it in your terminal, then close FloLess and open it again.', 'ok');
4498
+ const failed = () => showToast('Couldn’t copy automatically — run this in your terminal, then close FloLess and open it again: ' + cmd, 'warn');
4499
+ if (navigator.clipboard && navigator.clipboard.writeText) {
4500
+ navigator.clipboard.writeText(cmd).then(copied, failed);
4501
+ } else {
4502
+ failed();
4503
+ }
4414
4504
  return;
4415
4505
  }
4416
4506
  // desktop (Velopack): one-click download + relaunch. Refuse to start while another
@@ -4460,10 +4550,19 @@
4460
4550
  const r = await fetch('/api/update');
4461
4551
  const d = await r.json();
4462
4552
  if (r.ok && d.supported && d.updateAvailable && d.targetVersion) {
4463
- const npm = d.channel === 'npm';
4553
+ // Same inversion as applyAppUpdate: carry the command for every channel that CANNOT
4554
+ // self-apply, so a new channel never silently loses its instructions.
4555
+ const selfApply = d.channel === 'desktop';
4464
4556
  $appUpdate.textContent = '↑ Update to v' + d.targetVersion;
4465
4557
  $appUpdate.dataset.channel = d.channel || 'desktop';
4466
- $appUpdate.dataset.command = (npm && d.command) ? d.command : '';
4558
+ $appUpdate.dataset.command = (!selfApply && d.command) ? d.command : '';
4559
+ // npx: the running copy lives in a throwaway cache, so the command needs a restart to take
4560
+ // effect. Empty string (not "0") when absent — dataset values are strings and any non-empty
4561
+ // one is truthy, which is exactly how applyAppUpdate reads it.
4562
+ $appUpdate.dataset.transient = d.transient ? '1' : '';
4563
+ // Whether a desktop build exists for THIS OS (Windows-only today) — the popover only offers
4564
+ // the download when it does, so no one is sent after a build that isn't made for them.
4565
+ $appUpdate.dataset.desktop = d.desktopAvailable ? '1' : '';
4467
4566
  $appUpdate.dataset.target = d.targetVersion;
4468
4567
  $appUpdate.dataset.tip = "What's new in v" + d.targetVersion;
4469
4568
  $appUpdate.setAttribute('aria-haspopup', 'dialog');
@@ -4592,7 +4691,22 @@
4592
4691
  pillEl.dataset.tip = "What's new in v" + v;
4593
4692
  pillEl.setAttribute('aria-haspopup', 'dialog');
4594
4693
  if (component === 'aware') { pillEl.textContent = '↑ Upgrade AWARE to v' + v; }
4595
- else { pillEl.textContent = '↑ Update to v' + v; pillEl.dataset.channel = pillEl.dataset.channel || 'desktop'; }
4694
+ else {
4695
+ pillEl.textContent = '↑ Update to v' + v;
4696
+ // The override may now name a CHANNEL, and it is read before the 'desktop' default. This path
4697
+ // runs only when the real poll found nothing, so `dataset.channel` is unset — meaning an
4698
+ // npm/npx/dev build with the flag set used to be forced to 'desktop', sending it down the
4699
+ // Velopack self-apply path that has no Update.exe. That is the last route into the branch this
4700
+ // change exists to close, and worse for a test harness: an E2E driving the popover through this
4701
+ // flag silently exercised the DESKTOP variant whatever the build under test, so it could report
4702
+ // confidence about branches it never touched.
4703
+ pillEl.dataset.channel = forced.channel || pillEl.dataset.channel || 'desktop';
4704
+ if (forced.channel && forced.channel !== 'desktop') {
4705
+ pillEl.dataset.command = forced.command || 'npm i -g @floless/app@latest';
4706
+ pillEl.dataset.transient = forced.transient ? '1' : '';
4707
+ pillEl.dataset.desktop = forced.desktopAvailable ? '1' : '';
4708
+ }
4709
+ }
4596
4710
  pillEl.hidden = false;
4597
4711
  return true;
4598
4712
  }
@@ -329,22 +329,35 @@ function shapeOf(el) {
329
329
  if (/^(HSS|PIPE|TS|SHS|RHS|CHS|TUBE|HSQ)/.test(p)) return 'TUBE'; // hollow tube
330
330
  return 'BOX';
331
331
  }
332
- function profileShape(kind, w, d) {
332
+ // A real thickness off the element's `xsection` (AISC table / designation) when there is one and it fits
333
+ // inside the section, else null so the caller keeps its estimate. The fit check matters: a metric
334
+ // designation's thickness token is parsed as inches, which would draw a leg thicker than the whole angle.
335
+ function realThk(xs, key, half) {
336
+ const t = xs && typeof xs[key] === 'number' ? xs[key] : null;
337
+ return t != null && t > 0 && t < 2 * half ? t : null;
338
+ }
339
+ // `xs` is the scene element's `xsection`. Without it every thickness here is a GUESS off the envelope —
340
+ // an L4X4 leg came out 18.3mm against a real 9.5, so a connection bearing on the real face rendered buried
341
+ // in a member that was drawn nearly twice too thick. The estimates remain as the fallback for sections we
342
+ // have no data for; they are the reason a member can still be drawn at all.
343
+ function profileShape(kind, w, d, xs) {
333
344
  const s = new THREE.Shape(), hw = w / 2, hd = d / 2;
334
345
  if (kind === 'I') {
335
- const tf = Math.min(d * 0.5, Math.max(d * 0.10, 6)), tw = Math.min(w * 0.5, Math.max(w * 0.10, 5));
346
+ const tf = realThk(xs, 'tf', hd) ?? Math.min(d * 0.5, Math.max(d * 0.10, 6));
347
+ const tw = realThk(xs, 'tw', hw) ?? Math.min(w * 0.5, Math.max(w * 0.10, 5));
336
348
  s.moveTo(-hw, -hd); s.lineTo(hw, -hd); s.lineTo(hw, -hd + tf); s.lineTo(tw / 2, -hd + tf);
337
349
  s.lineTo(tw / 2, hd - tf); s.lineTo(hw, hd - tf); s.lineTo(hw, hd); s.lineTo(-hw, hd);
338
350
  s.lineTo(-hw, hd - tf); s.lineTo(-tw / 2, hd - tf); s.lineTo(-tw / 2, -hd + tf); s.lineTo(-hw, -hd + tf); s.closePath();
339
351
  } else if (kind === 'C') {
340
- const tf = Math.max(d * 0.10, 5), tw = Math.max(w * 0.12, 5);
352
+ const tf = realThk(xs, 'tf', hd) ?? Math.max(d * 0.10, 5);
353
+ const tw = realThk(xs, 'tw', hw) ?? Math.max(w * 0.12, 5);
341
354
  s.moveTo(-hw, -hd); s.lineTo(hw, -hd); s.lineTo(hw, -hd + tf); s.lineTo(-hw + tw, -hd + tf);
342
355
  s.lineTo(-hw + tw, hd - tf); s.lineTo(hw, hd - tf); s.lineTo(hw, hd); s.lineTo(-hw, hd); s.closePath();
343
356
  } else if (kind === 'L') {
344
- const t = Math.max(Math.min(w, d) * 0.18, 5);
357
+ const t = realThk(xs, 't', Math.min(hw, hd)) ?? Math.max(Math.min(w, d) * 0.18, 5);
345
358
  s.moveTo(-hw, -hd); s.lineTo(hw, -hd); s.lineTo(hw, -hd + t); s.lineTo(-hw + t, -hd + t); s.lineTo(-hw + t, hd); s.lineTo(-hw, hd); s.closePath();
346
359
  } else if (kind === 'TUBE') {
347
- const t = Math.max(Math.min(w, d) * 0.12, 4);
360
+ const t = realThk(xs, 't', Math.min(hw, hd)) ?? Math.max(Math.min(w, d) * 0.12, 4);
348
361
  s.moveTo(-hw, -hd); s.lineTo(hw, -hd); s.lineTo(hw, hd); s.lineTo(-hw, hd); s.closePath();
349
362
  const h = new THREE.Path(); h.moveTo(-hw + t, -hd + t); h.lineTo(hw - t, -hd + t); h.lineTo(hw - t, hd - t); h.lineTo(-hw + t, hd - t); h.closePath(); s.holes.push(h);
350
363
  } else { s.moveTo(-hw, -hd); s.lineTo(hw, -hd); s.lineTo(hw, hd); s.lineTo(-hw, hd); s.closePath(); }
@@ -353,7 +366,7 @@ function profileShape(kind, w, d) {
353
366
  function memberGeom(el, w, d, len) {
354
367
  const kind = shapeOf(el);
355
368
  if (kind === 'BOX') return new THREE.BoxGeometry(w, len, d); // length on local Y
356
- const g = new THREE.ExtrudeGeometry(profileShape(kind, w, d), { depth: len, bevelEnabled: false });
369
+ const g = new THREE.ExtrudeGeometry(profileShape(kind, w, d, el && el.xsection), { depth: len, bevelEnabled: false });
357
370
  g.translate(0, 0, -len / 2); return g; // extruded +Z, centred
358
371
  }
359
372
  const _ZA = new THREE.Vector3(0, 0, 1), _YA = new THREE.Vector3(0, 1, 0);
package/launch.mjs CHANGED
@@ -46,18 +46,25 @@ function ping() {
46
46
  });
47
47
  }
48
48
 
49
- // Probe the running server's build version via /api/health (it returns appVersion — the
50
- // installed build, "so it's scriptable"). Returns null when unreachable, non-JSON, or not
51
- // a floless server — in which case we never touch it.
52
- function probeVersion() {
49
+ // Probe the running server via /api/health for what it says about itself: its build version
50
+ // (appVersion — the installed build, "so it's scriptable") AND its distribution channel. Either is
51
+ // null when unreachable, non-JSON, or not a floless server — in which case we never touch it.
52
+ // `channel` is additionally null on builds older than the field, which shouldTakeOver reads as
53
+ // "cannot identify, do not evict".
54
+ function probeRunning() {
53
55
  return new Promise((resolve) => {
54
56
  const req = http.get(HEALTH_URL, { timeout: 1500 }, (res) => {
55
57
  let body = '';
56
58
  res.on('data', (c) => { body += c; });
57
- res.on('end', () => { try { resolve(JSON.parse(body).appVersion || null); } catch { resolve(null); } });
59
+ res.on('end', () => {
60
+ try {
61
+ const j = JSON.parse(body);
62
+ resolve({ version: j.appVersion || null, channel: j.appChannel || null });
63
+ } catch { resolve({ version: null, channel: null }); }
64
+ });
58
65
  });
59
- req.on('error', () => resolve(null));
60
- req.on('timeout', () => { req.destroy(); resolve(null); });
66
+ req.on('error', () => resolve({ version: null, channel: null }));
67
+ req.on('timeout', () => { req.destroy(); resolve({ version: null, channel: null }); });
61
68
  });
62
69
  }
63
70
 
@@ -74,14 +81,37 @@ export function cmpVersion(a, b) {
74
81
 
75
82
  // "Newest wins": take over the port ONLY when a known-older floless.app build is serving it
76
83
  // AND we know our own version — never kill an unknown/non-floless server, never downgrade.
77
- export function shouldTakeOver(runningVersion, selfVersion) {
84
+ //
85
+ // …plus a tie-break on CHANNEL, because equal version numbers do not mean equal builds. Reported
86
+ // from a real machine: an `npx` copy held the port, the user launched the installed desktop app at
87
+ // the SAME version, this returned false, and the launcher opened a browser onto the npx instance —
88
+ // a build with no Update.exe, so his one-click update turned into a terminal command he could not
89
+ // use. Only the desktop build can self-update, so on a tie it takes over one that cannot.
90
+ //
91
+ // Deliberately conservative in two ways. Only a channel we POSITIVELY RECOGNISE as unable to
92
+ // self-update may be evicted: an older build whose /api/health predates the field reports none, and
93
+ // an unrecognised value (a future or malformed channel) is no more identifiable than a missing one —
94
+ // so both are left alone. "Never kill a server we cannot identify" outranks fixing the tie, and an
95
+ // allow-list keeps that true as channels are added, where a "not desktop" test would silently start
96
+ // evicting each new one. And desktop-over-desktop stays false, so the common double-click of an
97
+ // already-running app is still a no-op instead of a pointless kill-and-restart.
98
+ //
99
+ // `channels` is optional so the version-only contract above is unchanged for every caller that
100
+ // cannot see a channel.
101
+ const EVICTABLE_CHANNELS = new Set(['npm', 'npx', 'dev']); // every build with no Update.exe
102
+
103
+ export function shouldTakeOver(runningVersion, selfVersion, channels = {}) {
78
104
  if (!runningVersion || !selfVersion) return false;
79
- return cmpVersion(selfVersion, runningVersion) > 0;
105
+ const cmp = cmpVersion(selfVersion, runningVersion);
106
+ if (cmp !== 0) return cmp > 0; // strictly newer wins; strictly older never downgrades
107
+ const { running = null, self = null } = channels;
108
+ return self === 'desktop' && EVICTABLE_CHANNELS.has(running);
80
109
  }
81
110
 
82
- // This launcher's own build version (set by runAction from the dispatcher), so cmdOpen can
83
- // compare against whatever is already serving the port.
111
+ // This launcher's own build version + channel (set by runAction from the dispatcher), so cmdOpen can
112
+ // compare against whatever is already serving the port. The channel decides ties the version cannot.
84
113
  let _selfVersion = null;
114
+ let _selfChannel = null;
85
115
 
86
116
  async function waitHealthy(timeoutMs = 30000) {
87
117
  const deadline = Date.now() + timeoutMs;
@@ -173,14 +203,17 @@ export async function cmdOpen() {
173
203
  // Something is already serving the port. If it's a DIFFERENT, OLDER floless.app build than
174
204
  // this one, take it over ("newest wins") so the version the user just launched is the one
175
205
  // they get — instead of silently opening the stale instance (e.g. a leftover dev server).
176
- const running = await probeVersion();
177
- if (shouldTakeOver(running, _selfVersion)) {
178
- log(`floless.app v${running} is already running on ${PORT}; this build is v${_selfVersion} — taking over`);
206
+ const running = await probeRunning();
207
+ if (shouldTakeOver(running.version, _selfVersion, { running: running.channel, self: _selfChannel })) {
208
+ // Name the CHANNELS, not just the versions: on a tie the version pair reads as "v0.5.0 taking
209
+ // over v0.5.0", which looks like a bug in the log unless it says which build won and why.
210
+ log(`floless.app v${running.version} (${running.channel ?? 'unknown'}) is already running on ${PORT}; `
211
+ + `this build is v${_selfVersion} (${_selfChannel ?? 'unknown'}) — taking over`);
179
212
  stopServer();
180
213
  await new Promise((r) => setTimeout(r, 500)); // let the OS release the port
181
214
  await ensureServerUp();
182
215
  } else {
183
- log(`already running${running ? ` (v${running})` : ''}`);
216
+ log(`already running${running.version ? ` (v${running.version}${running.channel ? `, ${running.channel}` : ''})` : ''}`);
184
217
  }
185
218
  } else {
186
219
  await ensureServerUp();
@@ -463,6 +496,19 @@ export function parseAction(arg) {
463
496
  // this is a deliberate no-op with the right instruction. The packaged exe never
464
497
  // reaches this: main.ts handles `update` before delegating to runAction.
465
498
  async function cmdUpdate() {
499
+ // An npx copy needs DIFFERENT words, and this is the likeliest place it gets asked: the user is
500
+ // already in a terminal. Telling them "this is the npm build" is false, and handing over the bare
501
+ // command reproduces the exact bug the UI now avoids — it installs a separate permanent copy while
502
+ // the copy they are running stays on the old version.
503
+ //
504
+ // The regex is `isNpxPath`'s, duplicated rather than imported ON PURPOSE: launch.mjs is the
505
+ // dependency-free launcher (Node built-ins only, no TS import of version.ts), which is why it also
506
+ // cannot ask appChannel(). Keep the two in step if the cache layout ever changes.
507
+ if (/(^|[\\/])_npx([\\/]|$)/.test(fileURLToPath(import.meta.url))) {
508
+ log('this copy is temporary (started with npx), so it cannot update itself');
509
+ log('install a permanent one with "npm i -g @floless/app@latest", then close FloLess and open it again');
510
+ return;
511
+ }
466
512
  log('this is the npm build — update it with "npm i -g @floless/app"');
467
513
  log('(the installer build self-updates via "floless-app update")');
468
514
  }
@@ -554,8 +600,9 @@ const ACTIONS = { open: cmdOpen, start: cmdStart, supervise: cmdSupervise, stop:
554
600
  // the packaged exe dispatcher (main.ts), so both surfaces behave identically. The
555
601
  // flag tail (argv.slice(3)) is parsed once here and passed to the action; every
556
602
  // existing action takes no params and simply ignores it (only `uninstall` reads it).
557
- export async function runAction(arg, flagArgv = [], selfVersion = null) {
603
+ export async function runAction(arg, flagArgv = [], selfVersion = null, selfChannel = null) {
558
604
  _selfVersion = selfVersion;
605
+ _selfChannel = selfChannel;
559
606
  const cmd = parseAction(arg);
560
607
  const action = ACTIONS[cmd];
561
608
  if (!action) { log(`unknown command "${cmd}" — use: open | start | supervise | stop | restart | login | update | uninstall`); process.exit(2); }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@floless/app",
3
- "version": "0.109.3",
3
+ "version": "0.110.0",
4
4
  "type": "module",
5
- "description": "Thin localhost host for floless.app — serves web/ and shells the aware CLI. No engine, no LLM.",
5
+ "description": "Thin localhost host for floless.app \u00e2\u20ac\u201d serves web/ and shells the aware CLI. No engine, no LLM.",
6
6
  "bin": {
7
7
  "floless-app": "bin/floless.mjs"
8
8
  },