jupyterlab_claude_code_extension 1.2.17 → 1.2.20

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/README.md CHANGED
@@ -29,7 +29,7 @@ Chat-panel extensions re-implement the agent loop and trail the real tool. This
29
29
  - **Live indicator** - a green dot marks sessions that are currently running somewhere
30
30
  - **One-click resume** - click a row to jump back into that session in a terminal. If a terminal for the project is already open, it's reused instead of duplicated
31
31
  - **Favorites** - star projects you keep coming back to via the right-click menu
32
- - **Remove** - drop a project's Claude history from the panel via the right-click menu; the history folder is moved to the trash (it honours JupyterLab's "move files to trash" setting), not deleted permanently
32
+ - **Remove** - drop a project's Claude history from the panel via the right-click menu; a confirmation dialog names the project and warns it removes the whole project and all its conversations before anything is touched, then the history folder is moved to the trash (it honours JupyterLab's "move files to trash" setting), not deleted permanently
33
33
  - **Clean up parallel sessions** - when a project has accumulated extra sessions beyond the main one, a right-click menu item (showing the count in brackets) removes them all, keeping only the main session; removed files honour the same trash setting
34
34
  - **Conversation switcher** - a right-click "Switch and Manage Sessions" submenu lists a project's other conversations by name and short session id, e.g. `home (3f2a1b9c)`, with last-activity time; pick one and it becomes the row's current conversation - the next click resumes exactly that one. The submenu shows the 5 most recent; "Manage Sessions..." opens a searchable popup over the full list where conversations can also be deleted - select one, many, or all via checkboxes, then confirm with a two-step Delete button (removed files honour the trash setting). Rows with multiple conversations show a branch icon with the count after the name
35
35
  - **Branch session** - fork the current conversation into a new named session via the right-click menu (normal or skip-permissions mode); uses Claude's native `--fork-session`, opens in a new terminal, the chosen name is stamped automatically, and the fork becomes the row's current conversation
package/lib/icons.d.ts CHANGED
@@ -6,4 +6,5 @@ export declare const removeIcon: LabIcon;
6
6
  export declare const shieldIcon: LabIcon;
7
7
  export declare const addIcon: LabIcon;
8
8
  export declare const branchIcon: LabIcon;
9
+ export declare const switchIcon: LabIcon;
9
10
  export declare const filterIcon: LabIcon;
package/lib/icons.js CHANGED
@@ -67,6 +67,15 @@ export const branchIcon = new LabIcon({
67
67
  name: 'jupyterlab_claude_code_extension:branch',
68
68
  svgstr: branchSvgStr
69
69
  });
