Skip to content

UI: Refactor MySQL connection tree to match PostgreSQL (Collapsible Object Groups) #204

Description

@ZhuchkaTriplesix

Currently, the MySQL database sidebar tree (connections_panel_mysql.dart) hardcodes the "Tables" and "Views" lists as uncollapsible flat lists directly under the database node. This differs from the PostgreSQL implementation (connections_panel_pg_tree.dart), where objects are neatly grouped into collapsible folders (Tables, Views, Functions, etc.) using _PgObjectGroup.

Tasks to implement

  1. Create _MysqlObjectGroup Widget: Create a new stateful widget in connections_panel_mysql.dart (analogous to _PgObjectGroup). It must maintain its own _expanded state and render a _PgTreeRow header with an expandable chevron (AnimatedRotation), followed by a QueryaAnimatedExpand containing the list of items.
  2. Refactor MySQL Database Node: In _MysqlDatabaseNodeState.build(), replace the hardcoded "Tables" and "Views" _PgTreeRow + lazyConnectionTreeList blocks with instances of the new _MysqlObjectGroup.
  3. Unify Visual Styling: Update the item rows inside the new group to use the correct icon styling. In PG, items use theme.colorScheme.primary.withValues(alpha: 0.5). In MySQL, they currently use mutedForeground. They should be updated to match the PG style.
  4. Context Menu Parity: Ensure that context menu parameters (openSqlDatabase, openSqlName, openSqlKind) are properly wired up and passed to the child _PgTreeRow items within the group, so they support the "Open in SQL" action just like the PostgreSQL nodes do.

Metadata

Metadata

Labels

mysqlMySQL database driver and workspaceuiUser interface components and widgets

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions