claude-code-kanban 7.33.0 → 7.34.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/public/index.html CHANGED
@@ -513,7 +513,10 @@
513
513
  <div id="preview-modal" class="modal-overlay" style="z-index:10002;" onclick="closePreviewModal()">
514
514
  <div class="modal preview-modal-dialog review-host" tabindex="-1" onclick="event.stopPropagation()">
515
515
  <div class="modal-header">
516
- <h3 class="modal-title" id="preview-modal-title">Preview</h3>
516
+ <div class="preview-heading">
517
+ <h3 class="modal-title" id="preview-modal-title">Preview</h3>
518
+ <div id="preview-modal-meta" title="Click to copy path" onclick="copyPreviewPath(this)"></div>
519
+ </div>
517
520
  <div style="display:flex;gap:4px;align-items:center;">
518
521
  <button id="preview-pane-btn" class="icon-btn" aria-label="Open in a pane" title="Open in a pane" onclick="openPreviewInPane()">
519
522
  <svg fill="none" stroke="currentColor" stroke-width="2" width="16" height="16"><use href="#icon-pane"/></svg>
@@ -543,7 +546,6 @@
543
546
  <div id="preview-modal-body" class="rendered-md modal-zoomable"></div>
544
547
  <aside id="preview-review-panel" class="review-panel" hidden></aside>
545
548
  </div>
546
- <div id="preview-modal-meta" title="Click to copy path" onclick="copyPreviewPath(this)"></div>
547
549
  </div>
548
550
  </div>
549
551
  </div>
package/public/style.css CHANGED
@@ -894,6 +894,34 @@ body::before {
894
894
  flex-shrink: 0;
895
895
  }
896
896
 
897
+ .zen-empty {
898
+ display: flex;
899
+ flex-direction: column;
900
+ gap: 12px;
901
+ padding: 14px 0 8px;
902
+ }
903
+ .zen-empty-head {
904
+ padding: 0 8px;
905
+ }
906
+ .zen-empty-title {
907
+ font-size: 13px;
908
+ font-weight: 600;
909
+ color: var(--text-primary);
910
+ }
911
+ .zen-empty-hint {
912
+ margin-top: 4px;
913
+ font-size: 11.5px;
914
+ color: var(--text-muted);
915
+ }
916
+ .zen-empty .home-keys {
917
+ width: auto;
918
+ margin: 0;
919
+ }
920
+ .zen-empty .home-key {
921
+ padding: 6px 8px;
922
+ font-size: 12px;
923
+ }
924
+
897
925
  /* After the ::after spacer, so the agents sit at the bottom of the free space. */
