fsanyoto commited on
Commit
2dbee8e
·
verified ·
1 Parent(s): 3331871

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
RELEASES.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "current": "d742b3b",
3
  "releases": [
4
  {
5
  "version": "v66",
 
1
  {
2
+ "current": "4c68648",
3
  "releases": [
4
  {
5
  "version": "v66",
VERSION CHANGED
@@ -1 +1 @@
1
- d742b3b
 
1
+ 4c68648
web/src/customer-grid/CustomerGrid.tsx CHANGED
@@ -1488,6 +1488,7 @@ function CustomerGridSurface({
1488
  * merge of values — the server's row wins outright, because by then it IS this row.
1489
  */
1490
  const [pendingRows, setPendingRows] = useState<Row[]>([]);
 
1491
  const rawRows = useMemo(() => {
1492
  const projected = embeddedRecordIds
1493
  ? fetchedRows.filter((row) => new Set(embeddedRecordIds).has(row.pid))
@@ -1495,10 +1496,10 @@ function CustomerGridSurface({
1495
  const base = embeddedExcludeRecordId !== undefined
1496
  ? projected.filter((row) => row.pid !== embeddedExcludeRecordId)
1497
  : projected;
1498
- const audit = payload.workspace?.auditTimestamps ?? {};
1499
  const watchedField = typeof config.display?.watchedField === "string"
1500
  ? config.display.watchedField : "";
1501
- const stamped = base.map((row) => ({
1502
  ...row,
1503
  _updated: audit[String(row.pid)]?.record ?? "",
1504
  ...(watchedField ? { _watched_updated: audit[String(row.pid)]?.fields?.[watchedField] ?? "" } : {}),
@@ -1509,7 +1510,7 @@ function CustomerGridSurface({
1509
  return extra.length ? [...stamped, ...extra] : stamped;
1510
  // The scalar key keeps this stable when a caller reconstructs the same id list.
1511
  // eslint-disable-next-line react-hooks/exhaustive-deps
1512
- }, [fetchedRows, embeddedIdsKey, embeddedExcludeRecordId, pendingRows, payload.workspace?.auditTimestamps, config.display?.watchedField]);
1513
  useEffect(() => {
1514
  // ⚠ PRUNED AGAINST THE FETCHED PAYLOAD, not against `rawRows` — `rawRows` contains the
1515
  // pending rows, so it can never report that one has been absorbed. Pruning against the
@@ -1619,7 +1620,6 @@ function CustomerGridSurface({
1619
  const [fields, setFields] = useState<Field[]>([]);
1620
  const [views, setViews] = useState<SavedView[]>([]);
1621
  const [activeViewId, setActiveViewId] = useState(ALL_VIEW_ID);
1622
- const [config, setConfig] = useState<ViewConfig>(() => defaultViewConfig([]));
1623
  /** C2 membership is a server-approved, active-View-only inclusion. It deliberately does not
1624
  * live in `config`: that object has a generic autosave effect for authored View changes. */
1625
  const [managedRouteClause, setManagedRouteClause] = useState<unknown>(undefined);
@@ -4821,10 +4821,18 @@ function CustomerGridSurface({
4821
  const fullSetMode =
4822
  displayMode === "calendar" || displayMode === "kanban" || displayMode === "swipe";
4823
  const timeSeriesDetailRows = useMemo(() => {
4824
- if (!timeSeriesDetailPids) return null;
4825
  const permitted = new Set(timeSeriesDetailPids);
4826
- return modeDataRows.filter((row) => permitted.has(row.pid)).map((record) => ({ kind: "data" as const, record }));
4827
- }, [modeDataRows, timeSeriesDetailPids]);
 
 
 
 
 
 
 
 
4828
  const detailRows = timeSeriesDetailRows ?? (displayMode === "map" ? mapDetailRows : fullSetMode ? visibleRows : displayRows);
4829
  const timeSeriesDetailPidToIndex = useMemo(
4830
  () => new Map((timeSeriesDetailRows ?? []).map((row, index) => [row.record.pid, index])),
 
1488
  * merge of values — the server's row wins outright, because by then it IS this row.
1489
  */
1490
  const [pendingRows, setPendingRows] = useState<Row[]>([]);
1491
+ const [config, setConfig] = useState<ViewConfig>(() => defaultViewConfig([]));
1492
  const rawRows = useMemo(() => {
1493
  const projected = embeddedRecordIds
1494
  ? fetchedRows.filter((row) => new Set(embeddedRecordIds).has(row.pid))
 
1496
  const base = embeddedExcludeRecordId !== undefined
1497
  ? projected.filter((row) => row.pid !== embeddedExcludeRecordId)
1498
  : projected;
1499
+ const audit = payload?.workspace?.auditTimestamps ?? {};
1500
  const watchedField = typeof config.display?.watchedField === "string"
1501
  ? config.display.watchedField : "";
1502
+ const stamped: Row[] = base.map((row): Row => ({
1503
  ...row,
1504
  _updated: audit[String(row.pid)]?.record ?? "",
1505
  ...(watchedField ? { _watched_updated: audit[String(row.pid)]?.fields?.[watchedField] ?? "" } : {}),
 
1510
  return extra.length ? [...stamped, ...extra] : stamped;
1511
  // The scalar key keeps this stable when a caller reconstructs the same id list.
1512
  // eslint-disable-next-line react-hooks/exhaustive-deps
1513
+ }, [fetchedRows, embeddedIdsKey, embeddedExcludeRecordId, pendingRows, payload?.workspace?.auditTimestamps, config.display?.watchedField]);
1514
  useEffect(() => {
1515
  // ⚠ PRUNED AGAINST THE FETCHED PAYLOAD, not against `rawRows` — `rawRows` contains the
1516
  // pending rows, so it can never report that one has been absorbed. Pruning against the
 
1620
  const [fields, setFields] = useState<Field[]>([]);
1621
  const [views, setViews] = useState<SavedView[]>([]);
1622
  const [activeViewId, setActiveViewId] = useState(ALL_VIEW_ID);
 
1623
  /** C2 membership is a server-approved, active-View-only inclusion. It deliberately does not
1624
  * live in `config`: that object has a generic autosave effect for authored View changes. */
1625
  const [managedRouteClause, setManagedRouteClause] = useState<unknown>(undefined);
 
4821
  const fullSetMode =
4822
  displayMode === "calendar" || displayMode === "kanban" || displayMode === "swipe";
4823
  const timeSeriesDetailRows = useMemo(() => {
4824
+ if (!timeSeriesDetailPids || displayMode !== "timeseries") return null;
4825
  const permitted = new Set(timeSeriesDetailPids);
4826
+ const seen = new Set<number>();
4827
+ const rows: { kind: "data"; record: Row }[] = [];
4828
+ for (const visible of visibleRows) {
4829
+ if (visible.kind !== "data" || seen.has(visible.record.pid) || !permitted.has(visible.record.pid)) continue;
4830
+ seen.add(visible.record.pid);
4831
+ const edits = overlayEdits[visible.record.pid];
4832
+ rows.push({ kind: "data", record: edits ? { ...visible.record, ...edits } : visible.record });
4833
+ }
4834
+ return rows;
4835
+ }, [displayMode, overlayEdits, timeSeriesDetailPids, visibleRows]);
4836
  const detailRows = timeSeriesDetailRows ?? (displayMode === "map" ? mapDetailRows : fullSetMode ? visibleRows : displayRows);
4837
  const timeSeriesDetailPidToIndex = useMemo(
4838
  () => new Map((timeSeriesDetailRows ?? []).map((row, index) => [row.record.pid, index])),
web/src/customer-grid/DatePicker.tsx CHANGED
@@ -420,7 +420,7 @@ export function DatePicker({ anchor, field, fields, pid, scopeKey, value, today,
420
  <div className="w46-recur-row">
421
  <span className="w46-recur-label">Holidays</span>
422
  <div className="w46-recur-controls">
423
- <select className="cg-select" value={rule.calendar ?? "US"} aria-label="Public calendar" onChange={(event) => updateRule(index, { calendar: event.target.value as "US" | "CA" })}>{CALENDAR_GROUPS.map(([group, heading]) => {
424
  const members = calendars.filter((calendar) => (calendar.group ?? "calendar") === group);
425
  return members.length ? <optgroup key={heading} label={heading}>{members.map((calendar) => <option key={calendar.code} value={calendar.code}>{calendar.label}</option>)}</optgroup> : null;
426
  })}</select>
 
420
  <div className="w46-recur-row">
421
  <span className="w46-recur-label">Holidays</span>
422
  <div className="w46-recur-controls">
423
+ <select className="cg-select" value={rule.calendar ?? "US"} aria-label="Public calendar" onChange={(event) => updateRule(index, { calendar: event.target.value as "US" | "CA" | "TENANT" })}>{CALENDAR_GROUPS.map(([group, heading]) => {
424
  const members = calendars.filter((calendar) => (calendar.group ?? "calendar") === group);
425
  return members.length ? <optgroup key={heading} label={heading}>{members.map((calendar) => <option key={calendar.code} value={calendar.code}>{calendar.label}</option>)}</optgroup> : null;
426
  })}</select>
web/src/customer-grid/types.ts CHANGED
@@ -116,8 +116,8 @@ export type DateRecurrenceRule = {
116
  /** Monthly first..fifth (1..5), or last (-1), plus an ISO weekday. */
117
  ordinal?: -1 | 1 | 2 | 3 | 4 | 5;
118
  weekday?: number;
119
- /** Only an API-supplied public calendar can be saved. */
120
- calendar?: "US" | "CA";
121
  /** -1 = day before, 0 = day on, 1 = day after. */
122
  offset?: -1 | 0 | 1;
123
  };
@@ -5109,6 +5109,7 @@ export type HostEvent =
5109
  sourceKey: string;
5110
  key: string;
5111
  label: string;
 
5112
  scope?: FieldScope;
5113
  }
5114
  /**
 
116
  /** Monthly first..fifth (1..5), or last (-1), plus an ISO weekday. */
117
  ordinal?: -1 | 1 | 2 | 3 | 4 | 5;
118
  weekday?: number;
119
+ /** Only an API-supplied public or tenant calendar can be saved. */
120
+ calendar?: "US" | "CA" | "TENANT";
121
  /** -1 = day before, 0 = day on, 1 = day after. */
122
  offset?: -1 | 0 | 1;
123
  };
 
5109
  sourceKey: string;
5110
  key: string;
5111
  label: string;
5112
+ copyValues?: true;
5113
  scope?: FieldScope;
5114
  }
5115
  /**
web/src/starred/StarredPage.tsx CHANGED
@@ -39,7 +39,7 @@ import { Mark } from "../shell/Brand";
39
  import { dbChipClass } from "../shell/nav";
40
  import type { DatabaseEntry } from "../shell/nav";
41
  import type { AutomationTile } from "../home/homeModel";
42
- import { BLANK, fmt } from "../ui/fmt";
43
  import { StarIcon } from "../ui/icons";
44
  import { EMPTY_STARRED, shapeStarred, starredCount, useStarred, viewCount } from "./starredApi";
45
  import type {
 
39
  import { dbChipClass } from "../shell/nav";
40
  import type { DatabaseEntry } from "../shell/nav";
41
  import type { AutomationTile } from "../home/homeModel";
42
+ import { fmt } from "../ui/fmt";
43
  import { StarIcon } from "../ui/icons";
44
  import { EMPTY_STARRED, shapeStarred, starredCount, useStarred, viewCount } from "./starredApi";
45
  import type {