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
- api/main.py +10 -0
- platform/harness/amazon_store.py +3 -3
- web/public/AIOS_DEPLOY_RECEIPT +1 -1
- web/src/sheet/BindingEditor.tsx +30 -28
- web/src/sheet/SheetGrid.tsx +6 -2
- web/src/sheet/SheetPage.tsx +15 -1
- web/src/sheet/bindingRefs.ts +39 -0
- web/wiring_rows/s63_combine.py +1 -1
RELEASES.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"current": "
|
| 3 |
"releases": [
|
| 4 |
{
|
| 5 |
"version": "v75",
|
|
|
|
| 1 |
{
|
| 2 |
+
"current": "7b5f8eb (7b5f8eb)",
|
| 3 |
"releases": [
|
| 4 |
{
|
| 5 |
"version": "v75",
|
VERSION
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
7b5f8eb (7b5f8eb)
|
api/main.py
CHANGED
|
@@ -754,6 +754,16 @@ def _pull_amazon(why):
|
|
| 754 |
print(f"[aios-api] amazon sync skipped ({why}): no stored amazon_sp credential "
|
| 755 |
"for royal-imports; the connector is idle, not broken")
|
| 756 |
return False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 757 |
rep = _amazon.sync(tenant_key, rt=rt, scheduled=True,
|
| 758 |
log=lambda message: print(f"[aios-api] amazon sync ({why}): {message}"))
|
| 759 |
for problem in rep.get("problems") or []:
|
|
|
|
| 754 |
print(f"[aios-api] amazon sync skipped ({why}): no stored amazon_sp credential "
|
| 755 |
"for royal-imports; the connector is idle, not broken")
|
| 756 |
return False
|
| 757 |
+
# Hotfix 2026-09-24: an unfinished first load goes through the Sync now desk, whose
|
| 758 |
+
# bounded passes requeue themselves until every table is loaded. `scheduled=True` loaded
|
| 759 |
+
# ONE table per resync (a 4 hour cadence), so five of seven tables were never pulled, and
|
| 760 |
+
# the markers live in the container's mirror, so every restart began again from orders.
|
| 761 |
+
if _amazon.needs_first_load(tenant_key, rt=rt):
|
| 762 |
+
from core import connector_sync as _connector_sync
|
| 763 |
+
receipt = _connector_sync.request_sync("amazon_sp", tenant_key, requested_by="first load")
|
| 764 |
+
print(f"[aios-api] amazon sync ({why}): first load "
|
| 765 |
+
+ ("queued on the sync desk" if receipt.get("accepted") else "already queued or running"))
|
| 766 |
+
return True
|
| 767 |
rep = _amazon.sync(tenant_key, rt=rt, scheduled=True,
|
| 768 |
log=lambda message: print(f"[aios-api] amazon sync ({why}): {message}"))
|
| 769 |
for problem in rep.get("problems") or []:
|
platform/harness/amazon_store.py
CHANGED
|
@@ -1579,7 +1579,7 @@ def sync(tenant_key="royal-imports", tables=None, since=None, log=print, rt=None
|
|
| 1579 |
if sibling:
|
| 1580 |
sibling_mirror = table_name(sibling)
|
| 1581 |
sibling_types = _ensure(con, sibling_mirror, cols, rows, declared=declared,
|
| 1582 |
-
preserve_rows=
|
| 1583 |
if cols and not sibling_cleared and not sibling_plan["incremental"]:
|
| 1584 |
con.execute(f"DELETE FROM {sibling_mirror} WHERE 1=1")
|
| 1585 |
sibling_cleared = True
|
|
@@ -1594,7 +1594,7 @@ def sync(tenant_key="royal-imports", tables=None, since=None, log=print, rt=None
|
|
| 1594 |
if table == "pricing":
|
| 1595 |
pricing_asins.extend(_pricing_asins(rows))
|
| 1596 |
types = _ensure(con, mirror, cols, rows, declared=declared,
|
| 1597 |
-
preserve_rows=
|
| 1598 |
# Explicit windows and first loads replace the mirror; incremental passes keep history.
|
| 1599 |
if not cleared and not plan["incremental"]:
|
| 1600 |
con.execute(f"DELETE FROM {mirror} WHERE 1=1")
|
|
@@ -1654,7 +1654,7 @@ def sync(tenant_key="royal-imports", tables=None, since=None, log=print, rt=None
|
|
| 1654 |
awd_rows = _awd_rows(inventory)
|
| 1655 |
if awd_rows:
|
| 1656 |
awd_cols = sorted({c for row in awd_rows for c in row})
|
| 1657 |
-
awd_types = _ensure(con, mirror, awd_cols, awd_rows, preserve_rows=
|
| 1658 |
if not cleared and not plan["incremental"]:
|
| 1659 |
con.execute(f"DELETE FROM {mirror} WHERE 1=1")
|
| 1660 |
cleared = True
|
|
|
|
| 1579 |
if sibling:
|
| 1580 |
sibling_mirror = table_name(sibling)
|
| 1581 |
sibling_types = _ensure(con, sibling_mirror, cols, rows, declared=declared,
|
| 1582 |
+
preserve_rows=True) if cols else {}
|
| 1583 |
if cols and not sibling_cleared and not sibling_plan["incremental"]:
|
| 1584 |
con.execute(f"DELETE FROM {sibling_mirror} WHERE 1=1")
|
| 1585 |
sibling_cleared = True
|
|
|
|
| 1594 |
if table == "pricing":
|
| 1595 |
pricing_asins.extend(_pricing_asins(rows))
|
| 1596 |
types = _ensure(con, mirror, cols, rows, declared=declared,
|
| 1597 |
+
preserve_rows=True) if cols else {}
|
| 1598 |
# Explicit windows and first loads replace the mirror; incremental passes keep history.
|
| 1599 |
if not cleared and not plan["incremental"]:
|
| 1600 |
con.execute(f"DELETE FROM {mirror} WHERE 1=1")
|
|
|
|
| 1654 |
awd_rows = _awd_rows(inventory)
|
| 1655 |
if awd_rows:
|
| 1656 |
awd_cols = sorted({c for row in awd_rows for c in row})
|
| 1657 |
+
awd_types = _ensure(con, mirror, awd_cols, awd_rows, preserve_rows=True)
|
| 1658 |
if not cleared and not plan["incremental"]:
|
| 1659 |
con.execute(f"DELETE FROM {mirror} WHERE 1=1")
|
| 1660 |
cleared = True
|
web/public/AIOS_DEPLOY_RECEIPT
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
2293b5d9c0265c3777607200eb74ad1d4c179b3730c9b006d859f5f2ccd8c42c
|
web/src/sheet/BindingEditor.tsx
CHANGED
|
@@ -69,7 +69,9 @@ import type { BindingAggregate, BindingDragStep, BindingOnDrag, BindingPeriod, B
|
|
| 69 |
// D-687: the drag arithmetic has ONE owner, and it is the file the drag path itself calls.
|
| 70 |
import { shiftPeriodStart } from "./sheetState";
|
| 71 |
import { bindingStepMode, bindingStepValues, resolveEndingCell, seedBindingStep,
|
| 72 |
-
bindingRefSlots, filterValueLeaves, resolveFilterCell,
|
|
|
|
|
|
|
| 73 |
import "../styles/wave57/binding-actions.css";
|
| 74 |
import "../styles/wave58/sheet.css";
|
| 75 |
import "../styles/wave59/binding.css";
|
|
@@ -681,10 +683,12 @@ export interface BindingEditorProps {
|
|
| 681 |
initial?: Record<string, unknown> | null;
|
| 682 |
onSave: (binding: Record<string, unknown>) => void;
|
| 683 |
onCancel: () => void;
|
|
|
|
|
|
|
| 684 |
}
|
| 685 |
|
| 686 |
export default function BindingEditor({
|
| 687 |
-
workbookId, addr, databases, initial, onSave, onCancel,
|
| 688 |
}: BindingEditorProps) {
|
| 689 |
const [activeSection, setActiveSection] = useState<typeof BINDING_SECTIONS[number]["key"]>("data");
|
| 690 |
const [shape, setShape] = useState<"value" | "view">(initial?.mode === "view" ? "view" : "value");
|
|
@@ -1504,21 +1508,9 @@ export default function BindingEditor({
|
|
| 1504 |
(last, section, index) => section.reachable ? index : last, 0,
|
| 1505 |
);
|
| 1506 |
|
| 1507 |
-
//
|
| 1508 |
-
|
| 1509 |
-
|
| 1510 |
-
// One eligible successor controls both the affordance and the action, including the last step.
|
| 1511 |
-
const next = sectionComplete[section]
|
| 1512 |
-
? sectionGates.slice(currentIndex + 1).find(({ reachable }) => reachable)
|
| 1513 |
-
: undefined;
|
| 1514 |
-
return (
|
| 1515 |
-
<button type="button" className="sheet-action" disabled={!sectionComplete[section] || !next}
|
| 1516 |
-
onClick={() => { if (next) setActiveSection(next.key); }}>
|
| 1517 |
-
Next
|
| 1518 |
-
</button>
|
| 1519 |
-
);
|
| 1520 |
-
};
|
| 1521 |
-
|
| 1522 |
useEffect(() => {
|
| 1523 |
setActiveSection((current) => {
|
| 1524 |
const currentIndex = BINDING_SECTIONS.findIndex(({ key }) => key === current);
|
|
@@ -1772,7 +1764,6 @@ export default function BindingEditor({
|
|
| 1772 |
onChange={(e) => setViewLimit(clampViewLimit(e.target.valueAsNumber))} />
|
| 1773 |
</label>
|
| 1774 |
</>}
|
| 1775 |
-
{renderNext("data")}
|
| 1776 |
</>
|
| 1777 |
)}
|
| 1778 |
{activeSection === "rows" && (
|
|
@@ -1863,6 +1854,18 @@ export default function BindingEditor({
|
|
| 1863 |
valueRef: { ...leaf.valueRef!, locked: e.target.checked } })))} />
|
| 1864 |
<span>Keep this cell when copied</span>
|
| 1865 |
</label>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1866 |
<p className="sheet-period-note">Include the sheet name when this workbook has several sheets.</p>
|
| 1867 |
</>}
|
| 1868 |
</div>;
|
|
@@ -1879,8 +1882,8 @@ export default function BindingEditor({
|
|
| 1879 |
<SheetFilterPopup
|
| 1880 |
addr={addr}
|
| 1881 |
fields={filterFields}
|
| 1882 |
-
filters={tree}
|
| 1883 |
-
onChange={setTree}
|
| 1884 |
statusValues={statusValues}
|
| 1885 |
onClose={() => setFilterPopupOpen(false)}
|
| 1886 |
/>
|
|
@@ -1888,7 +1891,6 @@ export default function BindingEditor({
|
|
| 1888 |
</>
|
| 1889 |
)}
|
| 1890 |
</fieldset>
|
| 1891 |
-
{renderNext("rows")}
|
| 1892 |
</>
|
| 1893 |
)}
|
| 1894 |
{activeSection === "related" && (
|
|
@@ -1954,12 +1956,16 @@ export default function BindingEditor({
|
|
| 1954 |
{countConditions(relatedTree.nodes) ? "Edit related filter" : "Build related filter"}
|
| 1955 |
</button>
|
| 1956 |
{countConditions(relatedTree.nodes) > 0 && <p className="sheet-period-note">
|
| 1957 |
-
{filterSentence(relatedTree, relatedFields)}
|
| 1958 |
</p>}
|
| 1959 |
{relatedPopupOpen && <SheetFilterPopup
|
| 1960 |
addr={`${addr} through ${selectedRelationship.label}`}
|
| 1961 |
-
fields={relatedFields} filters={relatedTree
|
| 1962 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1963 |
onClose={() => setRelatedPopupOpen(false)} />}
|
| 1964 |
</>}
|
| 1965 |
{relationshipListing.database === database && relationshipListing.loaded
|
|
@@ -1969,7 +1975,6 @@ export default function BindingEditor({
|
|
| 1969 |
</>}
|
| 1970 |
</>}
|
| 1971 |
</fieldset>
|
| 1972 |
-
{renderNext("related")}
|
| 1973 |
</>
|
| 1974 |
)}
|
| 1975 |
{activeSection === "period" && (
|
|
@@ -2263,7 +2268,6 @@ export default function BindingEditor({
|
|
| 2263 |
</>
|
| 2264 |
)}
|
| 2265 |
</fieldset>
|
| 2266 |
-
{renderNext("period")}
|
| 2267 |
</>
|
| 2268 |
)}
|
| 2269 |
{activeSection === "copied" && (
|
|
@@ -2348,7 +2352,6 @@ export default function BindingEditor({
|
|
| 2348 |
{!rowsResolved && <p className="sheet-period-note" role="status">{rowsNotice || "Loading all field values…"}</p>}
|
| 2349 |
{savedDragDriverMissing && <p className="sheet-notice" role="alert">The saved Step field is unavailable. Choose another field.</p>}
|
| 2350 |
</fieldset>
|
| 2351 |
-
{renderNext("copied")}
|
| 2352 |
</>
|
| 2353 |
)}
|
| 2354 |
{shape === "view" && activeSection === "place" && (
|
|
@@ -2357,7 +2360,6 @@ export default function BindingEditor({
|
|
| 2357 |
previewBinding={binding as ViewBinding}
|
| 2358 |
onClose={() => setActiveSection("copied")}
|
| 2359 |
onPlace={() => { if (ready) onSave(binding); }} />}
|
| 2360 |
-
{renderNext("place")}
|
| 2361 |
</>
|
| 2362 |
)}
|
| 2363 |
</div>
|
|
|
|
| 69 |
// D-687: the drag arithmetic has ONE owner, and it is the file the drag path itself calls.
|
| 70 |
import { shiftPeriodStart } from "./sheetState";
|
| 71 |
import { bindingStepMode, bindingStepValues, resolveEndingCell, seedBindingStep,
|
| 72 |
+
bindingRefSlots, filterValueLeaves, keepCellFilterValues, resolveFilterCell, showCellFilterValues,
|
| 73 |
+
updateFilterValueLeaf } from "./bindingRefs";
|
| 74 |
+
import type { ReadBindingCell } from "./bindingRefs";
|
| 75 |
import "../styles/wave57/binding-actions.css";
|
| 76 |
import "../styles/wave58/sheet.css";
|
| 77 |
import "../styles/wave59/binding.css";
|
|
|
|
| 683 |
initial?: Record<string, unknown> | null;
|
| 684 |
onSave: (binding: Record<string, unknown>) => void;
|
| 685 |
onCancel: () => void;
|
| 686 |
+
/** What a referenced cell reads now, so a filter value taken from a cell is shown, not blank. */
|
| 687 |
+
readCell?: ReadBindingCell;
|
| 688 |
}
|
| 689 |
|
| 690 |
export default function BindingEditor({
|
| 691 |
+
workbookId, addr, databases, initial, onSave, onCancel, readCell,
|
| 692 |
}: BindingEditorProps) {
|
| 693 |
const [activeSection, setActiveSection] = useState<typeof BINDING_SECTIONS[number]["key"]>("data");
|
| 694 |
const [shape, setShape] = useState<"value" | "view">(initial?.mode === "view" ? "view" : "value");
|
|
|
|
| 1508 |
(last, section, index) => section.reachable ? index : last, 0,
|
| 1509 |
);
|
| 1510 |
|
| 1511 |
+
// Hotfix 2026-09-24 (owner): the per-step Next buttons are gone, and R44's "one shared Next"
|
| 1512 |
+
// with them. The step rail on the left is the one way between steps; it already refuses a step
|
| 1513 |
+
// that is not reachable yet and names what blocks it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1514 |
useEffect(() => {
|
| 1515 |
setActiveSection((current) => {
|
| 1516 |
const currentIndex = BINDING_SECTIONS.findIndex(({ key }) => key === current);
|
|
|
|
| 1764 |
onChange={(e) => setViewLimit(clampViewLimit(e.target.valueAsNumber))} />
|
| 1765 |
</label>
|
| 1766 |
</>}
|
|
|
|
| 1767 |
</>
|
| 1768 |
)}
|
| 1769 |
{activeSection === "rows" && (
|
|
|
|
| 1854 |
valueRef: { ...leaf.valueRef!, locked: e.target.checked } })))} />
|
| 1855 |
<span>Keep this cell when copied</span>
|
| 1856 |
</label>
|
| 1857 |
+
{(() => {
|
| 1858 |
+
// Say what the linked cell reads now, and how, so a helper row far
|
| 1859 |
+
// down the sheet is not a bare address with no meaning.
|
| 1860 |
+
const got = node.valueRef.ref.trim() ? readCell?.(node.valueRef.ref) : null;
|
| 1861 |
+
if (!got) return null;
|
| 1862 |
+
return <p className="sheet-period-note" role="status">
|
| 1863 |
+
{got.value === ""
|
| 1864 |
+
? got.problem || `${node.valueRef.ref.trim()} is empty right now.`
|
| 1865 |
+
: `${node.valueRef.ref.trim()} reads ${got.value} now`
|
| 1866 |
+
+ (got.formula ? `, from ${got.formula}` : "") + "."}
|
| 1867 |
+
</p>;
|
| 1868 |
+
})()}
|
| 1869 |
<p className="sheet-period-note">Include the sheet name when this workbook has several sheets.</p>
|
| 1870 |
</>}
|
| 1871 |
</div>;
|
|
|
|
| 1882 |
<SheetFilterPopup
|
| 1883 |
addr={addr}
|
| 1884 |
fields={filterFields}
|
| 1885 |
+
filters={showCellFilterValues(tree, readCell)}
|
| 1886 |
+
onChange={(next) => setTree(keepCellFilterValues(next, readCell))}
|
| 1887 |
statusValues={statusValues}
|
| 1888 |
onClose={() => setFilterPopupOpen(false)}
|
| 1889 |
/>
|
|
|
|
| 1891 |
</>
|
| 1892 |
)}
|
| 1893 |
</fieldset>
|
|
|
|
| 1894 |
</>
|
| 1895 |
)}
|
| 1896 |
{activeSection === "related" && (
|
|
|
|
| 1956 |
{countConditions(relatedTree.nodes) ? "Edit related filter" : "Build related filter"}
|
| 1957 |
</button>
|
| 1958 |
{countConditions(relatedTree.nodes) > 0 && <p className="sheet-period-note">
|
| 1959 |
+
{filterSentence(showCellFilterValues(relatedTree, readCell), relatedFields)}
|
| 1960 |
</p>}
|
| 1961 |
{relatedPopupOpen && <SheetFilterPopup
|
| 1962 |
addr={`${addr} through ${selectedRelationship.label}`}
|
| 1963 |
+
fields={relatedFields} filters={showCellFilterValues(relatedTree, readCell)}
|
| 1964 |
+
statusValues={relatedStatusValues}
|
| 1965 |
+
onChange={(filter) => {
|
| 1966 |
+
setRelated({ via: related.via, filter: keepCellFilterValues(filter, readCell) });
|
| 1967 |
+
setPreview("");
|
| 1968 |
+
}}
|
| 1969 |
onClose={() => setRelatedPopupOpen(false)} />}
|
| 1970 |
</>}
|
| 1971 |
{relationshipListing.database === database && relationshipListing.loaded
|
|
|
|
| 1975 |
</>}
|
| 1976 |
</>}
|
| 1977 |
</fieldset>
|
|
|
|
| 1978 |
</>
|
| 1979 |
)}
|
| 1980 |
{activeSection === "period" && (
|
|
|
|
| 2268 |
</>
|
| 2269 |
)}
|
| 2270 |
</fieldset>
|
|
|
|
| 2271 |
</>
|
| 2272 |
)}
|
| 2273 |
{activeSection === "copied" && (
|
|
|
|
| 2352 |
{!rowsResolved && <p className="sheet-period-note" role="status">{rowsNotice || "Loading all field values…"}</p>}
|
| 2353 |
{savedDragDriverMissing && <p className="sheet-notice" role="alert">The saved Step field is unavailable. Choose another field.</p>}
|
| 2354 |
</fieldset>
|
|
|
|
| 2355 |
</>
|
| 2356 |
)}
|
| 2357 |
{shape === "view" && activeSection === "place" && (
|
|
|
|
| 2360 |
previewBinding={binding as ViewBinding}
|
| 2361 |
onClose={() => setActiveSection("copied")}
|
| 2362 |
onPlace={() => { if (ready) onSave(binding); }} />}
|
|
|
|
| 2363 |
</>
|
| 2364 |
)}
|
| 2365 |
</div>
|
web/src/sheet/SheetGrid.tsx
CHANGED
|
@@ -611,6 +611,10 @@ export interface SheetGridProps {
|
|
| 611 |
workbook: Workbook;
|
| 612 |
tab: SheetTab;
|
| 613 |
busy?: boolean;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 614 |
onEdit: (addr: string, cell: Cell | null) => void;
|
| 615 |
onViewRows: (addr: string, cell: Cell | null) => void;
|
| 616 |
|
|
@@ -1027,7 +1031,7 @@ export function RowOutline({ items, levels, onToggle }: {
|
|
| 1027 |
}
|
| 1028 |
|
| 1029 |
export default function SheetGrid({
|
| 1030 |
-
workbook: storedWorkbook, tab: storedTab, busy = false, onEdit, onViewRows,
|
| 1031 |
formulaBar, onRefresh, onSaveNow, onOpenImport,
|
| 1032 |
onCommit, openAt, onUndo, onRedo, onNotice, onEvaluateBindings,
|
| 1033 |
onSelect, onStructure, onGrow, onFreeze, onColumnWidth, onRowHeight, onHideBands, onRules, onCharts,
|
|
@@ -7206,7 +7210,7 @@ export default function SheetGrid({
|
|
| 7206 |
/>
|
| 7207 |
)}
|
| 7208 |
|
| 7209 |
-
{selected && anchor && !painter && !selected.cell?.viewChild && !viewChromeRefusal(selected.cell) && (
|
| 7210 |
<CellActionBar
|
| 7211 |
anchor={anchor}
|
| 7212 |
drill={drillAffordance(selected.cell)}
|
|
|
|
| 611 |
workbook: Workbook;
|
| 612 |
tab: SheetTab;
|
| 613 |
busy?: boolean;
|
| 614 |
+
/** Hotfix 2026-09-24: the binding panel or the drill is open over this grid. The cell action
|
| 615 |
+
* bar is the door to both, so it is hidden while either one is showing; it stayed painted
|
| 616 |
+
* over the grid after Edit was clicked. */
|
| 617 |
+
panelOpen?: boolean;
|
| 618 |
onEdit: (addr: string, cell: Cell | null) => void;
|
| 619 |
onViewRows: (addr: string, cell: Cell | null) => void;
|
| 620 |
|
|
|
|
| 1031 |
}
|
| 1032 |
|
| 1033 |
export default function SheetGrid({
|
| 1034 |
+
workbook: storedWorkbook, tab: storedTab, busy = false, panelOpen = false, onEdit, onViewRows,
|
| 1035 |
formulaBar, onRefresh, onSaveNow, onOpenImport,
|
| 1036 |
onCommit, openAt, onUndo, onRedo, onNotice, onEvaluateBindings,
|
| 1037 |
onSelect, onStructure, onGrow, onFreeze, onColumnWidth, onRowHeight, onHideBands, onRules, onCharts,
|
|
|
|
| 7210 |
/>
|
| 7211 |
)}
|
| 7212 |
|
| 7213 |
+
{selected && anchor && !painter && !panelOpen && !selected.cell?.viewChild && !viewChromeRefusal(selected.cell) && (
|
| 7214 |
<CellActionBar
|
| 7215 |
anchor={anchor}
|
| 7216 |
drill={drillAffordance(selected.cell)}
|
web/src/sheet/SheetPage.tsx
CHANGED
|
@@ -54,6 +54,7 @@ import { readSheetAddress, sheetAddressHash, SHEET_VIEW_KIND, writeSheetAddress
|
|
| 54 |
import { ITEM_DELETED_EVENT, isMissingItem, itemDeleted } from "../starred/starredApi";
|
| 55 |
import type { DeletedItem } from "../starred/starredApi";
|
| 56 |
import type { SheetAddress } from "./index";
|
|
|
|
| 57 |
import BindingEditor from "./BindingEditor";
|
| 58 |
import DrillModal from "./DrillModal";
|
| 59 |
import type { DrillCellScope } from "./DrillModal";
|
|
@@ -102,7 +103,7 @@ import { bindingOptionKey } from "./sheetState";
|
|
| 102 |
import type { OptionCatalogue } from "./sheetState";
|
| 103 |
import { bindingOnDrag, BINDING_ENDING_STEP, BINDING_PERIOD_STEP } from "./types";
|
| 104 |
import type { SavedViewShadow } from "./bindingRefs";
|
| 105 |
-
import { bindingStepValues } from "./bindingRefs";
|
| 106 |
|
| 107 |
// Twin in HomePage.tsx; this ticket's file fence keeps the timeout local to each chunk.
|
| 108 |
const FOLDER_WRITE_TIMEOUT_MS = 20000;
|
|
@@ -2945,6 +2946,7 @@ export default function SheetPage() {
|
|
| 2945 |
// reads exactly one prop for "a round trip is in flight". The page root's `data-drill`
|
| 2946 |
// is what tells the two apart in the stylesheet.
|
| 2947 |
busy={busy || drillLoading}
|
|
|
|
| 2948 |
onEdit={onEdit}
|
| 2949 |
onViewRows={onViewRows}
|
| 2950 |
onRefresh={onRefresh}
|
|
@@ -3243,6 +3245,18 @@ export default function SheetPage() {
|
|
| 3243 |
initial={(tab?.cells?.[editAt]?.binding as Record<string, unknown>) ?? null}
|
| 3244 |
onSave={onSaveBinding}
|
| 3245 |
onCancel={() => setEditAt("")}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3246 |
/>
|
| 3247 |
)}
|
| 3248 |
|
|
|
|
| 54 |
import { ITEM_DELETED_EVENT, isMissingItem, itemDeleted } from "../starred/starredApi";
|
| 55 |
import type { DeletedItem } from "../starred/starredApi";
|
| 56 |
import type { SheetAddress } from "./index";
|
| 57 |
+
import { parseRef } from "./a1";
|
| 58 |
import BindingEditor from "./BindingEditor";
|
| 59 |
import DrillModal from "./DrillModal";
|
| 60 |
import type { DrillCellScope } from "./DrillModal";
|
|
|
|
| 103 |
import type { OptionCatalogue } from "./sheetState";
|
| 104 |
import { bindingOnDrag, BINDING_ENDING_STEP, BINDING_PERIOD_STEP } from "./types";
|
| 105 |
import type { SavedViewShadow } from "./bindingRefs";
|
| 106 |
+
import { bindingStepValues, resolveFilterCell } from "./bindingRefs";
|
| 107 |
|
| 108 |
// Twin in HomePage.tsx; this ticket's file fence keeps the timeout local to each chunk.
|
| 109 |
const FOLDER_WRITE_TIMEOUT_MS = 20000;
|
|
|
|
| 2946 |
// reads exactly one prop for "a round trip is in flight". The page root's `data-drill`
|
| 2947 |
// is what tells the two apart in the stylesheet.
|
| 2948 |
busy={busy || drillLoading}
|
| 2949 |
+
panelOpen={Boolean(editAt || drillAt)}
|
| 2950 |
onEdit={onEdit}
|
| 2951 |
onViewRows={onViewRows}
|
| 2952 |
onRefresh={onRefresh}
|
|
|
|
| 3245 |
initial={(tab?.cells?.[editAt]?.binding as Record<string, unknown>) ?? null}
|
| 3246 |
onSave={onSaveBinding}
|
| 3247 |
onCancel={() => setEditAt("")}
|
| 3248 |
+
readCell={(text) => {
|
| 3249 |
+
// The same reader the drag and resolve paths use, so the panel shows what a refresh
|
| 3250 |
+
// would read. A bare reference is about the tab the edited cell is on.
|
| 3251 |
+
const ref = parseRef(text);
|
| 3252 |
+
if (!ref) return null;
|
| 3253 |
+
let value = "", problem = "";
|
| 3254 |
+
try { value = resolveFilterCell(book, text, tab?.name); }
|
| 3255 |
+
catch (error) { problem = error instanceof Error ? error.message : String(error); }
|
| 3256 |
+
const home = ref.sheet ? book.sheets.find((s) => s.name === ref.sheet) : tab;
|
| 3257 |
+
const cell = home?.cells?.[`${ref.col.toUpperCase()}${ref.row}`];
|
| 3258 |
+
return { value, problem, formula: cell?.kind === "formula" ? String(cell.formula ?? "") : "" };
|
| 3259 |
+
}}
|
| 3260 |
/>
|
| 3261 |
)}
|
| 3262 |
|
web/src/sheet/bindingRefs.ts
CHANGED
|
@@ -150,6 +150,45 @@ export const updateFilterValueLeaf = (
|
|
| 150 |
return { ...tree, nodes: visit(tree.nodes, indices) };
|
| 151 |
};
|
| 152 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
/**
|
| 154 |
* ⭐⭐ THE REGISTRY. Everything this module knows about binding references is these entries.
|
| 155 |
*
|
|
|
|
| 150 |
return { ...tree, nodes: visit(tree.nodes, indices) };
|
| 151 |
};
|
| 152 |
|
| 153 |
+
/** What a referenced cell holds right now: its value as text, and its formula when it has one. */
|
| 154 |
+
export type ReadBindingCell = (ref: string) => { value: string; formula: string; problem?: string } | null;
|
| 155 |
+
|
| 156 |
+
const mapFilterLeaves = (tree: FilterTree, change: (node: CellFilterRule) => CellFilterRule): FilterTree => {
|
| 157 |
+
const visit = (nodes: FilterNode[]): FilterNode[] =>
|
| 158 |
+
nodes.map((node) => "children" in node ? { ...node, children: visit(node.children) } : change(node));
|
| 159 |
+
return { ...tree, nodes: visit(tree.nodes) };
|
| 160 |
+
};
|
| 161 |
+
|
| 162 |
+
/**
|
| 163 |
+
* Hotfix 2026-09-24 (owner: "the edit filter shows in or after a date but the date is blank").
|
| 164 |
+
* The shared filter builder only knows typed values, so a condition whose value comes from a cell
|
| 165 |
+
* painted an empty date. This fills each such leaf's `value` with what the cell reads NOW, for
|
| 166 |
+
* display only; `keepCellFilterValues` takes it back off before the tree is stored.
|
| 167 |
+
*/
|
| 168 |
+
export const showCellFilterValues = (tree: FilterTree, read?: ReadBindingCell): FilterTree => !read ? tree
|
| 169 |
+
: mapFilterLeaves(tree, (node) => {
|
| 170 |
+
const got = node.valueRef?.ref ? read(node.valueRef.ref) : null;
|
| 171 |
+
return got && got.value !== "" ? { ...node, value: got.value } : node;
|
| 172 |
+
});
|
| 173 |
+
|
| 174 |
+
/**
|
| 175 |
+
* The inverse, run on every change from the builder. A leaf still showing its cell's value keeps
|
| 176 |
+
* the link and drops the displayed copy, so an untouched binding saves byte for byte as it was
|
| 177 |
+
* read. A leaf whose value the person typed over becomes a typed value, and the link goes.
|
| 178 |
+
*/
|
| 179 |
+
export const keepCellFilterValues = (tree: FilterTree, read?: ReadBindingCell): FilterTree => !read ? tree
|
| 180 |
+
: mapFilterLeaves(tree, (node) => {
|
| 181 |
+
if (!node.valueRef?.ref) return node;
|
| 182 |
+
const shown = read(node.valueRef.ref)?.value ?? "";
|
| 183 |
+
const typed = typeof node.value === "string" ? node.value : node.value == null ? "" : String(node.value);
|
| 184 |
+
if (typed === "" || typed === shown) {
|
| 185 |
+
const { value: _shown, ...linked } = node;
|
| 186 |
+
return linked as CellFilterRule;
|
| 187 |
+
}
|
| 188 |
+
const { valueRef: _link, ...own } = node;
|
| 189 |
+
return own as CellFilterRule;
|
| 190 |
+
});
|
| 191 |
+
|
| 192 |
/**
|
| 193 |
* ⭐⭐ THE REGISTRY. Everything this module knows about binding references is these entries.
|
| 194 |
*
|
web/wiring_rows/s63_combine.py
CHANGED
|
@@ -32,7 +32,7 @@ ROWS = [
|
|
| 32 |
"customer-grid/ColumnMenu.tsx", r"<FormulaEditor\b(?:(?!/>)[\s\S])*?onChange=\{onFormulaText\}"),
|
| 33 |
("S63 combine Cell database filters update the binding tree",
|
| 34 |
"filter-kit/SheetFilterPopup.tsx", r"export function SheetFilterPopup",
|
| 35 |
-
"sheet/BindingEditor.tsx", r"<SheetFilterPopup\b(?:(?!/>)[\s\S])*?onChange=\{setTree\}"),
|
| 36 |
("S63 combine database tile stars use the database writer",
|
| 37 |
"home/DatabaseTile.tsx", r"export default function DatabaseTile",
|
| 38 |
"home/HomePage.tsx", r'<DatabaseTile\b(?:(?!/>)[\s\S])*?onToggle=\{\(\) => toggle\("database", tile\.key, !dbStarred\.has\(tile\.key\)\)\}'),
|
|
|
|
| 32 |
"customer-grid/ColumnMenu.tsx", r"<FormulaEditor\b(?:(?!/>)[\s\S])*?onChange=\{onFormulaText\}"),
|
| 33 |
("S63 combine Cell database filters update the binding tree",
|
| 34 |
"filter-kit/SheetFilterPopup.tsx", r"export function SheetFilterPopup",
|
| 35 |
+
"sheet/BindingEditor.tsx", r"<SheetFilterPopup\b(?:(?!/>)[\s\S])*?onChange=\{\(next\) => setTree\(keepCellFilterValues\(next, readCell\)\)\}"),
|
| 36 |
("S63 combine database tile stars use the database writer",
|
| 37 |
"home/DatabaseTile.tsx", r"export default function DatabaseTile",
|
| 38 |
"home/HomePage.tsx", r'<DatabaseTile\b(?:(?!/>)[\s\S])*?onToggle=\{\(\) => toggle\("database", tile\.key, !dbStarred\.has\(tile\.key\)\)\}'),
|