feat(welcome): favorite connections from the welcome screen (#1302)#1452
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1302.
What it does
Adds a star/favorite affordance to the connection list on the welcome screen.
SyncRecordMapper.Design notes
The user cited DBeaver, DataGrip, TablePlus as having this feature. Investigation showed none of them actually does — they organize via folders and colors. The real native pattern lives in Mail, Finder, Reminders, and Notes. We follow Mail's model (duplicate into Favorites, keep in original section) because TablePro already has connection groups and we don't want favoriting to break the group the user built.
Apple switched their own "favorite" icon from heart to star in Sonoma 14.1 (Apple Music). Following suit:
starandstar.fill, with the menu strings "Add to Favorites" / "Remove from Favorites".Hover behavior:
starstar.fillThis keeps the list visually quiet for users with no favorites while still making the affordance discoverable.
Files
DatabaseConnection.swift—var isFavorite: Bool = false(CodingKeys, decode withdecodeIfPresent ?? false).ConnectionStorage.swift— propagated throughStoredConnection, decode-with-default for backward compat.SyncRecordMapper.swift—record["isFavorite"]asInt64(0|1), decoded with nil-safe default.WelcomeViewModel.swift—favoriteConnectionscomputed property andtoggleFavorite(_:)method that persists then callsrebuildTree()(respects the WelcomeViewModel tree-rebuild invariant) and emitsAppEvents.connectionUpdated.WelcomeConnectionRow.swift—isSelectedandonToggleFavoriteparameters, hover state, newfavoriteButtonview,.accessibilityAction(named:)on the row for VoiceOver rotor.WelcomeContextMenus.swift— favorite/unfavorite items in both single-selection and multi-selection menus, with correct plural strings and icons.WelcomeWindowView.swift— new top Favorites section, gated onsearchText.isEmpty && !favoriteConnections.isEmpty.Tests
ConnectionStoragePersistenceTests.swift— two new tests:isFavorite == false.isFavorite == true.The lifecycle/UI parts (hover state, context-menu wiring, section rendering) are best validated by manual interaction; no UI test infrastructure exists for the welcome list.
Docs and CHANGELOG
docs/databases/overview.mdx— new Favorites subsection under Organizing Connections.CHANGELOG.md— entry under[Unreleased] > Added.Notes
.onMoveand a per-connectionfavoriteSortIndexlater without affecting the data shape.