claude-code-kanban 7.37.0 → 7.38.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-kanban",
3
- "version": "7.37.0",
3
+ "version": "7.38.0",
4
4
  "description": "A web-based Kanban board for viewing Claude Code tasks with agent teams support",
5
5
  "main": "server.js",
6
6
  "type": "commonjs",
package/public/app.js CHANGED
@@ -3617,7 +3617,29 @@ const backgroundKind = (t) => BACKGROUND_KINDS[t.kind] || BACKGROUND_KINDS.shell
3617
3617
  const backgroundLabel = (t) => t.description || t.command || backgroundKind(t).name;
3618
3618
  const backgroundKindHtml = (t) =>
3619
3619
  `<span class="background-kind">${backgroundKind(t).icon}${backgroundKind(t).name}</span>`;
3620
- const backgroundClickAttr = (t) => (t.outputFile ? ` onclick="openPreviewByPath('${escAttrJs(t.outputFile)}')"` : '');
3620
+ const backgroundClickAttr = (t) => (t.outputFile ? ` onclick="openBackgroundOutput('${escAttrJs(t.taskId)}')"` : '');
3621
+
3622
+ function backgroundStatusRowHtml(t, now) {
3623
+ const running = !t.endedAt;
3624
+ const status = running ? 'running' : t.status === 'completed' ? 'done' : t.status;
3625
+ const elapsed = (running ? now : Date.parse(t.endedAt)) - Date.parse(t.startedAt);
3626
+ return `<span class="agent-status"><span class="agent-dot ${running ? 'active' : 'stopped'}"></span>${escapeHtml(status)}</span><span class="agent-duration">${formatDuration(elapsed)}</span>`;
3627
+ }
3628
+
3629
+ // The output file holds only what the task printed, so the modal shows the task above it.
3630
+ // biome-ignore lint/correctness/noUnusedVariables: used in HTML
3631
+ async function openBackgroundOutput(taskId) {
3632
+ const t = currentBackground.find((x) => x.taskId === taskId);
3633
+ if (!t?.outputFile || !(await openPreviewByPath(t.outputFile))) return;
3634
+ const el = document.getElementById('preview-task');
3635
+ el.innerHTML = `<div class="agent-status-row preview-task-meta">${backgroundKindHtml(t)}${backgroundStatusRowHtml(t, Date.now())}</div>
3636
+ ${t.description ? `<div class="preview-task-desc">${escapeHtml(t.description)}</div>` : ''}
3637
+ ${t.command ? `<div class="preview-task-cmd"><pre class="perm-code">${escapeHtml(t.command)}</pre><button type="button" class="icon-btn" aria-label="Copy command" title="Copy command">${ICON_COPY}</button></div>` : ''}`;
3638
+ el.querySelector('.preview-task-cmd button')?.addEventListener('click', (e) =>
3639
+ copyWithFeedback(t.command, e.currentTarget),
3640
+ );
3641
+ el.hidden = false;
3642
+ }
3621
3643
 
