Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
40c1ab7
test: cover known fallback mobile surface kinds
austinywang Aug 18, 2026
6c42ede
fix(macOS): centralize mobile surface kind mapping
austinywang Aug 18, 2026
c1eb816
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 1, 2026
f5c462d
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 1, 2026
1a5d580
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 1, 2026
45f0cd3
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 1, 2026
22ab7eb
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 1, 2026
56b3997
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 1, 2026
06e717d
Merge branch 'main' into issue-10225-main-macos-compile
austinywang Sep 2, 2026
a8a8451
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 4, 2026
8c988d8
test: keep mobile surface mapping oracle independent
austinywang Sep 4, 2026
b5d2e3b
test: keep cloud action fixture compiling
austinywang Sep 4, 2026
fe8d798
test: update cloud port action fixture
austinywang Sep 4, 2026
579324b
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 4, 2026
ae9d2ee
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 4, 2026
0f2967b
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 4, 2026
2c1109f
Merge branch 'main' into issue-10225-main-macos-compile
austinywang Sep 6, 2026
dcbba6e
Merge branch 'main' into issue-10225-main-macos-compile
austinywang Sep 6, 2026
ed776bd
Merge branch 'main' into issue-10225-main-macos-compile
austinywang Sep 6, 2026
08afc30
Merge branch 'main' into issue-10225-main-macos-compile
austinywang Sep 6, 2026
7e0069b
Merge branch 'main' into issue-10225-main-macos-compile
austinywang Sep 6, 2026
5546397
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 6, 2026
35e01cd
fix: keep cloud socket error adapter instance-bound
austinywang Sep 6, 2026
3459f63
fix: return available right sidebar modes
austinywang Sep 6, 2026
821fc00
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 6, 2026
974efbc
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 6, 2026
d45e098
Merge branch 'main' into issue-10225-main-macos-compile
austinywang Sep 6, 2026
b33795d
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 7, 2026
f0f445f
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 7, 2026
51c652f
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 7, 2026
50d5b12
Merge branch 'main' into issue-10225-main-macos-compile
austinywang Sep 8, 2026
09472bf
Merge branch 'main' into issue-10225-main-macos-compile
austinywang Sep 8, 2026
d2b99a4
Merge branch 'main' into issue-10225-main-macos-compile
austinywang Sep 8, 2026
21d6cc2
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 8, 2026
b5a1978
Merge remote-tracking branch 'origin/issue-10225-main-macos-compile' …
austinywang Sep 8, 2026
850a216
Merge remote-tracking branch 'origin/main' into issue-10225-main-maco…
austinywang Sep 8, 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
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,12 @@ public struct MobileSurfaceKind: RawRepresentable, Codable, Hashable, Sendable {
public static let todo = MobileSurfaceKind(rawValue: "todo")
/// A transient Cloud VM loading surface.
public static let cloudVMLoading = MobileSurfaceKind(rawValue: "cloudVMLoading")
/// A native Apple Simulator surface, rendered as a fallback card on mobile.
public static let simulator = MobileSurfaceKind(rawValue: "simulator")
/// A notifications surface, rendered as a fallback card on mobile.
public static let notifications = MobileSurfaceKind(rawValue: "notifications")
/// A transient iPhone pairing surface, rendered as a fallback card on mobile.
public static let mobilePairing = MobileSurfaceKind(rawValue: "mobilePairing")
/// A transient account sign-in surface, rendered as a fallback card on mobile.
public static let accountSignIn = MobileSurfaceKind(rawValue: "accountSignIn")
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,21 @@ struct MobileStateSyncFrameCodingTests {
#expect(try JSONDecoder().decode(MobileSurfaceKind.self, from: data) == kind)
}

@Test func knownFallbackKindsUseStableWireValues() {
// These Mac panel kinds intentionally use the open-vocabulary fallback
// renderer on phones until a native mobile renderer is available.
let kinds: [(MobileSurfaceKind, String)] = [
(.simulator, "simulator"),
(.notifications, "notifications"),
(.mobilePairing, "mobilePairing"),
(.accountSignIn, "accountSignIn"),
]

for (kind, expectedRawValue) in kinds {
#expect(kind.rawValue == expectedRawValue)
}
}

@Test func workspaceRecordWithoutSurfacesDecodesAndReencodesWithoutTheField() throws {
let json = #"{"id":"ws-old","title":"old","is_selected":false,"is_pinned":false,"last_activity_at":1,"has_unread":false,"sort_index":0,"terminals":[]}"#
let decoded = try MobileSyncFrameCoder().decode(
Expand Down
41 changes: 5 additions & 36 deletions Sources/TerminalController+MobileSurfaces.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,12 @@ import Foundation
/// Mobile surface inventory and focus support kept outside `TerminalController.swift`.
extension TerminalController {
/// Maps an app panel kind to the shared, open mobile wire vocabulary.
///
/// ``Workspace.surfaceKind(for:)`` is the canonical mapping used by Mac
/// workspace snapshots. Reusing it here keeps mobile descriptors and Mac
/// persistence on one exhaustive source of truth as panel kinds evolve.
func mobileSurfaceKind(for panelType: PanelType) -> MobileSurfaceKind {
switch panelType {
case .terminal:
return .terminal
case .browser:
return .browser
case .markdown:
return .markdown
case .filePreview:
return .filePreview
case .rightSidebarTool:
return .rightSidebarTool
case .customSidebar:
return .customSidebar
case .agentSession:
return .agentSession
case .project:
return .project
case .extensionBrowser:
return .extensionBrowser
case .workspaceTodo:
return .todo
case .notifications:
// Notifications use the open-vocabulary fallback until the phone
// provides a native renderer for this panel kind.
return MobileSurfaceKind(rawValue: "notifications")
case .cloudVMLoading:
return .cloudVMLoading
case .simulator:
// Open wire vocabulary: phones without a native renderer show the
// fallback card for this kind (design: unknown kinds stay cards).
return MobileSurfaceKind(rawValue: "simulator")
case .mobilePairing:
return MobileSurfaceKind(rawValue: "mobilePairing")
case .accountSignIn:
return MobileSurfaceKind(rawValue: "accountSignIn")
}
MobileSurfaceKind(rawValue: Workspace.surfaceKind(for: panelType))
}

/// Builds the stable, spatially ordered mobile descriptors for every panel.
Expand Down
4 changes: 4 additions & 0 deletions cmuxTests/MobileSurfaceKindMappingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ import Testing
.extensionBrowser: "extensionBrowser",
.workspaceTodo: "todo",
.cloudVMLoading: "cloudVMLoading",
.simulator: "simulator",
.notifications: "notifications",
.mobilePairing: "mobilePairing",
.accountSignIn: "accountSignIn",
]

@Test func everyPanelTypeMapsToItsCanonicalWireKind() throws {
Expand Down
Loading