mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-07 09:53:17 +00:00
feat(ui): merge 'Add to list' into 'Add to queue' and fix display bugs
- Remove 'Add to list' function from UI and state store - Replace 'Add to...' button with 'Add to queue' menu in AddDownloadsModal - Prevent completed items from displaying in queue views - Fix right-click context menu overflow clipping the queue submenu - Gracefully discard completed items when batch-assigning to queues
This commit is contained in:
@@ -102,20 +102,6 @@ describe('useDownloadStore', () => {
|
||||
expect(useDownloadStore.getState().backendRegisteredIds.has('1')).toBe(true); // Re-registered by dispatchItem
|
||||
});
|
||||
|
||||
it('adds to the list in the main queue without dispatching', async () => {
|
||||
await useDownloadStore.getState().addDownload({
|
||||
id: 'list-1',
|
||||
url: 'https://example.com/list.bin',
|
||||
fileName: 'list.bin',
|
||||
category: 'Other',
|
||||
dateAdded: ''
|
||||
}, { type: 'add-to-list' });
|
||||
|
||||
const item = useDownloadStore.getState().downloads[0];
|
||||
expect(item.status).toBe('ready');
|
||||
expect(item.queueId).toBe('00000000-0000-0000-0000-000000000001');
|
||||
expect(ipc.invokeCommand).not.toHaveBeenCalledWith('enqueue_download', expect.anything());
|
||||
});
|
||||
|
||||
it('adds to the selected queue without dispatching', async () => {
|
||||
await useDownloadStore.getState().addDownload({
|
||||
|
||||
@@ -143,7 +143,6 @@ export type { DownloadItem, Queue };
|
||||
export type ExtensionDownloadRequest = ExtensionDownload;
|
||||
export type AddDownloadAction =
|
||||
| { type: 'start-now' }
|
||||
| { type: 'add-to-list' }
|
||||
| { type: 'add-to-queue'; queueId: string };
|
||||
export type DownloadDraft = Omit<DownloadItem, 'status' | 'queueId' | 'hasBeenDispatched'>;
|
||||
|
||||
@@ -305,8 +304,6 @@ export const useDownloadStore = create<DownloadState>((set, get) => ({
|
||||
get().updateDownload(item.id, { hasBeenDispatched: true });
|
||||
}
|
||||
info(`Download ${item.id} started`);
|
||||
} else {
|
||||
info(`Download ${item.id} added to list`);
|
||||
}
|
||||
},
|
||||
applyProperties: async (id, updates) => {
|
||||
|
||||
Reference in New Issue
Block a user