Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
79c6dbc
Store sessions per account in the keychain
justin13888 Nov 23, 2026
0118561
Keep signed-out accounts and clean up abandoned stores
justin13888 Nov 23, 2026
aac396a
Support multiple signed-in accounts
justin13888 Nov 23, 2026
75131f1
Add account switcher
justin13888 Nov 23, 2026
92ec773
Route notifications and the Dock badge across accounts
justin13888 Nov 23, 2026
4cea0f4
Start a fresh login after each sign-in attempt
justin13888 Nov 23, 2026
1513cd1
Show avatars and Matrix IDs in the account switcher
justin13888 Nov 23, 2026
c393195
Cap the SQLite connection pool of each account store
justin13888 Nov 23, 2026
8cbb864
Raise the open file limit at launch
justin13888 Nov 23, 2026
f70686c
Show inactive accounts' notifications while Mactrix is frontmost
justin13888 Nov 23, 2026
91f3f29
Badge the account switcher with other accounts' unread rooms
justin13888 Nov 23, 2026
3e1dafc
Keep the app commands within older SDKs' builder limit
justin13888 Nov 24, 2026
86231ee
Localize the multi-account strings
justin13888 Nov 25, 2026
1f55ac7
Move the account switcher into the sidebar's status bar
justin13888 Nov 25, 2026
ca60933
Fold the signed-out notice into the account switcher
justin13888 Nov 25, 2026
3681e2b
Fold session verification into the account switcher
justin13888 Nov 25, 2026
efce943
Localize the account status strings
justin13888 Nov 25, 2026
352767e
Read the account from the window instead of the app
justin13888 Nov 26, 2026
98b7e59
Give each window its own account
justin13888 Nov 26, 2026
99caaf9
Badge each window's switcher with its other accounts' unread rooms
justin13888 Nov 26, 2026
405444a
Open notifications in the window showing their account
justin13888 Nov 26, 2026
ba7fce0
Flag verification requests for accounts no window shows
justin13888 Nov 26, 2026
34a7ccc
Localize the verification flag strings
justin13888 Nov 26, 2026
3b8e525
Show a loading state in the switcher until accounts are restored
justin13888 Nov 26, 2026
9b3c79a
Restore accounts in parallel
justin13888 Nov 26, 2026
8b7c410
Restore sessions without contacting the homeserver
justin13888 Nov 26, 2026
b9245f7
Start syncing even when account setup fails offline
justin13888 Nov 26, 2026
e8573fd
Tie "Restart sync" to the sync lifecycle
justin13888 Nov 26, 2026
2cc5081
Resend queued messages when sync comes back online
justin13888 Nov 26, 2026
73e4c96
Show which messages haven't been sent, with Retry
justin13888 Nov 26, 2026
f18b012
Log sync state changes and restarts
justin13888 Nov 26, 2026
c9a7ac4
Reconnect as soon as the network comes back
justin13888 Nov 26, 2026
6697901
Restart accounts that stay offline a few times
justin13888 Nov 27, 2026
ac6bbd5
Restart offline accounts less on battery saving or metered networks
justin13888 Nov 27, 2026
d5ba41b
Test how offline accounts are restarted
justin13888 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
7 changes: 7 additions & 0 deletions Mactrix.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@
"identifier" : "ContactLinkingTests",
"name" : "ContactLinkingTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "MatrixIntegrationTests",
"name" : "MatrixIntegrationTests"
}
}
],
"version" : 1
Expand Down
61 changes: 59 additions & 2 deletions Mactrix/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@
"" : {
"shouldTranslate" : false
},
"%@, %lld unread in other accounts" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "%1$@, %2$lld unread in other accounts"
}
}
}
},
"%@, needs attention" : {},
"%@, sync: %@" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "%1$@, sync: %2$@"
}
}
}
},
"%lld unread" : {},
"(edited)" : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -124,6 +146,7 @@
}
}
},
"%@, verification requested in another account" : {},
"%lld other events" : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -458,6 +481,7 @@
}
}
},
"Active Account" : {},
"Activities" : {
"localizations" : {
"da" : {
Expand All @@ -474,6 +498,8 @@
}
}
},
"Add Account" : {},
"Add Account…" : {},
"Add Reaction" : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -3546,6 +3572,7 @@
}
},
"logged out" : {
"extractionState" : "stale",
"localizations" : {
"da" : {
"stringUnit" : {
Expand Down Expand Up @@ -3955,6 +3982,7 @@
}
}
},
"No Account" : {},
"No backup found" : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -4131,6 +4159,8 @@
}
}
},
"Not sent yet" : {},
"Not sent. %@ Click to retry or delete." : {},
"Not signed in" : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -4896,6 +4926,7 @@
}
}
},
"Remove Account" : {},
"Reply" : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -5088,6 +5119,7 @@
}
}
},
"Restarting…" : {},
"Restoring encryption secrets…" : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -5136,6 +5168,7 @@
}
}
},
"Retry Sending" : {},
"revoked invitation for %@ to join the room" : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -5773,6 +5806,8 @@
}
}
},
"Sign In Again as %@" : {},
"Sign In Again…" : {},
"Sign in to continue." : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -5815,6 +5850,12 @@
}
}
},
"Sign Out" : {},
"Sign out of %@?" : {},
"Sign Out of %@…" : {},
"Sign Out of This Account" : {},
"Signed Out" : {},
"Signed out" : {},
"Smileys & Emotion" : {
"localizations" : {
"da" : {
Expand All @@ -5831,6 +5872,8 @@
}
}
},
"Some devices in this room aren't verified." : {},
"Someone in this room changed their identity." : {},
"Space" : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -7415,6 +7458,9 @@
}
}
},
"Switch account" : {},
"Switch account, current: %@" : {},
"Switch accounts from the sidebar or the Account menu." : {},
"Symbols" : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -7463,6 +7509,8 @@
}
}
},
"The attachment is no longer available." : {},
"The attachment's file type isn't recognized." : {},
"The original message isn't loaded." : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -7505,6 +7553,7 @@
}
}
},
"The server couldn't be reached." : {},
"They don't match" : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -7537,6 +7586,7 @@
}
}
},
"This account will be signed out on this Mac. Your other accounts stay signed in." : {},
"This device is verified" : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -7601,6 +7651,7 @@
}
}
},
"This session was ended by the server or another device." : {},
"This will remove the message for everyone in the room. This action cannot be undone." : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -8095,6 +8146,7 @@
}
}
},
"Unread rooms in your other accounts" : {},
"Unsupported attachment (%@): %@" : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -8309,6 +8361,7 @@
}
}
},
"Verification requested" : {},
"Verification status unknown" : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -8389,6 +8442,7 @@
}
}
},
"Verify this session to send messages." : {},
"Verify with Recovery Key" : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -8725,6 +8779,8 @@
}
}
},
"You were signed out." : {},
"You're already signed in as %@." : {},
"Your account recognizes this device as trusted." : {
"localizations" : {
"da" : {
Expand Down Expand Up @@ -8756,7 +8812,8 @@
}
}
}
}
},
"Your session expired." : {}
},
"version" : "1.0"
}
}
18 changes: 8 additions & 10 deletions Mactrix/MactrixApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ struct MactrixApp: App {
.windowToolbarStyle(.automatic)
.environment(appState)
.commands {
AppCommands()
AppCommands(appState: appState)
}
.onChange(of: windowState == nil, focusNotification)
.onChange(of: appState.matrixClient?.notifications.selectedRoomId == nil, focusNotification)
.onChange(of: windowState.map(ObjectIdentifier.init)) {
if let windowState { appState.focus(windowState) }
focusNotification()
}
.onChange(of: appState.notificationRouter.pendingTarget, focusNotification)
.onChange(of: appState.restoration, focusNotification)

Settings {
SettingsView()
Expand All @@ -27,12 +31,6 @@ struct MactrixApp: App {
}

func focusNotification() {
guard let windowState else { return }
guard let notificationRoomId = appState.matrixClient?.notifications.selectedRoomId else {
return
}

windowState.selectedRoomId = notificationRoomId
appState.matrixClient?.notifications.selectedRoomId = nil
appState.showNotificationTarget()
}
}
1 change: 1 addition & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ let package = Package(
.product(name: "MatrixRustSDK", package: "matrix-rust-components-swift"),
]
),
.testTarget(name: "MatrixIntegrationTests", dependencies: ["MatrixIntegration"]),
.target(
name: "MactrixApp",
dependencies: [
Expand Down
50 changes: 45 additions & 5 deletions Sources/MactrixApp/Commands.swift
Original file line number Diff line number Diff line change
@@ -1,25 +1,65 @@
import SwiftUI

public struct AppCommands: Commands {
let appState: AppState
@FocusedValue(WindowState.self) private var windowState: WindowState?
@AppStorage("fontSize") var fontSize: Int = 13

public init() {}
public init(appState: AppState) {
self.appState = appState
}

public var body: some Commands {
SidebarCommands()
InspectorCommands()
TextEditingCommands()
ToolbarCommands()
// Older SDKs' CommandsBuilder accepts at most 10 children, so the
// built-in command sets are grouped into one property.
builtInCommands

about
newTab
createRoom
quickNavigation
fontSizeCommands
accountCommands
conversationCommands
}

@CommandsBuilder
var builtInCommands: some Commands {
SidebarCommands()
InspectorCommands()
TextEditingCommands()
ToolbarCommands()
}

var accountCommands: some Commands {
CommandMenu("Account") {
ForEach(Array(appState.accounts.enumerated()), id: \.element.storeID) { index, account in
Toggle(
isOn: Binding(
get: { windowState?.accountID == account.storeID },
set: { if $0, let windowState { appState.show(account, in: windowState) } })
) {
Text(account.accountMenuTitle)
}
.disabled(windowState == nil)
.keyboardShortcut(
index < 9
? KeyboardShortcut(
KeyEquivalent(Character("\(index + 1)")), modifiers: [.command, .control])
: nil)
}

if !appState.accounts.isEmpty {
Divider()
}

Button("Add Account…") {
windowState?.loginSheet = .addAccount
}
.disabled(windowState == nil)
}
}

var about: some Commands {
CommandGroup(replacing: .appInfo) {
Button("About Mactrix") {
Expand Down
Loading
Loading