Skip to content

Phase 2 — migrate all <button> to Button/IconButton primitives (sweep) #152

@NicolaasGrobler

Description

@NicolaasGrobler

Scope

Migrate every raw <button className="..."> in src/ to use the Button / IconButton primitives shipped in Phase 1 (#149, PR #150).

Inventory

337 raw <button> instances across 36 files (grep <button\b in src/). Top offenders:

File Count
DatabaseExplorer.tsx 61
ResultsPanel.tsx 50
MultiQueryDialog.tsx 23
SettingsDialog.tsx 20
ImportExportDialog.tsx 18
CompareDialog.tsx 16
MainContent.tsx 15
ConnectionDialog.tsx 15
Toolbar.tsx 12
AppLayout.tsx 11
VisualOptimizer.tsx 10
HelpDialog.tsx 6
ActivityMonitor.tsx 6
CloneDialog.tsx 6
(22 more, 1–7 each) 68

A single PR for all 337 is unreviewable. Splitting into focused sweeps:

Sweep 2A — App chrome (highest visual impact)

Toolbar.tsx (12) + AppLayout.tsx (11) + MainContent.tsx (15) + Sidebar.tsx (if any) + ConfirmDialog.tsx (3, also adopt Dialog primitive).
Sets the visual tone of the whole app.

Sweep 2B — Settings & Help

SettingsDialog.tsx (20) + HelpDialog.tsx (6) + UpdateNotification.tsx (8) + CliDownloadDialog.tsx (3) + PsqlHelpDialog.tsx (3) + VariableSubstitutionDialog.tsx (3).

Sweep 2C — Connection / Create dialogs

ConnectionDialog.tsx (15) + CreateDatabaseDialog.tsx (3) + CreateTableDialog.tsx (5) + ImportExportDialog.tsx (18) + SchemaSelectionDialog.tsx (7). Includes killing the 50+ hardcoded #1e1e1e / #2d2d2d / #111111 values in ConnectionDialog.tsx — the audit's #1 offender.

Sweep 2D — Results + Editor pane

ResultsPanel.tsx (50) + VisualOptimizer.tsx (10) + QueryEditor.tsx (1) + AddRowModal.tsx (3) + DefinitionModal.tsx (2).

Sweep 2E — Tools modals

AIAssistantDialog.tsx (3) + ActivityMonitor.tsx (6) + CompareDialog.tsx (16) + CloneDialog.tsx (6) + MultiQueryDialog.tsx (23) + ToolGuideWizard.tsx (4).

Sweep 2F — Explorer trees

DatabaseExplorer.tsx (61) + FilesExplorer.tsx (3) + LocalHistoryDialog.tsx (6) + PsqlWindow.tsx (4). The 61 in DatabaseExplorer are mostly context menu items — likely surfaces a need for a Menu / MenuItem primitive that's a follow-up.

Rules per sweep

  • Each sweep its own branch and PR with before/after screenshots in both themes.
  • A raw <button> is allowed only when the primitive genuinely doesn't fit — document inline if so.
  • No hardcoded hex / rgb in className values — replace with token variables.
  • Run npx tsc --noEmit and npm test before opening the PR.
  • Visual regression check: open each affected dialog/screen in npm run tauri dev, verify nothing looks broken in dark and light themes.

Order

Recommended: 2A → 2C → 2B → 2D → 2E → 2F. Chrome first for visible coherence, ConnectionDialog second because it's the worst offender, others as the team has appetite.

Tracked under #149.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accessibilityAccessibility and a11y improvementsenhancementNew feature or requestrefactorCode restructuring without behavior change

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions