Skip to content

refactor(macos): move 35 stores onto one JSON store type and share one database list - #4303

Merged
datlechin merged 3 commits into
mainfrom
refactor/app-structure-4273
Nov 16, 2026
Merged

datlechin merged 3 commits into
mainfrom
refactor/app-structure-4273

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • UI-14: one container list, DatabaseSwitcherList, hosted by the toolbar's database and schema switcher and by Restore Dump's database picker. DatabaseSwitcherSheet is deleted.
  • The restore picker now shows favorite stars and offers the favorites and Copy Name menu, and always lists databases.
  • AR-12: one store abstraction in Core/Storage/Preferences: JSONDefaultsKey with KeyValueStore.read, write and removeValue, and JSONFileStore for one JSON value per file. A read returns StoreRead (missing, value, unreadable) and a write throws, so a store can tell damaged data from none. Failures are logged in one place, with a key or file name public only up to its connection id, so database, schema and table names stay private.
  • 35 stores moved onto it with the same keys, file paths, encoder settings and write options, so every stored format stays readable by the previous stable.
  • Defaults stores: CodableListPreferenceStore (linked folders, linked SQL folders), RowGenerationSettingsStore, ServerDashboardTileStorage, ImportColumnMappingStore, ValueDisplayFormatStorage, InspectorFieldHeightStore, WorkspaceRailOrderStore, RecentTablesStore, TableFolderStorage, RecentConnectionsStore, ERDiagramPositionStorage, HistoryPanelPreferencesStorage, QueryInsightsPreferencesStorage, ExternalConnectionTrustStore, MCPApprovalStore, LoadableExtensionApprovalStore, CustomSlashCommandStorage, FavoriteDatabasesStorage, DatabaseTreeFilterStorage, ConnectionApprovalStore, CompareSyncProfileStorage, MCPServerStore, FilterPresetStorage, FavoritesExpansionState.
  • File stores: AgentSessionStore, LastOpenConnectionsStorage, ExportProfileStorage, RecentlyClosedTabStore, HighlightRuleStorage, TableHealthHistoryStorage, AIChatStorage, SandboxKeychainStore, TeamLibraryStateStore.
  • Left on their own code: GroupStorage, TagStorage, FavoriteTablesStorage and the favourites order (they move to the core's library in ADR 0010 slice 1b), SSHProfileStorage, CredentialProfileStorage, FilterSettingsStorage, ColumnLayoutPersister, TabDiskActor, AppSettingsStorage, MCPTokenStore, ExecutionAuditLog, WindowSidebarState, the Cloudflare, Cloud SQL and tunnel command managers, RemoteDatabaseFileStore, LegacyLicenseStore. Not JSON value stores: the SQLite stores, TableLoadHistoryStore (JSON lines), ForeignKeyLabelColumnStore (sentinel bytes), and the plist-valued expansion and option stores.
  • AR-02 is not in this PR: ADR 0010 makes the core's ConnectionLibrary and tablepro_storage::cloudkit the one model and mapper (slices 1b and 2), which needs the core library linked into both apps first.
  • AR-03, AR-08 and AR-09 are left for later runs.

Test plan

  • New JSONDefaultsKeyTests, JSONFileStoreTests and StoreLogTests: missing, unreadable data left in place, round trip, the written bytes match the encoder each store used before, and the logged name stops at the connection id.
  • Every moved store's existing suite passes unchanged (563 cases across 51 suites), including the ones that pin stored bytes and legacy keys.
  • DatabaseSwitcherFilterTests and DatabaseSwitcherRefreshTests pass.

Refs #4273

@datlechin
datlechin merged commit 806b0db into main Nov 16, 2026
11 checks passed
@datlechin
datlechin deleted the refactor/app-structure-4273 branch November 17, 2026 04:12
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