3622
3644
  function zenBackgroundHtml(running) {
3623
3645
  if (!running.length) return '';
@@ -3635,12 +3657,10 @@ function zenBackgroundHtml(running) {
3635
3657
  function backgroundCardHtml(t, now) {
3636
3658
  const running = !t.endedAt;
3637
3659
  const label = backgroundLabel(t);
3638
- const elapsed = (running ? now : Date.parse(t.endedAt)) - Date.parse(t.startedAt);
3639
- const status = running ? 'running' : t.status === 'completed' ? 'done' : t.status;
3640
3660
  return `<div class="agent-card background-card ${running ? 'active' : 'stopped'}${t.outputFile ? ' has-output' : ''}" title="${escapeHtml(t.command || label)}"${backgroundClickAttr(t)}>
3641
3661
  <div class="agent-task">${escapeHtml(label)}</div>
3642
3662
  <div class="agent-ident-row">${backgroundKindHtml(t)}</div>
3643
- <div class="agent-status-row"><span class="agent-status"><span class="agent-dot ${running ? 'active' : 'stopped'}"></span>${escapeHtml(status)}</span><span class="agent-duration">${formatDuration(elapsed)}</span></div>
3663
+ <div class="agent-status-row">${backgroundStatusRowHtml(t, now)}</div>
3644
3664
  </div>`;
3645
3665
  }
3646
3666
 
@@ -4688,7 +4708,7 @@ function renderSessions() {
4688
4708
  renderZenAgents(visibleAgents());
4689
4709
  bindLinkedDocsHandlers(sessionsList.querySelector('.linked-docs-section'), zenSession.id);
4690
4710
  artifactsSection.load(zenSession.id);
4691
- scratchFilesSection.load(zenSession.id);
4711
+ loadScratchFiles(zenSession.id);
4692
4712
  if (zenSession.hasWorkflow) pollWorkflowLive(zenSession.id);
4693
4713
  restoreSessionCursor();
4694
4714
  return;
@@ -10254,6 +10274,7 @@ function localImageUrl(src, base) {
10254
10274
  }
10255
10275
 
10256
10276
  function openPreviewModal(filePath, content, kind, sessionId) {
10277
+ document.getElementById('preview-task').hidden = true;
10257
10278
  currentPreviewPath = filePath;
10258
10279
  currentPreviewContent = kind === 'image' ? null : content;
10259
10280
  document.getElementById('preview-copy-content-btn').style.display = currentPreviewContent == null ? 'none' : '';
@@ -10412,6 +10433,7 @@ async function openPreviewByPath(
10412
10433
  return;
10413
10434
  }
10414
10435
  openPreviewModal(data.path, data.content, data.kind, sessionId);
10436
+ return true;
10415
10437
  } catch {
10416
10438
  showToast('Failed to load preview', 'error');
10417
10439
  }
@@ -10948,6 +10970,8 @@ const scratchFilesSection = makeSectionLoader({
10948
10970
  // Outlives the cache entries on purpose: a refetch on the TTL must not collapse a list
10949
10971
  // the user opened.
10950
10972
  const scratchFilesExpanded = new Set();
10973
+ const SCRATCHPAD_FOLDED_KEY = sectionCollapsedKey('zen-scratchpad');
10974
+ let scratchpadFolded = store.getItem(SCRATCHPAD_FOLDED_KEY) === 'true';
10951
10975
  // Open folders only, keyed by absolute path: path -> { status: 'loading' | 'ready' |
10952
10976
  // 'error', children }. Closing a folder drops its entry, so the cache is bounded by
10953
10977
  // what is on screen and a reopen shows fresh contents for one readdir.
@@ -11002,6 +11026,11 @@ function scratchFilesInnerHtml(sessionId) {
11002
11026
  // Delegated at the document because the whole zen panel is re-rendered on every SSE tick,
11003
11027
  // which would drop a listener bound on the section.
11004
11028
  document.addEventListener('click', (e) => {
11029
+ const row = e.target.closest('.zen-scratchpad');
11030
+ if (row && !e.target.closest('.row-actions')) {
11031
+ toggleScratchpadFolded(row);
11032
+ return;
11033
+ }
11005
11034
  const toggle = e.target.closest('.scratch-folder-toggle');
11006
11035
  if (!toggle) return;
11007
11036
  const section = toggle.closest('[data-scratch-files-for]');
@@ -11026,8 +11055,21 @@ async function toggleScratchFolder(sessionId, dirPath) {
11026
11055
  }
11027
11056
  }
11028
11057
 
11029
- function renderScratchFilesHtml(sessionId) {
11030
- return `<div class="scratch-files-section" data-scratch-files-for="${escapeHtml(sessionId)}">${scratchFilesInnerHtml(sessionId)}</div>`;
11058
+ function loadScratchFiles(sessionId) {
11059
+ if (!scratchpadFolded) scratchFilesSection.load(sessionId);
11060
+ }
11061
+
11062
+ function toggleScratchpadFolded(row) {
11063
+ scratchpadFolded = !scratchpadFolded;
11064
+ store.setItem(SCRATCHPAD_FOLDED_KEY, scratchpadFolded);
11065
+ row.classList.toggle('collapsed', scratchpadFolded);
11066
+ const sessionId = row.dataset.scratchSession;
11067
+ paintSectionSlots('data-scratch-files-for', sessionId, scratchpadFolded ? '' : scratchFilesInnerHtml(sessionId));
11068
+ loadScratchFiles(sessionId);
11069
+ }
11070
+
11071
+ function renderScratchFilesSlot(sessionId, inner) {
11072
+ return `<div class="scratch-files-section" data-scratch-files-for="${escapeHtml(sessionId)}">${inner}</div>`;
11031
11073
  }
11032
11074
 
11033
11075
  // biome-ignore lint/correctness/noUnusedVariables: used in HTML
@@ -13258,15 +13300,15 @@ function abbreviateScratchpadDir(dir) {
13258
13300
  function renderScratchpadRow(session) {
13259
13301
  const dir = session?.scratchpadDir;
13260
13302
  if (!dir) return '';
13261
- return `<div class="zen-scratchpad">
13262
- <span class="zen-scratchpad-label">Scratchpad</span>
13263
- <span class="zen-scratchpad-path" title="${escapeHtml(dir)}">${escapeHtml(abbreviateScratchpadDir(dir))}</span>
13303
+ return `<div class="zen-scratchpad panel-section-header${scratchpadFolded ? ' collapsed' : ''}" data-scratch-session="${escapeHtml(session.id)}" title="${escapeHtml(dir)}">
13304
+ ${groupChevronSvg(12)}
13305
+ <span>Scratchpad</span>
13264
13306
  <span class="row-actions">
13265
13307
  <button onclick="copyWithFeedback('${escAttrJs(dir)}', this)" title="Copy">${ICON_COPY}</button>
13266
13308
  <button data-folder="${escapeHtml(dir)}" onclick="openFolderInEditor(this.dataset.folder)" title="Open in editor">${ICON_OPEN_EXTERNAL}</button>
13267
13309
  </span>
13268
13310
  </div>
13269
- ${renderScratchFilesHtml(session.id)}`;
13311
+ ${renderScratchFilesSlot(session.id, scratchpadFolded ? '' : scratchFilesInnerHtml(session.id))}`;
13270
13312
  }
13271
13313
 
13272
13314
  function showInfoModal(session, teamConfig, tasks, planContent, parentInfo) {
package/public/index.html CHANGED
@@ -541,6 +541,7 @@
541
541
  </button>
542
542
  </div>
543
543
  </div>
544
+ <div id="preview-task" hidden></div>
544
545
  <div class="modal-body">
545
546
  <div class="preview-split">
546
547
  <div id="preview-modal-body" class="rendered-md modal-zoomable"></div>
package/public/style.css CHANGED
@@ -1540,31 +1540,18 @@ body.booting .boot-splash {
1540
1540
  }
1541
1541
 
1542
1542
  .zen-scratchpad {
1543
- display: flex;
1544
- align-items: center;
1545
- gap: 8px;
1546
1543
  margin-top: 12px;
1547
1544
  padding-top: 10px;
1548
1545
  border-top: 1px solid var(--border);
1549
- font-size: 11px;
1546
+ cursor: pointer;
1550
1547
  }
1551
1548
 
1552
- .zen-scratchpad-label {
1553
- font-weight: 500;
1554
- color: var(--text-muted);
1555
- text-transform: uppercase;
1556
- letter-spacing: 0.5px;
1557
- white-space: nowrap;
1549
+ .zen-scratchpad:hover {
1550
+ color: var(--text-primary);
1558
1551
  }
1559
1552
 
1560
- .zen-scratchpad-path {
1561
- flex: 1;
1562
- min-width: 0;
1563
- overflow: hidden;
1564
- text-overflow: ellipsis;
1565
- white-space: nowrap;
1566
- font-family: var(--font-mono);
1567
- color: var(--text-secondary);
1553
+ .zen-scratchpad .row-actions {
1554
+ margin-left: auto;
1568
1555
  }
1569
1556
 
1570
1557
  .zen-panel:hover .row-actions {
@@ -8864,6 +8851,53 @@ body.light .msg-assistant .msg-text {
8864
8851
  color: var(--text-primary);
8865
8852
  }
8866
8853
 
8854
+ #preview-task {
8855
+ flex: none;
8856
+ display: grid;
8857
+ gap: 6px;
8858
+ padding: 10px 0;
8859
+ border-bottom: 1px solid var(--border);
8860
+ }
8861
+
8862
+ #preview-task[hidden] {
8863
+ display: none;
8864
+ }
8865
+
8866
+ .preview-task-meta {
8867
+ justify-content: flex-start;
8868
+ gap: 12px;
8869
+ font-size: 11px;
8870
+ color: var(--text-muted);
8871
+ }
8872
+
8873
+ .preview-task-meta .agent-status,
8874
+ .preview-task-meta .agent-duration {
8875
+ font-size: 11px;
8876
+ }
8877
+
8878
+ .preview-task-desc {
8879
+ font-size: 13px;
8880
+ font-weight: 600;
8881
+ color: var(--text-primary);
8882
+ }
8883
+
8884
+ .preview-task-cmd {
8885
+ position: relative;
8886
+ }
8887
+
8888
+ .preview-task-cmd pre {
8889
+ max-height: 7.5em;
8890
+ overflow: auto;
8891
+ padding-right: 40px;
8892
+ font-size: 12px;
8893
+ }
8894
+
8895
+ .preview-task-cmd .icon-btn {
8896
+ position: absolute;
8897
+ top: 4px;
8898
+ right: 4px;
8899
+ }
8900
+
8867
8901
  /* Rendered HTML pages need far more room than a markdown doc. */
8868
8902
  .modal.preview-modal-dialog.preview-html {
8869
8903
  width: 96vw;
@@ -11364,7 +11398,8 @@ pre.mermaid[data-mermaid-error]::before {
11364
11398
  .project-group-header .group-chevron,
11365
11399
  .session-group-header .group-chevron,
11366
11400
  .sg-section-toggle .group-chevron,
11367
- .scratch-folder-toggle .group-chevron {
11401
+ .scratch-folder-toggle .group-chevron,
11402
+ .zen-scratchpad .group-chevron {
11368
11403
  transition: transform 0.15s ease;
11369
11404
  flex-shrink: 0;
11370
11405
  display: block;
@@ -11373,7 +11408,8 @@ pre.mermaid[data-mermaid-error]::before {
11373
11408
  .project-group-header.collapsed .group-chevron,
11374
11409
  .session-group-header.collapsed .group-chevron,
11375
11410
  .sg-section-toggle.collapsed .group-chevron,
11376
- .scratch-folder-toggle.collapsed .group-chevron {
11411
+ .scratch-folder-toggle.collapsed .group-chevron,
11412
+ .zen-scratchpad.collapsed .group-chevron {
11377
11413
  transform: rotate(-90deg);
11378
11414
  }
11379
11415
 
package/server.js CHANGED
@@ -4039,7 +4039,11 @@ function resolvePreviewPath(rawPath, base) {
4039
4039
  // Normalized, not passed through: a linked document is identified by its path string,
4040
4040
  // and `C:/a/b` typed into the link editor has to reach the same string as the `C:\a\b`
4041
4041
  // a server-side `path.join` produces, or the same file is linked twice.
4042
- if (path.isAbsolute(filePath)) return dropUrlFragment(path.normalize(filePath));
4042
+ if (path.isAbsolute(filePath)) {
4043
+ const abs = dropUrlFragment(path.normalize(filePath));
4044
+ // Claude Code names its task output files under the 8.3 short temp dir (NIKIFO~1).
4045
+ return /~\d/.test(abs) ? realpathDeepest(abs) : abs;
4046
+ }
4043
4047
  if (base && typeof base === 'string' && path.isAbsolute(base)) {
4044
4048
  let baseDir = base;
4045
4049
  try {