@floless/app 0.168.0 → 0.169.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli-actions.mjs +8 -1
- package/dist/floless-server.cjs +83100 -68895
- package/dist/skills/floless-app-rfi/SKILL.md +4 -2
- package/dist/templates/college-phase-exporter.flo +7 -2
- package/dist/templates/trimble-list-projects.flo +10 -2
- package/dist/web/agent-steps.js +2 -2
- package/dist/web/agents.js +49 -13
- package/dist/web/app.css +44 -3
- package/dist/web/app.js +47 -4
- package/dist/web/aware-update-client.js +4 -4
- package/dist/web/aware.js +401 -31
- package/dist/web/chat.css +10 -0
- package/dist/web/chat.js +223 -22
- package/dist/web/commands-drawing-check.js +3 -0
- package/dist/web/commands-shell.js +111 -4
- package/dist/web/commands-steel.js +9 -2
- package/dist/web/commands-vector.js +69 -0
- package/dist/web/drawing-check-editor.html +10 -0
- package/dist/web/drawing-check-editor.js +502 -182
- package/dist/web/failure-copy.js +20 -2
- package/dist/web/flo-3d.js +310 -0
- package/dist/web/flo-card.js +72 -0
- package/dist/web/guide.js +3 -1
- package/dist/web/index.html +26 -4
- package/dist/web/instructor.js +3 -0
- package/dist/web/model-editor-steel-adapter.js +41 -1
- package/dist/web/model-viewport-toolbar.js +11 -0
- package/dist/web/pages.js +17 -14
- package/dist/web/panels.js +1 -1
- package/dist/web/project-history.js +2 -2
- package/dist/web/project-modules.js +3 -3
- package/dist/web/project-reconciliation.js +1 -1
- package/dist/web/project-rfis.js +2 -2
- package/dist/web/project-workflows.js +6 -4
- package/dist/web/renderers.js +6 -0
- package/dist/web/report-csp.js +68 -0
- package/dist/web/revit-editor.js +1 -1
- package/dist/web/run-history.js +2 -3
- package/dist/web/steel-3d-flo.js +309 -0
- package/dist/web/steel-3d-view.js +159 -0
- package/dist/web/steel-editor.html +130 -9
- package/dist/web/terminal-requests.js +78 -0
- package/dist/web/tool-updates.js +3 -2
- package/dist/web/vector-3d.html +1 -1
- package/dist/web/vector-editor.html +50 -8
- package/dist/web/workspace-root-management.js +1 -1
- package/dist/web/workspaces.js +626 -140
- package/launch.mjs +5 -0
- package/package.json +8 -8
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
[data-theme="light"] #selFly,[data-theme="light"] #m3dBar,[data-theme="light"] #m3dToolBar,
|
|
165
165
|
[data-theme="light"] #calloutPop,[data-theme="light"] #viewFly,[data-theme="light"] #comboPop.on-stage,
|
|
166
166
|
[data-theme="light"] #propPop,[data-theme="light"] #snapMenu,[data-theme="light"] #dimEditPop,[data-theme="light"] #cmHud,
|
|
167
|
-
[data-theme="light"] #m3dCube,[data-theme="light"] #m3dAxes,[data-theme="light"] #plHint,
|
|
167
|
+
[data-theme="light"] #m3dCube,[data-theme="light"] #m3dFloMin,[data-theme="light"] #m3dFloCard,[data-theme="light"] #m3dAxes,[data-theme="light"] #plHint,
|
|
168
168
|
[data-theme="light"] #gridReadout,[data-theme="light"] #gridLabelEdit,[data-theme="light"] #m3dReadout,[data-theme="light"] #m3dRubber,
|
|
169
169
|
[data-theme="light"] #m3dDimLabels,[data-theme="light"] #m3dMemberLabels,[data-theme="light"] #m3dHoverChip,
|
|
170
170
|
[data-theme="light"] #m3dPropLabelHost,[data-theme="light"] #m3dSelLenLabels,
|
|
@@ -1191,6 +1191,10 @@ rect.lblhot:focus-visible{outline:2px solid var(--brand);outline-offset:2px;stro
|
|
|
1191
1191
|
line needs ~227px. Laid out flat, the readout was pushed past the panel's own right edge and (in 3D
|
|
1192
1192
|
at a 1600px window) off the screen with it: the DOM value was right, so it read correct to a probe,
|
|
1193
1193
|
while the user saw "2" of "26 px". */
|
|
1194
|
+
#m3dViewMenu .mrow{display:flex;flex-wrap:wrap;align-items:center;gap:7px 8px;padding:2px 12px 8px 47px;min-width:150px;box-sizing:border-box} /* Flo size: under the Flo words, like the pl-note; the words and the read-out on one line, the slider full width under them */
|
|
1195
|
+
#m3dViewMenu .mrow .mlbl{color:var(--mut);font-size:11px;flex:1 1 auto}
|
|
1196
|
+
#m3dViewMenu .mrow .mval{color:var(--mut);font-size:11px;flex:none;text-align:right;font-variant-numeric:tabular-nums;order:2}
|
|
1197
|
+
#m3dViewMenu .mrow input[type=range]{flex:0 0 100%;min-width:0;order:3}
|
|
1194
1198
|
#moreMenu .mrow{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;padding:2px 12px 8px 26px;max-width:100%;box-sizing:border-box}
|
|
1195
1199
|
#moreMenu .mrow .mlbl{color:var(--mut);font-size:11px;flex:0 0 100%}
|
|
1196
1200
|
#moreMenu .mrow input[type=range]{flex:1 1 60px;min-width:0}
|
|
@@ -1988,6 +1992,10 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
1988
1992
|
#panel .mp-done:focus:not(:focus-visible){outline:none}
|
|
1989
1993
|
#panel .mp-done .hint{margin-top:4px}
|
|
1990
1994
|
#quickStat.is-unknown{text-decoration:underline dashed;text-underline-offset:3px}
|
|
1995
|
+
/* #2554 slice 2: which drawing files the model did not read. Muted, not amber (that is the Quick label's), and short: the
|
|
1996
|
+
full list is in its tip. */
|
|
1997
|
+
#coverageStat{white-space:nowrap;color:var(--mut);max-width:16ch;overflow:hidden;text-overflow:ellipsis}
|
|
1998
|
+
#coverageStat.is-unknown{text-decoration:underline dashed;text-underline-offset:3px}
|
|
1991
1999
|
.conf-quick{margin:0 0 8px;padding:6px 10px;border:1px solid var(--warn-edge);border-radius:6px;color:var(--mut);font-size:12px;line-height:1.45}
|
|
1992
2000
|
.conf-quick b{color:var(--warn)}
|
|
1993
2001
|
#srcStat b{display:inline-block;max-width:130px;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}
|
|
@@ -2950,6 +2958,36 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
2950
2958
|
cube was dropped 44px for a collision that cannot happen and sat 56 from the top against 12 from
|
|
2951
2959
|
the right. Equal insets put it in the corner. */
|
|
2952
2960
|
#m3dCube{position:absolute;right:12px;top:12px;width:84px;height:84px;display:none;z-index:6;cursor:pointer;filter:drop-shadow(0 6px 14px rgba(0,0,0,.5))}
|
|
2961
|
+
/* Flo's button sits centred under the cube, in the canvas bar's icon-button idiom. */
|
|
2962
|
+
/* Minimize, beside Flo while the pointer is on it (steel-3d-view.js places it). Hidden with visibility too, so
|
|
2963
|
+
a faded chip is never a tab stop. */
|
|
2964
|
+
#m3dFloMin{position:fixed;z-index:7;width:24px;height:24px;min-width:0;min-height:0;margin:0;padding:0;display:flex;align-items:center;justify-content:center;background:var(--panel);border:1px solid var(--line);border-radius:5px;box-shadow:0 4px 10px rgba(0,0,0,.35);color:var(--mut);cursor:pointer;opacity:0;visibility:hidden;transition:opacity .16s ease,visibility 0s linear .16s}
|
|
2965
|
+
#m3dFloMin.show{opacity:1;visibility:visible;transition:opacity .16s ease}
|
|
2966
|
+
#m3dFloMin:hover{background:var(--btn-hover);color:var(--text)}
|
|
2967
|
+
#m3dFloMin:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
|
|
2968
|
+
#m3dFloMin svg{width:14px;height:14px;display:block;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
|
|
2969
|
+
@media (prefers-reduced-motion:reduce){#m3dFloMin,#m3dFloMin.show{transition:none}}
|
|
2970
|
+
/* Flo's card: what the member Flo stands on is, beside Flo's head (steel-3d-view.js places it every frame). It is
|
|
2971
|
+
on the 3D stage, which is always dark, so it stays dark in the light theme too. Never in the way: it takes no
|
|
2972
|
+
pointer, so orbit and pick go straight through it. */
|
|
2973
|
+
#m3dFloCard{--fc-s:1;position:fixed;z-index:6;min-width:calc(150px * var(--fc-s));max-width:calc(220px * var(--fc-s));padding:calc(8px * var(--fc-s)) calc(11px * var(--fc-s)) calc(9px * var(--fc-s));background:var(--panel);border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 22px rgba(0,0,0,.45);color:var(--text);pointer-events:none;display:none}
|
|
2974
|
+
#m3dFloCard.show{display:block;animation:fcIn .15s ease}
|
|
2975
|
+
@keyframes fcIn{from{opacity:0}to{opacity:1}}
|
|
2976
|
+
#m3dFloCard::before{content:"";position:absolute;top:var(--fc-tail,14px);width:9px;height:9px;background:var(--panel);border:1px solid var(--line);transform:rotate(45deg)}
|
|
2977
|
+
#m3dFloCard[data-side="right"]::before{left:-5.5px;border-top:0;border-right:0}
|
|
2978
|
+
#m3dFloCard[data-side="left"]::before{right:-5.5px;border-bottom:0;border-left:0}
|
|
2979
|
+
#m3dFloCard .fc-cap{font:500 calc(10px * var(--fc-s))/1.3 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.06em;text-transform:uppercase;color:var(--mut);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
2980
|
+
#m3dFloCard .fc-head{font-size:calc(17px * var(--fc-s));font-weight:700;line-height:1.25;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
2981
|
+
#m3dFloCard .fc-head:first-child{margin-top:0}
|
|
2982
|
+
#m3dFloCard .fc-rows{display:grid;grid-template-columns:auto 1fr;column-gap:calc(12px * var(--fc-s));row-gap:2px;margin-top:calc(6px * var(--fc-s));font-size:calc(11.5px * var(--fc-s));line-height:1.35}
|
|
2983
|
+
#m3dFloCard .fc-rows:first-child{margin-top:0}
|
|
2984
|
+
#m3dFloCard .fc-k{color:var(--mut);font-size:calc(10px * var(--fc-s));letter-spacing:.04em;text-transform:uppercase;align-self:center;white-space:nowrap}
|
|
2985
|
+
#m3dFloCard .fc-v{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
2986
|
+
#m3dFloCard .fc-varies{font-style:italic;font-weight:500;color:var(--mut)} /* several selected and they differ: read as "not one value", like Properties' Varies */
|
|
2987
|
+
#floCardScope .fc-reset{display:block;width:auto;text-align:left;margin:2px 0 4px 47px;padding:3px 4px;background:none;border:0;color:var(--brand);font-size:11px;cursor:pointer}
|
|
2988
|
+
#floCardScope .fc-reset:hover{text-decoration:underline}
|
|
2989
|
+
#floCardScope .fc-reset:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
|
|
2990
|
+
@media (prefers-reduced-motion:reduce){#m3dFloCard.show{animation:none}}
|
|
2953
2991
|
/* Tekla-style world-axis triad, bottom-right (where the cube used to sit). Passive readout
|
|
2954
2992
|
(pointer-events:none) — orientation is the ViewCube's job; this only SHOWS where world X/Y/Z point. */
|
|
2955
2993
|
#m3dAxesDock{position:absolute;right:15px;bottom:12px;display:none;flex-direction:column;align-items:center;gap:4px;z-index:5;pointer-events:none}
|
|
@@ -3008,6 +3046,8 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
3008
3046
|
<script src="commands-steel.js"></script>
|
|
3009
3047
|
<!-- An Esc this editor leaves unused closes the shell's editor overlay (#1571); mounted after the keydown ladder. -->
|
|
3010
3048
|
<script src="overlay-escape.js"></script>
|
|
3049
|
+
<script src="flo.js"></script>
|
|
3050
|
+
<script src="flo-card.js"></script>
|
|
3011
3051
|
<script type="importmap">{"imports":{"three":"./vendor/three.module.js","three/addons/":"./vendor/","three-bvh-csg":"./vendor/three-bvh-csg.module.js"}}</script>
|
|
3012
3052
|
<script type="module" src="./steel-3d-view.js"></script>
|
|
3013
3053
|
<!-- grid-core is an ES module; the editor's classic script reaches it via window.GridCore (set before
|
|
@@ -3119,6 +3159,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
3119
3159
|
<span class=stat id=saveStat data-tip="Edits auto-save in this browser (localStorage)">Saved</span>
|
|
3120
3160
|
<span class=stat id=srcStat style="display:none"></span>
|
|
3121
3161
|
<span class=stat id=quickStat data-command-id="steel.quick-model-chip" tabindex=0 style="display:none"></span>
|
|
3162
|
+
<span class=stat id=coverageStat data-command-id="steel.read-coverage-chip" tabindex=0 style="display:none"></span>
|
|
3122
3163
|
<span class=tb-sep></span>
|
|
3123
3164
|
<button data-command-id="steel.undo" id=undoB data-tip="Undo (Ctrl+Z)">↶</button>
|
|
3124
3165
|
<button data-command-id="steel.redo" id=redoB data-tip="Redo (Ctrl+Y / Ctrl+Shift+Z)">↷</button>
|
|
@@ -4394,7 +4435,7 @@ function handleContractChanged(m){
|
|
|
4394
4435
|
const parked=parkDraftForExternalChange();
|
|
4395
4436
|
const lead=(typeof m.reason==='string'&&CHANGE_LEAD[m.reason])||'This model was changed';
|
|
4396
4437
|
showAiUpdateBanner(parked?lead+'. Reload to see the newest version. Your unsaved edits are kept on this computer.':lead+', but your unsaved edits could not be kept on this computer, so reloading now would lose them. Write down or take a screenshot of what you changed first.',parked?{onSeeChanges:seeChangesFromOpenTab}:{noReload:true,onSeeChanges:seeChangesFromOpenTab});
|
|
4397
|
-
}else
|
|
4438
|
+
}else{if(window.flolessModelFloRemember)window.flolessModelFloRemember();location.reload();} /* Flo visits what changed once the model is back */
|
|
4398
4439
|
}
|
|
4399
4440
|
function bufferContractEvent(m){
|
|
4400
4441
|
if(!Number.isSafeInteger(m.storeRevision)||m.storeRevision<0||typeof m.etag!=='string'){console.warn('steel-editor: ignored an unorderable contract event');return;}
|
|
@@ -4542,6 +4583,19 @@ function handleReviewChanged(m){
|
|
|
4542
4583
|
el.style.display='';
|
|
4543
4584
|
if(typeof renderConfQuick==='function')renderConfQuick();
|
|
4544
4585
|
}
|
|
4586
|
+
/* #2554 slice 2: which drawing files the loaded model did not read, beside the Quick chip and never inside it. Server-owned:
|
|
4587
|
+
no edit here changes it, so it is painted from each load. Absent (null) = the whole set was read; undefined = an
|
|
4588
|
+
unreadable reply, which leaves the chip as it was. */
|
|
4589
|
+
function paintCoverageStat(c){
|
|
4590
|
+
if(c===undefined)return;
|
|
4591
|
+
const el=document.getElementById('coverageStat');if(!el)return;
|
|
4592
|
+
const shown=c&&(c.state==='part'||c.state==='unknown')&&typeof c.short==='string'&&c.short?c:null;
|
|
4593
|
+
if(!shown){el.style.display='none';el.textContent='';el.removeAttribute('data-tip');return;}
|
|
4594
|
+
el.textContent=shown.short;
|
|
4595
|
+
el.classList.toggle('is-unknown',shown.state==='unknown');
|
|
4596
|
+
el.setAttribute('data-tip',(shown.text||shown.short)+' Shown as last loaded.');
|
|
4597
|
+
el.style.display='';
|
|
4598
|
+
}
|
|
4545
4599
|
/* The confidence report's line: scoped to the last saved model, and it says so when the report shows unsaved edits. */
|
|
4546
4600
|
function renderConfQuick(){
|
|
4547
4601
|
const el=document.getElementById('confQuick');if(!el)return;
|
|
@@ -4826,14 +4880,13 @@ function contractFailureState(status, code, serverError, projectScoped) {
|
|
|
4826
4880
|
}
|
|
4827
4881
|
|
|
4828
4882
|
/**
|
|
4829
|
-
* #3097: the sentence a person reads for a failed request on this page. The server's own
|
|
4830
|
-
* written
|
|
4831
|
-
*
|
|
4883
|
+
* #3097: the sentence a person reads for a failed request on this page. The server's own sentence is shown as
|
|
4884
|
+
* written when it wrote one for the person (`personText`: never raw exception text it marked `diagnostic`);
|
|
4885
|
+
* anything else gets the shared failure-copy.js sentence, never "(500)" or "HTTP 403".
|
|
4832
4886
|
* `ctx` is failureCopy's: `action` completes "Couldn’t …", `retrySafe` only for a request that just reads.
|
|
4833
4887
|
*/
|
|
4834
4888
|
function replyFailureText(status, body, ctx) {
|
|
4835
|
-
|
|
4836
|
-
return said || failureCopy({ status, body: body && typeof body === 'object' ? body : null }, ctx).text;
|
|
4889
|
+
return personText(body) || failureCopy({ status, body: body && typeof body === 'object' ? body : null }, ctx).text;
|
|
4837
4890
|
}
|
|
4838
4891
|
|
|
4839
4892
|
/**
|
|
@@ -4966,6 +5019,7 @@ async function boot() {
|
|
|
4966
5019
|
// live, and observable to anything that runs in between. Validate, then publish.
|
|
4967
5020
|
const snapshotPayload = await res.json();
|
|
4968
5021
|
paintQuickStat(snapshotPayload && typeof snapshotPayload === 'object' ? (snapshotPayload.quick ?? null) : undefined);
|
|
5022
|
+
paintCoverageStat(snapshotPayload && typeof snapshotPayload === 'object' ? (snapshotPayload.coverage ?? null) : undefined);
|
|
4969
5023
|
lastAiReviews = snapshotPayload && typeof snapshotPayload === 'object' && snapshotPayload.aiReviews && typeof snapshotPayload.aiReviews === 'object' ? snapshotPayload.aiReviews : null; // #2521 row 8a
|
|
4970
5024
|
const loaded = snapshotPayload && snapshotPayload.contract;
|
|
4971
5025
|
// Shape first, then type. A body that is null, an array or a scalar has no `type` to test, so a
|
|
@@ -15680,6 +15734,54 @@ function updDimToggle(){const b=document.getElementById('dimToggleB');if(!b)retu
|
|
|
15680
15734
|
document.getElementById('dimToggleB').onclick=e=>{e.stopPropagation();dimsVisible=!dimsVisible;updDimToggle();render();};
|
|
15681
15735
|
|
|
15682
15736
|
function updPosGizmoToggle(){const b=document.getElementById('posGizmoToggleB');if(!b)return;b.disabled=false;b.classList.toggle('on',showPosGizmo);b.setAttribute('aria-checked',String(showPosGizmo));}
|
|
15737
|
+
/* Show Flo is OFF until the person turns it on in the 3D Labels menu: Flo is an extra (owner, 2026-11-04). The key is
|
|
15738
|
+
read by steel-3d-view.js when 3D starts; the "–" beside Flo turns it off the same way. */
|
|
15739
|
+
/* Flo's settings live here, in memory, seeded once from storage and written back to it best-effort: storage can be
|
|
15740
|
+
blocked (a locked-down browser), and then every switch still works for this page, it is just not kept. A var read
|
|
15741
|
+
lazily, because syncDisplayRows can run before this line does. */
|
|
15742
|
+
var floSettings;
|
|
15743
|
+
function floSt(){if(!floSettings){let on=false,size=100;
|
|
15744
|
+
try{on=localStorage.getItem('steel:flo3d:v2')==='on';const v=Number(localStorage.getItem('steel:floSize:v2'));if(v>=60&&v<=200)size=Math.round(v);}catch(_){}
|
|
15745
|
+
floSettings={on,size,fields:FloCard.readFloCardFields(floCardStore())};}
|
|
15746
|
+
return floSettings;}
|
|
15747
|
+
function floShown(){return floSt().on;}
|
|
15748
|
+
let floShellMood='idle';
|
|
15749
|
+
function updFloToggle(){const on=floShown();
|
|
15750
|
+
const b=document.getElementById('floToggleB');if(b){b.classList.toggle('on',on);b.setAttribute('aria-checked',String(on));}
|
|
15751
|
+
updateLabelsBandMarks();}
|
|
15752
|
+
function rememberFloShown(on){floSt().on=!!on;try{localStorage.setItem('steel:flo3d:v2',on?'on':'off');}catch(_){}}
|
|
15753
|
+
/* The key is written here, so the switch holds before the 3D view exists. */
|
|
15754
|
+
function setFloShownFromPage(on){rememberFloShown(on);modelEditor.steel.setFlo(on);updFloToggle();}
|
|
15755
|
+
/* The chip beside Flo hides it from inside the 3D view: the key follows, so it stays off until switched back on in Labels. */
|
|
15756
|
+
window.addEventListener('floless:flo3d-shown',e=>{const via=e.detail&&e.detail.via;if(via==='chip')rememberFloShown(false);updFloToggle();});
|
|
15757
|
+
/* Flo's card: which details it shows (web/flo-card.js keeps the list and its order; stored per browser, like Show Flo). */
|
|
15758
|
+
function floCardStore(){try{return localStorage;}catch(_){return null;}}
|
|
15759
|
+
function floCardFields(){return floSt().fields;}
|
|
15760
|
+
function updFloCardRows(){const want=floCardFields();
|
|
15761
|
+
for(const r of document.querySelectorAll('#floCardScope [data-key]')){const on=want.includes(r.dataset.key);r.classList.toggle('on',on);r.setAttribute('aria-checked',String(on));}}
|
|
15762
|
+
function setFloCardFields(fields){floSt().fields=FloCard.sanitizeFloCardFields(fields);FloCard.writeFloCardFields(floCardStore(),fields);updFloCardRows();if(view3dReady)modelEditor.steel.refreshFloCard();}
|
|
15763
|
+
/* The section is drawn into the 3D Labels menu from the adapter's spec (model-editor-steel-adapter.js), and drawn
|
|
15764
|
+
again whenever the 3D toolbar is, so it is wired after every render (render3DToolbarShell). */
|
|
15765
|
+
function wireFloSection(){const section=document.getElementById('floSection'),d=document.getElementById('floCardDisc'),body=document.getElementById('floCardScope');
|
|
15766
|
+
if(!section||!d||!body)throw new Error('Flo controls are missing from the 3D Labels menu');
|
|
15767
|
+
section.onclick=e=>e.stopPropagation();
|
|
15768
|
+
section.onkeydown=e=>{if((e.key==='Enter'||e.key===' ')&&e.target.tagName==='BUTTON'){e.preventDefault();e.stopPropagation();if(!e.repeat)e.target.click();}};
|
|
15769
|
+
d.onclick=()=>{const open=d.getAttribute('aria-expanded')!=='true';d.setAttribute('aria-expanded',String(open));body.hidden=!open;d.querySelector('.pl-chevron').textContent=open?'▾':'▸';if(!open)d.focus();};
|
|
15770
|
+
document.getElementById('floToggleB').onclick=()=>setFloShownFromPage(!floShown());
|
|
15771
|
+
document.getElementById('floCardNote').textContent='Shown on Flo’s card. Several selected: a shared value, or Varies.';
|
|
15772
|
+
for(const r of body.querySelectorAll('[data-key]'))r.onclick=()=>{const k=r.dataset.key,want=floCardFields();setFloCardFields(want.includes(k)?want.filter(x=>x!==k):want.concat(k));};
|
|
15773
|
+
document.getElementById('floCardReset').onclick=()=>setFloCardFields(FloCard.FLO_CARD_DEFAULT);
|
|
15774
|
+
const size=document.getElementById('floSize'),sizeV=document.getElementById('floSizeV'),pct=floSizePct();
|
|
15775
|
+
size.value=pct;sizeV.textContent=pct+'%';
|
|
15776
|
+
size.addEventListener('input',()=>{const p=Math.round(Number(size.value));sizeV.textContent=p+'%';floSt().size=p;try{localStorage.setItem('steel:floSize:v2',String(p));}catch(_){}if(view3dReady)modelEditor.steel.setFloSize(p/100);});
|
|
15777
|
+
updFloCardRows();updFloToggle();}
|
|
15778
|
+
/* Flo size, in percent (Labels → Flo size): one setting for Flo and its card, stored per browser like Show Flo. The 3D view
|
|
15779
|
+
reads the same key when it starts (steel-3d-view.js floStoredSize), and the same range: anything else is 100%. */
|
|
15780
|
+
function floSizePct(){return floSt().size;}
|
|
15781
|
+
/* The shell pushes AI Chat's mood for this project (workspaces.js syncModelFlo): thinking, working, yourcall or idle. */
|
|
15782
|
+
window.flolessModelFlo=(state)=>{floShellMood=(state&&state.mood)||'idle';updFloToggle();try{modelEditor.steel.setFloMood(state&&state.mood);}catch(_){}};
|
|
15783
|
+
/* handleContractChanged lives outside this block and cannot see modelEditor: it reaches Flo through this. */
|
|
15784
|
+
window.flolessModelFloRemember=()=>{try{modelEditor.steel.floRemember();}catch(_){}};
|
|
15683
15785
|
document.getElementById('aiMarksToggleB').onclick=e=>{e.stopPropagation();showAiMarks=!showAiMarks;try{localStorage.setItem('steel:aiMarks:v2',showAiMarks?'1':'0');}catch(_){}updAiMarksToggle();render();}; // #2521 row 6: hides the 2D and 3D marks only; the strip and Inspect stay (owner ruling 2026-10-29)
|
|
15684
15786
|
document.getElementById('posGizmoToggleB').onclick=e=>{e.stopPropagation();showPosGizmo=!showPosGizmo;try{localStorage.setItem('steel:posGizmo:v2',showPosGizmo?'1':'0');}catch(_){}updPosGizmoToggle();if(view3dReady&&window.Steel3DView&&window.Steel3DView.setPositionGizmoVisible)window.Steel3DView.setPositionGizmoVisible(showPosGizmo);}; // the gizmo is a 3D overlay — push straight to the view (.stopPropagation keeps the menu open, like every .dtog)
|
|
15685
15787
|
// ⋯ Display → Grid label size. One setting, both views: 2D re-places its bubbles from the anchors baked
|
|
@@ -15755,7 +15857,7 @@ function updPlToggle(){const pl=C.prop_labels;if(!pl)return;reconcileActiveView(
|
|
|
15755
15857
|
// switches the menus show, so it cannot disagree with them: the 3D button follows Ref line + the 3D property-label
|
|
15756
15858
|
// switch, the 2D button follows the 2D plan's property-label switch only, whichever pane is active.
|
|
15757
15859
|
function updateLabelsBandMarks(){
|
|
15758
|
-
for(const [btnId,switchIds] of [['m3dView',['m3dRef','m3dPropLabels']],['pl2dBtn',['pl2dPropLabels']]]){
|
|
15860
|
+
for(const [btnId,switchIds] of [['m3dView',['m3dRef','m3dPropLabels','floToggleB']],['pl2dBtn',['pl2dPropLabels']]]){
|
|
15759
15861
|
// The 2D button is wired after the 3D shell at boot, so it is skipped until it is registered. Once registered it is
|
|
15760
15862
|
// required: a missing button then means the menu was wired against markup that was never drawn.
|
|
15761
15863
|
if(btnId==='pl2dBtn'&&!propLabelMenus.has('pl2d'))continue;
|
|
@@ -15789,6 +15891,7 @@ function render3DToolbarShell(){
|
|
|
15789
15891
|
bar.innerHTML=ViewportToolbar.renderToolbarMarkup(ModelEditor.steelRenderPlan());
|
|
15790
15892
|
wirePropLabelSection('m3dPl','m3dPropLabels','m3dPlDisclosure','m3dPlScope','3d');
|
|
15791
15893
|
updPlToggle();
|
|
15894
|
+
wireFloSection();
|
|
15792
15895
|
return bar;
|
|
15793
15896
|
}
|
|
15794
15897
|
render3DToolbarShell();
|
|
@@ -17185,6 +17288,18 @@ const view3dApi={
|
|
|
17185
17288
|
detailRequest('create',place,undefined,armedItems);},
|
|
17186
17289
|
onIsolateChange:()=>{updateIsolateBtn();refresh3DLegend();}, // every object-visibility change (isolate, group/part/selection hide, Show all) → refresh recovery control + legend rows
|
|
17187
17290
|
onWorkAreaChange:()=>updateWorkBtn(), // work area set / toggled → refresh the button + its checkbox
|
|
17291
|
+
// Flo's card (web/flo-card.js): the property registry's own values, so the card says exactly what Properties and the
|
|
17292
|
+
// property labels say. With several members selected and Flo on one of them, the card speaks for all of them by the
|
|
17293
|
+
// Properties pane's rule (shared value, Varies, or left out). Null when the member is gone or nothing chosen has a value.
|
|
17294
|
+
// Show Flo and Flo size as this page holds them (Labels menu), read when the 3D view is built.
|
|
17295
|
+
floSettings:()=>{const t=floSt();return {on:t.on,size:t.size};},
|
|
17296
|
+
floCardFor:id=>{if(!allMembers().some(x=>x.id===id))return null;
|
|
17297
|
+
const sel=propLabelSelection(),group=sel.length>1&&sel.some(x=>x.id===id)?sel:allMembers().filter(x=>x.id===id),look=projectedMemberLookup(),v={};
|
|
17298
|
+
const ms=group.map(b=>look(b.id)||b);
|
|
17299
|
+
for(const def of PROP_DEFS){if(!FloCard.FLO_CARD_FIELDS.includes(def.key))continue;
|
|
17300
|
+
const texts=ms.map(m=>{const raw=def.needsPlan&&!m.wp?(def.canonicalGet?def.canonicalGet(m):undefined):(def.labelGet||def.get)(m);return raw===undefined?undefined:def.fmt(raw);});
|
|
17301
|
+
const t=FloCard.aggregateFloCardValue(texts);if(t!==undefined)v[def.key]={label:def.label,text:t,varies:t===FloCard.VARIES&&ms.length>1};}
|
|
17302
|
+
return FloCard.floCardModel(v,floCardFields(),{count:ms.length});},
|
|
17188
17303
|
};
|
|
17189
17304
|
/*
|
|
17190
17305
|
* THE COMMON TOOLBAR'S FACADE over the 3D view (shared 3D editor, Task 1). Mounted HERE because this
|
|
@@ -28568,7 +28683,13 @@ async function rfiQuickRefile(versionN){
|
|
|
28568
28683
|
const filed=(body.outcomes||[]).filter(o=>['created','reused','reopened','successor'].includes(o.result)).length;
|
|
28569
28684
|
const notFiled=(body.outcomes||[]).filter(o=>o.result==='over-capacity'||o.result==='unplaceable').length;
|
|
28570
28685
|
toast(filed?filed+' question'+(filed===1?'':'s')+' filed as the AI\'s'+(notFiled?'; '+notFiled+' still could not be filed':'')+'.':notFiled?'Nothing more could be filed: '+notFiled+' still do not fit.':'Nothing was left to file.');
|
|
28571
|
-
}else
|
|
28686
|
+
}else{
|
|
28687
|
+
// #3097: the server's sentence when it wrote one for the person; an unexplained 5xx may have written some of them.
|
|
28688
|
+
const said=personText(body);
|
|
28689
|
+
toast(said?'These questions could not be filed: '+said+'. Nothing was changed.'
|
|
28690
|
+
:res.status>=500?'These questions could not be filed, and FloLess couldn’t tell whether any were written. Check the RFIs before filing them again.'
|
|
28691
|
+
:'These questions could not be filed: the RFI file could not be written. Nothing was changed.');
|
|
28692
|
+
}
|
|
28572
28693
|
}catch(e){console.error('[steel] could not retry filing the AI questions',e);toast('These questions could not be filed, because FloLess could not be reached. Nothing was changed.');}
|
|
28573
28694
|
// The button the pointer is over is replaced by the repaint, so no pointer-out ever hides its tip.
|
|
28574
28695
|
finally{rfiQuickRefileBusy=null;await refreshRfiRecords();if(rfiOpen())renderRfiList();if(window.__tip)window.__tip.hide();}
|
|
@@ -67,6 +67,82 @@
|
|
|
67
67
|
return node;
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
+
// #3131 F2: whether each card's exact inputs are open, kept by request id so a refreshed list keeps what the person chose.
|
|
71
|
+
const inputsOpen = new Map();
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* #3131 F2: a request's inputs exactly as they run: each key as it is spelled, each text as written, and a number, yes/no
|
|
75
|
+
* or empty value as its literal (a text that reads like one is quoted), and a list says it is one, so two different
|
|
76
|
+
* inputs never look the same.
|
|
77
|
+
*/
|
|
78
|
+
const inputsTree = (data) => {
|
|
79
|
+
const literal = (text) => { const span = document.createElement('span'); span.className = 'ai-chat-action-input-literal'; span.textContent = text; return span; };
|
|
80
|
+
const value = (v) => {
|
|
81
|
+
if (v !== null && typeof v === 'object') return inputsTree(v);
|
|
82
|
+
if (typeof v !== 'string') return literal(JSON.stringify(v));
|
|
83
|
+
return v === '' || v.trim() !== v || /^(true|false|null|-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?)$/.test(v) ? literal(JSON.stringify(v)) : document.createTextNode(v);
|
|
84
|
+
};
|
|
85
|
+
const entries = Array.isArray(data) ? data.map((v, i) => [`${i + 1}`, v]) : Object.entries(data);
|
|
86
|
+
if (!entries.length) return literal(Array.isArray(data) ? '[]' : '{}');
|
|
87
|
+
const list = document.createElement('dl');
|
|
88
|
+
list.className = 'assistant-card-result-list';
|
|
89
|
+
for (const [key, v] of entries) {
|
|
90
|
+
const dt = document.createElement('dt');
|
|
91
|
+
dt.textContent = key;
|
|
92
|
+
const dd = document.createElement('dd');
|
|
93
|
+
dd.append(value(v));
|
|
94
|
+
list.append(dt, dd);
|
|
95
|
+
}
|
|
96
|
+
if (!Array.isArray(data)) return list;
|
|
97
|
+
const items = document.createDocumentFragment();
|
|
98
|
+
items.append(literal(`list of ${data.length}`), list);
|
|
99
|
+
return items;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* #3131 F2: every input the request uses, as FloLess stored it: each value whole, or one too long to read named by its
|
|
104
|
+
* size and fingerprint (and listed by name). The summary may be shortened; this never is. Open from the start when the
|
|
105
|
+
* summary was cut or a value is named.
|
|
106
|
+
*/
|
|
107
|
+
const inputsBlock = (p, summary) => {
|
|
108
|
+
if (p.inputs === undefined || p.inputs === null || (typeof p.inputs === 'object' && !Object.keys(p.inputs).length)) return null;
|
|
109
|
+
const named = Array.isArray(p.inputsNamed) ? p.inputsNamed.map(String) : [];
|
|
110
|
+
if (!inputsOpen.has(p.id)) inputsOpen.set(p.id, p.summaryCut === true || named.length > 0);
|
|
111
|
+
const wrap = document.createElement('div');
|
|
112
|
+
wrap.className = 'ai-chat-action-inputs';
|
|
113
|
+
const toggle = button('', 'shell.terminal-request-inputs', p.id, summary, 'assistant-card-result-more');
|
|
114
|
+
toggle.dataset.tip = 'Shows every input this request uses.';
|
|
115
|
+
const body = document.createElement('div');
|
|
116
|
+
body.className = 'assistant-card-result-body assistant-card-result-full ai-chat-action-inputs-body';
|
|
117
|
+
body.id = `terminal-request-inputs-${p.id}`;
|
|
118
|
+
body.tabIndex = 0;
|
|
119
|
+
body.setAttribute('role', 'group');
|
|
120
|
+
body.setAttribute('aria-label', 'Exact inputs');
|
|
121
|
+
const note = (text) => {
|
|
122
|
+
const line = document.createElement('p');
|
|
123
|
+
line.className = 'ai-chat-filter-note ai-chat-action-inputs-note';
|
|
124
|
+
line.textContent = text;
|
|
125
|
+
body.append(line);
|
|
126
|
+
};
|
|
127
|
+
if (p.summaryCut === true) note('The summary above is shortened. Every input this request uses is listed here.');
|
|
128
|
+
if (named.length) note(`Too long to show here, but sent whole: ${named.join(', ')}. Each is named by its size and a fingerprint of its exact content.`);
|
|
129
|
+
const withheld = Array.isArray(p.inputsWithheld) ? p.inputsWithheld.map(String) : [];
|
|
130
|
+
if (withheld.length) note(`Not shown because it looks like a password or key, but sent as given: ${withheld.join(', ')}.`);
|
|
131
|
+
if (typeof p.inputs === 'object') body.append(inputsTree(p.inputs));
|
|
132
|
+
else note(String(p.inputs));
|
|
133
|
+
const show = (open) => {
|
|
134
|
+
inputsOpen.set(p.id, open);
|
|
135
|
+
body.hidden = !open;
|
|
136
|
+
toggle.textContent = open ? 'Hide exact inputs' : 'Show exact inputs';
|
|
137
|
+
toggle.setAttribute('aria-expanded', String(open));
|
|
138
|
+
};
|
|
139
|
+
toggle.setAttribute('aria-controls', body.id);
|
|
140
|
+
toggle.addEventListener('click', () => show(!inputsOpen.get(p.id)));
|
|
141
|
+
show(inputsOpen.get(p.id));
|
|
142
|
+
wrap.append(toggle, body);
|
|
143
|
+
return wrap;
|
|
144
|
+
};
|
|
145
|
+
|
|
70
146
|
const ago = (iso) => {
|
|
71
147
|
const mins = Math.max(0, Math.round((Date.now() - Date.parse(iso)) / 60000));
|
|
72
148
|
return mins < 1 ? 'Asked just now' : mins === 1 ? 'Asked 1 minute ago' : mins < 60 ? `Asked ${mins} minutes ago` : 'Asked over an hour ago';
|
|
@@ -290,6 +366,8 @@
|
|
|
290
366
|
terms.append(label, document.createTextNode(String(p.terms)));
|
|
291
367
|
node.append(terms);
|
|
292
368
|
}
|
|
369
|
+
const exact = inputsBlock(p, summary);
|
|
370
|
+
if (exact) node.append(exact);
|
|
293
371
|
|
|
294
372
|
if (handedOver(p)) {
|
|
295
373
|
node.classList.add('is-handed-over');
|
package/dist/web/tool-updates.js
CHANGED
|
@@ -343,10 +343,11 @@
|
|
|
343
343
|
});
|
|
344
344
|
if (!res.ok && body.ok !== true && !body.results) {
|
|
345
345
|
// The server's own words when it gave some; otherwise the shared failure sentence, never "HTTP 500".
|
|
346
|
-
var
|
|
346
|
+
var said = typeof personText === 'function' ? personText(body) : '';
|
|
347
|
+
var error = new Error(said || callFailureText({ status: res.status, body: body }, readOnly));
|
|
347
348
|
error.body = body;
|
|
348
349
|
error.status = res.status;
|
|
349
|
-
error.serverText = Boolean(
|
|
350
|
+
error.serverText = Boolean(said) && body.code !== 'response-unreadable';
|
|
350
351
|
throw error;
|
|
351
352
|
}
|
|
352
353
|
return body;
|
package/dist/web/vector-3d.html
CHANGED
|
@@ -253,7 +253,7 @@ function boot(v3d) {
|
|
|
253
253
|
// Reconstructing only reads the stored drawing, so the shared sentence may offer a retry.
|
|
254
254
|
function sceneFailureText(e) {
|
|
255
255
|
const action = 'reconstruct the drawing in 3D';
|
|
256
|
-
const said = e && e.body
|
|
256
|
+
const said = personText(e && e.body);
|
|
257
257
|
if (said) return 'Couldn’t ' + action + '. ' + (/[.!?]$/.test(said) ? said : said + '.');
|
|
258
258
|
return failureCopy(e, { action: action, retrySafe: true }).text;
|
|
259
259
|
}
|
|
@@ -180,6 +180,7 @@
|
|
|
180
180
|
/* Save conflict — the drawing moved under us. NOT .err: the user's document is fine, so it takes the
|
|
181
181
|
existing cyan "non-default, click to act" chip rather than the red failure colour. */
|
|
182
182
|
#saveStat.conflict{color:var(--cyan);border:1px solid var(--cyan);background:var(--cyan-soft);border-radius:4px;padding:1px 6px;cursor:pointer}
|
|
183
|
+
#saveStat.conflict:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
|
|
183
184
|
/* Weak-trace review list (inner scroll box — inherits the themed scrollbar rules above). */
|
|
184
185
|
#weakList{max-height:280px;overflow:auto;display:flex;flex-direction:column;gap:2px;margin-top:4px}
|
|
185
186
|
.wrow{display:flex;align-items:center;gap:6px;padding:4px 6px;border-radius:6px;font-size:12px}
|
|
@@ -257,9 +258,10 @@
|
|
|
257
258
|
<script src="commands-vector.js"></script>
|
|
258
259
|
<script src="instructor-reporter.js"></script>
|
|
259
260
|
<script>window.InstructorReporter.mount({ surface: 'vector-editor' });</script>
|
|
260
|
-
<!-- An Esc this page leaves unused closes the shell's editor overlay (#1571).
|
|
261
|
+
<!-- An Esc this page leaves unused closes the shell's editor overlay (#1571). While the save-conflict bar or its
|
|
262
|
+
overwrite question is up, Esc is theirs (#3143): it closes the question, then the bar, never the editor. -->
|
|
261
263
|
<script src="overlay-escape.js"></script>
|
|
262
|
-
<script>window.OverlayEscape.mount();</script>
|
|
264
|
+
<script>window.OverlayEscape.mount({ idle: function () { return !document.getElementById('conflictConfirm') && !document.getElementById('conflictBanner'); } });</script>
|
|
263
265
|
<script>
|
|
264
266
|
(function () {
|
|
265
267
|
'use strict';
|
|
@@ -457,13 +459,19 @@
|
|
|
457
459
|
function setSaved(state) {
|
|
458
460
|
if (!editable) return;
|
|
459
461
|
const el = $('saveStat'); el.hidden = false; el.classList.remove('dirty', 'err', 'conflict');
|
|
460
|
-
el.removeAttribute('data-tip'); el.onclick = null;
|
|
462
|
+
el.removeAttribute('data-tip'); el.onclick = null; el.onkeydown = null;
|
|
463
|
+
for (const a of ['data-command-id', 'role', 'tabindex', 'aria-label']) el.removeAttribute(a);
|
|
461
464
|
if (state === 'dirty') { el.classList.add('dirty'); el.textContent = 'Saving…'; }
|
|
462
465
|
else if (state === 'err') { el.classList.add('err'); el.textContent = 'Save failed'; }
|
|
463
466
|
else if (state === 'conflict') {
|
|
464
467
|
el.classList.add('conflict'); el.textContent = 'Save conflict';
|
|
465
468
|
el.dataset.tip = 'Someone else saved changes to this drawing since you opened it. Your edits are still here — click to choose what to do.';
|
|
466
469
|
el.onclick = () => showConflictBanner(); // the chip never acts on its own; it re-opens the banner
|
|
470
|
+
// A control only while it is this — and a keyboard one: Esc hides the bar, and this is the way back to it.
|
|
471
|
+
el.setAttribute('data-command-id', 'vector.save-conflict');
|
|
472
|
+
el.setAttribute('role', 'button'); el.tabIndex = 0;
|
|
473
|
+
el.setAttribute('aria-label', 'Save conflict: show what you can do');
|
|
474
|
+
el.onkeydown = (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); showConflictBanner(); } };
|
|
467
475
|
}
|
|
468
476
|
else el.textContent = 'Saved';
|
|
469
477
|
}
|
|
@@ -545,11 +553,15 @@
|
|
|
545
553
|
b.textContent = text; return b;
|
|
546
554
|
};
|
|
547
555
|
const reload = mk('↻ Reload', true); reload.onclick = () => location.reload();
|
|
556
|
+
reload.setAttribute('data-command-id', 'vector.conflict-reload');
|
|
548
557
|
const dismiss = mk('✕', false); dismiss.onclick = () => bar.remove();
|
|
558
|
+
dismiss.setAttribute('data-command-id', 'vector.conflict-dismiss');
|
|
559
|
+
dismiss.setAttribute('aria-label', 'Hide this message');
|
|
549
560
|
if (allowOverwrite === false) {
|
|
550
561
|
bar.append(msg, reload, dismiss);
|
|
551
562
|
} else {
|
|
552
563
|
const over = mk('Save mine anyway', false);
|
|
564
|
+
over.setAttribute('data-command-id', 'vector.conflict-save-mine');
|
|
553
565
|
over.dataset.tip = 'Replace the version someone else saved with what you have here';
|
|
554
566
|
over.onclick = () => confirmOverwrite();
|
|
555
567
|
bar.append(msg, reload, over, dismiss);
|
|
@@ -565,29 +577,59 @@
|
|
|
565
577
|
* clobber it with one stray click.
|
|
566
578
|
*/
|
|
567
579
|
function confirmOverwrite() {
|
|
580
|
+
if ($('conflictConfirm')) return;
|
|
581
|
+
const opener = document.activeElement;
|
|
568
582
|
const back = document.createElement('div');
|
|
583
|
+
back.id = 'conflictConfirm';
|
|
584
|
+
back.setAttribute('role', 'dialog'); back.setAttribute('aria-modal', 'true'); back.setAttribute('aria-labelledby', 'vcfTitle'); back.setAttribute('aria-describedby', 'vcfBody');
|
|
569
585
|
back.style.cssText = 'position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center';
|
|
570
586
|
const shade = document.createElement('div');
|
|
571
587
|
shade.style.cssText = 'position:absolute;inset:0;background:rgba(2,8,23,.62)';
|
|
572
588
|
const panel = document.createElement('div');
|
|
573
589
|
panel.style.cssText = 'position:relative;background:var(--panel,#0f172a);border:1px solid var(--line,#1e293b);'
|
|
574
590
|
+ 'border-radius:10px;width:min(520px,92vw);box-shadow:0 20px 60px rgba(0,0,0,.6)';
|
|
575
|
-
panel.innerHTML = '<div style="padding:14px 16px;border-bottom:1px solid var(--line,#1e293b);font-weight:600">Overwrite the other changes?</div>'
|
|
576
|
-
+ '<div style="padding:14px 16px;line-height:1.5">Someone else saved a version of this drawing after you opened yours. '
|
|
591
|
+
panel.innerHTML = '<div id=vcfTitle style="padding:14px 16px;border-bottom:1px solid var(--line,#1e293b);font-weight:600">Overwrite the other changes?</div>'
|
|
592
|
+
+ '<div id=vcfBody style="padding:14px 16px;line-height:1.5">Someone else saved a version of this drawing after you opened yours. '
|
|
577
593
|
+ 'Saving now replaces their version with what you see here — their changes will be gone for good.</div>'
|
|
578
594
|
+ '<div style="padding:12px 16px;display:flex;gap:8px;justify-content:flex-end;border-top:1px solid var(--line,#1e293b)">'
|
|
579
|
-
+ '<button id=vcfCancel>Cancel</button>'
|
|
580
|
-
+ '<button id=vcfGo style="background:#7f1d1d;border-color:#991b1b;color:#fecaca">Overwrite and save</button></div>';
|
|
595
|
+
+ '<button data-command-id="vector.overwrite-cancel" id=vcfCancel>Cancel</button>'
|
|
596
|
+
+ '<button data-command-id="vector.overwrite-save" id=vcfGo style="background:#7f1d1d;border-color:#991b1b;color:#fecaca">Overwrite and save</button></div>';
|
|
581
597
|
back.append(shade, panel);
|
|
582
598
|
document.body.appendChild(back);
|
|
583
|
-
|
|
599
|
+
// Back to the control that asked, so a keyboard user lands where they were — not on the page itself.
|
|
600
|
+
const close = () => { back.remove(); if (opener && opener.isConnected && typeof opener.focus === 'function') opener.focus(); };
|
|
601
|
+
back.__close = close;
|
|
584
602
|
shade.onclick = close;
|
|
585
603
|
panel.querySelector('#vcfCancel').onclick = close;
|
|
586
604
|
panel.querySelector('#vcfGo').onclick = async () => {
|
|
587
605
|
close(); conflicted = false; await doPut(true);
|
|
588
606
|
const bar = document.getElementById('conflictBanner'); if (bar) bar.remove();
|
|
589
607
|
};
|
|
608
|
+
// Tab stays on the question's two buttons: behind it is an editor whose edits are not saved.
|
|
609
|
+
back.addEventListener('keydown', (e) => {
|
|
610
|
+
if (e.key !== 'Tab') return;
|
|
611
|
+
const btns = [panel.querySelector('#vcfCancel'), panel.querySelector('#vcfGo')];
|
|
612
|
+
const at = btns.indexOf(document.activeElement);
|
|
613
|
+
e.preventDefault();
|
|
614
|
+
btns[(at + (e.shiftKey ? btns.length - 1 : 1)) % btns.length].focus();
|
|
615
|
+
});
|
|
616
|
+
panel.querySelector('#vcfCancel').focus(); // the safe answer is the one Enter presses
|
|
590
617
|
}
|
|
618
|
+
// Esc closes the topmost of the two (#3143): the overwrite question first, then the bar. Either way the press is
|
|
619
|
+
// marked used (preventDefault, the forwarder's contract), so it never also closes the shell's editor overlay over
|
|
620
|
+
// edits that are not saved. With both gone, the next Esc goes up — and Close asks about the conflict.
|
|
621
|
+
window.addEventListener('keydown', (e) => {
|
|
622
|
+
if (e.key !== 'Escape' || e.defaultPrevented) return;
|
|
623
|
+
const ask = $('conflictConfirm'); const bar = $('conflictBanner');
|
|
624
|
+
if (!ask && !bar) return;
|
|
625
|
+
e.preventDefault();
|
|
626
|
+
if (ask) { ask.__close(); return; }
|
|
627
|
+
const hadFocus = bar.contains(document.activeElement);
|
|
628
|
+
bar.remove();
|
|
629
|
+
// Focus would fall to the page; the chip that brings the bar back is the nearer place to land.
|
|
630
|
+
const chip = $('saveStat');
|
|
631
|
+
if (hadFocus && chip && chip.getAttribute('role') === 'button') chip.focus();
|
|
632
|
+
});
|
|
591
633
|
let pendingWrites = 0; // queued or in-flight PUTs — contractSaveState() reads 'saving' until they settle
|
|
592
634
|
function persistServer() {
|
|
593
635
|
if (!editable || !C) return Promise.resolve(true);
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
const response = await fetch(path, { credentials: 'same-origin', headers: { 'content-type': 'application/json' },
|
|
53
53
|
...(body === undefined ? {} : { method: 'POST', body: JSON.stringify(body) }) });
|
|
54
54
|
const result = await response.json();
|
|
55
|
-
if (!response.ok || result.ok === false) throw new Error(result
|
|
55
|
+
if (!response.ok || result.ok === false) throw new Error(personText(result) || 'FloLess could not review this directory. Try again.');
|
|
56
56
|
return result;
|
|
57
57
|
}
|
|
58
58
|
function button(action, text, command, attrs = '', row = null) {
|