Skip to content

perf(trees): stop selection InheritedWidget from rebuilding entire expanded tree #725

Description

@ZhuchkaTriplesix

Problem

Parent: #723

_ConnectionsTreeSelectionScope is an InheritedWidget. Any leaf that calls of(context) rebuilds when any selection field changes (updateShouldNotify compares all driver selections).

With several connections expanded, selecting one table can rebuild large parts of the sidebar tree.

Combined with AnimatedContainer selection chrome on _PgTreeRow / SDUI rows, that becomes paint+layout work on many rows for one click.

Proposal

  1. Prefer a ValueListenable / ListenableBuilder (or selector) so only the previous and newly selected rows rebuild.
  2. Or split scopes per connection id so cross-driver noise does not fan out.
  3. Consider DecoratedBox + instant style when Motion Off/Reduced instead of animating every selection.

Acceptance

  • Selecting a table does not rebuild unrelated expanded connection subtrees (verify with Flutter rebuild highlighter / DevTools)
  • Selection highlight still correct for PG/MySQL/SQLite/Extension/Redis/Mongo
  • No FPS spike on rapid click-through of leaves @ 120 Hz

Files

  • lib/features/connections/connections_panel.dart (_ConnectionsTreeSelectionScope)
  • _PgTreeRow consumers / SDUI isNodeSelected

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    connectionsDatabase connections, URI parsing, poolsfrontendTheme parser epic label: frontendperformanceTheme parser epic label: performanceuiUser interface components and widgets

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions