@floless/app 0.122.0 → 0.123.1

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/web/app.css CHANGED
@@ -40,6 +40,63 @@
40
40
  background-position: -1px -1px;
41
41
  }
42
42
 
43
+ /* Global checkbox theming, deliberately placed HERE — as a base element rule, ahead of every
44
+ component — for two reasons that both matter.
45
+ WHY IT EXISTS: CLAUDE.md's "Style EVERY control, including the secondary/native ones — no browser
46
+ default may leak through" names checkboxes outright, and this surface satisfied it in exactly two
47
+ places (.modal-check / .rev-check, below). Everywhere else — .fm-check-row, .int-flow, and every
48
+ box aware.js/workspaces.js builds for the Review and Migrate lists — carried `accent-color` alone,
49
+ which tints only the CHECKED fill. The UNCHECKED box stayed the UA widget: a solid white square on
50
+ this #070a0f page. Same defect the radio guard was written for, one control over.
51
+ WHY EARLY: `.rtn-toggle input` (the switch pattern, ~line 1860) visually HIDES its checkbox and
52
+ paints .rtn-toggle-track instead. Its selector ties this one on specificity (0,1,1), so source
53
+ order alone decides — declared here, the switch still wins and keeps its slider. Moving this block
54
+ below it would put a 14px box beside every toggle in the app. */
55
+ input[type="checkbox"] {
56
+ appearance: none; -webkit-appearance: none; flex: none;
57
+ width: 16px; height: 16px;
58
+ border: 1px solid var(--border-strong); border-radius: 4px; background: var(--surface-2);
59
+ cursor: pointer; display: inline-grid; place-content: center;
60
+ transition: border-color 0.12s, background 0.12s;
61
+ }
62
+ /* 10px, the size .modal-check always used — NOT a percentage. The box is `display:inline-grid` with
63
+ `place-content:center`, so its grid track is sized BY this item; a `width:62%` here resolves against
64
+ a track that is itself waiting on the item, and the tick lays out 0x0. Measured at 6x in Chromium
65
+ after exactly that: every checked box painted a solid accent square with no check in it, and no
66
+ guard could have said so — verify-native-controls reads DECLARATIONS, and `width:62%` is a
67
+ perfectly present one. */
68
+ input[type="checkbox"]::before {
69
+ content: ""; width: 10px; height: 10px; transform: scale(0); transition: transform 0.12s ease;
70
+ background: var(--accent-bright);
71
+ clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
72
+ }
73
+ input[type="checkbox"]:checked { border-color: var(--accent); background: var(--accent-soft); }
74
+ input[type="checkbox"]:checked::before { transform: scale(1); }
75
+ input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
76
+ /* INDETERMINATE. `appearance:none` deletes the platform's mixed-state dash along with the box, and
77
+ only `:checked` reveals the tick — so a checkbox put in the mixed state renders exactly like an
78
+ unchecked one, quietly reporting "no" where the truth is "the selection disagrees". Declared on
79
+ every surface so the next one to set `.indeterminate` inherits it rather than re-learning this.
80
+ (Raised by the Codex review on #592.) */
81
+ input[type="checkbox"]:indeterminate { border-color: var(--accent); background: var(--accent-soft); }
82
+ input[type="checkbox"]:indeterminate::before { transform: scale(1); clip-path: none; height: 2px; border-radius: 1px; }
83
+ /* FORCED COLORS (Windows High Contrast). The OS overrides every authored colour, so the custom box's
84
+ fill and its clipped ::before both collapse to system colours and the two states stop being
85
+ tellable apart. Hand the platform its own widget back: in that mode the UA control is the
86
+ accessible one, and the white-on-dark leak this rule exists to fix cannot arise, because the OS —
87
+ not this stylesheet — is choosing the colours. `revert` rolls each declaration back to the UA
88
+ origin. The switch pattern is unaffected: `.rtn-toggle input` still hides its input by opacity and
89
+ position, neither of which is reverted here.
90
+ NOTE for the guard: verify-native-controls deliberately cannot see inside a conditional @media, so
91
+ this block neither satisfies nor weakens it. (Raised by the Codex review on #592.) */
92
+ @media (forced-colors: active) {
93
+ input[type="checkbox"] {
94
+ appearance: revert; -webkit-appearance: revert; width: revert; height: revert;
95
+ border: revert; background: revert; display: revert;
96
+ }
97
+ input[type="checkbox"]::before { content: none; }
98
+ }
99
+
43
100
  /* ========== LAYOUT ========== */
