@floless/app 0.165.0 → 0.166.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.
@@ -1466,9 +1466,16 @@ rect.lblhot:focus-visible{outline:2px solid var(--brand);outline-offset:2px;stro
1466
1466
  #rfiList .rfimeta span{background:var(--sunken);border:1px solid var(--line);color:var(--mut);
1467
1467
  border-radius:4px;padding:0 5px;font-size:10px;line-height:1.7}
1468
1468
  #rfiList .rfinote{margin-top:4px;color:var(--mut);font-size:11px;line-height:1.5}
1469
+ /* #2470 R6.6d: an RFI's earlier rounds, oldest first, under its current round. Existing tokens only. */
1470
+ #rfiList .rfirounds{list-style:none;margin:4px 0 0;padding:0;display:grid;gap:6px}
1471
+ #rfiList .rfiround-head{color:var(--mut);font-size:11px;font-weight:600;line-height:1.5}
1472
+ #rfiList .rfiround-entries{margin:2px 0 0;padding-left:16px;color:var(--mut);font-size:11px;line-height:1.5}
1473
+ #rfiList .rfirounds-body:empty{display:none}
1469
1474
  /* #2521 row 3b-2 — the AI's mark. The word "AI" carries it, so it survives losing colour; the brand
1470
1475
  outline only says it is not one of the grey facts beside it. Shown where the AI wrote the proposal. */
1471
1476
  #rfiList .rfimeta .rfiby.ai{color:var(--brand);border-color:var(--brand)}
1477
+ /* #2925 — "Filed by you": a grey fact like its neighbours, focusable so its exact time is reachable by keyboard. */
1478
+ #rfiList .rfimeta .rfifiled:focus-visible,#rfiList .rfimeta .rfiby:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
1472
1479
  #rfiList .rfioccurrence-title{display:inline-flex;align-items:baseline;gap:6px;flex-wrap:wrap;margin-top:0}
1473
1480
  /* A Quick version's questions the AI could not get into the RFI file. Rows, not the banner: they are
1474
1481
  questions waiting on a filing, and the dashed badge already means "not filed" in this list. */
@@ -1920,6 +1927,65 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1920
1927
  .v2-ai-decisions .ai-head{display:flex;align-items:center;gap:6px;margin-bottom:2px}
1921
1928
  .v2-ai-decisions .ai-row{margin:2px 0}
1922
1929
  .v2-ai-decisions .ai-foot{color:var(--mut);margin-top:3px}
1930
+ /* #2521 row 8a: the way in to Make precise (a quiet button, the strip is a note) and its Properties-panel takeover,
1931
+ which reuses the member-end review's chrome (#panel .mer-*). Tokens only; reviewed reads neutral, never green. */
1932
+ .ai-strip .ai-precise{border:1px solid var(--line);background:transparent;color:var(--text);font:inherit;font-weight:600;padding:0 8px;border-radius:4px;cursor:pointer;white-space:nowrap}
1933
+ .ai-strip .ai-precise:hover{background:var(--hover-soft)}
1934
+ .ai-strip .ai-precise:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
1935
+ .ai-strip .ai-precise .ai-precise-n{font-weight:400;color:var(--mut);font-variant-numeric:tabular-nums}
1936
+ @media (max-width:720px){.ai-strip .ai-precise .ai-precise-n{display:none}}
1937
+ #panel .mer-title[tabindex]:focus{outline:none}
1938
+ #panel .mer-title[tabindex]:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
1939
+ #panel .mp-bar{height:4px;margin-top:8px;background:var(--line);border-radius:2px;overflow:hidden}
1940
+ #panel .mp-bar span{display:block;height:100%;background:var(--brand)}
1941
+ #panel .mp-intro{margin:8px 0 0;font-size:11px;line-height:1.45;color:var(--mut)}
1942
+ #panel .mp-banner{margin-top:8px;padding:6px 8px;border:1px solid var(--warn-edge);border-radius:5px;font-size:11.5px;line-height:1.45;color:var(--text)}
1943
+ #panel .mp-ghead{display:flex;align-items:baseline;justify-content:space-between;gap:6px 8px;flex-wrap:wrap}
1944
+ #panel .mp-ghead button{font-size:11px;padding:3px 8px}
1945
+ #panel .mp-gtitle{margin:0;font-size:12px;font-weight:600;line-height:1.4;color:var(--text);text-transform:none;letter-spacing:0}
1946
+ #panel .mp-gcount{font-weight:400;font-size:11px;color:var(--mut);font-variant-numeric:tabular-nums}
1947
+ #panel .mp-cons{margin:2px 0 2px;font-size:11px;line-height:1.4;color:var(--mut)}
1948
+ #panel .mp-arm{display:flex;gap:6px;flex-wrap:wrap}
1949
+ #panel .mp-arm .hint{align-self:center}
1950
+ #panel .mp-yes{background:var(--brand);border-color:var(--brand);color:var(--brand-ink);font-weight:700}
1951
+ #panel .mp-card{padding:7px 5px 7px 8px;border-left:3px solid transparent;border-radius:4px}
1952
+ #panel .mp-card+.mp-card{border-top:1px solid var(--line)}
1953
+ #panel .mp-card.changed{border-left-color:var(--warn);background:var(--hover-soft)}
1954
+ #panel .mp-card .chip{margin:0 0 4px}
1955
+ #panel .mp-q{display:block;width:100%;padding:0;border:0;background:transparent;color:var(--text);font:600 12px/1.4 var(--ui);text-align:left;cursor:pointer;overflow-wrap:anywhere}
1956
+ #panel .mp-q:hover{color:var(--brand)}
1957
+ #panel .mp-q:focus-visible,#panel .mp-why summary:focus-visible,#panel .mp-done:focus-visible{outline:2px solid var(--brand);outline-offset:2px;border-radius:3px}
1958
+ #panel .mp-q-text{font:600 12px/1.4 var(--ui);color:var(--text);overflow-wrap:anywhere}
1959
+ #panel .mp-chose{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px;font-size:11.5px;line-height:1.4;color:var(--mut)}
1960
+ #panel .mp-chose>span{min-width:0;overflow-wrap:anywhere}
1961
+ #panel .mp-chose b{color:var(--text);font-weight:600}
1962
+ #panel .mp-confirm{flex:none;font-size:11px;padding:4px 10px}
1963
+ #panel .mp-chose{flex-wrap:wrap}
1964
+ #panel .mp-acts{display:flex;flex:none;flex-wrap:wrap;gap:6px;margin-left:auto}
1965
+ #panel .mp-changeb{font-size:11px;padding:4px 8px}
1966
+ #panel .mp-changeb[aria-expanded=true]{border-color:var(--brand)}
1967
+ #panel .mp-mark{display:grid;gap:5px;margin-top:6px;padding:7px 8px;border:1px solid var(--line);border-radius:6px;background:var(--hover-soft)}
1968
+ #panel .mp-note-l{font-size:11px;color:var(--text);text-transform:none;letter-spacing:0}
1969
+ #panel .mp-note{min-height:44px;resize:vertical}
1970
+ #panel .mp-mark .mp-arm button{font-size:11px;padding:4px 10px}
1971
+ #panel .mp-why-not{margin-top:3px}
1972
+ #panel .mp-why{margin-top:4px;font-size:11px;line-height:1.45;color:var(--mut)}
1973
+ #panel .mp-why summary{display:inline-flex;align-items:center;gap:4px;list-style:none;cursor:pointer;color:var(--text)}
1974
+ #panel .mp-why summary::-webkit-details-marker{display:none}
1975
+ #panel .mp-why summary::before{content:'▸';width:9px;color:var(--mut)}
1976
+ #panel .mp-why[open] summary::before{content:'▾'}
1977
+ #panel .mp-why dl{display:grid;grid-template-columns:auto 1fr;gap:3px 8px;margin:5px 0 0 13px}
1978
+ #panel .mp-why dt{color:var(--mut)}
1979
+ #panel .mp-why dd{margin:0;color:var(--text);overflow-wrap:anywhere}
1980
+ #panel .mp-why ul{margin:0;padding-left:14px}
1981
+ #panel .mp-change{margin-top:6px}
1982
+ #panel .mp-change button{font-size:11px;padding:3px 8px}
1983
+ #panel .mp-change .hint{margin-top:3px}
1984
+ #panel .mp-more{width:100%;margin-top:6px;font-size:11px;padding:4px 7px}
1985
+ #panel .mp-sheet{font-weight:400;color:var(--mut)}
1986
+ #panel .mp-done{margin-top:12px;font-size:12px;line-height:1.5;color:var(--text)}
1987
+ #panel .mp-done:focus:not(:focus-visible){outline:none}
1988
+ #panel .mp-done .hint{margin-top:4px}
1923
1989
  #quickStat.is-unknown{text-decoration:underline dashed;text-underline-offset:3px}
1924
1990
  .conf-quick{margin:0 0 8px;padding:6px 10px;border:1px solid var(--warn-edge);border-radius:6px;color:var(--mut);font-size:12px;line-height:1.45}
1925
1991
  .conf-quick b{color:var(--warn)}
@@ -3656,7 +3722,7 @@ const EditorFocus = (() => {
3656
3722
  Promise.resolve().then(() => runner(job.req, current)).then(
3657
3723
  (outcome) => vacate(job, current() && outcome ? outcome : { superseded: true }),
3658
3724
  // The runner shows its own sentences; this is only the last line of defence, so the caller is never left waiting.
3659
- (error) => { console.error('[steel] could not show the connection asked for', error); vacate(job, current() ? { ok: false, said: job.req.rfiId ? 'FloLess could not show ' + job.req.rfiId + '. Find it on the RFIs page, or press it in the chat again.' : job.req.memberId ? 'The model could not show member ' + job.req.memberId + '. Press Show in the model again, or find it in the Model panel.' : 'The model could not show connection ' + job.req.jointId + '. Press Open in the model again, or find it in the Model panel.' } : { superseded: true }); });
3725
+ (error) => { console.error('[steel] could not show the connection asked for', error); vacate(job, current() ? { ok: false, said: job.req.makePrecise ? 'FloLess could not open Make precise. Press Open Make precise again, or press Make precise on the AI decisions strip.' : job.req.rfiId ? 'FloLess could not show ' + job.req.rfiId + '. Find it on the RFIs page, or press it in the chat again.' : job.req.memberId ? 'The model could not show member ' + job.req.memberId + '. Press Show in the model again, or find it in the Model panel.' : 'The model could not show connection ' + job.req.jointId + '. Press Open in the model again, or find it in the Model panel.' } : { superseded: true }); });
3660
3726
  };
3661
3727
  window.flolessEditorState = { project: PROJECT, ready: false };
3662
3728
  const text = (value) => typeof value === 'string' && value ? value : '';
