@floless/app 0.113.4 → 0.113.6

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.
@@ -54472,7 +54472,7 @@ function appVersion() {
54472
54472
  return resolveVersion({
54473
54473
  isSea: isSea2(),
54474
54474
  sqVersionXml: readSqVersionXml(),
54475
- define: true ? "0.113.4" : void 0,
54475
+ define: true ? "0.113.6" : void 0,
54476
54476
  pkgVersion: readPkgVersion()
54477
54477
  });
54478
54478
  }
@@ -54488,7 +54488,7 @@ function resolveChannel(s) {
54488
54488
  function appChannel() {
54489
54489
  return resolveChannel({
54490
54490
  isSea: isSea2(),
54491
- define: true ? "0.113.4" : void 0,
54491
+ define: true ? "0.113.6" : void 0,
54492
54492
  // argv[1] is the entry the runtime actually loaded (…/dist/floless-server.cjs), which is what
54493
54493
  // carries the npx cache prefix. Absent under the SEA exe, which never reaches the npx branch.
54494
54494
  modulePath: process.argv[1]
@@ -2869,7 +2869,7 @@ const geoMode = () => (api && api.geoMode && api.geoMode()) || null;
2869
2869
  let workPlane = null; // {origin:[x,y,z]mm, normal, xAxis} | null
2870
2870
  let wpMode = null; // 'face' | '3pt' — armed set-plane pick mode
2871
2871
  let wpDraft = null; // 3pt picks collected so far
2872
- let wpVisible = true; // "Show plane" toggle (applies to an explicit plane)
2872
+ let wpVisible = (() => { try { return localStorage.getItem('steel:wpVisible:v1') === '1'; } catch { return false; } })(); // reference surface is opt-in; remember both on and off without changing the active plane
2873
2873
  let wpGroup = null;
2874
2874
  let wpExtent = null; // test-observability: the projected u/v footprint the last-rendered "Show plane" surface was sized to (null = fallback square)
2875
2875
  // ---- 3D local drawing frame (UCS, stage 1): a SEPARATE rotate-about-Z frame for skewed framing.
@@ -3211,7 +3211,7 @@ function setWorkPlanePrincipal(kind, offsetMm) {
3211
3211
  wpMode = null; wpDraft = null; invalidatePointEntry('drift'); renderWorkPlane(); reflectWpBar();
3212
3212
  }
3213
3213
  function clearWorkPlane() { workPlane = null; wpMode = null; wpDraft = null; invalidatePointEntry('drift'); renderWorkPlane(); reflectWpBar(); }
3214
- function toggleWorkPlaneVisible(on) { wpVisible = on === undefined ? !wpVisible : !!on; renderWorkPlane(); }
3214
+ function toggleWorkPlaneVisible(on) { wpVisible = on === undefined ? !wpVisible : !!on; try { localStorage.setItem('steel:wpVisible:v1', wpVisible ? '1' : '0'); } catch { /* storage can be unavailable; keep the session preference */ } renderWorkPlane(); }
3215
3215
  function workPlaneInfo() { return { set: !!workPlane, mode: wpMode, visible: wpVisible, plane: workPlane ? { origin: [...workPlane.origin], normal: [...workPlane.normal], xAxis: [...workPlane.xAxis] } : null }; }
3216
3216
  // face pick: the clip tool's raycast, minus the camera-side flip — the plane lands ON the face.
3217
3217
  function wpFacePick(cx, cy) {
@@ -9,8 +9,9 @@
9
9
  *::-webkit-scrollbar-thumb{background:#475569;border-radius:6px;border:2px solid transparent;background-clip:content-box}
10
10
  *::-webkit-scrollbar-thumb:hover{background:#5b6b85;background-clip:content-box}
11
11
  *::-webkit-scrollbar-corner{background:transparent}
12
- *{box-sizing:border-box} body{margin:0;background:var(--bg);color:var(--text);font:13px system-ui;height:100vh;display:flex;flex-direction:column}
13
- header{display:flex;align-items:center;gap:14px;padding:8px 14px;background:var(--panel);border-bottom:1px solid var(--line)}
12
+ *{box-sizing:border-box} html{width:100%;height:100%;overflow:hidden}
13
+ body{margin:0;background:var(--bg);color:var(--text);font:13px system-ui;width:100%;max-width:100%;height:100vh;overflow:hidden;display:flex;flex-direction:column}
14
+ header{display:flex;flex-wrap:wrap;align-items:center;gap:14px;min-width:0;max-width:100%;padding:8px 14px;background:var(--panel);border-bottom:1px solid var(--line)}
14
15
  header b{font-size:14px} .stat{color:var(--mut)} .stat b{color:var(--text)}
15
16
  header .tb-sep{width:1px;height:20px;background:var(--line);flex:0 0 auto;align-self:center} /* thin divider grouping the header action clusters (history | tools | AI | more) */
16
17
  #dim3dWrap{gap:8px} /* 3D Dimension cluster in the header — display flips inline-flex/none by view (applyViewState) */
@@ -34,7 +35,7 @@
34
35
  body.model-ro:not(.v3d) #ro2d{display:flex}
35
36
  #ro2d b{color:var(--text);font-size:14px}
36
37
  #ro2d p{margin:0;max-width:44ch;line-height:1.5}
37
- main{flex:1;display:flex;min-height:0}
38
+ main{flex:1;display:flex;min-width:0;min-height:0;width:100%;max-width:100%;overflow:hidden;position:relative}
38
39
  #stagewrap{flex:1;position:relative;min-width:0;display:flex}
39
40
  #stage{flex:1;overflow:auto;background:#0b1220;display:flex;align-items:safe center;justify-content:safe center}
40
41
  svg{display:block;touch-action:none;flex:none}
@@ -63,6 +64,11 @@
63
64
  #panelResizer::before{content:"";position:absolute;inset:0 3px;border-radius:2px;transition:background-color .12s}
64
65
  #panelResizer:hover::before,#panelResizer.drag::before{background:var(--brand)}
65
66
  #panelResizer:focus-visible{outline:none} #panelResizer:focus-visible::before{background:var(--brand)}
67
+ #panelToggle{position:absolute;right:calc(var(--panelw,240px) - 14px);top:50%;transform:translateY(-50%);z-index:12;width:28px;height:42px;padding:0;display:flex;align-items:center;justify-content:center;background:var(--panel);border-color:var(--line);box-shadow:0 4px 14px rgba(0,0,0,.45);font-size:18px;line-height:1}
68
+ #panelToggle:hover{border-color:var(--brand)}
69
+ #panelToggle:focus-visible,#m3dLegendCollapse:focus-visible,#m3dLegendLauncher:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
70
+ body.panel-collapsed #panel,body.panel-collapsed #panelResizer{display:none}
71
+ body.panel-collapsed #panelToggle{right:4px}
66
72
  aside h3{margin:0 0 8px;font-size:12px;color:var(--mut);text-transform:uppercase;letter-spacing:.05em}
67
73
  select,input{background:#0f172a;color:var(--text);border:1px solid #475569;border-radius:6px;padding:6px;width:100%;font:13px system-ui}
68
74
  .row{margin:8px 0} .danger{background:#7f1d1d;border-color:#991b1b} .danger:hover{background:#991b1b}
@@ -596,7 +602,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
596
602
  circle.handle.ep-end{fill:#f472b6;stroke:#0b1220;stroke-width:2}
597
603
  .epdot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px;vertical-align:middle}
598
604
  /* 3D-only floating chrome (parity with AWARE viewer-3d): toolbar TL, legend BL, ViewCube BR */
599
- #m3dBar{position:absolute;top:12px;left:12px;display:none;gap:6px;align-items:center;z-index:59} /* above the floating dim-label chips (57) so the Clip/Work-area dropdowns aren't occluded; still below toasts (60) */
605
+ #m3dBar{position:absolute;top:12px;left:12px;right:12px;display:none;flex-wrap:wrap;gap:6px;align-items:center;z-index:59} /* bounded to the stage so narrow windows wrap this local toolbar instead of widening the whole document; above floating dim-label chips (57), below toasts (60) */
600
606
  #m3dBar .seg-group,#m3dBar>button{box-shadow:0 4px 14px rgba(0,0,0,.45)}
601
607
  #m3dBar>button{font-size:12px;padding:5px 9px}
602
608
  #m3dBar .m3dwrap{position:relative;display:inline-flex}
@@ -697,9 +703,15 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
697
703
  #m3dLegend .lrow.clip.sel .clab{color:var(--text)} /* selection is shown by the row-level .sel styling above (brand left-border + tint); the box is the enable toggle now */
698
704
  /* Panel shell (Objects | Views | Favourites tabs). The OUTER panel no longer scrolls — it caps the height and
699
705
  lays out [tab strip][active body]; each tab body is its own scroll container (themed by the global * rule). */
700
- #m3dLegend{position:absolute;left:12px;bottom:64px;display:none;flex-direction:column;max-height:52vh;min-width:210px;max-width:min(340px,92vw);background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:0;z-index:6;box-shadow:0 4px 14px rgba(0,0,0,.45);font-size:12px}
706
+ #m3dLegend{position:absolute;left:12px;bottom:64px;display:none;flex-direction:column;max-height:min(52vh,calc(100% - var(--m3d-legend-clearance,184px)));min-width:210px;max-width:min(340px,92vw);background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:0;z-index:6;box-shadow:0 4px 14px rgba(0,0,0,.45);font-size:12px} /* the measured clearance tracks however many rows the narrow toolbar wraps onto */
707
+ #m3dLegendCollapse{flex:none;width:28px;padding:0;border:1px solid #475569;border-radius:6px;background:transparent;color:var(--mut);box-shadow:none;font-size:15px}
708
+ #m3dLegendCollapse:hover{color:var(--text);background:#334155}
709
+ #m3dLegendLauncher{position:absolute;left:12px;bottom:12px;z-index:12;width:34px;height:34px;display:none;align-items:center;justify-content:center;padding:0;background:var(--panel);border:1px solid var(--line);border-radius:8px;box-shadow:0 4px 14px rgba(0,0,0,.45);color:var(--mut)}
710
+ #m3dLegendLauncher:hover{color:var(--text);border-color:var(--brand)}
711
+ #m3dLegendLauncher svg{display:block}
701
712
  /* Tab strip — the .seg-group segmented look, full-width across the panel top; sticky so it never scrolls away. */
702
- #m3dTabs{display:flex;flex:none;border-bottom:1px solid var(--line);padding:7px 8px 6px;gap:0}
713
+ #m3dPanelHeader{display:flex;flex:none;align-items:stretch;gap:6px;border-bottom:1px solid var(--line);padding:7px 8px 6px}
714
+ #m3dTabs{display:flex;flex:1;min-width:0;gap:0}
703
715
  #m3dTabs .m3dtab{flex:1;background:transparent;border:1px solid #475569;border-right-width:0;border-radius:0;color:var(--mut);font-size:11px;padding:5px 4px;cursor:pointer;box-shadow:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
704
716
  #m3dTabs .m3dtab:first-child{border-top-left-radius:6px;border-bottom-left-radius:6px}
705
717
  #m3dTabs .m3dtab:last-child{border-right-width:1px;border-top-right-radius:6px;border-bottom-right-radius:6px}
@@ -1095,7 +1107,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1095
1107
  <input id=m3dWpOff inputmode=decimal placeholder="16'-6" autocomplete=off data-tip="Offset along the plane normal (ft-in)">
1096
1108
  </div>
1097
1109
  <hr>
1098
- <label data-tip="Show or hide the reference plane surface"><input type=checkbox id=m3dWpShow checked> Show plane</label>
1110
+ <label data-tip="Show or hide the reference plane surface"><input type=checkbox id=m3dWpShow> Show plane</label>
1099
1111
  <button data-wp=reset data-tip="Back to the active plan's level">Reset to level</button>
1100
1112
  </div>
1101
1113
  </div>
@@ -1111,15 +1123,19 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1111
1123
  </div>
1112
1124
  </div>
1113
1125
  <div id=m3dLegend>
1114
- <div id=m3dTabs role=tablist aria-label="3D panel tabs">
1115
- <button class=m3dtab role=tab data-tab=objects aria-selected=true data-tip="Objects — show / hide, isolate, and search the model's parts">Objects</button>
1116
- <button class=m3dtab role=tab data-tab=views aria-selected=false data-tip="Saved views — save, switch, and manage named viewpoints">Views</button>
1117
- <button class=m3dtab role=tab data-tab=fav aria-selected=false data-tip="Favourite connections — save and re-apply detailed connections">Favourites</button>
1126
+ <div id=m3dPanelHeader>
1127
+ <div id=m3dTabs role=tablist aria-label="3D panel tabs">
1128
+ <button class=m3dtab role=tab data-tab=objects aria-selected=true data-tip="Objects — show / hide, isolate, and search the model's parts">Objects</button>
1129
+ <button class=m3dtab role=tab data-tab=views aria-selected=false data-tip="Saved views — save, switch, and manage named viewpoints">Views</button>
1130
+ <button class=m3dtab role=tab data-tab=fav aria-selected=false data-tip="Favourite connections — save and re-apply detailed connections">Favourites</button>
1131
+ </div>
1132
+ <button id=m3dLegendCollapse aria-label="Collapse 3D panel" aria-controls="m3dLegendBody m3dViewsBody m3dFavBody" aria-expanded=true data-tip="Collapse Objects, Views, and Favourites to the bottom-left corner">⌄</button>
1118
1133
  </div>
1119
1134
  <div id=m3dLegendBody class="m3dbody on" role=tabpanel aria-label=Objects></div>
1120
1135
  <div id=m3dViewsBody class=m3dbody role=tabpanel aria-label=Views></div>
1121
1136
  <div id=m3dFavBody class=m3dbody role=tabpanel aria-label=Favourites></div>
1122
1137
  </div>
1138
+ <button id=m3dLegendLauncher aria-label="Open 3D panel" aria-controls=m3dLegend aria-expanded=false data-tip="Open Objects, Views, and Favourites"><svg width=17 height=17 viewBox="0 0 17 17" fill=none stroke=currentColor stroke-width=1.4 aria-hidden=true><rect x=2.5 y=2.5 width=12 height=12 rx=2></rect><path d="M6.5 3v11M7 6h7M7 10h7"></path></svg></button>
1123
1139
  <div id=m3dCube data-tip="Click a face for that view · right-drag to orbit"></div>
1124
1140
  <div id=m3dAxes></div>
1125
1141
  <div id=zoombar>
@@ -1159,6 +1175,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1159
1175
  <div id=panelResizer role=separator aria-orientation=vertical aria-label="Resize properties panel" tabindex=0 data-tip="Drag to resize · double-click to reset"></div>
1160
1176
  <span id=connectionTruthStatus class=sr-only role=status aria-live=polite aria-atomic=true></span>
1161
1177
  <aside id=panel></aside>
1178
+ <button id=panelToggle aria-label="Collapse properties panel" aria-controls=panel aria-expanded=true data-tip="Collapse properties panel">›</button>
1162
1179
  </main>
1163
1180
  <datalist id=conntypes><option>moment</option><option>drag</option><option>shear</option><option>braced</option><option>pinned</option><option>fixed</option></datalist>
1164
1181
  <datalist id=profiles></datalist>
@@ -1740,16 +1757,19 @@ async function boot() {
1740
1757
  // The server's tag for the contract we just read. Every write echoes it back, so a write that would
1741
1758
  // land on top of someone else's is refused instead of silently winning.
1742
1759
  serverEtag = res.headers.get('ETag');
1743
- // The confidence target is a workflow INPUT (target_confidence), not contract data — read its
1744
- // declared default off the app def so the chip can show the goal. Best-effort: on any failure the
1745
- // chip just omits the "· target N%" suffix (no fabricated goal).
1746
- try {
1747
- const ar = await fetch('/api/app/' + encodeURIComponent(APP_ID));
1748
- if (ar.ok) {
1749
- const ti = ((await ar.json())?.app?.inputs || []).find(i => i && i.name === 'target_confidence');
1750
- if (ti && typeof ti.default === 'number') TARGET_CONF = ti.default;
1751
- }
1752
- } catch (_) { /* no target goal shown */ }
1760
+ // The confidence target is a workflow INPUT (target_confidence), not contract data. Read its declared
1761
+ // default only for an app-scoped editor: a project owns its contract independently of the installed
1762
+ // workflow, so asking /api/app/<id> there can only add a normal 404 to the console. A project-specific
1763
+ // target still comes from C.target_confidence through effectiveTarget().
1764
+ if (!PROJECT) {
1765
+ try {
1766
+ const ar = await fetch('/api/app/' + encodeURIComponent(APP_ID));
1767
+ if (ar.ok) {
1768
+ const ti = ((await ar.json())?.app?.inputs || []).find(i => i && i.name === 'target_confidence');
1769
+ if (ti && typeof ti.default === 'number') TARGET_CONF = ti.default;
1770
+ }
1771
+ } catch (_) { /* no target goal shown */ }
1772
+ }
1753
1773
  PAL = (Array.isArray(C.palette) && C.palette.length) ? C.palette : DEFAULT_PAL; WT = C.weights || {};
1754
1774
  try { const _sr = await fetch('/api/aisc-shapes'); if (_sr.ok) { const _sj = await _sr.json(); if (Array.isArray(_sj.shapes)) window.__AISC_SHAPES = new Set(_sj.shapes); if (_sj.bf && typeof _sj.bf === 'object') window.__AISC_BF = _sj.bf; if (_sj.sections && typeof _sj.sections === 'object') window.__AISC_SECTIONS = _sj.sections; } } catch (_) { /* no shape table → _nominalPlf falls back to regex-only; columns fall back to the marker footprint */ }
1755
1775
  // No weight seeding needed: every RFI/weight read resolves through _wt(), which falls back to the
@@ -6737,6 +6757,16 @@ reflectOriginGrid();
6737
6757
  rz.addEventListener('keydown',e=>{if(e.key==='ArrowLeft'){e.preventDefault();apply(curW()+(e.shiftKey?40:12),true);}else if(e.key==='ArrowRight'){e.preventDefault();apply(curW()-(e.shiftKey?40:12),true);}});
6738
6758
  window.addEventListener('resize',()=>{if(root.style.getPropertyValue('--panelw'))apply(curW(),false);}); // re-clamp if the viewport shrank
6739
6759
  })();
6760
+ // Properties panel: collapse the inspector and its resizer as one unit, but retain the user's saved width.
6761
+ // The edge button lives outside #panel because panel() replaces that aside's contents on every selection.
6762
+ (function(){
6763
+ const b=document.getElementById('panelToggle');if(!b)return;
6764
+ const KEY='steel:propertiesPanelCollapsed:v1';
6765
+ let collapsed=false;try{collapsed=localStorage.getItem(KEY)==='1';}catch(_){}
6766
+ const reflect=()=>{document.body.classList.toggle('panel-collapsed',collapsed);b.textContent=collapsed?'‹':'›';b.setAttribute('aria-expanded',String(!collapsed));const label=collapsed?'Open properties panel':'Collapse properties panel';b.setAttribute('aria-label',label);b.dataset.tip=label;};
6767
+ b.onclick=()=>{collapsed=!collapsed;try{localStorage.setItem(KEY,collapsed?'1':'0');}catch(_){}reflect();b.focus();};
6768
+ reflect();
6769
+ })();
6740
6770
  // --- Selection-filter toolbar (Select bar): same discipline as the snap bar — selFilter is the one source
6741
6771
  // of truth; the 4 class switches + the two type flyouts (Members / Connections) all reflect off it, and every
6742
6772
  // toggle persists + re-renders. Tekla-style: a switch gates what future picks CAN select — it does NOT
@@ -7641,8 +7671,23 @@ function retypeProfile(profKey,cat){if(!memberTypeKnown(cat))return;
7641
7671
  // A saved view is an opaque, versioned snapshot: {v,id,name,order,camera,projection,mode,clips,objects}.
7642
7672
  // ════════════════════════════════════════════════════════════════════════════════════════════════════════════
7643
7673
  let legendTab=(()=>{const t=localStorage.getItem('floless.legendTab');return (t==='views'||t==='fav')?t:'objects';})();
7674
+ let legendCollapsed=(()=>{try{return localStorage.getItem('steel:3dPanelCollapsed:v1')==='1';}catch(_){return false;}})();
7644
7675
  let legendTabsWired=false;
7645
7676
  function saveLegendTab(){try{localStorage.setItem('floless.legendTab',legendTab);}catch{}}
7677
+ function reflectLegendPanel(){
7678
+ const p=document.getElementById('m3dLegend'),launch=document.getElementById('m3dLegendLauncher'),collapse=document.getElementById('m3dLegendCollapse');
7679
+ syncLegendClearance();
7680
+ const open=!!view3d&&!legendCollapsed;
7681
+ if(p)p.style.display=open?'flex':'none';
7682
+ if(launch){launch.style.display=view3d&&legendCollapsed?'flex':'none';launch.setAttribute('aria-expanded',String(open));}
7683
+ if(collapse)collapse.setAttribute('aria-expanded',String(open));
7684
+ updateViewsBtn();
7685
+ }
7686
+ function setLegendPanelCollapsed(on,moveFocus){
7687
+ legendCollapsed=!!on;try{localStorage.setItem('steel:3dPanelCollapsed:v1',legendCollapsed?'1':'0');}catch(_){}
7688
+ reflectLegendPanel();
7689
+ if(moveFocus)(legendCollapsed?document.getElementById('m3dLegendLauncher'):document.getElementById('m3dLegendCollapse'))?.focus();
7690
+ }
7646
7691
  // Switch the active tab: light the strip button, show that body, render it on demand, persist the choice.
7647
7692
  function setLegendTab(tab){if(tab!=='objects'&&tab!=='views'&&tab!=='fav')tab='objects';legendTab=tab;saveLegendTab();
7648
7693
  document.querySelectorAll('#m3dTabs .m3dtab').forEach(b=>{const on=b.dataset.tab===tab;b.classList.toggle('on',on);b.setAttribute('aria-selected',String(on));});
@@ -7655,11 +7700,26 @@ function setLegendTab(tab){if(tab!=='objects'&&tab!=='views'&&tab!=='fav')tab='o
7655
7700
  // The 3D-toolbar Views button lights (.on) while the panel is open on the Views tab.
7656
7701
  function updateViewsBtn(){const vb=document.getElementById('m3dViewsBtn');if(!vb)return;const p=document.getElementById('m3dLegend');vb.classList.toggle('on',!!(p&&p.style.display!=='none'&&legendTab==='views'));}
7657
7702
  // Show the whole panel (used on 3D entry + by the toolbar Views button); optionally force a tab.
7658
- function showLegendPanel(tab){const p=document.getElementById('m3dLegend');if(!p)return;p.style.display='flex';setLegendTab(tab||legendTab);}
7703
+ function showLegendPanel(tab,forceOpen){if(forceOpen)setLegendPanelCollapsed(false);setLegendTab(tab||legendTab);reflectLegendPanel();}
7659
7704
  // Wire the tab strip once (its buttons persist across build3DLegend rebuilds).
7660
7705
  function wireLegendTabs(){if(legendTabsWired)return;legendTabsWired=true;
7661
7706
  document.querySelectorAll('#m3dTabs .m3dtab').forEach(b=>b.addEventListener('click',()=>setLegendTab(b.dataset.tab)));
7707
+ const collapse=document.getElementById('m3dLegendCollapse'),launch=document.getElementById('m3dLegendLauncher');
7708
+ if(collapse)collapse.onclick=()=>setLegendPanelCollapsed(true,true);
7709
+ if(launch)launch.onclick=()=>setLegendPanelCollapsed(false,true);
7710
+ }
7711
+ wireLegendTabs(); // the panel shell is static markup — wire it immediately so its controls never depend on an async 3D rebuild completing first
7712
+ // Keep the bottom-left panel below the toolbar's real wrapped height. ResizeObserver also catches
7713
+ // width changes caused by the properties panel opening/closing, not just window resizes.
7714
+ function syncLegendClearance(){
7715
+ const stage=document.getElementById('stagewrap'),bar=document.getElementById('m3dBar');if(!stage||!bar)return;
7716
+ const sr=stage.getBoundingClientRect(),br=bar.getBoundingClientRect();
7717
+ const clearance=Math.ceil(Math.max(0,br.bottom-sr.top)+72)+'px'; // 8px gap + 64px bottom chrome
7718
+ if(stage.style.getPropertyValue('--m3d-legend-clearance')!==clearance)stage.style.setProperty('--m3d-legend-clearance',clearance);
7662
7719
  }
7720
+ let legendClearanceObserver=null;
7721
+ if(typeof ResizeObserver!=='undefined'){legendClearanceObserver=new ResizeObserver(syncLegendClearance);legendClearanceObserver.observe(document.getElementById('m3dBar'));}
7722
+ window.addEventListener('resize',syncLegendClearance);
7663
7723
  // ── Views state ──────────────────────────────────────────────────────────────────────────────────────────────
7664
7724
  let viewsQuery=''; // transient Views-tab search filter — NOT persisted
7665
7725
  let viewsSearchOpen=false; // is the search input revealed?
@@ -8542,7 +8602,7 @@ function wire3DBar(){if(bar3dWired||!window.Steel3DView)return;bar3dWired=true;
8542
8602
  }
8543
8603
  document.getElementById('m3dIso').onclick=()=>{if(d3.isIsolated())d3.clearIsolation();else d3.isolateSelected();}; // onIsolateChange refreshes the button label/visibility
8544
8604
  // Views toolbar button: open the panel on the Views tab (or, if it's already open on Views, toggle it closed — a natural toolbar toggle).
8545
- {const vb=document.getElementById('m3dViewsBtn');if(vb)vb.onclick=()=>{const p=document.getElementById('m3dLegend');const openOnViews=p&&p.style.display!=='none'&&legendTab==='views';if(openOnViews){p.style.display='none';vb.classList.remove('on');}else{wireLegendTabs();showLegendPanel('views');}updateViewsBtn();};}
8605
+ {const vb=document.getElementById('m3dViewsBtn');if(vb)vb.onclick=()=>{const p=document.getElementById('m3dLegend');const openOnViews=p&&p.style.display!=='none'&&legendTab==='views';if(openOnViews)setLegendPanelCollapsed(true);else{wireLegendTabs();showLegendPanel('views',true);}updateViewsBtn();};}
8546
8606
  // Work area: the ▢ Work area button opens a menu (Set to all objects / Define from selection / Show work area).
8547
8607
  const workBtn=document.getElementById('m3dWork'),workMenu=document.getElementById('m3dWorkMenu');
8548
8608
  function workMenuOutside(e){if(!workMenu.contains(e.target)&&e.target!==workBtn)workMenuClose();}
@@ -8567,7 +8627,7 @@ function wire3DBar(){if(bar3dWired||!window.Steel3DView)return;bar3dWired=true;
8567
8627
  wpMenu.querySelectorAll('button[data-wpp]').forEach(b=>b.onclick=()=>{wpMenuClose();
8568
8628
  const offIn=parseLen(document.getElementById('m3dWpOff').value)||0; // ft-in → inches → mm along the normal
8569
8629
  d3.setWorkPlanePrincipal(b.dataset.wpp,offIn*25.4);});
8570
- document.getElementById('m3dWpShow').onchange=e=>{d3.toggleWorkPlaneVisible(e.target.checked);};
8630
+ {const show=document.getElementById('m3dWpShow');show.checked=d3.workPlaneInfo().visible;show.onchange=e=>{d3.toggleWorkPlaneVisible(e.target.checked);};}
8571
8631
  document.getElementById('m3dWpOff').addEventListener('keydown',ev=>{ev.stopPropagation();if(ev.key==='Enter'){ev.preventDefault();const xy=wpMenu.querySelector('button[data-wpp=xy]');if(xy)xy.click();}});} // Enter in the offset = apply XY (the common case); stopPropagation keeps editor shortcuts out
8572
8632
  function applyViewState(on){ // flip the toggle + swap the canvases (no 3D side effects)
8573
8633
  view3d=on;
@@ -8591,7 +8651,7 @@ function applyViewState(on){ // flip the toggle + swap the canvases (
8591
8651
  document.getElementById('m3dCube').style.display=on?'block':'none';
8592
8652
  document.getElementById('m3dAxes').style.display=on?'block':'none';
8593
8653
  document.getElementById('ptrBars').classList.toggle('s3d',on); // in 3D the pointer-behaviour bars shift clear of the world-axis triad (bottom-right); see #ptrBars.s3d
8594
- if(!on)document.getElementById('m3dLegend').style.display='none'; // panel is shown by setView (showLegendPanel) when entering 3D
8654
+ reflectLegendPanel(); // entering/leaving 3D honours the persisted collapsed state and keeps its launcher in sync
8595
8655
  }
8596
8656
  let viewSeq=0; // monotonic per view switch — see the staleness check after the awaited rebuild below
8597
8657
  async function setView(on){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floless/app",
3
- "version": "0.113.4",
3
+ "version": "0.113.6",
4
4
  "type": "module",
5
5
  "description": "Thin localhost host for floless.app — serves web/ and shells the aware CLI. No engine, no LLM.",
6
6
  "bin": {