feat: 统一机巢加载体验并对齐到达态界面

工作台、准备页、任务首次读取和景区空境库复用应用通用 Loading;到达态按 Web 展示,保留倒计时及手动开拍权限。新增图传几何诊断,不改变 Fit 渲染或设备连接行为。

验证:App 与测试包无签名 build-for-testing 编译通过,git diff --check 通过。iPhone 11 当前 unavailable,真机回归待设备重连后执行。
This commit is contained in:
2026-11-04 18:47:17 +08:00
parent b3fa6cf7d7
commit 3882a0d4c6
17 changed files with 906 additions and 16 deletions
@@ -9,6 +9,8 @@ final class DroneDockRemoteHomeViewTests: XCTestCase {
/// 设备请求尚未返回时先展示等高空卡片,返回设备后下方模块不跳动。
func testPendingDeviceRequestKeepsPlaceholderCardAtFullDeviceHeight() async throws {
GlobalLoadingManager.shared.hideAll()
defer { GlobalLoadingManager.shared.hideAll() }
let gate = HomeDeviceResponseGate()
defer { Task { await gate.release() } }
let (controller, session) = makeController(responses: [populatedEnvelope], deviceResponseGate: gate)
@@ -20,12 +22,15 @@ final class DroneDockRemoteHomeViewTests: XCTestCase {
try await settle(window: window) {
session.requests.count == 3 && controller.viewModel.isLoading
&& (collection.cellForItem(at: path) as? DroneDockDeviceCell)?.cardView.accessibilityIdentifier == "drone.device.empty"
&& GlobalLoadingManager.shared.isShowing
}
let placeholder = try XCTUnwrap((collection.cellForItem(at: path) as? DroneDockDeviceCell)?.cardView)
let frame = try XCTUnwrap(collection.collectionViewLayout.layoutAttributesForItem(at: path)).frame
XCTAssertEqual(collection.numberOfItems(inSection: 1), 1)
XCTAssertEqual(frame.height, 248, accuracy: 0.5)
XCTAssertNil(controller.viewModel.response)
XCTAssertTrue(GlobalLoadingManager.shared.isShowing)
XCTAssertTrue(window.subviews.contains { $0 is GlobalLoadingOverlayView })
XCTAssertTrue(visibleTexts(in: placeholder).contains("暂无无人机"))
XCTAssertTrue(visibleTexts(in: placeholder).contains("正在加载"))
XCTAssertEqual(metricTexts(in: placeholder), Dictionary(uniqueKeysWithValues: metricKeys.map { ($0, "—") }))
@@ -37,6 +42,7 @@ final class DroneDockRemoteHomeViewTests: XCTestCase {
&& !collection.hasUncommittedUpdates
}
let loadedFrame = try XCTUnwrap(collection.collectionViewLayout.layoutAttributesForItem(at: path)).frame
XCTAssertFalse(GlobalLoadingManager.shared.isShowing)
XCTAssertEqual(loadedFrame.minY, frame.minY, accuracy: 0.5)
XCTAssertEqual(loadedFrame.height, frame.height, accuracy: 0.5)
assertOnlyReadHomepageRequests(session)