feat: feedback verbetering 05

This commit is contained in:
kodi
2026-03-15 15:30:55 +01:00
parent 61d0c8de41
commit ae6a9d8c45
13 changed files with 139 additions and 31 deletions
+6 -6
View File
@@ -120,8 +120,8 @@ let headerTaskState = {
pollTimer: null,
lastRenderKey: "",
};
// The header chip reflects only user-visible file actions that use the shared task system.
const ACTIVE_TASK_OPERATIONS = new Set(["copy", "move", "duplicate", "delete"]);
// The header chip/popover reflects user-visible file operations, not every task-backed file action.
const ACTIVE_OPERATION_OPERATIONS = new Set(["copy", "move", "duplicate"]);
const ACTIVE_TASK_STATUSES = new Set(["queued", "running", "cancelling"]);
const VALID_THEME_FAMILIES = [
"default",
@@ -3870,7 +3870,7 @@ function formatTaskLine(task) {
}
function isActiveTask(task) {
return Boolean(task) && ACTIVE_TASK_OPERATIONS.has(task.operation) && ACTIVE_TASK_STATUSES.has(task.status);
return Boolean(task) && ACTIVE_OPERATION_OPERATIONS.has(task.operation) && ACTIVE_TASK_STATUSES.has(task.status);
}
function activeTasksFromItems(items) {
@@ -3878,7 +3878,7 @@ function activeTasksFromItems(items) {
}
function taskIsCancellable(task) {
return Boolean(task) && ACTIVE_TASK_OPERATIONS.has(task.operation) && ["queued", "running"].includes(task.status);
return Boolean(task) && ACTIVE_OPERATION_OPERATIONS.has(task.operation) && ["queued", "running"].includes(task.status);
}
async function cancelTaskRequest(taskId) {
@@ -3925,7 +3925,7 @@ function compactTaskCurrentItem(task) {
function activeTaskChipLabel(items) {
const count = Array.isArray(items) ? items.length : 0;
if (count !== 1) {
return `${count} active task${count === 1 ? "" : "s"}`;
return `${count} active operation${count === 1 ? "" : "s"}`;
}
const task = items[0];
const action = formatTaskOperationLabel(task);
@@ -4025,7 +4025,7 @@ function renderHeaderTaskPopover(items) {
if (!Array.isArray(items) || items.length === 0) {
const empty = document.createElement("div");
empty.className = "header-task-item-empty";
empty.textContent = "No active tasks right now.";
empty.textContent = "No active operations right now.";
elements.popoverList.append(empty);
headerTaskState.lastRenderKey = renderKey;
return;
+5 -5
View File
@@ -100,8 +100,8 @@ body {
position: absolute;
top: calc(100% + 8px);
right: 0;
width: min(360px, calc(100vw - 24px));
padding: 12px;
width: min(540px, calc(100vw - 24px));
padding: 14px;
border: 1px solid var(--color-border);
border-radius: var(--radius-md);
background: var(--color-surface-elevated);
@@ -131,8 +131,8 @@ body {
.header-task-popover-list {
display: flex;
flex-direction: column;
gap: 8px;
max-height: 260px;
gap: 10px;
max-height: 360px;
overflow-y: auto;
}
@@ -140,7 +140,7 @@ body {
border: 1px solid var(--color-border);
border-radius: var(--radius-sm);
background: var(--color-surface);
padding: 8px 9px;
padding: 10px 12px;
}
.header-task-item-title {
+3 -3
View File
@@ -34,11 +34,11 @@
aria-expanded="false"
aria-controls="header-task-popover"
>
<span id="header-task-chip-label">1 active task</span>
<span id="header-task-chip-label">1 active operation</span>
</button>
<div id="header-task-popover" class="header-task-popover hidden" role="dialog" aria-label="Active tasks">
<div id="header-task-popover" class="header-task-popover hidden" role="dialog" aria-label="Active operations">
<div class="header-task-popover-header">
<strong>Active tasks</strong>
<strong>Active operations</strong>
<button id="header-task-logs-btn" type="button" class="header-task-link">View in Logs</button>
</div>
<div id="header-task-popover-list" class="header-task-popover-list"></div>