Skip to content

refactor(hig): tech-debt cleanup — ER diagram Dynamic Type, canvas toolbar, Connection Form titlebar#994

Merged
datlechin merged 7 commits intomainfrom
refactor/hig-techdebt
May 4, 2026
Merged

refactor(hig): tech-debt cleanup — ER diagram Dynamic Type, canvas toolbar, Connection Form titlebar#994
datlechin merged 7 commits intomainfrom
refactor/hig-techdebt

Conversation

@datlechin
Copy link
Copy Markdown
Member

Summary

Three deferred items from earlier phases. Each in its own commit.

Commits

  1. refactor(er-diagram) — ER diagram nodes scale with system text-size preference.

    • New ERDiagramLayout.typeScale: CGFloat reads NSFont.preferredFont(forTextStyle: .body).pointSize / 13.0 and clamps to a 1.0 floor.
    • headerHeight, columnRowHeight, nodeWidth become computed properties multiplied by typeScale.
    • ERDiagramNodeRenderer Canvas font sizes (8, 10, 11, 12pt) and layout offsets (headerTextXOffset, iconXOffset, badgeXOffset, columnNameXOffset, typeRightMargin) all multiply by scale = ERDiagramLayout.typeScale.
    • estimateHeight(columnCount:) already uses the computed properties so it auto-scales.
    • Inter-node horizontalGap and verticalGap stay fixed (gaps are layout grid, not text).

    At default text size: zero visible change. At "Larger Accessibility Sizes": nodes grow proportionally so column text stays readable inside the rows instead of overflowing.

  2. refactor(er-diagram) toolbarERDiagramToolbar (the floating bottom-trailing canvas toolbar with zoom %, fit, compact mode, reset, export) drops the RoundedRectangle(cornerRadius: 8) + .regularMaterial + manual .shadow chrome and adopts Apple's canvas overlay pattern: Capsule() shape + .thinMaterial + half-pixel .quaternary stroke. The system handles depth automatically (and dims correctly when the window loses focus). Visual change: rounded-rectangle becomes a true pill, looks lighter.

  3. refactor(connection-form) — Connection Form footer actions move into the native window toolbar.

    • Before: Test Connection / Delete / Cancel / Save / Save & Connect lived in a custom HStack footer at the bottom of the window.
    • After: each action is a ToolbarItem with semantic placement:
      • .navigation — Test Connection (with status indicator transitions: progress / checkmark / antenna)
      • .destructiveAction — Delete (only shown when editing)
      • .cancellationAction — Cancel (Esc keyboard shortcut)
      • .secondaryAction — Save Only (only shown when creating a new connection)
      • .confirmationAction — primary Save / Save & Connect (Return keyboard shortcut)
    • Body wraps in NavigationStack so .toolbar { ... } attaches to the window titlebar.
    • The 13 onChange observers that reset testSucceeded (when host/port/username/password/database/SSH/SSL fields change) move from the deleted footer view to the body.

    Matches AIProviderDetailSheet (already on this pattern) and Apple Mail's compose window.

Net change

  • +104 / -107 lines, 5 files
  • 4 commits

Visible UX changes

  • ER diagram nodes look identical at default text size; only differ at accessibility-size settings where they now stay readable.
  • ER canvas toolbar is now pill-shaped instead of rounded-rectangle, with subtler material.
  • Connection Form footer is gone — actions are at the top in the titlebar. This is the biggest visible change. Test Connection sits on the left of the titlebar; Cancel + Save sit on the right; Delete (when editing) is grouped destructively. Window content is now ~50pt taller (no footer) so forms fit better.

Test plan

  • Open ER diagram on a schema with many tables. Default size: nodes look the same. Bump system text size in System Settings → Display → Text Size: nodes grow, text stays readable inside rows.
  • ER diagram canvas toolbar is now a pill at bottom-trailing; zoom buttons, fit, compact mode toggle, reset, export still work.
  • Open New Connection: titlebar shows Test Connection on left, Cancel + Save + Save & Connect on right. No footer at the bottom.
  • Open Edit Connection: titlebar shows Test Connection + Delete on left, Cancel + Save on right.
  • Type a connection field, click Test, see "Testing..." → "Connected"; modify a field — green checkmark resets back to antenna icon.
  • Press Esc — form dismisses.
  • Press Return — primary action fires.
  • Click Delete on existing connection — confirmation dialog appears.
  • swiftlint lint --strict passes (verified locally)

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@datlechin datlechin force-pushed the refactor/hig-techdebt branch from e039350 to 4c806f7 Compare May 4, 2026 17:22
@datlechin datlechin merged commit 90c8f0e into main May 4, 2026
2 checks passed
@datlechin datlechin deleted the refactor/hig-techdebt branch May 4, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant