Skip to content

refactor(graph): move the drill-down members to GroupingMixin - #1136

Open
redfish4ktc wants to merge 1 commit into
refactor/move_label_order_page_members_to_mixinsfrom
refactor/move_drill_down_members_to_grouping_mixin
Open

refactor(graph): move the drill-down members to GroupingMixin#1136
redfish4ktc wants to merge 1 commit into
refactor/move_label_order_page_members_to_mixinsfrom
refactor/move_drill_down_members_to_grouping_mixin

Conversation

@redfish4ktc

Copy link
Copy Markdown
Member

Note

Last PR of the stack: #1131#1132#1134#1135 → this one. The base is refactor/move_label_order_page_members_to_mixins, so the diff shown here contains only this step.

Fifth and final implementation step of the plan recorded in ADR 0003 (#1130). No behavior change, and the public API is unchanged.

Changes

Moved to GroupingMixin: resetViewOnRootChange, getCurrentRoot, getTranslateForRoot, getChildOffsetForCell, home and isValidRoot.

GroupingMixin already owns enterGroup and exitGroup, the two entry points of drill-down navigation, and it already had to declare isValidRoot and getCurrentRoot as external dependencies in order to implement them. Both now disappear from its dependency list.

AbstractGraph keeps calling home and resetViewOnRootChange from processChange, and getCurrentRoot from getDefaultParent. Declaration merging supports this without any change at the call sites.

AbstractGraph.ts loses 89 lines and its last use of Point.

What stays behind, deliberately

defaultParent, getDefaultParent and setDefaultParent are not moved, although they belong to the same topic. They are the most used entry point of the whole API and are read from processChange, so the cohesion gain does not justify the churn. This is recorded in Appendix B.2 of the ADR.

A caveat worth recording

Drill-down is view navigation, while grouping is model restructuring. They are two concerns sharing a file because no better home exists under the current rules, not because they belong together.

When GroupingMixin is converted to a plugin, the split should be reconsidered rather than carried over. The commit message records this so it does not get lost.

Result of the whole plan

AbstractGraph.ts goes from 1337 to 811 lines across the five PRs of the stack, with no breaking change other than the accessor binding note already in the changelog.

What remains in the class is what Appendix C of the ADR says should remain: the bootstrap contract, the collaborators, the plugin registry, the model-to-view dispatch, the lifecycle, and the properties parked by the shared-state constraint until their host mixin becomes a plugin.

Validation

Run locally on Node 24 (.nvmrc): build, test-check, the full suite (505 tests, 60 suites), lint, check:circular-dependencies. All passing, and no test needed changing.

@redfish4ktc redfish4ktc added the refactor Code refactoring label Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6ab76a70-94c4-4368-8ba1-910d4e9269ea

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

GroupingMixin already owns enterGroup and exitGroup, the two entry points of drill-down navigation, and it already had
to declare isValidRoot and getCurrentRoot as external dependencies to implement them. Move the members those methods
depend on: resetViewOnRootChange, getCurrentRoot, getTranslateForRoot, getChildOffsetForCell, home and isValidRoot.

AbstractGraph keeps calling home and resetViewOnRootChange from processChange, and getCurrentRoot from
getDefaultParent, which declaration merging supports without any change at the call sites.

defaultParent, getDefaultParent and setDefaultParent stay deliberately. They are the most used entry point of the whole
API and are read from processChange, so the cohesion gain does not justify the churn.

Worth recording for the eventual conversion of this mixin to a plugin: drill-down is view navigation while grouping is
model restructuring. They are two concerns sharing a file because no better home exists today, so this move should not
be read as a statement that they belong together.

AbstractGraph loses 89 lines and its last use of Point, and now stands at 811 lines, down from 1337 at the start of the
plan.
@tbouffard
tbouffard force-pushed the refactor/move_drill_down_members_to_grouping_mixin branch from 1a9ede4 to fe49375 Compare August 12, 2026 04:50
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant