@floless/app 0.166.0 → 0.167.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.
@@ -1959,6 +1959,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1959
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
1960
  #panel .mp-chose>span{min-width:0;overflow-wrap:anywhere}
1961
1961
  #panel .mp-chose b{color:var(--text);font-weight:600}
1962
+ #panel .mp-chose b.ai-restated{text-decoration:underline dotted var(--mut);text-underline-offset:2px;cursor:help} /* #2998: shown in project units; the tip says what the AI wrote */
1962
1963
  #panel .mp-confirm{flex:none;font-size:11px;padding:4px 10px}
1963
1964
  #panel .mp-chose{flex-wrap:wrap}
1964
1965
  #panel .mp-acts{display:flex;flex:none;flex-wrap:wrap;gap:6px;margin-left:auto}
@@ -2892,6 +2893,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
2892
2893
  #m3dLegend .lsearch .lsx:hover{color:#fecaca;background:#7f1d1d}
2893
2894
  #m3dLegend .lrow.qhide,#m3dLegend .cat-hdr.qhide{display:none} /* filtered OUT by search → gone (distinct from .off = hidden-in-3D, which only dims the swatch) */
2894
2895
  #m3dLegend .lsempty{color:var(--mut);font-size:11px;padding:10px 4px;text-align:center}
2896
+ #m3dLegend .lidhit{color:var(--mut);font-size:11px;margin-left:2px;min-width:0;overflow:hidden;text-overflow:ellipsis} /* #2998: the member id a search matched, after a profile row's label */
2895
2897
  /* Show-all reset bar — panel-local entry to showAllGroups(); shown only when something is hidden/isolated. Clones the
2896
2898
  .lsearch full-width box recipe; brand border on hover only (a one-shot action, not a mode → no solid fill). */
2897
2899
  #m3dLegend .lreset{display:none;align-items:center;justify-content:center;gap:6px;height:26px;margin-bottom:6px;background:var(--bg);border:1px solid var(--line);border-radius:6px;color:var(--text);font:12px var(--ui);cursor:pointer;flex:none;user-select:none}
@@ -5561,9 +5563,19 @@ function aiMarksInner(){
5561
5563
  }
5562
5564
  function aiPlanLabel(viewId){const plan=(C.plans||[]).find(p=>V2Projection.planViewId(p)===viewId);return plan?String(plan.title||plan.sheet||viewId):String(viewId);}
5563
5565
  /* The record's words for one decision, when FloLess has read them: what was chosen, why, and how sure the AI was. */
