Fix iOS Load file picker not opening
Five presentation modifiers (.sheet, .alert, two .fileImporter, .fileExporter) were stacked on the builder's root view. SwiftUI reliably drives only one presentation per view node, so adding the Boards .sheet swallowed the iOS rig Load importer — the Load button toggled its flag but no picker appeared. Move each presentation onto its own Color.clear background anchor so they no longer collide. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -163,7 +163,7 @@
|
|||||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 2;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
DEVELOPMENT_TEAM = HE5VJFE9E4;
|
DEVELOPMENT_TEAM = HE5VJFE9E4;
|
||||||
@@ -176,7 +176,7 @@
|
|||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 15.0;
|
MACOSX_DEPLOYMENT_TARGET = 15.0;
|
||||||
MARKETING_VERSION = 0.9;
|
MARKETING_VERSION = 0.91;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = net.realizedsound.ShoeGazeBuilder;
|
PRODUCT_BUNDLE_IDENTIFIER = net.realizedsound.ShoeGazeBuilder;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||||
@@ -194,7 +194,7 @@
|
|||||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 2;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEVELOPMENT_TEAM = HE5VJFE9E4;
|
DEVELOPMENT_TEAM = HE5VJFE9E4;
|
||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
@@ -206,7 +206,7 @@
|
|||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 15.0;
|
MACOSX_DEPLOYMENT_TARGET = 15.0;
|
||||||
MARKETING_VERSION = 0.9;
|
MARKETING_VERSION = 0.91;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = net.realizedsound.ShoeGazeBuilder;
|
PRODUCT_BUNDLE_IDENTIFIER = net.realizedsound.ShoeGazeBuilder;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||||
|
|||||||
@@ -160,6 +160,29 @@ public struct ShoeGazeBuilderView: View {
|
|||||||
)
|
)
|
||||||
.background(boardSwitchShortcuts)
|
.background(boardSwitchShortcuts)
|
||||||
.onAppear { restoreInputSelection() }
|
.onAppear { restoreInputSelection() }
|
||||||
|
// Each presentation (sheet / importers / exporter / alert) lives on its own anchor
|
||||||
|
// node. SwiftUI reliably drives only one presentation per view node, so stacking them
|
||||||
|
// all on the root view silently swallowed some (e.g. the iOS Load file importer).
|
||||||
|
.background(boardsSheetAnchor)
|
||||||
|
.alert("Microphone Access Needed", isPresented: $showMicDeniedAlert) {
|
||||||
|
Button("OK", role: .cancel) { }
|
||||||
|
} message: {
|
||||||
|
Text("Live input needs microphone access. Enable it in System Settings › Privacy & "
|
||||||
|
+ "Security › Microphone, then select the input again.")
|
||||||
|
}
|
||||||
|
#if !os(macOS)
|
||||||
|
.background(rigImportAnchor)
|
||||||
|
.background(recordingFolderImportAnchor)
|
||||||
|
.background(rigExportAnchor)
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Presentation anchors
|
||||||
|
|
||||||
|
/// Hosts the board-manager sheet on its own node so it does not collide with the file
|
||||||
|
/// importers / exporter (one presentation per view node).
|
||||||
|
private var boardsSheetAnchor: some View {
|
||||||
|
Color.clear
|
||||||
.sheet(isPresented: $showBoardsSheet) {
|
.sheet(isPresented: $showBoardsSheet) {
|
||||||
BoardsSheetView(
|
BoardsSheetView(
|
||||||
shoeGaze: shoeGaze,
|
shoeGaze: shoeGaze,
|
||||||
@@ -169,19 +192,28 @@ public struct ShoeGazeBuilderView: View {
|
|||||||
)
|
)
|
||||||
.presentationDetents([.medium, .large])
|
.presentationDetents([.medium, .large])
|
||||||
}
|
}
|
||||||
.alert("Microphone Access Needed", isPresented: $showMicDeniedAlert) {
|
|
||||||
Button("OK", role: .cancel) { }
|
|
||||||
} message: {
|
|
||||||
Text("Live input needs microphone access. Enable it in System Settings › Privacy & "
|
|
||||||
+ "Security › Microphone, then select the input again.")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !os(macOS)
|
#if !os(macOS)
|
||||||
|
/// Hosts the rig-load (`.json`) importer on its own node.
|
||||||
|
private var rigImportAnchor: some View {
|
||||||
|
Color.clear
|
||||||
.fileImporter(isPresented: $showImporter, allowedContentTypes: [.json]) { result in
|
.fileImporter(isPresented: $showImporter, allowedContentTypes: [.json]) { result in
|
||||||
handleImport(result)
|
handleImport(result)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Hosts the recording-folder importer on its own node.
|
||||||
|
private var recordingFolderImportAnchor: some View {
|
||||||
|
Color.clear
|
||||||
.fileImporter(isPresented: $showRecordingFolderImporter, allowedContentTypes: [.folder]) { result in
|
.fileImporter(isPresented: $showRecordingFolderImporter, allowedContentTypes: [.folder]) { result in
|
||||||
handleRecordingFolderImport(result)
|
handleRecordingFolderImport(result)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Hosts the rig-save (`.json`) exporter on its own node.
|
||||||
|
private var rigExportAnchor: some View {
|
||||||
|
Color.clear
|
||||||
.fileExporter(
|
.fileExporter(
|
||||||
isPresented: $showExporter,
|
isPresented: $showExporter,
|
||||||
document: exportDocument,
|
document: exportDocument,
|
||||||
@@ -192,8 +224,8 @@ public struct ShoeGazeBuilderView: View {
|
|||||||
print("[ShoeGazeBuilderView] export failed: \(error)")
|
print("[ShoeGazeBuilderView] export failed: \(error)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// MARK: - Transport row
|
// MARK: - Transport row
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user