T-iPad-2: AdaptiveRootView/LayoutPolicy (sole size-class decision), SplitRootView (NavigationSplitView sidebar+detail), StackRootView (iPhone path verbatim, zero regression); privacy shade hoisted to shared ZStack top for both branches T-iPad-3: KeyBarVisibility predicate (hide when hardware keyboard present), pointer context menu (copy/new-in-cwd/kill, all via existing channels) T-iPad-4: Projects multi-column grid on iPad (idiom-gated), adaptive sheet detents T-iPad-5 findings (4/4 fixed): kill onKillSession thread-through + AppCoordinator.killCurrentSession; split route-gated to .sessions (iPad first-run pairing); continue-last banner in split sidebar; iPad XCUITest deferred (covered by SidebarSelectionTests) Verified: iPhone 16 277 + iPad Pro 11 278 tests green; packages 261 + integration 10; zero changes under ios/Packages, src/, public/
29 lines
1.2 KiB
Swift
29 lines
1.2 KiB
Swift
import SwiftUI
|
||
import Testing
|
||
@testable import WebTerm
|
||
|
||
/// T-iPad-2 · 自适应根视图的唯一 size-class 决策点(仿 `PrivacyShadePolicy`
|
||
/// 的纯谓词先例)。regular 宽度 → 分栏(sidebar+detail);compact/未知 →
|
||
/// 现有 iPhone stack 路径。这是**唯一**判据 —— 视图里严禁散落
|
||
/// `if sizeClass == …`(PLAN_IOS_IPAD §4)。
|
||
///
|
||
/// 覆盖 `UserInterfaceSizeClass` 的三种可能取值(.regular / .compact / nil),
|
||
/// 后者是「size class 尚未确定」的最保守回退:退到现有已测路径。
|
||
@Suite("LayoutPolicy (T-iPad-2)")
|
||
struct LayoutPolicyTests {
|
||
@Test("regular 宽度 → split(iPad 全屏/大分屏:sidebar + detail)")
|
||
func regularIsSplit() {
|
||
#expect(LayoutPolicy.mode(horizontalSizeClass: .regular) == .split)
|
||
}
|
||
|
||
@Test("compact 宽度 → stack(iPhone / iPad Slide Over:字节级复用现有路径)")
|
||
func compactIsStack() {
|
||
#expect(LayoutPolicy.mode(horizontalSizeClass: .compact) == .stack)
|
||
}
|
||
|
||
@Test("nil(size class 未定)→ stack(最保守:退现有 iPhone 路径)")
|
||
func nilIsStack() {
|
||
#expect(LayoutPolicy.mode(horizontalSizeClass: nil) == .stack)
|
||
}
|
||
}
|