pf_app
The row axis has had Expand 0/1/2/3 since the pivot landed; the column axis had nothing. With a year over month split there was no way to step back to whole years short of dragging split_by apart in the settings panel and putting it back afterwards. Perspective gives the two axes nothing in common here. Rows collapse because the GROUP BY ROLLUP view holds every level at once and view.set_depth() hides the deeper ones. For columns there is no equivalent: expand()/collapse() take a row index, ViewConfig has group_by_depth but no split_by_depth, and split_rollup_mode only chooses whether subtotal column groups are emitted — a view shape, not an interaction. So applySplitDepth() collapses by restoring a truncated split_by, which rebuilds the view. Three consequences of that rebuild, each handled: - Once collapsed, viewer.save() only reports the short split_by, so the full hierarchy is held separately (splitFullRef) and persisted into the layout as split_full. Without it, collapsing would be a one-way door: reload while collapsed and the deeper levels are gone. adoptSplit() is the single place it is set. - perspective-config-update fires for our own restore as well as for the user rearranging the pivot, and the two mean opposite things — one must adopt the new hierarchy, the other must not. collapsingRef separates them. - Row depth lives on the discarded view, so it is re-applied afterwards. The selection is cleared on each change: slices name the split_by dimensions they were cut from, and the highlight is keyed on grid coordinates. Neither survives a column axis that just changed shape. Buttons are named for the level they show — Total, then one per split_by column — rather than numbered like Expand, since the levels are named and a number would say nothing about what you are collapsing to. Whole-axis, not per-branch: Excel can collapse 2025 while 2026 stays expanded, and this cannot. `columns` selects which measures appear, not individual split combinations, so there is no way to hide one branch's leaves while keeping another's. Verified in the browser against cash/test with split_by Year x Reason: Reason -> Total -> Year -> Reason all render the expected column sets and the right button highlights; and a reload while collapsed to Year comes back collapsed with Reason still offered. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoxNi8cFsQLPUSw3obb5NH |
||
|---|---|---|
| lib | ||
| public | ||
| routes | ||
| setup_sql | ||
| ui | ||
| .env.example | ||
| .gitignore | ||
| CLAUDE.md | ||
| install.sh | ||
| package-lock.json | ||
| package.json | ||
| PERSPECTIVE.md | ||
| pf_perspective_options.md | ||
| pf_spec.md | ||
| pf.sh | ||
| server.js | ||