claude-code-kanban 7.37.0 → 7.39.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/hub-app.json CHANGED
@@ -33,6 +33,17 @@
33
33
  }
34
34
  },
35
35
  "settings": [
36
+ {
37
+ "key": "sidebarSide",
38
+ "type": "choice",
39
+ "label": "Sidebar side",
40
+ "help": "Puts the sessions sidebar on the left or the right of the board.",
41
+ "options": [
42
+ { "value": "left", "label": "Left" },
43
+ { "value": "right", "label": "Right" }
44
+ ],
45
+ "default": "left"
46
+ },
36
47
  {
37
48
  "key": "zenCentered",
38
49
  "type": "boolean",
package/lib/terminal.js CHANGED
@@ -394,6 +394,12 @@ function createTerminalService(o) {
394
394
  const savedState = config.restore ? o.load?.() : null;
395
395
  const saved = savedState?.sessions;
396
396
  const restoreQueue = Array.isArray(saved) ? saved.filter((id) => typeof id === 'string' && UUID_RE.test(id)) : [];
397
+ // The hub's log has no timestamps, and a terminal that leaves the saved list is not restored
398
+ // on the next start, so each one is logged with the time and the reason.
399
+ let savedIds = new Set(restoreQueue);
400
+ const dropReasons = new Map();
401
+ const writeLog = o.log || console.log;
402
+ const log = (msg) => writeLog(`${new Date().toISOString()} ${msg}`);
397
403
  // A resumed claude gets back the shared task list it was started with.
398
404
  const savedTaskLists = {};
399
405
  for (const [id, list] of Object.entries(savedState?.taskLists || {})) {
@@ -457,6 +463,11 @@ function createTerminalService(o) {
457
463
  if (s.taskList) taskLists[s.id] = s.taskList;
458
464
  terminalIds[s.id] = s.terminalId;
459
465
  }
466
+ for (const id of savedIds) {
467
+ if (!ids.has(id)) log(`Terminal ${id} left the restore list: ${dropReasons.get(id) || 'reason not recorded'}`);
468
+ }
469
+ savedIds = ids;
470
+ dropReasons.clear();
460
471
  const data = {
461
472
  sessions: [...ids],
462
473
  ...(Object.keys(taskLists).length && { taskLists }),
@@ -472,14 +483,19 @@ function createTerminalService(o) {
472
483
  // startNew. A session that runs elsewhere or lost its transcript is dropped.
473
484
  function restore() {
474
485
  if (!restoreQueue.length || unavailableReason()) return;
475
- console.log(`Restoring ${restoreQueue.length} terminal(s)`);
486
+ log(`Restoring ${restoreQueue.length} terminal(s): ${restoreQueue.join(', ')}`);
476
487
  const next = async () => {
477
488
  while (restoreQueue.length && !shuttingDown) {
478
489
  const id = restoreQueue.shift();
479
- if (sessions.has(id) || o.isLiveElsewhere(id)) continue;
490
+ if (sessions.has(id)) continue;
491
+ if (o.isLiveElsewhere(id)) {
492
+ dropReasons.set(id, 'not restored, claude runs it outside this board');
493
+ continue;
494
+ }
480
495
  const r = await start(id, 'resume', {}, HEADLESS_COLS, HEADLESS_ROWS);
481
496
  if (!r.error) break;
482
- console.log(`Could not restore terminal ${id}: ${r.error}`);
497
+ dropReasons.set(id, `not restored, ${r.error}`);
498
+ log(`Could not restore terminal ${id}: ${r.error}`);
483
499
  }
484
500
  scheduleSave();
485
501
  if (restoreQueue.length && !shuttingDown) setTimeout(next, restoreGapMs).unref();
@@ -621,6 +637,7 @@ function createTerminalService(o) {
621
637
  }
622
638
  s.claudeExitedAt = Date.now();
623
639
  s.claudePid = null;
640
+ dropReasons.set(s.id, `claude exited (pid ${pid}), its shell still runs`);
624
641
  s.status.dropTransient();
625
642
  moved = true;
626
643
  }
@@ -709,6 +726,7 @@ function createTerminalService(o) {
709
726
  });
710
727
  proc.onExit(({ exitCode }) => {
711
728
  s.exited = true;
729
+ if (!s.ended) dropReasons.set(s.id, `terminal process exited (code ${exitCode})`);
712
730
  clearInterval(s.pickTimer);
713
731
  clearInterval(s.boostTimer);
714
732
  clearInterval(s.submitTimer);
@@ -974,6 +992,7 @@ function createTerminalService(o) {
974
992
  // kill() returns before the process is gone, so an ended session leaves list() at once.
975
993
  function kill(s) {
976
994
  s.ended = true;
995
+ dropReasons.set(s.id, 'ended from the board');
977
996
  s.pty.kill();
978
997
  changed();
979
998
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-kanban",
3
- "version": "7.37.0",
3
+ "version": "7.39.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
@@ -1052,9 +1052,8 @@ function initMessagePanelFull() {
1052
1052
  const panel = document.getElementById('message-panel');
1053
1053
  const sidebar = document.querySelector('.sidebar');
1054
1054
  if (sidebar) {
1055
- const sync = () => panel.style.setProperty('--sidebar-edge', `${sidebar.getBoundingClientRect().right}px`);
1055
+ const sync = ([e]) => panel.style.setProperty('--sidebar-w', `${e.borderBoxSize[0].inlineSize}px`);
1056
1056
  new ResizeObserver(sync).observe(sidebar);
1057
- sync();
1058
1057
  }
1059
1058
  applyMessagePanelFull(store.getItem(MESSAGE_PANEL_FULL_KEY) === 'true');
1060
1059
  }
@@ -3617,7 +3616,29 @@ const backgroundKind = (t) => BACKGROUND_KINDS[t.kind] || BACKGROUND_KINDS.shell
3617
3616
  const backgroundLabel = (t) => t.description || t.command || backgroundKind(t).name;
3618
3617
  const backgroundKindHtml = (t) =>
3619
3618
  `<span class="background-kind">${backgroundKind(t).icon}${backgroundKind(t).name}</span>`;
3620
- const backgroundClickAttr = (t) => (t.outputFile ? ` onclick="openPreviewByPath('${escAttrJs(t.outputFile)}')"` : '');
3619
+ const backgroundClickAttr = (t) => (t.outputFile ? ` onclick="openBackgroundOutput('${escAttrJs(t.taskId)}')"` : '');
3620
+
3621
+ function backgroundStatusRowHtml(t, now) {
3622
+ const running = !t.endedAt;
3623
+ const status = running ? 'running' : t.status === 'completed' ? 'done' : t.status;
3624
+ const elapsed = (running ? now : Date.parse(t.endedAt)) - Date.parse(t.startedAt);
3625
+ return `<span class="agent-status"><span class="agent-dot ${running ? 'active' : 'stopped'}"></span>${escapeHtml(status)}</span><span class="agent-duration">${formatDuration(elapsed)}</span>`;
3626
+ }
3627
+
3628
+ // The output file holds only what the task printed, so the modal shows the task above it.
3629
+ // biome-ignore lint/correctness/noUnusedVariables: used in HTML
3630
+ async function openBackgroundOutput(taskId) {
3631
+ const t = currentBackground.find((x) => x.taskId === taskId);
3632
+ if (!t?.outputFile || !(await openPreviewByPath(t.outputFile))) return;
3633
+ const el = document.getElementById('preview-task');
3634
+ el.innerHTML = `<div class="agent-status-row preview-task-meta">${backgroundKindHtml(t)}${backgroundStatusRowHtml(t, Date.now())}</div>
3635
+ ${t.description ? `<div class="preview-task-desc">${escapeHtml(t.description)}</div>` : ''}
3636
+ ${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>` : ''}`;
3637
+ el.querySelector('.preview-task-cmd button')?.addEventListener('click', (e) =>
3638
+ copyWithFeedback(t.command, e.currentTarget),
3639
+ );
3640
+ el.hidden = false;
3641
+ }
3621
3642
 
3622
3643
  function zenBackgroundHtml(running) {
3623
3644
  if (!running.length) return '';
@@ -3635,12 +3656,10 @@ function zenBackgroundHtml(running) {
3635
3656
  function backgroundCardHtml(t, now) {
3636
3657
  const running = !t.endedAt;
3637
3658
  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
3659
  return `<div class="agent-card background-card ${running ? 'active' : 'stopped'}${t.outputFile ? ' has-output' : ''}" title="${escapeHtml(t.command || label)}"${backgroundClickAttr(t)}>
3641
3660
  <div class="agent-task">${escapeHtml(label)}</div>
3642
3661
  <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>
3662
+ <div class="agent-status-row">${backgroundStatusRowHtml(t, now)}</div>
3644
3663
  </div>`;
3645
3664
  }
3646
3665
 
@@ -4688,7 +4707,7 @@ function renderSessions() {
4688
4707
  renderZenAgents(visibleAgents());
4689
4708
  bindLinkedDocsHandlers(sessionsList.querySelector('.linked-docs-section'), zenSession.id);
4690
4709
  artifactsSection.load(zenSession.id);
4691
- scratchFilesSection.load(zenSession.id);
4710
+ loadScratchFiles(zenSession.id);
4692
4711
  if (zenSession.hasWorkflow) pollWorkflowLive(zenSession.id);
4693
4712
  restoreSessionCursor();
4694
4713
  return;
@@ -10254,6 +10273,7 @@ function localImageUrl(src, base) {
10254
10273
  }
10255
10274
 
10256
10275
  function openPreviewModal(filePath, content, kind, sessionId) {
10276
+ document.getElementById('preview-task').hidden = true;
10257
10277
  currentPreviewPath = filePath;
10258
10278
  currentPreviewContent = kind === 'image' ? null : content;
10259
10279
  document.getElementById('preview-copy-content-btn').style.display = currentPreviewContent == null ? 'none' : '';
@@ -10412,6 +10432,7 @@ async function openPreviewByPath(
10412
10432
  return;
10413
10433
  }
10414
10434
  openPreviewModal(data.path, data.content, data.kind, sessionId);
10435
+ return true;
10415
10436
  } catch {
10416
10437
  showToast('Failed to load preview', 'error');
10417
10438
  }
@@ -10948,6 +10969,8 @@ const scratchFilesSection = makeSectionLoader({
10948
10969
  // Outlives the cache entries on purpose: a refetch on the TTL must not collapse a list
10949
10970
  // the user opened.
10950
10971
  const scratchFilesExpanded = new Set();
10972
+ const SCRATCHPAD_FOLDED_KEY = sectionCollapsedKey('zen-scratchpad');
10973
+ let scratchpadFolded = store.getItem(SCRATCHPAD_FOLDED_KEY) === 'true';
10951
10974
  // Open folders only, keyed by absolute path: path -> { status: 'loading' | 'ready' |
10952
10975
  // 'error', children }. Closing a folder drops its entry, so the cache is bounded by
10953
10976
  // what is on screen and a reopen shows fresh contents for one readdir.
@@ -11002,6 +11025,11 @@ function scratchFilesInnerHtml(sessionId) {
11002
11025
  // Delegated at the document because the whole zen panel is re-rendered on every SSE tick,
11003
11026
  // which would drop a listener bound on the section.
11004
11027
  document.addEventListener('click', (e) => {
11028
+ const row = e.target.closest('.zen-scratchpad');
11029
+ if (row && !e.target.closest('.row-actions')) {
11030
+ toggleScratchpadFolded(row);
11031
+ return;
11032
+ }
11005
11033
  const toggle = e.target.closest('.scratch-folder-toggle');
11006
11034
  if (!toggle) return;
11007
11035
  const section = toggle.closest('[data-scratch-files-for]');
@@ -11026,8 +11054,21 @@ async function toggleScratchFolder(sessionId, dirPath) {
11026
11054
  }
11027
11055
  }
11028
11056
 
11029
- function renderScratchFilesHtml(sessionId) {
11030
- return `<div class="scratch-files-section" data-scratch-files-for="${escapeHtml(sessionId)}">${scratchFilesInnerHtml(sessionId)}</div>`;
11057
+ function loadScratchFiles(sessionId) {
11058
+ if (!scratchpadFolded) scratchFilesSection.load(sessionId);
11059
+ }
11060
+
11061
+ function toggleScratchpadFolded(row) {
11062
+ scratchpadFolded = !scratchpadFolded;
11063
+ store.setItem(SCRATCHPAD_FOLDED_KEY, scratchpadFolded);
11064
+ row.classList.toggle('collapsed', scratchpadFolded);
11065
+ const sessionId = row.dataset.scratchSession;
11066
+ paintSectionSlots('data-scratch-files-for', sessionId, scratchpadFolded ? '' : scratchFilesInnerHtml(sessionId));
11067
+ loadScratchFiles(sessionId);
11068
+ }
11069
+
11070
+ function renderScratchFilesSlot(sessionId, inner) {
11071
+ return `<div class="scratch-files-section" data-scratch-files-for="${escapeHtml(sessionId)}">${inner}</div>`;
11031
11072
  }
11032
11073
 
11033
11074
  // biome-ignore lint/correctness/noUnusedVariables: used in HTML
@@ -12723,6 +12764,7 @@ let terminalHost = null;
12723
12764
  let sentTerminalHost = null;
12724
12765
 
12725
12766
  function applyHubSettings(s) {
12767
+ document.documentElement.classList.toggle('sidebar-right', s.sidebarSide === 'right');
12726
12768
  sessionsList.classList.toggle('zen-centered', s.zenCentered === true);
12727
12769
  if (s.zenPattern) sessionsList.dataset.zenPattern = s.zenPattern;
12728
12770
  else delete sessionsList.dataset.zenPattern;
@@ -13133,15 +13175,16 @@ function _initDragResize(handle, { onStart, onMove, onEnd }) {
13133
13175
  function initSidebarResize() {
13134
13176
  const sidebar = document.querySelector('.sidebar');
13135
13177
  const handle = document.getElementById('sidebar-resize');
13136
- let startWidth;
13178
+ let startWidth, sign;
13137
13179
 
13138
13180
  _initDragResize(handle, {
13139
13181
  onStart() {
13140
13182
  if (sidebar.classList.contains('collapsed')) return false;
13141
13183
  startWidth = sidebar.offsetWidth;
13184
+ sign = growSign(handle, sidebar);
13142
13185
  },
13143
13186
  onMove(dx) {
13144
- const w = Math.min(600, Math.max(200, startWidth + dx));
13187
+ const w = Math.min(600, Math.max(200, startWidth + sign * dx));
13145
13188
  sidebar.style.setProperty('--sidebar-width', `${w}px`);
13146
13189
  sidebar.style.width = `${w}px`;
13147
13190
  },
@@ -13155,15 +13198,23 @@ function initPanelResize(panelId, handleId, cssVar) {
13155
13198
  initResize(document.getElementById(panelId), document.getElementById(handleId), cssVar, panelWidthKey(panelId), 200);
13156
13199
  }
13157
13200
 
13201
+ // The sidebar side setting moves grips between edges, so the drag direction comes from where the grip is.
13202
+ function growSign(handle, el) {
13203
+ const h = handle.getBoundingClientRect();
13204
+ const r = el.getBoundingClientRect();
13205
+ return h.left + h.width / 2 > r.left + r.width / 2 ? 1 : -1;
13206
+ }
13207
+
13158
13208
  function initResize(panel, handle, cssVar, key, min) {
13159
- let startWidth;
13209
+ let startWidth, sign;
13160
13210
  _initDragResize(handle, {
13161
13211
  onStart() {
13162
13212
  startWidth = panel.offsetWidth;
13213
+ sign = growSign(handle, panel);
13163
13214
  panel.classList.add('resizing');
13164
13215
  },
13165
13216
  onMove(dx) {
13166
- panel.style.setProperty(cssVar, `${Math.max(min, startWidth - dx)}px`);
13217
+ panel.style.setProperty(cssVar, `${Math.max(min, startWidth + sign * dx)}px`);
13167
13218
  },
13168
13219
  onEnd() {
13169
13220
  panel.classList.remove('resizing');
@@ -13258,15 +13309,15 @@ function abbreviateScratchpadDir(dir) {
13258
13309
  function renderScratchpadRow(session) {
13259
13310
  const dir = session?.scratchpadDir;
13260
13311
  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>
13312
+ return `<div class="zen-scratchpad panel-section-header${scratchpadFolded ? ' collapsed' : ''}" data-scratch-session="${escapeHtml(session.id)}" title="${escapeHtml(dir)}">
13313
+ ${groupChevronSvg(12)}
13314
+ <span>Scratchpad</span>
13264
13315
  <span class="row-actions">
13265
13316
  <button onclick="copyWithFeedback('${escAttrJs(dir)}', this)" title="Copy">${ICON_COPY}</button>
13266
13317
  <button data-folder="${escapeHtml(dir)}" onclick="openFolderInEditor(this.dataset.folder)" title="Open in editor">${ICON_OPEN_EXTERNAL}</button>
13267
13318
  </span>
13268
13319
  </div>
13269
- ${renderScratchFilesHtml(session.id)}`;
13320
+ ${renderScratchFilesSlot(session.id, scratchpadFolded ? '' : scratchFilesInnerHtml(session.id))}`;
13270
13321
  }
13271
13322
 
13272
13323
  function showInfoModal(session, teamConfig, tasks, planContent, parentInfo) {
@@ -19322,11 +19373,12 @@ function startDockDrag(e, panel) {
19322
19373
  edge.setPointerCapture(e.pointerId);
19323
19374
  const hostW = dockHostWidth();
19324
19375
  const start = { x: e.clientX, w: panel.offsetWidth };
19376
+ const sign = growSign(edge, panel);
19325
19377
  let w = start.w;
19326
19378
  let raf = 0;
19327
19379
  document.body.classList.add('show-resizing');
19328
19380
  const move = (ev) => {
19329
- w = showDockWidth(Math.round(start.w + start.x - ev.clientX), hostW);
19381
+ w = showDockWidth(Math.round(start.w + sign * (ev.clientX - start.x)), hostW);
19330
19382
  raf ||= requestAnimationFrame(() => {
19331
19383
  raf = 0;
19332
19384
  panel.style.setProperty('--show-dock-drag', `${w}px`);
package/public/index.html CHANGED
@@ -299,11 +299,6 @@
299
299
  <circle cx="12" cy="17" r="0.5" fill="currentColor"/>
300
300
  </svg>
301
301
  </button>
302
- <a href="https://github.com/NikiforovAll/claude-code-kanban" target="_blank" class="icon-btn" title="View on GitHub" aria-label="View on GitHub">
303
- <svg viewBox="0 0 24 24" fill="currentColor" width="16" height="16">
304
- <path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"/>
305
- </svg>
306
- </a>
307
302
  </div>
308
303
  </header>
309
304
 
@@ -541,6 +536,7 @@
541
536
  </button>
542
537
  </div>
543
538
  </div>
539
+ <div id="preview-task" hidden></div>
544
540
  <div class="modal-body">
545
541
  <div class="preview-split">
546
542
  <div id="preview-modal-body" class="rendered-md modal-zoomable"></div>
@@ -556,6 +552,7 @@
556
552
  <div class="modal-header">
557
553
  <h3 class="modal-title">Keyboard Shortcuts</h3>
558
554
  <a class="help-docs" id="help-docs" href="https://nikiforovall.blog/claude-code-kanban/" target="_blank" rel="noopener">Docs ↗</a>
555
+ <a class="help-docs" href="https://github.com/NikiforovAll/claude-code-kanban" target="_blank" rel="noopener">GitHub ↗</a>
559
556
  <button class="modal-close" aria-label="Close dialog" onclick="closeHelpModal()">
560
557
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
561
558
  <path d="M18 6L6 18M6 6l12 12"/>
package/public/style.css CHANGED
@@ -150,6 +150,10 @@ body::before {
150
150
  height: 100vh;
151
151
  }
152
152
 
153
+ .sidebar-right .app {
154
+ flex-direction: row-reverse;
155
+ }
156
+
153
157
  /* #endregion */
154
158
 
155
159
  /* #region SIDEBAR */
@@ -366,6 +370,70 @@ body::before {
366
370
  display: none;
367
371
  }
368
372
 
373
+ .sidebar-right .sidebar {
374
+ border-right: none;
375
+ border-left: 1px solid color-mix(in srgb, var(--border) 35%, transparent);
376
+ box-shadow: -1px 0 12px rgba(0, 0, 0, 0.04);
377
+ }
378
+ .sidebar-right .sidebar-resize-handle {
379
+ right: auto;
380
+ left: 0;
381
+ }
382
+ .sidebar-right .sessions-list {
383
+ padding-left: 10px;
384
+ }
385
+ .sidebar-right
386
+ :is(
387
+ .sg-section-label,
388
+ .session-group-header,
389
+ .project-group-header,
390
+ .project-group-breadcrumb,
391
+ .pinned-sub-header,
392
+ .sg-sub-label
393
+ ) {
394
+ margin-left: -2px;
395
+ }
396
+ .sidebar-right :is(.sg-section-label, .session-group-header, .project-group-header) {
397
+ padding-left: 6px;
398
+ }
399
+ .sidebar-right .project-group-breadcrumb {
400
+ padding-left: 24px;
401
+ }
402
+ .sidebar-right .pinned-sub-header {
403
+ padding-left: 14px;
404
+ }
405
+ .sidebar-right .sg-sub-label {
406
+ padding-left: 4px;
407
+ }
408
+ .sidebar-right .sidebar-toggle-btn svg {
409
+ scale: -1 1;
410
+ }
411
+ .sidebar-right .app > .detail-panel:not(.expanded),
412
+ .sidebar-right .app > .message-panel {
413
+ left: 0;
414
+ right: auto;
415
+ border-left: none;
416
+ border-right: 1px solid color-mix(in srgb, var(--border) 35%, transparent);
417
+ box-shadow: 1px 0 12px rgba(0, 0, 0, 0.04);
418
+ }
419
+ .sidebar-right .app > .message-panel.full-width {
420
+ right: var(--sidebar-w, 0);
421
+ }
422
+ .sidebar-right .app > :is(.detail-panel, .message-panel) > .panel-resize-handle,
423
+ .sidebar-right .kanbot-popover.docked .kanbot-resize {
424
+ left: auto;
425
+ right: 0;
426
+ }
427
+ .sidebar-right .kanbot-popover:not(.expanded, .docked) {
428
+ left: auto;
429
+ right: 12px;
430
+ }
431
+ .sidebar-right .kanbot-popover.docked:not(.expanded) {
432
+ left: 0;
433
+ right: auto;
434
+ border-width: 0 1px 0 0;
435
+ }
436
+
369
437
  .panel-resize-handle {
370
438
  position: absolute;
371
439
  top: 0;
@@ -1540,31 +1608,18 @@ body.booting .boot-splash {
1540
1608
  }
1541
1609
 
1542
1610
  .zen-scratchpad {
1543
- display: flex;
1544
- align-items: center;
1545
- gap: 8px;
1546
1611
  margin-top: 12px;
1547
1612
  padding-top: 10px;
1548
1613
  border-top: 1px solid var(--border);
1549
- font-size: 11px;
1614
+ cursor: pointer;
1550
1615
  }
1551
1616
 
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;
1617
+ .zen-scratchpad:hover {
1618
+ color: var(--text-primary);
1558
1619
  }
1559
1620
 
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);
1621
+ .zen-scratchpad .row-actions {
1622
+ margin-left: auto;
1568
1623
  }
1569
1624
 
1570
1625
  .zen-panel:hover .row-actions {
@@ -4150,6 +4205,8 @@ code.ct .ct-has[aria-expanded='false'] .ct-name::after {
4150
4205
  .terminal-pane {
4151
4206
  --dock-rail-w: 0px;
4152
4207
  --dock-panel-w: 0px;
4208
+ --dock-start: 0px;
4209
+ --dock-end: calc(var(--dock-panel-w) + var(--dock-rail-w));
4153
4210
  }
4154
4211
 
4155
4212
  .terminal-pane.dock-rail-on {
@@ -4169,13 +4226,14 @@ code.ct .ct-has[aria-expanded='false'] .ct-name::after {
4169
4226
 
4170
4227
  .terminal-pane.dock-rail-on .terminal-frame,
4171
4228
  .terminal-pane.show-docked .terminal-frame {
4172
- width: calc(100% - var(--dock-panel-w) - var(--dock-rail-w));
4229
+ margin-left: var(--dock-start);
4230
+ width: calc(100% - var(--dock-start) - var(--dock-end));
4173
4231
  }
4174
4232
 
4175
4233
  .terminal-pane.dock-rail-on .terminal-bar,
4176
4234
  .terminal-pane.show-docked .terminal-bar {
4177
4235
  top: 8px;
4178
- right: calc(8px + var(--dock-panel-w) + var(--dock-rail-w));
4236
+ right: calc(8px + var(--dock-end));
4179
4237
  }
4180
4238
 
4181
4239
  .dock-rail {
@@ -4249,8 +4307,8 @@ code.ct .ct-has[aria-expanded='false'] .ct-name::after {
4249
4307
  box-sizing: border-box;
4250
4308
  display: flex;
4251
4309
  flex-direction: column;
4252
- border-left: 1px solid var(--border);
4253
- border-bottom: 1px solid var(--border);
4310
+ border: solid var(--border);
4311
+ border-width: 0 0 1px 1px;
4254
4312
  background: var(--bg-surface);
4255
4313
  color: var(--text-secondary);
4256
4314
  font-family: var(--font-mono);
@@ -4819,6 +4877,46 @@ body.show-resizing iframe {
4819
4877
  pointer-events: none;
4820
4878
  }
4821
4879
 
4880
+ .sidebar-right .terminal-pane.dock-rail-on,
4881
+ .sidebar-right .terminal-pane.show-docked {
4882
+ padding-left: 0;
4883
+ --dock-start: calc(var(--dock-panel-w) + var(--dock-rail-w));
4884
+ --dock-end: 0px;
4885
+ }
4886
+ /* The gap sits in the frame's border, not the host, so the host's focus ring stays hidden there. */
4887
+ .sidebar-right .terminal-pane.dock-rail-on .terminal-frame,
4888
+ .sidebar-right .terminal-pane.show-docked .terminal-frame {
4889
+ box-sizing: border-box;
4890
+ border-left: 12px solid var(--bg-deep);
4891
+ }
4892
+ .sidebar-right .dock-rail {
4893
+ right: auto;
4894
+ left: 0;
4895
+ border-left: 0;
4896
+ border-right: 1px solid var(--border);
4897
+ }
4898
+ .sidebar-right .dock-addon,
4899
+ .sidebar-right .show-card.docked {
4900
+ right: auto;
4901
+ left: var(--dock-rail-w);
4902
+ border-style: solid;
4903
+ border-width: 0 1px 1px 0;
4904
+ }
4905
+ .sidebar-right .dock-addon.expanded,
4906
+ .sidebar-right .show-card.docked.expanded {
4907
+ right: 0;
4908
+ }
4909
+ .sidebar-right .show-card:not(.docked) {
4910
+ right: var(--show-inset);
4911
+ }
4912
+ .sidebar-right .show-card.expanded:not(.docked) {
4913
+ left: calc(var(--show-inset) + var(--dock-rail-w));
4914
+ }
4915
+ .sidebar-right .show-dock-edge {
4916
+ left: auto;
4917
+ right: 0;
4918
+ }
4919
+
4822
4920
  .show-reopen {
4823
4921
  display: inline-flex;
4824
4922
  align-items: center;
@@ -5845,7 +5943,7 @@ body.show-resizing iframe {
5845
5943
  width: 60vw;
5846
5944
  }
5847
5945
  .message-panel.full-width {
5848
- left: var(--sidebar-edge, 0);
5946
+ left: var(--sidebar-w, 0);
5849
5947
  width: auto;
5850
5948
  }
5851
5949
  .message-panel.full-width .panel-resize-handle {
@@ -8864,6 +8962,53 @@ body.light .msg-assistant .msg-text {
8864
8962
  color: var(--text-primary);
8865
8963
  }
8866
8964
 
8965
+ #preview-task {
8966
+ flex: none;
8967
+ display: grid;
8968
+ gap: 6px;
8969
+ padding: 10px 0;
8970
+ border-bottom: 1px solid var(--border);
8971
+ }
8972
+
8973
+ #preview-task[hidden] {
8974
+ display: none;
8975
+ }
8976
+
8977
+ .preview-task-meta {
8978
+ justify-content: flex-start;
8979
+ gap: 12px;
8980
+ font-size: 11px;
8981
+ color: var(--text-muted);
8982
+ }
8983
+
8984
+ .preview-task-meta .agent-status,
8985
+ .preview-task-meta .agent-duration {
8986
+ font-size: 11px;
8987
+ }
8988
+
8989
+ .preview-task-desc {
8990
+ font-size: 13px;
8991
+ font-weight: 600;
8992
+ color: var(--text-primary);
8993
+ }
8994
+
8995
+ .preview-task-cmd {
8996
+ position: relative;
8997
+ }
8998
+
8999
+ .preview-task-cmd pre {
9000
+ max-height: 7.5em;
9001
+ overflow: auto;
9002
+ padding-right: 40px;
9003
+ font-size: 12px;
9004
+ }
9005
+
9006
+ .preview-task-cmd .icon-btn {
9007
+ position: absolute;
9008
+ top: 4px;
9009
+ right: 4px;
9010
+ }
9011
+
8867
9012
  /* Rendered HTML pages need far more room than a markdown doc. */
8868
9013
  .modal.preview-modal-dialog.preview-html {
8869
9014
  width: 96vw;
@@ -9253,6 +9398,10 @@ body.light .msg-assistant .msg-text {
9253
9398
  border-color 0.15s ease;
9254
9399
  }
9255
9400
 
9401
+ .help-docs + .help-docs {
9402
+ margin-left: -6px;
9403
+ }
9404
+
9256
9405
  .help-docs:hover {
9257
9406
  color: var(--accent);
9258
9407
  border-color: var(--accent);
@@ -11364,7 +11513,8 @@ pre.mermaid[data-mermaid-error]::before {
11364
11513
  .project-group-header .group-chevron,
11365
11514
  .session-group-header .group-chevron,
11366
11515
  .sg-section-toggle .group-chevron,
11367
- .scratch-folder-toggle .group-chevron {
11516
+ .scratch-folder-toggle .group-chevron,
11517
+ .zen-scratchpad .group-chevron {
11368
11518
  transition: transform 0.15s ease;
11369
11519
  flex-shrink: 0;
11370
11520
  display: block;
@@ -11373,7 +11523,8 @@ pre.mermaid[data-mermaid-error]::before {
11373
11523
  .project-group-header.collapsed .group-chevron,
11374
11524
  .session-group-header.collapsed .group-chevron,
11375
11525
  .sg-section-toggle.collapsed .group-chevron,
11376
- .scratch-folder-toggle.collapsed .group-chevron {
11526
+ .scratch-folder-toggle.collapsed .group-chevron,
11527
+ .zen-scratchpad.collapsed .group-chevron {
11377
11528
  transform: rotate(-90deg);
11378
11529
  }
11379
11530
 
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 {