@floless/app 0.137.1 → 0.137.3
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 +879 -640
- package/dist/web/app.css +21 -0
- package/dist/web/commands-shell.js +11 -0
- package/dist/web/steel-editor.html +127 -10
- package/dist/web/workspaces.js +81 -1
- package/package.json +1 -1
package/dist/web/app.css
CHANGED
|
@@ -5184,6 +5184,27 @@ table.hist tr.current td { background:var(--accent-soft); }
|
|
|
5184
5184
|
.hist-change-list li::marker { color:var(--text-dim); }
|
|
5185
5185
|
.hist-change-list .hist-change-more { color:var(--text-dim); font-style:italic; }
|
|
5186
5186
|
.hist-change-caution { margin-top:5px; color:var(--warn); font-size:11px; }
|
|
5187
|
+
/* An audit NOTE, deliberately not the amber caution above. `--warn` is this pane's "you may want to
|
|
5188
|
+
act on this" register; a read that filled in what the saved checkpoint never stated is a fact the
|
|
5189
|
+
owner should know and nothing to act on, so it takes the neutral accent-dim rail `.hist-working`
|
|
5190
|
+
and `.hist-empty` already use for "absence of a signature, not an error". Same tokens, no new
|
|
5191
|
+
colour — the two registers just have to be told apart at a glance when a version carries both. */
|
|
5192
|
+
.hist-change-note { margin-top:6px; padding:7px 10px; background:var(--surface-2); border:1px solid var(--border);
|
|
5193
|
+
border-left:3px solid var(--accent-dim); border-radius:6px; font-size:11px; color:var(--text-muted); }
|
|
5194
|
+
.hist-change-note strong { color:var(--text); font-weight:600; }
|
|
5195
|
+
.hist-change-tech { margin-top:6px; color:var(--text-dim); }
|
|
5196
|
+
/* The native disclosure triangle is a browser default and must not leak through — every other
|
|
5197
|
+
<details> in this app hides it and supplies its own caret (.req-technical, .req-run-output,
|
|
5198
|
+
.ws-archived-summary, .kb-adjust-summary, .import-failed-summary). Follows that majority rather
|
|
5199
|
+
than .approval-tech, which is an unthemed pre-existing gap. */
|
|
5200
|
+
.hist-change-tech > summary { width:max-content; max-width:100%; cursor:pointer; color:var(--text-muted);
|
|
5201
|
+
user-select:none; list-style:none; }
|
|
5202
|
+
.hist-change-tech > summary::-webkit-details-marker { display:none; }
|
|
5203
|
+
.hist-change-tech > summary::before { content:'▸'; margin-right:6px; color:var(--text-dim); }
|
|
5204
|
+
.hist-change-tech[open] > summary::before { content:'▾'; }
|
|
5205
|
+
.hist-change-tech > summary:hover { color:var(--text); }
|
|
5206
|
+
.hist-change-tech > summary:focus-visible { color:var(--text); outline:2px solid var(--accent); outline-offset:2px; border-radius:2px; }
|
|
5207
|
+
.hist-change-tech .hist-change-more { display:block; margin-top:3px; font-style:italic; }
|
|
5187
5208
|
.hist .btn-mini, .ws-drawings-bar .btn-mini, .ws-revision-card .btn-mini, .modal.revreview .btn-mini { background:none; border:1px solid var(--border-strong); color:var(--text-muted); border-radius:6px;
|
|
5188
5209
|
padding:4px 10px; font-size:11px; cursor:pointer; white-space:nowrap; }
|
|
5189
5210
|
.hist .btn-mini:hover, .ws-drawings-bar .btn-mini:hover, .ws-revision-card .btn-mini:hover, .modal.revreview .btn-mini:hover { color:var(--text); border-color:var(--accent); }
|
|
@@ -675,6 +675,17 @@
|
|
|
675
675
|
why: 'Close keeps the review. This separate action asks for confirmation before removing it.',
|
|
676
676
|
});
|
|
677
677
|
|
|
678
|
+
def('shell.history-authored-fields', {
|
|
679
|
+
label: 'Which fields (technical)',
|
|
680
|
+
actsOn: 'Expands the exact contract paths this read filled in beyond the saved Drawing Filter for {instance}',
|
|
681
|
+
group: 'In the project workspace',
|
|
682
|
+
persistence: 'none',
|
|
683
|
+
interaction: 'mode',
|
|
684
|
+
risk: [],
|
|
685
|
+
guidance: 'on-demand',
|
|
686
|
+
why: 'The note above it says WHAT KIND of field was supplied; this lists the exact ones, for whoever wants the evidence rather than the summary.',
|
|
687
|
+
});
|
|
688
|
+
|
|
678
689
|
def('shell.revision-failure-dismiss', {
|
|
679
690
|
label: 'Dismiss failed drawing read',
|
|
680
691
|
actsOn: 'Removes this failed drawing-read request from the project workspace',
|
|
@@ -2451,6 +2451,50 @@ function draftKey() {
|
|
|
2451
2451
|
* true, so the offered copy is parked somewhere nothing else writes.
|
|
2452
2452
|
*/
|
|
2453
2453
|
function offeredKey() { return draftKey() + '|offered'; }
|
|
2454
|
+
/**
|
|
2455
|
+
* Every server-issued tag this browser has unsaved edits recorded against — the live draft row and the
|
|
2456
|
+
* PARKED offer, deduplicated.
|
|
2457
|
+
*
|
|
2458
|
+
* WHY THE PAGE READS THEM BEFORE IT HAS A DOCUMENT. A draft autosaved by a build in the #938→#955
|
|
2459
|
+
* identity window records that build's spelling of a contract that has not changed since (#957), and
|
|
2460
|
+
* an exact comparison against the tag a fresh read hands us today would report the model as having
|
|
2461
|
+
* moved when nothing touched it — parking the user's edits behind a banner that says something false.
|
|
2462
|
+
* Whether a recorded tag still NAMES a generation is one server function's business
|
|
2463
|
+
* (`recordedEtagNamesContract`), so boot asks that question in the same read that fetches the document
|
|
2464
|
+
* rather than learning the other spelling and comparing here. See the snapshot route's `recordedEtag`.
|
|
2465
|
+
*
|
|
2466
|
+
* BOTH ROWS, and the parked one is the whole point rather than an afterthought (found in UX review).
|
|
2467
|
+
* The false refusal this fixes has ALREADY happened for anyone who booted a post-#955 build with a
|
|
2468
|
+
* v0.137.0 draft: their edits were moved to the offered row and the live row cleared. Asking only about
|
|
2469
|
+
* the live row would heal the users the bug had not reached yet and leave the reported ones re-offered
|
|
2470
|
+
* on every boot forever — and one click from a genuine 412, because taking the offer rewinds
|
|
2471
|
+
* `serverEtag` to a spelling the next save would send as `If-Match`.
|
|
2472
|
+
*
|
|
2473
|
+
* Best-effort: unreadable storage simply asks nothing, and the exact comparison stands — which is
|
|
2474
|
+
* today's behaviour, not a new failure mode.
|
|
2475
|
+
*/
|
|
2476
|
+
function draftBaseEtags() {
|
|
2477
|
+
const baseOf = (key) => {
|
|
2478
|
+
try {
|
|
2479
|
+
const raw = localStorage.getItem(key);
|
|
2480
|
+
if (!raw) return null;
|
|
2481
|
+
const d = JSON.parse(raw);
|
|
2482
|
+
return (d && typeof d.baseEtag === 'string' && d.baseEtag) ? d.baseEtag : null;
|
|
2483
|
+
} catch (_) { return null; }
|
|
2484
|
+
};
|
|
2485
|
+
return [...new Set([baseOf(draftKey()), baseOf(offeredKey())].filter(Boolean))];
|
|
2486
|
+
}
|
|
2487
|
+
/**
|
|
2488
|
+
* Does a row's recorded base still name the generation boot just loaded?
|
|
2489
|
+
*
|
|
2490
|
+
* BOUND to the exact tag: the verdict list answers the tags boot asked about, and a row can be
|
|
2491
|
+
* rewritten between the request and the restore. A positional or unbound answer would be a claim
|
|
2492
|
+
* about nothing in particular.
|
|
2493
|
+
*/
|
|
2494
|
+
function baseNamesLoaded(baseEtag, verdicts) {
|
|
2495
|
+
if (!baseEtag || !Array.isArray(verdicts)) return false;
|
|
2496
|
+
return verdicts.some((v) => v && v.recorded === baseEtag && v.namesSnapshot === true);
|
|
2497
|
+
}
|
|
2454
2498
|
/**
|
|
2455
2499
|
* Re-point the stored draft at the server version it is now a delta from.
|
|
2456
2500
|
*
|
|
@@ -3081,7 +3125,15 @@ async function boot() {
|
|
|
3081
3125
|
import('./steel-catalog-picker.js'), import('./connection-review-client.js'), import('./steel-profile-colours.js'),
|
|
3082
3126
|
import('./steel-reference-sheet.js'), import('./steel-read-confidence.js'),
|
|
3083
3127
|
]);
|
|
3084
|
-
|
|
3128
|
+
// The recorded bases ride along so the read can answer whether each still names what it is about to
|
|
3129
|
+
// serve — see draftBaseEtags(). The separator is computed rather than assumed: CONTRACT_QS is EMPTY
|
|
3130
|
+
// on the app-keyed URL, where a literal '&' would make the value part of the path query.
|
|
3131
|
+
const recordedAtBoot = draftBaseEtags();
|
|
3132
|
+
const snapshotQS = recordedAtBoot.reduce(
|
|
3133
|
+
(qs, tag) => qs + (qs ? '&' : '?') + 'recordedEtag=' + encodeURIComponent(tag),
|
|
3134
|
+
CONTRACT_QS,
|
|
3135
|
+
);
|
|
3136
|
+
const res = await fetch('/api/contract/' + encodeURIComponent(APP_ID) + '/snapshot' + snapshotQS);
|
|
3085
3137
|
// 204 = the project-scoped "nothing stored yet", the quiet twin of the generic 404 below. It carries
|
|
3086
3138
|
// no body and no code, so it routes straight to the same empty state rather than through the
|
|
3087
3139
|
// publication-code branches, which only an app-keyed read can produce.
|
|
@@ -3192,6 +3244,13 @@ async function boot() {
|
|
|
3192
3244
|
// The server's tag for the contract we just read. Every write echoes it back, so a write that would
|
|
3193
3245
|
// land on top of someone else's is refused instead of silently winning.
|
|
3194
3246
|
serverEtag = snapshotPayload.etag || res.headers.get('ETag');
|
|
3247
|
+
/* The answer to the question above, and it stays a LOCAL on purpose. `serverEtag` advances through
|
|
3248
|
+
every write path on this page; a module-level copy of a boot-time verdict would outlive the
|
|
3249
|
+
generation it describes, and a later restore could then overlay a draft from generation A onto
|
|
3250
|
+
generation B — silently, which is the one failure the whole draft-base machinery exists to stop.
|
|
3251
|
+
It is handed to main() and goes out of scope. It is a BOOLEAN plus the tag it is about, never the
|
|
3252
|
+
other spelling, so there is nothing here that could be mistaken for an If-Match. */
|
|
3253
|
+
const recordedBaseVerdicts = Array.isArray(snapshotPayload.recordedBases) ? snapshotPayload.recordedBases : [];
|
|
3195
3254
|
serverRevision = Number.isSafeInteger(snapshotPayload.storeRevision) ? snapshotPayload.storeRevision : -1;
|
|
3196
3255
|
/* The review summary rides the SAME envelope, read atomically with the contract under the project lock,
|
|
3197
3256
|
and is installed INDEPENDENTLY of the contract revision — a sign-off leaves storeRevision exactly
|
|
@@ -3243,7 +3302,7 @@ async function boot() {
|
|
|
3243
3302
|
if(!Array.isArray(C.views))C.views=[]; // model-global saved views (Views Organizer): ensure an array in boot()'s OUTER scope (like dims3d/detail_placements above). The array-guard is all this path needs — `C` here is the server-validated contract, so its views have already passed `$defs.view`. `sanitizeViews()` is for the path that has NOT been validated: the localStorage draft, via DRAFT_SANITIZERS in applyDraftFields (#854).
|
|
3244
3303
|
// Reference models (#278) are always a model-level array in the native contract.
|
|
3245
3304
|
if(!Array.isArray(C.reference_models))C.reference_models=[];
|
|
3246
|
-
main(); // (C.prop_labels is normalised inside main(), right after the PROP_DEFS/sanitizePropLabels registry is defined — see ~"normalise the contract's incoming value" — since that helper isn't in scope out here in boot())
|
|
3305
|
+
main(recordedBaseVerdicts); // (C.prop_labels is normalised inside main(), right after the PROP_DEFS/sanitizePropLabels registry is defined — see ~"normalise the contract's incoming value" — since that helper isn't in scope out here in boot())
|
|
3247
3306
|
contractBootSnapshotInstalled=true;
|
|
3248
3307
|
contractEventReady=true;
|
|
3249
3308
|
drainContractEvents(contractEventEpoch);
|
|
@@ -3414,7 +3473,7 @@ function showAiUpdateBanner(message, opts) {
|
|
|
3414
3473
|
msg.textContent = sentence;
|
|
3415
3474
|
}
|
|
3416
3475
|
|
|
3417
|
-
function main() {
|
|
3476
|
+
function main(bootRecordedBase) {
|
|
3418
3477
|
let P, X0,Y0,X1,Y1, FT, RB64, EXTX, EXTY, profs, NO_PLAN_VIEW=false; // per-plan, set by setPlan()
|
|
3419
3478
|
let v2IdSeq=0;
|
|
3420
3479
|
const newModelId=()=>`m-v2-${Date.now().toString(36)}-${(v2IdSeq++).toString(36)}`;
|
|
@@ -4412,6 +4471,10 @@ function dataSig(){return C.plans.map(p=>viewIdOf(p)+':'+((p.segments||[]).lengt
|
|
|
4412
4471
|
let saveT=null, saveSeq=0; // saveSeq: monotonic id per server save. Only the LATEST save's response may set the pill — an older in-flight PUT that resolves late must not overwrite a newer verdict (e.g. a stale 'ok' clobbering a fresh 'err').
|
|
4413
4472
|
function setSaved(state,msg){const el=document.getElementById('saveStat');if(!el)return;el.classList.remove('dirty','ok','err','conflict');
|
|
4414
4473
|
el.removeAttribute('data-tip'); el.onclick=null;
|
|
4474
|
+
// The markup's own tip says what this chip MEANS, and every state below used to drop it — so the one
|
|
4475
|
+
// state a user is most likely to hover, 'Restored ✓' after their unsaved edits came back, explained
|
|
4476
|
+
// nothing at all (UX review). Restored for every state except 'conflict', which sets its own.
|
|
4477
|
+
if(state!=='conflict')el.dataset.tip='Edits auto-save in this browser (localStorage)';
|
|
4415
4478
|
if(state==='ok'){el.classList.add('ok');el.textContent=msg||'Saved ✓';}
|
|
4416
4479
|
else if(state==='dirty'){el.classList.add('dirty');el.textContent='Saving…';}
|
|
4417
4480
|
else if(state==='err'){el.classList.add('err');el.textContent='Save failed';}
|
|
@@ -5041,8 +5104,8 @@ function showStaleDraftBanner(d){
|
|
|
5041
5104
|
* only on the load that first detected it — otherwise a user who reloads instead of answering the bar
|
|
5042
5105
|
* loses track of edits the bar told them were still saved.
|
|
5043
5106
|
*/
|
|
5044
|
-
function restoreSaved(){
|
|
5045
|
-
const applied=restoreSavedInner();
|
|
5107
|
+
function restoreSaved(recordedBases){
|
|
5108
|
+
const applied=restoreSavedInner(recordedBases);
|
|
5046
5109
|
try{
|
|
5047
5110
|
const oraw=localStorage.getItem(offeredKey());
|
|
5048
5111
|
if(oraw){
|
|
@@ -5057,7 +5120,45 @@ function restoreSaved(){
|
|
|
5057
5120
|
// applyDraftFields overlays per SHEET, so offering a draft built against a different dataset
|
|
5058
5121
|
// would let the user apply edits that cannot fit — the very masking the live gate prevents,
|
|
5059
5122
|
// reachable through the parked copy instead.
|
|
5060
|
-
if(draftFits(od))
|
|
5123
|
+
if(draftFits(od)){
|
|
5124
|
+
// A PARKED ROW WHOSE BASE STILL NAMES THIS GENERATION was parked by the very refusal this
|
|
5125
|
+
// fix removes (#957) — a post-#955 build meeting a v0.137.0 draft. Re-offering it would
|
|
5126
|
+
// repeat the false claim on every boot, and taking the offer rewinds `serverEtag` to that
|
|
5127
|
+
// spelling. So put it back the way the live row is put back: apply, re-stamp, un-park.
|
|
5128
|
+
//
|
|
5129
|
+
// ONLY INTO AN EMPTY LIVE SLOT, which is the correction review had to make and the reason
|
|
5130
|
+
// this is not simply `if(namesLoaded&&applies)`. `restoreSavedInner` returns false on three
|
|
5131
|
+
// paths that deliberately LEAVE a row in the live slot — a draft that does not fit, a draft
|
|
5132
|
+
// that fails validation, and a stale draft not parked because an offer already existed — and
|
|
5133
|
+
// writing LSKEY there overwrote the user's NEWER edits with this older copy. Reproduced
|
|
5134
|
+
// against the harness, and reachable with no identity window involved at all: a History
|
|
5135
|
+
// revert moves the working copy back, at which point a parked row names the live document
|
|
5136
|
+
// exactly while a newer live row does not. Same 'first one wins' discipline the park branch
|
|
5137
|
+
// states two screens down; discarding the user's only copy is the trade this item refuses.
|
|
5138
|
+
//
|
|
5139
|
+
// And only when it actually applied: un-parking a draft that did not go back would drop the
|
|
5140
|
+
// copy the banner promised was still saved.
|
|
5141
|
+
const liveSlotEmpty=(()=>{try{return localStorage.getItem(LSKEY)==null;}catch(_){return false;}})();
|
|
5142
|
+
if(baseNamesLoaded(od.baseEtag,recordedBases)){
|
|
5143
|
+
if(liveSlotEmpty&&applyDraftFields(od)){
|
|
5144
|
+
try{localStorage.setItem(LSKEY,JSON.stringify({...od,baseEtag:serverEtag}));localStorage.removeItem(offeredKey());}
|
|
5145
|
+
catch(_){/* the edits are on screen; storage catches up on the next persist() */}
|
|
5146
|
+
return true;
|
|
5147
|
+
}
|
|
5148
|
+
// NOT OFFERED, and this is the point of the whole item rather than an omission: this row's
|
|
5149
|
+
// base names the loaded generation, so "This model has changed since you last edited it
|
|
5150
|
+
// here" would be FALSE about it — the exact sentence #957 exists to stop. It is kept, not
|
|
5151
|
+
// discarded (a newer live row may restore instead, or a rollback may make this one
|
|
5152
|
+
// applicable), and said out loud, exactly as a row that does not FIT is treated.
|
|
5153
|
+
// WORDED FROM WHAT THE GATE ACTUALLY TESTED (review round 2). An earlier sentence named
|
|
5154
|
+
// the two cases it expected — 'a newer draft holds the live slot' — and a third reaches
|
|
5155
|
+
// here: unparseable bytes in that slot, which `restoreSavedInner` leaves in place and the
|
|
5156
|
+
// presence-only gate counts as occupied. Naming causes the code did not establish is the
|
|
5157
|
+
// same fault as the banner this whole item exists to remove, one log line down.
|
|
5158
|
+
console.warn('steel-editor: parked edits still match this model’s current version but were not put back — the live draft slot is occupied, or the edits no longer apply to this document as it stands');
|
|
5159
|
+
}
|
|
5160
|
+
else showStaleDraftBanner(od);
|
|
5161
|
+
}
|
|
5061
5162
|
// Deliberately NOT deleted when it does not fit. dataSig() is derived from the server document,
|
|
5062
5163
|
// and a rollback can restore the dataset these edits were built against — at which point they
|
|
5063
5164
|
// become offerable again. An unofferable row is one small row per store; discarding the user's
|
|
@@ -5078,7 +5179,7 @@ function restoreSaved(){
|
|
|
5078
5179
|
* The overlay is per sheet, so it is meaningless if the sheets moved; dataSig() is that check.
|
|
5079
5180
|
*/
|
|
5080
5181
|
function draftFits(d){return !!(d&&typeof d==='object'&&d.sig===dataSig());}
|
|
5081
|
-
function restoreSavedInner(){
|
|
5182
|
+
function restoreSavedInner(recordedBases){
|
|
5082
5183
|
try{const raw=localStorage.getItem(LSKEY);if(!raw)return false;const d=JSON.parse(raw);
|
|
5083
5184
|
// Structural first: the overlay is per sheet, so it is meaningless if sheets moved.
|
|
5084
5185
|
if(!draftFits(d)){
|
|
@@ -5089,7 +5190,17 @@ function restoreSavedInner(){
|
|
|
5089
5190
|
// Then the real base check. `serverEtag` is the tag boot() just read — main() is called synchronously
|
|
5090
5191
|
// from boot() and nothing writes before this point, so it has not been advanced by a save yet. (If a
|
|
5091
5192
|
// future change schedules a write earlier, this comparison silently starts meaning something else.)
|
|
5092
|
-
|
|
5193
|
+
//
|
|
5194
|
+
// THE QUESTION IS "DOES THIS RECORDED TAG NAME THE LOADED GENERATION", not "is it the same string"
|
|
5195
|
+
// (#957). A build in the #938→#955 window spelled an unchanged contract differently, and refusing
|
|
5196
|
+
// that spelling parks the user's edits under a banner claiming the model changed when it did not.
|
|
5197
|
+
// The server answered that question during the boot read; this page never sees the other spelling.
|
|
5198
|
+
//
|
|
5199
|
+
// BOUND to this exact row via `recorded`: the verdict is about the tag boot asked about, and the
|
|
5200
|
+
// row could have been rewritten since. An unbound boolean would be a claim about nothing.
|
|
5201
|
+
const namesCurrent=d.baseEtag===serverEtag;
|
|
5202
|
+
const namesViaWindow=!namesCurrent&&baseNamesLoaded(d.baseEtag,recordedBases);
|
|
5203
|
+
if(serverEtag&&!namesCurrent&&!namesViaWindow){
|
|
5093
5204
|
// PARK it, do not merely leave it: the main row is live, so the user's first edit on the current
|
|
5094
5205
|
// version would overwrite these edits — and edit() retires the offer bar before that happens, so
|
|
5095
5206
|
// they would never see them go. The banner promises they are still saved on this computer, and
|
|
@@ -5103,7 +5214,13 @@ function restoreSavedInner(){
|
|
|
5103
5214
|
showStaleDraftBanner(d);
|
|
5104
5215
|
return false;
|
|
5105
5216
|
}
|
|
5106
|
-
|
|
5217
|
+
const applied=applyDraftFields(d);
|
|
5218
|
+
// RE-STAMP ONLY AFTER IT ACTUALLY WENT BACK. `applyDraftFields` refuses a draft that fails canonical
|
|
5219
|
+
// validation, and stamping first would relabel a REFUSED row as a delta from the current generation —
|
|
5220
|
+
// arming exactly the silent overlay the base check exists to prevent. Through the existing seam, which
|
|
5221
|
+
// rewrites only a row whose base is still the value we matched.
|
|
5222
|
+
if(applied&&namesViaWindow)restampDraftBase(d.baseEtag,serverEtag);
|
|
5223
|
+
return applied;}catch(e){console.warn('steel-editor: a stored draft could not be read or applied — leaving it in place',e);return false;}}
|
|
5107
5224
|
function updUR(){document.getElementById('undoB').disabled=!undo.length;document.getElementById('redoB').disabled=!redo.length;}
|
|
5108
5225
|
// Canonical, model-global palette rank (B2): EVERY plan's non-blank member profiles ∪ weight-table keys,
|
|
5109
5226
|
// uppercased + sorted — the SAME basis contract-to-scene.ts uses, so a profile gets ONE hue in the 2D legend
|
|
@@ -19176,7 +19293,7 @@ if(PROJECT&&wsShell()){
|
|
|
19176
19293
|
// save keeps us here, where the red pill is visible, rather than navigating away from the problem.
|
|
19177
19294
|
try{await flushContract();}catch(_){return;}
|
|
19178
19295
|
b.openHistory();};}
|
|
19179
|
-
const _restored=restoreSaved();
|
|
19296
|
+
const _restored=restoreSaved(bootRecordedBase); // bring back this browser's saved edits before first paint
|
|
19180
19297
|
setPlan(C.active==null?0:C.active);
|
|
19181
19298
|
invalidateConnectionDiagnostics(); // 2D asks the same server bake as 3D before it promises a connection will build
|
|
19182
19299
|
// A restored draft can contain any native model field, so keep the status deliberately document-wide.
|
package/dist/web/workspaces.js
CHANGED
|
@@ -7032,6 +7032,86 @@
|
|
|
7032
7032
|
' detail/connection markers, but modeled 0 joints in this version.</div>';
|
|
7033
7033
|
}
|
|
7034
7034
|
|
|
7035
|
+
/**
|
|
7036
|
+
* WHAT THE READ AUTHORED that the saved Drawing Filter checkpoint never stated (#962b).
|
|
7037
|
+
*
|
|
7038
|
+
* The checkpoint is the document the human approved, and a first read may fill it in but not restate
|
|
7039
|
+
* it. Some upgraded checkpoints state things this build cannot honour — an empty grid, a registration
|
|
7040
|
+
* reference in a retired spelling, a drawing view with no registration at all — and the read is now
|
|
7041
|
+
* allowed to author exactly those. That is an approval fact, so the person who approved the document
|
|
7042
|
+
* has to be able to see it happened; a server log is a record for an operator, not for them.
|
|
7043
|
+
*
|
|
7044
|
+
* NOT the amber caution beside it. Nothing here needs acting on: the version published and is
|
|
7045
|
+
* correct. It reads in the neutral register `.hist-working` uses, and it leads with the reassurance,
|
|
7046
|
+
* because the first question anyone has on seeing this next to "AI read" is whether the AI overrode
|
|
7047
|
+
* what they approved. It did not — that is the whole point of the guard it passed.
|
|
7048
|
+
*
|
|
7049
|
+
* PARSED, NEVER ECHOED, following `detailReconciliationWarningHtml` exactly: the audit's own sentence
|
|
7050
|
+
* is written for a reader-AI and an operator, and it carries a mask hash that identifies nothing a
|
|
7051
|
+
* human can act on. A shape this does not recognise renders nothing rather than dumping that prose
|
|
7052
|
+
* at a detailer.
|
|
7053
|
+
*/
|
|
7054
|
+
const SHELL_AUTHORED_REASON = {
|
|
7055
|
+
'grid-unstated': 'a structural grid',
|
|
7056
|
+
'unreadable-reference': 'a readable drawing reference',
|
|
7057
|
+
'unregistered-view': 'where a drawing view sits in the model',
|
|
7058
|
+
};
|
|
7059
|
+
|
|
7060
|
+
function shellAuthoredNoteHtml(v) {
|
|
7061
|
+
if (!v || v.kind !== 'revision-read') return '';
|
|
7062
|
+
const audit = v.source && v.source.readAudit;
|
|
7063
|
+
const report = audit && audit.report;
|
|
7064
|
+
if (!audit || audit.version !== 1 || !report || report.version !== 1
|
|
7065
|
+
|| report.policy !== 'steel-read-completion/v1' || !Array.isArray(report.checks)) return '';
|
|
7066
|
+
const matching = report.checks.filter((row) => row && typeof row === 'object' && row.id === 'shell-preserved');
|
|
7067
|
+
if (matching.length !== 1) return '';
|
|
7068
|
+
const check = matching[0];
|
|
7069
|
+
if (check.status !== 'warning' || typeof check.detail !== 'string') return '';
|
|
7070
|
+
// ANCHORED END TO END, a 64-hex mask, and the exact closing clause: a regex that accepts any tail
|
|
7071
|
+
// would let a reworded or truncated audit sentence through and be read as the one this UI knows.
|
|
7072
|
+
// The reason CODES are the deliberate exception — an unmapped one falls back to itself below
|
|
7073
|
+
// rather than hiding the whole note, because a build that learns a new reason must not go silent
|
|
7074
|
+
// about a read having authored something. (Format anchoring found by review.)
|
|
7075
|
+
const match = /^([1-9]\d*) field\(s\) authored where the saved Drawing Filter checkpoint states nothing this build can honour \(([a-z][a-z-]*(?:, [a-z][a-z-]*)*); mask [0-9a-f]{64}\) — every OTHER field the checkpoint states is unchanged$/.exec(check.detail);
|
|
7076
|
+
if (!match) return '';
|
|
7077
|
+
const fields = Number(match[1]);
|
|
7078
|
+
if (!Number.isSafeInteger(fields)) return '';
|
|
7079
|
+
// `Object.hasOwn`, never a bare lookup: an inherited key would silently answer for a reason code
|
|
7080
|
+
// nobody wrote a phrase for. An unmapped code falls back to itself, readably, rather than blank.
|
|
7081
|
+
const phrases = match[2].split(', ').map((code) => (Object.hasOwn(SHELL_AUTHORED_REASON, code)
|
|
7082
|
+
? SHELL_AUTHORED_REASON[code]
|
|
7083
|
+
: code.replace(/-/g, ' ')));
|
|
7084
|
+
const listed = phrases.length > 1
|
|
7085
|
+
? `${phrases.slice(0, -1).join(', ')} or ${phrases[phrases.length - 1]}`
|
|
7086
|
+
: phrases[0];
|
|
7087
|
+
// The JSONPath list is evidence for whoever wants it, not copy — collapsed, and labelled technical.
|
|
7088
|
+
const rawSamples = Array.isArray(check.samples) ? check.samples : [];
|
|
7089
|
+
const samples = rawSamples.filter((row) => typeof row === 'string')
|
|
7090
|
+
.map((row) => row.replace(/ \([a-z-]+, [a-z-]+\)$/, ''));
|
|
7091
|
+
// The audit caps its sample list, so the count and the list can legitimately disagree. Say so
|
|
7092
|
+
// rather than letting a reader count nine rows under a headline that says thirteen.
|
|
7093
|
+
// From the RAW length, not the filtered one: a sample that is not a string is still a sample the
|
|
7094
|
+
// audit sent, so counting only the ones this UI could render would over-report what is missing.
|
|
7095
|
+
const undisclosed = fields - rawSamples.length;
|
|
7096
|
+
// The disclosure is a control a person invokes, so it carries its own command id and instance —
|
|
7097
|
+
// otherwise `?` on it falls back to whatever the DOM happens to expose. Instanced by VERSION,
|
|
7098
|
+
// because a project can carry one of these notes per read.
|
|
7099
|
+
const instance = `version ${Number(v.n)}`;
|
|
7100
|
+
const tech = samples.length
|
|
7101
|
+
? `<details class="hist-change-tech"><summary data-command-id="shell.history-authored-fields#${escapeAttr(String(v.n))}" ` +
|
|
7102
|
+
`data-command-instance-label="${escapeAttr(instance)}">Which fields (technical)</summary>` +
|
|
7103
|
+
samples.map((path) => `<span class="rev-issue-path">${escapeHtml(path)}</span>`).join('') +
|
|
7104
|
+
(undisclosed > 0 ? `<span class="hist-change-more">${escapeHtml(`${undisclosed} more not listed.`)}</span>` : '') +
|
|
7105
|
+
'</details>'
|
|
7106
|
+
: '';
|
|
7107
|
+
return '<div class="hist-change-note" role="note"><span aria-hidden="true">●</span> ' +
|
|
7108
|
+
'<strong>Some fields were filled in beyond the saved Drawing Filter.</strong> ' +
|
|
7109
|
+
escapeHtml(`The checkpoint you saved did not state ${listed}, so this read supplied ` +
|
|
7110
|
+
`${phrases.length > 1 ? 'them' : 'it'} — ${fields} ${fields === 1 ? 'field' : 'fields'} in total. ` +
|
|
7111
|
+
'Everything else the checkpoint stated was kept exactly as approved.') +
|
|
7112
|
+
`${tech}</div>`;
|
|
7113
|
+
}
|
|
7114
|
+
|
|
7035
7115
|
function changeCellHtml(v, meta) {
|
|
7036
7116
|
const s = v.changeSummary;
|
|
7037
7117
|
const n = Number(v.n);
|
|
@@ -7042,7 +7122,7 @@
|
|
|
7042
7122
|
'data-tip="Show the complete member-by-member comparison">' +
|
|
7043
7123
|
'<span class="hd-caret">▸</span><span class="hd-toggle-label">View detailed changes</span></button>'
|
|
7044
7124
|
: '';
|
|
7045
|
-
const detailWarning = detailReconciliationWarningHtml(v)
|
|
7125
|
+
const detailWarning = `${detailReconciliationWarningHtml(v)}${shellAuthoredNoteHtml(v)}`;
|
|
7046
7126
|
if (!s || !Array.isArray(s.bullets)) {
|
|
7047
7127
|
return `<div class="hist-event">${escapeHtml(v.message)}</div>${detailWarning}${toggle}`;
|
|
7048
7128
|
}
|