@floless/app 0.143.0 → 0.144.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.
Files changed (48) hide show
  1. package/dist/floless-server.cjs +177152 -160760
  2. package/dist/schemas/steel.model.v2.schema.json +50 -2
  3. package/dist/schemas/tekla.model.v1.schema.json +66 -0
  4. package/dist/schemas/tekla.model.v2.schema.json +69 -0
  5. package/dist/schemas/tekla.source-package.v1.schema.json +37 -0
  6. package/dist/skills/floless-app-steel-takeoff/SKILL.md +24 -1
  7. package/dist/skills/floless-app-workflows/SKILL.md +8 -2
  8. package/dist/skills/floless-app-workflows/references/workspace-data.md +25 -4
  9. package/dist/templates/floless-workspace-model-report.flo +27 -23
  10. package/dist/templates/revit-model.flo +6 -2
  11. package/dist/templates/tekla-model-report.flo +60 -0
  12. package/dist/templates/tekla-parser.flo +61 -0
  13. package/dist/web/app.css +89 -2
  14. package/dist/web/aware.js +423 -46
  15. package/dist/web/commands-revit.js +4 -0
  16. package/dist/web/commands-shell.js +136 -3
  17. package/dist/web/commands-steel.js +6 -0
  18. package/dist/web/commands-tekla-parser.js +48 -0
  19. package/dist/web/commands.js +1 -1
  20. package/dist/web/grid-core.js +15 -0
  21. package/dist/web/index.html +40 -2
  22. package/dist/web/instructor.js +13 -3
  23. package/dist/web/left-pane.js +160 -10
  24. package/dist/web/model-artifact-loader.js +15 -0
  25. package/dist/web/model-display-units.js +89 -0
  26. package/dist/web/model-editor-revit-adapter.js +21 -4
  27. package/dist/web/model-editor.css +4 -2
  28. package/dist/web/model-measure.js +10 -6
  29. package/dist/web/model-panel-bridge.js +46 -3
  30. package/dist/web/model-pointer-dock.js +21 -1
  31. package/dist/web/model-property-display.js +91 -0
  32. package/dist/web/model-revit-module.js +9 -0
  33. package/dist/web/model-selection-tools.js +11 -0
  34. package/dist/web/model-spatial-panel.js +52 -21
  35. package/dist/web/model-structural-grid-view.js +334 -0
  36. package/dist/web/model-tekla-selection.js +32 -0
  37. package/dist/web/model-viewport-revit-adapter.js +119 -32
  38. package/dist/web/revit-editor.css +11 -1
  39. package/dist/web/revit-editor.html +4 -3
  40. package/dist/web/revit-editor.js +589 -111
  41. package/dist/web/steel-3d-view.js +58 -372
  42. package/dist/web/steel-editor.html +231 -8
  43. package/dist/web/tekla-editor.html +71 -0
  44. package/dist/web/tekla-structural-grid-adapter.js +56 -0
  45. package/dist/web/workspaces.js +872 -97
  46. package/distribution-profile-production.mjs +4 -0
  47. package/distribution-resource-inventory.mjs +4 -2
  48. package/package.json +5 -2
