Skip to content

feat(ios): saved queries on iPhone and iPad, synced with the Mac - #3684

Open
datlechin wants to merge 7 commits into
mainfrom
feat/ios-saved-queries
Open

datlechin wants to merge 7 commits into
mainfrom
feat/ios-saved-queries

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • iOS gets saved queries. Query menu > Saved Queries lists this connection's queries and the global ones, in their folders, with search. Tapping one replaces the editor text and never runs it.
  • Query menu > Save Query… saves the editor text with a name, keyword and Global switch. Queries and folders rename, edit, move and delete from the list, through context menus and swipes.
  • iCloud Sync pulls and pushes SQLFavorite and SQLFavoriteFolder with the Mac's rules: one keyword per connection, the older query keeps a contested keyword, 900 KB limit. An existing install refetches once, since its change token already passed these records. No CloudKit schema change: both types are already in production.
  • .tablepro import reviews and imports saved queries as the Mac does, and the result alert counts them. Export gets Include Saved Queries and Also include global saved queries.
  • The rules both apps must agree on move to TableProCore: keyword winner, keyword availability, import placement, folder outline, record mapping. The Mac resolver and import path now call them.
  • A saved query or folder moved to the sample connection stays in iCloud as it was, as on the Mac, instead of being deleted there.
  • Fixed on iOS: a sync whose local write failed still saved the change token, so those changes never came back.
  • Fixed on iOS: a pull brought back a record deleted on this device before the deletion was pushed.
  • Fixed on Mac: turning a sync category on did not refetch records skipped while it was off. Added and edited records now come back; a deletion made elsewhere while it was off still does not.

Test plan

  • New, failing on main: TableProCore SyncRecordMapperSavedQueryTests, SavedQueryKeywordResolverTests, SavedQueryOutlineTests, SavedQueryImportPlacementTests, SavedQueryCodingTests, SavedQueryLedgerTests (keyword availability). iOS SavedQueryLibraryTests, SavedQueryRemoteMergeTests, SyncedWriteFailureTests, AppStateSyncWiringTests, SavedQueryDraftTests, MobileImportOutcomeMessageTests, new cases in IOSSyncCoordinatorTests and DeletedConnectionPurgeTests. Mac SyncCategoryRefetchTests.
  • Tests that pinned the old behavior, changed on purpose: IOSConnectionImportServiceTests (savedQueriesAreIgnored is now savedQueriesImport; a duplicate offers Keep Existing when the file holds its queries), IOSConnectionExportServiceTests (saved-query keys left out only when there are none), SyncFieldParityTests (both saved-query field enums are now shared record types), IOSSyncCoordinatorTests (fixture apply callbacks return Bool).
  • Simulator build: imported a .tablepro with three saved queries, saved one from the editor, made a folder and moved it there, opened it in the editor, opened the export sheet.
  • Not run: Mac to iPhone and back over real iCloud. The simulator has no iCloud account.
Light Dark
Query menu, before Before, light Before, dark
Query menu, after After, light After, dark
Saved Queries Saved Queries, light Saved Queries, dark
Row menu Row menu, light Row menu, dark
Save Query Save Query, light Save Query, dark
Import review, before Import review before, light Import review before, dark
Import review, after Import review after, light Import review after, dark
Import result Import result, light Import result, dark
Export, before Export before, light Export before, dark
Export, after Export after, light Export after, dark

Fixes #3634

# Conflicts:
#	apple/TableProMobile/TableProMobile/Views/ConnectionListView.swift
# Conflicts:
#	apple/TableProMobile/TableProMobile/Localizable.xcstrings
# Conflicts:
#	apple/TableProMobile/TableProMobile/Localizable.xcstrings
# Conflicts:
#	apple/TableProMobile/TableProMobile/Localizable.xcstrings
#	apple/TableProMobile/TableProMobileTests/Onboarding/AppStateFixture.swift

This branch has not been deployed

No deployments
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.

Saved queries on iPhone and iPad, synced with the Mac

1 participant