Automatically select added files (#4325)

# Description of Changes
When adding files, the user probably wants to use them straight away in
the next tool that they use, so automatically select any added files (in
addition to whatever they previously had selected).
This commit is contained in:
James Brunton
2025-08-29 16:39:19 +01:00
committed by GitHub
parent eecc410b77
commit 3b28b398d9
4 changed files with 34 additions and 10 deletions
+3 -3
View File
@@ -9,12 +9,12 @@ export const useFileHandler = () => {
const addToActiveFiles = useCallback(async (file: File) => {
// Let FileContext handle deduplication with quickKey logic
await actions.addFiles([file]);
await actions.addFiles([file], { selectFiles: true });
}, [actions.addFiles]);
const addMultipleFiles = useCallback(async (files: File[]) => {
// Let FileContext handle deduplication with quickKey logic
await actions.addFiles(files);
await actions.addFiles(files, { selectFiles: true });
}, [actions.addFiles]);
// Add stored files preserving their original IDs to prevent session duplicates
@@ -25,7 +25,7 @@ export const useFileHandler = () => {
});
if (newFiles.length > 0) {
await actions.addStoredFiles(newFiles);
await actions.addStoredFiles(newFiles, { selectFiles: true });
}
console.log(`📁 Added ${newFiles.length} stored files (${filesWithMetadata.length - newFiles.length} skipped as duplicates)`);