@@ -1311,6 +1311,12 @@ rect.lblhot:focus-visible{outline:2px solid var(--brand);outline-offset:2px;stro
1311
1311
  #rfiList .rfiacts button{font-size:11px;padding:3px 8px}
1312
1312
  #rfiList .rfiacts [aria-disabled=true]{opacity:.48;cursor:progress;background:var(--btn);border-color:var(--ctrl-border)}
1313
1313
  #rfiList .rfiacts [aria-disabled=true]:hover{background:var(--btn);border-color:var(--ctrl-border);color:var(--text)}
1314
+ /* #1723 — a proposed height and a typed one share one row of controls. The height field is the RFI
1315
+ form's own input treatment, compressed to the button row's height; its label sits inline so the
1316
+ row stays one line on a wide list and wraps whole on a narrow one. */
1317
+ #rfiList .rfielev{display:inline-flex;align-items:center;gap:5px}
1318
+ #rfiList .rfielev .elab{font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:var(--mut);margin:0}
1319
+ #rfiList .rfielev input{width:110px;font-size:11px;padding:3px 6px}
1314
1320
  #rfiList .rfigroup-toggle{width:100%;margin-top:8px;text-align:left;display:flex;justify-content:space-between;align-items:center}
1315
1321
  #rfiList .rfioccurrences{grid-column:1/-1;margin:4px 0 0;padding:0;list-style:none;border-top:1px solid var(--line)}
1316
1322
  #rfiList .rfioccurrence{padding:10px 0;border-bottom:1px solid var(--line)}
@@ -9122,7 +9128,7 @@ async function connModifyRequest(j){
9122
9128
  }
9123
9129
  function syncV2SelectionNotice(p){
9124
9130
  if(!p||!selIds.size||viewPropsId)return; // a view in the panel keeps the selection, not its notices
9125
- p.querySelectorAll('.v2-selection-notice,.v2-elevation-warning').forEach(el=>el.remove());
9131
+ p.querySelectorAll('.v2-selection-notice,.v2-elevation-warning,.v2-elevation-proposal').forEach(el=>el.remove());
9126
9132
  const ids=[...selIds].filter(id=>!!(C.members||[]).find(m=>m&&m.id===id));
9127
9133
  if(!ids.length)return;
9128
9134
  const other=[];
@@ -9179,8 +9185,67 @@ function syncV2SelectionNotice(p){
9179
9185
  const m=projected[0],canonical=selected[0];
9180
9186
  if(m&&canonical&&m.role==='column'){mark('bos',!Number.isFinite(canonical.from?.z?.known));mark('tosC',!Number.isFinite(canonical.to?.z?.known));}
9181
9187
  else if(m&&canonical){mark('tosA',!Number.isFinite(canonical.from?.z?.known));mark('tosB',!Number.isFinite(canonical.to?.z?.known));}
9188
+ if(m&&canonical)inspectorHeightNotes(m,canonical);
9182
9189
  }
9183
9190
  }
9191
+ /**
9192
+ * Under each elevation field of ONE selected member (#1723): say when the height shown is only where the
9193
+ * end is DRAWN — nothing on the drawings confirms it — and offer the heights the drawing states, with
9194
+ * the same Use control the questions list has. Every promised apply is reachable here even when the
9195
+ * questions list is capped, because the conversation names the member and its sheet.
9196
+ *
9197
+ * The first sentence is the model's own fact (`assumed`); the proposal and its wording are the server's,
9198
+ * from the last questions read — nothing here decides which height is right.
9199
+ */
9200
+ function inspectorHeightNotes(m,canonical){
9201
+ const ids=m.role==='column'?['bos','tosC']:['tosA','tosB'];
9202
+ [0,1].forEach(end=>{
9203
+ const input=document.getElementById(ids[end]);if(!input)return;
9204
+ const z=(end===0?canonical.from:canonical.to)?.z;
9205
+ const gapKey='unknown-elevation:'+canonical.id+':'+end;
9206
+ const live=rfiState.records.find(r=>r&&r.liveGap&&r.liveGap.gapKey===gapKey);
9207
+ const g=live&&live.liveGap,p=g&&g.proposal&&g.proposal.apply==='now'?g.proposal:null;
9208
+ const assumed=!!z&&z.assumed===true&&Number.isFinite(z.known);
9209
+ if(!assumed&&!p)return;
9210
+ const box=document.createElement('div');box.className='hint v2-elevation-proposal';box.setAttribute('role','note');
9211
+ // A whole row of the field grid, never one cell of it — squeezed into the value column the sentence
9212
+ // wraps a word per line beside the field it explains.
9213
+ box.style.cssText='margin:2px 0 6px;grid-column:1/-1;line-height:1.5';
9214
+ const parts=[];
9215
+ // The server's basis-aware sentence when the questions have been read; the model's own fact otherwise.
9216
+ // Otherwise the seam's own reason, which names the real basis (a plan's cut plane, the other end, the
9217
+ // read's own number) — a plan-placed end has no live question row, and must still say why.
9218
+ const drawn=g&&g.currentValue&&g.currentValue.note?g.currentValue.note
9219
+ :'Drawn at this height for now.'+(typeof z.why==='string'&&z.why.trim()?' '+z.why.trim():' The drawings do not confirm it.');
9220
+ const confirmsDrawn=!!p&&p.candidates.every(c=>c&&(c.readings||[]).every(rd=>rd&&rd.source==='server-placement'));
9221
+ if(assumed&&!p)parts.push(drawn+' Type the right height to settle it.');
9222
+ else if(assumed&&!confirmsDrawn)parts.push(drawn);
9223
+ if(p)parts.push(p.ask);
9224
+ const text=document.createElement('div');text.textContent=parts.join(' ');box.appendChild(text);
9225
+ if(p&&rfiEndUnresolved(canonical.id,end)){
9226
+ const acts=document.createElement('div');acts.className='row';acts.style.cssText='gap:5px;flex-wrap:wrap;margin-top:4px';
9227
+ for(const c of p.candidates){
9228
+ if(!c||typeof c.key!=='string'||!Number.isFinite(c.value))continue;
9229
+ const label=fmtDispElev(c.value),what='the top of steel at the '+rfiEndWords(end,m)+' of '+canonical.id;
9230
+ const verb=(c.readings||[]).every(rd=>rd&&rd.source==='server-placement')?'Confirm':'Use';
9231
+ const b=document.createElement('button');b.className='ghost';b.type='button';
9232
+ b.setAttribute('data-command-id','steel.inspector-use-height#'+canonical.id+' '+rfiEndWords(end,m)+'#'+c.key);
9233
+ b.setAttribute('data-command-instance-label',canonical.id+' '+rfiEndWords(end,m)+' — '+label);
9234
+ b.setAttribute('aria-label',verb+' '+label+' for '+what);b.textContent=verb+' '+label;
9235
+ if(rfiElevBusy){b.setAttribute('aria-disabled','true');b.setAttribute('data-blocked-reason','A height is still being saved — wait for it to finish');}
9236
+ b.onclick=()=>{if(b.getAttribute('aria-disabled')==='true')return;
9237
+ Promise.resolve(rfiApplyHeight(rfiRowKey('record',live.id),c.value,c.key)).then(()=>render()).catch(rfiGestureFailure);};
9238
+ acts.appendChild(b);
9239
+ }
9240
+ if(acts.childNodes.length)box.appendChild(acts);
9241
+ }
9242
+ // After the field's whole ROW (label + value), never inside the value cell: `.pval` is a flex cell a
9243
+ // sentence cannot wrap in. A layout without that row falls back to just after the field.
9244
+ const cell=input.closest('.pval'),row=cell&&cell.parentElement&&cell.parentElement!==document.getElementById('panel')?cell.parentElement:null;
9245
+ const anchor=row||(input.nextElementSibling&&input.nextElementSibling.classList.contains('edec')?input.nextElementSibling:input);
9246
+ anchor.after(box);
9247
+ });
9248
+ }
9184
9249
  /**
9185
9250
  * Does something else own the panel or the selection right now?
9186
9251
  *
@@ -21604,11 +21669,14 @@ function rfiOccurrenceOnActiveSheet(occ){
21604
21669
  /** Every row the list can show, before the status filter. Records first (newest first, as the server
21605
21670
  * sorted them), then the symptoms nobody has filed. */
21606
21671
  function rfiRowsIn(scope){
21607
- const live=rfiLiveByGap(),closed=rfiClosedByGap(),rows=[];
21672
+ const live=rfiLiveByGap(),closed=rfiClosedByGap(),rows=[],settleable=[];
21608
21673
  for(const r of rfiState.records){
21609
21674
  if(scope==='sheet'&&!rfiRecordOnActiveSheet(r))continue;
21610
- rows.push({kind:'record',record:r});
21675
+ // A question one click can settle leads (#1723): the list is capped, and a proposal a read promised
21676
+ // must not fall below the cap behind rows that need a conversation. Otherwise the server's order stands.
21677
+ (r&&r.liveGap&&r.liveGap.proposal&&r.liveGap.proposal.apply==='now'?settleable:rows).push({kind:'record',record:r});
21611
21678
  }
21679
+ rows.unshift(...settleable);
21612
21680
  for(const m of rfiSymptomMembersIn(scope)){
21613
21681
  const gap=rfiSizeGapKey(m.id);
21614
21682
  if(live.has(gap))continue; // the record is already listed above
@@ -21692,7 +21760,7 @@ async function refreshRfiRecords(opts){
21692
21760
  ?'Source: '+dt.sheet+', page '+dt.page+(dt.elementId?', element '+dt.elementId:''):'';
21693
21761
  return {
21694
21762
  id:'live:'+g.id,gapKey:g.gapKey,kind:g.kind,question:g.question,status:'open',recordRevision:0,
21695
- text:[g.question,ids.length?'Member'+(ids.length===1?'':'s')+': '+ids.join(', '):'',source].filter(Boolean).join('\n'),
21763
+ text:[(g.proposal&&typeof g.proposal.ask==='string'&&g.proposal.ask)||g.question,ids.length?'Member'+(ids.length===1?'':'s')+': '+ids.join(', '):'',source].filter(Boolean).join('\n'),
21696
21764
  subjects,checked:g.checked||[],liveOnly:true,liveGap:g,
21697
21765
  targets,
21698
21766
  }});
@@ -23350,6 +23418,125 @@ function rfiResolveControls(memberId,locked){
23350
23418
  /** The one sentence a row prints when the model holds the member but cannot draw it anywhere. */
23351
23419
  const RFI_UNREACHABLE='FloLess cannot place this member on any sheet it can map, so its size cannot be set or located from here — the sheet it is drawn on needs its registration fixed first.';
23352
23420
 
23421
+ /* ── Heights the drawing states, proposed rather than asked for (#1723) ───────────────────────────
23422
+ The server's live question row for a member end can carry a PROPOSAL — heights read off the drawing,
23423
+ each with the sheet it was read on — plus the height the end is drawn at although nothing confirms
23424
+ it, and a count of readings it held back. The browser composes none of it: it shows the server's
23425
+ sentences and offers two ways to settle the end, both the SAME edit the Inspector's elevation field
23426
+ makes (a typed height, which clears the unconfirmed mark). Nothing here decides which height is
23427
+ right; a person clicks one or types one.
23428
+
23429
+ Every Use button carries the candidate's content KEY, never its position, and the handler re-reads
23430
+ the questions before applying: a list that changed between seeing and clicking refuses rather than
23431
+ applying a different reading than the one on screen. */
23432
+ let rfiElevBusy=null; // rowKey of the height being saved, one at a time
23433
+ let rfiElevNote=null; // {rowKey,text} — the last refusal on a height row, shown in that row
23434
+ /** The member end a height question is about, from its subject — never parsed out of the gap key. */
23435
+ function rfiElevationSubject(g){
23436
+ if(!g||g.kind!=='unknown-elevation')return null;
23437
+ const s=(g.subjects||[]).find(x=>x&&typeof x.memberId==='string'&&(x.end===0||x.end===1));
23438
+ return s?{memberId:s.memberId,end:s.end}:null;
23439
+ }
23440
+ /** Is this end still unsettled in the model on screen? A settled end offers nothing to apply. */
23441
+ function rfiEndUnresolved(memberId,end){
23442
+ const m=(C.members||[]).find(x=>x&&x.id===memberId);if(!m)return false;
23443
+ const point=end===0?m.from:m.to,z=point&&point.z;
23444
+ return !!z&&(z.unknown===true||z.assumed===true);
23445
+ }
23446
+ const rfiEndWords=(end,m)=>m&&m.role==='column'?(end===0?'bottom':'top'):(end===0?'start':'end');
23447
+ /** The server's own sentences for a height row, as notes. Never re-derived here. */
23448
+ function rfiElevationNotes(g){
23449
+ if(!g||g.kind!=='unknown-elevation')return [];
23450
+ const notes=[];
23451
+ // A proposal that only CONFIRMS the drawn height already says that height and where it came from; the
23452
+ // disclosure beside it would say the same thing twice.
23453
+ const confirmsDrawn=!!(g.proposal&&Array.isArray(g.proposal.candidates)&&g.proposal.candidates.length
23454
+ &&g.proposal.candidates.every(c=>c&&Array.isArray(c.readings)&&c.readings.every(r=>r&&r.source==='server-placement')));
23455
+ if(g.currentValue&&g.currentValue.note&&!confirmsDrawn)notes.push(esc(g.currentValue.note));
23456
+ // The server's own sentence, shown as given — the chat relays the same one, so the two cannot drift.
23457
+ if(g.withheldReadings&&typeof g.withheldReadings.note==='string')notes.push(esc(g.withheldReadings.note));
23458
+ return notes;
23459
+ }
23460
+ /** The two ways to settle an end: one Use button per proposed height, and a typed height. */
23461
+ function rfiElevationControls(rowKey,rowId,g){
23462
+ const subject=rfiElevationSubject(g);
23463
+ if(!subject||!rfiEndUnresolved(subject.memberId,subject.end))return '';
23464
+ const m=byId(subject.memberId);
23465
+ if(!m)return '<div class=rfinote>'+esc(RFI_UNREACHABLE)+'</div>';
23466
+ const busy=rfiElevBusy===rowKey,blocked=!!rfiElevBusy;
23467
+ const block=blocked?' aria-disabled="true" data-blocked-reason="A height is still being saved — wait for it to finish"':'';
23468
+ const what='the top of steel at the '+rfiEndWords(subject.end,m)+' of '+subject.memberId;
23469
+ const p=g.proposal&&g.proposal.apply==='now'&&Array.isArray(g.proposal.candidates)?g.proposal:null;
23470
+ // EQUAL WEIGHT, in the server's order and not ranked: every candidate renders with the same class and
23471
+ // none takes focus by default, because "which is right" is the person's question, not this list's.
23472
+ const uses=p?p.candidates.filter(c=>c&&typeof c.key==='string'&&Number.isFinite(c.value)).map(c=>{
23473
+ const label=fmtDispElev(c.value);
23474
+ // CONFIRM when the height is the one already drawn (the server placed it and its basis has provenance);
23475
+ // USE when it was read off the drawing. Same edit either way — the word tells the person which it is.
23476
+ const verb=(c.readings||[]).every(rd=>rd&&rd.source==='server-placement')?'Confirm':'Use';
23477
+ return '<button data-command-id="steel.rfi-use-height#'+esc(rowId)+'#'+esc(c.key)+'" data-command-instance-label="'+esc(subject.memberId+' '+rfiEndWords(subject.end,m)+' — '+label)+'" data-rfi-ctl="use:'+esc(c.key)+'" data-rfi-use="'+esc(c.key)+'" data-rfi-on="'+esc(rowKey)+'" data-rfi-mm="'+esc(String(c.value))+'" class=ghost aria-label="'+verb+' '+esc(label)+' for '+esc(what)+'"'+block+'>'+verb+' '+esc(label)+'</button>';
23478
+ }).join(''):'';
23479
+ const typed='<label class=rfielev><span class=elab>Height</span><input data-command-id="steel.rfi-height#'+esc(rowId)+'" data-rfi-ctl=height data-rfi-height="'+esc(rowKey)+'" inputmode=decimal autocomplete=off aria-label="Height for '+esc(what)+'" placeholder="'+esc(g.currentValue&&Number.isFinite(g.currentValue.value)?'e.g. '+fmtDispElev(g.currentValue.value):elevExample())+'"'+(blocked?' readonly aria-disabled="true"':'')+'></label>'
23480
+ +'<button data-command-id="steel.rfi-set-height#'+esc(rowId)+'" data-command-instance-label="'+esc(subject.memberId+' '+rfiEndWords(subject.end,m))+'" data-rfi-ctl=setheight data-rfi-setheight="'+esc(rowKey)+'" aria-label="Set '+esc(what)+'"'+(busy?' aria-busy="true"':'')+block+'>'+(busy?'Setting height…':'Set height')+'</button>';
23481
+ const note=rfiElevNote&&rfiElevNote.rowKey===rowKey?'<div class=rfifail role=note>'+esc(rfiElevNote.text)+'</div>':'';
23482
+ return note+'<div class="rfiacts rfielevacts" data-rfi-elev-member="'+esc(subject.memberId)+'" data-rfi-elev-end="'+subject.end+'">'+uses+typed+'</div>';
23483
+ }
23484
+ /** The live question row a height control belongs to, from the list as last read. */
23485
+ function rfiElevationRow(rowKey){
23486
+ const r=rfiState.records.find(x=>x&&rfiRowKey('record',x.id)===rowKey);
23487
+ return (r&&r.liveGap)||null;
23488
+ }
23489
+ /**
23490
+ * Apply a height to a member end — the Inspector's own typed-elevation edit, then save and re-read.
23491
+ * `candidateKey` is the Use button's reading: the questions are re-read FIRST and the key must still be
23492
+ * offered for the same end, so a list that moved under the person refuses instead of guessing.
23493
+ */
23494
+ async function rfiApplyHeight(rowKey,mm,candidateKey){
23495
+ if(rfiElevBusy){toast('A height is still being set — wait for it to finish, then try again.');return;}
23496
+ const g0=rfiElevationRow(rowKey),subject=rfiElevationSubject(g0);
23497
+ if(!subject){toast('That question is no longer listed — the list has been refreshed.');await refreshRfiRecords({force:true});return;}
23498
+ rfiElevNote=null;
23499
+ // BUSY FROM THE FIRST AWAIT, not from the edit: two quick clicks must not both re-read and both apply.
23500
+ rfiElevBusy=rowKey;renderRfiList();rfiSay('Setting height…');
23501
+ let saveError='';
23502
+ try{
23503
+ if(candidateKey){
23504
+ // The proposal is applied only when a FRESH, complete read of the questions still offers this exact
23505
+ // height. A read that failed, or was overtaken by a newer one, proves nothing — so nothing is applied.
23506
+ const current=await refreshRfiRecords({force:true});
23507
+ if(current===false||rfiState.status!=='ok'||rfiState.liveTruth!=='known'){
23508
+ rfiElevNote={rowKey,text:'FloLess could not re-check this question just now, so nothing was changed. Try again in a moment.'};
23509
+ return;
23510
+ }
23511
+ const g=[...rfiState.records].map(x=>x&&x.liveGap).find(x=>x&&x.gapKey===g0.gapKey);
23512
+ const still=g&&g.proposal&&g.proposal.apply==='now'&&(g.proposal.candidates||[]).some(c=>c&&c.key===candidateKey&&c.value===mm);
23513
+ if(!still||!rfiEndUnresolved(subject.memberId,subject.end)){
23514
+ rfiElevNote={rowKey,text:'That reading changed since the list was shown, so nothing was applied. Check the question again.'};
23515
+ return;
23516
+ }
23517
+ }
23518
+ const m=byId(subject.memberId);
23519
+ if(!m){rfiElevNote={rowKey,text:RFI_UNREACHABLE};return;}
23520
+ const applied=edit(()=>{
23521
+ if(m.role==='column'){if(subject.end===0)ModelCmd.setBosMm(m.col,mm);else ModelCmd.setTosValueMm(m.col,mm);}
23522
+ else ModelCmd.setTosValueMm(m.ends[subject.end],mm);
23523
+ });
23524
+ if(!applied)return;
23525
+ const flushed=await rfiFlushModel().catch(e=>{console.error('[steel] could not save a height set from the questions list',e);return 'failed';});
23526
+ // Whatever the save reported, the height IS in the model on screen; the sentence says that, and not the
23527
+ // save helper's own wording, which was written for answering a question rather than setting a height.
23528
+ if(flushed)saveError='Your height is in the model on screen, but FloLess could not confirm it was saved. Save again before relying on it.';
23529
+ rfiElevBusy=null;
23530
+ const said=saveError||('The top of steel at the '+rfiEndWords(subject.end,m)+' of '+subject.memberId+' is now '+fmtDispElev(mm)+'.');
23531
+ if(saveError)rfiElevNote={rowKey,text:saveError};
23532
+ await refreshRfiRecords({force:true,actingRow:rowKey,focusWasOnActingRow:false});
23533
+ if(!saveError)toast(said);
23534
+ rfiSay(said);
23535
+ }finally{
23536
+ if(rfiElevBusy===rowKey){rfiElevBusy=null;renderRfiList();if(rfiElevNote&&rfiElevNote.rowKey===rowKey)rfiSay(rfiElevNote.text);}
23537
+ }
23538
+ }
23539
+
23353
23540
  /**
23354
23541
  * What FloLess could not do, said out loud. SEPARATE from the row rendering because it must survive a
23355
23542
  * suppressed repaint: `#rfiBanner` sits outside `#rfiList`, so repainting it never disturbs a control
@@ -23651,10 +23838,16 @@ function rfiRecordRowHtml(r){
23651
23838
  const targets=rfiTargetControls(r);
23652
23839
  const copy='<button data-command-id="steel.rfi-copy#'+esc(r.id)+'" data-command-instance-label="'+esc(r.id+' — '+kind)+'" data-rfi-ctl=copy class=ghost data-rfi-copy="'+esc(r.id)+'" data-tip="Copy this current question with its member and source context">Copy question</button>';
23653
23840
  const meta=ids.map(id=>'<span>'+esc(id)+'</span>').concat(sheets.map(sh=>'<span>Sheet '+esc(sh)+'</span>')).join('');
23654
- return '<div class="rfirow" data-rfi-row="'+esc(rowKey)+'"><span class="rfikind sym">'+esc(kind)+'</span><div class=rfitx>'
23655
- +esc(r.question||'Register this source view before placing the member in the model.')
23656
- +'<div class=rfimeta>'+meta+'</div><div class=rfinote>This question comes from the current model and remains visible even when the filed RFI list is full.</div>'
23841
+ // A height question that can PROPOSE shows the server's own ask in place of the bare question (#1723).
23842
+ const g=r.liveGap,ask=g&&g.proposal&&typeof g.proposal.ask==='string'?g.proposal.ask:'';
23843
+ const elevNotes=rfiElevationNotes(g);
23844
+ return '<div class="rfirow" data-rfi-row="'+esc(rowKey)+'"'+(rfiElevBusy===rowKey?' aria-busy="true"':'')+'><span class="rfikind sym">'+esc(kind)+'</span><div class=rfitx>'
23845
+ +esc(ask||r.question||'Register this source view before placing the member in the model.')
23846
+ +'<div class=rfimeta>'+meta+'</div>'
23847
+ +(elevNotes.length?'<div class=rfinote data-rfi-elev-note>'+elevNotes.join(' ')+'</div>':'')
23848
+ +'<div class=rfinote>This question comes from the current model and remains visible even when the filed RFI list is full.</div>'
23657
23849
  +(rfiCopyFallbackId===r.id?'<div class=rfinote style="white-space:pre-wrap;user-select:text">'+esc(r.text)+'</div>':'')
23850
+ +rfiElevationControls(rowKey,r.id,g)
23658
23851
  +'<div class=rfiacts>'+copy+targets+'</div></div></div>';
23659
23852
  }
23660
23853
  const meta=['<span>'+esc(r.id)+'</span>','<span>'+esc(rfiStatusWords(r))+'</span>']
@@ -23662,7 +23855,17 @@ function rfiRecordRowHtml(r){
23662
23855
  .concat(sheets.map(sh=>'<span>Sheet '+esc(sh)+'</span>'))
23663
23856
  .join('');
23664
23857
  const notes=[];
23665
- if(r.liveGap&&!r.liveOnly)notes.push('Placement is still unresolved because the source view is not registered. The correspondence history below remains separate from the model question.');
23858
+ // A HEIGHT overlay is not a placement one (#1723): its live row carries the server's proposal and the
23859
+ // height the end is drawn at, and the placement sentence would be false about it.
23860
+ const elevSubject=r.liveGap&&!r.liveOnly?rfiElevationSubject(r.liveGap):null;
23861
+ const elevGap=elevSubject&&(C.members||[]).some(m=>m&&m.id===elevSubject.memberId)?r.liveGap:null;
23862
+ if(r.liveGap&&!r.liveOnly&&!elevGap)notes.push('Placement is still unresolved because the source view is not registered. The correspondence history below remains separate from the model question.');
23863
+ if(elevGap){
23864
+ notes.push(...rfiElevationNotes(elevGap));
23865
+ // The server's ask as given: it already says where its height came from — a drawing's own words, a
23866
+ // picture, or the height FloLess levelled — so a prefix claiming "from the drawing" would be false for some.
23867
+ if(elevGap.proposal&&typeof elevGap.proposal.ask==='string')notes.push(esc(elevGap.proposal.ask));
23868
+ }
23666
23869
  if(r.sent)notes.push((r.sent.via==='gmail'?'Sent with Gmail to ':'Marked sent to ')+esc(r.sent.to)+' on '+esc(rfiWhen(r.sent.at))+'.');
23667
23870
  if(r.answer)notes.push('Answer: '+esc(rfiSentence(rfiAnswerText(r.answer))));
23668
23871
  if(r.applied)notes.push('Recorded as applied to the model on '+esc(rfiWhen(r.applied.at))+'.');
@@ -23751,6 +23954,7 @@ function rfiRecordRowHtml(r){
23751
23954
  +(settling?'<div class=rfinote role="note" data-rfi-profile-settle>'+esc(settling.message)+'</div>':'')
23752
23955
  +deliveryHtml
23753
23956
  +(rfiCopyFallbackId===r.id&&r.text?'<div class=rfinote style="white-space:pre-wrap;user-select:text">'+esc(r.text)+'</div>':'')
23957
+ +(elevGap&&!formOpen&&!recovering?rfiElevationControls(rowKey,r.id,elevGap):'')
23754
23958
  // The outcome renders INSIDE the form when one is open (directly above Submit, where focus lands);
23755
23959
  // at row level only when there is no form to put it in.
23756
23960
  +(formOpen?'':rfiOutcomeHtml(rowKey))
@@ -24076,6 +24280,25 @@ function wireRfiList(){
24076
24280
  rfiFocusAfterSymptomProfilePick(modal,rowKey,m.id);
24077
24281
  }});});
24078
24282
  root.querySelectorAll('button[data-rfi-profile-retry]').forEach(b=>b.onclick=()=>rfiRetryProfileSettle(b));
24283
+ // #1723: a proposed height, applied with one click, or a typed one. Both are the Inspector's own edit.
24284
+ root.querySelectorAll('button[data-rfi-use]').forEach(b=>b.onclick=()=>{
24285
+ if(b.getAttribute('aria-disabled')==='true')return;
24286
+ Promise.resolve(rfiApplyHeight(b.dataset.rfiOn,Number(b.dataset.rfiMm),b.dataset.rfiUse)).catch(rfiGestureFailure);});
24287
+ const setTyped=b=>{
24288
+ if(!b||b.getAttribute('aria-disabled')==='true')return;
24289
+ const rowKey=b.dataset.rfiSetheight;
24290
+ const input=[...root.querySelectorAll('input[data-rfi-height]')].find(x=>x.dataset.rfiHeight===rowKey);
24291
+ const typed=input?input.value.trim():'';
24292
+ const mm=typed?parseElevMm(typed):null;
24293
+ if(mm==null||!Number.isFinite(mm)){
24294
+ rfiElevNote={rowKey,text:typed?'Enter a height FloLess can read, like '+elevExample()+'.':'Type the height first, like '+elevExample()+'.'};
24295
+ rfiFocusOverride={rows:[rowKey],ctl:'height'};renderRfiList();rfiSay(rfiElevNote.text);return;
24296
+ }
24297
+ Promise.resolve(rfiApplyHeight(rowKey,mm,null)).catch(rfiGestureFailure);};
24298
+ root.querySelectorAll('button[data-rfi-setheight]').forEach(b=>b.onclick=()=>setTyped(b));
24299
+ root.querySelectorAll('input[data-rfi-height]').forEach(inp=>inp.onkeydown=e=>{
24300
+ if(e.key!=='Enter')return;e.preventDefault();
24301
+ setTyped([...root.querySelectorAll('button[data-rfi-setheight]')].find(x=>x.dataset.rfiSetheight===inp.dataset.rfiHeight));});
24079
24302
  root.querySelectorAll('button[data-loc]').forEach(b=>b.onclick=()=>rfiLocate(b.dataset.loc));
24080
24303
  root.querySelectorAll('button[data-rfi-target]').forEach(b=>b.onclick=()=>rfiOpenTarget(b));
24081
24304
  // THE CATCH-UP. A record read that landed while somebody was typing in this list did not repaint it,
@@ -0,0 +1,71 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <title>Tekla Parser · FloLess</title>
7
+ <link rel="stylesheet" href="model-editor.css">
8
+ <link rel="stylesheet" href="revit-editor.css">
9
+ </head>
10
+ <body class="revit-model-editor" data-model-kind="tekla-parser">
11
+ <header class="authority-bar">
12
+ <div class="authority-copy">
13
+ <span class="authority-kicker">Tekla Parser</span>
14
+ <strong id="modelName">Loading model…</strong>
15
+ <span id="sourceName" class="source-name"></span>
16
+ </div>
17
+ <div id="authorityChoices" class="authority-choices" role="group" aria-label="Model authority"></div>
18
+ <div id="modelUnits" class="model-display-units"></div>
19
+ <span class="read-only-chip" data-tip="FloLess displays a copied snapshot and cannot write to the source Tekla model.">Read-only</span>
20
+ </header>
21
+ <main id="editorRoot" class="editor-root">
22
+ <section id="modelStage" class="model-stage" aria-label="Tekla model snapshot viewport">
23
+ <canvas id="modelCanvas" tabindex="0" aria-label="Interactive Tekla model snapshot"></canvas>
24
+ <div id="m3dBar" class="model-view-toolbar" role="toolbar" aria-label="Model view controls"></div>
25
+ <div id="modelViewCube" class="model-view-cube-host" aria-label="Model orientation"></div>
26
+ <div id="modelWorldAxes" class="model-world-axes-host" aria-hidden="true"></div>
27
+ <div id="modelDimensionOverlay" aria-hidden="true"></div>
28
+ <div id="modelSelectionMarquee" aria-hidden="true"></div>
29
+ <div id="modelHoverSummary" role="status" aria-live="polite" hidden></div>
30
+ <div id="modelSpatialHud" class="model-spatial-hud" aria-live="polite">
31
+ <button id="modelFrameStatus" type="button" data-command-id="tekla-parser.spatial-controls" data-tip="Open coordinate frame, working plane, clip, and work-area controls">Global</button>
32
+ <span id="modelCursorCoordinates">X — · Y — · Z — mm</span>
33
+ </div>
34
+ <div id="modelBottomDock" class="model-bottom-dock">
35
+ <div id="modelModuleActions"></div>
36
+ <div id="modelPointerBars" class="model-pointer-bars">
37
+ <div id="modelSelectBar" role="group" aria-label="Selection filter"></div>
38
+ <div id="modelSnapBar" role="group" aria-label="Snap settings"></div>
39
+ </div>
40
+ </div>
41
+ <div id="modelExplorer" hidden>
42
+ <div id="revitExplorerClassification"></div>
43
+ <div id="revitExplorerTypes"></div>
44
+ </div>
45
+ <div id="revitPanelTabs" hidden>
46
+ <div id="revitClipListHost" class="revit-clip-list-host"></div>
47
+ <div id="teklaAuditHost" class="tekla-audit-host" hidden></div>
48
+ </div>
49
+ <div id="loadingState" class="viewport-state" aria-live="polite">
50
+ <span class="state-spinner" aria-hidden="true"></span>
51
+ <strong>Opening verified snapshot</strong>
52
+ <span>Reading the signed read-only model package.</span>
53
+ </div>
54
+ </section>
55
+ <div id="inspectorResizer" class="inspector-resizer model-inspector-resizer" role="separator" tabindex="0" aria-label="Resize Properties" aria-orientation="vertical" data-tip="Drag to resize · double-click to reset"></div>
56
+ <aside id="inspectorPanel" class="inspector-panel model-inspector-panel" aria-label="Properties">
57
+ <div class="panel-heading inspector-heading"><strong>Properties</strong></div>
58
+ <div id="inspectorBody" class="inspector-body"></div>
59
+ </aside>
60
+ <div id="inspectorStub" class="model-inspector-stub" aria-hidden="true"><span class="vertical-label">Properties</span></div>
61
+ <button id="inspectorToggle" class="model-inspector-toggle" type="button" data-command-id="tekla-parser.inspector-toggle" data-tip="Collapse Properties" aria-label="Collapse Properties" aria-controls="inspectorPanel" aria-expanded="true"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="m6 3 5 5-5 5"/></svg></button>
62
+ </main>
63
+ <div id="toast" role="status" aria-live="polite"></div>
64
+ <script src="commands.js"></script>
65
+ <script src="commands-tekla-parser.js"></script>
66
+ <script src="instructor-reporter.js"></script>
67
+ <script>InstructorReporter.mount({ surface: 'tekla-parser-editor', snapshot: function () { return window.__revitInstructorState || {}; } });</script>
68
+ <script type="importmap">{"imports":{"three":"./vendor/three.module.js","three/addons/":"./vendor/"}}</script>
69
+ <script type="module" src="revit-editor.js"></script>
70
+ </body>
71
+ </html>
@@ -0,0 +1,56 @@
1
+ const SCHEMA = 'floless.tekla-structural-grid/v1';
2
+ const text = (value, name) => {
3
+ if (typeof value !== 'string' || !value.trim()) throw new TypeError(`Tekla structural grid ${name} is missing.`);
4
+ return value;
5
+ };
6
+ const finiteNonnegative = (value, name) => {
7
+ if (!Number.isFinite(value) || value < 0) throw new TypeError(`Tekla structural grid ${name} is invalid.`);
8
+ return value;
9
+ };
10
+
11
+ /**
12
+ * Rename a server-validated Tekla grid facade into grid-core's provider-neutral input.
13
+ * Parsing, cumulative spacing, labels, IDs and geometry remain grid-core responsibilities.
14
+ */
15
+ export function teklaStructuralGridContract(entity) {
16
+ const payload = entity?.structuralGrid;
17
+ if (!payload) return null;
18
+ if (payload.schemaVersion !== SCHEMA || payload.entityId !== entity.id || payload.mapping?.kind !== 'symmetric') {
19
+ throw new TypeError('The authenticated Tekla structural grid facade is inconsistent.');
20
+ }
21
+ const extents = payload.mapping.extentsMm;
22
+ const values = ['xNegative', 'xPositive', 'yNegative', 'yPositive', 'zNegative', 'zPositive']
23
+ .map((name) => finiteNonnegative(extents?.[name], name));
24
+ if (!values.every((value) => value === values[0])) throw new TypeError('The Tekla structural grid is not symmetrically mapped.');
25
+ const origin = payload.mapping.originMm;
26
+ const originValues = ['x', 'y', 'z'].map((name) => {
27
+ const value = origin?.[name];
28
+ if (!Number.isFinite(value)) throw new TypeError(`Tekla structural grid origin ${name} is invalid.`);
29
+ return value;
30
+ });
31
+ const strings = payload.strings;
32
+ const objectGuid = text(payload.objectGuid, 'GUID');
33
+ return Object.freeze({
34
+ ownerId: entity.id,
35
+ source: payload,
36
+ grid: Object.freeze({
37
+ on: true,
38
+ origin: Object.freeze(originValues.slice(0, 2)),
39
+ x: text(strings?.xSpacing, 'X coordinates'),
40
+ y: text(strings?.ySpacing, 'Y coordinates'),
41
+ z: text(strings?.zLevels, 'Z coordinates'),
42
+ labels_x: text(strings?.xLabels, 'X labels'),
43
+ labels_y: text(strings?.yLabels, 'Y labels'),
44
+ labels_z: Object.freeze(text(strings?.zLabels, 'Z labels').trim().split(/\s+/)),
45
+ hidden_z: Object.freeze([]),
46
+ ext: values[0],
47
+ identity_scope: objectGuid,
48
+ }),
49
+ });
50
+ }
51
+
52
+ export function findTeklaStructuralGrid(entities = []) {
53
+ const values = entities.map(teklaStructuralGridContract).filter(Boolean);
54
+ if (values.length > 1) throw new TypeError('The verified snapshot contains more than one drawable structural grid.');
55
+ return values[0] ?? null;
56
+ }