70
+ // Arrow-switch glyph (Octicons arrow-switch-16, MIT) - marks the
71
+ // "Switch and Manage Sessions" submenu.
72
+ const switchSvgStr = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
73
+ <path class="jp-icon3" fill="#616161" d="M5.22 14.78a.75.75 0 0 0 1.06-1.06L4.56 12h8.69a.75.75 0 0 0 0-1.5H4.56l1.72-1.72a.75.75 0 0 0-1.06-1.06l-3 3a.75.75 0 0 0 0 1.06l3 3Zm5.56-6.5a.75.75 0 1 1-1.06-1.06l1.72-1.72H2.75a.75.75 0 0 1 0-1.5h8.69L9.72 2.28a.75.75 0 0 1 1.06-1.06l3 3a.75.75 0 0 1 0 1.06l-3 3Z"/>
74
+ </svg>`;
75
+ export const switchIcon = new LabIcon({
76
+ name: 'jupyterlab_claude_code_extension:switch',
77
+ svgstr: switchSvgStr
78
+ });
70
79
  // Funnel copied verbatim from @jupyterlab/ui-components'
71
80
  // `search/filter.svg` - the same image the file browser's filter
72
81
  // toggle uses. The `class="jp-icon3"` lets JupyterLab's theme drive
package/lib/widget.js CHANGED
@@ -5,7 +5,7 @@ import { CommandRegistry } from '@lumino/commands';
5
5
  import { UUID } from '@lumino/coreutils';
6
6
  import { Menu, Widget } from '@lumino/widgets';
7
7
  import { requestAPI } from './request';
8
- import { addIcon, branchIcon, claudeIcon, filterIcon, refreshIcon, removeIcon, shieldIcon, starFilledIcon } from './icons';
8
+ import { addIcon, branchIcon, switchIcon, claudeIcon, filterIcon, refreshIcon, removeIcon, shieldIcon, starFilledIcon } from './icons';
9
9
  const POLL_INTERVAL_MS = 30000;
10
10
  const DEFAULT_RECENT_LIMIT = 10;
11
11
  const EXPANDED_STORAGE_KEY = 'jupyterlab_claude_code_extension:expanded';
@@ -331,6 +331,16 @@ export class ClaudeCodeSessionsWidget extends Widget {
331
331
  }
332
332
  async _remove(session) {
333
333
  var _a;
334
+ const name = this._lookupName(session);
335
+ const confirm = await showDialog({
336
+ title: 'Remove from Claude',
337
+ body: `Remove "${name}" from Claude? This deletes the entire Claude ` +
338
+ 'project and every conversation it holds. This cannot be undone.',
339
+ buttons: [Dialog.cancelButton(), Dialog.warnButton({ label: 'Remove' })]
340
+ });
341
+ if (!confirm.button.accept) {
342
+ return;
343
+ }
334
344
  this._removingPaths.add(session.encoded_path);
335
345
  this._render();
336
346
  try {
@@ -1117,6 +1127,7 @@ export class ClaudeCodeSessionsWidget extends Widget {
1117
1127
  this._branchSubmenu = new Menu({ commands: this._commands });
1118
1128
  this._branchSubmenu.addClass('jp-ClaudeSessionsContextMenu');
1119
1129
  this._branchSubmenu.title.label = 'Switch and Manage Sessions';
1130
+ this._branchSubmenu.title.icon = switchIcon;
1120
1131
  // Submenu grouping the two branch-session launch modes.
1121
1132
  this._branchSessionMenu = new Menu({ commands: this._commands });
1122
1133
  this._branchSessionMenu.addClass('jp-ClaudeSessionsContextMenu');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jupyterlab_claude_code_extension",
3
- "version": "1.2.17",
3
+ "version": "1.2.20",
4
4
  "description": "Browse, resume, and manage your Claude Code CLI sessions from a JupyterLab side panel. One click reactivates the right terminal - no duplicate tabs, live remote-control indicator, and favourites for the projects you keep coming back to.",
5
5
  "keywords": [
6
6
  "jupyter",
package/src/icons.ts CHANGED
@@ -82,6 +82,17 @@ export const branchIcon = new LabIcon({
82
82
  svgstr: branchSvgStr
83
83
  });
84
84
 
85
+ // Arrow-switch glyph (Octicons arrow-switch-16, MIT) - marks the
86
+ // "Switch and Manage Sessions" submenu.
87
+ const switchSvgStr = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
88
+ <path class="jp-icon3" fill="#616161" d="M5.22 14.78a.75.75 0 0 0 1.06-1.06L4.56 12h8.69a.75.75 0 0 0 0-1.5H4.56l1.72-1.72a.75.75 0 0 0-1.06-1.06l-3 3a.75.75 0 0 0 0 1.06l3 3Zm5.56-6.5a.75.75 0 1 1-1.06-1.06l1.72-1.72H2.75a.75.75 0 0 1 0-1.5h8.69L9.72 2.28a.75.75 0 0 1 1.06-1.06l3 3a.75.75 0 0 1 0 1.06l-3 3Z"/>
89
+ </svg>`;
90
+
91
+ export const switchIcon = new LabIcon({
92
+ name: 'jupyterlab_claude_code_extension:switch',
93
+ svgstr: switchSvgStr
94
+ });
95
+
85
96
  // Funnel copied verbatim from @jupyterlab/ui-components'
86
97
  // `search/filter.svg` - the same image the file browser's filter
87
98
  // toggle uses. The `class="jp-icon3"` lets JupyterLab's theme drive
package/src/widget.ts CHANGED
@@ -19,6 +19,7 @@ import { requestAPI } from './request';
19
19
  import {
20
20
  addIcon,
21
21
  branchIcon,
22
+ switchIcon,
22
23
  claudeIcon,
23
24
  filterIcon,
24
25
  refreshIcon,
@@ -406,6 +407,18 @@ export class ClaudeCodeSessionsWidget extends Widget {
406
407
  }
407
408
 
408
409
  private async _remove(session: ISession): Promise<void> {
410
+ const name = this._lookupName(session);
411
+ const confirm = await showDialog({
412
+ title: 'Remove from Claude',
413
+ body:
414
+ `Remove "${name}" from Claude? This deletes the entire Claude ` +
415
+ 'project and every conversation it holds. This cannot be undone.',
416
+ buttons: [Dialog.cancelButton(), Dialog.warnButton({ label: 'Remove' })]
417
+ });
418
+ if (!confirm.button.accept) {
419
+ return;
420
+ }
421
+
409
422
  this._removingPaths.add(session.encoded_path);
410
423
  this._render();
411
424
  try {
@@ -1302,6 +1315,7 @@ export class ClaudeCodeSessionsWidget extends Widget {
1302
1315
  this._branchSubmenu = new Menu({ commands: this._commands });
1303
1316
  this._branchSubmenu.addClass('jp-ClaudeSessionsContextMenu');
1304
1317
  this._branchSubmenu.title.label = 'Switch and Manage Sessions';
1318
+ this._branchSubmenu.title.icon = switchIcon;
1305
1319
 
1306
1320
  // Submenu grouping the two branch-session launch modes.
1307
1321
  this._branchSessionMenu = new Menu({ commands: this._commands });