Skip to content

feat(connections): projects that keep one product's connections, queries and history apart - #4376

Merged
datlechin merged 36 commits into
mainfrom
feat/connection-projects
Nov 27, 2026
Merged

datlechin merged 36 commits into
mainfrom
feat/connection-projects

Conversation

@datlechin

@datlechin datlechin commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Projects for saved connections, in the macOS, iOS, Linux and Windows apps.

  • A project holds top-level groups and ungrouped connections. A connection is in at most one project. "All Connections" is built in and shows everything.
  • With a project active, the connection list, search, Favorites, Recent, saved queries, query history and the menus that list connections show only that project. Open windows stay open. A link or a saved Shortcut still opens a connection by id.
  • Switcher on the connection list of each app: the first item of the Welcome toolbar on macOS, the title menu on iOS, the primary menu on Linux, beside the page title on Windows. File > Project on macOS and Windows. Manage Projects, Move to Project, an empty-project state and "Search All Connections".
  • The active project is per device. New connections, groups and imports land in it, the setup guide's imports included. Deleting a project keeps its connections.
  • The setup guide still shows only on an empty library: an empty project does not count as one on any app.
  • MCP, AppleScript, Shortcuts, the widget, Spotlight and the CLI list the active project only. An outside MCP client that names a connection of another project by id is refused with out_of_scope. The in-app assistant is not narrowed. Nothing an outside client could not reach before is reachable now.
  • iCloud sync of projects is written but off until the CloudKit schema is deployed (below). Until then a pull keeps each device's own assignments. tablepro-records carries ConnectionProject and both projectId fields as pending, as 0054's frozen set has them.
  • Storage: optional keys, no format bump. A build from before this change drops project assignments the next time it writes the library (core/docs/decisions/0067-connection-projects.md).
  • ADRs renumbered after main took both numbers: core 0041 is now 0067, Windows 0024 is now 0027.
  • The change journal names a connection_project kind, so a project write reaches sync as a group or tag write does.
  • iOS keeps its projects in the core's store with the rest of its library (feat(ios): connection library on the core store models #4608 moved it there): LibraryWrite, library_contents and replace_library carry the project list and both project_id fields, beside fix(core): replace_library refuses a file that changed since it was read, and rebuild takes over unreadable files #4617's removing and vouched digest. There is no projects.json.
  • A project_id no project holds stays as stored and reads as no project, as main now keeps a group id the list lacks; deleting a project clears its members.

Defects found on the way, fixed here:

  • Earlier red macOS Tests (EditorTabDetachUITests.testDraggingATabOutOfTheStripOpensItInItsOwnWindow): a tab drag the app read after the button was up. main fixed it in fix(tab-strip): settle a tab drag the app reads after its release #4402; this merge brings it in.
  • A file of projects and groups with no connections imported nothing; it lands now (Linux applies it without the connection review, which has nothing to show).
  • An export asked for a project deleted meanwhile wrote the whole library; it is refused.
  • iOS applied pulled project records and deletions while project sync is off; it leaves them for the full fetch, as the Mac does.
  • A project's saved queries hid the ones with no connection.
  • Windows: moving an empty group in or out of the active project left an open form's group choices stale.
  • macOS toolbar connection switcher did not search tags, username, engine or group.
  • macOS and iOS search took the query as one substring; it now matches every word, as Linux and Windows do.
  • macOS and iOS: a group deleted on another device left a dead group id on its connections.
  • macOS: a group or tag record the build could not read was dropped on the next save.
  • Windows: deleting a connection could skip the saved-query purge with no message, and never removed its history.
  • iOS test mock RecordingSyncTransport: its IOSSyncTransport conformance moved to an extension. Xcode 27.1 fails to compile it written on the actor ("'nonisolated' on an actor") when a test that makes one lands in the same compile batch; main's own sync tests hit it too once batched with it.