44
101
  .app {
45
102
  display: grid;
@@ -1268,21 +1325,11 @@
1268
1325
  /* Consent checkbox (fork liability terms) — inline label + fully themed box (no native
1269
1326
  default leaks the dark baseline). Custom checkmark via clip-path, accent on check. */
1270
1327
  .modal-check, .rev-check { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; font-size: 12.5px; line-height: 1.5; color: var(--text-muted); margin: 2px 0 4px; }
1271
- .modal-check input[type="checkbox"], .rev-check input[type="checkbox"] {
1272
- appearance: none; -webkit-appearance: none; flex: none;
1273
- width: 16px; height: 16px; margin: 1px 0 0;
1274
- border: 1px solid var(--border-strong); border-radius: 4px; background: var(--surface-2);
1275
- cursor: pointer; display: grid; place-content: center;
1276
- transition: border-color 0.12s, background 0.12s;
1277
- }
1278
- .modal-check input[type="checkbox"]::before, .rev-check input[type="checkbox"]::before {
1279
- content: ""; width: 10px; height: 10px; transform: scale(0); transition: transform 0.12s ease;
1280
- background: var(--accent-bright);
1281
- clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
1282
- }
1283
- .modal-check input[type="checkbox"]:checked, .rev-check input[type="checkbox"]:checked { border-color: var(--accent); background: var(--accent-soft); }
1284
- .modal-check input[type="checkbox"]:checked::before, .rev-check input[type="checkbox"]:checked::before { transform: scale(1); }
1285
- .modal-check input[type="checkbox"]:focus-visible, .rev-check input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
1328
+ /* The box, tick, :checked and focus ring these two used to declare for themselves are now the global
1329
+ input[type="checkbox"] rule near the top of this file — same values, applied everywhere instead of
1330
+ to the two containers that happened to ask. All that is left here is the alignment nudge that keeps
1331
+ the box on the first line of a wrapping label. */
1332
+ .modal-check input[type="checkbox"], .rev-check input[type="checkbox"] { margin: 1px 0 0; }
1286
1333
  .modal-check span, .rev-check span { user-select: none; }
1287
1334
  .modal-categories { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; }
1288
1335
  .modal-categories button {
@@ -1368,7 +1415,12 @@
1368
1415
  background:var(--surface-2); border:1px solid var(--border); border-radius:6px; padding:9px 11px;
1369
1416
  }
1370
1417
  .fm-check-row.on { border-color:var(--accent-dim); }
1371
- .fm-check-row input[type="checkbox"] { width:13px; height:13px; margin:2px 0 0; accent-color:var(--accent); }
1418
+ /* Size and accent-color both dropped, deliberately. The 13px was chosen to match the NATIVE
1419
+ checkbox's own size back when accent-color left the UA widget in place; now that the global rule
1420
+ replaces the widget, 13px just squeezed the 10px tick against its border while .modal-check — the
1421
+ same control, in the same modal system — sat at 16px. Inheriting the base rule makes the modal
1422
+ family one size again. */
1423
+ .fm-check-row input[type="checkbox"] { margin:1px 0 0; }
1372
1424
  /* Dimmed, but NOT natively disabled — the row stays tabbable so the reason beside it is
1373
1425
  reachable. Opacity is on the box alone; the reason text must keep its full contrast. */
1374
1426
  .fm-check-row.off input[type="checkbox"] { opacity:.4; cursor:not-allowed; }
@@ -1849,7 +1901,12 @@
1849
1901
 
1850
1902
  /* Toggle switch — no switch existed in the app; this is the one new control. */
1851
1903
  .rtn-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; position: relative; }
1852
- .rtn-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
1904
+ /* border/padding:0 are not decoration — the global input[type="checkbox"] rule above gives every
1905
+ checkbox a 1px border, and under the `* { box-sizing: border-box }` reset a `width:0` element still
1906
+ floors to its borders, so this visually-hidden input laid out as a 2px box. It is `opacity:0` and
1907
+ absolutely positioned, so nothing showed; stripping them keeps the switch's real size at 0 rather
1908
+ than resting on the opacity to hide an artifact. */
1909
+ .rtn-toggle input { position: absolute; opacity: 0; width: 0; height: 0; border: 0; padding: 0; }
1853
1910
  .rtn-toggle-track { position: relative; width: 30px; height: 17px; border-radius: 999px; background: var(--border-strong); transition: background 0.15s; flex-shrink: 0; }
1854
1911
  .rtn-toggle-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--text-muted); transition: transform 0.15s, background 0.15s; }
1855
1912
  .rtn-toggle input:checked + .rtn-toggle-track { background: var(--accent); }
package/dist/web/app.js CHANGED
@@ -1339,7 +1339,7 @@ function showToast(msg, type) {
1339
1339
  };
1340
1340
  // Errors stay until dismissed (they carry an action to read); warnings linger
1341
1341
  // longer; info/ok auto-dismiss. warn/err get an × so they can be closed early.
