@floless/app 0.162.1 → 0.163.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/dist/floless-server.cjs +11754 -8096
- package/dist/schemas/steel.model.v2.schema.json +16 -2
- package/dist/skills/floless-app-actions/SKILL.md +54 -3
- package/dist/skills/floless-app-onboarding/SKILL.md +2 -2
- package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +8 -6
- package/dist/skills/floless-app-report-issue/SKILL.md +12 -1
- package/dist/skills/floless-app-rfi/SKILL.md +36 -9
- package/dist/skills/floless-app-steel-model/SKILL.md +5 -3
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +39 -34
- package/dist/skills/floless-app-steel-takeoff/references/elevation-registration.md +10 -6
- package/dist/web/agents.js +24 -4
- package/dist/web/app.css +45 -7
- package/dist/web/app.js +22 -3
- package/dist/web/aware.js +157 -43
- package/dist/web/chat.css +26 -1
- package/dist/web/chat.js +32 -8
- package/dist/web/commands-shell.js +190 -4
- package/dist/web/commands-steel.js +14 -0
- package/dist/web/failure-copy.js +168 -0
- package/dist/web/index.html +35 -1
- package/dist/web/instructor.js +3 -1
- package/dist/web/landing-sort.js +277 -0
- package/dist/web/model-editor-steel-adapter.js +3 -0
- package/dist/web/model-panel-bridge.js +13 -2
- package/dist/web/model-view-query.js +23 -15
- package/dist/web/project-access.js +3 -3
- package/dist/web/project-rfis.js +250 -7
- package/dist/web/project-workflows.js +1 -1
- package/dist/web/steel-3d-view.js +8 -1
- package/dist/web/steel-editor.html +441 -12
- package/dist/web/steel-filter-core.js +2 -0
- package/dist/web/steel-filter.html +38 -5
- package/dist/web/steel-model-v2-commands.js +3 -1
- package/dist/web/steel-profile-colours.js +124 -24
- package/dist/web/workspaces.js +243 -38
- package/package.json +1 -1
|
@@ -1547,6 +1547,11 @@ rect.lblhot:focus-visible{outline:2px solid var(--brand);outline-offset:2px;stro
|
|
|
1547
1547
|
blurs a focused control when it is disabled, which would drop focus to body for the whole request
|
|
1548
1548
|
and let Tab walk out of an aria-modal dialog. */
|
|
1549
1549
|
#rfiList .rfiform [aria-disabled=true]{opacity:.4;cursor:default}
|
|
1550
|
+
/* #2470 R6.6e: the not-confirmed sends of an RFI, and the tick in the Send it again dialog. */
|
|
1551
|
+
#rfiList .rfisettled{margin:4px 0 0;padding-left:18px}
|
|
1552
|
+
#coCardModal .rfiform{display:flex;flex-direction:column;gap:8px}
|
|
1553
|
+
#coCardModal .rfiform label{display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--mut)}
|
|
1554
|
+
#coCardModal .rfiform label.rficheck{flex-direction:row;align-items:center;gap:8px;color:var(--text);cursor:pointer}
|
|
1550
1555
|
/* The pill group clips its children, so the global focus ring (offset 2px) lands outside the border
|
|
1551
1556
|
and is cut off. Inset it, the same way #reviewFly .frow does. */
|
|
1552
1557
|
#rfiList .rfidisp button:focus-visible{outline-offset:-2px}
|
|
@@ -7842,11 +7847,21 @@ function updUR(){document.getElementById('undoB').disabled=!undo.length;document
|
|
|
7842
7847
|
// AND in 3D, stable across plans. (The per-plan `profs` still drives the legend/datalist; only the colour
|
|
7843
7848
|
// index moved off it — a blank/RFI/other-plan profile must not shift a real profile's slot.) Rebuilt at
|
|
7844
7849
|
// render() top so it tracks edits without touching every profs.push site.
|
|
7845
|
-
let colorRank=
|
|
7850
|
+
let colorRank=null; // the ProfileColours.profileColourContext of the last render
|
|
7846
7851
|
const canonProfile=s=>ProfileColours.canonicalProfile(s);
|
|
7847
|
-
function buildColorRank(){colorRank=ProfileColours.
|
|
7852
|
+
function buildColorRank(){colorRank=ProfileColours.profileColourContext(C,WT,profileColourSpellings);} // rank + per-section member spellings, rebuilt per render (#2877)
|
|
7853
|
+
// #2877: every spelling the editor's catalogue lists for a member's section, minus aliases that are another
|
|
7854
|
+
// section's own name (ProfileColours.catalogueSpellings, the same rule the scene bake applies to the server
|
|
7855
|
+
// catalogue), so a colour keyed `UC305X97` or `UC305*305*97` resolves identically in 2D, the Inspector, the
|
|
7856
|
+
// Profile colours menu and 3D. Memoised: the catalogue is fixed once loaded and colorFor() runs per member.
|
|
7857
|
+
const _colourSpellings=new Map();
|
|
7858
|
+
function profileColourSpellings(p){const k=String(p==null?'':p);if(_colourSpellings.has(k))return _colourSpellings.get(k);
|
|
7859
|
+
const out=k.trim()?ProfileColours.catalogueSpellings(_profileCatalogRow(_canonDes(k)),s=>_profileCatalogRow(_canonDes(s))):[];_colourSpellings.set(k,out);return out;}
|
|
7848
7860
|
function colorFor(p){return ProfileColours.profileColour(p,C.profile_colors,colorRank,PAL,message=>console.warn('steel-editor: '+message));}
|
|
7849
|
-
|
|
7861
|
+
// Removes every key a lookup for this section reads (its members' spellings, its catalogue spellings), from a
|
|
7862
|
+
// context built now so an edit since the last render cannot leave a stale spelling that outranks the new key.
|
|
7863
|
+
function setProfileColour(profile,colour){ProfileColours.setCanonicalProfileColour(C.profile_colors,profile,colour,
|
|
7864
|
+
ProfileColours.sectionSpellings(ProfileColours.profileColourContext(C,WT,profileColourSpellings),profile));}
|
|
7850
7865
|
// F5: per member-type 2D line style. Tokens → px; dashes chosen to avoid the reserved semantic patterns
|
|
7851
7866
|
// (RFI 10 6, brace 30 8 6 8, grid 12 4 2 4). med+solid (or absent) = today's default (line.member stroke-width:6).
|
|
7852
7867
|
const MS_W={thin:3,med:6,thick:9},MS_D={solid:'',dashed:'14 8',dotted:'2 8',dashdot:'18 7 3 7'};
|
|
@@ -11007,6 +11022,20 @@ function answeredProposalSaid(a){const p=a&&a.how==='confirmed'&&a.proposal&&typ
|
|
|
11007
11022
|
if(p.how==='derived')return', which the read derived from '+String(p.basis||'');
|
|
11008
11023
|
if(p.how==='measured')return', which the read measured on the drawings'+(p.basis?' ('+String(p.basis)+')':'');
|
|
11009
11024
|
return', read off the drawings'+(p.basis?' ('+String(p.basis)+')':'');}
|
|
11025
|
+
/** The Inspector's own "drawn at" sentence for an end with no live question row (an unfiled placement).
|
|
11026
|
+
* #2873: an estimate-placed end says its basis here or nowhere — and once the end has been moved off the
|
|
11027
|
+
* estimate, or the estimate was set aside, the read's number is said as history, never as this height's basis. */
|
|
11028
|
+
function inspectorDrawnFallback(z,assumed){
|
|
11029
|
+
const why=typeof z.why==='string'&&z.why.trim()?z.why.trim():'';
|
|
11030
|
+
const est=assumed&&z.estimate&&Number.isFinite(z.estimate.value)&&typeof z.estimate.basis==='string'&&z.estimate.basis.trim()?z.estimate:null;
|
|
11031
|
+
if(!est)return 'Drawn at this height for now.'+(why?' '+why:' The drawings do not confirm it.');
|
|
11032
|
+
const basis=est.basis.trim().replace(/\.$/,'');
|
|
11033
|
+
if(est.value===z.known)return 'Drawn at this height for now.'+(why?' '+why:'')+' The estimate’s basis: '+basis+'.';
|
|
11034
|
+
const history=' The drawing read estimated '+fmtDispElev(est.value)+' (basis: '+basis+'), but this end is not drawn at that height.';
|
|
11035
|
+
// The stored reason still says "placed at the drawing read's provisional estimate", which is no longer true.
|
|
11036
|
+
if(/provisional estimate/.test(why))return 'Drawn at this height for now; nothing on the drawings confirms it.'+history;
|
|
11037
|
+
return 'Drawn at this height for now.'+(why?' '+why:' The drawings do not confirm it.')+history;
|
|
11038
|
+
}
|
|
11010
11039
|
function inspectorHeightNotes(m,canonical){
|
|
11011
11040
|
const ids=m.role==='column'?['bos','tosC']:['tosA','tosB'];
|
|
11012
11041
|
[0,1].forEach(end=>{
|
|
@@ -11051,12 +11080,19 @@ function inspectorHeightNotes(m,canonical){
|
|
|
11051
11080
|
// The server's basis-aware sentence when the questions have been read; the model's own fact otherwise.
|
|
11052
11081
|
// Otherwise the seam's own reason, which names the real basis (a plan's cut plane, the other end, the
|
|
11053
11082
|
// read's own number) — a plan-placed end has no live question row, and must still say why.
|
|
11054
|
-
const drawn=g&&g.currentValue&&g.currentValue.note?g.currentValue.note
|
|
11055
|
-
:'Drawn at this height for now.'+(typeof z.why==='string'&&z.why.trim()?' '+z.why.trim():' The drawings do not confirm it.');
|
|
11083
|
+
const drawn=g&&g.currentValue&&g.currentValue.note?g.currentValue.note:inspectorDrawnFallback(z,assumed);
|
|
11056
11084
|
const confirmsDrawn=!!p&&p.candidates.every(c=>c&&(c.readings||[]).every(rd=>rd&&rd.source==='server-placement'));
|
|
11057
11085
|
if(assumed&&!p)parts.push(drawn+' Type the right height to settle it.');
|
|
11058
11086
|
else if(assumed&&!confirmsDrawn)parts.push(drawn);
|
|
11059
11087
|
if(p)parts.push(p.ask);
|
|
11088
|
+
// #2873: inspecting the steel says whether its question is already an RFI. Only a FILED record counts
|
|
11089
|
+
// (a live-only row is the question, not an RFI), and "not filed" is said only when the list was read.
|
|
11090
|
+
if(assumed){
|
|
11091
|
+
const filed=rfiFiledForGap(gapKey);
|
|
11092
|
+
if(filed)parts.push('Filed as '+filed.id+' ('+(RFI_STATUS_LABEL[filed.status]||'Open').toLowerCase()+').');
|
|
11093
|
+
else if(rfiState.status==='ok')parts.push('No RFI has been filed for this height yet.');
|
|
11094
|
+
else if(rfiState.status==='fail')parts.push('FloLess could not load the RFI list, so it cannot say yet whether this height has an RFI.');
|
|
11095
|
+
}
|
|
11060
11096
|
const text=document.createElement('div');text.textContent=parts.join(' ');box.appendChild(text);
|
|
11061
11097
|
if(p&&rfiEndUnresolved(canonical.id,end)){
|
|
11062
11098
|
const acts=document.createElement('div');acts.className='row';acts.style.cssText='gap:5px;flex-wrap:wrap;margin-top:4px';
|
|
@@ -16506,7 +16542,8 @@ function paintChatQuestions(p){
|
|
|
16506
16542
|
function modelPanelSnapshot(){
|
|
16507
16543
|
const n=allMembers().length;
|
|
16508
16544
|
return {context:n+' member'+(n===1?'':'s'),selectedId:[...selIds].at(-1)||null,selectedIds:[...selIds],tabs:[],bodies:{},
|
|
16509
|
-
panelTabs:view3dShown?LEGEND_TABS:LEGEND_TABS.filter(t=>t.key==='objects')
|
|
16545
|
+
panelTabs:view3dShown?LEGEND_TABS:LEGEND_TABS.filter(t=>t.key==='objects'), // Views, Favourites and References act on the 3D view
|
|
16546
|
+
...(PROJECT?{viewer:steelViewTarget()}:{})}; // #2876: the view an AI Chat view command may be applied to (a project's model only)
|
|
16510
16547
|
}
|
|
16511
16548
|
let editorTerminalDisposed=false,editorBfcacheSuspended=false,editorBfcacheWas3d=false;
|
|
16512
16549
|
function disposeEditor(reason='parent-replacement'){
|
|
@@ -24406,6 +24443,8 @@ const RFI_GMAIL_API={
|
|
|
24406
24443
|
deliver:id=>'/api/projects/'+encodeURIComponent(PROJECT)+'/rfis/'+encodeURIComponent(id)+'/deliver',
|
|
24407
24444
|
continueAttempt:(id,attemptId)=>'/api/projects/'+encodeURIComponent(PROJECT)+'/rfis/'+encodeURIComponent(id)+'/delivery-attempts/'+encodeURIComponent(attemptId)+'/continue',
|
|
24408
24445
|
confirmSent:(id,attemptId)=>'/api/projects/'+encodeURIComponent(PROJECT)+'/rfis/'+encodeURIComponent(id)+'/delivery-attempts/'+encodeURIComponent(attemptId)+'/confirm-sent',
|
|
24446
|
+
// #2470 R6.6e: the three ways out of a send FloLess could not confirm (way = try-again | sent-another-way | leave-unconfirmed).
|
|
24447
|
+
settle:(id,attemptId,way)=>'/api/projects/'+encodeURIComponent(PROJECT)+'/rfis/'+encodeURIComponent(id)+'/delivery-attempts/'+encodeURIComponent(attemptId)+'/'+way,
|
|
24409
24448
|
};
|
|
24410
24449
|
let rfiGmailReadiness={status:PROJECT?'loading':'off',message:''};
|
|
24411
24450
|
let rfiGmailReadinessSeq=0;
|
|
@@ -24525,6 +24564,26 @@ async function refreshRfiGmailReadiness(){
|
|
|
24525
24564
|
* how a row is matched to a record the server already filed under it. */
|
|
24526
24565
|
const rfiSizeGapKey=id=>'unknown-size:'+id;
|
|
24527
24566
|
|
|
24567
|
+
/** #2873: the FILED record that asks this gap, newest first (the server sorts by seq descending), or null.
|
|
24568
|
+
* A live-only row is the open question itself, not an RFI, so it never counts. */
|
|
24569
|
+
/** #2873: the Inspector's height notes say whether an RFI is filed, so they follow the RFI list when it
|
|
24570
|
+
* loads or changes — never while focus sits inside one of them (a Use button the person is on). */
|
|
24571
|
+
function rfiRepaintHeightNotes(){
|
|
24572
|
+
const p=document.getElementById('panel'),a=document.activeElement;
|
|
24573
|
+
if(!p||(a&&a.closest&&a.closest('.v2-elevation-proposal,.v2-elevation-answered')))return;
|
|
24574
|
+
syncV2SelectionNotice(p);
|
|
24575
|
+
}
|
|
24576
|
+
function rfiFiledForGap(gapKey){
|
|
24577
|
+
for(const r of rfiState.records){
|
|
24578
|
+
if(!r||r.liveOnly||typeof r.id!=='string')continue;
|
|
24579
|
+
// A grouped record speaks for several heights: THIS height's status is its occurrence's, never the group's,
|
|
24580
|
+
// so its occurrences are asked FIRST, before any top-level key the group may also carry.
|
|
24581
|
+
const occ=r.grouped?(r.occurrences||[]).find(o=>o&&o.technical&&o.technical.gapKey===gapKey):null;
|
|
24582
|
+
if(occ)return {id:r.id,status:typeof occ.status==='string'?occ.status:r.status};
|
|
24583
|
+
if(r.gapKey===gapKey||(r.liveGap&&r.liveGap.gapKey===gapKey))return r;
|
|
24584
|
+
}
|
|
24585
|
+
return null;
|
|
24586
|
+
}
|
|
24528
24587
|
/** Records that are not closed, by gap key — what suppresses a symptom row. */
|
|
24529
24588
|
function rfiLiveByGap(){
|
|
24530
24589
|
const out=new Map();
|
|
@@ -24713,6 +24772,7 @@ async function refreshRfiRecords(opts){
|
|
|
24713
24772
|
// BEFORE the paint, so a sentence about a record that has since moved on never reaches the screen.
|
|
24714
24773
|
rfiPruneOutcome();
|
|
24715
24774
|
paintRfiStat();
|
|
24775
|
+
rfiRepaintHeightNotes();
|
|
24716
24776
|
// NEVER repaint the list out from under someone's hands. `openRFI` starts this read, so it lands a
|
|
24717
24777
|
// moment after the dialog opens - and a repaint replaces the row's profile input, which discards
|
|
24718
24778
|
// whatever the user has typed into it and leaves the combo popup pointing at a node that is gone.
|
|
@@ -24951,6 +25011,8 @@ function rfiDeliveryOf(r){
|
|
|
24951
25011
|
return {status,attemptId,preparedAt:String(d.preparedAt||''),
|
|
24952
25012
|
canContinue:d.canContinue===true||status==='prepared',
|
|
24953
25013
|
canConfirmFoundInSent:d.canConfirmFoundInSent===true||status==='outcome-unknown',
|
|
25014
|
+
to:String(d.to||''),
|
|
25015
|
+
canTryAgain:d.canTryAgain===true,canRecordSentAnotherWay:d.canRecordSentAnotherWay===true,canLeaveUnconfirmed:d.canLeaveUnconfirmed===true,
|
|
24954
25016
|
reconciliationMarker:String(d.reconciliationMarker||(r.id&&attemptId?(r.id+'/'+attemptId):''))};
|
|
24955
25017
|
}
|
|
24956
25018
|
const rfiDeliveryBlocks=r=>{const d=rfiDeliveryOf(r);return !!d&&(d.status==='prepared'||d.status==='outcome-unknown');};
|
|
@@ -25425,7 +25487,7 @@ function rfiMergeResponse(j){
|
|
|
25425
25487
|
// assumed: a truth that flipped to `unavailable` would otherwise leave Apply and `resolved` offered.
|
|
25426
25488
|
if(j&&(j.sizeTruth==='known'||j.sizeTruth==='unavailable'))rfiState={...rfiState,sizeTruth:j.sizeTruth};
|
|
25427
25489
|
if(merged){
|
|
25428
|
-
rfiFetchSeq++;rfiRecordsSeq++;rfiPruneTargetErrors();paintRfiStat();
|
|
25490
|
+
rfiFetchSeq++;rfiRecordsSeq++;rfiPruneTargetErrors();paintRfiStat();rfiRepaintHeightNotes();
|
|
25429
25491
|
// The bump above cancels any read still in flight. If one of those owned the `loading` transition
|
|
25430
25492
|
// that Retry started, nothing would ever end it — `openRFI` will not re-read while `loading` and
|
|
25431
25493
|
// the loading banner offers no Retry, so the dialog sticks with no way out.
|
|
@@ -25869,6 +25931,7 @@ function rfiGmailUnknownCopy(base,attempt,record){
|
|
|
25869
25931
|
function rfiGmailBusyMessage(action,id){
|
|
25870
25932
|
if(action==='deliver')return 'Sending '+id+' with Gmail…';
|
|
25871
25933
|
if(action==='confirm')return 'Recording the Sent-folder confirmation for '+id+'…';
|
|
25934
|
+
if(action==='settle')return 'Settling the unconfirmed Gmail send of '+id+'…';
|
|
25872
25935
|
return 'Continuing the prepared Gmail send for '+id+'…';
|
|
25873
25936
|
}
|
|
25874
25937
|
const RFI_GMAIL_RECOVERY_KEY_PREFIX='floless:rfi-gmail-recovery:v1:';
|
|
@@ -25893,7 +25956,7 @@ function rfiGmailRecoveryKey(attemptId,action){
|
|
|
25893
25956
|
return opKey;
|
|
25894
25957
|
}
|
|
25895
25958
|
function rfiForgetGmailRecoveryKeys(attemptId){
|
|
25896
|
-
for(const action of ['continue','confirm']){
|
|
25959
|
+
for(const action of ['continue','confirm',...RFI_SETTLE_WAYS.map(w=>'settle-'+w.key)]){
|
|
25897
25960
|
const storageKey=rfiGmailRecoveryStorageKey(attemptId,action);
|
|
25898
25961
|
rfiGmailRecoveryKeys.delete(storageKey);try{localStorage.removeItem(storageKey);}catch(_){}
|
|
25899
25962
|
}
|
|
@@ -25988,6 +26051,212 @@ async function rfiRecoverGmail(button){
|
|
|
25988
26051
|
deadline.clear();rfiGmailBusy=null;renderRfiList();paintRfiFail();paintRfiStat();
|
|
25989
26052
|
}
|
|
25990
26053
|
}
|
|
26054
|
+
// ── The ways out of a send FloLess could not confirm (#2470 R6.6e) ────────────────────────────────────────────
|
|
26055
|
+
// Only the ways the server offers, never preselected: the person chooses. Each is final and stays in the history.
|
|
26056
|
+
const RFI_SETTLE_WAYS=[
|
|
26057
|
+
{key:'try-again',allowed:'canTryAgain',label:'Send it again with Gmail',help:'They may get it twice. FloLess asks you to confirm first.',primary:'Send it again…'},
|
|
26058
|
+
{key:'sent-another-way',allowed:'canRecordSentAnotherWay',label:'I sent it another way',help:'FloLess records it and marks the RFI sent. It sends nothing.',primary:'Record as sent'},
|
|
26059
|
+
{key:'leave-unconfirmed',allowed:'canLeaveUnconfirmed',label:'Leave it unconfirmed',help:'FloLess won’t finish or send this, and can’t say whether Gmail already did. The RFI is free again, and its history will show this send as not confirmed.',primary:'Leave unconfirmed'},
|
|
26060
|
+
];
|
|
26061
|
+
const RFI_SETTLED_WORDS={'try-again':'sent again with Gmail','sent-another-way':'sent another way','left-unconfirmed':'left unconfirmed'};
|
|
26062
|
+
// What became of the new send of a Try again: said only as far as FloLess knows it (a refused one reached nobody).
|
|
26063
|
+
const rfiResendWords=s=>!s||s==='recorded'||s==='confirmed-sent'?'':s==='failed'?' · Gmail didn’t receive the new send':' · the new send isn’t confirmed either';
|
|
26064
|
+
// Refusals that mean the list on screen is out of date: the panel closes and the list is read again.
|
|
26065
|
+
const RFI_SETTLE_OUT_OF_DATE=new Set(['rfi-delivery-terminal','rfi-delivery-stale','rfi-revision-stale','rfi-delivery-evidence-present','rfi-delivery-not-found']);
|
|
26066
|
+
const rfiRefreshSaid=rowKey=>rfiRefreshAfterAction(rowKey).catch(error=>{console.warn('[steel] the RFI list could not be read again',error&&error.message?error.message:error);return false;});
|
|
26067
|
+
const RFI_HOW_MAX=120;
|
|
26068
|
+
let rfiSettleFor=null; // {rowKey,id,attemptId,way,via,to,how,error,busy} | null — one open at a time
|
|
26069
|
+
const rfiSettledOpen=new Set(); // RFIs whose not-confirmed sends are listed
|
|
26070
|
+
/** A send that holds this RFI — the live one, or one from before it last changed — by its attempt id. */
|
|
26071
|
+
function rfiHeldAttempt(r,attemptId){
|
|
26072
|
+
const held=(Array.isArray(r&&r.holdingDeliveries)?r.holdingDeliveries:[]).find(h=>h&&h.attemptId===attemptId);
|
|
26073
|
+
if(held)return held;
|
|
26074
|
+
const d=rfiDeliveryOf(r);
|
|
26075
|
+
return d&&d.attemptId===attemptId&&(d.status==='prepared'||d.status==='outcome-unknown')?d:null;
|
|
26076
|
+
}
|
|
26077
|
+
function rfiSettleButton(r,delivery,rowKey){
|
|
26078
|
+
if(!delivery||!delivery.attemptId||!RFI_SETTLE_WAYS.some(w=>delivery[w.allowed]))return '';
|
|
26079
|
+
if((rfiSettleFor&&rfiSettleFor.rowKey===rowKey)||(rfiGmailBusy&&rfiGmailBusy.rowKey===rowKey))return '';
|
|
26080
|
+
const text=delivery.status==='prepared'?'Something else…':'I didn’t find it…';
|
|
26081
|
+
return '<button class=ghost data-command-id="steel.rfi-gmail-settle#'+esc(r.id)+'" data-command-instance-label="'+esc(r.id)+'" aria-label="'+esc(text.replace('…','')+': '+r.id)+'" data-rfi-ctl="settle:open" data-rfi-settle-open="'+esc(r.id)+'" data-rfi-settle-attempt="'+esc(delivery.attemptId)+'" data-tip="Other ways to settle this send: send it again, record that you sent it, or leave it unconfirmed">'+text+'</button>';
|
|
26082
|
+
}
|
|
26083
|
+
/** The earlier held sends, the not-confirmed history, and the open settle panel of one row. */
|
|
26084
|
+
function rfiSettleHtml(r,rowKey){
|
|
26085
|
+
let html='';
|
|
26086
|
+
for(const h of (Array.isArray(r.holdingDeliveries)?r.holdingDeliveries:[]).filter(h=>h&&h.stale)){
|
|
26087
|
+
html+='<div class=rfiunknown role=note>An earlier Gmail send to '+esc(h.to||'')+' ('+esc(rfiAgo(h.preparedAt))+') is still held. Settle it to free this RFI.</div>';
|
|
26088
|
+
if(!(rfiSettleFor&&rfiSettleFor.rowKey===rowKey&&rfiSettleFor.attemptId===h.attemptId))
|
|
26089
|
+
html+='<div class=rfiacts><button class=ghost data-command-id="steel.rfi-gmail-leave-earlier#'+esc(h.attemptId)+'" data-command-instance-label="'+esc(r.id)+'" aria-label="'+esc('Leave the earlier send of '+r.id+' unconfirmed')+'" data-rfi-ctl="settle:earlier" data-rfi-settle-open="'+esc(r.id)+'" data-rfi-settle-attempt="'+esc(h.attemptId)+'" data-tip="Settles that earlier send without recording a send">Leave it unconfirmed…</button></div>';
|
|
26090
|
+
}
|
|
26091
|
+
const history=r.deliveryHistory;
|
|
26092
|
+
if(history&&Array.isArray(history.settled)&&history.settled.length){
|
|
26093
|
+
const reach=history.mayHaveReached||{},open=rfiSettledOpen.has(r.id);
|
|
26094
|
+
html+='<div class=rfinote role=note>'+esc(reach.to||'')+(reach.moreThanOnce?' may have received it more than once.':' may already have this RFI.')+'</div>'
|
|
26095
|
+
+'<div class=rfiacts><button class=ghost data-command-id="steel.rfi-settled-history#'+esc(r.id)+'" data-command-instance-label="'+esc(r.id)+'" data-rfi-ctl="settle:history" data-rfi-settle-history="'+esc(r.id)+'" aria-expanded="'+open+'">Not confirmed ('+history.settled.length+')</button></div>'
|
|
26096
|
+
+(open?'<ul class="rfinote rfisettled" aria-label="'+esc('Sends of '+r.id+' FloLess couldn’t confirm')+'">'+history.settled.map(h=>'<li>Gmail send to '+esc(h.to)+' · '+esc(rfiAgo(h.preparedAt))+' · not confirmed, '+esc(RFI_SETTLED_WORDS[h.choice]||h.choice)+(h.stale?' (an earlier send)':'')+rfiResendWords(h.resend)+'</li>').join('')+'</ul>':'');
|
|
26097
|
+
}
|
|
26098
|
+
const f=rfiSettleFor;
|
|
26099
|
+
if(f&&f.rowKey===rowKey)html+=rfiSettlePanelHtml(r,f);
|
|
26100
|
+
return html;
|
|
26101
|
+
}
|
|
26102
|
+
function rfiSettlePanelHtml(r,f){
|
|
26103
|
+
const held=rfiHeldAttempt(r,f.attemptId);
|
|
26104
|
+
if(!held)return '';
|
|
26105
|
+
const ways=RFI_SETTLE_WAYS.filter(w=>held[w.allowed]),chosen=RFI_SETTLE_WAYS.find(w=>w.key===f.way);
|
|
26106
|
+
const off=f.busy?' disabled':'',seg=(label,attr,items,value)=>'<div class=seg2 role=radiogroup aria-label="'+label+'">'+items.map(([key,text],i)=>
|
|
26107
|
+
'<button type=button role=radio aria-checked="'+(value===key)+'" tabindex="'+(value===key||(!value&&i===0)?0:-1)+'"'+(value===key?' class=on':'')+' data-rfi-ctl="settle:'+attr+':'+key+'" data-rfi-settle-'+attr+'="'+key+'" '
|
|
26108
|
+
// Each command id is written whole; only the instance after "#" varies.
|
|
26109
|
+
+(attr==='way'?'data-command-id="steel.rfi-settle-way#'+esc(key)+'"':'data-command-id="steel.rfi-settle-via#'+esc(key)+'"')
|
|
26110
|
+
+' data-command-instance-label="'+esc(text)+'"'+off+'>'+esc(text)+'</button>').join('')+'</div>';
|
|
26111
|
+
let html='<div class=rfiform role=group aria-label="'+esc('Settle the unconfirmed send of '+r.id)+'" data-rfi-settle-panel>';
|
|
26112
|
+
if(held.stale)html+='<div class=rfinote>This earlier send to '+esc(held.to||'')+' is from before this RFI last changed, so the only way to settle it is to leave it unconfirmed.</div>';
|
|
26113
|
+
if(ways.length>1)html+=seg('What do you want to do?','way',ways.map(w=>[w.key,w.label]),f.way);
|
|
26114
|
+
if(chosen)html+='<div class=rfinote>'+esc(chosen.help)+'</div>';
|
|
26115
|
+
if(f.way==='sent-another-way'){
|
|
26116
|
+
html+=seg('How did you send it?','via',[['email','Email'],['other','Other']],f.via)
|
|
26117
|
+
+'<label>Who did you send it to?<input type=email autocomplete=email data-rfi-ctl="settle:to" data-rfi-settle-input=to value="'+esc(f.to)+'" data-command-id="steel.rfi-settle-to#'+esc(r.id)+'" data-command-instance-label="'+esc(r.id)+'"'+(f.busy?' readonly':'')+'></label>';
|
|
26118
|
+
if(f.via==='other')html+='<label>How did you send it?<input maxlength='+RFI_HOW_MAX+' placeholder="Handed over at the site meeting" data-rfi-ctl="settle:how" data-rfi-settle-input=how value="'+esc(f.how)+'" data-command-id="steel.rfi-settle-how#'+esc(r.id)+'" data-command-instance-label="'+esc(r.id)+'"'+(f.busy?' readonly':'')+'></label><div class=rfinote data-rfi-settle-count>'+f.how.length+' of '+RFI_HOW_MAX+'</div>';
|
|
26119
|
+
}
|
|
26120
|
+
if(f.error)html+='<div class=rfifail role=alert>'+esc(f.error)+'</div>';
|
|
26121
|
+
if(f.busy)html+='<div class=rfinote role=status>'+esc(rfiGmailBusyMessage('settle',r.id))+'</div>';
|
|
26122
|
+
return html+'<div class=rfirow-acts><button type=button class=ghost data-rfi-ctl="settle:cancel" data-rfi-settle-cancel=1 data-command-id="steel.rfi-settle-cancel#'+esc(r.id)+'" data-command-instance-label="'+esc(r.id)+'"'+off+'>Cancel</button>'
|
|
26123
|
+
+'<button type=button data-rfi-ctl="settle:submit" data-rfi-settle-submit=1 data-command-id="steel.rfi-settle-submit#'+esc(r.id)+'" data-command-instance-label="'+esc(r.id)+'"'+(f.busy?' aria-busy=true aria-disabled=true data-blocked-reason="This send is being settled now"':'')+'>'+esc(f.busy?'Saving…':chosen?chosen.primary:'Choose one')+'</button></div></div>';
|
|
26124
|
+
}
|
|
26125
|
+
function rfiAgo(iso){
|
|
26126
|
+
const t=Date.parse(iso);if(!Number.isFinite(t))return 'earlier';
|
|
26127
|
+
const m=Math.round(Math.max(0,Date.now()-t)/60000);
|
|
26128
|
+
if(m<1)return 'just now';if(m<60)return m+' min ago';
|
|
26129
|
+
const h=Math.round(m/60);if(h<24)return h+' h ago';
|
|
26130
|
+
const d=Math.round(h/24);return d===1?'yesterday':d+' days ago';
|
|
26131
|
+
}
|
|
26132
|
+
function rfiOpenSettle(id,attemptId){
|
|
26133
|
+
if(rfiBusy()){toast('One RFI is still being recorded — wait for it to finish.');return;}
|
|
26134
|
+
const r=rfiState.records.find(x=>x&&x.id===id),held=r&&rfiHeldAttempt(r,attemptId);
|
|
26135
|
+
if(!held){toast(id+' — that send is already settled. The list has been read again.');void rfiRefreshAfterAction(rfiRowKey('record',id)).then(()=>renderRfiList()).catch(()=>{});return;}
|
|
26136
|
+
const ways=RFI_SETTLE_WAYS.filter(w=>held[w.allowed]);
|
|
26137
|
+
// Only one way (an earlier send): it is the choice. Otherwise nothing is chosen for the person.
|
|
26138
|
+
rfiSettleFor={rowKey:rfiRowKey('record',id),id,attemptId,way:ways.length===1?ways[0].key:'',via:'',to:String(held.to||''),how:'',error:'',busy:false};
|
|
26139
|
+
rfiFocusOverride={rows:[rfiSettleFor.rowKey],ctl:ways.length>1?'settle:way:'+ways[0].key:'settle:submit'};
|
|
26140
|
+
renderRfiList();
|
|
26141
|
+
}
|
|
26142
|
+
function rfiCloseSettle(){
|
|
26143
|
+
const f=rfiSettleFor;if(!f||f.busy)return;
|
|
26144
|
+
rfiSettleFor=null;rfiFocusOverride={rows:[f.rowKey],ctl:'*first'};renderRfiList();
|
|
26145
|
+
}
|
|
26146
|
+
function rfiSettleChoose(kind,value){
|
|
26147
|
+
const f=rfiSettleFor;if(!f||f.busy)return;
|
|
26148
|
+
f[kind]=value;f.error='';rfiFocusOverride={rows:[f.rowKey],ctl:'settle:'+kind+':'+value};renderRfiList();
|
|
26149
|
+
}
|
|
26150
|
+
function rfiSettleSubmit(){
|
|
26151
|
+
const f=rfiSettleFor;if(!f||f.busy)return;
|
|
26152
|
+
const to=String(f.to||'').trim(),how=String(f.how||'').trim(),address=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(to);
|
|
26153
|
+
// Asked, not refused: the button stays live and says what is missing.
|
|
26154
|
+
f.error=!f.way?'Choose what you want to do first.'
|
|
26155
|
+
:f.way==='sent-another-way'&&!f.via?'Say how you sent it: by email, or another way.'
|
|
26156
|
+
:f.way==='sent-another-way'&&!address?'Give the one email address it went to, like name@company.com.'
|
|
26157
|
+
:f.way==='sent-another-way'&&f.via==='other'&&!how?'Say in a few words how you sent it.':'';
|
|
26158
|
+
if(f.error){
|
|
26159
|
+
rfiFocusOverride={rows:[f.rowKey],ctl:!f.way?'settle:way:'+RFI_SETTLE_WAYS[0].key:!f.via?'settle:via:email':!address?'settle:to':'settle:how'};
|
|
26160
|
+
rfiSay(f.error);renderRfiList();return;
|
|
26161
|
+
}
|
|
26162
|
+
if(f.way==='try-again'){rfiSettleAskAgain(f);return;}
|
|
26163
|
+
void rfiSettleSend(f,f.way==='sent-another-way'?{to,via:f.via,...(f.via==='other'?{how}:{})}:{}).catch(rfiGestureFailure);
|
|
26164
|
+
}
|
|
26165
|
+
/** Try Gmail again asks first, in a dialog with a tick the person must give (owner ruling, #2470 R6.6e). */
|
|
26166
|
+
function rfiSettleAskAgain(f){
|
|
26167
|
+
const r=rfiState.records.find(x=>x&&x.id===f.id),held=r&&rfiHeldAttempt(r,f.attemptId);
|
|
26168
|
+
if(!r||!held)return;
|
|
26169
|
+
const from=document.querySelector('[data-rfi-settle-submit]');
|
|
26170
|
+
openCalloutCard({title:'Send it again?',from,
|
|
26171
|
+
html:'<p>FloLess can’t tell whether Gmail already sent '+esc(r.id)+' to '+esc(held.to||'')+'. If it did, they will get it twice.</p>'
|
|
26172
|
+
+'<div class=rfiform><label>Gmail sends a new email to<input type=email autocomplete=email data-rfi-again-to value="'+esc(f.againTo||held.to||'')+'" data-command-id="steel.rfi-gmail-again-to"></label>'
|
|
26173
|
+
+'<label class=rficheck><input type=checkbox data-rfi-again-tick data-command-id="steel.rfi-gmail-again-tick"><span>I understand they may get it twice</span></label></div>',
|
|
26174
|
+
actions:[
|
|
26175
|
+
{label:'Cancel',ghost:true,cmd:'steel.rfi-gmail-again-cancel',run:()=>closeCalloutCard()},
|
|
26176
|
+
{label:'Send again with Gmail',primary:true,cmd:'steel.rfi-gmail-again-send',run:()=>{
|
|
26177
|
+
const body=document.getElementById('coCardBody'),status=document.getElementById('coCardStatus');
|
|
26178
|
+
const toInput=body.querySelector('[data-rfi-again-to]'),tick=body.querySelector('[data-rfi-again-tick]');
|
|
26179
|
+
const to=String(toInput&&toInput.value||'').trim();
|
|
26180
|
+
// Asked, not refused: the button stays live and says what is missing.
|
|
26181
|
+
if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(to)){status.setAttribute('role','alert');status.textContent='Give one email address, like name@company.com.';toInput&&toInput.focus();return;}
|
|
26182
|
+
if(!tick||!tick.checked){status.setAttribute('role','alert');status.textContent='Tick the box to confirm you understand they may get it twice.';if(tick){tick.setAttribute('aria-invalid','true');tick.focus();}return;}
|
|
26183
|
+
f.againTo=to;closeCalloutCard();
|
|
26184
|
+
if(rfiSettleFor!==f)return;
|
|
26185
|
+
void rfiSettleSend(f,{to,recordRevision:r.recordRevision}).catch(rfiGestureFailure);
|
|
26186
|
+
}},
|
|
26187
|
+
]});
|
|
26188
|
+
const first=document.querySelector('#coCardBody [data-rfi-again-tick]');if(first)first.focus();
|
|
26189
|
+
}
|
|
26190
|
+
async function rfiSettleSend(f,fields){
|
|
26191
|
+
const rowKey=f.rowKey,way=f.way;
|
|
26192
|
+
if(rfiBusy()){toast('One RFI is still being recorded — wait for it to finish.');return;}
|
|
26193
|
+
let opKey;
|
|
26194
|
+
try{opKey=rfiGmailRecoveryKey(f.attemptId,'settle-'+way);}
|
|
26195
|
+
catch(error){f.error=error.message;renderRfiList();return;}
|
|
26196
|
+
f.busy=true;f.error='';rfiOutcome=null;rfiGmailBusy={rowKey,action:'settle'};
|
|
26197
|
+
rfiFocusOverride={rows:[rowKey],ctl:'settle:submit'};rfiSay(rfiGmailBusyMessage('settle',f.id));renderRfiList();
|
|
26198
|
+
const deadline=rfiDeadline(RFI_ACTION_TIMEOUT_MS);
|
|
26199
|
+
try{
|
|
26200
|
+
const res=await deadline.race(rfiPost(RFI_GMAIL_API.settle(f.id,f.attemptId,way),JSON.stringify({operationKey:opKey,...fields}),deadline.signal));
|
|
26201
|
+
const body=res.body||{};
|
|
26202
|
+
if(way==='try-again'&&(res.httpOk||body.attempt)){
|
|
26203
|
+
// The answer is about the new send: Gmail's result reads exactly like a first send's.
|
|
26204
|
+
rfiForgetGmailRecoveryKeys(f.attemptId);rfiSettleFor=null;
|
|
26205
|
+
await rfiFinishGmailResponse(rowKey,res,body);
|
|
26206
|
+
// The new send never started (the project is being archived, or it changed): say the server's reason, not
|
|
26207
|
+
// "not finished recording", which is not what happened. The earlier send is settled either way.
|
|
26208
|
+
const fresh=body.attempt;
|
|
26209
|
+
// "Didn't start" only when the server says so; otherwise Gmail may have taken it and only the record is missing.
|
|
26210
|
+
if(body.settledAttempt&&fresh&&fresh.status==='prepared'&&body.error)
|
|
26211
|
+
rfiGmailOutcome(rowKey,'rfi-gmail-prepared',(body.code==='rfi-gmail-prepared'?'The earlier send is settled, but the new Gmail send didn’t start. ':'The earlier send is settled. ')+String(body.error),'unknown');
|
|
26212
|
+
return;
|
|
26213
|
+
}
|
|
26214
|
+
if(res.httpOk){
|
|
26215
|
+
rfiForgetGmailRecoveryKeys(f.attemptId);rfiSettleFor=null;rfiGmailUnknownRows.delete(rowKey);
|
|
26216
|
+
await rfiRefreshSaid(rowKey);
|
|
26217
|
+
const message=way==='leave-unconfirmed'?f.id+' left unconfirmed. It’s free again.':f.id+' recorded as sent another way, to '+fields.to+'.';
|
|
26218
|
+
rfiSay(message);toast(message,false,0,true);rfiFocusOverride={rows:[rowKey],ctl:'*first'};return;
|
|
26219
|
+
}
|
|
26220
|
+
rfiForgetGmailRecoveryKeys(f.attemptId);
|
|
26221
|
+
// Settled somewhere else, or it changed: say what the server said and show the list as it now is.
|
|
26222
|
+
if(RFI_SETTLE_OUT_OF_DATE.has(body.code)){
|
|
26223
|
+
rfiSettleFor=null;
|
|
26224
|
+
await rfiRefreshSaid(rowKey);
|
|
26225
|
+
const message=String(body.error||f.id+' changed since you opened it.');
|
|
26226
|
+
rfiSay(message);toast(message);rfiFocusOverride={rows:[rowKey],ctl:'*first'};return;
|
|
26227
|
+
}
|
|
26228
|
+
// Refused: nothing changed. Say why in the panel; the next try is a new intent.
|
|
26229
|
+
// The answer carries Gmail's readiness: show it at once, never wait on a second check before the panel answers.
|
|
26230
|
+
if(body.code==='rfi-gmail-not-ready'&&body.readiness&&typeof body.readiness==='object'){
|
|
26231
|
+
rfiGmailReadiness={status:String(body.readiness.status||'unavailable'),message:String(body.readiness.message||'')};paintRfiGmailReadiness();
|
|
26232
|
+
}
|
|
26233
|
+
f.busy=false;f.error=String(body.error||'FloLess couldn’t do that just now. Try again.');
|
|
26234
|
+
rfiFocusOverride={rows:[rowKey],ctl:'settle:submit'};rfiSay(f.error);
|
|
26235
|
+
}catch(error){
|
|
26236
|
+
if(deadline.cancelled())return;
|
|
26237
|
+
if(!deadline.timedOut())console.warn('[steel] settle response was lost',error&&error.message?error.message:error);
|
|
26238
|
+
if(way==='try-again'){
|
|
26239
|
+
// A Try again can still be sending after the browser stops waiting: read the list, and if the earlier send is
|
|
26240
|
+
// no longer the one holding the RFI, a new Gmail send may be on its way — say so, never offer to send again.
|
|
26241
|
+
// Bounded: a read that hangs too must not leave every RFI action waiting behind it.
|
|
26242
|
+
const read=await Promise.race([rfiRefreshSaid(rowKey),new Promise(resolve=>setTimeout(()=>resolve('timeout'),RFI_ACTION_TIMEOUT_MS))]);
|
|
26243
|
+
const fresh=read==='timeout'?null:rfiState.records.find(r=>r&&r.id===f.id),now=fresh&&rfiGmailAttemptFrom(null,fresh);
|
|
26244
|
+
if(now&&now.attemptId!==f.attemptId){
|
|
26245
|
+
rfiSettleFor=null;rfiGmailUnknownRows.add(rowKey);
|
|
26246
|
+
await rfiFinishGmailResponse(rowKey,{httpOk:true},{rfi:fresh});return;
|
|
26247
|
+
}
|
|
26248
|
+
if(!now||!rfiHeldAttempt(fresh,f.attemptId)){
|
|
26249
|
+
rfiSettleFor=null;rfiGmailUnknownRows.add(rowKey);
|
|
26250
|
+
rfiGmailOutcome(rowKey,'rfi-gmail-outcome-unknown','FloLess stopped waiting, and a new Gmail send may be on its way. Do not send this RFI again. Check it once the connection recovers.','unknown');return;
|
|
26251
|
+
}
|
|
26252
|
+
}
|
|
26253
|
+
// No answer: the same key does it once, so trying again is safe.
|
|
26254
|
+
f.busy=false;f.error='FloLess didn’t get an answer, so it can’t tell whether that was recorded. Doing it again does it once.';
|
|
26255
|
+
rfiFocusOverride={rows:[rowKey],ctl:'settle:submit'};rfiSay(f.error);
|
|
26256
|
+
}finally{
|
|
26257
|
+
deadline.clear();rfiGmailBusy=null;renderRfiList();paintRfiFail();paintRfiStat();
|
|
26258
|
+
}
|
|
26259
|
+
}
|
|
25991
26260
|
async function rfiSubmitForm(){
|
|
25992
26261
|
const f=rfiFormFor;
|
|
25993
26262
|
if(!f||f.busy)return;
|
|
@@ -26765,6 +27034,146 @@ async function focusMember(memberId,opts){
|
|
|
26765
27034
|
if(modelEditor.dispatch('model.fit-selection')===false)return {ok:false,reason:'frame',said:'Member '+memberId+' is selected, but it is hidden in the 3D view. Use Show all in the Visibility menu, then press Show in the model again.'};
|
|
26766
27035
|
return {ok:true};
|
|
26767
27036
|
}
|
|
27037
|
+
/* -- AI Chat's view command (#2255; the steel model, #2876) ----------------------------------------------------------
|
|
27038
|
+
The structured query the Revit and Tekla Parser viewers take (web/model-view-query.js), evaluated over this model's
|
|
27039
|
+
members by the rows its Properties panel shows (PROP_DEFS, plus Material) and applied through the calls the 3D
|
|
27040
|
+
toolbar makes. Only the view changes: nothing is saved.
|
|
27041
|
+
The steel model is edited live, so the view a command was claimed for is this page's session, not a model revision:
|
|
27042
|
+
a query is matched against the members as they are when it is applied. Ids keep the revision they were shared with
|
|
27043
|
+
(the selection's serverRevision), as in every viewer. When the 3D view is not on screen it comes up first, the way
|
|
27044
|
+
Show in the model brings it up; the query is checked before that, so a request that cannot apply moves nothing, and
|
|
27045
|
+
checked again after, synchronously from there to its last change, so an edit cannot land in the middle. */
|
|
27046
|
+
// Made on first use with the editor's own id helper (it falls back where crypto is missing), so loading this block runs nothing.
|
|
27047
|
+
let steelViewerSessionId=null;
|
|
27048
|
+
const steelViewSession=()=>steelViewerSessionId||(steelViewerSessionId=newMutationId());
|
|
27049
|
+
/** Bringing the 3D view up must leave time to answer before the main window stops waiting (9 s, web/chat.js). */
|
|
27050
|
+
const STEEL_VIEW_3D_WAIT_MS=7000;
|
|
27051
|
+
const STEEL_VIEW_MODES=Object.freeze(['wire','xray','solid','realistic','shadowed']);
|
|
27052
|
+
/** Rows whose value is a world elevation in millimetres (see _effTos), compared as lengths. */
|
|
27053
|
+
const STEEL_VIEW_ELEVATION_KEYS=new Set(['tos_start','tos_end','col_tos','col_bos']);
|
|
27054
|
+
function steelViewTarget(){
|
|
27055
|
+
return {projectId:PROJECT,source:'steel',revision:'live',sourceDigest:'live',viewerSessionId:steelViewSession(),loading:false};
|
|
27056
|
+
}
|
|
27057
|
+
/** One candidate per member: { id, label, facts: Map<lowercase name, fact[]>, names, colour }. */
|
|
27058
|
+
function steelViewCandidates(){
|
|
27059
|
+
const members=allMembers().filter(m=>m&&m.id!=null);
|
|
27060
|
+
const lookup={members:new Map(members.map(m=>[m.id,m])),details:new Map()};
|
|
27061
|
+
return members.map(m=>{
|
|
27062
|
+
const facts=new Map(),names=new Map();
|
|
27063
|
+
const add=(name,shown,number=null,unit=null,lengthMm=null)=>{
|
|
27064
|
+
const key=name.toLocaleLowerCase(),list=facts.get(key)||[];
|
|
27065
|
+
list.push({group:'Properties',text:String(shown),number,unit,lengthMm});facts.set(key,list);if(!names.has(key))names.set(key,name);
|
|
27066
|
+
};
|
|
27067
|
+
for(const def of PROP_DEFS){
|
|
27068
|
+
// A row the panel withholds (a plan-derived default) is not a value to match on.
|
|
27069
|
+
if(def.needsPlan&&!def.canonicalGet)continue;
|
|
27070
|
+
let raw,shown;
|
|
27071
|
+
try{raw=def.needsPlan?def.canonicalGet(m):(def.labelGet||def.get)(m);if(raw===undefined||raw===null)continue;shown=def.fmt(raw);}
|
|
27072
|
+
catch(_){continue;}
|
|
27073
|
+
if(shown==null||shown==='')continue;
|
|
27074
|
+
if(def.key==='length'){const mm=_lenMm(m);add(def.label,shown,Number.isFinite(mm)?mm:null,'mm',Number.isFinite(mm)?mm:null);}
|
|
27075
|
+
else if(STEEL_VIEW_ELEVATION_KEYS.has(def.key)&&Number.isFinite(raw))add(def.label,shown,raw,'mm',raw);
|
|
27076
|
+
else if(def.key==='weight'&&Number.isFinite(raw))add(def.label,shown,raw,_uw().weight,null);
|
|
27077
|
+
else add(def.label,shown);
|
|
27078
|
+
}
|
|
27079
|
+
let material=null;try{material=m.material||profileDefaultMaterial(m.profile);}catch(_){}
|
|
27080
|
+
if(material)add('Material',material);
|
|
27081
|
+
return {id:m.id,label:subjectLabelText(subjectLabel({kind:'member',id:m.id},lookup))||String(m.id),facts,names,colour:null};
|
|
27082
|
+
});
|
|
27083
|
+
}
|
|
27084
|
+
async function applySteelModelView(command,target){
|
|
27085
|
+
const selectedNow=()=>{try{return modelEditor.isReady()?(modelEditor.getState().selectionCount??selIds.size):selIds.size;}catch(_){return selIds.size;}};
|
|
27086
|
+
const base={total:0,matched:0,selectionApplied:0,selectedFinal:0,notDrawable:0,noField:0,unchecked:0,overCap:false,
|
|
27087
|
+
framed:false,display:null,skipped:[],assumptions:[],references:[],samples:[]};
|
|
27088
|
+
const refuse=(reason,extra={})=>({...base,selectedFinal:selectedNow(),status:'not-applied',reason,...extra});
|
|
27089
|
+
// Only the view this command was claimed for: this page, showing this project's model.
|
|
27090
|
+
const sameView=()=>!editorTerminalDisposed&&!!target&&target.viewerSessionId===steelViewSession();
|
|
27091
|
+
if(!sameView())return refuse('session-changed');
|
|
27092
|
+
if(target.projectId!==PROJECT)return refuse('model-changed');
|
|
27093
|
+
let parsed;
|
|
27094
|
+
try{parsed=ModelPanelBridge.parseModelViewCommand(command);}
|
|
27095
|
+
catch(error){console.error('[steel] an AI view command could not be read',error);return refuse('failed');}
|
|
27096
|
+
// The query over the members as they are now. `drawn` (member ids built in 3D) is known once the 3D view is up.
|
|
27097
|
+
const evaluate=(drawn)=>{
|
|
27098
|
+
const candidates=steelViewCandidates(),total=candidates.length;
|
|
27099
|
+
if(!parsed.select)return {total,selection:null};
|
|
27100
|
+
const ev=ModelPanelBridge.evaluateModelViewQuery(candidates,parsed.select,{selectedIds:[...selIds],knownIds:new Set(candidates.map(c=>c.id)),
|
|
27101
|
+
revision:serverRevision>=0?String(serverRevision):'',displayUnits:displayUnits()});
|
|
27102
|
+
if(!ev.ok)return {total,refusal:refuse(ev.reason,{total,field:ev.field??null,commonFields:ev.commonFields??null,missing:ev.missing??0})};
|
|
27103
|
+
const counts={total,matched:ev.matchedIds.length,noField:ev.noField,unchecked:ev.unchecked,references:ev.references,assumptions:ev.assumptions};
|
|
27104
|
+
if(!ev.matchedIds.length)return {total,refusal:refuse('no-match',counts)};
|
|
27105
|
+
if(!drawn)return {total,selection:{ids:ev.matchedIds,counts}};
|
|
27106
|
+
// A member with no geometry (an elevation that was never read) is matched but has nothing to select in 3D.
|
|
27107
|
+
const ids=ev.matchedIds.filter(id=>drawn.has(id)),notDrawable=ev.matchedIds.length-ids.length;
|
|
27108
|
+
if(!ids.length)return {total,refusal:refuse('nothing-drawable',{...counts,notDrawable})};
|
|
27109
|
+
return {total,selection:{ids,counts:{...counts,notDrawable}}};
|
|
27110
|
+
};
|
|
27111
|
+
const needsSelection=ModelPanelBridge.displayNeedsSelection(parsed.display);
|
|
27112
|
+
let checked;
|
|
27113
|
+
try{checked=evaluate(null);}
|
|
27114
|
+
catch(error){console.error('[steel] an AI view command could not be evaluated',error);return refuse('failed');}
|
|
27115
|
+
if(checked.refusal)return checked.refusal;
|
|
27116
|
+
if(needsSelection&&!checked.selection&&!selIds.size)return refuse('selection-required',{total:checked.total});
|
|
27117
|
+
// The 3D view holds the selection's display tools: bring it up, in the layout the person chose (requestFocusView).
|
|
27118
|
+
const ready3d=()=>view3dShown&&view3dReady&&!!window.Steel3DView&&modelEditor.isReady()&&!viewTransition;
|
|
27119
|
+
// A request refused once the 3D view was brought up for it puts the 2D plan back (and cancels a switch still on its
|
|
27120
|
+
// way), unless the person picked a view meanwhile: "Nothing changed" must stay true of the layout too.
|
|
27121
|
+
let putBack=()=>{};
|
|
27122
|
+
const refuseAfter3d=(reason,extra)=>{putBack();return refuse(reason,extra);};
|
|
27123
|
+
if(!ready3d()){
|
|
27124
|
+
const choice=viewChoiceSeq,before=viewMode;let gaveUp=false,timer=null;
|
|
27125
|
+
// viewWantSeq++ calls off a 3D/Split switch still waiting; focusViewSeq++ calls off requestFocusView's own retry of
|
|
27126
|
+
// a Split restore it took over; remember:false keeps the person's saved layout (this is not their choice) (#2876 review).
|
|
27127
|
+
if(before==='2d')putBack=()=>{if(viewChoiceSeq!==choice)return;viewWantSeq++;focusViewSeq++;if(viewMode!=='2d')setView('2d',{remember:false});};
|
|
27128
|
+
const up=(async()=>view3dSettled(await requestFocusView(),()=>!gaveUp,choice))();
|
|
27129
|
+
const outcome=await Promise.race([up,new Promise(resolve=>{timer=setTimeout(()=>resolve('late'),STEEL_VIEW_3D_WAIT_MS);})]);
|
|
27130
|
+
clearTimeout(timer);gaveUp=true;
|
|
27131
|
+
if(!sameView())return refuse('session-changed');
|
|
27132
|
+
if(outcome!==true||!ready3d())return refuseAfter3d('loading',{total:checked.total});
|
|
27133
|
+
}
|
|
27134
|
+
// From here to the last change nothing awaits.
|
|
27135
|
+
let evaluated;
|
|
27136
|
+
const drawnIds=modelEditor.steel.drawnMemberIds();
|
|
27137
|
+
if(!Array.isArray(drawnIds))return refuseAfter3d('loading',{total:checked.total});
|
|
27138
|
+
try{evaluated=evaluate(new Set(drawnIds));}
|
|
27139
|
+
catch(error){console.error('[steel] an AI view command could not be evaluated',error);return refuseAfter3d('failed',{total:checked.total});}
|
|
27140
|
+
if(evaluated.refusal){putBack();return evaluated.refusal;}
|
|
27141
|
+
const {total,selection}=evaluated,display=parsed.display;
|
|
27142
|
+
if(needsSelection&&!selection&&!selectedNow())return refuseAfter3d('selection-required',{total});
|
|
27143
|
+
if(viewMode==='split')setActivePane('3d');
|
|
27144
|
+
// Nothing has changed up to here. From here on, every step is the call a person's click makes.
|
|
27145
|
+
if(selection){
|
|
27146
|
+
if(modelEditor.steel.clearConnSel)modelEditor.steel.clearConnSel();
|
|
27147
|
+
modelSelection.replaceMembers(selection.ids);selDimIds.clear();sel3dDimIds.clear();modelSelection.clearGrids();render();
|
|
27148
|
+
if(!selection.ids.some(id=>selIds.has(id)))return refuse('failed',{total});
|
|
27149
|
+
}
|
|
27150
|
+
const selectionApplied=selection?selection.ids.filter(id=>selIds.has(id)).length:0;
|
|
27151
|
+
const skipped=[],applied=[];
|
|
27152
|
+
// Framed only when the fit ran: a selection that is all hidden leaves the camera where it was.
|
|
27153
|
+
let framed=false;
|
|
27154
|
+
try{
|
|
27155
|
+
if(selection&&display?.fit!=='none'&&display?.fit!=='all')framed=modelEditor.dispatch('model.fit-selection')===true;
|
|
27156
|
+
if(display?.visibility==='isolate'){modelEditor.dispatch('model.isolate');applied.push('isolate');}
|
|
27157
|
+
if(display?.visibility==='hide-selected'){modelEditor.dispatch('model.hide-selected');applied.push('hide-selected');}
|
|
27158
|
+
if(display?.visibility==='show-all'){modelEditor.dispatch('model.show-all');applied.push('show-all');}
|
|
27159
|
+
if(display?.ghostUnselected!=null){modelEditor.dispatch('model.ghost-unselected.set',display.ghostUnselected);applied.push('ghost');}
|
|
27160
|
+
if(display?.mode){modelEditor.dispatch('model.display-mode.set',display.mode);reflectMode();applied.push('mode');}
|
|
27161
|
+
if(display?.fit==='all'){modelEditor.dispatch('model.fit');applied.push('fit-all');}
|
|
27162
|
+
else if(display?.fit==='selection'&&!selection&&selectedNow()){framed=modelEditor.dispatch('model.fit-selection')===true;applied.push('fit-selection');}
|
|
27163
|
+
}catch(error){
|
|
27164
|
+
console.error('[steel] an AI display change failed part way',error);
|
|
27165
|
+
skipped.push('display-failed');
|
|
27166
|
+
}
|
|
27167
|
+
render();
|
|
27168
|
+
modelPanelBridge?.publishSnapshot();
|
|
27169
|
+
const state=modelEditor.getState()||{},mode=modelEditor.displayMode();
|
|
27170
|
+
const lookup={members:new Map(allMembers().filter(Boolean).map(m=>[m.id,m])),details:new Map()};
|
|
27171
|
+
return {...base,...(selection?.counts??{}),total,
|
|
27172
|
+
status:skipped.length?'partial':'applied',reason:null,skipped,
|
|
27173
|
+
selectionApplied,selectedFinal:state.selectionCount??selIds.size,framed,
|
|
27174
|
+
display:{ghostUnselected:modelEditor.ghostUnselected()===true,mode:STEEL_VIEW_MODES.includes(mode)?mode:'solid',filtered:state.hasVisibilityFilter===true,applied},
|
|
27175
|
+
samples:selection?selection.ids.slice(0,10).map(id=>(subjectLabelText(subjectLabel({kind:'member',id},lookup))||String(id)).slice(0,120)):[]};
|
|
27176
|
+
}
|
|
26768
27177
|
async function rfiOpenTarget(button){
|
|
26769
27178
|
const tuple=JSON.parse(button.dataset.rfiTarget),held=rfiCurrentTarget(tuple);
|
|
26770
27179
|
const localErrorKey=Number.isSafeInteger(tuple[3])?rfiOccurrenceKey(tuple[0],tuple[3]):null;
|
|
@@ -26888,6 +27297,7 @@ function rfiGroupedRecordRowHtml(r){
|
|
|
26888
27297
|
deliveryActs='<button data-command-id="steel.rfi-gmail-continue#'+esc(r.id)+'" data-command-instance-label="'+esc(r.id)+'" aria-label="Continue recording this send: '+esc(r.id)+'" data-rfi-ctl="gmail:continue" data-rfi-gmail-action=continue data-rfi-gmail-on="'+esc(r.id)+'" data-rfi-gmail-attempt="'+esc(delivery.attemptId)+'" data-tip="Resume only this prepared Gmail attempt"'+(busy?' aria-busy=true aria-disabled=true data-blocked-reason="This prepared Gmail attempt is already being continued"':'')+'>'+(busy?'Continuing this send…':'Continue recording this send')+'</button>';}
|
|
26889
27298
|
if(delivery&&delivery.status==='outcome-unknown'&&delivery.canConfirmFoundInSent&&delivery.attemptId){const busy=deliveryBusy&&rfiGmailBusy.action==='confirm';
|
|
26890
27299
|
deliveryActs='<button data-command-id="steel.rfi-gmail-confirm-sent#'+esc(r.id)+'" data-command-instance-label="'+esc(r.id)+'" aria-label="I found it in Sent: '+esc(r.id)+'" data-rfi-ctl="gmail:confirm" data-rfi-gmail-action=confirm data-rfi-gmail-on="'+esc(r.id)+'" data-rfi-gmail-attempt="'+esc(delivery.attemptId)+'" data-tip="Use only after matching this exact attempt in the connected account’s Sent folder"'+(busy?' aria-busy=true aria-disabled=true data-blocked-reason="This Sent-folder confirmation is already being recorded"':'')+'>'+(busy?'Recording confirmation…':'I found it in Sent')+'</button>';}
|
|
27300
|
+
deliveryActs+=rfiSettleButton(r,delivery,rowKey);
|
|
26891
27301
|
const occurrences=expanded?'<ol id="'+panelId+'" class=rfioccurrences aria-label="Occurrences in '+esc(r.id)+'">'+ordered.map(occ=>{
|
|
26892
27302
|
const index=occ.occurrenceIndex,key=rfiOccurrenceKey(r.id,index),technical=rfiTechnicalOccurrences.has(key);
|
|
26893
27303
|
const occurrenceForm=formOpen&&rfiFormFor.scopeKind!=='group'&&rfiFormFor.occurrenceIndex===index;
|
|
@@ -26907,7 +27317,7 @@ function rfiGroupedRecordRowHtml(r){
|
|
|
26907
27317
|
const sheetSummary=rfiScope==='sheet'?matching.length+' of '+count+' occurrences on this sheet · ':'';
|
|
26908
27318
|
return '<div class="rfirow'+(formOpen?' editing':'')+'" data-rfi-row="'+esc(rowKey)+'"'+(rowBusy?' aria-busy="true"':'')+'><span class="rfikind '+rfiStatusTone(r)+'">'+esc(kind)+'</span><div class=rfitx>'
|
|
26909
27319
|
+esc(r.question||'This grouped RFI records no question.')+'<div class=rfimeta><span>'+esc(r.id)+'</span><span>'+esc(rfiStatusWords(r))+'</span><span>'+sheetSummary+count+' occurrences · '+r.counts.sheets+' sheets · '+r.counts.entities+' members/connections</span></div>'
|
|
26910
|
-
+deliveryNote+(groupForm?rfiFormHtml(r,'all '+count+' occurrences',rowKey):(formOpen?'':recovering?rfiRecoveryHtml(rowKey)+(copy?'<div class=rfiacts>'+copy+'</div>':''):'<div class=rfiacts>'+gmail+send+allAnswer+allClose+allReopen+copy+deliveryActs+'</div>'))
|
|
27320
|
+
+deliveryNote+rfiSettleHtml(r,rowKey)+(groupForm?rfiFormHtml(r,'all '+count+' occurrences',rowKey):(formOpen?'':recovering?rfiRecoveryHtml(rowKey)+(copy?'<div class=rfiacts>'+copy+'</div>':''):'<div class=rfiacts>'+gmail+send+allAnswer+allClose+allReopen+copy+deliveryActs+'</div>'))
|
|
26911
27321
|
+'<button class="ghost rfigroup-toggle" data-command-id="steel.rfi-group-toggle#'+esc(r.id)+'" data-command-instance-label="'+esc(r.id)+'" data-rfi-expand="'+esc(r.id)+'" data-rfi-ctl=expand aria-expanded="'+expanded+'" aria-controls="'+panelId+'"><span>'+(expanded?'Hide':'Show')+' '+count+' occurrences</span><span aria-hidden=true>'+(expanded?'▴':'▾')+'</span></button>'
|
|
26912
27322
|
+(formOpen?'':rfiOutcomeHtml(rowKey))+occurrences+'</div></div>';
|
|
26913
27323
|
}
|
|
@@ -27072,13 +27482,14 @@ function rfiRecordRowHtml(r){
|
|
|
27072
27482
|
else if(delivery.status==='confirmed-sent')deliveryHtml='<div class=rfiaccepted role=note>Confirmed in the connected account’s Sent folder.</div>';
|
|
27073
27483
|
else if(delivery.status==='failed')deliveryHtml='<div class=rfifail role=note>Gmail did not receive this RFI. Nothing was sent.</div>';
|
|
27074
27484
|
else if(delivery.status==='prepared')deliveryHtml='<div class=rfiunknown role=note>This Gmail send was prepared, but FloLess has not finished recording its result. Do not start another send.</div>';
|
|
27075
|
-
else if(delivery.status==='outcome-unknown')deliveryHtml='<div class=rfiunknown role=note>FloLess cannot confirm whether Gmail accepted this RFI. Do not send it again. Check the connected account’s Sent folder'+(delivery.reconciliationMarker?' for '+esc(delivery.reconciliationMarker):'')+'.</div>';
|
|
27485
|
+
else if(delivery.status==='outcome-unknown')deliveryHtml='<div class=rfiunknown role=note>FloLess cannot confirm whether Gmail accepted this RFI. Do not send it again. Check the connected account’s Sent folder'+(delivery.reconciliationMarker?' for '+esc(delivery.reconciliationMarker):'')+'. If you don’t find it, choose I didn’t find it.</div>';
|
|
27076
27486
|
if(delivery.status==='prepared'&&delivery.canContinue&&delivery.attemptId){const busy=deliveryBusy&&rfiGmailBusy.action==='continue';
|
|
27077
27487
|
deliveryActs='<button data-command-id="steel.rfi-gmail-continue#'+esc(r.id)+'" data-command-instance-label="'+esc(r.id)+'" aria-label="Continue recording this send: '+esc(r.id)+'" data-rfi-ctl="gmail:continue" data-rfi-gmail-action=continue data-rfi-gmail-on="'+esc(r.id)+'" data-rfi-gmail-attempt="'+esc(delivery.attemptId)+'" data-tip="Resume only this prepared Gmail attempt"'+(busy?' aria-busy=true aria-disabled=true data-blocked-reason="This prepared Gmail attempt is already being continued"':'')+'>'+(busy?'Continuing this send…':'Continue recording this send')+'</button>';}
|
|
27078
27488
|
if(delivery.status==='outcome-unknown'&&delivery.canConfirmFoundInSent&&delivery.attemptId){const busy=deliveryBusy&&rfiGmailBusy.action==='confirm';
|
|
27079
27489
|
deliveryActs='<button data-command-id="steel.rfi-gmail-confirm-sent#'+esc(r.id)+'" data-command-instance-label="'+esc(r.id)+'" aria-label="I found it in Sent: '+esc(r.id)+'" data-rfi-ctl="gmail:confirm" data-rfi-gmail-action=confirm data-rfi-gmail-on="'+esc(r.id)+'" data-rfi-gmail-attempt="'+esc(delivery.attemptId)+'" data-tip="Use only after matching this exact attempt in the connected account’s Sent folder"'+(busy?' aria-busy=true aria-disabled=true data-blocked-reason="This Sent-folder confirmation is already being recorded"':'')+'>'+(busy?'Recording confirmation…':'I found it in Sent')+'</button>';}
|
|
27080
27490
|
if(deliveryBusy)deliveryHtml+='<div class=rfinote role=note>'+esc(rfiGmailBusyMessage(rfiGmailBusy.action,r.id))+'</div>';
|
|
27081
27491
|
}
|
|
27492
|
+
deliveryActs+=rfiSettleButton(r,delivery,rowKey);
|
|
27082
27493
|
if(rfiOutcome&&rfiOutcome.rowKey===rowKey&&delivery&&['failed','prepared','outcome-unknown'].includes(delivery.status))deliveryHtml='';
|
|
27083
27494
|
if(!delivery&&rfiGmailUnknownRows.has(rowKey))deliveryHtml='<div class=rfiunknown role=note>FloLess lost the Gmail response. Do not send this RFI again until a fresh read proves what happened.</div>';
|
|
27084
27495
|
// Said out loud rather than left as an absence somebody has to infer.
|
|
@@ -27096,7 +27507,7 @@ function rfiRecordRowHtml(r){
|
|
|
27096
27507
|
+(answerMismatch&&!profileMismatch?'<div class=rfinote role="note" data-rfi-answer-truth>'+esc(rfiSentence(answerMismatch.fact))+' The saved model must match the answer before Mark applied is available.</div>':'')
|
|
27097
27508
|
+(receiptMismatch&&!profileMismatch?'<div class=rfinote role="note" data-rfi-receipt-truth>'+esc(rfiSentence(receiptMismatch.fact))+' Refresh the model view before closing this RFI as resolved.</div>':'')
|
|
27098
27509
|
+(settling?'<div class=rfinote role="note" data-rfi-profile-settle>'+esc(settling.message)+'</div>':'')
|
|
27099
|
-
+deliveryHtml
|
|
27510
|
+
+deliveryHtml+rfiSettleHtml(r,rowKey)
|
|
27100
27511
|
+(rfiCopyFallbackId===r.id&&r.text?'<div class=rfinote style="white-space:pre-wrap;user-select:text">'+esc(r.text)+'</div>':'')
|
|
27101
27512
|
+(elevGap&&!formOpen&&!recovering?rfiElevationControls(rowKey,r.id,elevGap):'')
|
|
27102
27513
|
// The outcome renders INSIDE the form when one is open (directly above Submit, where focus lands);
|
|
@@ -27397,6 +27808,23 @@ function wireRfiList(){
|
|
|
27397
27808
|
rfiFocusOverride={rows:[rfiRowKey('record',id)],ctl:'occ:'+index+':technical'};renderRfiList();});
|
|
27398
27809
|
root.querySelectorAll('[data-rfi-gmail-action]').forEach(b=>b.onclick=()=>
|
|
27399
27810
|
Promise.resolve(rfiRecoverGmail(b)).catch(rfiGestureFailure));
|
|
27811
|
+
root.querySelectorAll('[data-rfi-settle-open]').forEach(b=>b.onclick=()=>rfiOpenSettle(b.dataset.rfiSettleOpen,b.dataset.rfiSettleAttempt));
|
|
27812
|
+
root.querySelectorAll('[data-rfi-settle-way]').forEach(b=>b.onclick=()=>rfiSettleChoose('way',b.dataset.rfiSettleWay));
|
|
27813
|
+
root.querySelectorAll('[data-rfi-settle-via]').forEach(b=>b.onclick=()=>rfiSettleChoose('via',b.dataset.rfiSettleVia));
|
|
27814
|
+
root.querySelectorAll('[data-rfi-settle-cancel]').forEach(b=>b.onclick=()=>rfiCloseSettle());
|
|
27815
|
+
root.querySelectorAll('[data-rfi-settle-submit]').forEach(b=>b.onclick=()=>{if(b.getAttribute('aria-disabled')==='true'){toast(b.dataset.blockedReason||'Wait for it to finish.');return;}rfiSettleSubmit();});
|
|
27816
|
+
root.querySelectorAll('[data-rfi-settle-history]').forEach(b=>b.onclick=()=>{
|
|
27817
|
+
const id=b.dataset.rfiSettleHistory;if(rfiSettledOpen.has(id))rfiSettledOpen.delete(id);else rfiSettledOpen.add(id);
|
|
27818
|
+
rfiFocusOverride={rows:[rfiRowKey('record',id)],ctl:'settle:history'};renderRfiList();});
|
|
27819
|
+
root.querySelectorAll('[data-rfi-settle-input]').forEach(i=>i.oninput=()=>{
|
|
27820
|
+
if(!rfiSettleFor)return;rfiSettleFor[i.dataset.rfiSettleInput]=i.value;
|
|
27821
|
+
const count=i.dataset.rfiSettleInput==='how'&&i.closest('[data-rfi-settle-panel]')?.querySelector('[data-rfi-settle-count]');
|
|
27822
|
+
if(count)count.textContent=i.value.length+' of '+RFI_HOW_MAX;});
|
|
27823
|
+
// The settle choices are radio groups: arrows move and choose.
|
|
27824
|
+
root.querySelectorAll('[data-rfi-settle-panel] [role=radiogroup]').forEach(g=>g.onkeydown=e=>{
|
|
27825
|
+
if(!['ArrowDown','ArrowRight','ArrowUp','ArrowLeft'].includes(e.key))return;
|
|
27826
|
+
const radios=[...g.querySelectorAll('[role=radio]')],i=radios.indexOf(document.activeElement);if(i<0)return;
|
|
27827
|
+
e.preventDefault();radios[(i+(e.key==='ArrowDown'||e.key==='ArrowRight'?1:radios.length-1))%radios.length].click();});
|
|
27400
27828
|
root.querySelectorAll('[data-rfi-disp]').forEach(b=>b.onclick=()=>rfiSetDisposition(b.dataset.rfiDisp));
|
|
27401
27829
|
root.querySelectorAll('[data-rfi-submit]').forEach(b=>b.onclick=()=>Promise.resolve(rfiSubmitForm()).catch(rfiGestureFailure));
|
|
27402
27830
|
root.querySelectorAll('[data-rfi-cancel]').forEach(b=>b.onclick=()=>rfiCloseForm());
|
|
@@ -28464,7 +28892,7 @@ document.getElementById('coCardModal').addEventListener('keydown',e=>{
|
|
|
28464
28892
|
e.stopPropagation();
|
|
28465
28893
|
if(e.key==='Escape'){e.preventDefault();if(window.OverlayEscape)window.OverlayEscape.markUsed(e);closeCalloutCard();return;}
|
|
28466
28894
|
if(e.key!=='Tab')return;
|
|
28467
|
-
const f=[...document.querySelectorAll('#coCardModal button')].filter(n=>!n.disabled&&n.offsetParent!==null);if(!f.length)return;
|
|
28895
|
+
const f=[...document.querySelectorAll('#coCardModal button, #coCardModal input')].filter(n=>!n.disabled&&n.offsetParent!==null);if(!f.length)return;
|
|
28468
28896
|
const first=f[0],last=f[f.length-1];
|
|
28469
28897
|
if(e.shiftKey&&document.activeElement===first){e.preventDefault();last.focus();}
|
|
28470
28898
|
else if(!e.shiftKey&&document.activeElement===last){e.preventDefault();first.focus();}
|
|
@@ -30910,6 +31338,7 @@ legendPanelHost=ModelPanelBridge.createPanelHost({win:window,root:legendBody('ro
|
|
|
30910
31338
|
modelPanelBridge=ModelPanelBridge.createModelPanelBridge({win:window,origin:location.origin,snapshot:modelPanelSnapshot,
|
|
30911
31339
|
selectedId:()=>[...selIds].at(-1)||null,selectedIds:()=>[...selIds],selectedSubjects:modelSubjects,
|
|
30912
31340
|
chatLinksChanged:()=>refreshChatLinks(true),
|
|
31341
|
+
view:(command,target)=>applySteelModelView(command,target), // #2876: an AI view command this window claimed, applied in this viewer
|
|
30913
31342
|
select:()=>false,expand:()=>false, // no list tabs to pick from or expand
|
|
30914
31343
|
panel:showLegendTab});
|
|
30915
31344
|
modelPanelBridge.ready(String(PROJECT||APP_ID));modelPanelGeneration=modelEditGeneration;
|