fix: +メニューの「既存のフォルダを開く…」でフォルダ選択パネルが開かない問題を修正#72
Merged
Conversation
同一ビューに .fileImporter が 2 つ付いていたため(既存フォルダ用と org 用)、 SwiftUI の同種プレゼンテーション修飾子の後勝ちで既存フォルダ側が発火しなかった。 1 つの .fileImporter に統合し、用途は importerTarget(enum)で分岐する。
sasagar
added a commit
that referenced
this pull request
Jul 6, 2026
同一ビューに .fileImporter が 2 つ付いていたため(既存フォルダ用と org 用)、 SwiftUI の同種プレゼンテーション修飾子の後勝ちで既存フォルダ側が発火しなかった。 1 つの .fileImporter に統合し、用途は importerTarget(enum)で分岐する。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
症状
サイドバーの + メニュー(および空状態の詳細ペイン)から「既存のフォルダを開く…」を選んでも、フォルダ選択パネル(NSOpenPanel)が表示されない。
根本原因
ContentView.swiftの同一ビュー階層に.fileImporterが 2 つ付いていた(既存フォルダ用showImporterと org 用showOrgImporter)。SwiftUI は同一ビューに同種のプレゼンテーション修飾子を複数付けると後勝ちで 1 つしか発火せず、後ろにある org 用だけが生き残り、既存フォルダ用のパネルが出なくなっていた(#31 で org 用 importer を追加した際に混入した回帰)。修正
.fileImporterを 1 つに統合し、用途はFolderImporterTargetenum(.repository/.org)で分岐importerTargetを設定してからshowImporter = true検証(実機・AX 自動操作)
修正前後で Debug ビルドを起動し、AX(process "LaboLabo" 限定)でメニュー操作して確認:
いずれもパネル/シートはキャンセルで閉じ、フォルダ選択・セッション作成は行っていない。
xcodebuildは BUILD SUCCEEDED。