@floless/app 0.127.1 → 0.127.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/floless-server.cjs +6 -5
- package/dist/web/steel-editor.html +23 -10
- package/package.json +1 -1
package/dist/floless-server.cjs
CHANGED
|
@@ -54744,7 +54744,7 @@ function appVersion() {
|
|
|
54744
54744
|
return resolveVersion({
|
|
54745
54745
|
isSea: isSea2(),
|
|
54746
54746
|
sqVersionXml: readSqVersionXml(),
|
|
54747
|
-
define: true ? "0.127.
|
|
54747
|
+
define: true ? "0.127.2" : void 0,
|
|
54748
54748
|
pkgVersion: readPkgVersion()
|
|
54749
54749
|
});
|
|
54750
54750
|
}
|
|
@@ -54760,7 +54760,7 @@ function resolveChannel(s) {
|
|
|
54760
54760
|
function appChannel() {
|
|
54761
54761
|
return resolveChannel({
|
|
54762
54762
|
isSea: isSea2(),
|
|
54763
|
-
define: true ? "0.127.
|
|
54763
|
+
define: true ? "0.127.2" : void 0,
|
|
54764
54764
|
// argv[1] is the entry the runtime actually loaded (…/dist/floless-server.cjs), which is what
|
|
54765
54765
|
// carries the npx cache prefix. Absent under the SEA exe, which never reaches the npx branch.
|
|
54766
54766
|
modulePath: process.argv[1]
|
|
@@ -71790,9 +71790,10 @@ function watchDisconnect(reply, onGone) {
|
|
|
71790
71790
|
// reference-routes.ts
|
|
71791
71791
|
var APPID = /^[a-z0-9][a-z0-9._-]*$/i;
|
|
71792
71792
|
var REFERENCE_BODY_LIMIT = 210 * 1024 * 1024;
|
|
71793
|
-
function runScope(deps, reply) {
|
|
71793
|
+
function runScope(deps, reply, opts = {}) {
|
|
71794
71794
|
let current = null;
|
|
71795
|
-
const signal =
|
|
71795
|
+
const signal = opts.detachOnDisconnect ? { gone: () => false, finish: () => {
|
|
71796
|
+
} } : watchDisconnect(reply, () => {
|
|
71796
71797
|
if (current) deps.runControl.cancel(current);
|
|
71797
71798
|
});
|
|
71798
71799
|
return {
|
|
@@ -71949,7 +71950,7 @@ function registerReferenceRoutes(app, deps) {
|
|
|
71949
71950
|
app.post(
|
|
71950
71951
|
"/api/steel/:appId/reference",
|
|
71951
71952
|
async (req, reply) => {
|
|
71952
|
-
const scope = runScope(deps, reply);
|
|
71953
|
+
const scope = runScope(deps, reply, { detachOnDisconnect: true });
|
|
71953
71954
|
const g = gate2(deps, req.params.appId, req.query.project);
|
|
71954
71955
|
if (!g.ok) return reply.status(g.refusal.status).send(g.refusal.body);
|
|
71955
71956
|
const { sha, name, placement } = req.body ?? {};
|
|
@@ -1613,7 +1613,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
1613
1613
|
<!-- The spinner is `connImportModal`'s own `.ci-prog`/`.ci-spin` (see the CSS above), reused rather
|
|
1614
1614
|
than re-invented: this stage sat as static text for up to six seconds before its honest
|
|
1615
1615
|
"still working" message appeared, which reads as hung next to the sibling modal that spins. -->
|
|
1616
|
-
<div id=riProgStage style="display:none"><div class=ci-prog><span class=ci-spin aria-hidden=true></span><span id=riProgTxt>Reading the file…</span></div></div>
|
|
1616
|
+
<div id=riProgStage style="display:none"><div class=ci-prog><span class=ci-spin aria-hidden=true></span><span id=riProgTxt role=status aria-live=polite>Reading the file…</span></div><div id=riProgNote style="display:none">You can close this — FloLess will keep importing this model.</div></div>
|
|
1617
1617
|
<div id=riConfirmStage style="display:none">
|
|
1618
1618
|
<div id=riSays></div>
|
|
1619
1619
|
<div class=rirow><span class=pn>Schema</span><span class=pv id=riSchema>—</span></div>
|
|
@@ -11146,7 +11146,7 @@ function adoptReferenceWrite(etag){if(!etag)return;const prev=serverEtag;serverE
|
|
|
11146
11146
|
// that guard could never fire from this UI, because the browser never disconnected — Cancel left the
|
|
11147
11147
|
// request in flight, so a cancelled 66 MB read went on holding the single run lock for its full
|
|
11148
11148
|
// duration and the next import queued behind the file the user had just given up on.
|
|
11149
|
-
let riRun=0,riAbort=null;
|
|
11149
|
+
let riRun=0,riAbort=null,riMutationId=null;
|
|
11150
11150
|
/** End the current attempt: nothing it started may touch the modal, and its upload stops now. */
|
|
11151
11151
|
const riStop=()=>{riRun++;if(riAbort){try{riAbort.abort();}catch(_){/* already settled */}riAbort=null;}};
|
|
11152
11152
|
const riClearSoft=()=>{if(riSoftT){clearTimeout(riSoftT);riSoftT=null;}};
|
|
@@ -11157,7 +11157,8 @@ function adoptReferenceWrite(etag){if(!etag)return;const prev=serverEtag;serverE
|
|
|
11157
11157
|
ri$('riProgStage').style.display=s==='prog'?'':'none';
|
|
11158
11158
|
ri$('riConfirmStage').style.display=s==='confirm'?'':'none';
|
|
11159
11159
|
ri$('riInsert').style.display=s==='confirm'?'':'none';
|
|
11160
|
-
ri$('riClose').style.display=s==='prog'?'none':'';
|
|
11160
|
+
ri$('riClose').style.display=s==='prog'?'none':'';
|
|
11161
|
+
ri$('riProgNote').style.display='none';
|
|
11161
11162
|
ri$('riTitle').textContent=s==='prog'?'Reading the file':s==='confirm'?'Add this reference?':'Add a reference model';};
|
|
11162
11163
|
const riProg=(label,soft)=>{riClearSoft();ri$('riProgTxt').textContent=label;
|
|
11163
11164
|
if(soft)riSoftT=setTimeout(()=>{ri$('riProgTxt').textContent=soft;},6000);}; // an honest "still working", never a fake %
|
|
@@ -11171,7 +11172,18 @@ function adoptReferenceWrite(etag){if(!etag)return;const prev=serverEtag;serverE
|
|
|
11171
11172
|
riBuildPick(null); // and the picker, so a cancelled file's storeys never show under a new name
|
|
11172
11173
|
riStage('drop');ri$('refImportModal').style.display='flex';}
|
|
11173
11174
|
window.openRefImport=openRefImport;
|
|
11174
|
-
function riClose(){
|
|
11175
|
+
function riClose(){
|
|
11176
|
+
// A reference insert is intentionally detached from this modal once accepted. Closing is a
|
|
11177
|
+
// backgrounding action, never an implicit cancellation of an expensive model read.
|
|
11178
|
+
if(riBusy&&riStageNow==='prog'){
|
|
11179
|
+
// The server broadcasts before its HTTP response. Once the user backgrounds this attempt, its
|
|
11180
|
+
// mutation may no longer suppress that broadcast or the contract can commit invisibly here.
|
|
11181
|
+
if(riMutationId){releaseMutation(riMutationId);riMutationId=null;}
|
|
11182
|
+
riRun++;riAbort=null;riBusy=false;riClearSoft();ri$('riCancel').textContent='Cancel';ri$('refImportModal').style.display='none';
|
|
11183
|
+
toast('Import continues in the background.');return;
|
|
11184
|
+
}
|
|
11185
|
+
riStop();riClearSoft();ri$('refImportModal').style.display='none';
|
|
11186
|
+
}
|
|
11175
11187
|
|
|
11176
11188
|
const RI_MAX_BYTES=150*1024*1024; // mirrors MAX_BYTES in server/reference-import.ts (pinned by the parity test)
|
|
11177
11189
|
// Mirrors MAX_OBJECTS / WARN_OBJECTS in server/reference-import.ts (pinned by the same parity test).
|
|
@@ -11517,9 +11529,10 @@ function adoptReferenceWrite(etag){if(!etag)return;const prev=serverEtag;serverE
|
|
|
11517
11529
|
const riNative=nativeModelCentre();
|
|
11518
11530
|
const riFilterBody=riBuildFilter(); // computed ONCE — it was called twice in one expression
|
|
11519
11531
|
const riOriginShift=takeOrigin&&riProbeCentre?riProbeCentre.map((v,i)=>riNative[i]-v):null;
|
|
11520
|
-
riStage('prog');riProg('Reading the geometry…','Still reading — a whole building takes a moment.');
|
|
11532
|
+
riStage('prog');ri$('riProgNote').style.display='block';ri$('riCancel').textContent='Continue in background';riProg('Reading the geometry…','Still reading — a whole building takes a moment.');
|
|
11533
|
+
let mid=null;
|
|
11521
11534
|
try{
|
|
11522
|
-
|
|
11535
|
+
mid=newMutationId();riMutationId=mid;claimMutation(mid);
|
|
11523
11536
|
const res=await fetch(refApi(''),{method:'POST',signal,headers:{'content-type':'application/json','x-floless-mutation-id':mid},
|
|
11524
11537
|
// The placement rides the INSERT, so the choice the user made in the modal is committed with
|
|
11525
11538
|
// the reference rather than by a debounced PUT afterwards. Applying it in the presentation
|
|
@@ -11539,7 +11552,7 @@ function adoptReferenceWrite(etag){if(!etag)return;const prev=serverEtag;serverE
|
|
|
11539
11552
|
// own echo would not be replayed at us, and if the write DID land, suppressing its broadcast
|
|
11540
11553
|
// is precisely what would leave a reference committed on disk and invisible in the editor —
|
|
11541
11554
|
// where the next full save could quietly drop it. Released, the broadcast reconciles instead.
|
|
11542
|
-
releaseMutation(mid);
|
|
11555
|
+
releaseMutation(mid);if(riMutationId===mid)riMutationId=null;
|
|
11543
11556
|
return;
|
|
11544
11557
|
}
|
|
11545
11558
|
riClearSoft();
|
|
@@ -11568,9 +11581,9 @@ function adoptReferenceWrite(etag){if(!etag)return;const prev=serverEtag;serverE
|
|
|
11568
11581
|
}catch(e){
|
|
11569
11582
|
// Aborted: no response at all, so we cannot know whether the write landed. Same reasoning as
|
|
11570
11583
|
// above — release the claim so a broadcast that does arrive is applied rather than swallowed.
|
|
11571
|
-
if(mine!==riRun||(e&&e.name==='AbortError')){releaseMutation(mid);return;}
|
|
11584
|
+
if(mine!==riRun||(e&&e.name==='AbortError')){if(mid)releaseMutation(mid);if(riMutationId===mid)riMutationId=null;return;}
|
|
11572
11585
|
riClearSoft();riStage('drop');riErr('Could not add that reference.');console.error('[reference] insert failed',e);return;}
|
|
11573
|
-
finally{riBusy=false;if(
|
|
11586
|
+
finally{if(mine===riRun){riBusy=false;riAbort=null;ri$('riCancel').textContent='Cancel';}if(riMutationId===mid)riMutationId=null;}
|
|
11574
11587
|
// ── PAST THE POINT OF NO RETURN. Everything above is the transaction; everything below is showing
|
|
11575
11588
|
// it. They were one try, and a throw in the presentation half ran riErr() on a modal riClose() had
|
|
11576
11589
|
// already hidden — so the user saw NOTHING while the reference was committed and on disk, and the
|
|
@@ -11610,7 +11623,7 @@ function adoptReferenceWrite(etag){if(!etag)return;const prev=serverEtag;serverE
|
|
|
11610
11623
|
// exit — and the backdrop, a full-viewport overlay that looks like nothing at all, quietly offered
|
|
11611
11624
|
// the same abort to a stray click just outside the panel. Hiding one of two identical exits and
|
|
11612
11625
|
// leaving the invisible one is the version of that rule that does not hold. (UX review, #580.)
|
|
11613
|
-
ri$('riBackdrop').onclick=()=>
|
|
11626
|
+
ri$('riBackdrop').onclick=()=>riClose();
|
|
11614
11627
|
ri$('riInsert').onclick=riInsert;
|
|
11615
11628
|
ri$('riPickToggle').onclick=()=>riSetPickOpen(ri$('riPick').style.display==='none');
|
|
11616
11629
|
// The tri-state header toggle: `null` (all) and a full Set are the same selection but not the
|