fix: clean up console task summary
This commit is contained in:
@@ -28,6 +28,10 @@
|
||||
.slice(0, 3),
|
||||
);
|
||||
|
||||
function taskNoun(count: number): "task" | "tasks" {
|
||||
return count === 1 ? "task" : "tasks";
|
||||
}
|
||||
|
||||
function mark(status: ConsoleTask["status"]): string {
|
||||
switch (status) {
|
||||
case "pending":
|
||||
@@ -54,7 +58,7 @@
|
||||
{/each}
|
||||
<div class="task-summary-row">
|
||||
<span class="task-summary">
|
||||
{counts.total} task(s) — pending: {counts.pending}, inprogress: {counts.inprogress}, completed: {counts.completed}, deleted: {counts.deleted}
|
||||
{counts.total} {taskNoun(counts.total)} — pending: {counts.pending}, inprogress: {counts.inprogress}, completed: {counts.completed}
|
||||
</span>
|
||||
{#if workerViews.length > 1}
|
||||
<span class="worker-view-tabs" role="group" aria-label="Worker transcript view">
|
||||
|
||||
@@ -857,9 +857,10 @@ Deno.test("Web Console renders the client-projected Worker task store", async ()
|
||||
tasksComponent.includes("[~]") &&
|
||||
tasksComponent.includes("[x]") &&
|
||||
tasksComponent.includes("[-]") &&
|
||||
tasksComponent.includes("task(s) — pending:") &&
|
||||
tasksComponent.includes('return count === 1 ? "task" : "tasks"') &&
|
||||
!tasksComponent.includes(", deleted: {counts.deleted}") &&
|
||||
tasksComponent.includes("task.description"),
|
||||
"Tasks UI should mirror the TUI status marks, summary, and descriptions",
|
||||
"Tasks UI should mirror the TUI status marks, pluralize its summary, omit the deleted count, and show descriptions",
|
||||
);
|
||||
assert(
|
||||
tasksModel.includes('name === "TaskCreate"') &&
|
||||
|
||||
Reference in New Issue
Block a user