Skip to content

refactor(connections): compose connection forms from reusable network, credentials, and SSL sections #1364

Description

@ZhuchkaTriplesix

Summary

Currently, five separate connection forms exist across the codebase:

  • postgresql_connection_form.dart (863 lines)
  • mysql_connection_form.dart (650+ lines)
  • mongodb_connection_form.dart (768 lines)
  • sqlite_connection_form.dart (500+ lines)
  • extension_connection_form.dart

These forms duplicate 60–70% of their UI and validation logic:

  1. Host, port, and socket fields with identical integer range validations (1–65535).
  2. Username and password fields with identical show-password eye toggle buttons (as identified in epic(ui): buttons in the Querya UI kit: one control scale, our own button family, no shadcn buttons #1331: "the show-password eye button is pasted into four forms").
  3. Database / schema name inputs, SSH Tunnel sections, and SSL certificate fields.
  4. Test connection and save action handling (partially targeted by refactor(ui): migrate dialogs and forms to QueryaButton and QueryaDialogActions #1338 for footers).

Proposed Solution

  1. Create reusable composite form sections in lib/features/connections/forms/:
    • ConnectionHostPortSection: Host, port, and unix socket inputs with unified validation.
    • ConnectionAuthSection: Username, password with shared password-visibility toggle from Querya UI Kit.
    • ConnectionDatabaseSection: Database name, schema, search path.
  2. Refactor PostgreSQL, MySQL, and MongoDB connection forms to compose these shared sections rather than duplicating input trees.

Acceptance Criteria

  • Shared network and credentials sections are used across connection forms.
  • Password visibility toggle logic is unified into a single reusable component.
  • Existing form validation, saving, and secret storage behavior remains unchanged.

Activity

  1. added
    frontendTheme parser epic label: frontend
    uiUser interface components and widgets
    connectionsDatabase connections, URI parsing, pools
    P2Medium priority / Parity & Refactoring
    on Oct 10, 2026
  2. ZhuchkaTriplesix commented on Oct 11, 2026

    @ZhuchkaTriplesix
    MemberAuthor

    Done in #1390 (merged into dev).

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

    P2Medium priority / Parity & RefactoringconnectionsDatabase connections, URI parsing, poolsfrontendTheme parser epic label: frontenduiUser interface components and widgets

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions