Skip to content

feat(connections): show tag and group in the connection switcher and welcome list#1752

Merged
datlechin merged 3 commits into
mainfrom
emdash/feat-tags-groups-connection-list-vrzdq
Jun 22, 2026
Merged

feat(connections): show tag and group in the connection switcher and welcome list#1752
datlechin merged 3 commits into
mainfrom
emdash/feat-tags-groups-connection-list-vrzdq

Conversation

@datlechin

Copy link
Copy Markdown
Member

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/ConnectionGroup with color presets like production=red) was already complete, so this was a display gap only.

Change

  • New ConnectionMetadataBadges.swift: reusable ConnectionTagBadge (colored dot + name) and ConnectionGroupBadge (folder glyph tinted by the group color + name), plus a pure ConnectionMetadata.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

ConnectionMetadataTests covers 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 files
  • xcodebuild test -only-testing:TableProTests/ConnectionMetadata: passing

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +205 to +209
let metadata = ConnectionMetadata.resolve(
connection: connection,
tags: TagStorage.shared.loadTags(),
groups: GroupStorage.shared.loadGroups()
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@mintlify

mintlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
TablePro 🟢 Ready View Preview Jun 22, 2026, 4:53 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

…ps-connection-list-vrzdq

# Conflicts:
#	TablePro/Views/Connection/WelcomeConnectionRow.swift

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +33 to +38
if tags.count == 1 {
Text(tags[0].name)
.font(.caption)
.foregroundStyle(.secondary)
.lineLimit(1)
} else if tags.count > shown.count {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@datlechin datlechin merged commit 0d042a4 into main Jun 22, 2026
2 checks passed
@datlechin datlechin deleted the emdash/feat-tags-groups-connection-list-vrzdq branch June 22, 2026 18:21
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.

show tags or groups in the connection list

1 participant