Tests updated on purpose, since they pin what this change alters:

  • ConnectionSyncSchemaTests.everyDeclaredFieldIsWritable, SyncSchemaGateTests.pendingProductionDeploy, SyncFieldParityTests.sharedRecordTypes: the new record type and fields, not yet in Production.
  • SyncPendingDeletionsTests.eachSwitchWithholdsItsOwnRecordTypes, SyncRecordMapperConnectionTests.everyStoredPropertyIsClassified, ConnectionFormEditsCoverageTests, ConnectionCoverageFixture: projectId and .project classified.
  • SyncProjectMembershipTests.readableContentNamesTheProjectFields, projectsFollowGroupsAndTags; three cases in HistoryProjectScopeTests: rewritten over the real scope signal.
  • WelcomeToolbarTests.itemsKeepTheirPlaces: the project pop-up leads the toolbar.
  • ProjectMenuTests.popUpButtonShowsTheActiveScope: the pop-up's controller is ProjectPopUpController, which the AppKit toolbar hosts.
  • tablepro-records schema/tests.rs: project_id on a connection and a group, and a table for ConnectionProject.
  • tablepro-storage store_tests.rs unknown_keys_survive_a_rewrite_at_every_level: project_id is a known key now, so it survives as a UUID and the unknown key is workspace_id.
  • tablepro-storage a_read_drops_a_project_no_project_holds_and_numbers_the_projects is now a_project_id_no_project_holds_stays_stored_and_reads_as_no_project.
  • iOS AppStateProjectTests: damagedProjectsFileDoesNotLockTheList is gone and projectsPersist checks the core store, since projects have no file of their own; ProjectSyncWiringTests.unreadableProjectsFileHoldsThePull is gone for the same reason; IntentProjectScopeTests reads the project ids from the core's file.
  • tablepro-storage a_projects_export_holds_its_members_and_no_other_project: an export of a project the library no longer holds is refused instead of widened to the whole library.
  • iOS ProjectSyncWiringTests: three cases that pulled projects with project sync off now run with it on, and readableSetFollowsTheGate expects ConnectionProject only while it is on.
  • saved_queries a_list_for_a_set_of_connections_holds_theirs_and_the_ones_with_no_connection: queries with no connection belong to every project.
  • Linux ui/workspace/tests/shell.rs primary-menu action count 12 to 15; one history dialog test renamed for the reload on a switch.
  • core/crates/mcp/tests/mcp_server.rs: the out-of-scope refusal no longer names the connection.
  • QueryHistoryCoreMirrorTests.historyMovesInUnderItsIds (from feat(macos): saved queries and history on the core stores #4611): the core history search takes a project now, and the test passes none.
  • ConnectionFormEditsMergeTests.tableCoversEveryWrittenProperty (from refactor(connection-form): rebuild the macOS connection editor as a sidebar window #4417): projectId is carried over, not written by the form, as ConnectionFormEditsCoverageTests has it.
  • Windows UI TheConnectionsPageShowsOneProjectAndItsSearchStaysInside: opens the sample from Help, since feat(onboarding): setup guide, import hand-off and shortcut presets on every app #4482 took the Home sample card away.

Needs the maintainer

  • Deploy the CloudKit schema to Production (approved 2026-11-25): record type ConnectionProject, and projectId on Connection and ConnectionGroup. Then apple/scripts/export-cloudkit-schema.sh, commit the snapshot, and add the type and both fields to verifiedInProduction, all in one commit.

Screenshots

The shots below predate main's Welcome rebuild (#4415): the macOS pop-up is now the first item of the AppKit toolbar, with the same menu. Fresh shots are left for a follow-up.

Before After, project active
Before, light After, light
Before, dark Switcher menu, dark

Manage Projects

iOS, All Connections with the title menu:

iOS list

Test plan

  • verify.sh --jobs 4 on the mini, head 1616318 (main at 20770d4 merged in):
    • core: tablepro-ffi 411/411, clippy and fmt clean. tablepro-storage 505/505 on 2ff932e, unchanged since; records 119, mcp 142, foreign-import 530, cli 89, session 163 on f9b385b.
    • Windows: bindings regenerate and check, build, tests 2551/2551 (29 skipped).
    • Linux container: compile, 3781 lib tests, clippy clean.
    • macOS: 988/988 across 97 suites (projects, sync, Welcome, connection form, core mirror and import).
    • iOS: build-for-testing for the generic simulator: TEST BUILD SUCCEEDED (a127965, the mock fix on top of 1616318).
  • Owed on the MacBook (the mini has no simulator runtime): the iOS suites AppStateProjectTests, ConnectionLibraryEditingTests, ConnectionListSelectionTests, ConnectionListStateTests, ConnectionProjectEditingTests, ConnectionProjectTransferTests, CoreLibraryStoreTests, IntentProjectScopeTests, ProjectSyncWiringTests.
  • Windows UI tests run in CI only; the project UI test now opens the sample from Help.
  • Codex: review and security rounds 1 to 3; round 4 on everything since round 3 (core store move on iOS, the fix(core): replace_library refuses a file that changed since it was read, and rebuild takes over unreadable files #4617 merge, the test fixes): no findings.

Fixes #4307

… and resolve a script's connection id outside the active project
# Conflicts:
#	apple/TablePro/Core/Services/Infrastructure/WelcomeRouter.swift
#	apple/TablePro/Core/Sync/SyncCoordinator.swift
#	apple/TablePro/Resources/Localizable.xcstrings
#	apple/TablePro/ViewModels/WelcomeViewModel+ConnectionCreation.swift
#	apple/TablePro/ViewModels/WelcomeViewModel.swift
#	apple/TablePro/Views/ConnectionForm/ConnectionFormCoordinator.swift
#	apple/TablePro/Views/ConnectionForm/Panes/AppearancePaneView.swift
#	apple/TablePro/Views/Welcome/WelcomeLibraryPane.swift
#	apple/TableProMobile/TableProMobile/Views/ConnectionListView.swift
#	core/crates/ffi/tests/foreign_import.rs
#	core/docs/decisions/README.md
#	linux/ARCHITECTURE.md
#	linux/crates/app/src/ui/session_window/import_from_app.rs
#	linux/crates/app/src/ui/session_window/mod.rs
#	linux/crates/app/src/ui/session_window/window_actions.rs
#	linux/crates/app/src/ui/workspace/tests/shell.rs
#	windows/docs/decisions/0004-app-shell.md
#	windows/docs/decisions/README.md
#	windows/src/TablePro.App.Model/ForeignImportForm.cs
#	windows/src/TablePro.App/Strings/en-US/Resources.resw
#	windows/src/TablePro.App/Views/HomeView.xaml.cs
#	windows/src/TablePro.App/Views/ImportFromAppDialog.cs
#	windows/src/TablePro.Interop/ConnectionLibrary.cs
#	windows/src/TablePro.Interop/Generated/tablepro_ffi.cs
# Conflicts:
#	core/crates/storage/src/connections/cloud.rs
#	core/crates/storage/src/connections/mod.rs
# Conflicts:
#	core/crates/records/src/cloudkit/library/mod.rs
#	core/crates/records/src/schema/tests.rs
#	core/crates/storage/src/connections/mod.rs
#	core/crates/storage/src/error.rs
#	core/crates/storage/src/lib.rs
#	core/crates/storage/src/saved_queries/mod.rs
#	core/docs/decisions/README.md
# Conflicts:
#	core/crates/ffi/src/lib.rs
#	core/crates/ffi/src/library.rs
#	core/crates/ffi/tests/ai.rs
#	core/crates/ffi/tests/cloud_library.rs
#	core/crates/ffi/tests/csv_import.rs
#	core/crates/ffi/tests/library.rs
#	core/crates/ffi/tests/library_copies.rs
#	core/crates/ffi/tests/mcp.rs
#	core/crates/ffi/tests/row_edits.rs
#	core/crates/ffi/tests/safe_mode_gate.rs
#	core/crates/foreign-import/tests/review.rs
#	core/crates/mcp/src/tool_context.rs
#	core/crates/records/src/schema/tests.rs
#	core/crates/storage/src/connection_group.rs
#	core/crates/storage/src/connections/library/mod.rs
#	core/crates/storage/src/connections/mod.rs
#	core/crates/storage/src/connections/placement.rs
#	core/crates/storage/src/error.rs
#	core/crates/storage/src/lib.rs
#	core/crates/storage/tests/stored_formats.rs
#	linux/crates/app/src/services/saved_connection_editor.rs
#	linux/docs/storage.md
#	windows/src/TablePro.Interop/Generated/tablepro_ffi.cs
The iOS library moved onto the core store in #4608, so its project list moves there too: LibraryWrite and the FFI library records carry projects, and a project id no project holds stays as stored.
# Conflicts:
#	apple/TableProMobile/TableProMobile/CoreStore/CoreLibraryStore.swift
#	apple/TableProMobile/TableProMobileTests/CoreStore/CoreLibraryStoreTests.swift
#	core/crates/ffi/src/library_contents.rs
#	core/crates/ffi/tests/library_details.rs
#	core/crates/storage/src/connections/library/mod.rs
#	core/crates/storage/src/connections/store_tests.rs
#	core/crates/storage/src/lib.rs
#	windows/src/TablePro.Interop/Generated/tablepro_ffi.cs
# Conflicts:
#	windows/src/TablePro.Interop/Generated/tablepro_ffi.cs
@datlechin
datlechin merged commit c5d735a into main Nov 27, 2026
3 checks passed
@datlechin
datlechin deleted the feat/connection-projects branch November 27, 2026 16:36
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.

Separate connections per project (like DataGrip projects)

1 participant