taskchef 5.11.2 → 5.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskchef",
3
- "version": "5.11.2",
3
+ "version": "5.12.0",
4
4
  "description": "Dispatch work from a data-only workspace to visible Codex project tasks.",
5
5
  "author": {
6
6
  "name": "Favo Yang",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskchef",
3
- "version": "5.11.2",
3
+ "version": "5.12.0",
4
4
  "description": "A non-blocking interactive dispatcher for visible Codex tasks.",
5
5
  "license": "MIT",
6
6
  "author": "Favo Yang",
@@ -0,0 +1,17 @@
1
+ export async function openTaskFromControl(event, taskId, {
2
+ fetchAction = globalThis.fetch,
3
+ showMessage,
4
+ } = {}) {
5
+ event.stopPropagation();
6
+ const control = event.currentTarget;
7
+ control.disabled = true;
8
+ try {
9
+ const response = await fetchAction(`/api/tasks/${encodeURIComponent(taskId)}/open-codex`, {
10
+ method: "POST",
11
+ });
12
+ const result = await response.json();
13
+ showMessage(result.message);
14
+ } finally {
15
+ control.disabled = false;
16
+ }
17
+ }
@@ -7,6 +7,7 @@ import {
7
7
  taskStatusLabel,
8
8
  taskWithinDateFilter,
9
9
  } from "./state.js";
10
+ import { openTaskFromControl } from "./actions.js";
10
11
 
11
12
  const state = {
12
13
  tasks: [],
@@ -161,7 +162,18 @@ function taskCard(task) {
161
162
  const time = document.createElement("time");
162
163
  time.dateTime = task.meaningfulUpdatedAt ?? task.updatedAt ?? task.createdAt;
163
164
  time.textContent = `Updated ${formatTime(time.dateTime)}`;
164
- article.append(heading, project, summary, time);
165
+ const footer = document.createElement("div");
166
+ footer.className = "task-footer";
167
+ const openTask = document.createElement("button");
168
+ openTask.type = "button";
169
+ openTask.className = "secondary-button task-open";
170
+ openTask.textContent = "Open task";
171
+ openTask.setAttribute("aria-label", `Open ${task.title} in Codex`);
172
+ openTask.addEventListener("click", (event) => openTaskFromControl(event, task.id, {
173
+ showMessage,
174
+ }));
175
+ footer.append(time, openTask);
176
+ article.append(heading, project, summary, footer);
165
177
  return article;
166
178
  }
167
179
 
@@ -251,16 +263,7 @@ elements.copyThreadId.addEventListener("click", async () => {
251
263
  showMessage("Clipboard access is unavailable. Copy the thread ID from the metadata below.");
252
264
  }
253
265
  });
254
- elements.openProject.addEventListener("click", async () => {
266
+ elements.openProject.addEventListener("click", async (event) => {
255
267
  if (!state.selectedTask) return;
256
- elements.openProject.disabled = true;
257
- try {
258
- const response = await fetch(`/api/tasks/${encodeURIComponent(state.selectedTask.id)}/open-codex`, {
259
- method: "POST",
260
- });
261
- const result = await response.json();
262
- showMessage(result.message);
263
- } finally {
264
- elements.openProject.disabled = false;
265
- }
268
+ await openTaskFromControl(event, state.selectedTask.id, { showMessage });
266
269
  });
@@ -12,7 +12,7 @@
12
12
  <header class="site-header">
13
13
  <div>
14
14
  <p class="eyebrow">TaskChef</p>
15
- <h1>Task dashboard</h1>
15
+ <h1>TaskChef dashboard</h1>
16
16
  <p class="subtitle">Latest delegated work, updated as TaskChef reports change.</p>
17
17
  </div>
18
18
  <div class="connection" role="status" aria-live="polite">
@@ -74,6 +74,8 @@ select { min-width: 180px; padding: 9px 34px 9px 11px; border: 1px solid var(--b
74
74
  .task-project { margin: 3px 0 12px; font-size: 0.86rem; }
75
75
  .task-summary { max-width: 78ch; margin-bottom: 14px; }
76
76
  time { font-size: 0.78rem; }
77
+ .task-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
78
+ .task-open { flex: none; }
77
79
 
78
80
  .status { flex: none; padding: 4px 9px; border-radius: 999px; background: var(--surface-muted); color: var(--muted); font-size: 0.72rem; font-weight: 750; text-transform: capitalize; }
79
81
  .status-completed { background: var(--accent-soft); color: var(--accent); }
@@ -122,6 +124,8 @@ pre { max-height: 280px; margin: 0; padding: 14px; overflow: auto; border-radius
122
124
  .toolbar label, .toolbar select { width: 100%; }
123
125
  .task-count { margin: 0; }
124
126
  .task-heading { align-items: flex-start; }
127
+ .task-footer { align-items: flex-start; flex-direction: column; }
128
+ .task-open { width: 100%; }
125
129
  .dialog-actions { align-items: stretch; flex-direction: column; }
126
130
  .metadata { grid-template-columns: 1fr; }
127
131
  .metadata dt { padding-bottom: 0; border-bottom: 0; }
package/src/dashboard.js CHANGED
@@ -37,6 +37,7 @@ const CONTENT_SECURITY_POLICY = [
37
37
 
38
38
  const STATIC_FILES = new Map([
39
39
  ["/", ["index.html", "text/html; charset=utf-8"]],
40
+ ["/actions.js", ["actions.js", "text/javascript; charset=utf-8"]],
40
41
  ["/app.js", ["app.js", "text/javascript; charset=utf-8"]],
41
42
  ["/state.js", ["state.js", "text/javascript; charset=utf-8"]],
42
43
  ["/styles.css", ["styles.css", "text/css; charset=utf-8"]],