fix(gamut): don't disable layer toggles when SceneKit is unavailable (#147) #160

Merged
gronod merged 1 commits from fix/147-gamut-toggle-disabled into milestone/m10-studio 2026-09-13 17:05:07 +01:00
2 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -142,7 +142,7 @@ struct GamutView: View {
Text(layer?.displayName ?? fallback) Text(layer?.displayName ?? fallback)
} }
.toggleStyle(.checkbox) .toggleStyle(.checkbox)
.disabled(layer == nil || viewModel.viewerUnavailable) .disabled(layer == nil)
.help(layer.map { $0.sourceURL.lastPathComponent } ?? "No profile .gam loaded") .help(layer.map { $0.sourceURL.lastPathComponent } ?? "No profile .gam loaded")
// macOS 12 puts the identifier on the Toggle's container, an // macOS 12 puts the identifier on the Toggle's container, an
// element that never reports isEnabled combine so the a11y // element that never reports isEnabled combine so the a11y
@@ -115,6 +115,10 @@ final class Milestone10GamutCompareUITests: XCTestCase {
let compare = waitFor("gamutLayer-compare") let compare = waitFor("gamutLayer-compare")
XCTAssertTrue(compare.exists) XCTAssertTrue(compare.exists)
XCTAssertFalse(compare.isEnabled, "Compare toggle must be disabled before a load") XCTAssertFalse(compare.isEnabled, "Compare toggle must be disabled before a load")
let status = waitFor("gamutStatusText")
let statusValue = status.value as? String ?? ""
XCTAssertTrue(statusValue.contains("sRGB"), "Status should list the sRGB layer, got: \(statusValue)")
} }
func testAddCompareButtonExists() throws { func testAddCompareButtonExists() throws {
@@ -142,6 +146,7 @@ final class Milestone10GamutCompareUITests: XCTestCase {
// The pre-load placeholder also exists wait for enabled. // The pre-load placeholder also exists wait for enabled.
let compare = waitUntilEnabled("gamutLayer-compare") let compare = waitUntilEnabled("gamutLayer-compare")
XCTAssertTrue(compare.isEnabled, "Compare toggle should enable after load") XCTAssertTrue(compare.isEnabled, "Compare toggle should enable after load")
XCTAssertEqual(compare.value as? Int, 1, "Compare layer should be on after load")
let status = waitFor("gamutStatusText") let status = waitFor("gamutStatusText")
let value = status.value as? String ?? "" let value = status.value as? String ?? ""
@@ -164,6 +169,12 @@ final class Milestone10GamutCompareUITests: XCTestCase {
let compare = waitUntilEnabled("gamutLayer-compare") let compare = waitUntilEnabled("gamutLayer-compare")
XCTAssertTrue(compare.isEnabled, "Compare toggle should enable after iccgamut") XCTAssertTrue(compare.isEnabled, "Compare toggle should enable after iccgamut")
XCTAssertEqual(compare.value as? Int, 1, "Compare layer should be on after iccgamut")
// The compare slot's display name is the .gam stem ("myprinter").
let status = waitFor("gamutStatusText")
let statusValue = status.value as? String ?? ""
XCTAssertTrue(statusValue.contains("myprinter"), "Status should list the compare layer, got: \(statusValue)")
} }
func testInspectPanelIdleStableHeight() throws { func testInspectPanelIdleStableHeight() throws {