Skip to content

refactor(viewer): scope rules on a tree - #445

Merged
daggerok merged 1 commit into
mainfrom
refactor/scope-tree
Dec 4, 2026
Merged

daggerok merged 1 commit into
mainfrom
refactor/scope-tree

Conversation

@daggerok

@daggerok daggerok commented Dec 4, 2026 •

Copy link
Copy Markdown
Owner

What

  • src/viewer/app/scope-tree.ts + test: the scope as one tree, All -> source (Fidelity, ADP) -> group -> account, leaves fidelity:<number>, adp:401k, adp:pay. Pure and immutable: buildTree, groupAccounts, leavesOf, pathTo, nodeOf, parentOf, scopeOf, shownLeaves, onlyNode, toggleNode (the generalised group checkbox), toggleLeaf, framedNodes, checkState, scopeTitle, chipKids and chipLabel (a level with one child is one chip: "ADP 401k"), validScope, migrateScope (today's all, none, group:, account:, set: as leaves), migrateFolded
  • derive.ts: groupsOf, framedChips, toggleGroup, toggleAccount run on a Fidelity-only tree (one per dataset); the scope is still kept in today's words, so nothing else changes
  • Tests: every existing derive.test.ts case unchanged and passing; the plan's five traces; leaf ids of the 401k and the pay in tree-only tests (pages of only the pay, of the ADP source)

Why

Step 3 of the scope tree plan: the rules the strip uses move onto the tree the 401k joins later. Nothing the owner sees changes

Checks

  • bun test: 620 pass, 0 fail
  • parcel build --dist-dir ./.check/out + DIST=.check/out bun src/build/postbuild.ts
  • .claude/tools/etfs/tc/check.sh on the new and changed files: no output
  • git diff --check
  • Chrome on localhost:1237 with made-up data (5 made-up accounts in 2 groups): the same 16 clicks on the strip (group, account and All checkboxes, an account chip, folds, the logo) on main and on this branch give the same saved scope, folds, framed chips, checkbox states (ticked, partly, clear) and Balance card title at every step

One edge that differs

A browser whose Fidelity accounts are all in ONE group: ticking that group's box while everything is ticked used to change nothing (the group was "all"); on the tree it clears every box like the All box does (none ticked = everything shown, the numbers stay the same). With two or more groups (the owner's case) every step is the same as before

@daggerok daggerok closed this Dec 4, 2026
@daggerok daggerok reopened this Dec 4, 2026
@daggerok
daggerok merged commit 27b1a0b into main Dec 4, 2026
1 check passed
@daggerok
daggerok deleted the refactor/scope-tree branch December 4, 2026 00:53
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.

1 participant