fsanyoto commited on
Commit
3dda967
·
verified ·
1 Parent(s): 4cfab62

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
RELEASES.json CHANGED
@@ -1,6 +1,12 @@
1
  {
2
- "current": "v40 (1451837)",
3
  "releases": [
 
 
 
 
 
 
4
  {
5
  "version": "v40",
6
  "sha": "1451837",
 
1
  {
2
+ "current": "v41 (1d6adcc)",
3
  "releases": [
4
+ {
5
+ "version": "v41",
6
+ "sha": "1d6adcc",
7
+ "date": "2026-08-22",
8
+ "subject": "v41 vertical route navigation"
9
+ },
10
  {
11
  "version": "v40",
12
  "sha": "1451837",
VERSION CHANGED
@@ -1 +1 @@
1
- v40 (1451837)
 
1
+ v41 (1d6adcc)
web/src/customer-grid/CustomerGrid.tsx CHANGED
@@ -1935,10 +1935,7 @@ function CustomerGridSurface({
1935
  // the same reason grouping is off there).
1936
  const displaySpec = cleanDisplay(config.display);
1937
  const displayMode: DisplayMode = serverWindowed ? "grid" : displaySpec?.mode ?? "grid";
1938
- const [routeOpenSignal, setRouteOpenSignal] = useState(0);
1939
- const [routeOpen, setRouteOpen] = useState(false);
1940
- const openRoute = useCallback(() => setRouteOpenSignal((current) => current + 1), []);
1941
- const onRouteOpenChange = useCallback((open: boolean) => setRouteOpen(open), []);
1942
 
1943
  // ═══════════════════════════════════════════════════════════════════════════════════════
1944
  // ⭐⭐ WAVE 30 · W30-T42 (contract C2) — PAGING A READ-THROUGH GRID.
@@ -6400,9 +6397,6 @@ function CustomerGridSurface({
6400
  // bubble-size picker feeds from, so "what can be totalled" has one definition.
6401
  metricChoices={sizeFieldChoices}
6402
  onCalendarMetrics={setCalendarMetrics}
6403
- routeOpen={routeOpen}
6404
- onOpenRoute={displayMode === "map" ? openRoute : undefined}
6405
- routeDisabled={selectedPids.size < 2}
6406
  />
6407
  );
6408
  // ⭐ Wave-23 C7 — the open document, resolved exactly like the picker's value below it:
@@ -6748,6 +6742,9 @@ function CustomerGridSurface({
6748
  onToggleImportant={toggleViewImportant}
6749
  />
6750
  )}
 
 
 
6751
  {/* ⭐⭐ W37-T29 / CONTRACT C6 (rulings R2, R10) — E's CHAT, DOCKED AND OPENABLE.
6752
  ⛔ THE LAUNCHER SHIPS IN THE SAME CHANGE AS THE MOUNT, and that is not tidiness: a panel
6753
  whose only entry point is a prop nobody flips is mounted-but-never-offered, which is the
@@ -7370,8 +7367,7 @@ function CustomerGridSurface({
7370
  selectedPids={selectedPids}
7371
  onSelectPids={selectPids}
7372
  onOpen={setDetailPid}
7373
- routeOpenSignal={routeOpenSignal}
7374
- onRouteOpenChange={onRouteOpenChange}
7375
  />
7376
  )}
7377
  {/* Owner item 19 — the hover-only Expand. The COUNTERPART to item 17: the single
 
1935
  // the same reason grouping is off there).
1936
  const displaySpec = cleanDisplay(config.display);
1937
  const displayMode: DisplayMode = serverWindowed ? "grid" : displaySpec?.mode ?? "grid";
1938
+ const [routeRailHost, setRouteRailHost] = useState<HTMLDivElement | null>(null);
 
 
 
1939
 
1940
  // ═══════════════════════════════════════════════════════════════════════════════════════
1941
  // ⭐⭐ WAVE 30 · W30-T42 (contract C2) — PAGING A READ-THROUGH GRID.
 
6397
  // bubble-size picker feeds from, so "what can be totalled" has one definition.
6398
  metricChoices={sizeFieldChoices}
6399
  onCalendarMetrics={setCalendarMetrics}
 
 
 
6400
  />
6401
  );
6402
  // ⭐ Wave-23 C7 — the open document, resolved exactly like the picker's value below it:
 
6742
  onToggleImportant={toggleViewImportant}
6743
  />
6744
  )}
6745
+ {displayMode === "map" && (
6746
+ <div className="cg-route-slot" ref={setRouteRailHost} aria-label="Route navigation" />
6747
+ )}
6748
  {/* ⭐⭐ W37-T29 / CONTRACT C6 (rulings R2, R10) — E's CHAT, DOCKED AND OPENABLE.
6749
  ⛔ THE LAUNCHER SHIPS IN THE SAME CHANGE AS THE MOUNT, and that is not tidiness: a panel
6750
  whose only entry point is a prop nobody flips is mounted-but-never-offered, which is the
 
7367
  selectedPids={selectedPids}
7368
  onSelectPids={selectPids}
7369
  onOpen={setDetailPid}
7370
+ routeRailHost={routeRailHost}
 
7371
  />
7372
  )}
7373
  {/* Owner item 19 — the hover-only Expand. The COUNTERPART to item 17: the single
web/src/customer-grid/MapView.tsx CHANGED
@@ -53,6 +53,7 @@
53
  // ---------------------------------------------------------------------------
54
 
55
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
 
56
  import type { KeyboardEvent as ReactKeyboardEvent, PointerEvent as ReactPointerEvent } from "react";
57
  import type { Field, Row } from "./types";
58
  import { formatDisplay } from "./cells";
@@ -216,8 +217,7 @@ export function MapView({
216
  onSelectPids,
217
  onOpen,
218
  onGeocoded,
219
- routeOpenSignal,
220
- onRouteOpenChange,
221
  }: {
222
  /** DISTINCT data rows from the full pipeline, overlay edits layered — the
223
  * calendar/kanban contract, verbatim. */
@@ -253,8 +253,7 @@ export function MapView({
253
  * arrangement in which a person can run a lookup whose results have nowhere to land.
254
  */
255
  onGeocoded?: (writes: { pid: number; value: string }[]) => void;
256
- routeOpenSignal?: number;
257
- onRouteOpenChange?: (open: boolean) => void;
258
  }) {
259
  const [hoverPid, setHoverPid] = useState<number | null>(null);
260
  // I18-R — the route planner. Off until asked for: a route drawn over a
@@ -262,7 +261,6 @@ export function MapView({
262
  const [routeOn, setRouteOn] = useState(false);
263
  const [roundTrip, setRoundTrip] = useState(false);
264
  const [routeStartPid, setRouteStartPid] = useState<number | null>(null);
265
- const routeOpenSignalSeen = useRef<number | undefined>(routeOpenSignal);
266
  const askRoadRef = useRef(false);
267
  /**
268
  * W37-T36 — A HAND-PICKED STOP ORDER, pids in visiting sequence, or null for the planner's.
@@ -585,19 +583,6 @@ export function MapView({
585
  .sort((a, b) => a.pid - b.pid),
586
  [points, selectedPids]
587
  );
588
- useEffect(() => {
589
- if (routeOpenSignal == null || routeOpenSignal === routeOpenSignalSeen.current) return;
590
- routeOpenSignalSeen.current = routeOpenSignal;
591
- if (customerRoutable.length < 2) return;
592
- setRouteOn(true);
593
- setRouteOrder(null);
594
- askRoadRef.current = true;
595
- }, [routeOpenSignal, customerRoutable.length]);
596
-
597
- useEffect(() => {
598
- onRouteOpenChange?.(routeOn);
599
- }, [routeOn, onRouteOpenChange]);
600
-
601
  useEffect(() => {
602
  if (routeOn && customerRoutable.length < 2) {
603
  setRouteOn(false);
@@ -1453,7 +1438,17 @@ export function MapView({
1453
  {/* I18-R — the route planner. Appears only with a multi-pin selection, so
1454
  it is mutually exclusive with the single-pin links above and the bar
1455
  never carries both. */}
1456
- {selectedPids.size >= 2 && (
 
 
 
 
 
 
 
 
 
 
1457
  <span className="cg-map-route">
1458
  {!routeOn ? (
1459
  <button
@@ -1731,7 +1726,15 @@ export function MapView({
1731
  </span>
1732
  )}
1733
  </span>
1734
- )}
 
 
 
 
 
 
 
 
1735
  {/* ⭐⭐ W37-T37 (R4 / R3 / R14) — LOOK UP THE ADDRESSES OF THE RECORDS YOU CHOSE.
1736
  It lives HERE, on the map, because this is the surface where the absence is felt: you
1737
  are looking at a picture with a chip saying N records have no location, and the answer
 
53
  // ---------------------------------------------------------------------------
54
 
55
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
56
+ import { createPortal } from "react-dom";
57
  import type { KeyboardEvent as ReactKeyboardEvent, PointerEvent as ReactPointerEvent } from "react";
58
  import type { Field, Row } from "./types";
59
  import { formatDisplay } from "./cells";
 
217
  onSelectPids,
218
  onOpen,
219
  onGeocoded,
220
+ routeRailHost,
 
221
  }: {
222
  /** DISTINCT data rows from the full pipeline, overlay edits layered — the
223
  * calendar/kanban contract, verbatim. */
 
253
  * arrangement in which a person can run a lookup whose results have nowhere to land.
254
  */
255
  onGeocoded?: (writes: { pid: number; value: string }[]) => void;
256
+ routeRailHost?: HTMLElement | null;
 
257
  }) {
258
  const [hoverPid, setHoverPid] = useState<number | null>(null);
259
  // I18-R — the route planner. Off until asked for: a route drawn over a
 
261
  const [routeOn, setRouteOn] = useState(false);
262
  const [roundTrip, setRoundTrip] = useState(false);
263
  const [routeStartPid, setRouteStartPid] = useState<number | null>(null);
 
264
  const askRoadRef = useRef(false);
265
  /**
266
  * W37-T36 — A HAND-PICKED STOP ORDER, pids in visiting sequence, or null for the planner's.
 
583
  .sort((a, b) => a.pid - b.pid),
584
  [points, selectedPids]
585
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
586
  useEffect(() => {
587
  if (routeOn && customerRoutable.length < 2) {
588
  setRouteOn(false);
 
1438
  {/* I18-R — the route planner. Appears only with a multi-pin selection, so
1439
  it is mutually exclusive with the single-pin links above and the bar
1440
  never carries both. */}
1441
+ {routeRailHost &&
1442
+ createPortal(
1443
+ <aside className="cg-route-rail" aria-label="Route navigation">
1444
+ <div className="cg-route-rail-head">
1445
+ <span className="cg-views-title">Route</span>
1446
+ <span className="cg-route-rail-count">
1447
+ {selectedPids.size >= 2 ? `${selectedPids.size} selected` : "Select records"}
1448
+ </span>
1449
+ </div>
1450
+ <div className="cg-route-rail-body">
1451
+ {selectedPids.size >= 2 ? (
1452
  <span className="cg-map-route">
1453
  {!routeOn ? (
1454
  <button
 
1726
  </span>
1727
  )}
1728
  </span>
1729
+ ) : (
1730
+ <span className="cg-route-empty">
1731
+ Select at least two records to plan a route.
1732
+ </span>
1733
+ )}
1734
+ </div>
1735
+ </aside>,
1736
+ routeRailHost
1737
+ )}
1738
  {/* ⭐⭐ W37-T37 (R4 / R3 / R14) — LOOK UP THE ADDRESSES OF THE RECORDS YOU CHOSE.
1739
  It lives HERE, on the map, because this is the surface where the absence is felt: you
1740
  are looking at a picture with a chip saying N records have no location, and the answer
web/src/customer-grid/map.css CHANGED
@@ -99,27 +99,31 @@
99
 
100
  /* --- the ordered stop list (T36) ------------------------------------------
101
  *
102
- * The route's stops as a row of numbered chips with move controls. Inline in the map bar rather
103
- * than in a panel: reordering is a thing people do WHILE looking at the map, and a dialog over the
104
- * picture would hide the answer they are reordering against.
105
  */
106
 
107
  .cg-map-stoplist {
108
- display: inline-flex;
109
- align-items: center;
 
110
  gap: 4px;
111
  flex: 0 0 auto;
112
- flex-wrap: nowrap;
113
- max-width: min(720px, 100%);
114
- overflow-x: auto;
 
115
  padding-bottom: 2px;
116
  scrollbar-width: thin;
117
  }
118
 
119
  .cg-map-stopitem {
120
- display: inline-flex;
121
  align-items: center;
122
  gap: 2px;
 
 
123
  padding: 1px 2px 1px 4px;
124
  border: 1px solid #dfe3ea;
125
  border-radius: 11px;
@@ -141,7 +145,9 @@
141
  }
142
 
143
  .cg-map-stopname {
144
- max-width: 108px;
 
 
145
  overflow: hidden;
146
  text-overflow: ellipsis;
147
  white-space: nowrap;
 
99
 
100
  /* --- the ordered stop list (T36) ------------------------------------------
101
  *
102
+ * The route's stops are a vertical stack of numbered chips with move controls in the route rail
103
+ * beside View. The map remains visible beside the rail, so reordering is still done while looking
104
+ * at the picture without putting route chrome across its header.
105
  */
106
 
107
  .cg-map-stoplist {
108
+ display: flex;
109
+ flex-direction: column;
110
+ align-items: stretch;
111
  gap: 4px;
112
  flex: 0 0 auto;
113
+ width: 100%;
114
+ max-width: none;
115
+ max-height: 240px;
116
+ overflow-y: auto;
117
  padding-bottom: 2px;
118
  scrollbar-width: thin;
119
  }
120
 
121
  .cg-map-stopitem {
122
+ display: flex;
123
  align-items: center;
124
  gap: 2px;
125
+ min-width: 0;
126
+ width: 100%;
127
  padding: 1px 2px 1px 4px;
128
  border: 1px solid #dfe3ea;
129
  border-radius: 11px;
 
145
  }
146
 
147
  .cg-map-stopname {
148
+ min-width: 0;
149
+ max-width: none;
150
+ flex: 1 1 auto;
151
  overflow: hidden;
152
  text-overflow: ellipsis;
153
  white-space: nowrap;
web/src/customer-grid/viewModes.tsx CHANGED
@@ -106,9 +106,6 @@ export function ModeSwitch({
106
  calendarMetrics = [],
107
  metricChoices = [],
108
  onCalendarMetrics,
109
- routeOpen = false,
110
- onOpenRoute,
111
- routeDisabled = false,
112
  }: {
113
  mode: DisplayMode;
114
  onMode: (m: DisplayMode) => void;
@@ -176,9 +173,6 @@ export function ModeSwitch({
176
  calendarMetrics?: { id: string; field: string; agg: string }[];
177
  metricChoices?: Field[];
178
  onCalendarMetrics?: (next: { id: string; field: string; agg: string }[]) => void;
179
- routeOpen?: boolean;
180
- onOpenRoute?: () => void;
181
- routeDisabled?: boolean;
182
  }) {
183
  // Wave-7 item W12: the switcher is a DROPDOWN in the toolbar-button family — the
184
  // same Popover component Fields/Filter/Sort use, radio rows inside (the Rows/Color
@@ -272,25 +266,6 @@ export function ModeSwitch({
272
  date field and a board without a stack field are not modes, so the picker is never
273
  in its placeholder state here unless the view names a field the table has lost —
274
  which it now SHOWS rather than silently replacing with the first choice. */}
275
- {mode === "map" && onOpenRoute && (
276
- <button
277
- type="button"
278
- className={"cg-tb-btn cg-route-nav" + (routeOpen ? " is-active" : "")}
279
- aria-pressed={routeOpen}
280
- disabled={routeDisabled}
281
- onClick={onOpenRoute}
282
- title={
283
- routeDisabled
284
- ? "Select at least two records to plan a route"
285
- : routeOpen
286
- ? "The route planner is open below the map toolbar"
287
- : "Plan a route from the selected records"
288
- }
289
- >
290
- <ModeIcon mode="map" />
291
- <span className="cg-tb-label">Route</span>
292
- </button>
293
- )}
294
  {mode === "calendar" && dateChoices.length > 0 && (
295
  <FieldSelectButton
296
  className="cg-mode-field"
 
106
  calendarMetrics = [],
107
  metricChoices = [],
108
  onCalendarMetrics,
 
 
 
109
  }: {
110
  mode: DisplayMode;
111
  onMode: (m: DisplayMode) => void;
 
173
  calendarMetrics?: { id: string; field: string; agg: string }[];
174
  metricChoices?: Field[];
175
  onCalendarMetrics?: (next: { id: string; field: string; agg: string }[]) => void;
 
 
 
176
  }) {
177
  // Wave-7 item W12: the switcher is a DROPDOWN in the toolbar-button family — the
178
  // same Popover component Fields/Filter/Sort use, radio rows inside (the Rows/Color
 
266
  date field and a board without a stack field are not modes, so the picker is never
267
  in its placeholder state here unless the view names a field the table has lost —
268
  which it now SHOWS rather than silently replacing with the first choice. */}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  {mode === "calendar" && dateChoices.length > 0 && (
270
  <FieldSelectButton
271
  className="cg-mode-field"
web/src/index.css CHANGED
@@ -351,6 +351,60 @@ body {
351
  flex-direction: column;
352
  }
353
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
354
  .cg-grid-box {
355
  position: relative;
356
  flex: 1 1 auto;
@@ -4674,9 +4728,8 @@ body > .cg-overlay {
4674
  align-items: center;
4675
  gap: 10px;
4676
  margin-bottom: 8px;
4677
- /* I18-R adds the route controls here; they only appear with a multi-pin
4678
- selection, and when they do the row must wrap rather than push the gesture
4679
- hint off the edge. */
4680
  flex-wrap: wrap;
4681
  row-gap: 6px;
4682
  }
@@ -4914,20 +4967,32 @@ a.cg-map-ctl-b { text-decoration: none; }
4914
 
4915
  /* Wave-9 I18-R — the route planner. Sequencing is ours (free arithmetic); the
4916
  roads are Google's, reached by the same key-less URL as the rest of the
4917
- hand-off. Nothing here fetches anything. */
4918
  .cg-map-route {
4919
  display: flex;
4920
- align-items: center;
4921
- gap: 10px;
4922
- flex: 1 1 100%;
 
4923
  width: 100%;
4924
  font-size: var(--lp-fs-3xs);
4925
  min-width: 0;
4926
- flex-wrap: nowrap;
4927
- overflow-x: auto;
4928
- padding-bottom: 2px;
4929
- scrollbar-width: thin;
 
 
 
 
 
 
 
 
 
4930
  }
 
 
4931
  .cg-map-route-go {
4932
  flex: 0 0 auto;
4933
  height: 22px;
 
351
  flex-direction: column;
352
  }
353
 
354
+ /* Route navigation is a sibling rail, not map chrome. The planner is portalled into this slot
355
+ by MapView so every route control stays beside View navigation while the map remains the work
356
+ surface. It deliberately uses the same rail token and fold rhythm as `.cg-views`. */
357
+ .cg-route-slot {
358
+ flex: 0 0 var(--lp-rail-w);
359
+ width: var(--lp-rail-w);
360
+ min-width: var(--lp-rail-w);
361
+ height: 100%;
362
+ border-right: 1px solid var(--lp-line);
363
+ background: var(--lp-surface);
364
+ color: var(--cg-text);
365
+ overflow: hidden;
366
+ display: flex;
367
+ flex-direction: column;
368
+ }
369
+ .cg-route-rail {
370
+ width: 100%;
371
+ height: 100%;
372
+ min-width: 0;
373
+ padding: 0 8px 10px;
374
+ display: flex;
375
+ flex-direction: column;
376
+ overflow: hidden;
377
+ }
378
+ .cg-route-rail-head {
379
+ flex: 0 0 var(--lp-rail-head-h);
380
+ min-height: var(--lp-rail-head-h);
381
+ display: flex;
382
+ align-items: center;
383
+ justify-content: space-between;
384
+ gap: 8px;
385
+ margin: 0 -8px 8px;
386
+ padding: 0 8px;
387
+ border-bottom: 1px solid var(--lp-line);
388
+ }
389
+ .cg-route-rail-count {
390
+ color: var(--lp-muted);
391
+ font-size: var(--lp-fs-3xs);
392
+ white-space: nowrap;
393
+ }
394
+ .cg-route-rail-body {
395
+ min-height: 0;
396
+ overflow-y: auto;
397
+ padding: 0 2px;
398
+ scrollbar-width: thin;
399
+ }
400
+ .cg-route-empty {
401
+ display: block;
402
+ color: var(--lp-muted);
403
+ font-size: var(--lp-fs-2xs);
404
+ line-height: 1.45;
405
+ padding: 4px 2px;
406
+ }
407
+
408
  .cg-grid-box {
409
  position: relative;
410
  flex: 1 1 auto;
 
4728
  align-items: center;
4729
  gap: 10px;
4730
  margin-bottom: 8px;
4731
+ /* Route controls live in the sibling route rail; this row only carries map-local status and
4732
+ lookup controls. */
 
4733
  flex-wrap: wrap;
4734
  row-gap: 6px;
4735
  }
 
4967
 
4968
  /* Wave-9 I18-R — the route planner. Sequencing is ours (free arithmetic); the
4969
  roads are Google's, reached by the same key-less URL as the rest of the
4970
+ hand-off. The controls are rendered in the sibling route rail. */
4971
  .cg-map-route {
4972
  display: flex;
4973
+ flex-direction: column;
4974
+ align-items: stretch;
4975
+ gap: 8px;
4976
+ flex: 0 0 auto;
4977
  width: 100%;
4978
  font-size: var(--lp-fs-3xs);
4979
  min-width: 0;
4980
+ overflow: visible;
4981
+ }
4982
+ .cg-route-rail .cg-map-route-go { width: 100%; min-height: 28px; height: auto; text-align: left; white-space: normal; }
4983
+ .cg-route-rail .cg-map-route-sum { white-space: normal; line-height: 1.45; }
4984
+ .cg-route-rail .cg-map-route-opt {
4985
+ align-items: stretch;
4986
+ flex-direction: column;
4987
+ gap: 4px;
4988
+ white-space: normal;
4989
+ }
4990
+ .cg-route-rail .cg-map-route-opt:has(input[type="checkbox"]) {
4991
+ flex-direction: row;
4992
+ align-items: center;
4993
  }
4994
+ .cg-route-rail .cg-map-route-start { width: 100%; max-width: none; }
4995
+ .cg-route-rail .cg-map-route a { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
4996
  .cg-map-route-go {
4997
  flex: 0 0 auto;
4998
  height: 22px;