feat(connections): show tag and group in the connection switcher and welcome list#1752
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 67cd678f53
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let metadata = ConnectionMetadata.resolve( | ||
| connection: connection, | ||
| tags: TagStorage.shared.loadTags(), | ||
| groups: GroupStorage.shared.loadGroups() | ||
| ) |
There was a problem hiding this comment.
Resolve active row badges from saved connection metadata
When an already-open connection is edited or moved to a group, the form/group actions update ConnectionStorage but do not refresh DatabaseManager.activeSessions[...].connection; because active rows resolve badges from that session snapshot and the saved copy is filtered out of inactiveSaved, reopening the switcher can keep showing the old tag/group or no group until the connection is reconnected. Use the current saved connection for the metadata lookup when the row is active, or update the session metadata on connection changes.
Useful? React with 👍 / 👎.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
…ps-connection-list-vrzdq # Conflicts: # TablePro/Views/Connection/WelcomeConnectionRow.swift
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acd33263ac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if tags.count == 1 { | ||
| Text(tags[0].name) | ||
| .font(.caption) | ||
| .foregroundStyle(.secondary) | ||
| .lineLimit(1) | ||
| } else if tags.count > shown.count { |
There was a problem hiding this comment.
Preserve tag names when multiple tags are assigned
When a connection has two or more tags, this badge renders only colored dots (and an overflow count for 4+ tags) while omitting all tag names from the visible row. In the newly added connection switcher badge this means multi-tag connections still rely on ambiguous colors and do not show the assigned tags at a glance unless the user hovers for the tooltip.
Useful? React with 👍 / 👎.
Closes #1323.
Problem
The connection switcher popover (the list in the issue screenshot) showed only a colored dot, the name/subtitle, and a database-type pill. It never showed the connection's tag name or its group, and it is a flat list with no group sections, so group membership was invisible. Color alone is ambiguous, so users could not tell production from staging at a glance. The welcome window already showed the tag badge but never the group inline.
The data model (
tagId,groupId,ConnectionTag/ConnectionGroupwith color presets like production=red) was already complete, so this was a display gap only.Change
ConnectionMetadataBadges.swift: reusableConnectionTagBadge(colored dot + name) andConnectionGroupBadge(folder glyph tinted by the group color + name), plus a pureConnectionMetadata.resolve(connection:tags:groups:)resolver. The folder-vs-dot distinction keeps tag and group separable, so neither relies on color alone.ConnectionSwitcherPopover: each row shows the tag badge before the database-type pill and the group on the subtitle line.WelcomeConnectionRow: uses the shared tag badge and gains a matching group label on the subtitle line, so both lists are consistent.Stale
tagId/groupId(referenced tag or group deleted) resolve to nil and render nothing.Tests
ConnectionMetadataTestscovers the resolver: valid id resolves, unassigned returns nil, and a stale/deleted id returns nil, for both tag and group.swiftlint lint --strict: clean on changed filesxcodebuild test -only-testing:TableProTests/ConnectionMetadata: passing