fsanyoto commited on
Commit
02fc3d1
Β·
verified Β·
1 Parent(s): 6e31d07

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
RELEASES.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "current": "898b8d4",
3
  "releases": [
4
  {
5
  "version": "v61",
 
1
  {
2
+ "current": "2c8f702",
3
  "releases": [
4
  {
5
  "version": "v61",
VERSION CHANGED
@@ -1 +1 @@
1
- 898b8d4
 
1
+ 2c8f702
platform/harness/measure_filter.py CHANGED
@@ -81,6 +81,24 @@ ADMITTED = {
81
  # other side of a measure-vs-measure) would divide by 100 twice, so it is applied to the
82
  # literal alone and the gate proves that by construction.
83
  'margin_pct': {'label': 'Gross Margin %', 'topic': 'sales_lines', 'input_scale': 100.0},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  # ⚠ COMPANY-LEVEL (2026-07-27, owner's ask). Credit notes carry team_id = 1 for everything,
85
  # so a business-unit total is not a thing that exists β€” `_query_parts` refuses one and the
86
  # live domain builder refuses one. `measure_fields(team_id)` therefore stops OFFERING these
 
81
  # other side of a measure-vs-measure) would divide by 100 twice, so it is applied to the
82
  # literal alone and the gate proves that by construction.
83
  'margin_pct': {'label': 'Gross Margin %', 'topic': 'sales_lines', 'input_scale': 100.0},
84
+ # ⭐⭐ W47-T29, ADMITTED AT /wave-validate 2026-08-31. The ticket's `done-when` says the grid's
85
+ # Metric field kind offers all six customer measures and it offered FOUR: `cogs` and `asp` were
86
+ # simply never added here, so the model layer could declare them and the picker still could not
87
+ # show them.
88
+ # β›” THIS IS NOT A WIDENING OF THE ADMISSION RULE, AND THAT IS THE POINT. The rule is the one
89
+ # `verify_measure_filter` asserts -- *every admitted measure decomposes into parity-checked bases
90
+ # only* -- and both clear it with NOTHING unbacked:
91
+ # cogs -> {revenue, margin} asp -> {revenue, units}
92
+ # `cogs` has the IDENTICAL base set to `margin_pct` directly above, which has been admitted all
93
+ # along, so withholding one while offering the other was an inconsistency rather than a policy.
94
+ # Neither adds a name to PARITY_CHECKED and neither needs a new `validate:` block: a composite
95
+ # inherits its contract from its components, which is exactly how `aov` and `margin_pct` are here.
96
+ # ⚠ `cogs` is `agg: derived` (revenue - margin), the first derived member of this list; `asp` is
97
+ # a SAME-TOPIC ratio, so unlike `aov` it survives a grouped store_query without _post_compute
98
+ # having to combine two topics. No `input_scale` on either: both are usd, not percentages, so
99
+ # there is no literal to rescale at the input boundary.
100
+ 'cogs': {'label': 'COGS', 'topic': 'sales_lines'},
101
+ 'asp': {'label': 'Avg selling price', 'topic': 'sales_lines'},
102
  # ⚠ COMPANY-LEVEL (2026-07-27, owner's ask). Credit notes carry team_id = 1 for everything,
103
  # so a business-unit total is not a thing that exists β€” `_query_parts` refuses one and the
104
  # live domain builder refuses one. `measure_fields(team_id)` therefore stops OFFERING these
web/src/customer-grid/MapView.tsx CHANGED
@@ -701,6 +701,34 @@ export function MapView({
701
  const [zoneEditorId, setZoneEditorId] = useState("");
702
  const [zoneName, setZoneName] = useState("");
703
  const [zoneColor, setZoneColor] = useState(ZONE_COLOR_CHOICES[0].value);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
704
  const [zoneDrawShape, setZoneDrawShape] = useState<"polygon" | "circle">("polygon");
705
  const [drawnZoneGeometry, setDrawnZoneGeometry] = useState<ZoneGeometry | null>(null);
706
  const [zoneKeyboardDraft, setZoneKeyboardDraft] = useState<{
@@ -3346,7 +3374,15 @@ export function MapView({
3346
  );
3347
 
3348
  return (
3349
- <div className="cg-mapview">
 
 
 
 
 
 
 
 
3350
  <div className="cg-map-bar">
3351
  {/* The count is "N of M", never a bare N: a pin can only be drawn for a
3352
  row the host geocoded, and a lone "1,402" silently redefines the
@@ -3635,6 +3671,28 @@ export function MapView({
3635
  {ZONE_COLOR_CHOICES.map((choice) => <option key={choice.value} value={choice.value}>{choice.label}</option>)}
3636
  </select>
3637
  </label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3638
  {/* β›”β›” W46-T28 β€” A MISSING NAME OR BOUNDARY NO LONGER DISABLES THIS BUTTON, and
3639
  that is the point rather than a loosening. A disabled control cannot say why it
3640
  is disabled, so the owner's "it won't even let me save" arrived with no reason
@@ -4262,7 +4320,7 @@ export function MapView({
4262
  zoneKeyboardDraft.cursor.x - zoneKeyboardDraft.center.x,
4263
  zoneKeyboardDraft.cursor.y - zoneKeyboardDraft.center.y
4264
  ))}
4265
- fill={zonePaint(zoneColor)} fillOpacity={LP_ZONE_FILL_OPACITY} stroke={zonePaint(zoneColor)}
4266
  strokeWidth="3" strokeDasharray="6 4"
4267
  />
4268
  )}
 
701
  const [zoneEditorId, setZoneEditorId] = useState("");
702
  const [zoneName, setZoneName] = useState("");
703
  const [zoneColor, setZoneColor] = useState(ZONE_COLOR_CHOICES[0].value);
704
+ /* ⭐⭐ OWNER, 2026-08-31: *"let's make the Zone opacity toggleable under the Zone configuration
705
+ module"*, in the same breath as correcting the fill to 80%. This state is the SINGLE WRITER of
706
+ both seams contract C1 names -- it drives the `--lp-zone-fill` custom property inline on
707
+ `.cg-mapview` AND the keyboard draft's `fillOpacity` attribute -- so the two can no longer
708
+ drift by hand, which is what C1 was asking a person to prevent.
709
+ ⚠ A DISPLAY PREFERENCE, NOT ZONE DATA, and that is a deliberate scope call on a hotfix. It is
710
+ stored per reader in `localStorage` rather than on the Zone record: persisting it server-side
711
+ would mean a `MapZoneDto` field, a route and a store write, which is a schema change and not a
712
+ hotfix. If the owner wants opacity to travel WITH a Zone to other viewers, that is the
713
+ follow-up this comment exists to name.
714
+ ⚠ `localStorage` can throw outright (private mode, blocked site data), so every read and
715
+ write is guarded and falls back to the token rather than leaving the map unpainted. */
716
+ const [zoneFillOpacity, setZoneFillOpacity] = useState<number>(() => {
717
+ try {
718
+ const raw = window.localStorage.getItem("cg-zone-fill-opacity");
719
+ const parsed = raw === null ? NaN : Number(raw);
720
+ return Number.isFinite(parsed) && parsed >= 0 && parsed <= 1 ? parsed : LP_ZONE_FILL_OPACITY;
721
+ } catch {
722
+ return LP_ZONE_FILL_OPACITY;
723
+ }
724
+ });
725
+ useEffect(() => {
726
+ try {
727
+ window.localStorage.setItem("cg-zone-fill-opacity", String(zoneFillOpacity));
728
+ } catch {
729
+ /* a reader who cannot store a preference still gets to SET one for this session */
730
+ }
731
+ }, [zoneFillOpacity]);
732
  const [zoneDrawShape, setZoneDrawShape] = useState<"polygon" | "circle">("polygon");
733
  const [drawnZoneGeometry, setDrawnZoneGeometry] = useState<ZoneGeometry | null>(null);
734
  const [zoneKeyboardDraft, setZoneKeyboardDraft] = useState<{
 
3374
  );
3375
 
3376
  return (
3377
+ <div
3378
+ className="cg-mapview"
3379
+ /* Both custom properties, from ONE number. The unsaved shape stays exactly half, which is
3380
+ the invariant `map-panels.css` says has already survived three retunes. */
3381
+ style={{
3382
+ "--lp-zone-fill": String(zoneFillOpacity),
3383
+ "--lp-zone-fill-unsaved": String(zoneFillOpacity / 2),
3384
+ } as React.CSSProperties}
3385
+ >
3386
  <div className="cg-map-bar">
3387
  {/* The count is "N of M", never a bare N: a pin can only be drawn for a
3388
  row the host geocoded, and a lone "1,402" silently redefines the
 
3671
  {ZONE_COLOR_CHOICES.map((choice) => <option key={choice.value} value={choice.value}>{choice.label}</option>)}
3672
  </select>
3673
  </label>
3674
+ {/* ⭐ OWNER 2026-08-31 - the opacity is a dial now, not a constant. It sits beside
3675
+ Color because both are how a Zone READS rather than what it covers, and it takes
3676
+ effect on every Zone the moment it moves: the value is the custom property the
3677
+ saved-Zone rule already consumes.
3678
+ ⚠ The reading is shown as a PERCENTAGE because that is the unit the instruction
3679
+ was given in ("80% opacity"), while the stored value stays the 0-1 fraction every
3680
+ consumer expects - the conversion happens at this boundary and nowhere else. */}
3681
+ <label className="cg-map-zone-control">
3682
+ Fill opacity
3683
+ <input
3684
+ type="range"
3685
+ className="cg-zone-opacity-range"
3686
+ min={0}
3687
+ max={100}
3688
+ step={5}
3689
+ value={Math.round(zoneFillOpacity * 100)}
3690
+ aria-label="Zone fill opacity"
3691
+ aria-valuetext={`${Math.round(zoneFillOpacity * 100)} percent`}
3692
+ onChange={(event) => setZoneFillOpacity(Number(event.currentTarget.value) / 100)}
3693
+ />
3694
+ <span className="cg-zone-opacity-read">{Math.round(zoneFillOpacity * 100)}%</span>
3695
+ </label>
3696
  {/* β›”β›” W46-T28 β€” A MISSING NAME OR BOUNDARY NO LONGER DISABLES THIS BUTTON, and
3697
  that is the point rather than a loosening. A disabled control cannot say why it
3698
  is disabled, so the owner's "it won't even let me save" arrived with no reason
 
4320
  zoneKeyboardDraft.cursor.x - zoneKeyboardDraft.center.x,
4321
  zoneKeyboardDraft.cursor.y - zoneKeyboardDraft.center.y
4322
  ))}
4323
+ fill={zonePaint(zoneColor)} fillOpacity={zoneFillOpacity} stroke={zonePaint(zoneColor)}
4324
  strokeWidth="3" strokeDasharray="6 4"
4325
  />
4326
  )}
web/src/customer-grid/theme.ts CHANGED
@@ -140,10 +140,19 @@ export const LP_MAP_SELECTED = "#1B4F9C";
140
  * `map-panels.css`: a lane declares the property beside the rule that reads it.
141
  * ⚠ THIS IS NOT ONLY A MIRROR: it is READ at the keyboard-draft polygon in `MapView.tsx`
142
  * (`fillOpacity={LP_ZONE_FILL_OPACITY}`), so editing it moves a painted surface too.
143
- * ⚠ The fill is now deliberately near-invisible, and that is the design rather than a floor to
144
- * be raised the next time a Zone reads faint. The legibility budget was moved to the stroke;
145
- * anyone tempted to push this number back up is undoing instruction 2. */
146
- export const LP_ZONE_FILL_OPACITY = 0.1;
 
 
 
 
 
 
 
 
 
147
  /** ⭐ W47-T01 β€” THE OTHER HALF OF INSTRUCTION 2, AND THE HALF A FILL CHANGE ALONE LOSES.
148
  * Dropping the fill to 0.1 makes a Zone read as almost nothing, so "the zone needs to be more
149
  * visible" has to be paid at the boundary. This is the stroke weight passed to `hair()` at every
 
140
  * `map-panels.css`: a lane declares the property beside the rule that reads it.
141
  * ⚠ THIS IS NOT ONLY A MIRROR: it is READ at the keyboard-draft polygon in `MapView.tsx`
142
  * (`fillOpacity={LP_ZONE_FILL_OPACITY}`), so editing it moves a painted surface too.
143
+ * β›”β›” CORRECTED BY THE OWNER 2026-08-31, AND THE PARAGRAPH THAT STOOD HERE WAS WRONG.
144
+ * It read: *"the fill is now deliberately near-invisible ... anyone tempted to push this number
145
+ * back up is undoing instruction 2."* W47-T01 had read instruction 2's "10% opacity" literally.
146
+ * The owner's correction, verbatim: *"i don't mean 10% I mean to say 80% opacity"* -- so 0.1 was
147
+ * a misreading of the instruction, not a design the next reader must defend.
148
+ * ⭐ AND IT IS NOW A DEFAULT RATHER THAN A CONSTANT. The same instruction asked for the opacity
149
+ * to be *"toggleable under the Zone configuration module"*, so this seeds `zoneFillOpacity` state
150
+ * in `MapView.tsx`, which drives BOTH seams at once (this token AND the `--lp-zone-fill` custom
151
+ * property, set inline on the map root). That makes contract C1 -- one number, two seams --
152
+ * structurally true rather than maintained by hand: there is now ONE writer.
153
+ * ⚠ The stroke budget W47-T01 bought stays: `LP_ZONE_STROKE_WIDTH` is unchanged, so a Zone
154
+ * dialled back down to a low fill still carries the boundary that made it findable. */
155
+ export const LP_ZONE_FILL_OPACITY = 0.8;
156
  /** ⭐ W47-T01 β€” THE OTHER HALF OF INSTRUCTION 2, AND THE HALF A FILL CHANGE ALONE LOSES.
157
  * Dropping the fill to 0.1 makes a Zone read as almost nothing, so "the zone needs to be more
158
  * visible" has to be paid at the boundary. This is the stroke weight passed to `hair()` at every
web/src/styles/wave46/map-panels.css CHANGED
@@ -133,8 +133,13 @@
133
  the rule: a second importer of MapView, or a reordered import line, silently flips it back and
134
  every gate stays green ([[a-lane-stylesheet-cannot-override-index-css]]). `.cg-map-svg
135
  .cg-map-zone` wins on SPECIFICITY (0,2,0 against 0,1,0), which no import order can undo. */
 
 
 
 
 
136
  :root {
137
- --lp-zone-fill: 0.1;
138
  }
139
 
140
  /* ⭐ W47-T01 (owner instruction 2). The FILL drops to 0.1 so the record dots read through a
@@ -196,8 +201,13 @@
196
  `hair()`, because this group renders inside the camera transform where a user-unit dash grows
197
  with the zoom, and the usual cure β€” `vector-effect: non-scaling-stroke` β€” is exactly what
198
  `verify_map.py`'s `map-css-no-non-scaling-stroke` leg reds the build over. */
 
 
 
 
 
199
  :root {
200
- --lp-zone-fill-unsaved: 0.05;
201
  }
202
 
203
  .cg-map-svg .cg-map-zone-unsaved {
@@ -641,3 +651,35 @@
641
  margin: 0;
642
  cursor: pointer;
643
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  the rule: a second importer of MapView, or a reordered import line, silently flips it back and
134
  every gate stays green ([[a-lane-stylesheet-cannot-override-index-css]]). `.cg-map-svg
135
  .cg-map-zone` wins on SPECIFICITY (0,2,0 against 0,1,0), which no import order can undo. */
136
+ /* β›” 0.1 -> 0.8, owner correction 2026-08-31: *"i don't mean 10% I mean to say 80% opacity"*.
137
+ ⭐ This is the FALLBACK now. `MapView.tsx` sets `--lp-zone-fill` inline on `.cg-mapview` from
138
+ its `zoneFillOpacity` state, so this value is what paints before that state mounts and after a
139
+ reader clears their stored preference. Both seams still hold one number (C1) -- and now they
140
+ cannot drift, because the component is the single writer of both. */
141
  :root {
142
+ --lp-zone-fill: 0.8;
143
  }
144
 
145
  /* ⭐ W47-T01 (owner instruction 2). The FILL drops to 0.1 so the record dots read through a
 
201
  `hair()`, because this group renders inside the camera transform where a user-unit dash grows
202
  with the zoom, and the usual cure β€” `vector-effect: non-scaling-stroke` β€” is exactly what
203
  `verify_map.py`'s `map-css-no-non-scaling-stroke` leg reds the build over. */
204
+ /* ⭐ STILL EXACTLY HALF, and this is the third retune the ratio has absorbed: 0.18 -> 0.4
205
+ (instruction 16), 0.4 -> 0.1 (W47-T01), and now 0.1 -> 0.8 (the owner's correction). A
206
+ hand-picked number would have stopped being "lighter than a saved Zone" at every one of them.
207
+ `MapView.tsx` computes the inline override as `zoneFillOpacity / 2`, so the ratio survives the
208
+ slider too. */
209
  :root {
210
+ --lp-zone-fill-unsaved: 0.4;
211
  }
212
 
213
  .cg-map-svg .cg-map-zone-unsaved {
 
651
  margin: 0;
652
  cursor: pointer;
653
  }
654
+
655
+ /* ═══════ OWNER 2026-08-31 β€” THE ZONE FILL OPACITY DIAL ═══════════════════════════════════════
656
+ *"let's make the Zone opacity toggleable under the Zone configuration module"*, alongside the
657
+ correction that instruction 2's "10% opacity" meant EIGHTY. The control sits in the Zone
658
+ configuration panel beside Color, and `MapView.tsx` owns its value.
659
+
660
+ ⚠ THE ROW IS A THREE-PART LABEL, so it needs its own shape: `.cg-map-zone-control` is a column
661
+ for a label over a single control, and this one carries a slider AND its reading. The reading is
662
+ `tabular-nums` and width-floored so the row does not jitter as the number crosses 9 -> 10 -> 100,
663
+ which is the kind of movement that reads as the panel being broken. */
664
+ .cg-map-zone-control:has(> .cg-zone-opacity-range) {
665
+ display: grid;
666
+ grid-template-columns: 1fr auto;
667
+ align-items: center;
668
+ gap: 4px 8px;
669
+ }
670
+ .cg-zone-opacity-range {
671
+ width: 100%;
672
+ min-width: 0;
673
+ accent-color: var(--lp-blue-solid);
674
+ cursor: pointer;
675
+ }
676
+ .cg-zone-opacity-range:focus-visible {
677
+ outline: 2px solid var(--lp-blue-deep);
678
+ outline-offset: 2px;
679
+ }
680
+ .cg-zone-opacity-read {
681
+ min-width: 4ch;
682
+ color: var(--lp-muted);
683
+ font-variant-numeric: tabular-nums;
684
+ text-align: right;
685
+ }