898
926
  .zen-agents {
899
927
  order: 1;
@@ -1158,7 +1186,9 @@ body.booting .boot-splash {
1158
1186
  .session-item.unread::before,
1159
1187
  .session-item.permission-pending::before,
1160
1188
  .sp-row.unread::before,
1161
- .sp-row.permission-pending::before {
1189
+ .sp-row.permission-pending::before,
1190
+ .session-item.reported-error::before,
1191
+ .sp-row.reported-error::before {
1162
1192
  content: '';
1163
1193
  position: absolute;
1164
1194
  inset: -1px;
@@ -1167,7 +1197,8 @@ body.booting .boot-splash {
1167
1197
  }
1168
1198
 
1169
1199
  .session-item.unread::before,
1170
- .session-item.permission-pending::before {
1200
+ .session-item.permission-pending::before,
1201
+ .session-item.reported-error::before {
1171
1202
  border-radius: inherit;
1172
1203
  }
1173
1204
 
@@ -1177,6 +1208,62 @@ body.booting .boot-splash {
1177
1208
  animation: agent-badge-pulse 1.6s ease-in-out infinite;
1178
1209
  }
1179
1210
 
1211
+ .session-item.reported-error::before,
1212
+ .sp-row.reported-error::before {
1213
+ border-left-color: var(--danger);
1214
+ }
1215
+
1216
+ .session-footer .session-time.has-report {
1217
+ flex: 1;
1218
+ }
1219
+
1220
+ .session-report {
1221
+ display: flex;
1222
+ flex: 1;
1223
+ align-items: center;
1224
+ gap: 6px;
1225
+ min-width: 0;
1226
+ font-family: var(--sans);
1227
+ font-size: 12px;
1228
+ line-height: 16px;
1229
+ color: var(--text-secondary);
1230
+ }
1231
+
1232
+ .report-chip {
1233
+ flex: none;
1234
+ padding: 0 6px;
1235
+ border: 1px solid currentColor;
1236
+ border-radius: 8px;
1237
+ font-size: 10px;
1238
+ font-weight: 600;
1239
+ line-height: 14px;
1240
+ color: var(--warning);
1241
+ }
1242
+
1243
+ .report-error .report-chip,
1244
+ .report-chip.report-error {
1245
+ color: var(--danger);
1246
+ }
1247
+
1248
+ .report-app {
1249
+ flex: none;
1250
+ font-family: var(--mono);
1251
+ font-size: 11px;
1252
+ color: var(--text-tertiary);
1253
+ }
1254
+
1255
+ .report-msg {
1256
+ flex: 1;
1257
+ min-width: 0;
1258
+ overflow: hidden;
1259
+ white-space: nowrap;
1260
+ text-overflow: ellipsis;
1261
+ }
1262
+
1263
+ .sp-report {
1264
+ margin-left: 6px;
1265
+ }
1266
+
1180
1267
  @media (prefers-reduced-motion: reduce) {
1181
1268
  .session-item.permission-pending::before,
1182
1269
  .sp-row.permission-pending::before {
@@ -8738,13 +8825,22 @@ body.light .msg-assistant .msg-text {
8738
8825
  max-height: 70vh;
8739
8826
  }
8740
8827
 
8828
+ .preview-heading {
8829
+ flex: 1;
8830
+ min-width: 0;
8831
+ margin-right: 12px;
8832
+ }
8833
+
8741
8834
  #preview-modal-meta {
8742
- margin-top: 12px;
8835
+ margin-top: 2px;
8743
8836
  font-size: 11px;
8744
8837
  color: var(--text-muted);
8745
- flex-shrink: 0;
8746
8838
  cursor: copy;
8747
- align-self: flex-start;
8839
+ width: fit-content;
8840
+ max-width: 100%;
8841
+ overflow: hidden;
8842
+ text-overflow: ellipsis;
8843
+ white-space: nowrap;
8748
8844
  }
8749
8845
 
8750
8846
  #preview-modal-meta:hover {
@@ -108,6 +108,11 @@
108
108
  if (parentOrigin) win.parent.postMessage({ ...data, type: MSG + t }, parentOrigin);
109
109
  }
110
110
 
111
+ // Ctrl+click (Cmd on macOS) on a folder skips the board's toast and opens the folder at once.
112
+ function upLink(e, href) {
113
+ up('link', e?.ctrlKey || e?.metaKey ? { href, ctrl: true } : { href });
114
+ }
115
+
111
116
  function send(msg) {
112
117
  if (state.ws?.readyState === win.WebSocket.OPEN) state.ws.send(JSON.stringify(msg));
113
118
  }
@@ -221,7 +226,7 @@
221
226
  cursorBlink: true,
222
227
  allowProposedApi: true,
223
228
  // xterm's default asks with confirm() and opens a window, which the installed hub window blocks.
224
- linkHandler: { activate: (_e, uri) => up('link', { href: uri }), allowNonHttpProtocols: true },
229
+ linkHandler: { activate: upLink, allowNonHttpProtocols: true },
225
230
  ...o.themeOptions,
226
231
  });
227
232
  state.term = term;
@@ -230,7 +235,7 @@
230
235
  term.loadAddon(new win.Unicode11Addon.Unicode11Addon());
231
236
  term.unicode.activeVersion = '11';
232
237
  // Link providers scan a line only when the pointer moves onto it, never on output.
233
- term.loadAddon(new win.WebLinksAddon.WebLinksAddon((_e, uri) => up('link', { href: uri })));
238
+ term.loadAddon(new win.WebLinksAddon.WebLinksAddon(upLink));
234
239
  const cellReuse = term.buffer.active.getNullCell();
235
240
  term.registerLinkProvider({
236
241
  provideLinks(y, done) {
@@ -240,7 +245,7 @@
240
245
  const links = pathsIn(text).map((p) => ({
241
246
  text: p.text,
242
247
  range: { start: { x: xs[p.index] + 1, y }, end: { x: xs[p.index + p.text.length - 1] + 1, y } },
243
- activate: () => up('link', { href: p.path }),
248
+ activate: (e) => upLink(e, p.path),
244
249
  }));
245
250
  done(links.length ? links : undefined);
246
251
  },
package/server.js CHANGED
@@ -25,6 +25,7 @@ const os = require('node:os');
25
25
  const crypto = require('node:crypto');
26
26
  const { spawn } = require('node:child_process');
27
27
  const { assertOpenTarget, openInEditor, whichSync, exeBehindShim } = require('./lib/open-editor');
28
+ const { revealInFileManager } = require('./lib/reveal');
28
29
  const { createNetGuard } = require('./lib/net-guard');
29
30
  const { isContained, realpathDeepest } = require('./lib/contain');
30
31
  const { resolveScratchSubdir, listScratchDir } = require('./lib/scratch-files');
@@ -1621,6 +1622,7 @@ app.get('/api/sessions', async (req, res) => {
1621
1622
  // the project filter, because pinning is a preference and the filter is an intent.
1622
1623
  // The client sends the session it currently has open, which it cannot render at all
1623
1624
  // if the row is missing — that one is not a preference.
1625
+ const unfiltered = sessions;
1624
1626
  if (projectFilter) {
1625
1627
  const matches = projectMatcher(String(projectFilter));
1626
1628
  sessions = sessions.filter(s => matches(s.project, s.worktree?.repo) || includeIds.has(s.id));
@@ -1645,6 +1647,10 @@ app.get('/api/sessions', async (req, res) => {
1645
1647
  const missingPinned = sessions.filter(s => pinnedIds.has(s.id) && !topIds.has(s.id));
1646
1648
  sessions = [...top, ...missingPinned];
1647
1649
  }
1650
+ // `nest=1` (zen on a project): the sidebar draws a nested child in its parent's place, so the
1651
+ // client needs both ends of each nest link of the page to place a session as the full list does.
1652
+ // Added after the limit, like pins, so they take no page slots.
1653
+ if (projectFilter && req.query.nest === '1') sessions = withNestRelatives(sessions, unfiltered);
1648
1654
 
1649
1655
  // Loop info can mean a full read of the transcript, so only the rows sent pay for it, and
1650
1656
  // `lite=1` (the CLI's group list, which only counts and names sessions) skips it.
@@ -2259,6 +2265,19 @@ app.post('/api/open-folder', (req, res) => {
2259
2265
  }
2260
2266
  });
2261
2267
 
2268
+ // API: Show a folder, or a file selected in its folder, in the OS file manager.
2269
+ app.post('/api/reveal', (req, res) => {
2270
+ try {
2271
+ const target = assertOpenTarget(resolvePreviewPath(req.body?.path) || '', 'path');
2272
+ revealInFileManager(target);
2273
+ res.json({ success: true, path: target });
2274
+ } catch (error) {
2275
+ if (error.status) return res.status(error.status).json({ error: error.message });
2276
+ console.error('Error revealing path:', error);
2277
+ res.status(500).json({ error: 'Failed to open the file manager' });
2278
+ }
2279
+ });
2280
+
2262
2281
  // API: Open file in editor — either an existing path ({ file }) or content as a temp file ({ content, title })
2263
2282
  app.post('/api/open-in-editor', (req, res) => {
2264
2283
  try {
@@ -2632,7 +2651,9 @@ app.post('/api/sessions/:sessionId/waiting/discard', (req, res) => {
2632
2651
 
2633
2652
  app.post('/api/sessions/:sessionId/read', (req, res) => {
2634
2653
  try {
2635
- clearActivityMarker(resolveSessionId(req.params.sessionId), '_stop.json');
2654
+ const sessionId = resolveSessionId(req.params.sessionId);
2655
+ terminal.markStatusSeen(sessionId);
2656
+ clearActivityMarker(sessionId, '_stop.json');
2636
2657
  res.json({ ok: true });
2637
2658
  } catch {
2638
2659
  res.status(500).json({ error: 'Failed to mark session read' });
@@ -3273,7 +3294,7 @@ const terminal = createTerminalClient({
3273
3294
  resolveCwd: resolveSessionFolder,
3274
3295
  shellRun: (id) => panes.shellPane(id)?.run || null,
3275
3296
  isAllowedFolder,
3276
- onChange: () => broadcast({ type: 'terminals-update', ids: terminal.ids(), awaitingTrust: terminal.awaitingTrust() }),
3297
+ onChange: () => broadcast({ type: 'terminals-update', ids: terminal.ids(), awaitingTrust: terminal.awaitingTrust(), programStatus: terminal.programStatus(), statusSilent: terminal.statusSilent() }),
3277
3298
  onExit: (id) => {
3278
3299
  if (dispatched.get(id)) broadcast({ type: 'dispatch-update' });
3279
3300
  },
@@ -3312,7 +3333,7 @@ app.post('/api/terminal/pick-folder', async (req, res) => {
3312
3333
  }
3313
3334
  });
3314
3335
 
3315
- // The hub's terminalHost setting reaches only the board page, which relays it here.
3336
+ // A change to the hub's terminalHost setting reaches only the board page, which relays it here.
3316
3337
  app.post('/api/terminal/options', (req, res) => {
3317
3338
  if (!terminal.authorized(req.get('x-terminal-token'))) return res.status(401).json({ error: 'invalid terminal token' });
3318
3339
  if (typeof req.body?.conptyDll !== 'boolean') return res.status(400).json({ error: 'conptyDll must be a boolean' });
@@ -3504,11 +3525,43 @@ const forks = createDispatchedStore(jsonFile(FORKS_FILE));
3504
3525
  const linkedDocs = createLinkedDocStore(jsonFile(LINKED_DOCS_FILE));
3505
3526
 
3506
3527
  const nestStoreOf = (id) => (dispatched.get(id) ? dispatched : forks.get(id) ? forks : null);
3528
+ const nestOf = (id) => nestStoreOf(id)?.get(id);
3529
+
3530
+ // The ancestors and descendants of the page's sessions along nest links, not their siblings.
3531
+ function withNestRelatives(page, all) {
3532
+ const byId = new Map(all.map((s) => [s.id, s]));
3533
+ const parentOf = new Map();
3534
+ const childrenOf = new Map();
3535
+ for (const s of all) {
3536
+ const nest = nestOf(s.id);
3537
+ if (!nest?.child || !byId.has(nest.parent)) continue;
3538
+ parentOf.set(s.id, nest.parent);
3539
+ if (!childrenOf.has(nest.parent)) childrenOf.set(nest.parent, []);
3540
+ childrenOf.get(nest.parent).push(s.id);
3541
+ }
3542
+ const keep = new Set(page.map((s) => s.id));
3543
+ const added = [];
3544
+ const add = (id) => {
3545
+ if (keep.has(id)) return false;
3546
+ keep.add(id);
3547
+ added.push(byId.get(id));
3548
+ return true;
3549
+ };
3550
+ for (const s of page) {
3551
+ for (let id = parentOf.get(s.id); id && add(id); id = parentOf.get(id));
3552
+ const down = [...(childrenOf.get(s.id) || [])];
3553
+ while (down.length) {
3554
+ const id = down.pop();
3555
+ if (add(id)) down.push(...(childrenOf.get(id) || []));
3556
+ }
3557
+ }
3558
+ return added.length ? [...page, ...added] : page;
3559
+ }
3507
3560
 
3508
3561
  function withDispatchMarker(sessions) {
3509
3562
  return sessions.map((s) => {
3510
3563
  const marker = dispatched.get(s.id);
3511
- const nest = marker || forks.get(s.id);
3564
+ const nest = nestOf(s.id);
3512
3565
  if (!nest) return s;
3513
3566
  return {
3514
3567
  ...s,
@@ -3859,9 +3912,20 @@ async function readHead(absPath) {
3859
3912
  }
3860
3913
  }
3861
3914
 
3915
+ // A name the allowlist does not know (.gitignore, Dockerfile, LICENSE) is text when its head
3916
+ // is also valid UTF-8: a stricter test than a listed extension gets, because here the name
3917
+ // claims nothing.
3862
3918
  async function confirmKind(absPath, kind) {
3863
- if (!kind) return null;
3864
- return (await readHead(absPath)).includes(0) ? null : kind;
3919
+ if (!kind && PREVIEW_OPAQUE_EXTS.has(previewExtFor(absPath))) return null;
3920
+ const head = await readHead(absPath);
3921
+ if (head.includes(0)) return null;
3922
+ if (kind) return kind;
3923
+ try {
3924
+ new TextDecoder('utf-8', { fatal: true }).decode(head, { stream: true });
3925
+ return 'text';
3926
+ } catch {
3927
+ return null;
3928
+ }
3865
3929
  }
3866
3930
 
3867
3931
  // Whole files are pushed into a modal, so anything huge freezes the tab regardless of kind.
@@ -3875,13 +3939,14 @@ const PREVIEW_TEXT_MAX_BYTES = 2 * 1024 * 1024;
3875
3939
  async function statFileTarget(absPath) {
3876
3940
  try {
3877
3941
  const stats = await fs.stat(absPath);
3942
+ if (stats.isDirectory()) throw previewError(400, 'Not a file', 'is_dir');
3878
3943
  if (!stats.isFile()) throw previewError(400, 'Not a file', 'not_a_file');
3879
3944
  const kind = previewKindFor(absPath);
3880
3945
  return { size: stats.size, kind: kind === 'image' ? kind : await confirmKind(absPath, kind) };
3881
3946
  } catch (e) {
3882
3947
  if (e.status) throw e;
3883
3948
  if (e.code === 'ENOENT') throw previewError(404, 'File not found', 'file_not_found');
3884
- if (e.code === 'EISDIR') throw previewError(400, 'Not a file', 'not_a_file');
3949
+ if (e.code === 'EISDIR') throw previewError(400, 'Not a file', 'is_dir');
3885
3950
  throw e;
3886
3951
  }
3887
3952
  }
@@ -4210,6 +4275,8 @@ app.get('/api/preview', async (req, res) => {
4210
4275
  // document is followed without knowing the target is there, so a link to a deleted
4211
4276
  // file would put a 404 in the browser console. The caller toasts it from `exists`.
4212
4277
  if (error.status === 404) return res.json({ path: abs, exists: false, content: null, kind: null });
4278
+ // A folder is an answer too: the caller offers the file manager instead of a preview.
4279
+ if (error.code === 'is_dir') return res.json({ path: abs, exists: true, content: null, kind: null, dir: true });
4213
4280
  // A previewError carries the status it wants reported and is an answer, not a
4214
4281
  // failure — a missing file or one too large to render is the user's doing.
4215
4282
  if (!error.status) console.error('Error in GET /api/preview:', error);