Fix #13269 : support multi-file import across different formats#13271
Conversation
|
PLease add a changelog entry, otherwise it's good to go! |
|
You modified Markdown ( You can check the detailed error output by navigating to your pull request, selecting the tab "Checks", section "Tests" (on the left), subsection "Markdown". |
| || selectedExtensionFilter == FileFilterConverter.ANY_FILE | ||
| || "Available import formats".equals(selectedExtensionFilter.getDescription())) { | ||
| task = BackgroundTask.wrap( | ||
| () -> doImport(files, null)); |
There was a problem hiding this comment.
Why should it be null for cases selectedExtensionFilter == FileFilterConverter.ANY_FILE || "Available import formats".equals(selectedExtensionFilter.getDescription()) ? The logic in the else case is more general - shouldn't that work here as well?
There was a problem hiding this comment.
Well I just realized that it worked because showFileOpenDialogAndGetMultipleFiles doesn't update selectedExtensionFilter which makes sense, but then it's always null and always imports with no format specified, whether its a singular or multiple files.
I'll update showFileOpenDialogAndGetMultipleFiles and refactor importMultipleFiles to infer format only when there's only one file to be imported and no specific filter
| LibraryTab tab = tabContainer.getCurrentLibraryTab(); | ||
|
|
||
| if (importMethod == ImportMethod.AS_NEW) { | ||
| if (importMethod == ImportMethod.AS_NEW || tab == null) { |
There was a problem hiding this comment.
Please add a comment why the second condition works, as otherwise just by reading code this seems like a logic proxy/hacky way.
There was a problem hiding this comment.
"Import into current library" can still be enabled if there are no libraries open. Is that intentional ? If not, then comment should mention a bug report ?
|
@trag-bot didn't find any issues in the code! ✅✨ |
Closes #13269
this PR improves the import command to properly handle importing multiple files with different supported formats in a single operation.
ImportCommand::executenow callsdialogService.showFileOpenDialogAndGetMultipleFilesinstead ofdialogService.showFileOpenDialogandimportSingleFile()has been refactored toimportMultipleFiles()to handle one or more filesSteps to test
Mandatory checks
CHANGELOG.mddescribed in a way that is understandable for the average user (if change is visible to the user)