fsanyoto commited on
Commit
d11d07e
·
verified ·
1 Parent(s): 7304b55

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
RELEASES.json CHANGED
@@ -1,4 +1,4 @@
1
  {
2
- "current": "6f5be07e2d",
3
  "releases": []
4
  }
 
1
  {
2
+ "current": "d1884950f7",
3
  "releases": []
4
  }
VERSION CHANGED
@@ -1 +1 @@
1
- 6f5be07e2d
 
1
+ d1884950f7
api/routes_sheet.py CHANGED
@@ -2335,10 +2335,11 @@ def _binding_display_types(session, database):
2335
 
2336
 
2337
  def _hydrate_binding_display_type(session, cell, types):
2338
- """Project source-verified display metadata without changing the binding's query."""
2339
  from modules import sheet as sheet_mod
2340
  binding = {key: value for key, value in (cell.get("binding") or {}).items() if key != "fieldType"}
2341
  cell["binding"] = binding
 
2342
  field = (binding.get("aggregate") or {}).get("field")
2343
  if not field or cell.get("state") == "refused":
2344
  return
@@ -2356,7 +2357,7 @@ def _hydrate_binding_display_type(session, cell, types):
2356
  except sheet_mod.SheetRefusal:
2357
  return
2358
  if "fieldType" in cleaned:
2359
- binding["fieldType"] = cleaned["fieldType"]
2360
 
2361
 
