Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Deploy AIOS web (React glide grid + FastAPI slice)
Browse files- RELEASES.json +1 -1
- VERSION +1 -1
- web/public/AIOS_DEPLOY_RECEIPT +1 -1
- web/src/sheet/SheetGrid.tsx +1 -1
- web/src/sheet/formulaEval.ts +54 -2
- web/src/sheet/sheetDataEditor.tsx +1 -1
RELEASES.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"current": "
|
| 3 |
"releases": [
|
| 4 |
{
|
| 5 |
"version": "v75",
|
|
|
|
| 1 |
{
|
| 2 |
+
"current": "d411bd2 (d411bd2)",
|
| 3 |
"releases": [
|
| 4 |
{
|
| 5 |
"version": "v75",
|
VERSION
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
d411bd2 (d411bd2)
|
web/public/AIOS_DEPLOY_RECEIPT
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
e87162072024626f5037b796d0af86a98a0ed437dbba06c94bab9994e64ce474
|
web/src/sheet/SheetGrid.tsx
CHANGED
|
@@ -1615,7 +1615,7 @@ export default function SheetGrid({
|
|
| 1615 |
/**
|
| 1616 |
* ⭐ HOTFIX 2026-09-24: THE NUMBER glide's ROW MARKER PAINTS, AS THE SHEET'S OWN ROW.
|
| 1617 |
* glide paints `rowMarkerStartIndex + drawnRow`, blind to hidden rows, so an imported workbook
|
| 1618 |
-
* hiding rows
|
| 1619 |
* serves both mounts: the main grid starts at `bandRows + 1` and the band at 1, and in both
|
| 1620 |
* cases `shown - bandRows - 1` is exactly the view row `realRow` already speaks (negative in
|
| 1621 |
* the band), so the marker, the name box and the selected row's overlay read one number.
|
|
|
|
| 1615 |
/**
|
| 1616 |
* ⭐ HOTFIX 2026-09-24: THE NUMBER glide's ROW MARKER PAINTS, AS THE SHEET'S OWN ROW.
|
| 1617 |
* glide paints `rowMarkerStartIndex + drawnRow`, blind to hidden rows, so an imported workbook
|
| 1618 |
+
* hiding rows 8 to 26 labelled sheet row 31 as 12 while the name box said F31. ONE function
|
| 1619 |
* serves both mounts: the main grid starts at `bandRows + 1` and the band at 1, and in both
|
| 1620 |
* cases `shown - bandRows - 1` is exactly the view row `realRow` already speaks (negative in
|
| 1621 |
* the band), so the marker, the name box and the selected row's overlay read one number.
|
web/src/sheet/formulaEval.ts
CHANGED
|
@@ -1164,6 +1164,42 @@ const functionDateText = (date: Date): string => {
|
|
| 1164 |
return date.toISOString().slice(0, 10);
|
| 1165 |
};
|
| 1166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1167 |
const parseLookup = (name: string, c: Cursor, get: Getter,
|
| 1168 |
prepared?: (read: Getter) => LookupArgument[]): CellValue => {
|
| 1169 |
const textOrDate = name === "TEXTJOIN" || name === "SUBSTITUTE" || name === "EOMONTH"
|
|
@@ -1494,9 +1530,14 @@ const parseExpr = (c: Cursor, get: Getter): ExpressionValue => {
|
|
| 1494 |
let value = parseTerm(c, get);
|
| 1495 |
while (isOp(peekTok(c), "+") || isOp(peekTok(c), "-")) {
|
| 1496 |
const op = take(c);
|
| 1497 |
-
const
|
| 1498 |
-
const right = expressionNumber(parseTerm(c, get));
|
| 1499 |
const plus = op.t === "op" && op.v === "+";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1500 |
value = { n: plus ? left.n + right.n : left.n - right.n,
|
| 1501 |
pending: left.pending || right.pending };
|
| 1502 |
}
|
|
@@ -2338,6 +2379,17 @@ export const evaluateCompiledSheetFormula = (
|
|
| 2338 |
if (node.op === "&") return { kind: "text", value: String(a) + String(b) };
|
| 2339 |
return { kind: "boolean", value: excelComparison(a, b, node.op) };
|
| 2340 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2341 |
const left = expressionNumber(first), right = expressionNumber(second);
|
| 2342 |
if (node.op === "/" && right.n === 0) {
|
| 2343 |
if (right.pending) throw new PendingInput("divisor");
|
|
|
|
| 1164 |
return date.toISOString().slice(0, 10);
|
| 1165 |
};
|
| 1166 |
|
| 1167 |
+
/**
|
| 1168 |
+
* ⭐⭐ HOTFIX 2026-09-24: `formula_runtime.py`'s ISO DAY ARITHMETIC, MIRRORED (its `+`/`-` branch).
|
| 1169 |
+
* A date is ISO text on both sides (`DATE` and `EOMONTH` already answer it), and the server gives
|
| 1170 |
+
* that text Excel's day arithmetic: date minus date is a day count, date plus or minus a whole
|
| 1171 |
+
* number is another ISO date. The client read the same text through `toNum`, so the Daily Sales
|
| 1172 |
+
* workbook's `=F7-6` and `=(DATE(YEAR(R7),12,31) - R7)/7` painted `#VALUE!` over values the server
|
| 1173 |
+
* stores as `2026-06-05` and `17`. Sheet inputs read as the server's `_SheetInputs` read them: a
|
| 1174 |
+
* blank is 0 and a boolean is 1 or 0. `null` means no date rule applies and arithmetic proceeds.
|
| 1175 |
+
*/
|
| 1176 |
+
const isoDayArithmetic = (l: CellValue, r: CellValue, op: "+" | "-"): ExpressionValue | null => {
|
| 1177 |
+
const leftDay = l.kind === "text" ? functionDate(l) : null;
|
| 1178 |
+
const rightDay = r.kind === "text" ? functionDate(r) : null;
|
| 1179 |
+
if (!leftDay && !rightDay) return null;
|
| 1180 |
+
if (l.kind === "pending" || r.kind === "pending") throw new PendingInput("date arithmetic");
|
| 1181 |
+
const numberOf = (v: CellValue): number | null => v.kind === "empty" ? 0
|
| 1182 |
+
: v.kind === "boolean" ? Number(v.value)
|
| 1183 |
+
: v.kind === "number" || v.kind === "text" ? functionNumber(v) : null;
|
| 1184 |
+
const pending = ("pending" in l && l.pending === true) || ("pending" in r && r.pending === true);
|
| 1185 |
+
const shifted = (day: Date, days: number): ExpressionValue => ({
|
| 1186 |
+
kind: "text", value: functionDateText(new Date(day.getTime() + days * CALENDAR_DAY_MS)),
|
| 1187 |
+
...(pending ? { pending: true } : {}),
|
| 1188 |
+
});
|
| 1189 |
+
if (leftDay && rightDay && op === "-") {
|
| 1190 |
+
return { n: Math.round((leftDay.getTime() - rightDay.getTime()) / CALENDAR_DAY_MS), pending };
|
| 1191 |
+
}
|
| 1192 |
+
const rightNum = numberOf(r);
|
| 1193 |
+
if (leftDay && rightNum !== null && Number.isInteger(rightNum)) {
|
| 1194 |
+
return shifted(leftDay, op === "+" ? rightNum : -rightNum);
|
| 1195 |
+
}
|
| 1196 |
+
const leftNum = numberOf(l);
|
| 1197 |
+
if (rightDay && leftNum !== null && op === "+" && Number.isInteger(leftNum)) {
|
| 1198 |
+
return shifted(rightDay, leftNum);
|
| 1199 |
+
}
|
| 1200 |
+
return null;
|
| 1201 |
+
};
|
| 1202 |
+
|
| 1203 |
const parseLookup = (name: string, c: Cursor, get: Getter,
|
| 1204 |
prepared?: (read: Getter) => LookupArgument[]): CellValue => {
|
| 1205 |
const textOrDate = name === "TEXTJOIN" || name === "SUBSTITUTE" || name === "EOMONTH"
|
|
|
|
| 1530 |
let value = parseTerm(c, get);
|
| 1531 |
while (isOp(peekTok(c), "+") || isOp(peekTok(c), "-")) {
|
| 1532 |
const op = take(c);
|
| 1533 |
+
const term = parseTerm(c, get);
|
|
|
|
| 1534 |
const plus = op.t === "op" && op.v === "+";
|
| 1535 |
+
// HOTFIX 2026-09-24: THIS path answers plain `=F7-6`, so it takes the same ISO day rule as the
|
| 1536 |
+
// tree evaluator's binary branch; missing it here is what left Daily Sales E6 at #VALUE!.
|
| 1537 |
+
const day = isoDayArithmetic(expressionCell(value), expressionCell(term), plus ? "+" : "-");
|
| 1538 |
+
if (day) { value = day; continue; }
|
| 1539 |
+
const left = expressionNumber(value);
|
| 1540 |
+
const right = expressionNumber(term);
|
| 1541 |
value = { n: plus ? left.n + right.n : left.n - right.n,
|
| 1542 |
pending: left.pending || right.pending };
|
| 1543 |
}
|
|
|
|
| 2379 |
if (node.op === "&") return { kind: "text", value: String(a) + String(b) };
|
| 2380 |
return { kind: "boolean", value: excelComparison(a, b, node.op) };
|
| 2381 |
}
|
| 2382 |
+
if (node.op === "+" || node.op === "-") {
|
| 2383 |
+
const dated = isoDayArithmetic(expressionCell(first), expressionCell(second), node.op);
|
| 2384 |
+
// ⚠ A DAY COUNT IS A PLAIN NUMBER. Left unformatted, `inferredFormat` reads the `DATE()`
|
| 2385 |
+
// operand's date format and a 17 day gap painted as "Jan 1, 1970". `=TODAY()-7` never
|
| 2386 |
+
// reaches this line (TODAY is a serial, not ISO text), so it keeps its inferred date.
|
| 2387 |
+
if (dated && !("kind" in dated)) {
|
| 2388 |
+
return { kind: "number", value: dated.n, ...(dated.pending ? { pending: true } : {}),
|
| 2389 |
+
style: { format: { kind: "general" } } };
|
| 2390 |
+
}
|
| 2391 |
+
if (dated) return dated;
|
| 2392 |
+
}
|
| 2393 |
const left = expressionNumber(first), right = expressionNumber(second);
|
| 2394 |
if (node.op === "/" && right.n === 0) {
|
| 2395 |
if (right.pending) throw new PendingInput("divisor");
|
web/src/sheet/sheetDataEditor.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
* ⭐⭐ HOTFIX 2026-09-24 — THE ROW NUMBER IS THE SHEET'S ROW, NOT GLIDE'S COUNT OF DRAWN ROWS.
|
| 3 |
*
|
| 4 |
* Owner, on the imported Daily Sales workbook: *"the sheet module row when highlighted is the
|
| 5 |
-
* wrong number."* That workbook hides rows
|
| 6 |
* 31. The name box said F31, the selected row's marker (`.sheet-active-row-header`, which goes
|
| 7 |
* through `realRow`) said 31, and glide's own canvas marker said 12, because `rowMarkers="number"`
|
| 8 |
* paints `rowMarkerStartIndex + drawnIndex` and knows nothing about hidden rows. Every formula in
|
|
|
|
| 2 |
* ⭐⭐ HOTFIX 2026-09-24 — THE ROW NUMBER IS THE SHEET'S ROW, NOT GLIDE'S COUNT OF DRAWN ROWS.
|
| 3 |
*
|
| 4 |
* Owner, on the imported Daily Sales workbook: *"the sheet module row when highlighted is the
|
| 5 |
+
* wrong number."* That workbook hides rows 8 to 26, so the row reading `Current YTD` is sheet row
|
| 6 |
* 31. The name box said F31, the selected row's marker (`.sheet-active-row-header`, which goes
|
| 7 |
* through `realRow`) said 31, and glide's own canvas marker said 12, because `rowMarkers="number"`
|
| 8 |
* paints `rowMarkerStartIndex + drawnIndex` and knows nothing about hidden rows. Every formula in
|