Send the whole config when changing row depth
A partial restore({ group_by_depth: d }) had no effect -- the buttons did
nothing, and the depth appearing to survive every rebuild was simply a tree
that had never been collapsed. So the full config goes back with the one
field changed.
table is dropped from it: the table is loaded by reference, and a stale name
in a restored config fails the lookup -- the same reason every other restore
in this file strips it.
If this still does nothing then group_by_depth is not applied when the view
is constructed, and the fix belongs in the fork beside split_by_depth.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
033176eb43
commit
02a0db386e
@ -832,7 +832,11 @@ export default function Forecast({ sources = [], sourceId, versions = [], versio
|
|||||||
async function applyDepth(d) {
|
async function applyDepth(d) {
|
||||||
const viewer = viewerRef.current
|
const viewer = viewerRef.current
|
||||||
if (!viewer) return
|
if (!viewer) return
|
||||||
await viewer.restore({ group_by_depth: d })
|
// A partial restore({ group_by_depth }) on its own did nothing, so the whole
|
||||||
|
// config goes back with the field changed. table is dropped: it is loaded by
|
||||||
|
// reference, and a stale name in the config fails the lookup.
|
||||||
|
const { table: _t, ...cfg } = await viewer.save()
|
||||||
|
await viewer.restore({ ...cfg, group_by_depth: d })
|
||||||
setExpandDepth(d)
|
setExpandDepth(d)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user