Skip to content

feat(toolbar): tint engine icon with connection color for at-a-glance identity#1046

Merged
datlechin merged 6 commits intomainfrom
feat/issue-1044-toolbar-connection-identity
May 6, 2026
Merged

feat(toolbar): tint engine icon with connection color for at-a-glance identity#1046
datlechin merged 6 commits intomainfrom
feat/issue-1044-toolbar-connection-identity

Conversation

@datlechin
Copy link
Copy Markdown
Member

@datlechin datlechin commented May 6, 2026

Summary

  • Replaces the gray "PostgreSQL 16.x" toolbar text with the database engine icon tinted with the connection's color, followed by the connection name. Multiple windows targeting the same database (prod-safe, prod-unsafe, staging, local) become distinguishable at a glance instead of all reading the same vendor + version.
  • Single-element pattern, matching Calendar.app and Reminders.app: the icon shape carries the engine type, the icon tint carries the user-chosen connection identity. Same rendering as the existing ConnectionSidebarHeader.swift and WelcomeConnectionRow.swift, so the connection looks consistent across sidebar, welcome screen, and toolbar.
  • When Connection Color = None, the icon falls back to the database type's brand color via the existing displayColor resolver, so the brand identity is preserved by default. Brand color only changes when the user opts in.
  • Engine icon scales with Dynamic Type via @ScaledMetric.
  • Database vendor and version move to the hover tooltip (prod-safe • PostgreSQL 16.1) and the VoiceOver label (Connection: prod-safe, PostgreSQL 16.1), so the info is one hover or one screen-reader stop away.
  • Both the connection-name and database-name Text labels now use .fixedSize(horizontal: true, vertical: false). Previously SwiftUI compressed flexible text inside the NSHostingController principal item before NSToolbar got a chance to evaluate intrinsic width, so a long database name would render truncated as sep... even in a 1900pt-wide window.
  • Drops dead tagName: String? and connectionState: ToolbarConnectionState props on ConnectionStatusView (neither was rendered) and updates the TableProToolbarView caller to stop computing them.
  • Pre-existing trailing-pipe artifact (a divider rendered after PostgreSQL 16.x even when databaseName was empty, e.g. Redis or fresh Postgres) is fixed in passing by moving the divider inside the if !databaseName.isEmpty branch.

Fixes #1044.

Test plan

  • Open four PostgreSQL connections with Connection Color set to red, orange, yellow, green respectively. Toolbar shows the same Postgres icon shape in four different tints. Tooltip on each reads <connection-name> • PostgreSQL <version>.
  • Open one connection with Connection Color = None. Icon renders in the PostgreSQL brand color (#336791).
  • Toggle dark mode. Icon tint stays readable in both modes.
  • VoiceOver: focus the toolbar identity. Hear "Connection: <name>, <DB type> <version>" as a single combined element.
  • Connection with empty databaseName (Redis, fresh Postgres). Divider and database section drop without leaving a trailing |.
  • Connection with a long database name. Database name renders fully without sep... truncation in a normal-width window.
  • Larger Accessibility text size. Engine icon scales proportionally to text via @ScaledMetric.
  • Run swiftlint lint --strict.

@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 changed the title feat(toolbar): lead identity with connection name and color dot feat(toolbar): tint engine icon with connection color for at-a-glance identity May 6, 2026
@datlechin datlechin merged commit 4f9a63b into main May 6, 2026
2 checks passed
@datlechin datlechin deleted the feat/issue-1044-toolbar-connection-identity branch May 6, 2026 13:39
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.

Make it easier to differentiate connexion windows

1 participant