Skip to content

feat: show all database types in connection form with install status badge (#418)#428

Merged
datlechin merged 8 commits intomainfrom
feat/show-all-plugins-connection-form-418
Mar 22, 2026
Merged

feat: show all database types in connection form with install status badge (#418)#428
datlechin merged 8 commits intomainfrom
feat/show-all-plugins-connection-form-418

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

@datlechin datlechin commented Mar 22, 2026

Summary

  • Connection form type picker now shows all known database types (installed + uninstalled) instead of only installed plugins
  • Uninstalled plugins display a "Not Installed" badge next to the type name
  • Selecting an uninstalled type and connecting triggers the existing plugin install prompt

Addresses #418 (item 2)

Test plan

  • Open New Connection → type picker shows all ~17 database types
  • Installed types appear normally, uninstalled show "Not Installed" badge
  • Select uninstalled type → Test Connection → install prompt appears
  • After install, badge disappears from picker

Summary by CodeRabbit

  • New Features
    • Connection form now shows all available database types, including those not installed, with a clear "Not Installed" badge.
    • Inline plugin installation UI added: users can install missing drivers from the form, see installation progress, and retry on failure.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 22, 2026

Warning

Rate limit exceeded

@datlechin has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 58 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 96766c88-8479-4140-8e97-197898443dd7

📥 Commits

Reviewing files that changed from the base of the PR and between b06c126 and d3e2622.

📒 Files selected for processing (1)
  • TablePro/Views/Connection/ConnectionFormView.swift
📝 Walkthrough

Walkthrough

Adds a PluginManager property that exposes the union of known and currently available database types, updates the connection form to list those types, shows a "Not Installed" badge for downloadable-but-unloaded drivers, and adds inline plugin install UI and async install handling.

Changes

Cohort / File(s) Summary
Changelog
CHANGELOG.md
Added an unreleased changelog entry describing the feature to show all database types with an install status badge.
Plugin Manager
TablePro/Core/Plugins/PluginManager.swift
Added public computed property allAvailableDatabaseTypes that returns the union of loaded availableDatabaseTypes and DatabaseType.allKnownTypes, deduplicated and sorted.
Connection Form UI
TablePro/Views/Connection/ConnectionFormView.swift
Switched the Type picker to allAvailableDatabaseTypes; replaced download icon with an inline "Not Installed" badge for downloadable plugins not loaded; added install state (isInstallingPlugin, pluginInstallError), an installPlugin(for:) helper, and a conditional Section with progress, error/retry, or install button.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant User as "User"
  participant UI as "ConnectionFormView\n(UI)"
  participant PM as "PluginManager"
  participant Registry as "Plugin Registry / Downloader"

  User->>UI: Open connection form / select Type picker
  UI->>PM: request allAvailableDatabaseTypes
  PM-->>UI: return combined list (loaded + known)
  alt selected type is downloadable && driver not loaded
    UI-->>UI: show \"Not Installed\" badge
    User->>UI: tap \"Install Plugin\"
    UI->>PM: installMissingPlugin(for: type)
    PM->>Registry: download/install plugin
    Registry-->>PM: install success / failure
    PM-->>UI: update availableDatabaseTypes / install result
    UI-->>User: show progress / success / error and retry
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped into the picker, nose a-tingle,

Saw types galore — some ready, some single,
A tiny badge: "Not Installed" — so neat,
Tap to fetch drivers, progress can't be beat,
Hop, install, connect — a rabbit's tasty feat! 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: showing all database types in the connection form with an install status badge, which directly aligns with the primary modifications across all three files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/show-all-plugins-connection-form-418

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@TablePro/Views/Connection/ConnectionFormView.swift`:
- Around line 1493-1502: installPlugin(for:) currently installs a plugin but
does not populate the newly available default field values, causing isValid,
saveConnection(), and testConnection() to still see empty additionalFieldValues;
after PluginManager.shared.installMissingPlugin(for:databaseType) completes
successfully, obtain the plugin's additional field definitions (their
defaultValue) and merge/assign those defaults into the view's
additionalFieldValues (same logic used in the type-change path that materializes
defaults), ensuring the assignment runs on the main actor so bindings update UI
and validation uses the seeded values for isValid, saveConnection(), and
testConnection().
- Around line 271-302: While a plugin install is in progress (isInstallingPlugin
== true) you must block the type picker and footer actions to prevent
re-entering plugin install logic; add UI disabling and early-return guards:
disable the type Picker (the control around the type selection at/near Lines
236-258) and the footer action Buttons ("Test Connection", "Create") by binding
their .disabled to isInstallingPlugin, and inside the action handlers (e.g., the
methods or closures that implement Test Connection and Create) add an early
guard that returns if isInstallingPlugin is true before calling
installPlugin(for:) or PluginManager APIs so the install process cannot be
retriggered concurrently.
- Around line 129-130: The shared pluginInstallError state persists across
database type changes so a prior failure stays visible; update the existing
type-change handler that updates the selected database type (where you set the
selection) to also clear pluginInstallError (set it to nil) and reset
isInstallingPlugin if appropriate, or alternatively change pluginInstallError to
be keyed by DatabaseType (e.g., a [DatabaseType: String?] map) and use the
current selectedDatabaseType to read/write the error; this will ensure the UI
shows the correct install CTA when switching types.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dcdd7fd3-f80b-4df7-8211-6a7dae0635ea

📥 Commits

Reviewing files that changed from the base of the PR and between 9b76a31 and b06c126.

📒 Files selected for processing (1)
  • TablePro/Views/Connection/ConnectionFormView.swift

@datlechin datlechin merged commit dd8bc55 into main Mar 22, 2026
2 checks passed
@datlechin datlechin deleted the feat/show-all-plugins-connection-form-418 branch March 22, 2026 10:50
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