Skip to content

Cube tester: PctTotalAggregator rewritten as a calculated field (hoist-react #4620) - #895

Closed
lbwexler wants to merge 3 commits into
developfrom
claude/issue-4620-kyt4eq
Closed

lbwexler wants to merge 3 commits into
developfrom
claude/issue-4620-kyt4eq

Conversation

@lbwexler

Copy link
Copy Markdown
Member

Companion to xh/hoist-react#4636 (eponymous branch) - exercises CubeFieldSpec.calculatedFn in the cube test panel, per the validation plan in hoist-react #4620.

Run against a local hoist-react checkout on claude/issue-4620-kyt4eq.

Changes

  • pctCommission is now a calculated field: percent-of-total computed lazily at read time from the row's SUM-aggregated commission and a per-update total memoized in ctx.appData via ctx.filteredRecords. PctTotalAggregator deleted.
  • No pctCommission values are stamped on source orders in the load or update streams - calculated fields require no source data.
  • Column marked editable: false (calculated fields are read-only), toggle relabeled Pct Total (calc)?, and the field drops out of the query in the non-projection A/B mode (Views with calculated fields require projectionOnly connected stores).

What to verify

  • With Pct Total (calc)? on and a streaming update rate set, the View's diagnostics stay on the data-only update path (the old aggregator forced a full generation per tick).
  • Visible pctCommission cells repaint on every tick, including rows whose own commission did not change (the moving-denominator case) - and leaf rows now show a real percent under Leaves?.
  • Sorting by pctCommission stays correct across ticks; values match the old aggregator's at parent levels.
  • Heap chart (memory flags) comparable or better vs develop at high record multipliers - checks the generated dense/parent-row data classes hold V8 fast-properties shapes.
  • Fund filter + query/grouping changes behave with the calculated field included.

Generated by Claude Code

claude and others added 3 commits August 31, 2026 11:58
…eact #4620)

Companion branch to xh/hoist-react#4636 - exercises CubeFieldSpec.calculatedFn in the cube test panel:

- pctCommission is now a calculated field computing percent-of-total at read time from the row's SUM-aggregated commission and a per-update total memoized in ctx.appData via ctx.filteredRecords. PctTotalAggregator deleted.
- No pctCommission values stamped on source orders in load or update streams - calculated fields need no source data, and the View retains its incremental data-only update path with the field included.
- Column marked read-only (editing a calculated field throws), and the field drops out of the query in the non-projection A/B mode, which calculated views disallow.

Note: requires a local hoist-react checkout on the eponymous branch.
Hoist now renders columns bound to calculated fields read-only automatically (hoist-react #4620).
Connected stores are now always projections - the View enforces the mode itself, so the tester exercises the enforced default with no explicit config.
@lbwexler

Copy link
Copy Markdown
Member Author

Superseded by a follow-up PR from branch claude/issue-4637-kyt4eq, which contains this branch's full history plus the StoreConfig.view API updates.

@lbwexler lbwexler closed this Aug 31, 2026
@lbwexler
lbwexler deleted the claude/issue-4620-kyt4eq branch August 31, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants