fsanyoto commited on
Commit
4872c31
·
verified ·
1 Parent(s): d4eb395

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
Files changed (3) hide show
  1. RELEASES.json +1 -1
  2. VERSION +1 -1
  3. web/src/customer-grid/MapView.tsx +19 -98
RELEASES.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "current": "43e061e",
3
  "releases": [
4
  {
5
  "version": "v64",
 
1
  {
2
+ "current": "9f6cfed",
3
  "releases": [
4
  {
5
  "version": "v64",
VERSION CHANGED
@@ -1 +1 @@
1
- 43e061e
 
1
+ 9f6cfed
web/src/customer-grid/MapView.tsx CHANGED
@@ -814,37 +814,6 @@ export function MapView({
814
  >(null);
815
  const [roadBusy, setRoadBusy] = useState(false);
816
  const [roadErr, setRoadErr] = useState<string | null>(null);
817
- /**
818
- * ⭐⭐ W38-T20 — THE ROUTE-ORDER COLUMNS THIS ACCOUNT MAY SEE, fetched rather than read off the
819
- * grid's `fields`.
820
- *
821
- * ⛔ TWO REASONS, AND THE SECOND IS THE REAL ONE. `MapView` is handed the field it PLOTS, not
822
- * the table's field list, so it could not find them anyway; and the useful half is not the
823
- * column, it is the INPUT FINGERPRINT each column was solved from, which the grid contract has
824
- * no business carrying to every reader of every row. `GET /customers/route-order` serves the
825
- * pair behind the same per-field wall the grid uses, so a column this account was not granted
826
- * is absent here exactly as it is absent there.
827
- * ⚠ `null` means NOT ASKED YET and `[]` means none exist. They are different states: the first
828
- * must not render "no saved orders".
829
- */
830
- const [routeCols, setRouteCols] = useState<
831
- {
832
- key: string;
833
- label: string;
834
- inputsHash: string;
835
- mine: boolean;
836
- stops?: number;
837
- solvedAt?: string;
838
- solvedBy?: string;
839
- note?: string;
840
- depot?: RouteDepot | null;
841
- }[] | null
842
- >(null);
843
- const [routeEditKey, setRouteEditKey] = useState("");
844
- const [routeEditName, setRouteEditName] = useState("");
845
- const [routeEditNote, setRouteEditNote] = useState("");
846
- const [routeEditBusy, setRouteEditBusy] = useState(false);
847
- const [routeEditErr, setRouteEditErr] = useState<string | null>(null);
848
  /** The legacy on-map planner still chunks a preview at ten stops. Scheduled normalized Routes
849
  * own their independently editable 2-10 choice inside RouteNav. */
850
  const mapsPerLink = 10;
@@ -875,22 +844,19 @@ export function MapView({
875
  * Owner: *"When we click the newly renamed 'Save route' it should prompt the user to Name the
876
  * route, with the default as Route 1, or Route 2, etc."*
877
  *
878
- * ⛔ `nextLabel` IS ALLOCATED SERVER-SIDE AND NEVER COMPUTED FROM `routeCols`. That list is
879
- * filtered by the per-field wall, so a user with no grant on `route_route_1` would be offered
880
- * "Route 1" as their pre-fill, send it, and be refused `field_key_taken` on a name this panel
881
- * put in the box for them. `GET /customers/route-order` allocates it over the WHOLE shared
882
- * stratum, which is a fact about absence and leaks nothing.
883
- *
884
- * ⚠ AND AN UNEDITED DEFAULT WAS SENT AS **NO LABEL AT ALL**. The door allocates the next free
885
- * name at the moment of the write, so a name that went stale between the panel opening and the
886
- * Save landing cannot become a refusal the user did not cause.
887
  *
888
- * ⛔ THE CLIENT SENDER IS GONE (W47-T09 / R9). Wave 44 retired this panel's surface, and the
889
- * only writer of `POST /customers/route-order` was deleted with it. `nextLabel` is still
890
- * allocated and stored here, unread, so that whoever puts the naming panel back reads this
891
- * paragraph before re-deriving the pre-fill from `routeCols`.
892
  */
893
- const [nextLabel, setNextLabel] = useState("");
894
  const [naming, setNaming] = useState(false);
895
  const [nameDraft, setNameDraft] = useState("");
896
  const [saveBusy, setSaveBusy] = useState(false);
@@ -2339,19 +2305,6 @@ export function MapView({
2339
  * ROUTING request on a render; this asks our own store for a short list of column names and is
2340
  * the only way the STALE marker can exist at all.
2341
  */
2342
- const loadRouteCols = useCallback(async () => {
2343
- try {
2344
- const res = await fetch("/api/v1/customers/route-order", { credentials: "same-origin" });
2345
- const body = res.ok ? await res.json().catch(() => null) : null;
2346
- setRouteCols(Array.isArray(body?.fields) ? body.fields : []);
2347
- setNextLabel(typeof body?.nextLabel === "string" ? body.nextLabel : "");
2348
- } catch {
2349
- // A listing that cannot be fetched is "none known", not an error banner over the map: the
2350
- // planner still works, and the save below reports its own failure in its own words.
2351
- setRouteCols([]);
2352
- }
2353
- }, []);
2354
-
2355
  const loadRouteDeliveries = useCallback(async (routeId: string): Promise<RouteDeliveryDto[]> => {
2356
  try {
2357
  const res = await fetch(
@@ -2365,14 +2318,6 @@ export function MapView({
2365
  }
2366
  }, []);
2367
 
2368
- // ⭐ OWNER, 2026-08-23 — `routePanelOpen`, NOT `routeOn`. The saved-route picker is the first
2369
- // control in the panel and it is how a person reaches somebody's plan without solving one of
2370
- // their own, so the listing has to be in hand the moment the panel opens rather than after a
2371
- // solve. Still a READ of our own store and still once per mount (`routeCols === null` is the
2372
- // not-asked-yet state), so R3 is untouched: no routing request is spent by opening a panel.
2373
- useEffect(() => {
2374
- if ((routePanelOpen || routeOn) && routeCols === null) void loadRouteCols();
2375
- }, [routePanelOpen, routeOn, routeCols, loadRouteCols]);
2376
  useEffect(() => {
2377
  let current = true;
2378
  setRouteDeliveries(null);
@@ -2382,33 +2327,6 @@ export function MapView({
2382
  return () => { current = false; };
2383
  }, [activeRouteId, loadRouteDeliveries, routePanelOpen]);
2384
 
2385
- const updateRouteDetails = useCallback(async () => {
2386
- if (!routeEditKey || !routeEditName.trim()) return;
2387
- setRouteEditBusy(true);
2388
- setRouteEditErr(null);
2389
- try {
2390
- const res = await fetch(`/api/v1/customers/route-order/${encodeURIComponent(routeEditKey)}`, {
2391
- method: "PATCH",
2392
- credentials: "same-origin",
2393
- headers: { "Content-Type": "application/json" },
2394
- body: JSON.stringify({ label: routeEditName.trim(), note: routeEditNote }),
2395
- });
2396
- const body = await res.json().catch(() => null);
2397
- if (!res.ok) {
2398
- setRouteEditErr(body?.error?.message || "The route details could not be saved.");
2399
- return;
2400
- }
2401
- setRouteEditKey("");
2402
- setRouteEditName("");
2403
- setRouteEditNote("");
2404
- await loadRouteCols();
2405
- } catch {
2406
- setRouteEditErr("The route details could not be saved.");
2407
- } finally {
2408
- setRouteEditBusy(false);
2409
- }
2410
- }, [routeEditKey, routeEditName, routeEditNote, loadRouteCols]);
2411
-
2412
  const copyRouteLinks = useCallback(async () => {
2413
  if (!plan?.links.length) return;
2414
  const text = plan.links.map((link) => link.url).join("\n");
@@ -2777,15 +2695,18 @@ export function MapView({
2777
  [plan]
2778
  );
2779
 
2780
- // The legacy route-order calculation remains available to the existing map drawing and data
2781
- // migration code, but its second navigator is deliberately gone. Keep these compatibility
2782
- // hooks live until route-order columns are retired server-side; none renders a second Route UI.
 
 
 
2783
  void [
2784
  formatDuration, ROUTE_STOP_CAP, RecordPicker, setDepot, setTravelMode, travelModes,
2785
- roadBusy, roadErr, routeEditBusy, routeEditErr, routeCopyMsg,
2786
  openErr, naming, nameDraft, setNameDraft,
2787
  saveBusy, saveMsg, saveErr, unroutable, unroutableNames,
2788
- updateRouteDetails, copyRouteLinks,
2789
  removeStop, addRecord, addableRecords, moveStop,
2790
  // W47-T09 / R9 deleted the always-false staleness derivation and, with it, the two retired
2791
  // callbacks that were its only real writers. These are what those two left behind: state the
 
814
  >(null);
815
  const [roadBusy, setRoadBusy] = useState(false);
816
  const [roadErr, setRoadErr] = useState<string | null>(null);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
817
  /** The legacy on-map planner still chunks a preview at ten stops. Scheduled normalized Routes
818
  * own their independently editable 2-10 choice inside RouteNav. */
819
  const mapsPerLink = 10;
 
844
  * Owner: *"When we click the newly renamed 'Save route' it should prompt the user to Name the
845
  * route, with the default as Route 1, or Route 2, etc."*
846
  *
847
+ * ⛔ THE SERVER-SIDE ALLOCATOR IS GONE. `nextLabel` used to come from
848
+ * `GET /customers/route-order`, which counted the whole shared stratum of legacy route COLUMNS
849
+ * so a user with no grant on `route_route_1` was never pre-filled a name they would then be
850
+ * refused. That door and that stratum are deleted, and no client reads this value: W47-T09 / R9
851
+ * had already retired the naming panel, which is why the constant below is parked in the
852
+ * `void [...]` list rather than rendered.
 
 
 
853
  *
854
+ * ⚠ WHOEVER PUTS THE NAMING PANEL BACK: derive the pre-fill from the normalized Routes the
855
+ * panel already holds, NOT from a column listing -- there are no columns to count any more, and
856
+ * the refusal the old allocator existed to prevent (`field_key_taken` on a name this panel put
857
+ * in the box) cannot arise on a Route record, whose name is not a store key.
858
  */
859
+ const nextLabel = "";
860
  const [naming, setNaming] = useState(false);
861
  const [nameDraft, setNameDraft] = useState("");
862
  const [saveBusy, setSaveBusy] = useState(false);
 
2305
  * ROUTING request on a render; this asks our own store for a short list of column names and is
2306
  * the only way the STALE marker can exist at all.
2307
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
2308
  const loadRouteDeliveries = useCallback(async (routeId: string): Promise<RouteDeliveryDto[]> => {
2309
  try {
2310
  const res = await fetch(
 
2318
  }
2319
  }, []);
2320
 
 
 
 
 
 
 
 
 
2321
  useEffect(() => {
2322
  let current = true;
2323
  setRouteDeliveries(null);
 
2327
  return () => { current = false; };
2328
  }, [activeRouteId, loadRouteDeliveries, routePanelOpen]);
2329
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2330
  const copyRouteLinks = useCallback(async () => {
2331
  if (!plan?.links.length) return;
2332
  const text = plan.links.map((link) => link.url).join("\n");
 
2695
  [plan]
2696
  );
2697
 
2698
+ // ⭐ "Keep these compatibility hooks live UNTIL ROUTE-ORDER COLUMNS ARE RETIRED SERVER-SIDE"
2699
+ // is what this list used to say. They are retired: every tenant schema holds zero of them and
2700
+ // the four doors are deleted. So the entries that existed only to serve a legacy COLUMN went
2701
+ // with it -- `routeCols`, the `routeEdit*` bag, `updateRouteDetails` and the listing fetch that
2702
+ // put a 404 in the console on every panel open. What remains below is the retired-PANEL surface
2703
+ // (W47-T09 / R9), which is a different retirement and still parks its state here unread.
2704
  void [
2705
  formatDuration, ROUTE_STOP_CAP, RecordPicker, setDepot, setTravelMode, travelModes,
2706
+ roadBusy, roadErr, routeCopyMsg,
2707
  openErr, naming, nameDraft, setNameDraft,
2708
  saveBusy, saveMsg, saveErr, unroutable, unroutableNames,
2709
+ copyRouteLinks,
2710
  removeStop, addRecord, addableRecords, moveStop,
2711
  // W47-T09 / R9 deleted the always-false staleness derivation and, with it, the two retired
2712
  // callbacks that were its only real writers. These are what those two left behind: state the