5564
- function aiChosenText(id,marks){
5566
+ // #2998: a length the AI wrote in the other unit system is shown in the project's (decisionChoiceInUnits); what it
5567
+ // actually wrote goes into `wrote`, for the row's tooltip.
5568
+ function aiChosenWords(chosen,value,wrote){
5569
+ const said=AiMarks&&chosen?AiMarks.decisionChoiceInUnits(chosen,value,displayUnits()):{text:chosen||''};
5570
+ if(said.wrote&&wrote)wrote.push(said.wrote);
5571
+ return said.text;
5572
+ }
5573
+ const aiWroteTip=wrote=>wrote.length?'Shown in this project’s units. The AI wrote '+[...new Set(wrote)].join(', ')+'.':'';
5574
+ // The tip on hover, and the same words for a screen reader, which never sees a data-tip.
5575
+ function aiWroteMark(el,wrote){if(!wrote.length)return;const tip=aiWroteTip(wrote);el.dataset.tip=tip;el.appendChild(Object.assign(document.createElement('span'),{className:'sr-only',textContent:' '+tip}));}
5576
+ function aiChosenText(id,marks,wrote){
5565
5577
  const entry=marks.entries.get(id),rec=aiRecord.rows.get(id);
5566
- const chosen=(entry&&typeof entry.chosen==='string'&&entry.chosen)||(rec&&rec.chosen)||'';
5578
+ const chosen=aiChosenWords((entry&&typeof entry.chosen==='string'&&entry.chosen)||(rec&&rec.chosen)||'',(entry&&entry.value)||(rec&&rec.value),wrote);
5567
5579
  let t=chosen?'the AI chose '+chosen:'the AI decided it';
5568
5580
  if(rec&&rec.why)t+=' (why: '+String(rec.why).replace(/\.\s*$/,'')+(rec.confidence?'; '+rec.confidence+' confidence':'')+')';
5569
5581
  else if(!AI_DECISION_ID.test(id))t+=' (FloLess cannot read this decision’s id, so it cannot say why)';
@@ -5574,11 +5586,12 @@ function aiChosenText(id,marks){
5574
5586
  if(at)t+=(note===undefined?', reviewed by you':', changed by you')+(mpDate(at)?' on '+mpDate(at):'')+(note?' ('+note.replace(/\.\s*$/,'')+')':'');
5575
5587
  return t;
5576
5588
  }
5577
- function aiNoteText(item,marks){
5578
- const entry=item.decisionId?marks.entries.get(item.decisionId):null,chosen=entry&&entry.chosen?': '+entry.chosen:'';
5589
+ function aiNoteText(item,marks,wrote){
5590
+ const entry=item.decisionId?marks.entries.get(item.decisionId):null,chosen=entry&&entry.chosen?': '+aiChosenWords(entry.chosen,entry.value,wrote):'';
5579
5591
  if(item.reason==='unreadable')return'An AI decision FloLess could not read.';
5580
5592
  switch(item.channel){
5581
5593
  case'filter':return'The Drawing Filter (which sheets and areas the read used) was chosen by the AI'+chosen+'. Every member rests on that choice.';
5594
+ case'scope':return'The drawing set was too large to read at once, so the AI chose which files to read'+chosen+'. The model covers only those files.';
5582
5595
  case'setup-origin':return'The model origin was chosen by the AI'+chosen+'. Every member’s position rests on it.';
5583
5596
  case'audit-gap':return'The AI settled a question the drawings left open'+chosen+'.';
5584
5597
  case'unmodelled-detail':return'The AI left a detail unmodelled'+chosen+'.';
@@ -5615,8 +5628,8 @@ function renderAiStrip(){
5615
5628
  const chip=span('chip assumed','AI chose this view’s '+rows.map(r=>r==='scale'?'scale':'level').join(' and '));
5616
5629
  chip.tabIndex=0;chip.setAttribute('role','note');
5617
5630
  chip.setAttribute('data-command-id','steel.ai-decision-view-note#'+vid);chip.setAttribute('data-command-instance-label',aiPlanLabel(vid));
5618
- const said=viewRows.map(v=>'its '+(v.row==='scale'?'drawing scale':'level')+(marks.entries.get(v.decisionId)&&marks.entries.get(v.decisionId).chosen?' ('+marks.entries.get(v.decisionId).chosen+')':'')).join(' and ');
5619
- const tip='The AI decided '+said+' for '+aiPlanLabel(vid)+'. Every member drawn on this view rests on that choice, and Inspect says so for each. Not reviewed.';
5631
+ const wrote=[],said=viewRows.map(v=>{const e=marks.entries.get(v.decisionId);return 'its '+(v.row==='scale'?'drawing scale':'level')+(e&&e.chosen?' ('+aiChosenWords(e.chosen,e.value,wrote)+')':'');}).join(' and ');
5632
+ const tip='The AI decided '+said+' for '+aiPlanLabel(vid)+'. Every member drawn on this view rests on that choice, and Inspect says so for each. Not reviewed.'+(wrote.length?' '+aiWroteTip(wrote):'');
5620
5633
  chip.setAttribute('data-tip',tip);chip.setAttribute('aria-label',tip);
5621
5634
  line.appendChild(chip);
5622
5635
  }
@@ -5639,7 +5652,7 @@ function renderAiStrip(){
5639
5652
  line.appendChild(more);
5640
5653
  if(aiStripOpen){
5641
5654
  const d=document.createElement('div');d.className='ai-details';d.id='aiStripDetails';
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);}
5655
+ if(marks.model.length){const ul=document.createElement('ul');for(const item of marks.model){const li=document.createElement('li'),wrote=[];li.textContent=aiNoteText(item,marks,wrote);aiWroteMark(li,wrote);ul.appendChild(li);}d.appendChild(ul);}
5643
5656
  const n=marks.decisionCount;
5644
5657
  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. ')
5645
5658
  +'The marks follow your current edits; the Quick model label describes the model as last saved. '
@@ -5670,18 +5683,19 @@ function fillAiNote(box,m,canonical,list,marks){
5670
5683
  const chip=document.createElement('span');chip.className='chip assumed';chip.textContent='AI decision';
5671
5684
  const b=document.createElement('b');b.textContent='Rests on AI decisions';head.append(chip,b);box.appendChild(head);
5672
5685
  for(const mark of list){
5673
- const row=document.createElement('div');row.className='ai-row';
5686
+ const row=document.createElement('div'),wrote=[];row.className='ai-row';
5674
5687
  if(mark.kind==='height'){
5675
5688
  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)
5676
5689
  const word=aiEndWord(m.role,mark.end),n=mark.decisionIds.length;
5677
5690
  row.textContent=word.charAt(0).toUpperCase()+word.slice(1)+' height'+(now?' '+now:'')+' rests on '+(n===1?'an AI decision':n+' AI decisions')
5678
- +(mark.derived?', derived from '+(n===1?'it':'them')+' by a copy, split or merge':'')+': '+mark.decisionIds.map(id=>aiChosenText(id,marks)).join('; ')+'.';
5691
+ +(mark.derived?', derived from '+(n===1?'it':'them')+' by a copy, split or merge':'')+': '+mark.decisionIds.map(id=>aiChosenText(id,marks,wrote)).join('; ')+'.';
5679
5692
  }else if(mark.kind==='connection'){
5680
5693
  const joint=(C.joints||[]).find(j=>j&&j.id===mark.jointId);
5681
- row.textContent='Its connection '+String(joint&&joint.name||mark.jointId)+' rests on an AI assumption: '+aiChosenText(mark.decisionId,marks)+'.';
5694
+ row.textContent='Its connection '+String(joint&&joint.name||mark.jointId)+' rests on an AI assumption: '+aiChosenText(mark.decisionId,marks,wrote)+'.';
5682
5695
  }else{
5683
- row.textContent='Drawn on '+aiPlanLabel(mark.viewId)+', whose '+(mark.row==='scale'?'drawing scale':'level')+' the AI decided: '+aiChosenText(mark.decisionId,marks)+'.';
5696
+ row.textContent='Drawn on '+aiPlanLabel(mark.viewId)+', whose '+(mark.row==='scale'?'drawing scale':'level')+' the AI decided: '+aiChosenText(mark.decisionId,marks,wrote)+'.';
5684
5697
  }
5698
+ aiWroteMark(row,wrote);
5685
5699
  box.appendChild(row);
5686
5700
  }
5687
5701
  const foot=document.createElement('div');foot.className='ai-foot';
@@ -5999,7 +6013,8 @@ function renderMakePrecisePanel(p){
5999
6013
  :`<div class=mp-q-text>${qHtml}</div>`;
6000
6014
  const marking=!!(state.mark&&state.mark.id===c.decisionId);
6001
6015
  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>`;
6016
+ const chWrote=[],chText=aiChosenWords(c.chosen,c.value,chWrote);
6017
+ html+=`<div class=mp-chose><span>The AI chose: <b${chWrote.length?` class=ai-restated data-tip="${esc(aiWroteTip(chWrote))}"`:''}>${esc(chText||'(not recorded)')}</b>${chWrote.length?`<span class=sr-only> ${esc(aiWroteTip(chWrote))}</span>`:''}</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
6018
  if(!c.confirmable&&c.notConfirmable)html+=`<div class="hint mp-why-not">${esc(c.notConfirmable)}</div>`;
6004
6019
  if(c.confirmable&&!c.canMarkChanged&&!c.canEditHeight&&c.channel==='setup')html+=`<div class="hint mp-why-not">${esc(MP_FIXED_SETUP)}</div>`;
6005
6020
  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>`
@@ -18053,6 +18068,7 @@ let legendMode=(localStorage.getItem('floless.legendMode')==='type')?'type':'pro
18053
18068
  legMenu.addEventListener('keydown',e=>menuKeys(e,legMenu,legBtn,legClose));
18054
18069
  let collapsedCats=new Set((()=>{try{return JSON.parse(localStorage.getItem('floless.legendCollapsed')||'[]');}catch{return [];}})());
18055
18070
  let legendQuery=''; // transient objects-list search filter (members + connections only) — NOT persisted
18071
+ let legendIdHits=[]; // #2998: the member ids the current search matched by id (applyLegendFilter); one → Enter selects it
18056
18072
  // While a search is active, object categories (member types + connections) render EXPANDED so a match inside a
18057
18073
  // manually-collapsed category still surfaces — WITHOUT mutating the persisted collapsedCats.
18058
18074
  function catForceOpen(cat){return !!legendQuery&&(cat==='placed-details'||memberTypeRecords().some(t=>t.k===cat)||/^conn-/.test(cat));}
@@ -23040,7 +23056,8 @@ function build3DLegend(){const host=legendBody('objects'),vis=legendVis(),in3d=l
23040
23056
  const inp=document.createElement('input');inp.id='legSearch';inp.type='text';inp.placeholder='Search objects…';inp.autocomplete='off';inp.value=legendQuery;inp.setAttribute('role','searchbox');inp.setAttribute('aria-label','Search objects in the list');
23041
23057
  const clr=Object.assign(document.createElement('span'),{className:'lsx',textContent:'×'});clr.dataset.tip='Clear';
23042
23058
  inp.addEventListener('input',()=>onLegendSearchInput(inp.value));
23043
- inp.addEventListener('keydown',e=>{if(e.key==='Escape'){e.stopPropagation();if(inp.value){inp.value='';onLegendSearchInput('');}else{inp.blur();}}});
23059
+ inp.addEventListener('keydown',e=>{if(e.key==='Escape'){e.stopPropagation();if(inp.value){inp.value='';onLegendSearchInput('');}else{inp.blur();}}
23060
+ else if(e.key==='Enter'&&legendIdHits.length===1){e.preventDefault();legendSelectMemberId(legendIdHits[0]);}}); // #2998: the one member the search found by id
23044
23061
  clr.addEventListener('click',()=>{if(!inp.value&&!legendQuery)return;inp.value='';onLegendSearchInput('');inp.focus();});
23045
23062
  sb.append(ico,inp,clr);
23046
23063
  host.insertBefore(sb,hint);
@@ -23205,6 +23222,15 @@ function refresh3DLegend(){const vis=legendVis();if(!vis)return;const st=vis.gro
23205
23222
  function legendRowClick(e,row){if(row&&row._dragging)return;const mods={ctrl:e.ctrlKey||e.metaKey,shift:e.shiftKey};clearTimeout(leg3dClickT);if(mods.ctrl||mods.shift)legendSelect(row,mods);else leg3dClickT=setTimeout(()=>legendSelect(row,mods),220);}
23206
23223
  // A selection made IN the list is already where the person is looking, so Follow selection must not scroll the list
23207
23224
  // away from it. The flag covers every way the list selects (click, Ctrl, Shift range, Enter), whatever branch it takes.
23225
+ // #2998: select ONE member the search found by its id (Enter in the search box), as a plain row click selects a group,
23226
+ // and frame it in the pane being searched: `model.fit-selection` only reaches the 3D camera, so a plan zooms itself.
23227
+ // The search box keeps focus, so a person can refine the query and press Enter again.
23228
+ function legendSelectMemberId(id){
23229
+ if(!legendMembers().some(m=>m&&String(m.id)===id))return;
23230
+ legendSelecting=true;try{clearWholeReferenceSelection();modelSelection.replaceMembers([id]);modelSelection.clearGrids();selDimIds.clear();sel3dDimIds.clear();legendSelAnchor=null;render();}finally{legendSelecting=false;}
23231
+ if(legendView()==='2d'){if(sel2d().length)zoomToSelection();}
23232
+ else if(modelEditor.isReady())modelEditor.dispatch('model.fit-selection');
23233
+ }
23208
23234
  function legendSelect(row,mods){legendSelecting=true;try{legendSelectRows(row,mods);}finally{legendSelecting=false;}}
23209
23235
  function legendSelectRows(row,mods){
23210
23236
  if(!row)return;const ids=legRowIds(row);if(!ids.length)return;
@@ -23271,9 +23297,29 @@ function applyLegendFilter(){
23271
23297
  const q=(legendQuery||'').trim().toLowerCase();
23272
23298
  const old=host.querySelector('.lsnomatch');if(old)old.remove(); // only its own note: an empty sheet's stays
23273
23299
  const rows=[...host.querySelectorAll('.lrow[data-key],.lrow[data-connkey],.lrow[data-detailkey]')];
23300
+ host.querySelectorAll('.lidhit').forEach(t=>t.remove());legendIdHits=[]; // a row's own text, never last pass's tag, is what it is matched on
23274
23301
  if(!q){rows.forEach(r=>r.classList.remove('qhide'));host.querySelectorAll('.cat-hdr.qhide').forEach(h=>h.classList.remove('qhide'));return;}
23275
- let any=false;
23276
- rows.forEach(r=>{const hit=(r.textContent||'').toLowerCase().includes(q);r.classList.toggle('qhide',!hit);if(hit)any=true;});
23302
+ // #2998: a row also matches by the ids of what it holds (a member id such as c-021, the id AI decisions, Make precise,
23303
+ // Inspect and the chat all use). A row grouped by profile holds many, so the matched id is shown after its label.
23304
+ const byKey=new Map();for(const m of legendMembers())if(m&&m.id!=null){const k=profileKeyOf(m);if(!byKey.has(k))byKey.set(k,[]);byKey.get(k).push(String(m.id));}
23305
+ let any=false;const tagged=[];
23306
+ rows.forEach(r=>{const textHit=(r.textContent||'').toLowerCase().includes(q);
23307
+ const ids=r.dataset.key?(byKey.get(r.dataset.key)||[]):(r._ids||[]).map(String);
23308
+ const exactFirst=(a,b)=>(b.toLowerCase()===q)-(a.toLowerCase()===q)||a.localeCompare(b); // a typed whole id leads its row's tag
23309
+ // Every member whose id matches is a candidate for Enter, also in a row its label already matched (a member IPE300 in
23310
+ // the IPE300 row); only a row found by id alone needs the tag that says why it is shown.
23311
+ const idMatches=ids.filter(id=>id.toLowerCase().includes(q)).sort(exactFirst),idHits=textHit?[]:idMatches;
23312
+ if(r.dataset.key)legendIdHits.push(...idMatches);
23313
+ const hit=textHit||idHits.length>0;r.classList.toggle('qhide',!hit);if(hit)any=true;
23314
+ if(idHits.length)tagged.push([r,idHits]);});
23315
+ // A whole id typed is that member, even when it also begins longer ids (m-12 of m-120, m-121).
23316
+ const exact=legendIdHits.filter(id=>id.toLowerCase()===q);if(exact.length===1)legendIdHits=exact;
23317
+ const one=legendIdHits.length===1;
23318
+ for(const [r,idHits] of tagged){const t=document.createElement('span');t.className='lidhit';
23319
+ t.textContent='· '+idHits[0]+(idHits.length>1?' +'+(idHits.length-1)+' more':'');
23320
+ t.dataset.tip=one&&r.dataset.key&&idHits[0]===legendIdHits[0]?'Member '+idHits[0]+' is in this group. Press Enter in the search box to select only it.'
23321
+ :'Matched by id: '+idHits.slice(0,8).join(', ')+(idHits.length>8?', …':'')+'. Clicking the row selects the whole group.';
23322
+ r.appendChild(t);}
23277
23323
  host.querySelectorAll('.cat-hdr').forEach(h=>{const cat=h.dataset.cat||'';
23278
23324
  if(!(memberTypeRecords().some(t=>t.k===cat)||/^conn-/.test(cat)||cat==='placed-details'))return; // leave the Dimensions/Clip headers untouched
23279
23325
  let vis=false;
@@ -15,6 +15,12 @@ export const FLO_FRESH_LOOK_MS = 45_000;
15
15
  export const FLO_CATCH_UP = 3;
16
16
  export const FLO_VISIT_MS = 2500;
17
17
  export const FLO_STORAGE_KEY = 'floless:filter-flo';
18
+ /** How far the pointer must move on Flo before a press becomes a drag, so a click stays a click. */
19
+ export const FLO_DRAG_THRESHOLD = 4;
20
+ /** Flo springs out of Show Flo and tucks back into it; the way back is the shorter. */
21
+ export const FLO_POP_IN_MS = 320;
22
+ export const FLO_POP_OUT_MS = 240;
23
+ const FLO_STEP = 16;
18
24
 
19
25
  /** The Filter sheet a look is of: the ONE sheet with its source and page number, else -1 (none, or two). */
20
26
  export function floSheetIndex(sheets, look) {
@@ -59,31 +65,93 @@ export function floPerch(box, stage, pilot, clear) {
59
65
 
60
66
  /**
61
67
  * The overlay. `d` is the page's half: its elements and what only it knows.
62
- * root, scan, pilot, bubble, head, sentence, where, showBtn, answerBtn, toggle, live: the elements;
68
+ * root, scan, pilot, bubble, head, sentence, where, showBtn, answerBtn, toggle, live: the elements; minBtn: the
69
+ * bubble's own Minimize, which does what turning Show Flo off does;
63
70
  * avatar: floAvatar(...)'s handle, or null; stage: the stage element;
64
71
  * sheets(), active(), setSheet(i), focusSheets(): the Filter's sheets;
65
72
  * toStage(x, y): a sheet point in stage px; bgRect(sheet): where the sheet's own picture lies;
66
73
  * clearTop(), clearBottom(): px kept clear (the place bar; the zoom bar and the note above it);
67
- * ask(): asks the shell to open the question in AI Chat; storage: localStorage or null; now(): ms.
74
+ * ask(): asks the shell to open the question in AI Chat; storage: localStorage or null; now(): ms;
75
+ * handle: the element the person grabs to move Flo (the avatar), or null.
76
+ *
77
+ * The person may drag Flo anywhere on the stage. It then stays where it was put (as a fraction of the stage, so a
78
+ * resize keeps it in place) while the box goes on following the reading, until a double-click, Escape, or turning
79
+ * Flo off and on sends it back to following.
68
80
  */
69
81
  export function mountFilterFlo(d) {
70
82
  let state = { mode: 'off' };
71
83
  let on = true;
72
84
  try { on = d.storage?.getItem(FLO_STORAGE_KEY) !== 'off'; } catch { /* private mode: on, the default */ }
73
85
  let cur = null, queue = [], tour = 0, freshTimer = 0, leaving = 0, lastSeq = 0, last = null, spoken = '', read = null, unpin = 0;
86
+ /** Where the person put Flo, as fractions of the stage; null while Flo follows the reading. */
87
+ let pin = null;
88
+ /** Where Flo is under the pointer while the person drags it (stage px), so a poll in the middle never pulls it away. */
89
+ let held = null;
90
+ /** 'in' or 'out' just after Show Flo was pressed: the next show or hide springs from or into the button. */
91
+ let popping = '';
92
+ let popAnim = null;
93
+ const reducedMotion = () => !!globalThis.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches;
74
94
 
75
95
  const show = (el, yes) => { el.hidden = !yes; };
76
96
  const sheetName = (i) => (i >= 0 ? d.sheets()[i]?.sheet || null : null);
77
97
 
98
+ /** The centre of Show Flo, in stage px, or null when it cannot be measured. */
99
+ function toggleCentre() {
100
+ const t = d.toggle.getBoundingClientRect?.(), s = d.stage.getBoundingClientRect?.();
101
+ if (!t || !s || !t.width) return null;
102
+ return { x: t.left - s.left + t.width / 2, y: t.top - s.top + t.height / 2 };
103
+ }
104
+
105
+ /**
106
+ * Flo springing between Show Flo and `p` (its stage position): out of the button for 'in', back into it for 'out'.
107
+ * A plain fade for a person who asked for less motion. False when this browser cannot animate it.
108
+ */
109
+ function pop(dir, p, done) {
110
+ popAnim?.cancel();
111
+ popAnim = null;
112
+ const c = toggleCentre();
113
+ if (typeof d.pilot.animate !== 'function' || !c || !p) return false;
114
+ const w = d.pilot.offsetWidth || 0, h = d.pilot.offsetHeight || 0;
115
+ const at = `translate(${Math.round(p.x)}px, ${Math.round(p.y)}px)`;
116
+ // Scaled from its top-left, so this start puts the small Flo's centre on the button's.
117
+ const button = `translate(${Math.round(c.x - 0.1 * w)}px, ${Math.round(c.y - 0.1 * h)}px) scale(0.2)`;
118
+ const still = reducedMotion();
119
+ const frames = still
120
+ ? [{ transform: at, opacity: dir === 'in' ? 0 : 1 }, { transform: at, opacity: dir === 'in' ? 1 : 0 }]
121
+ : dir === 'in'
122
+ ? [{ transform: button, opacity: 0 }, { opacity: 1, offset: 0.4 }, { transform: `${at} scale(1.04)`, offset: 0.8 }, { transform: at, opacity: 1 }]
123
+ : [{ transform: at, opacity: 1 }, { opacity: 1, offset: 0.6 }, { transform: button, opacity: 0 }];
124
+ d.root.classList.add('popping');
125
+ const anim = popAnim = d.pilot.animate(frames, {
126
+ duration: still ? 120 : dir === 'in' ? FLO_POP_IN_MS : FLO_POP_OUT_MS,
127
+ easing: dir === 'in' ? 'cubic-bezier(.22,1,.36,1)' : 'cubic-bezier(.55,0,1,.45)',
128
+ });
129
+ anim.onfinish = () => {
130
+ if (popAnim !== anim) return;
131
+ popAnim = null;
132
+ d.root.classList.remove('popping');
133
+ if (dir === 'in') { d.toggle.classList.add('landed'); setTimeout(() => d.toggle.classList.remove('landed'), 180); }
134
+ done?.();
135
+ };
136
+ return true;
137
+ }
138
+
78
139
  function hide() {
79
140
  clearTimeout(freshTimer);
80
141
  d.avatar?.setMood('idle');
81
142
  if (d.root.hidden || leaving) return;
143
+ const finish = () => { clearTimeout(leaving); leaving = 0; d.root.hidden = true; d.root.classList.remove('leaving'); };
144
+ if (popping === 'out') {
145
+ popping = '';
146
+ d.scan.classList.add('hide');
147
+ // The timer is the backstop: a cancelled animation never finishes.
148
+ if (pop('out', last, () => { if (leaving) finish(); })) { leaving = setTimeout(finish, FLO_POP_OUT_MS + 200); return; }
149
+ }
82
150
  d.root.classList.add('leaving');
83
- leaving = setTimeout(() => { leaving = 0; d.root.hidden = true; d.root.classList.remove('leaving'); }, 300);
151
+ leaving = setTimeout(finish, 300);
84
152
  }
85
153
  function reveal() {
86
- if (leaving) { clearTimeout(leaving); leaving = 0; d.root.classList.remove('leaving'); }
154
+ if (leaving) { clearTimeout(leaving); leaving = 0; d.root.classList.remove('leaving'); popAnim?.cancel(); popAnim = null; d.root.classList.remove('popping'); }
87
155
  d.root.hidden = false;
88
156
  }
89
157
 
@@ -118,6 +186,13 @@ export function mountFilterFlo(d) {
118
186
  function render(instant = false) {
119
187
  // The switch is there only while a read is live: with nothing to show it would be a control that does nothing.
120
188
  d.toggle.hidden = state.mode !== 'reading' && state.mode !== 'waiting';
189
+ const asking = !on && state.mode === 'waiting';
190
+ d.toggle.classList.toggle('asking', asking);
191
+ if (asking) d.toggle.dataset.tip = 'Show Flo. The AI is waiting for your answer.';
192
+ else tipToggle();
193
+ // The dot is for eyes; a screen reader hears the same thing on the button.
194
+ if (asking) d.toggle.setAttribute('aria-description', 'The AI is waiting for your answer');
195
+ else d.toggle.removeAttribute('aria-description');
121
196
  const mode = on ? state.mode : 'off';
122
197
  const waiting = mode === 'waiting';
123
198
  // Said once on the way in (and again only if what it waits on changes), never per poll: the bubble is not a
@@ -147,7 +222,9 @@ export function mountFilterFlo(d) {
147
222
  show(d.answerBtn, waiting && !!state.chat);
148
223
  if (waiting) { d.avatar?.setMood('yourcall', true); d.avatar?.rest(); }
149
224
  else d.avatar?.setMood(look ? 'working' : 'thinking', true);
150
- place(instant, look, at);
225
+ const springing = popping === 'in';
226
+ place(instant || springing, look, at);
227
+ if (springing) { popping = ''; pop('in', last); }
151
228
  if (look) freshTimer = setTimeout(() => render(), Math.max(0, cur.at + FLO_FRESH_LOOK_MS - t) + 50);
152
229
  }
153
230
 
@@ -189,7 +266,15 @@ export function mountFilterFlo(d) {
189
266
  // Between pictures: think where it stood.
190
267
  p = last ? { ...last, y: Math.max(clear.top, Math.min(H - clear.bottom - pilot.ph, last.y)) } : { x: 16, y: clear.top, left: false };
191
268
  }
269
+ if (pin) {
270
+ // Where the person put it, kept on the stage and clear of the bars.
271
+ p = { x: Math.max(8, Math.min(W - pilot.pw - 8, pin.fx * W)),
272
+ y: Math.max(clear.top, Math.min(H - clear.bottom - pilot.ph, pin.fy * H)), left: false };
273
+ }
274
+ // Seen in a real browser pass: a poll arriving mid-drag put Flo back where the reading had it.
275
+ if (held) p = { x: held.x, y: held.y, left: false };
192
276
  last = p;
277
+ d.root.classList.toggle('pinned', !!pin);
193
278
  d.pilot.classList.toggle('left', p.left);
194
279
  d.pilot.style.transform = `translate(${Math.round(p.x)}px, ${Math.round(p.y)}px)`;
195
280
  d.scan.classList.toggle('hide', !box);
@@ -203,11 +288,87 @@ export function mountFilterFlo(d) {
203
288
 
204
289
  function setOn(next) {
205
290
  on = !!next;
291
+ // Off and on again is a way back to following, as a double-click is.
292
+ if (pin) pinAt(null, false);
293
+ popping = on ? 'in' : 'out';
206
294
  d.toggle.setAttribute('aria-pressed', String(on));
295
+ tipToggle();
207
296
  try { d.storage?.setItem(FLO_STORAGE_KEY, on ? 'on' : 'off'); } catch { /* private mode */ }
208
297
  render(true);
209
298
  }
210
299
 
300
+ function tipToggle() {
301
+ // The name stays "Show Flo" and aria-pressed carries the state; only the tip says what a press does now.
302
+ d.toggle.setAttribute('aria-label', 'Show Flo');
303
+ d.toggle.dataset.tip = on
304
+ ? 'Hide Flo. While a drawing read runs, Flo shows which part of the drawing the AI is reading and says when it is waiting for your answer. Drag Flo to move it.'
305
+ : 'Show Flo, which shows which part of the drawing the AI is reading and says when it is waiting for your answer';
306
+ }
307
+
308
+ /** Keeps Flo where the person moved it (stage px of its top-left), or with null lets it follow the reading again. */
309
+ function pinAt(x, y, paint = true) {
310
+ const W = d.stage.clientWidth, H = d.stage.clientHeight;
311
+ pin = x === null || !W || !H ? null : { fx: x / W, fy: y / H };
312
+ if (d.handle) {
313
+ d.handle.dataset.tip = pin ? 'Flo stays here. Double-click it, or press Escape, to let it follow the reading again.'
314
+ : 'Drag Flo to move it out of the way';
315
+ }
316
+ if (paint) render(!!pin);
317
+ }
318
+
319
+ if (d.handle) {
320
+ const h = d.handle;
321
+ let press = null;
322
+ h.addEventListener('pointerdown', (e) => {
323
+ if (e.button !== 0 || !last) return;
324
+ e.stopPropagation(); // moving Flo is not panning the drawing
325
+ press = { id: e.pointerId, sx: e.clientX, sy: e.clientY, x: last.x, y: last.y, moved: false, at: null };
326
+ // Captured on the press, not once it moves: a quick flick leaves Flo's face before its first move arrives, and
327
+ // that move would go to the drawing underneath (seen in a real browser pass). A click still clicks.
328
+ try { h.setPointerCapture(e.pointerId); } catch { /* the pointer is already gone */ }
329
+ });
330
+ h.addEventListener('pointermove', (e) => {
331
+ if (!press || e.pointerId !== press.id) return;
332
+ const dx = e.clientX - press.sx, dy = e.clientY - press.sy;
333
+ if (!press.moved) {
334
+ if (Math.hypot(dx, dy) < FLO_DRAG_THRESHOLD) return;
335
+ press.moved = true;
336
+ // The captured pointer keeps re-hovering Flo, which would bring its tip back mid-drag; the drop sets it again.
337
+ h.dataset.tip = '';
338
+ d.root.classList.add('dragging', 'instant');
339
+ }
340
+ const W = d.stage.clientWidth, H = d.stage.clientHeight, pw = d.pilot.offsetWidth || 0, ph = d.pilot.offsetHeight || 0;
341
+ const x = Math.max(8, Math.min(W - pw - 8, press.x + dx));
342
+ const y = Math.max(d.clearTop(), Math.min(H - d.clearBottom() - ph, press.y + dy));
343
+ d.pilot.classList.remove('left');
344
+ d.pilot.style.transform = `translate(${Math.round(x)}px, ${Math.round(y)}px)`;
345
+ press.at = { x, y };
346
+ held = press.at;
347
+ });
348
+ const drop = (e) => {
349
+ if (!press || e.pointerId !== press.id) return;
350
+ const done = press;
351
+ press = null;
352
+ held = null;
353
+ d.root.classList.remove('dragging', 'instant');
354
+ if (done.moved && done.at) pinAt(done.at.x, done.at.y);
355
+ };
356
+ h.addEventListener('pointerup', drop);
357
+ h.addEventListener('pointercancel', drop);
358
+ h.addEventListener('dblclick', (e) => { e.stopPropagation(); pinAt(null); });
359
+ h.addEventListener('keydown', (e) => {
360
+ // Flo is a button: Enter and Space press it, which lets it follow the reading again, as Escape does.
361
+ if (e.key === 'Escape' || e.key === 'Home' || e.key === 'Enter' || e.key === ' ') { if (pin) { e.preventDefault(); pinAt(null); } return; }
362
+ const step = e.shiftKey ? FLO_STEP * 4 : FLO_STEP;
363
+ const move = { ArrowLeft: [-step, 0], ArrowRight: [step, 0], ArrowUp: [0, -step], ArrowDown: [0, step] }[e.key];
364
+ if (!move || !last) return;
365
+ e.preventDefault();
366
+ pinAt(last.x + move[0], last.y + move[1]);
367
+ });
368
+ h.dataset.tip = 'Drag Flo to move it out of the way';
369
+ }
370
+
371
+ tipToggle();
211
372
  d.toggle.setAttribute('aria-pressed', String(on));
212
373
  d.toggle.addEventListener('click', () => setOn(!on));
213
374
  d.showBtn.addEventListener('click', () => {
@@ -218,8 +379,11 @@ export function mountFilterFlo(d) {
218
379
  d.focusSheets(); // the button is gone now that its sheet is on screen
219
380
  });
220
381
  d.answerBtn.addEventListener('click', () => d.ask());
382
+ // Minimize is Show Flo off, found where Flo is. The bubble is leaving, so focus goes to where Flo comes back from.
383
+ // With the read just ended, Show Flo is gone too: the sheet list is the nearest place left.
384
+ d.minBtn?.addEventListener('click', () => { setOn(false); if (!d.toggle.hidden) d.toggle.focus?.(); else d.focusSheets(); });
221
385
  // Pan and hover pass through everything but the buttons.
222
- for (const el of [d.showBtn, d.answerBtn]) el.addEventListener('pointerdown', (e) => e.stopPropagation());
386
+ for (const el of [d.showBtn, d.answerBtn, d.minBtn]) el?.addEventListener('pointerdown', (e) => e.stopPropagation());
223
387
 
224
- return { update, place: (instant) => place(instant), isOn: () => on };
388
+ return { update, place: (instant) => place(instant), isOn: () => on, isPinned: () => !!pin };
225
389
  }
@@ -532,19 +532,32 @@ body.publication-blocked #empty{position:static;flex:1}
532
532
  ellipsises (scrollWidth 84 vs clientWidth 77). A button now moves to its own line before it
533
533
  shrinks, so the ellipsis is the second line of defence, not the first. */
534
534
  #zoombar{position:absolute;left:12px;bottom:12px;max-width:calc(100% - 24px);overflow:hidden;display:flex;flex-wrap:wrap;gap:6px;background:var(--stage-panel);border:1px solid var(--stage-line);border-radius:8px;padding:6px 8px;box-shadow:var(--stage-shadow)}
535
- #zoombar button{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:var(--stage-btn);border-color:var(--stage-ctrl);color:var(--stage-text)}
536
- #zoombar button:hover{background:var(--stage-btn-hover)}
535
+ /* ICONS (owner request 2026-11-01): the 3D view toolbar's compact 30px icon buttons, 16px stroked glyphs and its
536
+ pressed language (brand outline and brand glyph), so the app's canvas bars read as one family. Every button
537
+ keeps its words as aria-label and its sentence as data-tip. Four icons are 140px on one row, so the wrap
538
+ arithmetic above now has room to spare. */
539
+ #zoombar{gap:2px;padding:4px;align-items:center}
540
+ #zoombar button{position:relative;width:30px;height:30px;min-width:0;min-height:0;padding:0;display:flex;align-items:center;justify-content:center;background:transparent;border:1px solid transparent;border-radius:6px;box-shadow:none;color:var(--stage-mut)}
541
+ #zoombar button:hover{background:var(--stage-btn-hover);color:var(--stage-text)}
542
+ #zoombar button:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
543
+ #zoombar svg{width:16px;height:16px;display:block;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
544
+ /* Show Flo when off: the same face, struck through, so the state never rests on colour alone. */
545
+ #zoombar svg.zb-off{position:absolute;left:6px;top:6px}
546
+ #floToggle[aria-pressed="true"] svg.zb-off{display:none}
547
+ /* Minimized while the AI waits for an answer: a warning dot, so tucking Flo away never buries the question. */
548
+ #floToggle.asking::after{content:"";position:absolute;top:3px;right:3px;width:7px;height:7px;border-radius:50%;background:var(--warn);box-shadow:0 0 0 2px var(--stage-panel)}
549
+ #floToggle.landed{box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 35%,transparent);transition:box-shadow .16s ease}
537
550
  /* Hover info is a READ tool, not a framing control -- the divider says so, so the bar reads as the
538
551
  framing pair plus the canvas tools after it (Hover info, and Show Flo during a read) rather than
539
552
  commands of one kind. aria-hidden: it is
540
553
  decoration, and the buttons' own names already say what each does. */
541
- #zoombar .zb-sep{width:1px;align-self:stretch;background:var(--stage-line);flex:none}
554
+ #zoombar .zb-sep{width:1px;height:16px;margin:0 3px;background:var(--stage-line);flex:none}
542
555
  /* Hover info ON. It reuses button.primary's exact fill — the "this is active" language the page
543
556
  already speaks — so the pressed state costs no new colour. aria-pressed rather than a switch
544
557
  component: this surface ships checkboxes and buttons and nothing else, and inventing a third
545
558
  control vocabulary is precisely what the locked baseline forbids. */
546
- #zoombar button[aria-pressed="true"]{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)}
547
- #zoombar button[aria-pressed="true"]:hover{background:var(--brand-hover)}
559
+ #zoombar button[aria-pressed="true"]{background:color-mix(in srgb,var(--brand) 12%,transparent);border-color:var(--brand);color:var(--brand)}
560
+ #zoombar button[aria-pressed="true"]:hover{background:color-mix(in srgb,var(--brand) 20%,transparent)}
548
561
  /* Forced colors flattens the brand fill, so the pressed state needs a cue that is not a colour. */
549
562
  @media (forced-colors:active){#zoombar button[aria-pressed="true"]{outline:2px solid currentColor;outline-offset:-3px}}
550
563
  /* #2777 slice D: a place AI Chat opened here. Its outline is its OWN layer in #canvas, never the #hot halo,
@@ -658,7 +671,11 @@ body.publication-blocked #empty{position:static;flex:1}
658
671
  #floPilot{position:absolute;left:0;top:0;display:flex;align-items:flex-start;gap:4px;transition:transform 1.1s var(--flo-glide)}
659
672
  #floPilot.left{flex-direction:row-reverse}
660
673
  #floFx.instant #floPilot,#floFx.instant #floScan{transition:none}
661
- #floAvatar{flex:none}
674
+ #floAvatar{flex:none;pointer-events:auto;cursor:grab;touch-action:none;border-radius:50%;transition:transform .15s ease,filter .15s ease}
675
+ #floAvatar:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
676
+ #floFx.dragging #floAvatar{cursor:grabbing;transform:scale(1.06);filter:drop-shadow(0 6px 10px rgba(0,0,0,.35))}
677
+ #floFx.popping #floPilot{transition:none}
678
+ #floFx.popping #floAvatar{pointer-events:none}
662
679
  #floAvatar .flo-avatar{display:block;--flo-line:var(--brand);--flo-fill:var(--stage-panel);--flo-hat:var(--stage-text);--flo-hat-line:var(--stage-text);--flo-pulse:var(--stage-text)}
663
680
  /* On a light sheet a white hat needs its outline, as app.css gives Flo in the light theme. */
664
681
  [data-theme="light"] #floAvatar .flo-avatar{--flo-hat-line:var(--brand)}
@@ -678,6 +695,13 @@ body.publication-blocked #empty{position:static;flex:1}
678
695
  #floWhere[hidden],#floBubble button[hidden]{display:none}
679
696
  #floBubble button{display:block;pointer-events:auto;margin-top:7px;white-space:nowrap;background:var(--stage-btn);border-color:var(--stage-ctrl);color:var(--stage-text)}
680
697
  #floBubble button:hover{background:var(--stage-btn-hover)}
698
+ /* Minimize, in the bubble's corner: the canvas bar's icon-button idiom at bubble scale, so tucking Flo away is found
699
+ where Flo is, not only on the bar. The bubble keeps its text clear of it. */
700
+ #floBubble{position:relative;padding-right:32px}
701
+ #floBubble #floMin{position:absolute;top:4px;right:4px;width:24px;height:24px;min-width:0;min-height:0;margin:0;padding:0;display:flex;align-items:center;justify-content:center;background:transparent;border:1px solid transparent;border-radius:5px;box-shadow:none;color:var(--stage-mut)}
702
+ #floBubble #floMin:hover{background:var(--stage-btn-hover);color:var(--stage-text)}
703
+ #floBubble #floMin:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
704
+ #floMin svg{width:14px;height:14px;display:block;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
681
705
  @media (prefers-reduced-motion:reduce){#floFx,#floPilot,#floScan{transition:none}#floScan span{display:none}}
682
706
  /* The hovered element's own row in each facet: the checkbox the user is about to untick, lit where it
683
707
  sits. Reuses the option-row hover fill and the left-accent idiom .sheet-option.selected already
@@ -875,9 +899,10 @@ body.publication-blocked #empty{position:static;flex:1}
875
899
  <div id="floFx" hidden>
876
900
  <div id="floScan" class="hide" aria-hidden="true"><span></span><i></i><i></i><i></i><i></i></div>
877
901
  <div id="floPilot">
878
- <div id="floAvatar" aria-hidden="true"></div>
902
+ <div id="floAvatar" role="button" tabindex="0" aria-label="Move Flo" data-command-id="filter.flo-move" data-tip="Drag Flo to move it out of the way"></div>
879
903
  <div id="floDots" aria-hidden="true"><i></i><i></i></div>
880
904
  <div id="floBubble">
905
+ <button id="floMin" type="button" aria-label="Minimize Flo" data-command-id="filter.flo-minimize" data-tip="Minimize Flo. Bring it back with Show Flo."><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 8h8"/></svg></button>
881
906
  <p><b id="floHead"></b> <span id="floNow"></span></p>
882
907
  <span id="floWhere" hidden></span>
883
908
  <button id="floShow" type="button" data-command-id="filter.flo-show-sheet" data-tip="Show the sheet the AI is reading now" hidden></button>
@@ -893,7 +918,7 @@ body.publication-blocked #empty{position:static;flex:1}
893
918
  bare noun read as a category, not a command. data-tip (never title=) carries the full
894
919
  sentence. -->
895
920
  <div id="placebar" role="status" aria-live="polite" hidden><span id="placebarText"></span><button id="placebarClear" type="button" data-command-id="filter.place-clear" data-tip="Remove the marked place from this drawing">Clear</button></div>
896
- <div id="zoombar"><button id="fit2" data-command-id="filter.fit" data-tip="Fit the whole page in view">Fit</button><button id="zoomsteel2" data-command-id="filter.zoom-steel" data-tip="Zoom to fit the steel elements on this sheet">Zoom steel</button><span class="zb-sep" aria-hidden="true"></span><button id="hoverInfo" type="button" aria-pressed="false" data-command-id="filter.hover-info" data-tip="Point at any line or label, shown or switched off, to read its layer, thickness and colour — and light up its rows in the Filters panel. Click a switched-off line to see what to tick to bring it back. Background-only linework, on layers the drawing read never picked up, can’t be read by pointing; click an empty spot to ask the original drawing what is there, where the original drawing is available.">Hover info</button><button id="floToggle" type="button" aria-pressed="true" hidden data-command-id="filter.flo-toggle" data-tip="While a drawing read runs, Flo shows which part of the drawing the AI is reading, and says when it is waiting for your answer">Show Flo</button></div>
921
+ <div id="zoombar"><button id="fit2" type="button" data-command-id="filter.fit" aria-label="Fit" data-tip="Fit the whole page in view"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 6V2h4M14 6V2h-4M2 10v4h4M14 10v4h-4"/></svg></button><button id="zoomsteel2" type="button" data-command-id="filter.zoom-steel" aria-label="Zoom steel" data-tip="Zoom to fit the steel elements on this sheet"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 5V2h3M14 5V2h-3M2 11v3h3M14 11v3h-3"/><path d="M5.4 5.4h5.2M5.4 10.6h5.2M8 5.4v5.2" stroke-width="1.4"/></svg></button><span class="zb-sep" aria-hidden="true"></span><button id="hoverInfo" type="button" aria-pressed="false" aria-label="Hover info" data-command-id="filter.hover-info" data-tip="Hover info. Point at any line or label, shown or switched off, to read its layer, thickness and colour — and light up its rows in the Filters panel. Click a switched-off line to see what to tick to bring it back. Background-only linework, on layers the drawing read never picked up, can’t be read by pointing; click an empty spot to ask the original drawing what is there, where the original drawing is available."><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.2 2.4 3.2 12l2.6-2.4 1.8 4 1.7-.8-1.8-3.9 3.6-.1z"/><path d="M11.6 3.4h2.6M11.6 5.6h1.6" stroke-width="1.4"/></svg></button><button id="floToggle" type="button" aria-pressed="true" aria-label="Show Flo" hidden data-command-id="filter.flo-toggle" data-tip="Hide Flo. While a drawing read runs, Flo shows which part of the drawing the AI is reading and says when it is waiting for your answer. Drag Flo to move it."><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4.2 6.6a3.8 3.8 0 0 1 7.6 0M3 6.6h10"/><path d="M4.6 6.6v2a3.4 3.4 0 0 0 6.8 0v-2"/><path d="M6.5 8.7h.01M9.5 8.7h.01" stroke-width="2"/></svg><svg class="zb-off" viewBox="0 0 16 16" aria-hidden="true"><path d="M2.6 13.4 13.4 2.6" stroke-width="1.5"/></svg></button></div>
897
922
  <!-- The hover readout, anchored at the line it names (see #hoverbar's CSS for why it is not docked).
898
923
  Hidden until the pointer is on a line with the mode on; hidden again when it leaves the line, or
899
924
  when a click opens the popover (which then says the same thing).
@@ -4900,7 +4925,7 @@ boot();
4900
4925
  const stage = $('stage'), zoombar = $('zoombar');
4901
4926
  filterFlo = mountFilterFlo({
4902
4927
  root: $('floFx'), scan: $('floScan'), pilot: $('floPilot'), bubble: $('floBubble'), head: $('floHead'), sentence: $('floNow'),
4903
- where: $('floWhere'), showBtn: $('floShow'), answerBtn: $('floAnswer'), toggle: $('floToggle'), live: $('floLive'),
4928
+ where: $('floWhere'), showBtn: $('floShow'), answerBtn: $('floAnswer'), minBtn: $('floMin'), toggle: $('floToggle'), live: $('floLive'),
4904
4929
  avatar: typeof window.floAvatar === 'function' ? window.floAvatar($('floAvatar'), { size: 56, mood: 'idle', hat: true }) : null,
4905
4930
  stage,
4906
4931
  sheets: () => sheets, active: () => active, setSheet,
@@ -4920,6 +4945,7 @@ boot();
4920
4945
  ask: () => { try { if(window.parent !== window) window.parent.dispatchEvent(new CustomEvent('floless:filter-flo-answer')); } catch { /* no shell */ } },
4921
4946
  storage: (() => { try { return window.localStorage; } catch { return null; } })(),
4922
4947
  now: () => Date.now(),
4948
+ handle: $('floAvatar'),
4923
4949
  });
4924
4950
  window.flolessFilterFlo = (state) => filterFlo.update(state);
4925
4951
  // For a real browser pass to read the outcome; it drives nothing.
@@ -4928,7 +4954,7 @@ boot();
4928
4954
  head: $('floHead').textContent, now: $('floNow').textContent, where: $('floWhere').hidden ? '' : $('floWhere').textContent,
4929
4955
  show: $('floShow').hidden ? '' : $('floShow').textContent, answer: !$('floAnswer').hidden,
4930
4956
  box: $('floScan').classList.contains('hide') ? null : ['left', 'top', 'width', 'height'].map((k) => parseFloat($('floScan').style[k])),
4931
- pilot: $('floPilot').style.transform, live: $('floLive').textContent,
4957
+ pilot: $('floPilot').style.transform, live: $('floLive').textContent, pinned: filterFlo.isPinned(),
4932
4958
  });
4933
4959
  if(typeof ResizeObserver === 'function') new ResizeObserver(() => filterFlo.place(true)).observe(stage);
4934
4960
  }
@@ -403,6 +403,11 @@
403
403
  await window.flolessWorkspaces.setMode(screen.view); opened = true;
404
404
  } else if (screen?.view === 'tool-update-policy' && typeof window.openToolUpdatePolicy === 'function') {
405
405
  window.openToolUpdatePolicy(); opened = true;
406
+ } else if (screen?.view === 'new-project' && typeof window.flolessWorkspaces?.openNewProjectFromDrawings === 'function') {
407
+ // #2811: the file picker, then New project (Quick pressed when asked); the Drawing Filter choice stays the person's.
408
+ const outcome = await window.flolessWorkspaces.openNewProjectFromDrawings({ quick: screen.buildMode === 'quick' });
409
+ opened = outcome?.ok === true;
410
+ if (!opened) why = typeof outcome?.said === 'string' ? outcome.said : '';
406
411
  }
407
412
  } catch (error) {
408
413
  // The bridge throws sentences written for the person (e.g. "This window no longer holds that run's report…").