@@ -3666,7 +3732,18 @@ const EditorFocus = (() => {
3666
3732
  const normalise = (req) => req && text(req.jointId)
3667
3733
  ? { jointId: req.jointId, ...(req.raiseRfi === true ? { raiseRfi: true } : {}), ...(text(req.checkId) ? { checkId: req.checkId } : {}) }
3668
3734
  : req && text(req.memberId) ? { memberId: req.memberId }
3669
- : req && text(req.rfiId) && /^RFI-\d{3,16}$/.test(req.rfiId) ? { rfiId: req.rfiId } : null;
3735
+ : req && text(req.rfiId) && /^RFI-\d{3,16}$/.test(req.rfiId) ? { rfiId: req.rfiId }
3736
+ // #2521 row 9: or Make precise itself, the chat's "Open Make precise" (the panel opens; nothing is confirmed).
3737
+ : req && req.makePrecise === true ? { makePrecise: true } : null;
3738
+ // The failure sentence names a connection; every other request is told what it asked for, worded as the shell words it (#2980).
3739
+ // The button to press again, and the step that explains, are the asker's own too.
3740
+ const failedFor = (req) => {
3741
+ const asked = !req ? '' : req.makePrecise ? 'Make precise' : req.rfiId ? req.rfiId : req.memberId ? 'the member' : '';
3742
+ if (!asked) return failed;
3743
+ const again = req.makePrecise ? 'Open Make precise' : req.rfiId ? req.rfiId + ' in the chat' : 'Show in the model';
3744
+ const said = failed.replace(/the connection/g, asked).replace('press Open in the model again', 'press ' + again + ' again');
3745
+ return req.rfiId ? said.replace('The Model step says why', 'The RFIs step says why') : said;
3746
+ };
3670
3747
  window.flolessEditorFocus = (req) => {
3671
3748
  if (!normalise(req)) return false;
3672
3749
  const id = typeof req.requestId === 'string' && req.requestId ? req.requestId : 'editor-' + (++made);
@@ -3674,7 +3751,7 @@ const EditorFocus = (() => {
3674
3751
  const outcome = new Promise((resolve) => { settle = resolve; });
3675
3752
  const job = { id, req: normalise(req), settle, running: false };
3676
3753
  // The editor will never be ready (no model, or it failed to load): answer at once, never leave it waiting.
3677
- if (failed) { settle({ ok: false, said: failed }); return outcome; }
3754
+ if (failed) { settle({ ok: false, said: failedFor(job.req) }); return outcome; }
3678
3755
  const previous = slot;
3679
3756
  slot = job;
3680
3757
  // A held request is answered now; a running one learns it at its next await, through current().
@@ -3712,7 +3789,7 @@ const EditorFocus = (() => {
3712
3789
  failed = sentence;
3713
3790
  window.flolessEditorState = { project: PROJECT, ready: false, failed: true };
3714
3791
  const job = slot; slot = null;
3715
- if (job) job.settle({ ok: false, said: failed });
3792
+ if (job) job.settle({ ok: false, said: failedFor(job.req) });
3716
3793
  },
3717
3794
  };
3718
3795
  })();
@@ -4444,6 +4521,8 @@ function handleReviewChanged(m){
4444
4521
  read: undefined until a snapshot or save answered (the marks then say they could not read everything), null only
4445
4522
  for an explicit precise answer, {state:'unknown'} for a verdict it cannot read. */
4446
4523
  let lastSavedVerdict;
4524
+ /* #2521 row 8a: which AI decisions a person reviewed in Make precise, as the server last said ({ reviewed: { id: at } }). */
4525
+ let lastAiReviews=null;
4447
4526
  function paintQuickStat(q){
4448
4527
  if(q===undefined)return; // a reply whose body could not be read leaves the last label in place; null = precise
4449
4528
  lastSavedVerdict=q===null?null:q&&q.state==='quick'&&typeof q.short==='string'?q:{state:'unknown'};
@@ -4848,6 +4927,7 @@ async function boot() {
4848
4927
  // live, and observable to anything that runs in between. Validate, then publish.
4849
4928
  const snapshotPayload = await res.json();
4850
4929
  paintQuickStat(snapshotPayload && typeof snapshotPayload === 'object' ? (snapshotPayload.quick ?? null) : undefined);
4930
+ lastAiReviews = snapshotPayload && typeof snapshotPayload === 'object' && snapshotPayload.aiReviews && typeof snapshotPayload.aiReviews === 'object' ? snapshotPayload.aiReviews : null; // #2521 row 8a
4851
4931
  const loaded = snapshotPayload && snapshotPayload.contract;
4852
4932
  // Shape first, then type. A body that is null, an array or a scalar has no `type` to test, so a
4853
4933
  // type-only gate waved it through and the failure surfaced as a raw red `boot().catch` — "Cannot read
@@ -5433,6 +5513,7 @@ let v2IdSeq=0;
5433
5513
  FINDING: unmarked never means drawn, and the strip says so whenever anything is shown. */
5434
5514
  let showAiMarks=(()=>{try{return localStorage.getItem('steel:aiMarks:v2')!=='0';}catch(_){return true;}})(); // ⋯ Display → AI decisions: on by default (owner ruling 2026-10-29)
5435
5515
  let aiMarksMemo=null,aiStripOpen=false,aiMarks3dSent=null;
5516
+ let aiShownMemo=null,aiReviewsMemo={src:undefined,map:new Map()}; // #2521 row 8a: the marks of what nobody has reviewed
5436
5517
  function aiMarksNow(){
5437
5518
  if(!AiMarks||!C||C.type!=='steel.model/v2')return null;
5438
5519
  // Every edit, undo, redo and installed save reply bumps the generation; a replaced model is a new C. So hover, zoom and
@@ -5440,12 +5521,12 @@ function aiMarksNow(){
5440
5521
  if(aiMarksMemo&&aiMarksMemo.c===C&&aiMarksMemo.gen===modelEditGeneration)return aiMarksMemo.marks;
5441
5522
  const marks=AiMarks.aiDecisionMarksOf(C);aiMarksMemo={c:C,gen:modelEditGeneration,marks};return marks;
5442
5523
  }
5443
- function aiMarksState(){if(!AiMarks)return'none';return AiMarks.aiMarksDisplayState(aiMarksNow()||{state:'none'},lastSavedVerdict);}
5524
+ function aiMarksState(){if(!AiMarks)return'none';return AiMarks.aiMarksDisplayState(aiMarksShown()||{state:'none'},lastSavedVerdict);}
5444
5525
  const aiHasCanvasMarks=m=>!!m&&(m.ends.length>0||m.joints.length>0);
5445
5526
  const aiEndWord=(role,end)=>role==='column'?(end===0?'base':'top'):(end===0?'start':'end');
5446
5527
  /* What the mark means, on the member's OWN tooltip (the marks themselves never take a pointer). */
5447
5528
  function aiTipFor(m){
5448
- if(!showAiMarks||!m)return'';const marks=aiMarksNow(),list=marks&&marks.members.get(m.id);if(!list)return'';
5529
+ if(!showAiMarks||!m)return'';const marks=aiMarksShown(),list=marks&&marks.members.get(m.id);if(!list)return'';
5449
5530
  const ends=list.filter(x=>x.kind==='height').map(x=>aiEndWord(m.role,x.end));
5450
5531
  const parts=[];
5451
5532
  if(ends.length)parts.push('The AI chose this member’s '+ends.join(' and ')+' height'+(ends.length>1?'s':'')+'.');
@@ -5466,7 +5547,7 @@ function aiJointPoint2d(j,byId){
5466
5547
  /* The canvas marks of the plan on screen, sized in 1/zoom like the review marker (updateBadges redraws them on zoom). */
5467
5548
  function aiMarksInner(){
5468
5549
  if(!showAiMarks||!P||!Array.isArray(P.members))return'';
5469
- const marks=aiMarksNow();if(!aiHasCanvasMarks(marks))return'';
5550
+ const marks=aiMarksShown();if(!aiHasCanvasMarks(marks))return'';
5470
5551
  // Positions come from every member this plan draws; visibility only decides whether a mark is shown. An end mark needs
5471
5552
  // its member shown; a ring needs ANY member of the joint shown (it rests on the connection whichever one is hidden).
5472
5553
  const byId=new Map(),shown=new Set();
@@ -5489,6 +5570,8 @@ function aiChosenText(id,marks){
5489
5570
  else if(aiRecord.absent.has(id))t+=' (this decision is not in the project’s record, so FloLess cannot say why)';
5490
5571
  else if(aiRecordFailed(id))t+=' (FloLess could not read why just now; it tries again when you select the member)';
5491
5572
  else if(aiRecord.inflight.has(id))t+=' (reading why…)';
5573
+ const at=aiReviewedNow().get(id),note=aiChangedNow().get(id); // #2521 row 8a; row 8b: a change says it was one
5574
+ if(at)t+=(note===undefined?', reviewed by you':', changed by you')+(mpDate(at)?' on '+mpDate(at):'')+(note?' ('+note.replace(/\.\s*$/,'')+')':'');
5492
5575
  return t;
5493
5576
  }
5494
5577
  function aiNoteText(item,marks){
@@ -5509,9 +5592,10 @@ function renderAiStrip(){
5509
5592
  const el=document.getElementById('aiStrip');if(!el)return;
5510
5593
  const state=C?aiMarksState():'none';
5511
5594
  if(state==='none'){if(!el.hidden){el.hidden=true;el.textContent='';el.dataset.key='';}return;}
5512
- const marks=aiMarksNow()||{ends:[],joints:[],views:new Map(),model:[],entries:new Map(),members:new Map()};
5595
+ const marks=aiMarksShown()||{ends:[],joints:[],views:new Map(),model:[],entries:new Map(),members:new Map()};
5513
5596
  const vid=C&&C.plans&&C.plans[C.active]?V2Projection.planViewId(C.plans[C.active]):'';
5514
- const key=[state,showAiMarks,aiStripOpen,aiMarksMemo&&aiMarksMemo.gen,vid,aiRecord.epoch].join('|');
5597
+ const saved=lastSavedVerdict&&lastSavedVerdict.state==='quick'?lastSavedVerdict:null,reviewedHere=aiReviewedCount();
5598
+ const key=[state,showAiMarks,aiStripOpen,aiMarksMemo&&aiMarksMemo.gen,vid,aiRecord.epoch,reviewedHere,saved&&saved.decisions,!!makePrecise].join('|');
5515
5599
  if(el.dataset.key===key&&!el.hidden)return; // render() calls this on every repaint: rebuild only when something it shows moved
5516
5600
  const hadFocus=el.contains(document.activeElement)?document.activeElement.getAttribute('data-command-id'):null;
5517
5601
  el.dataset.key=key;el.textContent='';el.hidden=false;
@@ -5538,6 +5622,16 @@ function renderAiStrip(){
5538
5622
  }
5539
5623
  if(marks.model.length)line.appendChild(span('','+ '+marks.model.length+' that bear'+(marks.model.length===1?'s':'')+' on the whole model.'));
5540
5624
  line.appendChild(span('','Unmarked members may still rest on AI decisions FloLess cannot trace.'));
5625
+ // #2521 row 8a: the way in to Make precise, while the saved model is a Quick model. A quiet button: the strip is a note.
5626
+ if(saved&&PROJECT){
5627
+ const go=document.createElement('button');go.type='button';go.className='ai-precise';go.id='aiPreciseB';
5628
+ const n=Number.isSafeInteger(saved.decisions)&&saved.decisions>0?saved.decisions:null;
5629
+ go.textContent='Make precise';if(n)go.appendChild(span('ai-precise-n',' · '+n+' to review'));
5630
+ go.setAttribute('data-command-id','steel.make-precise-open');go.setAttribute('aria-expanded',String(!!makePrecise));go.setAttribute('aria-controls','panel');
5631
+ go.setAttribute('data-tip','Review the AI decisions this model rests on, one group at a time, and confirm each');
5632
+ go.onclick=e=>{e.stopPropagation();openMakePrecise();};
5633
+ line.appendChild(go);
5634
+ }
5541
5635
  const more=document.createElement('button');more.type='button';more.className='ai-more';more.textContent=aiStripOpen?'Less':'Details';
5542
5636
  more.setAttribute('data-command-id','steel.ai-decisions-note');more.setAttribute('aria-expanded',String(aiStripOpen));more.setAttribute('aria-controls','aiStripDetails');
5543
5637
  more.setAttribute('data-tip','What the AI decided that bears on the whole model, and what the marks and the label each describe');
@@ -5548,7 +5642,8 @@ function renderAiStrip(){
5548
5642
  if(marks.model.length){const ul=document.createElement('ul');for(const item of marks.model){const li=document.createElement('li');li.textContent=aiNoteText(item,marks);ul.appendChild(li);}d.appendChild(ul);}
5549
5643
  const n=marks.decisionCount;
5550
5644
  d.appendChild(span('',(n?'Your current edits rest on '+n+' AI decision'+(n===1?'':'s')+' FloLess can trace. ':'Your current edits rest on no AI decision FloLess can trace. ')
5551
- +'The marks follow your current edits; the Quick model label describes the model as last saved. None of these decisions is reviewed.'));
5645
+ +'The marks follow your current edits; the Quick model label describes the model as last saved. '
5646
+ +(reviewedHere?'You have reviewed '+reviewedHere+' other'+(reviewedHere===1?'':'s')+' in Make precise; '+(reviewedHere===1?'it is':'they are')+' no longer marked.':'None of these decisions is reviewed.')));
5552
5647
  el.appendChild(d);
5553
5648
  }
5554
5649
  if(hadFocus){const back=el.querySelector('[data-command-id="'+CSS.escape(hadFocus)+'"]');if(back)back.focus();}
@@ -5577,7 +5672,7 @@ function fillAiNote(box,m,canonical,list,marks){
5577
5672
  for(const mark of list){
5578
5673
  const row=document.createElement('div');row.className='ai-row';
5579
5674
  if(mark.kind==='height'){
5580
- const z=(mark.end===0?canonical.from:canonical.to)?.z,now=z&&Number.isFinite(z.known)?fmtDispElev(z.known):'';
5675
+ const z=(mark.end===0?canonical.from:canonical.to)?.z,now=z&&Number.isFinite(z.known)?fmtDispElev(z.known):''; // the full analysis: a reviewed decision is listed, and says so (aiChosenText)
5581
5676
  const word=aiEndWord(m.role,mark.end),n=mark.decisionIds.length;
5582
5677
  row.textContent=word.charAt(0).toUpperCase()+word.slice(1)+' height'+(now?' '+now:'')+' rests on '+(n===1?'an AI decision':n+' AI decisions')
5583
5678
  +(mark.derived?', derived from '+(n===1?'it':'them')+' by a copy, split or merge':'')+': '+mark.decisionIds.map(id=>aiChosenText(id,marks)).join('; ')+'.';
@@ -5590,7 +5685,9 @@ function fillAiNote(box,m,canonical,list,marks){
5590
5685
  box.appendChild(row);
5591
5686
  }
5592
5687
  const foot=document.createElement('div');foot.className='ai-foot';
5593
- foot.textContent='Not reviewed. FloLess lists what it can trace; this member may still rest on other AI decisions.';box.appendChild(foot);
5688
+ const ids=[...new Set(list.flatMap(x=>x.kind==='height'?x.decisionIds:[x.decisionId]))],rv=aiReviewedNow(),nRev=ids.filter(id=>rv.has(id)).length;
5689
+ foot.textContent=(nRev===ids.length?'Reviewed by you in Make precise.':nRev?'Not all reviewed: Make precise lists the rest.':'Not reviewed.')
5690
+ +' FloLess lists what it can trace; this member may still rest on other AI decisions.';box.appendChild(foot);
5594
5691
  }
5595
5692
  /* The record's words (why, confidence), read by id on demand (plan R8, V2). In-flight requests are shared; an epoch,
5596
5693
  bumped when the record changes or the model is replaced, drops an answer that arrives after it is stale, before it
@@ -5622,15 +5719,372 @@ function aiRecordWant(ids){
5622
5719
  /* The 3D marks follow the 2D ones: the same analysis, the same switch. Pushed only when they change. */
5623
5720
  function syncAiMarks3d(force){
5624
5721
  if(!view3dReady)return; // through the Steel adapter, never the raw viewport (the seam ratchet only shrinks)
5625
- const marks=showAiMarks?aiMarksNow():null;
5722
+ const marks=showAiMarks?aiMarksShown():null;
5626
5723
  if(!force&&aiMarks3dSent&&aiMarks3dSent.marks===marks)return;
5627
5724
  aiMarks3dSent={marks};
5628
5725
  modelEditor.steel.setAiMarks(aiHasCanvasMarks(marks)?AiMarks.canvasMarksOf(marks):null);
5629
5726
  }
5630
- function updAiMarksToggle(){const b=document.getElementById('aiMarksToggleB');if(!b)return;b.hidden=!aiHasCanvasMarks(aiMarksNow());b.classList.toggle('on',showAiMarks);b.setAttribute('aria-checked',String(showAiMarks));}
5727
+ function updAiMarksToggle(){const b=document.getElementById('aiMarksToggleB');if(!b)return;b.hidden=!aiHasCanvasMarks(aiMarksShown());b.classList.toggle('on',showAiMarks);b.setAttribute('aria-checked',String(showAiMarks));}
5631
5728
  /* The two callers outside main(): the label paint (paintQuickStat) and the record-changed event. */
5632
5729
  window.aiMarksRepaintStrip=renderAiStrip;
5633
- window.aiMarksRecordChanged=()=>{aiRecordInvalidate();render();};
5730
+ window.aiMarksRecordChanged=()=>{aiRecordInvalidate();aiReviewsRefresh();render();};
5731
+ /* #2521 row 8a: Make precise. The person reviews the AI decisions the saved model rests on, a group at a time, and
5732
+ confirms each. A review is written on the decision's row in the project's record and changes nothing in the model
5733
+ (plan docs/superpowers/specs/2026-10-29-quick-model-row8-PLAN.md, Revision 3.1). The list is the server's, so the
5734
+ panel and the Quick label never disagree; a confirm goes only through the chat UI session from this window, which
5735
+ the AI chat cannot reach. The canvas, 3D and strip mark only what nobody has reviewed; Inspect lists every decision. */
5736
+ let makePrecise=null,mpSessionReady=null;
5737
+ // #2994: each group shows its first MP_FIRST cards (all of them up to MP_FIRST+2), then MP_PAGE more per press, so every
5738
+ // group’s heading and Confirm all are on screen from the start. MP_BATCH: what one confirm request may carry (make-precise-service.ts).
5739
+ const MP_FIRST=5,MP_PAGE=25,MP_TWO_STEP=10,MP_BATCH=500;
5740
+ const mpDate=at=>{const d=new Date(at);return Number.isFinite(d.getTime())?d.toLocaleDateString('en-GB',{day:'numeric',month:'short',year:'numeric'}):'';};
5741
+ function aiReviewedNow(){
5742
+ if(aiReviewsMemo.src!==lastAiReviews){
5743
+ const map=new Map(),r=lastAiReviews&&lastAiReviews.reviewed;
5744
+ if(r&&typeof r==='object')for(const [id,at] of Object.entries(r))if(AI_DECISION_ID.test(id)&&typeof at==='string')map.set(id,at);
5745
+ aiReviewsMemo={src:lastAiReviews,map};
5746
+ }
5747
+ return aiReviewsMemo.map;
5748
+ }
5749
+ /* #2521 row 8b: the decisions the person marked changed, with their note ('' when none). */
5750
+ let aiChangedMemo={src:undefined,map:new Map()};
5751
+ function aiChangedNow(){
5752
+ if(aiChangedMemo.src!==lastAiReviews){
5753
+ const map=new Map(),c=lastAiReviews&&lastAiReviews.changed;
5754
+ if(c&&typeof c==='object')for(const [id,note] of Object.entries(c))if(AI_DECISION_ID.test(id)&&typeof note==='string')map.set(id,note);
5755
+ aiChangedMemo={src:lastAiReviews,map};
5756
+ }
5757
+ return aiChangedMemo.map;
5758
+ }
5759
+ function aiMarksShown(){
5760
+ const all=aiMarksNow();if(!all||!AiMarks.unreviewedMarksOf)return all;
5761
+ const reviewed=aiReviewedNow();
5762
+ if(aiShownMemo&&aiShownMemo.all===all&&aiShownMemo.reviewed===reviewed)return aiShownMemo.marks;
5763
+ const marks=AiMarks.unreviewedMarksOf(all,reviewed);aiShownMemo={all,reviewed,marks};return marks;
5764
+ }
5765
+ /* How many of the decisions the live model rests on a person has reviewed: the strip says they are no longer marked. */
5766
+ function aiReviewedCount(){const all=aiMarksNow(),rv=aiReviewedNow();return all&&rv.size?all.dependencyIds.filter(id=>rv.has(id)).length:0;}
5767
+ function mpAdopt(d){
5768
+ lastAiReviews=d&&d.aiReviews&&typeof d.aiReviews==='object'?d.aiReviews:null;
5769
+ if(d&&'quick' in d)paintQuickStat(d.quick??null); // the label as it stands now, reviews counted
5770
+ }
5771
+ const mpRead=()=>fetch('/api/projects/'+encodeURIComponent(PROJECT)+'/make-precise',{cache:'no-store'})
5772
+ .then(async r=>{const d=await r.json().catch(()=>null);if(!r.ok||!d||!Array.isArray(d.groups))throw new Error('make-precise read '+r.status);return d;});
5773
+ /* Another window, or this one, recorded a review: read who reviewed what again (and the list, if it is open). */
5774
+ function aiReviewsRefresh(){
5775
+ if(!PROJECT)return;
5776
+ if(makePrecise){if(!makePrecise.busy)mpLoad(true);return;}
5777
+ mpRead().then(d=>{mpAdopt(d);render();}).catch(e=>console.warn('make precise: could not read the reviews again; the marks show them on the next load',String(e&&e.message||e)));
5778
+ }
5779
+ /* Reads of the list can overlap (a reopen during a confirm, then the confirm's own refresh): only the latest one
5780
+ started is applied, so an older answer arriving last never offers again what was just recorded. */
5781
+ let mpLoadSeq=0;
5782
+ const MP_REFRESH_FAILED='FloLess could not refresh the list just now, so it may still show some that are already reviewed. Close and reopen Make precise to see the latest.';
5783
+ async function mpLoad(keepLive){
5784
+ const state=makePrecise;if(!state||!PROJECT)return;
5785
+ const seq=++mpLoadSeq;
5786
+ try{
5787
+ const d=await mpRead();if(makePrecise!==state||seq!==mpLoadSeq)return;
5788
+ mpAdopt(d);state.review=d;state.status='ready';if(!keepLive)state.live='';
5789
+ const ids=new Set(d.groups.flatMap(g=>g.items.map(c=>c.decisionId)));for(const id of [...state.changed])if(!ids.has(id))state.changed.delete(id);
5790
+ }catch(e){
5791
+ if(makePrecise!==state||seq!==mpLoadSeq)return;
5792
+ console.warn('make precise: could not read the AI decisions',String(e&&e.message||e));
5793
+ // What the confirm said stays (it may be that FloLess cannot tell what was recorded); only its promise that the
5794
+ // list shows the latest is taken back.
5795
+ if(state.review){
5796
+ const said=keepLive&&state.live&&!state.live.endsWith(MP_REFRESH_FAILED)?state.live.replace(/ ?The list now shows what is still to review\.$/,''):'';
5797
+ state.live=keepLive&&state.live.endsWith(MP_REFRESH_FAILED)?state.live:(said?said+' ':'')+MP_REFRESH_FAILED;
5798
+ }
5799
+ else state.status='error';
5800
+ }
5801
+ render();
5802
+ }
5803
+ function openMakePrecise(){
5804
+ if(!PROJECT)return;
5805
+ if(makePrecise){document.getElementById('mpTitle')?.focus();return;}
5806
+ if(!memberEndYieldPanel('Make precise',openMakePrecise,'aiPreciseB'))return; // the member-end review gives way first, or asks
5807
+ if(viewPropsId)releaseViewProps();
5808
+ if(gridMode)setGridMode(false);
5809
+ if(dimStyleMode)setDimStyleMode(false);
5810
+ if(csaxisMode){csaxisMode=false;setCsMode();}
5811
+ if(dimMode){dimMode=false;setDimMode();}
5812
+ makePrecise={status:'loading',review:null,live:'',busy:false,changed:new Set(),arm:null,armTimer:0,limits:{},focus:{key:'title'},mark:null};
5813
+ render();mpLoad();
5814
+ }
5815
+ function closeMakePrecise(){
5816
+ if(!makePrecise)return;clearTimeout(makePrecise.armTimer);makePrecise=null;render();
5817
+ (document.getElementById('aiPreciseB')||moreBtn).focus();
5818
+ }
5819
+ /* The chat UI session cookie the confirm route asks for. Minted once; asked again once if it expired. */
5820
+ function mpSession(){
5821
+ if(!mpSessionReady)mpSessionReady=fetch('/api/chat/session',{credentials:'same-origin',cache:'no-store'})
5822
+ .then(r=>{if(!r.ok)throw new Error('chat session '+r.status);}).catch(e=>{mpSessionReady=null;throw e;});
5823
+ return mpSessionReady;
5824
+ }
5825
+ const mpCards=()=>makePrecise&&makePrecise.review?makePrecise.review.groups.flatMap(g=>g.items):[];
5826
+ // How many of a group's cards are on screen: what Show more asked for, else the first MP_FIRST (a group only a couple
5827
+ // longer shows whole, since a button for one or two cards costs more than the cards).
5828
+ const mpShownIn=g=>{const n=makePrecise&&makePrecise.limits[g.id];return Math.min(g.items.length,n||(g.items.length<=MP_FIRST+2?g.items.length:MP_FIRST));};
5829
+ const mpSheet=c=>{const e=Array.isArray(c.evidence)?c.evidence.find(x=>x&&x.sheet):null;return e?String(e.sheet):'';};
5830
+ // The member end a height sits on, in the words Properties uses: a column's base or top, a beam's start or end end.
5831
+ const mpEndName=c=>{
5832
+ const e=c.heightEnds&&c.heightEnds.length===1?c.heightEnds[0]:null,m=e&&byId(e.memberId);if(!e)return'';
5833
+ return m&&m.role==='column'?(e.end===0?'Base':'Top'):(e.end===0?'Start end':'End end');
5834
+ };
5835
+ // What tells cards that ask the same question apart, said beside each (#2994): their sheet when every one is on its own
5836
+ // sheet, else the member end when that differs (a beam's two ends ask alike), else the sheet where it varies and a
5837
+ // number. Worked out over the whole group, so a label never changes when more cards are shown.
5838
+ function mpTwinLabels(items){
5839
+ const out=new Map(),asked=new Map(),distinct=a=>a.every(Boolean)&&new Set(a).size===a.length;
5840
+ for(const c of items){const q=c.question||c.chosen||'';asked.set(q,(asked.get(q)||[]).concat(c));}
5841
+ for(const list of asked.values()){
5842
+ if(list.length<2)continue;
5843
+ const sheets=list.map(mpSheet),ends=list.map(mpEndName);
5844
+ if(distinct(sheets)){list.forEach((c,i)=>out.set(c.decisionId,'Sheet '+sheets[i]));continue;}
5845
+ if(distinct(ends)){list.forEach((c,i)=>out.set(c.decisionId,ends[i]));continue;}
5846
+ const varies=new Set(sheets).size>1,bySheet=new Map();
5847
+ list.forEach((c,i)=>bySheet.set(sheets[i],(bySheet.get(sheets[i])||[]).concat(c)));
5848
+ for(const [sh,same] of bySheet)same.forEach((c,i)=>out.set(c.decisionId,[varies&&sh?'Sheet '+sh:'',same.length>1?(i+1)+' of '+same.length:''].filter(Boolean).join(' · ')));
5849
+ }
5850
+ return out;
5851
+ }
5852
+ async function mpConfirm(items){
5853
+ const state=makePrecise;if(!state||state.busy||!items.length)return;
5854
+ const order=mpCards().filter(c=>c.confirmable).map(c=>c.decisionId),last=order.indexOf(items[items.length-1].decisionId);
5855
+ const after=order.slice(last+1).filter(id=>!items.some(c=>c.decisionId===id));
5856
+ state.busy=true;state.arm=null;clearTimeout(state.armTimer);
5857
+ state.live=items.length===1?'Recording your review…':'Recording '+items.length+' reviews…';panel();
5858
+ const post=batch=>fetch('/api/chat/make-precise/'+encodeURIComponent(PROJECT)+'/confirm',{method:'POST',credentials:'same-origin',
5859
+ headers:{'Content-Type':'application/json'},body:JSON.stringify({items:batch.map(c=>({decisionId:c.decisionId,card:c.card,...(c.outcome==='changed'?{outcome:'changed',...(c.note?{note:c.note}:{})}:{})}))})});
5860
+ // One request, with the chat session it needs (minted again once if it lapsed). No session means the request never
5861
+ // left, so nothing can have been recorded (notSent); a lost answer after it left is another matter (confirmInBatches).
5862
+ const session=async()=>{try{await mpSession();}catch(e){throw Object.assign(new Error(String(e&&e.message||e)),{notSent:true});}};
5863
+ const send=async batch=>{
5864
+ await session();const res=await post(batch);
5865
+ if(res.status!==401)return res;
5866
+ const d=await res.clone().json().catch(()=>null);if(!(d&&d.code==='chat-session-required'))return res;
5867
+ mpSessionReady=null;await session();return post(batch);
5868
+ };
5869
+ // A group larger than one request takes goes a batch at a time (confirmInBatches, tested); what is said is worded only
5870
+ // from what THIS confirm did (makePreciseOutcome, tested).
5871
+ const run=await AiMarks.confirmInBatches(items,MP_BATCH,send,n=>{if(makePrecise===state){state.live='Recording reviews… '+n+' of '+items.length+' done.';panel();}});
5872
+ if(run.error)console.warn('make precise: the review could not be sent',String(run.error&&run.error.message||run.error));
5873
+ const {res,d,settled,byYou,already}=run;
5874
+ if(run.reviewedIds.length){
5875
+ const at=new Date().toISOString(),next={...(lastAiReviews&&lastAiReviews.reviewed||{})},changedNow={...(lastAiReviews&&lastAiReviews.changed||{})};
5876
+ for(const id of run.reviewedIds)if(!next[id]){next[id]=at;const it=items.find(c=>c.decisionId===id);if(it&&it.outcome==='changed')changedNow[id]=it.note||'';}
5877
+ lastAiReviews={reviewed:next,...(Object.keys(changedNow).length?{changed:changedNow}:{})};
5878
+ }
5879
+ if(run.quick!==undefined)paintQuickStat(run.quick);
5880
+ state.busy=false; // this confirm's own panel, on every way out
5881
+ // The panel was closed meanwhile: whatever is open now (a reopened Make precise, or the canvas) is refreshed, so it
5882
+ // never offers what this confirm just recorded.
5883
+ const touched=settled>0||run.unknown;
5884
+ if(makePrecise!==state){if(touched){if(makePrecise)await mpLoad(true);else render();}return;}
5885
+ if(settled)state.mark=null; // what it recorded leaves the list, and its Change area with it
5886
+ // #2521 row 8b: another window recorded a different review of one of these. It is said, never dropped: the list is
5887
+ // refreshed to what is recorded now.
5888
+ const differently=!!(res&&res.status===409&&d&&d.code==='make-precise-reviewed-differently');
5889
+ const rest=items.slice(settled).map(c=>c.decisionId),conflict=!differently&&!!(res&&res.status===409&&d&&d.review&&Array.isArray(d.review.groups));
5890
+ // FloLess's own refusals are worded for a person; anything else (no answer, a session the browser could not open) is worded by the helper.
5891
+ const refusal=d&&typeof d.code==='string'&&/^(make-precise|ai-decisions)/.test(d.code)&&typeof d.error==='string'?d.error:undefined;
5892
+ const left=!rest.length&&d&&d.progress&&Number.isSafeInteger(d.progress.remaining)?d.progress.remaining:null;
5893
+ const failure=!rest.length?null:conflict?'changed':run.unknown?'unknown':'error';
5894
+ state.live=AiMarks.makePreciseOutcome({byYou,already,unsettled:rest.length,left,...(failure?{failure}:{}),...(refusal&&failure==='error'?{refusal}:{}),
5895
+ ...(items.every(c=>c.outcome==='changed')?{changed:true}:{})});
5896
+ if(differently){state.mark=null;state.focus={after:[...rest,...after]};await mpLoad(true);return;}
5897
+ if(conflict){
5898
+ state.review=d.review;for(const id of d.changed||[])state.changed.add(id);
5899
+ state.focus={after:[...(d.changed||[]),...rest,...after]};render();return;
5900
+ }
5901
+ // Focus: after a full confirm the next one to review; otherwise the first one this confirm did not record.
5902
+ state.focus={after:rest.length?[...rest,...after]:after};
5903
+ if(touched){await mpLoad(true);return;} // the server's list, so the panel and the label never disagree
5904
+ panel();
5905
+ }
5906
+ /* Select what a decision bears on, and frame it on this sheet. The panel stays: the selection shows on the canvas. */
5907
+ function mpSelect(ids){
5908
+ const keep=[...new Set(ids)].filter(id=>byId(id));
5909
+ if(!keep.length){makePrecise.live='These members are no longer in the model.';panel();return 0;}
5910
+ if(modelEditor.isReady()&&modelEditor.steel.clearConnSel)modelEditor.steel.clearConnSel();
5911
+ modelSelection.replaceMembers(keep);selDimIds.clear();sel3dDimIds.clear();modelSelection.clearGrids();
5912
+ const set=new Set(keep),here=view3d?[]:P.members.filter(m=>set.has(m.id)&&visible2d(m));
5913
+ makePrecise.live='Selected '+keep.length+' member'+(keep.length===1?'':'s')+(view3d||here.length===keep.length?'.':'; '+(keep.length-here.length)+' '+(keep.length-here.length===1?'is':'are')+' not drawn on this sheet.');
5914
+ render();if(here.length)zoomToMembers(here);
5915
+ return keep.length;
5916
+ }
5917
+ function mpAffects(c){
5918
+ const a=c.affects,parts=[],s=n=>n===1?'':'s';
5919
+ if(a.wholeModel)parts.push('the whole model');
5920
+ if(a.viewId)parts.push('every member drawn on '+aiPlanLabel(a.viewId));
5921
+ if(a.jointIds.length)parts.push(a.jointIds.length+' connection'+s(a.jointIds.length));
5922
+ if(a.memberIds.length&&!a.viewId)parts.push(a.memberIds.length+' member'+s(a.memberIds.length));
5923
+ return parts.length?parts.join(', '):'Nothing FloLess can point to on the model';
5924
+ }
5925
+ /* The Elevation field of the end a height decision is on: a column's bottom or top, a beam's start or end. */
5926
+ function mpHeightField(e){const m=e&&byId(e.memberId);if(!m)return null;return m.role==='column'?(e.end===0?'bos':'tosC'):(e.end===0?'tosA':'tosB');}
5927
+ function mpElevationField(e){const id=mpHeightField(e);return id?document.getElementById(id):null;}
5928
+ /* With several members selected, each Elevation field writes that end of EVERY selected member. So the ends a height
5929
+ sits on can be edited together only when they all land in the same field (same kind of member, same end); otherwise
5930
+ one member is edited at a time, or typing would move an end the decision does not sit on. */
5931
+ /* What the change-height button says, worked out from what its click selects: k of the n ends the height sits on. */
5932
+ function mpHeightWords(k,n){
5933
+ if(k>=n)return{label:`Select ${n} member end${n===1?'':'s'}`,tip:'Select the member ends that carry this height and show them in Properties',
5934
+ toast:'Type the new height in Elevation. Make precise in the AI decisions strip takes you back to the list.'};
5935
+ const these=k===1?'1 of them is':k+' of them are';
5936
+ return{label:`Select ${k} of ${n} member ends`,tip:`This height sits on ${n} member ends that cannot all be changed together: select the ${k===1?'one':k} that can, and show ${k===1?'it':'them'} in Properties`,
5937
+ toast:`This height sits on ${n} member ends that cannot all be changed together, so ${these} selected. Type the new height in Elevation; Make precise in the AI decisions strip takes you back to the list for the rest.`};
5938
+ }
5939
+ function mpHeightEnds(c){
5940
+ const ends=c.heightEnds||[],shown=ends.filter(e=>mpHeightField(e)); // an end on a member this view cannot show has no field
5941
+ if(!shown.length)return ends.slice(0,1);
5942
+ return new Set(shown.map(mpHeightField)).size===1?shown:shown.slice(0,1);
5943
+ }
5944
+ const MP_CONFIDENCE={high:'High',medium:'Medium',low:'Low'};
5945
+ /* #2521 row 8b: where a person changes each kind of AI decision themselves, before marking it changed. A height is typed
5946
+ (its own button); a view's scale and the grid origin cannot change in an existing model (MP_FIXED_SETUP). */
5947
+ const MP_NOTE_MAX=600;
5948
+ const MP_FIXED_SETUP='A view’s scale and the grid origin can’t be changed in an existing model, so this can only be confirmed. If the AI’s choice is wrong, read the drawings into a new project.';
5949
+ function mpWhereToChange(c){
5950
+ switch(c.channel){
5951
+ case'connection':return'Change the connection in the model. Select it with the question above.';
5952
+ case'filter':return'Read the drawings again from Attach revised drawings in the workspace, and save a different Drawing Filter in that read.';
5953
+ default:return'Change it in the model here in the editor, or read the drawings again from Attach revised drawings in the workspace.';
5954
+ }
5955
+ }
5956
+ function renderMakePrecisePanel(p){
5957
+ const state=makePrecise,review=state.review,prog=review&&review.progress;
5958
+ // The rebuild replaces every node: keep focus, the list's scroll and each open "Why?".
5959
+ const active=document.activeElement,keepKey=active&&p.contains(active)?active.getAttribute('data-mp-key'):null;
5960
+ const oldList=p.querySelector('#mpList'),keepScroll=oldList?oldList.scrollTop:0;
5961
+ const openWhy=new Set([...p.querySelectorAll('details.mp-why[open]')].map(x=>x.dataset.mpId));
5962
+ p.setAttribute('aria-busy',String(!!state.busy));p.setAttribute('aria-labelledby','mpTitle');
5963
+ const dis=state.busy?' disabled':'',s=n=>n===1?'':'s';
5964
+ const sub=!prog?'Reading the AI decisions…':prog.remaining?prog.remaining+' of '+prog.total+' AI decision'+s(prog.total)+' to review':'Nothing left to review';
5965
+ let html=`<div class=mer-head><div><div class=mer-title id=mpTitle tabindex=-1 data-mp-key=title>Make precise</div><div class=hint>${esc(sub)}</div></div><button id=mpDone data-mp-key=done data-command-id="steel.make-precise-close" class=ghost data-tip="Close Make precise. What you confirmed is saved."${dis}>Done</button></div>`;
5966
+ if(prog&&prog.total)html+=`<div class=mp-bar aria-hidden=true><span style="width:${Math.round(100*prog.reviewed/prog.total)}%"></span></div>`;
5967
+ if(!prog||prog.remaining)html+='<p class=mp-intro>Confirming a decision records that you looked at it. It doesn’t check the value or change the model. The model stays a Quick model until you’ve reviewed every AI decision.</p>';
5968
+ if(state.status==='loading')html+='<div class=mer-empty role=status>Reading the AI decisions…</div>';
5969
+ else if(state.status==='error')html+=`<div class=mer-empty>FloLess could not read the AI decisions just now. Your model is unchanged.<div class=mer-toolbar><button id=mpRetry data-mp-key=retry data-command-id="steel.make-precise-retry" class=ghost>Try again</button></div></div>`;
5970
+ else if(!prog.remaining){
5971
+ html+=`<div class=mp-done id=mpDoneMsg tabindex=-1 data-mp-key=done-msg><b>${prog.total?(prog.total===1?'The AI decision is reviewed.':'All '+prog.total+' AI decisions are reviewed.'):'This model rests on no AI decision.'}</b> This model is no longer labelled Quick model.<div class=hint>Reviewing records your look at each decision. It does not verify the model.</div></div>`;
5972
+ }else{
5973
+ if(review.record==='unreadable')html+='<div class=mp-banner role=note>The review record can’t be read, so nothing can be marked reviewed yet. Your model is unchanged.</div>';
5974
+ else if(review.record==='absent')html+='<div class=mp-banner role=note>FloLess has no record of how the AI made these decisions, so they can’t be confirmed here, and the model stays a Quick model while it rests on them. Reading the drawings again records them.</div>';
5975
+ html+='<div class=mer-list id=mpList>';
5976
+ review.groups.forEach((g,gi)=>{
5977
+ const items=g.items.slice(0,mpShownIn(g)),hidden=g.items.length-items.length;
5978
+ const can=g.items.filter(c=>c.confirmable),gk=esc(g.id),gl=esc(g.title);
5979
+ const unseen=can.filter(c=>!items.includes(c)).length; // Confirm all records these too, so the armed step says so
5980
+ const twin=mpTwinLabels(g.items);
5981
+ let act='';
5982
+ if(can.length>1){
5983
+ act=state.arm===g.id
5984
+ ?`<div class=mp-arm role=group aria-label="Confirm ${can.length} decisions"><button data-mp-all-yes="${gk}" data-mp-key="yes:${gk}" data-command-id="steel.make-precise-confirm-all#${esc(g.id)}" data-command-instance-label="${gl}" class=mp-yes aria-label="Yes, record all ${can.length} in ${gl} as reviewed${unseen?', including '+unseen+' not shown yet':''}"${dis}>Yes, record ${can.length} as reviewed</button><button data-mp-all-no="${gk}" data-mp-key="no:${gk}" data-command-id="steel.make-precise-confirm-all-cancel" class=ghost${dis}>Cancel</button>${unseen?`<span class=hint>Includes ${unseen} not shown yet.</span>`:''}</div>`
5985
+ :`<button data-mp-all="${gk}" data-mp-key="all:${gk}" data-command-id="steel.make-precise-confirm-all#${esc(g.id)}" data-command-instance-label="${gl}" class=ghost aria-label="Confirm all ${can.length} in ${gl}" data-tip="Record every decision in this group as reviewed by you"${dis}>Confirm all ${can.length}</button>`;
5986
+ }
5987
+ html+=`<section class="mer-group mp-group" aria-labelledby="mpG${gi}"><div class=mp-ghead><h3 class=mp-gtitle id="mpG${gi}">${gl} <span class=mp-gcount>· ${g.items.length} to review</span></h3>${act}</div>`;
5988
+ if(g.consequence)html+=`<p class=mp-cons>${esc(g.consequence)}</p>`;
5989
+ for(const c of items){
5990
+ const which=twin.get(c.decisionId)||'';
5991
+ const id=esc(c.decisionId),changed=state.changed.has(c.decisionId),q0=c.question||c.chosen||'An AI decision';
5992
+ // The accessible names keep what tells it apart even when the question is cut short.
5993
+ const cut=q0.length>60?q0.slice(0,57)+'…':q0,short=esc(which?cut+' ('+which+')':cut),q=which?q0+' ('+which+')':q0;
5994
+ const qHtml=which?`${esc(q0)} <span class=mp-sheet>· ${esc(which)}</span>`:esc(q0);
5995
+ html+=`<div class="mp-card${changed?' changed':''}" data-mp-id="${id}">`;
5996
+ if(changed)html+='<span class="chip assumed">Updated</span>'; // its words changed since it was shown (row 8b: not "Changed", the person's verb)
5997
+ html+=c.affects.memberIds.length
5998
+ ?`<button type=button class=mp-q data-mp-locate="${id}" data-mp-key="q:${id}" data-command-id="steel.make-precise-locate#${esc(c.decisionId)}" data-command-instance-label="${short}" data-tip="Select the ${c.affects.memberIds.length} member${s(c.affects.memberIds.length)} this decision bears on">${qHtml}</button>`
5999
+ :`<div class=mp-q-text>${qHtml}</div>`;
6000
+ const marking=!!(state.mark&&state.mark.id===c.decisionId);
6001
+ const changeB=c.canMarkChanged?`<button type=button class="ghost mp-changeb" data-mp-mark="${id}" data-mp-key="m:${id}" data-command-id="steel.make-precise-mark-changed#${esc(c.decisionId)}" data-command-instance-label="${short}" aria-expanded="${marking}" aria-controls="mpM${id}" aria-label="Changed it myself: ${esc(q)}" data-tip="Change it in the model yourself, then record here that you did"${dis}>Changed it myself</button>`:'';
6002
+ html+=`<div class=mp-chose><span>The AI chose: <b>${esc(c.chosen||'(not recorded)')}</b></span>${c.confirmable?`<span class=mp-acts><button class=mp-confirm data-mp-confirm="${id}" data-mp-key="c:${id}" data-command-id="steel.make-precise-confirm#${esc(c.decisionId)}" data-command-instance-label="${short}" aria-label="Confirm: ${esc(q)}"${dis}>Confirm</button>${changeB}</span>`:''}</div>`;
6003
+ if(!c.confirmable&&c.notConfirmable)html+=`<div class="hint mp-why-not">${esc(c.notConfirmable)}</div>`;
6004
+ if(c.confirmable&&!c.canMarkChanged&&!c.canEditHeight&&c.channel==='setup')html+=`<div class="hint mp-why-not">${esc(MP_FIXED_SETUP)}</div>`;
6005
+ if(marking)html+=`<div class=mp-mark id="mpM${id}" role=group aria-label="Record your change: ${esc(q)}"><div class=hint id="mpMl${id}">${esc(mpWhereToChange(c))}</div>`
6006
+ +`<label class=mp-note-l for="mpN${id}">What you changed <span class=hint>(optional)</span></label><textarea id="mpN${id}" class=mp-note data-mp-note="${id}" data-mp-key="n:${id}" data-command-id="steel.make-precise-mark-changed-note#${esc(c.decisionId)}" data-command-instance-label="${short}" rows=2 maxlength=${MP_NOTE_MAX} aria-describedby="mpMl${id} mpMd${id}"${dis}>${esc(state.mark.note||'')}</textarea>`
6007
+ +`<div class=hint id="mpMd${id}">This records that you changed it. FloLess doesn’t check the model.</div>`
6008
+ +`<div class=mp-arm><button class=ghost data-mp-mark-yes="${id}" data-mp-key="my:${id}" data-command-id="steel.make-precise-mark-changed-record#${esc(c.decisionId)}" data-command-instance-label="${short}" aria-label="Record my change: ${esc(q)}"${dis}>Record my change</button><button class=ghost data-mp-mark-no="${id}" data-mp-key="mn:${id}" data-command-id="steel.make-precise-mark-changed-cancel"${dis}>Cancel</button></div></div>`;
6009
+ let dl='';
6010
+ if(c.why)dl+=`<dt>Reason</dt><dd>${esc(c.why)}</dd>`;
6011
+ if(c.confidence)dl+=`<dt>Confidence</dt><dd>${esc(MP_CONFIDENCE[c.confidence]||c.confidence)}</dd>`;
6012
+ if(Array.isArray(c.evidence)&&c.evidence.length)dl+=`<dt>Evidence</dt><dd><ul>${c.evidence.map(e=>{const where=[e.sheet,e.location].filter(Boolean).join(', ');return`<li>${esc(where?where+': ':'')}${esc(e.reading||'')}</li>`;}).join('')}</ul></dd>`;
6013
+ dl+=`<dt>Affects</dt><dd>${esc(mpAffects(c))}</dd>`;
6014
+ html+=`<details class=mp-why data-mp-id="${id}"${openWhy.has(c.decisionId)?' open':''}><summary data-mp-key="w:${id}" data-command-id="steel.make-precise-why#${esc(c.decisionId)}" data-command-instance-label="${short}">Why?</summary><dl>${dl}</dl></details>`;
6015
+ if(c.canEditHeight){
6016
+ const words=mpHeightWords(mpHeightEnds(c).length,c.heightEnds.length);
6017
+ html+=`<div class=mp-change><button type=button class=ghost data-mp-height="${id}" data-mp-key="h:${id}" data-command-id="steel.make-precise-change-height#${esc(c.decisionId)}" data-command-instance-label="${short}" data-tip="${esc(words.tip)}"${dis}>${esc(words.label)}</button><div class=hint>To change it, type the new height in Elevation. This decision stays until no member end uses it (${c.heightEnds.length} now).</div></div>`;
6018
+ }
6019
+ html+='</div>';
6020
+ }
6021
+ if(hidden){
6022
+ const next=Math.min(MP_PAGE,hidden);
6023
+ html+=`<button type=button data-mp-more="${gk}" data-mp-key="more:${gk}" data-command-id="steel.make-precise-more#${esc(g.id)}" data-command-instance-label="${gl}" class="ghost mp-more" aria-label="Show ${next} more of ${g.items.length} in ${gl}, ${hidden} not shown yet"${dis}>Show ${next} more of ${g.items.length}</button>`;
6024
+ }
6025
+ html+='</section>';
6026
+ });
6027
+ html+='</div>';
6028
+ }
6029
+ html+=`<div class=mer-live id=mpLive role=status aria-live=polite>${esc(state.live||'')}</div>`;
6030
+ p.innerHTML=html;
6031
+ const card=id=>mpCards().find(c=>c.decisionId===id),group=id=>review&&review.groups.find(g=>g.id===id);
6032
+ p.querySelector('#mpDone').onclick=()=>closeMakePrecise();
6033
+ p.querySelector('#mpRetry')?.addEventListener('click',()=>{state.status='loading';state.live='';panel();mpLoad();});
6034
+ for(const b of p.querySelectorAll('[data-mp-more]'))b.onclick=()=>{
6035
+ const g=group(b.dataset.mpMore);if(!g)return;
6036
+ const from=mpShownIn(g),first=g.items[from];state.limits[g.id]=from+MP_PAGE;
6037
+ const left=g.items.length-mpShownIn(g);
6038
+ state.live=`${mpShownIn(g)-from} more shown in ${g.title}.${left?' '+left+' not shown yet.':''}`;
6039
+ if(first)state.focus={key:'q:'+first.decisionId,orCard:first.decisionId};panel();
6040
+ };
6041
+ for(const b of p.querySelectorAll('[data-mp-confirm]'))b.onclick=()=>{const c=card(b.dataset.mpConfirm);if(c)mpConfirm([c]);};
6042
+ // #2521 row 8b: Change opens the area under its card (one at a time); the note is kept as typed, without a redraw.
6043
+ for(const b of p.querySelectorAll('[data-mp-mark]'))b.onclick=()=>{
6044
+ const id=b.dataset.mpMark,open=state.mark&&state.mark.id===id;
6045
+ state.mark=open?null:{id,note:''};state.focus={key:open?'m:'+id:'n:'+id};panel();
6046
+ };
6047
+ for(const t of p.querySelectorAll('[data-mp-note]')){
6048
+ t.oninput=()=>{if(state.mark&&state.mark.id===t.dataset.mpNote)state.mark.note=t.value;};
6049
+ t.onkeydown=e=>{if(e.key==='Escape'){e.preventDefault();e.stopPropagation();state.mark=null;state.focus={key:'m:'+t.dataset.mpNote};panel();}};
6050
+ }
6051
+ for(const b of p.querySelectorAll('[data-mp-mark-no]'))b.onclick=()=>{state.mark=null;state.focus={key:'m:'+b.dataset.mpMarkNo};panel();};
6052
+ for(const b of p.querySelectorAll('[data-mp-mark-yes]'))b.onclick=()=>{
6053
+ const c=card(b.dataset.mpMarkYes);if(!c||!state.mark||state.mark.id!==c.decisionId)return;
6054
+ const note=String(state.mark.note||'').trim();
6055
+ mpConfirm([{...c,outcome:'changed',...(note?{note}:{})}]);
6056
+ };
6057
+ for(const b of p.querySelectorAll('[data-mp-locate]'))b.onclick=()=>{const c=card(b.dataset.mpLocate);if(c)mpSelect(c.affects.memberIds);};
6058
+ for(const b of p.querySelectorAll('[data-mp-height]'))b.onclick=()=>{
6059
+ const c=card(b.dataset.mpHeight);if(!c)return;
6060
+ // Elevation is in Properties, which this panel covers: close it, select the ends, and say how to come back.
6061
+ const ends=mpHeightEnds(c);
6062
+ if(!mpSelect([...new Set(ends.map(e=>e.memberId))]))return;
6063
+ clearTimeout(state.armTimer);makePrecise=null;render();
6064
+ toast(mpHeightWords(ends.length,c.heightEnds.length).toast);
6065
+ queueMicrotask(()=>mpElevationField(ends[0])?.focus());
6066
+ };
6067
+ for(const b of p.querySelectorAll('[data-mp-all]'))b.onclick=()=>{
6068
+ const g=group(b.dataset.mpAll);if(!g)return;const can=g.items.filter(c=>c.confirmable);
6069
+ // A small group whose cards are all on screen confirms at once. A large one, or one with cards not shown yet (#2994:
6070
+ // they would be recorded unseen), asks once, in place, saying how many are not shown; it goes back by itself if left.
6071
+ const shown=g.items.slice(0,mpShownIn(g));
6072
+ if(can.length<=MP_TWO_STEP&&can.every(c=>shown.includes(c))){mpConfirm(can);return;}
6073
+ state.arm=g.id;clearTimeout(state.armTimer);
6074
+ state.armTimer=setTimeout(()=>{if(makePrecise===state&&state.arm===g.id){state.arm=null;state.focus=p.contains(document.activeElement)&&document.activeElement.closest('.mp-arm')?{key:'all:'+g.id}:null;panel();}},8000);
6075
+ state.focus={key:'yes:'+g.id};panel();
6076
+ };
6077
+ for(const b of p.querySelectorAll('[data-mp-all-yes]'))b.onclick=()=>{const g=group(b.dataset.mpAllYes);if(g)mpConfirm(g.items.filter(c=>c.confirmable));};
6078
+ for(const b of p.querySelectorAll('[data-mp-all-no]'))b.onclick=()=>{clearTimeout(state.armTimer);state.arm=null;state.focus={key:'all:'+b.dataset.mpAllNo};panel();};
6079
+ const list=p.querySelector('#mpList');if(list)list.scrollTop=keepScroll;
6080
+ const f=state.focus;state.focus=null;
6081
+ const byKey=k=>p.querySelector('[data-mp-key="'+CSS.escape(k)+'"]');
6082
+ let el=null;
6083
+ if(f&&f.after){for(const id of f.after){el=byKey('c:'+id);if(el)break;}if(!el)el=p.querySelector('[data-mp-confirm]')||p.querySelector('#mpDoneMsg')||byKey('title');}
6084
+ else if(f&&f.key)el=byKey(f.key)||(f.orCard?p.querySelector('[data-mp-id="'+CSS.escape(f.orCard)+'"] summary'):null);
6085
+ else if(keepKey)el=byKey(keepKey);
6086
+ if(el)el.focus({preventScroll:!(f&&(f.after||f.orCard))});
6087
+ }
5634
6088
  const newModelId=()=>`m-v2-${Date.now().toString(36)}-${(v2IdSeq++).toString(36)}`;
5635
6089
  V2_SESSION=V2Commands.createV2CommandSession(C,{
5636
6090
  validate:doc=>V2Validation.validateClientSteelModelV2(doc,V2_SCHEMA),
@@ -11143,7 +11597,7 @@ function projectedMemberLookup(presence=V2Projection.createMemberPresenceIndex(C
11143
11597
  };}
11144
11598
 
11145
11599
  function syncV2SelectionNotice(p){
11146
- if(!p||!selIds.size||viewPropsId)return; // a view in the panel keeps the selection, not its notices
11600
+ if(!p||!selIds.size||viewPropsId||makePrecise)return; // a view in the panel, or Make precise (#2521 row 8a), keeps the selection, not its notices
11147
11601
  p.querySelectorAll('.v2-selection-notice,.v2-elevation-warning,.v2-elevation-proposal,.v2-elevation-answered,.v2-ai-decisions').forEach(el=>el.remove());
11148
11602
  const presence=V2Projection.createMemberPresenceIndex(C);
11149
11603
  const ids=[...selIds].filter(id=>presence.members.has(id));
@@ -11412,7 +11866,7 @@ function refPanelPreempted(){
11412
11866
  }
11413
11867
  // Review list view-model: type -> member -> ends, narrowed by a filter. PURE (no DOM, no globals) so a test can run
11414
11868
  // the shipped function. `typeOf(finding)` -> {k,label}; `textOf(finding)` is the reason text the filter also matches;
11415
- // `typeOrder` is the Objects tree's type order. The filter matches a member's mark, its type and any end's reason
11869
+ // `typeOrder` is the Objects tree's type order. The filter matches a member's ID, its type and any end's reason
11416
11870
  // text, every space-separated word having to hit. `endOrder` is the Previous/Next walk (every shown end, in the order
11417
11871
  // the list draws them); `order` is the member order Shift+click ranges over.
11418
11872
  function memberEndBuildView(findings,opts){
@@ -11527,7 +11981,7 @@ function renderMemberEndPanel(p){
11527
11981
  const toolbar=[];if(shownReady.length>shownTicked)toolbar.push(`<button id=merAll data-command-id="steel.member-end-select-all" data-tip="Tick every end in the groups shown below. Collapsed groups are left alone." class=ghost${disabled}>Select all</button>`);if(selected)toolbar.push(`<button id=merClear data-command-id="steel.member-end-select-clear" class=ghost${disabled}>Clear</button>`);
11528
11982
  const counts=selected+' end'+(selected===1?'':'s')+' ticked'+(hiddenTicked>0?' ('+hiddenTicked+' hidden by filter)':'')+(selectedMembers>1?' · '+selectedMembers+' members selected':'');
11529
11983
  html+=`<div class=mer-toolbar>${toolbar.join('')}<span class=hint>${counts}</span></div>`;
11530
- html+=`<div class="mer-search${query?' has':''}"><span class=lsico aria-hidden=true><svg viewBox="0 0 16 16" width=12 height=12 fill=none stroke=currentColor stroke-width=1.6 stroke-linecap=round><circle cx=7 cy=7 r=4.5></circle><line x1=10.6 y1=10.6 x2=14 y2=14></line></svg></span><input id=merFilter type=text role=searchbox autocomplete=off placeholder="Filter members…" aria-label="Filter members by mark, type or reason" data-command-id="steel.member-end-filter" value="${esc(query)}"><button type=button class=lsx id=merFilterClear aria-label="Clear filter" data-command-id="steel.member-end-filter-clear" data-tip="Clear">×</button></div>`;
11984
+ html+=`<div class="mer-search${query?' has':''}"><span class=lsico aria-hidden=true><svg viewBox="0 0 16 16" width=12 height=12 fill=none stroke=currentColor stroke-width=1.6 stroke-linecap=round><circle cx=7 cy=7 r=4.5></circle><line x1=10.6 y1=10.6 x2=14 y2=14></line></svg></span><input id=merFilter type=text role=searchbox autocomplete=off placeholder="Filter members…" aria-label="Filter members by ID, type or reason" data-command-id="steel.member-end-filter" value="${esc(query)}"><button type=button class=lsx id=merFilterClear aria-label="Clear filter" data-command-id="steel.member-end-filter-clear" data-tip="Clear">×</button></div>`;
11531
11985
  if(query)html+=`<div class=hint id=merFilterCount role=status>${view.shownMembers} of ${view.totalMembers} member${view.totalMembers===1?'':'s'}</div>`;
11532
11986
  html+='<div class=mer-list id=merList>';
11533
11987
  if(query&&!view.groups.length)html+=`<div class=mer-empty role=status>No members match “${esc(query)}”. <button type=button id=merFilterReset class=mer-link data-command-id="steel.member-end-filter-reset">Clear</button></div>`;
@@ -11663,31 +12117,36 @@ function nativeElevationContextHtml(){
11663
12117
  * editing command handed one would resolve nothing (see `selCanonicalArr`). The panel says where to edit
11664
12118
  * instead.
11665
12119
  */
12120
+ /** #2948: a member's drawing marks as panel HTML, or a muted "No mark" (real text, so it is read out) when it has none. */
12121
+ function markHtml(id){const k=memberMarks(id);return k.length?`<span style="overflow-wrap:anywhere">${esc(k.join(', '))}</span>`:'<span style="color:var(--mut)">No mark</span>';}
11666
12122
  function refusedSheetPropsHtml(rows){
11667
12123
  const kv=(l,val)=>`<div style="display:flex;justify-content:space-between;gap:8px;font-size:12px;margin:3px 0"><span style="color:var(--mut)">${esc(l)}</span><span style="font-variant-numeric:tabular-nums">${val}</span></div>`;
11668
12124
  const sec=t=>`<div class=divrow><hr><span class=sect style="margin:0">${esc(t)}</span><hr></div>`;
11669
- // NOT pre-escaped: `kv` escapes its own label, so escaping here rendered a legal mark like `A&B` as
12125
+ // NOT pre-escaped: `kv` escapes its own label, so escaping here rendered a legal id like `A&B` as
11670
12126
  // `A&amp;B` — the panel misquoting the user's own id, which is the small untruth this whole issue is about.
11671
- const mark=m=>(m.id==null?'—':String(m.id));
12127
+ const idText=m=>(m.id==null?'—':String(m.id));
11672
12128
  // A multi-selection gets one identifying line each rather than N full property lists — a box-select can
11673
12129
  // carry hundreds, and a panel that long is not a readout. CAP keeps it a panel; the count says what was cut.
11674
12130
  if(rows.length!==1){
11675
12131
  const CAP=12,shown=rows.slice(0,CAP);
11676
12132
  return sec('Selected members')
11677
- +shown.map(m=>kv(mark(m),esc((m.profile||'—')+' · '+memberTypeLabel(memberTypeOf(m))))).join('')
12133
+ +shown.map(m=>kv(idText(m),esc((m.profile||'—')+' · '+memberTypeLabel(memberTypeOf(m))))).join('')
11678
12134
  +(rows.length>CAP?'<div class=hint style="margin-top:6px">…and '+(rows.length-CAP)+' more.</div>':'')
11679
12135
  +'<div class=hint style="margin-top:6px">Select a single member to see its full properties.</div>';}
11680
12136
  const m=ensureMeta(rows[0]);
11681
- // The mark is a DATA row, not the section header. `.sect` uppercases, and a mark is the member's stored
11682
- // id — rendering `m-beam-1` as `M-BEAM-1` would be the panel restating the user's own data as something
11683
- // it is not. Section headers are labels and may be uppercased; ids may not.
12137
+ // The id is a DATA row, not the section header. `.sect` uppercases, and rendering `m-beam-1` as `M-BEAM-1`
12138
+ // would be the panel restating the user's own data as something it is not. Section headers are labels and
12139
+ // may be uppercased; ids and marks may not.
12140
+ // #2948: the id is the model's name for the member, never its Mark. The Mark row is what the drawings gave it,
12141
+ // or "No mark" (muted, as real text) when they gave none: this label is what led the AI to cite ids as marks.
11684
12142
  let out=sec('Properties');
11685
- out+=kv('Mark',esc(m.id==null?'—':String(m.id)));
12143
+ out+=kv('ID',esc(idText(m)));
12144
+ out+=kv('Mark',markHtml(m.id));
11686
12145
  out+=kv('Profile',esc(m.profile||'—'));
11687
12146
  out+=kv('Material',m.material?esc(m.material):esc(profileDefaultMaterial(m.profile))+' <span style="color:var(--mut);font-size:11px">· profile default</span>');
11688
12147
  const withheld=[];
11689
12148
  for(const def of PROP_DEFS){
11690
- if(def.key==='id'||def.key==='profile')continue; // the mark heads the block; the profile leads it
12149
+ if(def.key==='id'||def.key==='mark'||def.key==='profile')continue; // the ID and Mark head the block; the profile leads it
11691
12150
  // A row that really is coordinate-derived is NAMED as withheld, never quietly dropped: a property
11692
12151
  // missing without explanation reads as "this member has none", which is the class of silence #935 and
11693
12152
  // #942 both exist to end. `canonicalGet` first, though — see `needsPlan` in PROP_DEFS: a stored
@@ -11786,8 +12245,10 @@ function panel(){
11786
12245
  if(!selDimIds.size||!dimsVisible)dimSplitMode=false;document.body.classList.toggle('dimsplit',dimSplitMode); // split mode is meaningless without a (visible) dim selected — also disarms when dims are hidden
11787
12246
  if(viewPropsId&&viewPropsClaim()!==viewPropsClaimSig)releaseViewProps(); // a saved view holds the panel only until something selects or arms a tool
11788
12247
  if(viewPropsId&&renderViewPropsPanel(p))return;
12248
+ if(makePrecise&&(memberEndScan||memberEndReview||gridMode||dimStyleMode||csaxisMode||dimMode)){clearTimeout(makePrecise.armTimer);makePrecise=null;} // #2521 row 8a: another takeover armed has the panel; Make precise reopens from the strip
11789
12249
  if(memberEndScan){renderMemberEndScanPanel(p);return;}
11790
12250
  if(memberEndReview){renderMemberEndPanel(p);return;}
12251
+ if(makePrecise){renderMakePrecisePanel(p);return;}
11791
12252
  if(gridMode){renderGridPanel(p);return;}
11792
12253
  if(provisionalSelId){
11793
12254
  const member=selectedProvisionalTrace(provisionalMembersForActiveView(),provisionalSelId);
@@ -12631,7 +13092,8 @@ function panel(){
12631
13092
  // This note lives OUT here on purpose. It was first written as an HTML comment inside the template
12632
13093
  // below, where a backtick and a ${...} in the prose are not prose at all: they closed the literal and
12633
13094
  // the rest parsed as code. An HTML comment inside a template literal is still template text.
12634
- p.innerHTML=`<h3>Member ${esc(m.id)}</h3>
13095
+ p.innerHTML=`<h3>Member <span style="text-transform:none">${esc(m.id)}</span></h3>
13096
+ <div class="row hint" id=memberMark>${memberMarks(m.id).length?'Mark <b style="overflow-wrap:anywhere">'+esc(memberMarks(m.id).join(', '))+'</b>':'No mark'}</div>
12635
13097
  ${typeFilterHTML(arr)}
12636
13098
  ${memberTypeField('mTypeS',[m])}
12637
13099
  <div class="f"><div class=elab>Profile</div><div style="display:flex;gap:6px"><input data-command-id="steel.member-profile" aria-label="Profile" id=pf class=combo data-src=profiles value="${esc(m.profile)}" style="flex:1" autocomplete=off><button data-command-id="steel.browse-profile-catalog" id=profileBrowseS class=ghost aria-label="Search the profile catalog" data-tip="Search the profile catalog — 4,516 profiles, by designation or alias"><svg viewBox="0 0 16 16" aria-hidden=true width=13 height=13 fill=none stroke=currentColor stroke-width=1.4 stroke-linecap=round><circle cx="6.9" cy="6.9" r="4.3"/><path d="M10.1 10.1 13.7 13.7"/></svg></button><button data-command-id="steel.pick-profile" id=pickProf class="ghost${(picking&&pickKind==='profile')?' on':''}" aria-pressed="${(picking&&pickKind==='profile')?'true':'false'}" aria-label="Pick profile from a drawing label" data-tip="Pick profile from drawing labels by click, Enter, or Space">⌖</button></div>${(picking&&pickKind==='profile')?'<div class="hint" data-profile-pick-status role=status aria-live=polite style="margin-top:4px;font-style:italic;color:var(--brand)">'+esc(profilePickGuidance())+'</div>':''}</div>
@@ -13303,7 +13765,29 @@ function _len3dFt(m,ppf,dTos){
13303
13765
  * 2. The array length, checked alongside identity on every lookup.
13304
13766
  */
13305
13767
  let _v2MemberIndex=null,_v2MemberIndexFor=null,_v2MemberIndexLen=-1;
13306
- function v2InvalidateMemberIndex(){_v2MemberIndex=null;_v2MemberIndexFor=null;_v2MemberIndexLen=-1;}
13768
+ function v2InvalidateMemberIndex(){_v2MemberIndex=null;_v2MemberIndexFor=null;_v2MemberIndexLen=-1;_memberMarksIndex=null;}
13769
+ /*
13770
+ * #2948: the marks the drawings gave a member, which is NOT its id. A member's id (`c-A/3`, `m-beam-1`) is the
13771
+ * model's own name for it; a mark (`B202-49`) is what a drawing printed beside it, and many members have none.
13772
+ * The same rule as the server's `marksByMember` (server/steel-schedule-agreement.ts), which is what the AI chat
13773
+ * cites by: only an ACTIVE observation binding counts (a superseded one is what an earlier read believed), and
13774
+ * the mark is the observation's trimmed `evidence.observed.mark.value`. Exact repeats are dropped, order is the
13775
+ * plans' own. `steel-member-mark-ui.test.ts` holds the two to the same answer.
13776
+ * Indexed once per model state: rebuilt when the plans array is replaced, and on every command commit.
13777
+ */
13778
+ let _memberMarksIndex=null,_memberMarksFor=null;
13779
+ function memberMarks(id){
13780
+ if(id==null)return [];
13781
+ const plans=C.plans;
13782
+ if(_memberMarksIndex===null||_memberMarksFor!==plans){
13783
+ _memberMarksIndex=new Map();_memberMarksFor=plans;
13784
+ for(const plan of Array.isArray(plans)?plans:[])for(const o of (plan&&Array.isArray(plan.memberObservations))?plan.memberObservations:[]){
13785
+ const b=o&&o.binding,v=o&&o.evidence&&o.evidence.observed&&o.evidence.observed.mark&&o.evidence.observed.mark.value;
13786
+ if(!b||b.status!=='active'||!Array.isArray(b.memberIds)||typeof v!=='string'||!v.trim())continue;
13787
+ for(const mid of b.memberIds){if(typeof mid!=='string')continue;const set=_memberMarksIndex.get(mid)||new Set();set.add(v.trim());_memberMarksIndex.set(mid,set);}
13788
+ }
13789
+ }
13790
+ return [...(_memberMarksIndex.get(id)||[])];}
13307
13791
  function v2CanonicalMember(id){
13308
13792
  if(id==null)return undefined;
13309
13793
  const members=modelMembersV2();
@@ -13360,7 +13844,10 @@ function _lenFtLabel(m){
13360
13844
  const v=_lenFt(m);
13361
13845
  return (Number.isFinite(v)&&v>0)?v:undefined;}
13362
13846
  const PROP_DEFS=[
13363
- {key:'id', label:'Mark', get:m=>m.id, fmt:v=>v==null?'':String(v)},
13847
+ // #2948: the id is labelled ID, never Mark. The key stays `id`, so a label someone already picked still shows.
13848
+ {key:'id', label:'ID', get:m=>m.id, fmt:v=>v==null?'':String(v)},
13849
+ // A member the drawings gave no mark answers undefined, so no label chip and no view-query fact claim one.
13850
+ {key:'mark', label:'Mark', get:m=>{const k=memberMarks(m&&m.id);return k.length?k.join(', '):undefined;}, fmt:v=>v==null?'':String(v)},
13364
13851
  {key:'profile', label:'Profile', get:m=>m.profile, fmt:v=>v==null?'':String(v)},
13365
13852
  {key:'type', label:'Type', get:m=>memberTypeLabel(memberTypeOf(m)), fmt:v=>v==null?'':String(v)},
13366
13853
  {key:'role', label:'Role', get:m=>m.role==='column'?'Column':'Beam', fmt:v=>v||''},
@@ -24742,6 +25229,96 @@ const rfiElsewhereGroups=new Set();
24742
25229
  const rfiTechnicalOccurrences=new Set();
24743
25230
  const rfiTargetErrors=new Map();
24744
25231
  const rfiOccurrenceKey=(recordId,index)=>recordId+'\u0000'+index;
25232
+ /* ── Earlier rounds (#2470 R6.6d carve-out) ───────────────────────────────────────────────────────────────────────
25233
+ A reopened RFI — or one member of a grouped RFI — keeps every earlier round. The list carries only how many; the
25234
+ rounds load when the person opens them, oldest first, each as what happened in order. Keyed by record or occurrence,
25235
+ cached with the revision they were read at, never a failure. */
25236
+ const rfiRoundsOpen=new Set(),rfiRoundsCache=new Map();
25237
+ const rfiRoundsKey=(id,index)=>index==null?'record\u0000'+id:rfiOccurrenceKey(id,index);
25238
+ function rfiExactWhen(iso){const d=new Date(String(iso||''));return isNaN(d.getTime())?String(iso||''):d.toLocaleString(undefined,{weekday:'short',day:'numeric',month:'short',year:'numeric',hour:'2-digit',minute:'2-digit'});}
25239
+ /** A short date to read; the exact one to point at and for a screen reader. */
25240
+ function rfiDated(iso){return '<time datetime="'+esc(iso)+'" data-tip="'+esc(rfiExactWhen(iso))+'"><span aria-hidden="true">'+esc(rfiWhen(iso))+'</span><span class=sr-only>'+esc(rfiExactWhen(iso))+'</span></time>';}
25241
+ function rfiRoundEntryHtml(e){
25242
+ const line=t=>'<li>'+rfiDated(e.at)+' · '+t+'</li>';
25243
+ const email=e.group?' (one email for the whole RFI)':'';
25244
+ switch(e.t){
25245
+ case 'raised':return line('Filed: '+esc(e.question));
25246
+ case 'seen-again':return line('Seen again on a newer drawing: '+esc(e.question));
25247
+ case 'reopened':return line(e.why?'Reopened: '+esc(e.why):'Reopened.');
25248
+ case 'sent':return line((e.via==='gmail'?'Sent with Gmail to ':'Marked sent to ')+esc(e.to)+email);
25249
+ case 'answered':return line('Answer: '+esc(rfiAnswerText(e.answer)));
25250
+ case 'applied':return line('Recorded as applied to the model.');
25251
+ case 'closed':return line('Closed '+esc(rfiDispositionWords(e.disposition))+(e.note?' — '+esc(e.note):'.'));
25252
+ default:return '';
25253
+ }
25254
+ }
25255
+ /** The Earlier rounds toggle and, when open, its rounds — for a plain record (index null) or one grouped occurrence. */
25256
+ function rfiRoundsHtml(r,count,index){
25257
+ if(!count)return '';
25258
+ const key=rfiRoundsKey(r.id,index),open=rfiRoundsOpen.has(key);
25259
+ const bodyId='rfi-rounds-'+r.seq+(index==null?'':'-'+index);
25260
+ const label=r.id+(index==null?'':' — occurrence '+(index+1));
25261
+ const occ=index==null?'':' data-rfi-rounds-occ="'+index+'"';
25262
+ const toggle='<button class=ghost data-command-id="steel.rfi-earlier-rounds#'+esc(label)+'" data-command-instance-label="'+esc(label)+'" data-rfi-ctl="'+(index==null?'rounds':'occ:'+index+':rounds')+'" data-rfi-rounds="'+esc(r.id)+'"'+occ
25263
+ +' aria-expanded="'+open+'" aria-controls="'+bodyId+'" data-tip="What was asked, sent, answered and closed before this was reopened">Earlier rounds ('+count+')</button>';
25264
+ let body='';
25265
+ // A record's revision only rises, so rounds read at or after the list's revision are current for it.
25266
+ const got=rfiRoundsCache.get(key),fresh=got&&got.revision>=r.recordRevision?got:null;
25267
+ const busy=open&&(!fresh||fresh.status==='loading');
25268
+ // Open on an RFI the list says changed since its rounds were read, with nothing in flight: read them again.
25269
+ if(open&&!fresh&&!(got&&got.status==='loading'))queueMicrotask(()=>rfiLoadRounds(r.id,index,r.recordRevision));
25270
+ if(open){
25271
+ if(!fresh||fresh.status==='loading')body='<div class=rfinote role=status>Loading earlier rounds…</div>';
25272
+ else if(fresh.status==='error')body='<div class=rfinote role=status>'+esc(fresh.error)+'</div><div class=rfiacts><button class=ghost data-command-id="steel.rfi-earlier-rounds-again#'+esc(label)+'" data-command-instance-label="'+esc(label)+'" data-rfi-ctl="'+(index==null?'rounds-again':'occ:'+index+':rounds-again')+'" data-rfi-rounds-again="'+esc(r.id)+'"'+occ+'>Try again</button></div>';
25273
+ else if(!fresh.rounds.length)body='<div class=rfinote role=status>No earlier rounds were found for this RFI.</div>';
25274
+ else body='<ol class=rfirounds aria-label="'+esc('Earlier rounds of '+label)+'">'+fresh.rounds.map(rd=>{
25275
+ const first=rd.entries[0],how=first?(first.t==='reopened'?'Reopened ':first.t==='seen-again'?'Seen again ':'Filed ')+rfiDated(first.at):'';
25276
+ return '<li><div class=rfiround-head>Round '+rd.round+(how?' · '+how:'')+'</div><ul class=rfiround-entries>'+rd.entries.map(rfiRoundEntryHtml).join('')+'</ul></li>';
25277
+ }).join('')+'</ol>';
25278
+ }
25279
+ return '<div class=rfiacts>'+toggle+'</div><div id="'+bodyId+'" class=rfirounds-body'+(busy?' aria-busy="true"':'')+'>'+body+'</div>';
25280
+ }
25281
+ async function rfiLoadRounds(id,index,revision){
25282
+ const key=rfiRoundsKey(id,index);
25283
+ rfiRoundsCache.set(key,{status:'loading',revision});
25284
+ const project=PROJECT;
25285
+ try{
25286
+ const r=await fetch('/api/projects/'+encodeURIComponent(project)+'/rfis/'+encodeURIComponent(id)+'/rounds'+(index==null?'':'?occurrenceIndex='+index));
25287
+ const j=await r.json().catch(()=>({}));
25288
+ if(project!==PROJECT)return;
25289
+ if(!r.ok||!j||j.ok===false)rfiRoundsCache.set(key,{status:'error',revision,error:j&&typeof j.error==='string'&&j.error?j.error:'FloLess couldn’t load the earlier rounds just now.'});
25290
+ else{
25291
+ // Never below the revision asked for: an answer behind the list cannot start the reads over (Codex review).
25292
+ const read=Number.isSafeInteger(j.recordRevision)?Math.max(j.recordRevision,revision):revision;
25293
+ rfiRoundsCache.set(key,{status:'ready',revision:read,rounds:Array.isArray(j.rounds)?j.rounds:[]});
25294
+ // The rounds are newer than the list (changed elsewhere): read the list once, never the rounds again.
25295
+ const now=(rfiState.records||[]).find(x=>x&&x.id===id);
25296
+ if(now&&Number.isSafeInteger(now.recordRevision)&&now.recordRevision<read)void refreshRfiRecords();
25297
+ }
25298
+ }catch(_){
25299
+ if(project!==PROJECT)return;
25300
+ rfiRoundsCache.set(key,{status:'error',revision,error:'FloLess couldn’t load the earlier rounds just now.'});
25301
+ }
25302
+ if(!rfiOpen())return;
25303
+ // Back to the toggle only if the person is still on it (or on its Try again, gone while loading), and through the
25304
+ // guarded repaint, which yields to somebody typing on ANY row, this RFI's own included: a row's profile combo keeps
25305
+ // its text only in the DOM, and rounds landing are not an action on the row, so no row is exempt (Codex review).
25306
+ const at=document.activeElement,occ=index==null?null:String(index);
25307
+ const mine=at&&typeof at.getAttribute==='function'&&(at.getAttribute('data-rfi-rounds')===id||at.getAttribute('data-rfi-rounds-again')===id)&&at.getAttribute('data-rfi-rounds-occ')===occ;
25308
+ if(mine||!at||at===document.body)rfiFocusOverride={rows:[rfiRowKey('record',id)],ctl:index==null?'rounds':'occ:'+index+':rounds'};
25309
+ rfiSettleRepaint({force:true});
25310
+ }
25311
+ /** Open or close one Earlier rounds, reading the rounds the first time (or when the RFI changed since). */
25312
+ function rfiToggleRounds(id,index){
25313
+ const key=rfiRoundsKey(id,index);
25314
+ if(rfiRoundsOpen.has(key))rfiRoundsOpen.delete(key);
25315
+ else{
25316
+ rfiRoundsOpen.add(key);
25317
+ const r=(rfiState.records||[]).find(x=>x&&x.id===id),got=rfiRoundsCache.get(key);
25318
+ if(r&&!(got&&got.revision>=r.recordRevision&&got.status!=='error'))void rfiLoadRounds(id,index,r.recordRevision);
25319
+ }
25320
+ rfiFocusOverride={rows:[rfiRowKey('record',id)],ctl:index==null?'rounds':'occ:'+index+':rounds'};renderRfiList();
25321
+ }
24745
25322
 
24746
25323
  /* ── RFI actions and outcomes (#1090) ──────────────────────────────────────────────────────────────
24747
25324
  THE OUTCOME OF AN ACTION IS ITS OWN SURFACE, on its own branch. `paintRfiBanner` says what FloLess
@@ -24977,13 +25554,38 @@ function paintRfiStat(){
24977
25554
 
24978
25555
  const liveDrawingTargets=g=>{const rows=Array.isArray(g&&g.drawingTargets)&&g.drawingTargets.length?g.drawingTargets:g&&g.drawingTarget?[g.drawingTarget]:[];
24979
25556
  return rows.map(dt=>({where:'drawing',role:'member location',...dt}));};
25557
+ /** #2928: set once the page says it is leaving (`beforeunload`), so a read the browser cuts off on the way out
25558
+ * is not reported as a failure. See the catch in `refreshRfiRecords`. */
25559
+ let rfiPageLeaving=false;
25560
+ const RFI_LEAVE_GRACE_MS=3000;
25561
+ /** #2924: every records read has one owner that can cancel it, so a stalled read never keeps holding one of the
25562
+ * browser's six connections to FloLess. `rfiReadCtl` is the current read's: a newer read (or a merge that
25563
+ * supersedes it, see rfiMergeResponse) aborts it, and so does its own deadline. The deadline is longer than an RFI
25564
+ * action's (RFI_ACTION_TIMEOUT_MS): when FloLess stalls, the action's own recovery speaks first, and the list says it
25565
+ * stopped waiting only if it is still stuck after that. */
25566
+ let rfiReadCtl=null;
25567
+ const RFI_READ_DEADLINE_MS=45000;
25568
+ const RFI_READ_TIMEOUT_SAID='FloLess got no answer within '+Math.round(RFI_READ_DEADLINE_MS/1000)+' seconds, so it stopped waiting. Press Retry to read them again.';
25569
+ function rfiAbortRead(){if(rfiReadCtl){const c=rfiReadCtl;rfiReadCtl=null;c.abort();}}
24980
25570
  async function refreshRfiRecords(opts){
24981
25571
  if(!PROJECT){rfiState={status:'off',records:[],sizeTruth:'known',liveTruth:'known',detail:'',liveDetail:'',http:0,error:''};rfiTargetErrors.clear();paintRfiStat();if(rfiOpen())renderRfiList();return true;}
24982
25572
  const mine=++rfiFetchSeq;
25573
+ // The read this one supersedes is cancelled, not only ignored: its answer could never be shown anyway.
25574
+ rfiAbortRead();
25575
+ const ctl=new AbortController();rfiReadCtl=ctl;
25576
+ let late=false;
25577
+ // A caller's own signal (a chat mention's deadline, a row action) cancels this read, and its deadline is the one
25578
+ // that bounds it: an action's recovery read must not get a second deadline and a second, competing banner.
25579
+ const outer=opts&&opts.signal,follow=()=>ctl.abort();
25580
+ const deadline=outer?null:setTimeout(()=>{late=true;ctl.abort();},RFI_READ_DEADLINE_MS);
25581
+ if(outer){if(outer.aborted)ctl.abort();else outer.addEventListener('abort',follow,{once:true});}
24983
25582
  try{
24984
- const r=await fetch('/api/projects/'+encodeURIComponent(PROJECT)+'/rfis',{signal:opts&&opts.signal});
25583
+ const r=await fetch('/api/projects/'+encodeURIComponent(PROJECT)+'/rfis',{signal:ctl.signal});
24985
25584
  const j=await r.json().catch(()=>({}));
24986
25585
  if(mine!==rfiFetchSeq)return false; // a later read owns the state now — see rfiFetchSeq
25586
+ // The deadline can land while the body is read, which `.catch` above turns into an empty body: that is a
25587
+ // read that took too long, never a broken answer from the server.
25588
+ if(late)throw new Error('the RFI records read passed its deadline');
24987
25589
  rfiLiveContractHash=typeof j.liveContractHash==='string'?j.liveContractHash:'';
24988
25590
  const live=(Array.isArray(j.liveRfis)?j.liveRfis:[]).map(g=>{const subjects=g.subjects||[],targets=liveDrawingTargets(g),dt=targets[0];
24989
25591
  const ids=subjects.map(s=>s&&s.memberId).filter(Boolean),source=dt
@@ -25032,11 +25634,31 @@ async function refreshRfiRecords(opts){
25032
25634
  // FloLess disposed this editor (the project is being reopened or switched) and is replacing the frame, which cuts
25033
25635
  // off any read still in flight. Nobody is looking at this page any more, so that is not a failure to report.
25034
25636
  if(editorTerminalDisposed)return false;
25637
+ // #2928: a reload or a navigation away cuts the read off too, and in Chrome the rejection can land BEFORE
25638
+ // `pagehide` disposes the editor. Once the page has said it is leaving, wait: a page that really goes never
25639
+ // runs the timer, so nothing is reported; a page that is still here afterwards (the person stayed) reports
25640
+ // the failure as any other.
25641
+ if(rfiPageLeaving){
25642
+ await new Promise(r=>setTimeout(r,RFI_LEAVE_GRACE_MS));
25643
+ rfiPageLeaving=false; // the page is still here: it did not leave after all
25644
+ if(mine!==rfiFetchSeq||editorTerminalDisposed||(opts&&opts.signal&&opts.signal.aborted))return false;
25645
+ }
25646
+ // #2924: the read's own deadline stopped it. Said in plain words, with what to do; it is not a fault in the page.
25647
+ if(late){
25648
+ console.warn('[steel] the filed RFIs read took too long and was stopped');
25649
+ rfiState={status:'fail',records:[],sizeTruth:'known',liveTruth:'known',detail:'',liveDetail:'',http:0,error:RFI_READ_TIMEOUT_SAID};
25650
+ }else{
25035
25651
  // Bind and log it. A dead server, a DNS failure and a TypeError thrown by our own code inside the
25036
25652
  // try all render the same banner, and a bug report cannot tell them apart from that banner alone.
25037
25653
  console.error('[steel] could not read the filed RFIs', e);
25038
25654
  rfiState={status:'fail',records:[],sizeTruth:'known',liveTruth:'known',detail:'',liveDetail:'',http:0,
25039
25655
  error:String((e&&e.message)||'')};
25656
+ }
25657
+ }finally{
25658
+ // Every way out of the read ends what it owned: its deadline, its link to the caller's signal, and its slot.
25659
+ clearTimeout(deadline);
25660
+ if(outer)outer.removeEventListener('abort',follow);
25661
+ if(rfiReadCtl===ctl)rfiReadCtl=null;
25040
25662
  }
25041
25663
  rfiRecordsSeq++;
25042
25664
  if(rfiState.status==='ok')rfiPruneTargetErrors();
@@ -25738,7 +26360,7 @@ function rfiDeadline(ms){
25738
26360
  }
25739
26361
  // Leaving the page has no UI left to recover into. Retire every request and, through `cancelled()`,
25740
26362
  // prevent its rejection from starting a fresh RFI read during teardown.
25741
- window.addEventListener('beforeunload',()=>{for(const deadline of [...rfiDeadlines])deadline.abort();uncertainWrites.clear();});
26363
+ window.addEventListener('beforeunload',()=>{rfiPageLeaving=true;for(const deadline of [...rfiDeadlines])deadline.abort();uncertainWrites.clear();});
25742
26364
 
25743
26365
  /** Take whatever a response gave us of the record. It rides out on a NON-2xx only through the
25744
26366
  * reconcile arm — every other refusal sends a bare `{ok,code,error}`, which is why rules below
@@ -25758,7 +26380,8 @@ function rfiMergeResponse(j){
25758
26380
  // assumed: a truth that flipped to `unavailable` would otherwise leave Apply and `resolved` offered.
25759
26381
  if(j&&(j.sizeTruth==='known'||j.sizeTruth==='unavailable'))rfiState={...rfiState,sizeTruth:j.sizeTruth};
25760
26382
  if(merged){
25761
- rfiFetchSeq++;rfiRecordsSeq++;rfiPruneTargetErrors();paintRfiStat();rfiRepaintHeightNotes();
26383
+ // #2924: the read this merge supersedes is cancelled too, so it stops holding a connection.
26384
+ rfiFetchSeq++;rfiRecordsSeq++;rfiPruneTargetErrors();paintRfiStat();rfiRepaintHeightNotes();rfiAbortRead();
25762
26385
  // The bump above cancels any read still in flight. If one of those owned the `loading` transition
25763
26386
  // that Retry started, nothing would ever end it — `openRFI` will not re-read while `loading` and
25764
26387
  // the loading banner offers no Retry, so the dialog sticks with no way out.
@@ -27117,6 +27740,7 @@ function rfiTargetControls(r,occurrenceIndex){
27117
27740
  const EDITOR_FOCUS_3D_WAIT_MS=20000;
27118
27741
  /** The last-resort sentence when showing what was asked for failed in a way the runner did not foresee. */
27119
27742
  function editorFocusFailed(req){
27743
+ if(req.makePrecise)return 'FloLess could not open Make precise. Press Open Make precise again, or press Make precise on the AI decisions strip.';
27120
27744
  if(req.rfiId)return 'FloLess could not show '+req.rfiId+'. Find it on the RFIs page, or press it in the chat again.';
27121
27745
  return req.memberId?'The model could not show member '+req.memberId+'. Press Show in the model again, or find it in the Model panel.'
27122
27746
  :'The model could not show connection '+req.jointId+'. Press Open in the model again, or find it in the Model panel.';
@@ -27185,7 +27809,29 @@ async function runRfiFocus(rfiId,current){
27185
27809
  const shown=_rfiByAttr(document.getElementById('rfiList'),'data-rfi-row',rfiRowKey('record',rfiId));if(shown)shown.classList.remove('is-mentioned');},2400);
27186
27810
  return widened?{ok:true,said:'Showing all RFIs, so '+rfiId+' is in view.'}:{ok:true};
27187
27811
  }
27812
+ /**
27813
+ * #2521 row 9: the chat's "Open Make precise" opens the panel itself, as the strip's button does. It only opens it:
27814
+ * every confirm stays the person's click. It waits for the saved model's verdict (the strip offers Make precise only
27815
+ * for a Quick model) and says, in a sentence, why it did not open.
27816
+ */
27817
+ async function runMakePreciseFocus(current){
27818
+ const until=Date.now()+EDITOR_FOCUS_3D_WAIT_MS;
27819
+ while(lastSavedVerdict===undefined&&Date.now()<until){await new Promise(resolve=>setTimeout(resolve,100));if(!current())return null;}
27820
+ if(!current())return null; // replaced before it started, with the verdict already known: open nothing over the newer request
27821
+ const refuse=said=>{answerToast(said);return {ok:false,said};};
27822
+ if(lastSavedVerdict===undefined)return refuse('FloLess is still checking whether this model has AI decisions, so Make precise did not open. Wait a moment, then press Open Make precise again.');
27823
+ if(lastSavedVerdict===null)return refuse('This model is precise as last saved: no AI decision it rests on is left to review.');
27824
+ if(lastSavedVerdict.state!=='quick')return refuse('FloLess could not read the AI decisions in this model, so Make precise did not open. Reopen the Model step, then press Open Make precise again.');
27825
+ openMakePrecise();
27826
+ if(makePrecise)return {ok:true};
27827
+ // The member-end review asks first, on screen, and opens Make precise once the person answers.
27828
+ if(memberEndReview&&memberEndReview.leaving&&memberEndReview.leaving.name==='Make precise')return {ok:true};
27829
+ // Otherwise the member-end review said why where the person is looking (memberEndYieldPanel); the card says the same.
27830
+ if(memberEndReview&&memberEndReview.busy)return {ok:false,said:'Make precise could not open because a member-end change is still being applied. Press Open Make precise again when it finishes.'};
27831
+ return {ok:false,said:'Make precise could not open because a check on the member ends is still running. Press Open Make precise again when it finishes.'};
27832
+ }
27188
27833
  async function runEditorFocus(req,current){
27834
+ if(req.makePrecise)return runMakePreciseFocus(current);
27189
27835
  if(req.rfiId)return runRfiFocus(req.rfiId,current);
27190
27836
  const until=Date.now()+EDITOR_FOCUS_3D_WAIT_MS;
27191
27837
  while(!window.Steel3DView&&Date.now()<until){await new Promise(resolve=>setTimeout(resolve,100));if(!current())return null;}
@@ -27416,6 +28062,8 @@ function steelViewCandidates(){
27416
28062
  for(const def of PROP_DEFS){
27417
28063
  // A row the panel withholds (a plan-derived default) is not a value to match on.
27418
28064
  if(def.needsPlan&&!def.canonicalGet)continue;
28065
+ // #2948: each mark the drawings gave is its own value, so Mark eq "B7" finds a member marked both B7 and X9.
28066
+ if(def.key==='mark'){for(const k of memberMarks(m.id))add(def.label,k);continue;}
27419
28067
  let raw,shown;
27420
28068
  try{raw=def.needsPlan?def.canonicalGet(m):(def.labelGet||def.get)(m);if(raw===undefined||raw===null)continue;shown=def.fmt(raw);}
27421
28069
  catch(_){continue;}
@@ -27657,6 +28305,8 @@ function rfiGroupedRecordRowHtml(r){
27657
28305
  const error=rfiTargetErrors.get(key);
27658
28306
  return '<li class=rfioccurrence data-rfi-occurrence="'+index+'"><article aria-labelledby="rfi-occ-'+r.seq+'-'+index+'"><div class=rfioccurrence-head><span class="rfioccurrence-title rfimeta"><h4 id="rfi-occ-'+r.seq+'-'+index+'" tabindex="-1">Occurrence '+(index+1)+' of '+count+' — '+esc(rfiGroupedOccurrenceSubject(occ))+'</h4>'+rfiAiMark(occ.latestBy)+'</span><span class="rfikind '+rfiStatusTone(occ)+'">'+esc(rfiStatusWords(occ))+'</span></div>'
27659
28307
  +'<div class=rfinote>'+esc(occ.question)+(sheets?' · '+esc(sheets):'')+'</div>'
28308
+ +(occ.reopened?'<div class=rfinote>Reopened '+rfiDated(occ.reopened.at)+(occ.reopened.why?': '+esc(occ.reopened.why):'.')+'</div>':'')
28309
+ +rfiRoundsHtml(r,occ.earlierRounds,index)
27660
28310
  +(error?'<div class=rfifail role=alert>'+esc(error.message)+'</div>':'')
27661
28311
  +(occurrenceForm?rfiFormHtml(view,'occurrence '+(index+1)+' of '+count,rowKey):(formOpen?'':'<div class=rfiacts>'+rfiGroupedOccurrenceVerbs(r,occ,rowBusy)+targets+'</div>'))
27662
28312
  +'<div class=rfitechnical><button class=ghost data-command-id="steel.rfi-technical#'+esc(r.id+' occurrence '+(index+1))+'" data-command-instance-label="'+esc(r.id+' — occurrence '+(index+1))+'" data-rfi-ctl="occ:'+index+':technical" data-rfi-technical="'+index+'" data-rfi-on="'+esc(r.id)+'" aria-expanded="'+technical+'" aria-controls="rfi-tech-'+r.seq+'-'+index+'">Technical details</button>'
@@ -27665,12 +28315,23 @@ function rfiGroupedRecordRowHtml(r){
27665
28315
  :'<ol id="'+panelId+'" class=rfioccurrences aria-label="Occurrences in '+esc(r.id)+'" hidden></ol>';
27666
28316
  const sheetSummary=rfiScope==='sheet'?matching.length+' of '+count+' occurrences on this sheet · ':'';
27667
28317
  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>'
27668
- +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>'
28318
+ +esc(r.question||'This grouped RFI records no question.')+'<div class=rfimeta><span>'+esc(r.id)+'</span>'+rfiFiledByYou(r)+'<span>'+esc(rfiStatusWords(r))+'</span><span>'+sheetSummary+count+' occurrences · '+r.counts.sheets+' sheets · '+r.counts.entities+' members/connections</span></div>'
27669
28319
  +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>'))
27670
28320
  +'<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>'
27671
28321
  +(formOpen?'':rfiOutcomeHtml(rowKey))+occurrences+'</div></div>';
27672
28322
  }
27673
28323
 
28324
+ /* #2925 — "Filed by you" on an RFI a person filed (from "From the read, not filed", or raised from the model): the
28325
+ record's FIRST event is the person's. Reader-filed rows carry no chip. Short date on the chip, the exact time in the
28326
+ tooltip and the accessible name, so keyboard and touch users get the date without hovering. */
28327
+ function rfiFiledByYou(r){
28328
+ if(!r||r.raisedBy!=='user'||typeof r.raisedAt!=='string'||Number.isNaN(Date.parse(r.raisedAt)))return '';
28329
+ const at=new Date(r.raisedAt),now=new Date();
28330
+ const day=at.toDateString()===now.toDateString()?'today'
28331
+ :at.toLocaleDateString(undefined,at.getFullYear()===now.getFullYear()?{day:'numeric',month:'short'}:{day:'numeric',month:'short',year:'numeric'});
28332
+ const full='Filed by you on '+at.toLocaleString(undefined,{weekday:'short',day:'numeric',month:'short',year:'numeric',hour:'2-digit',minute:'2-digit'});
28333
+ return '<span class=rfifiled tabindex="0" data-command-id="steel.rfi-filed-by#'+esc(r.id)+'" data-command-instance-label="'+esc(r.id)+'" aria-label="'+esc(full)+'" data-tip="'+esc(full)+'">Filed by you · '+esc(day)+'</span>';
28334
+ }
27674
28335
  /* #2521 row 3b-2 — "AI" beside a proposal the AI wrote (the sighting's `latestBy`), in a Quick model. Not
27675
28336
  for `raisedBy` alone: a later sighting by a guided read carries its own proposal and no AI mark. */
27676
28337
  const RFI_AI_TIP='Proposed by the AI in a Quick model: this answer is the AI\'s decision, not a person\'s.';
@@ -27878,7 +28539,7 @@ function rfiRecordRowHtml(r){
27878
28539
  +rfiElevationControls(rowKey,r.id,g)
27879
28540
  +'<div class=rfiacts>'+copy+targets+'</div></div></div>';
27880
28541
  }
27881
- const meta=[rfiAiMark(r.latestBy),'<span>'+esc(r.id)+'</span>','<span>'+esc(rfiStatusWords(r))+'</span>']
28542
+ const meta=[rfiAiMark(r.latestBy),'<span>'+esc(r.id)+'</span>',rfiFiledByYou(r),'<span>'+esc(rfiStatusWords(r))+'</span>']
27882
28543
  .concat(ids.slice(0,6).map(id=>'<span>'+esc(id)+'</span>'))
27883
28544
  .concat(sheets.map(sh=>'<span>Sheet '+esc(sh)+'</span>'))
27884
28545
  .join('');
@@ -27899,6 +28560,8 @@ function rfiRecordRowHtml(r){
27899
28560
  if(r.applied)notes.push('Recorded as applied to the model on '+esc(rfiWhen(r.applied.at))+'.');
27900
28561
  if(r.closed)notes.push('Closed '+esc(rfiDispositionWords(r.closed.disposition))
27901
28562
  +' on '+esc(rfiWhen(r.closed.at))+(r.closed.note?' — '+esc(rfiSentence(r.closed.note)):'.'));
28563
+ // #2470 R6.6d: why the current round is open again.
28564
+ if(r.reopened)notes.push('Reopened '+rfiDated(r.reopened.at)+(r.reopened.why?': '+esc(rfiSentence(r.reopened.why)):'.'));
27902
28565
  // #2521 row 3b-2: the AI's recommendation. Not "built on": a question about an unbuilt connection or an unresolved
27903
28566
  // placement was never applied, and a later edit can change the model (Codex review).
27904
28567
  if(r.proposed)notes.push(r.latestBy==='ai'?'The AI’s proposed answer: '+esc(rfiSentence(r.proposed))
@@ -27980,6 +28643,7 @@ function rfiRecordRowHtml(r){
27980
28643
  +esc(r.question||'This RFI records no question.')
27981
28644
  +'<div class=rfimeta>'+meta+'</div>'
27982
28645
  +(notes.length?'<div class=rfinote>'+notes.join(' ')+'</div>':'')
28646
+ +rfiRoundsHtml(r,r.earlierRounds,null)
27983
28647
  +(profileMismatch?'<div class=rfinote role="note" data-rfi-profile-truth>'+esc(rfiProfileTruthMessage(profileMismatch))+'</div>':'')
27984
28648
  +(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>':'')
27985
28649
  +(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>':'')
@@ -28277,6 +28941,12 @@ function wireRfiList(){
28277
28941
  root.querySelectorAll('[data-rfi-read-raise]').forEach(b=>b.onclick=()=>{const k=b.dataset.rfiReadRaise;return Promise.resolve(rfiReadRaise([k],false,'read:'+k)).catch(rfiGestureFailure);});
28278
28942
  root.querySelectorAll('[data-rfi-read-raise-all]').forEach(b=>b.onclick=()=>{const kind=b.dataset.rfiReadRaiseAll,g=rfiReadGroups().find(x=>x.kind===kind);if(!g)return;return Promise.resolve(rfiReadRaise(g.rows.map(q=>q.gapKey),true,'readgroup:'+kind)).catch(rfiGestureFailure);});
28279
28943
  root.querySelectorAll('[data-rfi-read-toggle]').forEach(b=>b.onclick=()=>{const kind=b.dataset.rfiReadToggle;if(rfiReadOpenKinds.has(kind))rfiReadOpenKinds.delete(kind);else rfiReadOpenKinds.add(kind);rfiFocusOverride={rows:['readgroup:'+kind],ctl:'read-toggle'};renderRfiList();});
28944
+ // #2470 R6.6d: Earlier rounds, on a record or on one occurrence of a grouped record.
28945
+ root.querySelectorAll('[data-rfi-rounds]').forEach(b=>b.onclick=()=>rfiToggleRounds(b.dataset.rfiRounds,b.dataset.rfiRoundsOcc==null?null:Number(b.dataset.rfiRoundsOcc)));
28946
+ root.querySelectorAll('[data-rfi-rounds-again]').forEach(b=>b.onclick=()=>{const id=b.dataset.rfiRoundsAgain,index=b.dataset.rfiRoundsOcc==null?null:Number(b.dataset.rfiRoundsOcc);
28947
+ const r=(rfiState.records||[]).find(x=>x&&x.id===id);if(r)void rfiLoadRounds(id,index,r.recordRevision);
28948
+ // Try again is gone while it loads: keep focus on the toggle it belongs to.
28949
+ rfiFocusOverride={rows:[rfiRowKey('record',id)],ctl:index==null?'rounds':'occ:'+index+':rounds'};renderRfiList();});
28280
28950
  root.querySelectorAll('[data-rfi-expand]').forEach(b=>b.onclick=()=>{
28281
28951
  const id=b.dataset.rfiExpand;if(rfiExpandedGroups.has(id))rfiExpandedGroups.delete(id);else rfiExpandedGroups.add(id);
28282
28952
  rfiFocusOverride={rows:[rfiRowKey('record',id)],ctl:'expand'};renderRfiList();});
@@ -31916,7 +32586,8 @@ boot().catch(err => { EditorFocus.fail('The model did not open, so the connectio
31916
32586
  // data-tip hover after a short delay, positioned below the control and clamped to the viewport. A function of
31917
32587
  // its document because the 3D panel's tabs can live in a second one: the left Model section's host frame.
31918
32588
  function installThemedTips(doc){ const win=doc.defaultView||window; const tip=doc.createElement('div'); tip.id='tooltip'; doc.body.appendChild(tip); let t=null;
31919
- function show(el){ if(el.getAttribute('aria-haspopup')==='menu'&&el.getAttribute('aria-expanded')==='true')return; // an opening trigger can still have a pending hover timer; never let its tip cover the menu below it
32589
+ function show(el){ if(!el.isConnected)return; // a panel that re-rendered under the pointer replaced it: its box is gone, so the tip would sit at the window's corner
32590
+ if(el.getAttribute('aria-haspopup')==='menu'&&el.getAttribute('aria-expanded')==='true')return; // an opening trigger can still have a pending hover timer; never let its tip cover the menu below it
31920
32591
  const txt=el.getAttribute('data-tip'); if(!txt) return; tip.textContent=txt; tip.classList.add('show');
31921
32592
  const r=el.getBoundingClientRect(), tw=tip.offsetWidth, th=tip.offsetHeight;
31922
32593
  let x=Math.max(6,Math.min(r.left+r.width/2-tw/2, win.innerWidth-tw-6)), y=r.bottom+6; if(y+th>win.innerHeight-6) y=r.top-th-6;
@@ -31925,6 +32596,10 @@ function installThemedTips(doc){ const win=doc.defaultView||window; const tip=do
31925
32596
  doc.addEventListener('pointerover', e=>{ const el=e.target.closest('[data-tip]'); if(!el) return; clearTimeout(t); t=setTimeout(()=>show(el),400); });
31926
32597
  doc.addEventListener('pointerout', e=>{ if(e.target.closest('[data-tip]')) hide(); });
31927
32598
  doc.addEventListener('pointerdown', hide, true); // a click hides the tip immediately
32599
+ // #2925: a focusable RFI label ("Filed by you", the AI mark) has nothing to click, so its tip is its whole content;
32600
+ // a keyboard user gets it on focus too. Scoped to those labels: buttons keep their pointer-only tips.
32601
+ doc.addEventListener('focusin', e=>{ const el=e.target.closest&&e.target.closest('.rfimeta [data-tip][tabindex]'); if(el&&el.matches(':focus-visible')){ clearTimeout(t); show(el); } });
32602
+ doc.addEventListener('focusout', e=>{ if(e.target.closest&&e.target.closest('.rfimeta [data-tip][tabindex]')) hide(); });
31928
32603
  // Programmatic access for canvas handles (the 3D gizmo has no DOM to carry data-tip). Same shared themed
31929
32604
  // #tooltip element, positioned at a client point, clamped to the viewport — so a WebGL handle's tooltip is
31930
32605
  // themed exactly like every toolbar tip and never a native light title=. showText hides on the next hover-out