2362
  def _reresolved_for_reader(session: Session, book, *, endings_only=False, recalculate=True,
 
2335
 
2336
 
2337
  def _hydrate_binding_display_type(session, cell, types):
2338
+ """Project source-verified display metadata outside the authored binding."""
2339
  from modules import sheet as sheet_mod
2340
  binding = {key: value for key, value in (cell.get("binding") or {}).items() if key != "fieldType"}
2341
  cell["binding"] = binding
2342
+ cell.pop("bindingDisplayType", None)
2343
  field = (binding.get("aggregate") or {}).get("field")
2344
  if not field or cell.get("state") == "refused":
2345
  return
 
2357
  except sheet_mod.SheetRefusal:
2358
  return
2359
  if "fieldType" in cleaned:
2360
+ cell["bindingDisplayType"] = cleaned["fieldType"]
2361
 
2362
 
2363
  def _reresolved_for_reader(session: Session, book, *, endings_only=False, recalculate=True,
api/routes_tables.py CHANGED
@@ -3206,6 +3206,11 @@ def table_rows(table_key: str, session: Session = Depends(require_session),
3206
  g['shared_cells'] = {
3207
  pid: {key: value for key, value in cells.items() if key not in g['hidden']}
3208
  for pid, cells in _ut_shared_cells(session, table_key, g['pids']).items()}
 
 
 
 
 
3209
  # ⛔ THE OVERLAY WAS NEVER ACTUALLY MERGED, and the docstring above has described the merge
3210
  # this line does not perform since the route was written (owner item 3, 2026-08-09:
3211
  # *"Using the swipe, fast doesn't register the CHANGE. I went back and it all got reseted"*).
 
3206
  g['shared_cells'] = {
3207
  pid: {key: value for key, value in cells.items() if key not in g['hidden']}
3208
  for pid, cells in _ut_shared_cells(session, table_key, g['pids']).items()}
3209
+ if table_key in _AMAZON_PROFIT_TABLES:
3210
+ # Schema metadata omits personal cells; restore them after row admission through the bound reader.
3211
+ personal = _ops(session, table_key, st=original_rt).workspace(
3212
+ session.uname, consume_corrections=False)
3213
+ g['ws'] = dict(g.get('ws') or {}, overlays=personal.get('overlays') or {})
3214
  # ⛔ THE OVERLAY WAS NEVER ACTUALLY MERGED, and the docstring above has described the merge
3215
  # this line does not perform since the route was written (owner item 3, 2026-08-09:
3216
  # *"Using the swipe, fast doesn't register the CHANGE. I went back and it all got reseted"*).
platform/core/sheets.py CHANGED
@@ -512,13 +512,14 @@ class _PgSheetRows:
512
  if marker_only:
513
  value = "CASE WHEN value->>'__layout__' = 'rows' THEN value ELSE NULL END"
514
  elif metadata_only:
515
- value = ("(value - 'cells') || jsonb_build_object('cells', '{}'::jsonb, 'cellCount', "
 
516
  "(SELECT count(*) FROM jsonb_object_keys(COALESCE(NULLIF(value->'cells', "
517
- "'null'::jsonb), '{}'::jsonb))))")
518
  elif addresses is not None:
519
  value = ("(value - 'cells') || jsonb_build_object('cells', COALESCE((SELECT "
520
  "jsonb_object_agg(cell.key, cell.value) FROM jsonb_each(COALESCE(NULLIF(value->'cells', "
521
- "'null'::jsonb), '{}'::jsonb)) cell WHERE cell.key = ANY(%s)), '{}'::jsonb))")
522
  params.append(list(addresses))
523
  query = "SELECT (" + value + ")::text FROM {tbl} WHERE key = %s"
524
  row = self.con.execute(pg._q(query + (" FOR UPDATE" if lock else ""), "store_kv", self.slug),
@@ -1277,7 +1278,7 @@ def clean_cell(raw, addr=""):
1277
 
1278
  known = {"kind", "state", "text", "formula", "display", "value", "style", "validation",
1279
  "binding", "source", "refusal", "refreshed_at", "link", "note", "sparkline",
1280
- "formulaMeta", "error", "excel", "imported_value"}
1281
  # C6's server answer stamp is a JSON cell extension, preserved verbatim on every save.
1282
  cell = {key: copy.deepcopy(value) for key, value in raw.items() if key not in known}
1283
  _json_safe(cell, "cell extensions")
 
512
  if marker_only:
513
  value = "CASE WHEN value->>'__layout__' = 'rows' THEN value ELSE NULL END"
514
  elif metadata_only:
515
+ # Escape JSON braces for pg._q's SQL.format while preserving named identifiers.
516
+ value = ("(value - 'cells') || jsonb_build_object('cells', '{{}}'::jsonb, 'cellCount', "
517
  "(SELECT count(*) FROM jsonb_object_keys(COALESCE(NULLIF(value->'cells', "
518
+ "'null'::jsonb), '{{}}'::jsonb))))")
519
  elif addresses is not None:
520
  value = ("(value - 'cells') || jsonb_build_object('cells', COALESCE((SELECT "
521
  "jsonb_object_agg(cell.key, cell.value) FROM jsonb_each(COALESCE(NULLIF(value->'cells', "
522
+ "'null'::jsonb), '{{}}'::jsonb)) cell WHERE cell.key = ANY(%s)), '{{}}'::jsonb))")
523
  params.append(list(addresses))
524
  query = "SELECT (" + value + ")::text FROM {tbl} WHERE key = %s"
525
  row = self.con.execute(pg._q(query + (" FOR UPDATE" if lock else ""), "store_kv", self.slug),
 
1278
 
1279
  known = {"kind", "state", "text", "formula", "display", "value", "style", "validation",
1280
  "binding", "source", "refusal", "refreshed_at", "link", "note", "sparkline",
1281
+ "formulaMeta", "error", "excel", "imported_value", "bindingDisplayType"}
1282
  # C6's server answer stamp is a JSON cell extension, preserved verbatim on every save.
1283
  cell = {key: copy.deepcopy(value) for key, value in raw.items() if key not in known}
1284
  _json_safe(cell, "cell extensions")
web/public/AIOS_DEPLOY_RECEIPT CHANGED
@@ -1 +1 @@
1
- f5099a86e8482d9acd4c8fb4584401322c8fe4e89ae5f197dfb11a557e58f232
 
1
+ 3b5e8894edea476bd7dd250f8db2a6f22f250380b758a21524dca98c9f42bd9e
web/src/sheet/sheetState.ts CHANGED
@@ -767,11 +767,11 @@ export const BOUND_CURRENCY_FORMAT: CellFormat = {
767
 
768
  /**
769
  * True when the cell is a sum, average, min or max over a currency field.
770
- * ⚠ The field's Table type rides on the binding as `fieldType`. A count is a count, never money.
771
  */
772
  export const boundToCurrency = (cell: Cell | null | undefined): boolean => {
773
  if (!cell || cell.kind !== "bound" || !cell.binding) return false;
774
- if (cell.binding.fieldType !== "currency") return false;
775
  const aggregate = bindingAggregate(cell.binding.aggregate);
776
  return aggregate.kind === "column" && aggregate.fn !== "count" && Boolean(aggregate.field);
777
  };
 
767
 
768
  /**
769
  * True when the cell is a sum, average, min or max over a currency field.
770
+ * Unsaved editor hints override the reader's source type. A count never reads as money.
771
  */
772
  export const boundToCurrency = (cell: Cell | null | undefined): boolean => {
773
  if (!cell || cell.kind !== "bound" || !cell.binding) return false;
774
+ if ((cell.binding.fieldType ?? cell.bindingDisplayType) !== "currency") return false;
775
  const aggregate = bindingAggregate(cell.binding.aggregate);
776
  return aggregate.kind === "column" && aggregate.fn !== "count" && Boolean(aggregate.field);
777
  };
web/src/sheet/types.ts CHANGED
@@ -1011,6 +1011,8 @@ export interface Cell {
1011
  value?: unknown;
1012
  display?: string;
1013
  binding?: CellBinding;
 
 
1014
  // clean_cell in platform/core/sheets.py preserves unknown keys through _json_safe,
1015
  // so viewChild survives persistence without adding a server cell kind or cleaner branch.
1016
  viewChild?: { origin: string; field: string; line: number };
 
1011
  value?: unknown;
1012
  display?: string;
1013
  binding?: CellBinding;
1014
+ /** Read-only source field type, recomputed for this reader and omitted on save. */
1015
+ readonly bindingDisplayType?: string;
1016
  // clean_cell in platform/core/sheets.py preserves unknown keys through _json_safe,
1017
  // so viewChild survives persistence without adding a server cell kind or cleaner branch.
1018
  viewChild?: { origin: string; field: string; line: number };