feat(ui): implement multi-select and fix finder reveal

- Fix 'Show in finder' for unfinished entries to open destination folder
- Add 'Add to queue' submenu for unfinished items
- Support Shift/Cmd modifiers for multi-selection in download list
- Implement mass-action context menu for multi-selected downloads
- Enhance DeleteConfirmationModal to handle mass deletions gracefully
This commit is contained in:
NimBold
2026-06-21 00:52:43 +03:30
parent 226c7913f5
commit cd0397ea00
5 changed files with 295 additions and 141 deletions
+5 -5
View File
@@ -14,10 +14,10 @@ export const DeleteConfirmationModal: React.FC = () => {
};
const handleRemoveFromList = async () => {
if (deleteModalState.downloadId) {
if (deleteModalState.downloadIds && deleteModalState.downloadIds.length > 0) {
setIsRemoving(true);
try {
await removeDownload(deleteModalState.downloadId, false);
await Promise.all(deleteModalState.downloadIds.map(id => removeDownload(id, false)));
} catch (error) {
setErrorMessage(`Remove failed: ${String(error)}`);
setIsRemoving(false);
@@ -28,10 +28,10 @@ export const DeleteConfirmationModal: React.FC = () => {
};
const handleDeleteFile = async () => {
if (deleteModalState.downloadId) {
if (deleteModalState.downloadIds && deleteModalState.downloadIds.length > 0) {
setIsRemoving(true);
try {
await removeDownload(deleteModalState.downloadId, true);
await Promise.all(deleteModalState.downloadIds.map(id => removeDownload(id, true)));
} catch (error) {
setErrorMessage(`Delete failed: ${String(error)}`);
setIsRemoving(false);
@@ -55,7 +55,7 @@ export const DeleteConfirmationModal: React.FC = () => {
</div>
<div className="px-5 py-6 flex-1 text-sm text-text-secondary leading-relaxed">
Are you sure you want to remove this item from the list? You can also choose to delete the underlying file from your hard drive.
{`Are you sure you want to remove ${deleteModalState.downloadIds?.length && deleteModalState.downloadIds.length > 1 ? 'these ' + deleteModalState.downloadIds.length + ' items' : 'this item'} from the list? You can also choose to delete the underlying file from your hard drive.`}
{errorMessage && <div className="mt-3 text-xs text-red-400">{errorMessage}</div>}
</div>