@floless/app 0.165.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.
- package/dist/floless-server.cjs +30794 -25371
- package/dist/schemas/drawing-check.profile.v1.schema.json +4 -2
- package/dist/schemas/steel.model.v2.schema.json +2 -1
- package/dist/skills/floless-app-knowledge/SKILL.md +8 -1
- package/dist/skills/floless-app-rfi/SKILL.md +7 -2
- package/dist/skills/floless-app-steel-model/SKILL.md +4 -1
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +31 -17
- package/dist/skills/floless-app-steel-takeoff/references/elevation-registration.md +15 -1
- package/dist/templates/college-phase-exporter.flo +41 -49
- package/dist/templates/screenshot-to-saved-settings.flo +12 -2
- package/dist/web/app.css +120 -1
- package/dist/web/aware.js +385 -88
- package/dist/web/chat-question-card.js +3 -1
- package/dist/web/chat.css +32 -0
- package/dist/web/chat.js +1021 -88
- package/dist/web/commands-drawing-check.js +1 -0
- package/dist/web/commands-filter.js +23 -0
- package/dist/web/commands-shell.js +231 -19
- package/dist/web/commands-steel.js +22 -2
- package/dist/web/drawing-check-editor.html +4 -0
- package/dist/web/drawing-check-editor.js +82 -2
- package/dist/web/index.html +14 -6
- package/dist/web/project-history.js +163 -19
- package/dist/web/project-modules.js +5 -0
- package/dist/web/project-rfis.js +206 -20
- package/dist/web/steel-ai-marks.js +173 -2
- package/dist/web/steel-editor.html +770 -49
- package/dist/web/steel-filter-flo.js +171 -7
- package/dist/web/steel-filter.html +36 -10
- package/dist/web/steel-model-v2-projection.js +26 -20
- package/dist/web/terminal-requests.js +5 -0
- package/dist/web/tool-updates.js +65 -20
- package/dist/web/workspaces.js +632 -85
- package/package.json +3 -2
|
@@ -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(
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
536
|
-
|
|
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;
|
|
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
|
|
547
|
-
#zoombar button[aria-pressed="true"]:hover{background:var(--brand
|
|
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-
|
|
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"
|
|
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
|
}
|
|
@@ -51,6 +51,17 @@ export function createMemberPresenceIndex(model) {
|
|
|
51
51
|
return { members, plans };
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Where `member` stands against `plan`'s cut, judged by THIS project's reach and near-cut tolerance — its saved
|
|
56
|
+
* `column_below_reach_mm`, else the default for its standard (300 mm metric, 12 in imperial). 'unknown' for
|
|
57
|
+
* anything that is not a column, and for a plan with no cut level. The one answer `memberPresence` and
|
|
58
|
+
* `projectMember` share, so the row a sheet draws and the reason it is drawn cannot use two different reaches (#2670).
|
|
59
|
+
*/
|
|
60
|
+
function columnRelationOnPlan(model, plan, member) {
|
|
61
|
+
if (member.role !== 'column' || !Number.isFinite(plan?.elevation_mm)) return 'unknown';
|
|
62
|
+
return columnCutRelation(member.from?.z, member.to?.z, plan.elevation_mm, columnBelowReachOf(model), defaultColumnNearCut(model?.environment));
|
|
63
|
+
}
|
|
64
|
+
|
|
54
65
|
/**
|
|
55
66
|
* The three-source membersOnSheet rule, kept equivalent to the server projection (`membersOnSheet`).
|
|
56
67
|
*
|
|
@@ -65,10 +76,7 @@ export function memberPresence(model, plan, member, index = null) {
|
|
|
65
76
|
const lookup = index?.plans.get(plan);
|
|
66
77
|
const observed = (lookup?.observed || observationIds(plan)).has(member.id);
|
|
67
78
|
const explicit = lookup ? lookup.explicit.has(member.id) : (plan.memberRefs || []).includes(member.id);
|
|
68
|
-
const
|
|
69
|
-
const relation = cutMm !== null && member.role === 'column'
|
|
70
|
-
? columnCutRelation(member.from?.z, member.to?.z, cutMm, columnBelowReachOf(model), defaultColumnNearCut(model?.environment))
|
|
71
|
-
: 'unknown';
|
|
79
|
+
const relation = columnRelationOnPlan(model, plan, member);
|
|
72
80
|
const crossing = relation === 'crossing';
|
|
73
81
|
const below = relation === 'below';
|
|
74
82
|
// A base read a little over the cut (#2815): drawn where it is, solid, never moved to the level.
|
|
@@ -245,8 +253,12 @@ export function memberProperties(member) {
|
|
|
245
253
|
|
|
246
254
|
}
|
|
247
255
|
|
|
248
|
-
/**
|
|
249
|
-
|
|
256
|
+
/**
|
|
257
|
+
* One canonical member mapped into the display-space vocabulary the 2D canvas consumes. `plan` is the sheet the
|
|
258
|
+
* row is drawn on (in practice the projection built from it, which carries the same `elevation_mm`); `model` is
|
|
259
|
+
* the document it belongs to, read only for its column reach. Without one the reach is the imperial default.
|
|
260
|
+
*/
|
|
261
|
+
export function projectMember(member, plan, session = null, model = null) {
|
|
250
262
|
const a = worldToSheetPx(member.from, plan);
|
|
251
263
|
const b = worldToSheetPx(member.to, plan);
|
|
252
264
|
// Destructured so the emitted key ORDER is byte-identical to what this function built inline before the
|
|
@@ -257,21 +269,15 @@ export function projectMember(member, plan, session = null) {
|
|
|
257
269
|
Decided HERE, from the member and the plan's own cut, and not handed down by whoever built the list: the
|
|
258
270
|
`patchMembers` path re-projects a row without asking presence at all, so a flag that came from the caller
|
|
259
271
|
would be lost on the first drag. Set only when true, so every other row keeps exactly the shape it had. */
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
// and its metric default, which is the split-brain `memberPresence` avoids by passing
|
|
266
|
-
// `columnBelowReachOf(model)`. Threading the model in here needs a signature change this change
|
|
267
|
-
// did not warrant: #2670.
|
|
268
|
-
const relation = columnCutRelation(member.from?.z, member.to?.z, plan.elevation_mm);
|
|
269
|
-
if (relation === 'below' || relation === 'far-below') projected.belowCut = true;
|
|
270
|
-
}
|
|
272
|
+
// Judged at the PROJECT's reach, the same one presence uses (#2670). `below` and `far-below` set the same
|
|
273
|
+
// flag today, but the relation rides on the row's link so a reader that ever tells them apart gets the
|
|
274
|
+
// project's answer and not the imperial default's.
|
|
275
|
+
const cutRelation = columnRelationOnPlan(model, plan, member);
|
|
276
|
+
if (cutRelation === 'below' || cutRelation === 'far-below') projected.belowCut = true;
|
|
271
277
|
// `viewId` is the identity every command resolves its row by; `sheet` rides along for display only
|
|
272
278
|
// and must never be used as a lookup key (#938).
|
|
273
279
|
const base = { session, kind: 'member', memberId: member.id, viewId: planViewId(plan), sheet: plan.sheet };
|
|
274
|
-
link(projected, base);
|
|
280
|
+
link(projected, member.role === 'column' ? { ...base, cutRelation } : base);
|
|
275
281
|
link(projected.ends[0], { ...base, kind: 'end', end: 0 });
|
|
276
282
|
link(projected.ends[1], { ...base, kind: 'end', end: 1 });
|
|
277
283
|
link(projected.col, { ...base, kind: 'column' });
|
|
@@ -336,7 +342,7 @@ export function createV2Projection(model, viewId, options = {}) {
|
|
|
336
342
|
const index = createMemberPresenceIndex(model);
|
|
337
343
|
return (model.members || []).filter((m) => memberPresence(model, plan, m, index).visible);
|
|
338
344
|
})();
|
|
339
|
-
projection.members = visible.map((m) => projectMember(m, projection, session));
|
|
345
|
+
projection.members = visible.map((m) => projectMember(m, projection, session, model));
|
|
340
346
|
// Dimensions go with them. A `dim` is anchored to a member point or a grid axis (`aRef`/`bRef`), so on
|
|
341
347
|
// a refused sheet it measures between two things that are no longer there — and it draws in raw sheet
|
|
342
348
|
// pixels, so it draws ANYWAY, leaving one confident-looking annotation floating over an empty plan.
|
|
@@ -396,7 +402,7 @@ export function createV2Projection(model, viewId, options = {}) {
|
|
|
396
402
|
const id = projection.members[i]?.id;
|
|
397
403
|
if (!wanted.has(id)) continue;
|
|
398
404
|
const member = canonical.get(id);
|
|
399
|
-
if (member) projection.members[i] = projectMember(member, projection, session);
|
|
405
|
+
if (member) projection.members[i] = projectMember(member, projection, session, model);
|
|
400
406
|
}
|
|
401
407
|
patchCount += wanted.size;
|
|
402
408
|
return projection;
|
|
@@ -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…").
|