feat: voortgang delete in headerbar
This commit is contained in:
@@ -335,7 +335,7 @@ class UiSmokeGoldenTest(unittest.TestCase):
|
||||
pollTimer: null,
|
||||
lastRenderKey: "",
|
||||
}};
|
||||
const ACTIVE_TASK_OPERATIONS = new Set(["copy", "move", "duplicate"]);
|
||||
const ACTIVE_TASK_OPERATIONS = new Set(["copy", "move", "duplicate", "delete"]);
|
||||
const ACTIVE_TASK_STATUSES = new Set(["queued", "running"]);
|
||||
|
||||
{functions}
|
||||
@@ -354,21 +354,21 @@ class UiSmokeGoldenTest(unittest.TestCase):
|
||||
];
|
||||
|
||||
const activeTasks = activeTasksFromItems(mixedTasks);
|
||||
assert(activeTasks.length === 3, "Only copy, move and duplicate tasks in queued or running should count as active");
|
||||
assert(activeTasks.length === 4, "Only task-based file actions in queued or running should count as active");
|
||||
assert(activeTasks.every((task) => isActiveTask(task)), "All filtered tasks should be active");
|
||||
assert(!activeTasks.some((task) => task.operation === "delete"), "Delete should not be counted because it is not task-based in the current UI flow");
|
||||
assert(activeTaskChipLabel(activeTasks.length) === "3 active tasks", "Chip label should reflect active task count");
|
||||
assert(activeTasks.some((task) => task.operation === "delete"), "Delete should count once it uses the shared task flow");
|
||||
assert(activeTaskChipLabel(activeTasks.length) === "4 active tasks", "Chip label should reflect active task count");
|
||||
|
||||
updateHeaderTaskState(mixedTasks);
|
||||
assert(!elements["header-task-chip-container"].classList.contains("hidden"), "Chip should be visible with active tasks");
|
||||
assert(elements["header-task-chip-label"].textContent === "3 active tasks", "Chip label should render active task count");
|
||||
assert(elements["header-task-chip-label"].textContent === "4 active tasks", "Chip label should render active task count");
|
||||
assert(shouldPollHeaderTasks(), "Active tasks should enable header polling");
|
||||
|
||||
setHeaderTaskPopoverOpen(true);
|
||||
assert(headerTaskState.popoverOpen, "Popover should open when active tasks exist");
|
||||
assert(!elements["header-task-popover"].classList.contains("hidden"), "Popover should be visible when open");
|
||||
assert(elements["header-task-chip-btn"].attributes["aria-expanded"] === "true", "Chip button should expose expanded state");
|
||||
assert(elements["header-task-popover-list"].children.length === 3, "Popover should render only active file-action tasks");
|
||||
assert(elements["header-task-popover-list"].children.length === 4, "Popover should render only active file-action tasks");
|
||||
|
||||
updateHeaderTaskState([
|
||||
{{ id: "z1", operation: "copy", status: "completed", source: "/src/z1", destination: "/dst/z1" }},
|
||||
@@ -496,7 +496,7 @@ class UiSmokeGoldenTest(unittest.TestCase):
|
||||
pollTimer: null,
|
||||
lastRenderKey: "",
|
||||
}};
|
||||
const ACTIVE_TASK_OPERATIONS = new Set(["copy", "move", "duplicate"]);
|
||||
const ACTIVE_TASK_OPERATIONS = new Set(["copy", "move", "duplicate", "delete"]);
|
||||
const ACTIVE_TASK_STATUSES = new Set(["queued", "running"]);
|
||||
|
||||
{functions}
|
||||
@@ -780,9 +780,9 @@ class UiSmokeGoldenTest(unittest.TestCase):
|
||||
self.assertIn('function inferDownloadTaskContext(task)', app_js)
|
||||
self.assertIn('function formatTaskLine(task)', app_js)
|
||||
self.assertIn('let headerTaskState = {', app_js)
|
||||
self.assertIn('const ACTIVE_TASK_OPERATIONS = new Set(["copy", "move", "duplicate"]);', app_js)
|
||||
self.assertIn('const ACTIVE_TASK_OPERATIONS = new Set(["copy", "move", "duplicate", "delete"]);', app_js)
|
||||
self.assertIn('const ACTIVE_TASK_STATUSES = new Set(["queued", "running"]);', app_js)
|
||||
self.assertIn("Delete stays out of this set because it still runs as a direct request flow", app_js)
|
||||
self.assertIn("The header chip reflects only user-visible file actions that use the shared task system.", app_js)
|
||||
self.assertIn('function headerTaskElements()', app_js)
|
||||
self.assertIn('function isActiveTask(task)', app_js)
|
||||
self.assertIn('function activeTasksFromItems(items)', app_js)
|
||||
@@ -884,6 +884,9 @@ class UiSmokeGoldenTest(unittest.TestCase):
|
||||
self.assertIn('function startContextMenuRename()', app_js)
|
||||
self.assertIn('function startDuplicateSelected()', app_js)
|
||||
self.assertIn('async function deleteSelected()', app_js)
|
||||
self.assertIn('const result = await apiRequest("POST", "/api/files/delete", {', app_js)
|
||||
self.assertIn('state.selectedTaskId = result.task_id;', app_js)
|
||||
self.assertIn('await refreshTasksSnapshot();', app_js)
|
||||
self.assertIn('function startContextMenuDuplicate()', app_js)
|
||||
self.assertIn('function startContextMenuCopy()', app_js)
|
||||
self.assertIn('function startContextMenuMove()', app_js)
|
||||
|
||||
Reference in New Issue
Block a user