1342
- const ms = { ok: 2500, info: 2500, warn: 5000, err: 0 }[type] ?? 2500;
1342
+ const ms = { ok: 2500, info: 2500, warn: 5000, err: 0, progress: 0 }[type] ?? 2500;
1343
1343
  if (type === 'warn' || type === 'err') {
1344
1344
  const x = document.createElement('button');
1345
1345
  x.className = 'toast-close';
@@ -1351,6 +1351,7 @@ function showToast(msg, type) {
1351
1351
  }
1352
1352
  c.appendChild(t);
1353
1353
  if (ms > 0) setTimeout(dismiss, ms);
1354
+ return dismiss;
1354
1355
  }
1355
1356
 
1356
1357
  /* ============= ZOOM + PAN ============= */
@@ -39,7 +39,17 @@ const parseInches = (raw) => {
39
39
  return NaN;
40
40
  };
41
41
 
42
- /** mm per display px for a plan scale (matches steel-3d-core kOf). */
42
+ /**
43
+ * mm per display px for a plan scale — THE one implementation of the plan display scale.
44
+ *
45
+ * It lives in this leaf module because five copies of `FT_MM / (ptPerFt > 0 ? ptPerFt : 1)` had grown
46
+ * (here, steel-3d-core's `kOf`, steel-model-adapter's and steel-model-commands' `scaleOf`, and inline
47
+ * in steel-plan-transform and server/contract-to-scene), each carrying a comment telling the next
48
+ * reader to keep it in lock-step with the others by hand. They all import this now.
49
+ *
50
+ * A missing, zero or negative `pt_per_ft` reads as 1 pt/ft rather than dividing by it, so an
51
+ * unscaled sheet degrades to a 1:1 map instead of putting Infinity or a mirrored scale into geometry.
52
+ */
43
53
  export const mmPerPx = (ptPerFt) => FT_MM / (ptPerFt > 0 ? ptPerFt : 1);
44
54
 
45
55
  /** One length token → mm, or NaN. Accepts 25' | 25'-6 1/2" | 6 1/2" | 1/2" | 7.5m | 6096 (mm) | 6096mm; leading '-' negates. */
@@ -11,6 +11,8 @@
11
11
  * needs it).
12
12
  */
13
13
 
14
+ import { mmPerPx } from './grid-core.js';
15
+
14
16
  export const FT_TO_MM = 304.8;
15
17
  export const IN_TO_MM = 25.4;
16
18
 
@@ -124,15 +126,17 @@ export function projectedFootprintHitsRect2d(points, rect, windowMode) {
124
126
  return true;
125
127
  }
126
128
 
127
- const kOf = (ptPerFt) => FT_TO_MM / (ptPerFt > 0 ? ptPerFt : 1);
128
-
129
129
  const nz = (n) => n + 0; // normalize -0 → 0 (negating 0 yields -0, which surprises equality checks)
130
130
 
131
- /** display-space wp point → scene mm [x,y] (Y flipped, matching contractToScene.dispToMm). */
132
- export function dispToMm(pt, ptPerFt) { const k = kOf(ptPerFt); return [nz(pt[0] * k), nz(-pt[1] * k)]; }
131
+ /**
132
+ * display-space wp point → scene mm [x,y] (Y flipped). THE one display→mm conversion: the adapter and
133
+ * server/contract-to-scene each used to carry their own copy of `[x·k, -y·k]`, with a comment on each
134
+ * naming the others as mirrors to keep by hand.
135
+ */
136
+ export function dispToMm(pt, ptPerFt) { const k = mmPerPx(ptPerFt); return [nz(pt[0] * k), nz(-pt[1] * k)]; }
133
137
 
134
138
  /** scene mm point [x,y,…] → display-space wp [px,py] (inverse of dispToMm). */
135
- export function planPointToWp(p, ptPerFt) { const k = kOf(ptPerFt); return [nz(p[0] / k), nz(-p[1] / k)]; }
139
+ export function planPointToWp(p, ptPerFt) { const k = mmPerPx(ptPerFt); return [nz(p[0] / k), nz(-p[1] / k)]; }
136
140
 
137
141
  /**
138
142
  * The px→ft scale and default T.O.S of the plan that OWNS a member, resolved from the SAME per-plan
@@ -878,7 +882,7 @@ export function selectedLengthLabelAnchors(labels, members, geometryOf) {
878
882
  * Snap targets from v2 members — the v2 sibling of `snapCandidates`, emitting the identical record shapes
879
883
  * so `snapPoint`'s precedence table and `candidatePoint` need no v2 case.
880
884
  *
881
- * WHY THIS IS NOT `snapCandidates(members, 304.8, 0, excludeId)`. That nearly works — `kOf(304.8)` is 1 —
885
+ * WHY THIS IS NOT `snapCandidates(members, 304.8, 0, excludeId)`. That nearly works — `mmPerPx(304.8)` is 1 —
882
886
  * and is wrong twice: it would still negate Y (v2 coordinates are already world), and it would still read
883
887
  * `m.wp`/`m.col`/`m.ends`, which a v2 member does not have. A v2 member routed through the v1 function
884
888
  * does not throw; it yields NaN candidates that snap silently to nowhere. Silence is the failure mode.