Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
6cdb499
feat(duckdb): connect to MotherDuck and update DuckDB to 2.0.1 (#4461)
datlechin Nov 24, 2026
3eb0d7b
docs(core): ADR 0046, a monthly self-hosted license has 7 days' grace…
datlechin Nov 24, 2026
78ec49e
fix(mcp): bind approvals to the scope they showed and harden scope ru…
datlechin Nov 24, 2026
75d2bb4
docs(core): ADR 0048, a self-hosted install signs in through OIDC or …
datlechin Nov 24, 2026
9cf15f0
perf(editor): restyle a long line without typesetting it again (#4475)
datlechin Nov 24, 2026
ddf5288
perf(dashboard): publish one board per Server Dashboard refresh (#4476)
datlechin Nov 24, 2026
32dc16b
fix(focus): keep the sidebar selection accent and the keyboard when a…
datlechin Nov 25, 2026
a1238a1
feat(ai): read models from each provider and a shared catalog (#4477)
datlechin Nov 25, 2026
8955f77
feat(core): sign in to a company server and verify its license (#4470)
datlechin Nov 25, 2026
dfaf912
docs(core): ADR 0050, a self-hosted license renewal is requested by t…
datlechin Nov 25, 2026
fe6a624
docs(core): ADR 0055, managed policies for the sync provider and tabl…
datlechin Nov 25, 2026
e2b0999
feat(filter): list the filter column picker alphabetically on request…
datlechin Nov 25, 2026
2f1d007
feat(core): require RFC 9207 iss where the server promises it, compar…
datlechin Nov 25, 2026
5f4a17f
docs(core): ADR 0051, the sync protocol and its record rules (#4488)
datlechin Nov 25, 2026
3a14cbf
test(core-sqlite): measure the linked SQLite's stored tail check inst…
datlechin Nov 25, 2026
274dcd4
docs(core): 0055's personalSync keeps the key kinds, as amended by 00…
datlechin Nov 25, 2026
54efc4f
docs(core): ADR 0051, G0 round 1 fixes (#4491)
datlechin Nov 25, 2026
cd9b322
docs(core): ADR 0052, synced records have canonical ids and saved que…
datlechin Nov 25, 2026
3b3516e
docs(core): ADR 0051, G0 round 3 security fixes (#4496)
datlechin Nov 25, 2026
43753ff
docs(core): ADR 0054, one sync engine in the core for TablePro Sync a…
datlechin Nov 25, 2026
3c7724f
docs(core): ADR 0053, end-to-end sync keys under the recovery key, an…
datlechin Nov 25, 2026
f1bd5ca
docs(core): 0044 names what 0053 amends (#4499)
datlechin Nov 25, 2026
5f9ac36
docs(core): ADR 0051, G0 round 5 fixes (#4500)
datlechin Nov 25, 2026
c9ded5a
docs(core): 0054's key versions count from the chain, reset generatio…
datlechin Nov 25, 2026
836625e
docs(core): 0054 drop rule, generations without S, head times, fork b…
datlechin Nov 25, 2026
e0c55c6
docs(core): ADR 0053 G0 round 5, equivocation-only forks, new generat…
datlechin Nov 25, 2026
6a202f5
docs(core): ADR 0051, new generations and identity-key team statement…
datlechin Nov 25, 2026
9bdaa24
docs(core): ADR 0052, identity, device and member ids carry the gener…
datlechin Nov 25, 2026
8d79637
fix(transfer): show progress and results inside the import, export an…
datlechin Nov 25, 2026
e2c9a12
docs(core): ADR 0056, end-to-end keys on the 1Password and Bitwarden …
datlechin Nov 25, 2026
0aa3828
docs(core): align 0051, 0052, 0054, 0044 and 0055 with ADR 0056 (#4507)
datlechin Nov 25, 2026
4af6f5d
docs(core): ADR 0056 r2 and 0051, 0052, 0054 amendments for G0 round …
datlechin Nov 25, 2026
c2d418a
feat(policy): apply the ADR 0055 managed policy keys on the Mac and i…
datlechin Nov 25, 2026
26f3157
docs(core): ADR 0056 r3 and 0051, 0054 amendments for G0 round 2 (#4509)
datlechin Nov 25, 2026
c8f9b84
docs(core): ADR 0056 r4 and 0051, 0054 amendments for G0 round 3 (#4511)
datlechin Nov 25, 2026
d95bf4e
chore(skills): verify.sh takes a jobs cap (#4510)
datlechin Nov 25, 2026
1f95b43
docs(core): ADR 0056 r5 and 0051, 0054 amendments for G0 round 4 (#4512)
datlechin Nov 25, 2026
d881b57
docs(core): ADR 0056 r6 and 0051, 0054 amendments for G0 round 5 (#4513)
datlechin Nov 25, 2026
9072f9e
docs(core): ADR 0056 r7 and 0051, 0054 amendments for G0 round 6 (#4514)
datlechin Nov 25, 2026
e56ddf6
docs(core): ADR 0056 r8 and 0051, 0054 amendments for G0 round 7 (#4515)
datlechin Nov 25, 2026
f8e4ec2
fix(ios): keep plugin enum labels and always identities, and name an …
mvanhorn Nov 25, 2026
5402042
docs(core): accept ADRs 0051, 0052, 0054 and 0056 after G0 (#4517)
datlechin Nov 25, 2026
f5e5ea6
refactor(core): move the generated /v2 client into tablepro-cloud-api…
datlechin Nov 25, 2026
e0f17c7
feat(onboarding): setup guide, import hand-off and shortcut presets o…
datlechin Nov 25, 2026
20eab6b
feat(ios): sign in to a TablePro account through the shared core (#4492)
datlechin Nov 25, 2026
fdc66a8
feat(core): tablepro-records crate for synced kinds (#4518)
datlechin Nov 25, 2026
79e19fc
feat(core): tablepro-keys crate for the end-to-end design (#4519)
datlechin Nov 25, 2026
3dfce83
feat(core): store models, change journal and store generation (#4560)
datlechin Nov 25, 2026
fcb8da7
docs(core): ADR 0059, key errors name the expected signer and two lib…
datlechin Nov 25, 2026
01be1a3
docs(core): ADR 0060, the change journal names the records each write…
datlechin Nov 25, 2026
052faa7
docs(core): ADR 0061, the records crate settles six record rules (#4569)
datlechin Nov 25, 2026
743a2e0
docs(core): ADR 0062, a stopped scope records why it stopped (#4574)
datlechin Nov 25, 2026
5edaa79
test(ci): iOS runs on the shortcut presets now that it links the core…
datlechin Nov 26, 2026
018f999
docs(core): ADR 0064, a team restart waits for a word comparison, and…
datlechin Nov 26, 2026
e0cbe8e
docs(core): ADR 0063, the macOS app holds its results in the core bef…
datlechin Nov 26, 2026
295f67b
perf(editor): redraw only the lines a caret move or edit changes (#4570)
datlechin Nov 26, 2026
f8cacd7
perf(editor): parse edits off the main thread without copying the doc…
datlechin Nov 26, 2026
9221796
perf(autocomplete): size the completion popup before showing it and u…
datlechin Nov 26, 2026
594d9f7
docs(core): ADR 0065 and 0066, the WAL timeline check, refused change…
datlechin Nov 26, 2026
08bdd75
fix(core-storage): copy history.db into a name that does not exist ye…
datlechin Nov 26, 2026
3968cbd
fix(core): G1 round 1 fixes for tablepro-keys vectors and hardening (…
datlechin Nov 26, 2026
b055e28
feat(core): UUID record ids for synced kinds (#4587)
datlechin Nov 26, 2026
ba7b463
feat(core): sync crate contracts, FFI sync surface and fakes (#4572)
datlechin Nov 26, 2026
25b1d50
feat(core): store parity for the Mac library (ids, icons, SSH/TLS fie…
datlechin Nov 26, 2026
68b47a8
perf(import): read transaction state only when it can move, and trans…
datlechin Nov 26, 2026
4e39c02
feat(ios): connection library on the core store models (#4608)
datlechin Nov 26, 2026
b40e760
perf(export): start an export from the catalog's row estimate, not an…
datlechin Nov 26, 2026
0ddc1f4
perf(export): read a dump's table DDL once per schema (#4592)
datlechin Nov 26, 2026
baf645f
perf(connections): read the catalog side kinds in one round trip per …
datlechin Nov 26, 2026
4643c81
perf(editor): bound the memory each document's undo history holds (#4…
datlechin Nov 26, 2026
b2791c6
perf(editor): answer attributedString() with the text storage (#4562)
datlechin Nov 26, 2026
c2524df
perf(connections): reconnect when the network returns and ping less w…
datlechin Nov 26, 2026
d1e2db4
feat(macos): saved queries and history on the core stores (#4611)
datlechin Nov 26, 2026
9c5bfa3
perf(autocomplete): run completion requests off the main thread with …
datlechin Nov 26, 2026
77cff41
perf(redis): page keys from a saved scan cursor and send cluster pipe…
datlechin Nov 26, 2026
9df1cb2
fix(core): replace_library refuses a file that changed since it was r…
datlechin Nov 26, 2026
7b91fec
perf(ssh): share one session per route, use the probe channel, keep l…
datlechin Nov 26, 2026
3552158
test(editor): queue each TreeSitter edit burst before any of it can p…
datlechin Nov 26, 2026
10857f3
chore(windows): add changelog.d and towncrier notes (#4612)
datlechin Nov 26, 2026
2e551d4
perf(export): stream gzip while writing a dump and while reading one …
datlechin Nov 26, 2026
62b1297
perf(drivers): decode ClickHouse and SQL Server cells without per-fie…
datlechin Nov 26, 2026
971456a
feat(core): re-vendor /v2 with sync and key operations, and RFC 9470 …
datlechin Nov 26, 2026
917c297
perf(editor): scan a large script's run controls off the main thread …
datlechin Nov 26, 2026
1f3363e
perf(sidebar): match ASCII names by bytes and filter each container o…
datlechin Nov 26, 2026
6400623
perf(connections): use the idle session for the first listing and rea…
datlechin Nov 26, 2026
32b4099
perf(idle): save tabs only after a change and let the app nap with a …
datlechin Nov 27, 2026
0a2120f
perf(connections): send session setup with the connect instead of in …
datlechin Nov 27, 2026
cc50546
perf(editor): keep each query tab's document when switching tabs (#4588)
datlechin Nov 27, 2026
8c47b6c
test(memory): pin that a closed tab lets go of its rows and its resul…
datlechin Nov 27, 2026
ee20f01
ci(ios): install the simulator runtime when the runner image lacks it…
datlechin Nov 27, 2026
2dc1d14
ci(linux): pull Docker Hub images through mirror.gcr.io instead of an…
datlechin Nov 27, 2026
fec5b18
test(core): let each step-up test permit release one sign-in page (#4…
datlechin Nov 27, 2026
422d6ac
test(ios): fail the sync merge save with a read-only folder, not a de…
datlechin Nov 27, 2026
22f3ad1
fix(core-postgres): read the catalogs of PostgreSQL 10 to 13 (#4613)
datlechin Nov 27, 2026
98f6883
test(windows): live-server tests for PostgreSQL (#4614)
datlechin Nov 27, 2026
4079a88
fix(plugin-oracle): follow TNS listener redirects (#4610)
datlechin Nov 27, 2026
20770d4
ci(deps): bump the actions group across 1 directory with 2 updates (#…
dependabot[bot] Nov 27, 2026
873fc11
perf(memory): build each result row at its exact size in every driver…
datlechin Nov 27, 2026
d465598
perf(results): run the adapter's side of every driver call off the ma…
datlechin Nov 27, 2026
f51edc1
perf(autocomplete): rank table names from a prebuilt index instead of…
datlechin Nov 27, 2026
e60d667
fix(ios): a library write after the core's file went missing writes i…
datlechin Nov 27, 2026
3fd812b
perf(data-grid): read large text, JSON and binary cells as a head and…
datlechin Nov 27, 2026
d42bb33
fix(results): check for Stop just before a user statement reaches the…
datlechin Nov 27, 2026
c5d735a
feat(connections): projects that keep one product's connections, quer…
datlechin Nov 27, 2026
bb6d4a3
perf(sqlite): run SQLite statements on their own thread, not Swift's …
datlechin Nov 27, 2026
7407caf
perf(postgresql): read rows in libpq chunks instead of one result per…
datlechin Nov 27, 2026
5b45237
perf(mongodb): read each document's BSON once with libbson's iterator…
datlechin Nov 27, 2026
f1dffe0
feat(core-ai): tool calling for both provider protocols (#4630)
datlechin Nov 27, 2026
0404813
feat(windows): per-shortcut rebinding with a recorder (#4627)
datlechin Nov 27, 2026
cb48f3e
feat(windows): command palette / quick switcher (#4628)
datlechin Nov 27, 2026
f0fc0b5
feat(core): query-plan model, parsers and FFI (#4622)
datlechin Nov 27, 2026
e753de7
feat(core): SSH and credential profiles go through the checked librar…
datlechin Nov 27, 2026
67d604f
fix(linux): read the assistant message text through ChatMessage::text…
datlechin Nov 27, 2026
065acfd
perf(paging): seek on the primary key for next, previous and last pag…
datlechin Nov 27, 2026
90fe85f
fix(plugin-oracle): load the sidebar, long values and CLOBs on Oracle…
datlechin Nov 27, 2026
8af8705
fix(theme): stop a themed window covering the sidebar in full screen …
datlechin Nov 27, 2026
03d311e
fix(theme): make selections visible in every built-in theme (#4636)
datlechin Nov 27, 2026
98bb0b7
feat(core): end-to-end sync engine, accounts and keys (ADR 0044, 0056…
datlechin Nov 27, 2026
dc15243
fix(windows): make the command palette's commit event args a class (#…
datlechin Nov 27, 2026
ddafb12
test(core-storage): the report test builds its profile without serde_…
datlechin Nov 27, 2026
806d4c9
fix(windows): mark ShortcutRecorderButton partial for the AOT publish…
datlechin Nov 27, 2026
8271f51
fix(core-sync): a reopened service waits for its state file, and key …
datlechin Nov 27, 2026
e50a954
docs(core): ADR 0068 moves the pending-edit tracker and undo to the c…
datlechin Nov 27, 2026
051bb76
feat(core): sync connection projects (#4642)
datlechin Nov 27, 2026
2cce543
feat(core): the host peeks and acknowledges the library writes the co…
datlechin Nov 27, 2026
f28a8b6
feat(core): Team Library connections cross as library records, and ev…
datlechin Nov 27, 2026
ec95fcc
docs(core): ADRs 0069 to 0075 settle the full-sync milestone's ruling…
datlechin Nov 28, 2026
6bedf84
fix(macos): stop typing in the connection form's Tags field from cras…
datlechin Nov 28, 2026
ea66de3
fix(macos): open row context menus from VoiceOver and the keyboard (#…
datlechin Nov 28, 2026
4d4925a
feat(core-sync): sync passwords end to end as personal envelopes (#4665)
datlechin Nov 28, 2026
bed162f
fix(windows): run the shortcuts UI test serially and scroll to its ca…
datlechin Nov 28, 2026
c89f096
feat(core): grid copy and display text into the core (C-11) (#4653)
datlechin Nov 28, 2026
eeff06a
feat(windows): agent mode for the AI assistant (1b, 1c, 2) (#4657)
datlechin Nov 28, 2026
0a7066e
fix(core): no state transaction held across a nested begin or a netwo…
datlechin Nov 28, 2026
a262573
feat(core): table structure/DDL and SQL dump/import through the FFI (…
datlechin Nov 28, 2026
d8e4772
fix(core): list and decide sync approvals per record, show them in th…
datlechin Nov 28, 2026
d970079
fix(macos): build the menu anchor test's selection without the reduce…
datlechin Nov 28, 2026
6afee86
feat(core): script runner with a batch error policy into the core (C-…
datlechin Nov 28, 2026
bb41eb8
fix(linux): drop the icu deps the app no longer uses (#4670)
datlechin Nov 28, 2026
4a57f48
feat(core): move the pending-edit tracker and undo to the core, keyed…
datlechin Nov 28, 2026
1b5d480
fix(core): route a personal approval to the engine that listed it (#4…
datlechin Nov 28, 2026
38ea5cc
fix(core-sync): a refused envelope waits for its record, never as a r…
datlechin Nov 28, 2026
bfc26fc
fix(core-sync): the app's synced secrets host takes every kind it nam…
datlechin Nov 28, 2026
5a8deb8
fix(windows): compare stored shortcut values in the shortcuts UI test…
datlechin Nov 28, 2026
3c7e87a
fix(core-sync): the engine opens with the server out of reach and kee…
datlechin Nov 28, 2026
8583a18
fix(core): settle SSH profile names by lowest id, as credential profi…
datlechin Nov 28, 2026
4b0e421
fix(core): a log sink set from any thread never turns tracing off for…
datlechin Nov 28, 2026
97e2b02
test(windows): expect the integer rendering for a toggled boolean cel…
datlechin Nov 28, 2026
ca28319
fix(core): name signed-out key devices and log a public code with eve…
datlechin Nov 28, 2026
7cb317c
test(core): name the captured log line type in the log code tests (#4…
datlechin Nov 28, 2026
dc43cf4
test(core): the project import fakes return the credential write resu…
datlechin Nov 28, 2026
f9adcff
feat(core-sync): team connection secrets as team envelopes (#4682)
datlechin Nov 28, 2026
9ebc4f0
test(ios): lock the folder a failing sync merge save writes to, since…
datlechin Nov 28, 2026
10a30d0
fix(core): a Team Library copy carries no device credential path, and…
datlechin Nov 28, 2026
b85cf95
fix(macos): a Team Library or linked-folder row asks before it uses t…
datlechin Nov 28, 2026
07a3028
feat(windows): TablePro Sync settings, status and end-to-end encrypti…
datlechin Nov 28, 2026
99b8ec6
fix(core): a run's times cross in microseconds, so a run under a mill…
datlechin Nov 28, 2026
6d09ec8
fix(core-sync): a server that never answers is out of reach in second…
datlechin Nov 28, 2026
61457a0
fix(windows): passwords sync under TablePro Sync by default (#4689)
datlechin Nov 28, 2026
ce1706f
fix(macos): start a new folder's rename and keep a rename across a re…
datlechin Nov 28, 2026
1d3292c
fix(macos): keep a rename's caret and selection across a Favorites re…
datlechin Nov 28, 2026
018bb66
test(macos): the history downgrade probe checks the stores 0.88.0 rea…
datlechin Nov 28, 2026
d02dfdb
fix(windows): settings cards set Content only when there is one (#4693)
datlechin Nov 28, 2026
c8beb2d
fix(macos): explain a feature a company license leaves out instead of…
datlechin Nov 28, 2026
6876e08
ci(ios): boot an iPhone on the selected Xcode's simulator runtime and…
datlechin Nov 28, 2026
bebe73c
fix(macos): a file row's sign-in question names the file it opens on …
datlechin Nov 28, 2026
3bb881e
build(linux): drop indexmap from the app, unused since pending edits …
datlechin Nov 28, 2026
39682c2
feat(macos): TablePro Sync on the core, with keys, approvals, passwor…
datlechin Nov 28, 2026
b25a198
fix(sync): show the Passwords switch off while the server does not sy…
datlechin Nov 28, 2026
7b99547
docs(sync): changelog fragments for the Passwords switch fix (#4700)
datlechin Nov 28, 2026
05f8078
ci(macos): give macOS Tests 150 minutes, since a cold Rust cache push…
datlechin Nov 28, 2026
e2514e4
fix(core-sync): a key rotation never keeps a key device no device row…
datlechin Nov 28, 2026
87f9280
chore(release): move release/0.89 to main e2514e4b09 for v0.89.0-beta.2
datlechin Nov 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/macos-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
macos:
name: macOS Tests
runs-on: xcode-27
timeout-minutes: 120
# A warm run takes about 105 minutes. A Cargo.lock change misses the Rust cache and adds about 20 minutes to rebuild the core.
timeout-minutes: 150
env:
NSUnbufferedIO: "YES"
COMPILE_PLUGINS: ${{ inputs.plugins }}
Expand Down
9 changes: 7 additions & 2 deletions apple/TablePro/Core/Services/Account/AccountServices.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ internal final class AccountServices: AccountBackendListener {
// Whether subscribers know of a session, so a sign-out reaches them once, whether the core's listener or the
// call that caused it gets here first.
private var announcedSession = false
// Why the last sign-in ended, for Settings to say so until the next one.
private var signedOutBy: AccountSignOutCause?

init(
backend: any AccountBackend,
Expand Down Expand Up @@ -314,8 +316,9 @@ internal final class AccountServices: AccountBackendListener {

// A sign-out the person asked for is announced by the call that made it.
func accountStatusChanged(signedOutBy cause: AccountSignOutCause?) {
if cause != nil {
if let cause {
verifiedAt = nil
signedOutBy = cause == .user ? nil : cause
}
publish()
guard let cause, cause != .user, !isSignedIn else { return }
Expand Down Expand Up @@ -397,6 +400,7 @@ internal final class AccountServices: AccountBackendListener {
}
if snapshot.state == .signedIn {
announcedSession = true
signedOutBy = nil
}
let license = backend.license()
access.update(AccountState(
Expand All @@ -408,7 +412,8 @@ internal final class AccountServices: AccountBackendListener {
features: features,
verifiedAt: verifiedAt,
isRestored: isRestored,
sessionID: snapshot.sessionID
sessionID: snapshot.sessionID,
signedOutBy: signedOutBy
))
let current = now()
let boundaries = [entitlement?.expiresAt, license?.expiresAt, license?.graceEndsAt].compactMap { $0 }
Expand Down
2 changes: 2 additions & 0 deletions apple/TablePro/Core/Services/Account/FeatureAccess.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ internal struct AccountState: Equatable, Sendable {
var isRestored = false
// The core's id of the sign-in; what the app keeps for a sign-in goes with it.
var sessionID: String?
// Why the last sign-in ended when the person did not end it; nil once signed in again.
var signedOutBy: AccountSignOutCause?
}

// Whether the person in front of the app has paid, which losing the network cannot undo.
Expand Down
4 changes: 3 additions & 1 deletion apple/TablePro/Core/Sync/MoveBetweenProviders.swift
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,9 @@ extension ProviderMoves {

nonisolated static func message(forCode code: String) -> String {
switch code {
case "sync.locked", "sync.not_allowed", "sync.device_not_approved", "sync.device_removed":
case "sync.device_removed":
return String(localized: "This Mac was removed from your account. Sign in again to use TablePro Sync here.")
case "sync.locked", "sync.not_allowed", "sync.device_not_approved":
return String(localized: "This Mac cannot read your account's keys. Approve it from another device, or use your recovery key.")
case "sync.network", "sync.server", "sync.rate_limited", "sync.restore_check_unavailable", "account.unreachable":
return String(localized: "TablePro Sync cannot be reached. Your data stays on this Mac; try again once you are online.")
Expand Down
6 changes: 6 additions & 0 deletions apple/TablePro/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -229647,6 +229647,12 @@
},
"This Mac was removed from your account" : {

},
"This Mac was removed from your account. Sign in again to use it here." : {

},
"This Mac was removed from your account. Sign in again to use TablePro Sync here." : {

},
"This Mac was removed from your account. Sign in again to use your keys." : {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ internal struct AccountSettingsContent: Equatable {
static let expiryWarning: TimeInterval = 3 * 24 * 60 * 60

let identity: Identity
// The server removed this Mac's row, which ended its sign-in (core ADR 0056, A locked device).
let removedFromAccount: Bool
let notices: [Notice]
let showsPlan: Bool
let plans: [PlanRow]
Expand Down Expand Up @@ -125,6 +127,7 @@ internal struct AccountSettingsContent: Equatable {

return AccountSettingsContent(
identity: identity(state: state, profile: profile),
removedFromAccount: !state.isSignedIn && entitlement == nil && state.signedOutBy == .deviceRevoked,
notices: notices(state: state, plans: plans, isDeviceLimit: isDeviceLimit, now: now),
showsPlan: showsPlan,
plans: plans,
Expand Down
15 changes: 14 additions & 1 deletion apple/TablePro/Views/Settings/Account/AccountSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ internal struct AccountSettingsView: View {
var body: some View {
let content = model.content
Form {
AccountIdentitySection(model: model, identity: content.identity, canRefresh: content.canRefresh)
AccountIdentitySection(
model: model,
identity: content.identity,
canRefresh: content.canRefresh,
removedFromAccount: content.removedFromAccount
)

AccountServerSection(model: model, content: content)

Expand Down Expand Up @@ -57,6 +62,7 @@ private struct AccountIdentitySection: View {
@ObservedObject var model: AccountSettingsModel
let identity: AccountSettingsContent.Identity
let canRefresh: Bool
let removedFromAccount: Bool

var body: some View {
Section {
Expand Down Expand Up @@ -142,6 +148,13 @@ private struct AccountIdentitySection: View {

signInFailure

if removedFromAccount {
AccountFailureLine(
message: String(localized: "This Mac was removed from your account. Sign in again to use it here."),
identifier: "account-removed"
)
}

if server.isProduction, server.othersAllowed {
LabeledContent {
Button(String(localized: "Use a Company Server…")) {
Expand Down
5 changes: 5 additions & 0 deletions apple/TablePro/Views/Settings/SyncPaneLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ struct SyncPaneLayout: Equatable {
serverPolicies.contains(.passwordsOff) || serverPolicies.contains(.personalSyncOff)
}

// Shows what is in effect, as a setting a profile manages does; the stored choice comes back once the server allows it.
func passwordSwitch(_ settings: SyncSettings) -> Bool {
!passwordsOffOnServer && settings.passwordSwitch(on: settings.provider)
}

// `personal_sync` off holds history too, so it is the one notice then.
static func serverPolicies(_ scopes: [ScopeStatusInfo]) -> [SyncServerPolicy] {
let personal = scopes.first { $0.scope == "personal" }
Expand Down
22 changes: 9 additions & 13 deletions apple/TablePro/Views/Settings/SyncSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ struct SyncSettingsView: View {
}

if layout.showsCategories {
categoriesSection
categoriesSection(layout)
}
}
.formStyle(.grouped)
Expand Down Expand Up @@ -325,19 +325,19 @@ struct SyncSettingsView: View {
}
}

private var categoriesSection: some View {
private func categoriesSection(_ layout: SyncPaneLayout) -> some View {
Section("What Syncs") {
Toggle(isOn: syncConnections) {
Text("Connections")
Text("Connections set to Local only are left out.")
}
.accessibilityIdentifier("settings-sync-category-connections")

Toggle(isOn: passwords) {
Toggle(isOn: passwords(layout)) {
Text("Passwords")
Text(passwordsDetail)
Text(passwordsDetail(layout))
}
.disabled(!settings.syncConnections || passwordsOffOnServer)
.disabled(!settings.syncConnections || layout.passwordsOffOnServer)
.accessibilityIdentifier("settings-sync-category-passwords")

Toggle("Groups & Tags", isOn: $settings.syncGroupsAndTags)
Expand Down Expand Up @@ -372,12 +372,8 @@ struct SyncSettingsView: View {
}
}

private var passwordsOffOnServer: Bool {
layout.passwordsOffOnServer
}

private var passwordsDetail: String {
if passwordsOffOnServer {
private func passwordsDetail(_ layout: SyncPaneLayout) -> String {
if layout.passwordsOffOnServer {
return String(localized: "Your server does not sync passwords. Each one stays on this Mac.")
}
if settings.provider == .tableproSync {
Expand All @@ -391,10 +387,10 @@ struct SyncSettingsView: View {
}

// iCloud Keychain and TablePro Sync each keep their own switch.
private var passwords: Binding<Bool> {
private func passwords(_ layout: SyncPaneLayout) -> Binding<Bool> {
let settings = $settings
return Binding(
get: { settings.wrappedValue.passwordSwitch(on: settings.wrappedValue.provider) },
get: { layout.passwordSwitch(settings.wrappedValue) },
set: { settings.wrappedValue = settings.wrappedValue.settingPasswords($0, on: settings.wrappedValue.provider) }
)
}
Expand Down
5 changes: 3 additions & 2 deletions apple/TablePro/Views/Sync/Keys/AccountRecoveryKeyFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ internal final class AccountRecoveryKeyFlow: ObservableObject, Identifiable {
}
}

// A device the rotation may keep: one this Mac compared words with. This Mac always stays.
// A device the rotation may keep, as the core offers it: one this Mac compared words with that a row still holds.
// This Mac always stays.
func canKeep(_ device: ReviewedDeviceInfo) -> Bool {
device.device.compared && !device.device.thisDevice
device.canKeep && !device.device.thisDevice
}

func setKeep(_ device: ReviewedDeviceInfo, _ kept: Bool) {
Expand Down
24 changes: 17 additions & 7 deletions apple/TablePro/Views/Sync/Keys/AccountRecoveryKeySheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ internal struct AccountRecoveryKeySheet: View {
Section {
ForEach(flow.devices, id: \.device.keyDevice) { device in
AccountKeepDeviceToggle(
device: device.device,
reviewed: device,
isOn: Binding(
get: { device.device.thisDevice || flow.keep.contains(device.device.keyDevice) },
set: { flow.setKeep(device, $0) }
Expand Down Expand Up @@ -230,23 +230,33 @@ internal struct AccountRecoveryKeySheet: View {

// A device a rotation can keep, ticked for those it keeps. This Mac always stays.
internal struct AccountKeepDeviceToggle: View {
let device: AccountDeviceInfo
let reviewed: ReviewedDeviceInfo
let isOn: Binding<Bool>
let isEnabled: Bool

private var subtitle: String {
private var device: AccountDeviceInfo {
reviewed.device
}

// A key device no row holds goes with the rotation, as the Devices list shows it removed.
static func subtitle(_ reviewed: ReviewedDeviceInfo) -> String {
let device = reviewed.device
if device.thisDevice {
return String(localized: "This Mac")
}
return isEnabled
? String(localized: "You compared words with it")
: String(localized: "Asks for approval again")
if reviewed.canKeep {
return String(localized: "You compared words with it")
}
if device.device == nil {
return String(localized: "Removed")
}
return String(localized: "Asks for approval again")
}

var body: some View {
Toggle(isOn: isOn) {
Text(verbatim: AccountKeysText.deviceName(device.name))
Text(verbatim: [AccountKeysText.platform(device.platform), subtitle].compactMap { $0 }.joined(separator: " · "))
Text(verbatim: [AccountKeysText.platform(device.platform), Self.subtitle(reviewed)].compactMap { $0 }.joined(separator: " · "))
}
.disabled(!isEnabled)
.accessibilityIdentifier("account-keep-device-\(device.keyDevice)")
Expand Down
5 changes: 3 additions & 2 deletions apple/TablePro/Views/Sync/Keys/AccountRemovalFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ internal final class AccountRemovalFlow: ObservableObject, Identifiable {
}
}

// Only a device this Mac compared words with can keep its keys; every other one joins again by approval.
// The core decides: a device this Mac compared words with that a row still holds. Every other one joins again by
// approval, and one no row holds was removed or signed out, so it goes with the lost one.
func canKeep(_ device: ReviewedDeviceInfo) -> Bool {
device.device.compared && !device.device.thisDevice && device.device.keyDevice != lost.keyDevice
device.canKeep && !device.device.thisDevice && device.device.keyDevice != lost.keyDevice
}

func setKeep(_ device: ReviewedDeviceInfo, _ kept: Bool) {
Expand Down
2 changes: 1 addition & 1 deletion apple/TablePro/Views/Sync/Keys/AccountRemovalSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ internal struct AccountRemovalSheet: View {
Section {
ForEach(review.devices, id: \.device.keyDevice) { device in
AccountKeepDeviceToggle(
device: device.device,
reviewed: device,
isOn: Binding(
get: { device.device.thisDevice || flow.keep.contains(device.device.keyDevice) },
set: { flow.setKeep(device, $0) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,23 @@ struct AccountServicesTests {
}
}

// E2E F33: Settings says this Mac was removed until it signs in again.
@Test("Why the core signed the account out stays on its state until the next sign-in")
func signOutCauseStaysUntilSignIn() async throws {
let fixture = try AccountFixture()
try await fixture.signIn()
await fixture.server.set(Self.revokesDevice)

await fixture.services.refreshEntitlement()
let removed = fixture.access.state.signedOutBy
await fixture.server.set { $0.deviceRevoked = false }
try await fixture.signIn()

#expect(removed == .deviceRevoked)
#expect(fixture.access.state.isSignedIn)
#expect(fixture.access.state.signedOutBy == nil)
}

@Test("A key an older build stored is exchanged once through the core, then deleted with its payload")
func storedKeyIsExchanged() async throws {
let fixture = try AccountFixture()
Expand Down
9 changes: 9 additions & 0 deletions apple/TableProTests/Core/Sync/ProviderMovesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,15 @@ struct ProviderMovesTests {
#expect(!message.isEmpty)
#expect(!message.contains(code))
}

// E2E F33: approval can't help a removed Mac, so its words are its own.
@Test("A removed Mac is told it was removed, not to ask for approval")
func removedMacHasItsOwnWords() {
let removed = ProviderMoves.message(forCode: "sync.device_removed")

#expect(removed == String(localized: "This Mac was removed from your account. Sign in again to use TablePro Sync here."))
#expect(removed != ProviderMoves.message(forCode: "sync.device_not_approved"))
}
}

// The core engine as both the iCloud coordinator and the moves drive it, one per provider it is opened for, so the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,21 @@ struct AccountSettingsContentTests {
#expect(content.machineID == Self.machineID)
}

// E2E F33: the server removed this Mac's row, which ended its sign-in. Signed out, the page says why; any other
// sign-out the core made says nothing more than signed out.
@Test("Signed out because this Mac was removed says so, and only then")
func signedOutAsRemoved() {
let removed = Self.make(AccountState(signedOutBy: .deviceRevoked))
let refused = Self.make(AccountState(signedOutBy: .refreshRefused))
let signedIn = Self.make(AccountState(isSignedIn: true, entitlement: Self.entitlement(), signedOutBy: .deviceRevoked))

#expect(removed.identity == .signedOut)
#expect(removed.removedFromAccount)
#expect(!refused.removedFromAccount)
#expect(!signedIn.removedFromAccount)
#expect(!Self.make(AccountState()).removedFromAccount)
}

@Test("A lifetime starter-tier license reads as Pro with a Lifetime status, owned personally, with the personal billing page")
func starterLifetime() throws {
let content = Self.make(AccountState(
Expand Down
19 changes: 19 additions & 0 deletions apple/TableProTests/Views/Settings/SyncPaneLayoutTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,25 @@ struct SyncPaneLayoutTests {
}
}

@Test("A server that holds passwords back shows the switch off, and the stored choice shows again once it allows them")
func passwordSwitchShowsTheServersHold() {
var settings = SyncSettings.default
settings.provider = .tableproSync
let stored = settings

for hold in [Self.scope("personal", passwords: false), Self.scope("personal", personal: false)] {
let layout = Self.layout(provider: .tableproSync, scopes: [hold])
#expect(layout.passwordsOffOnServer)
#expect(!layout.passwordSwitch(settings))
}
#expect(settings == stored)
#expect(settings.passwordSwitch(on: .tableproSync))

let allowed = Self.layout(provider: .tableproSync, scopes: [Self.scope("personal", passwords: true)])
#expect(allowed.passwordSwitch(settings))
#expect(!allowed.passwordSwitch(settings.settingPasswords(false, on: .tableproSync)))
}

@Test("A personal scope the server keeps read-only is pull-only, as past grace")
func readOnlyScopeIsPullOnly() {
let layout = Self.layout(provider: .tableproSync, scopes: [Self.scope("personal", writable: false)])
Expand Down
Loading
Loading