jupyterlab_claude_code_extension 1.0.39 → 1.0.43
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/lib/widget.d.ts +0 -1
- package/lib/widget.js +8 -7
- package/package.json +1 -1
- package/src/widget.ts +9 -9
- package/style/base.css +0 -8
package/lib/widget.d.ts
CHANGED
package/lib/widget.js
CHANGED
|
@@ -149,14 +149,10 @@ export class ClaudeCodeSessionsWidget extends Widget {
|
|
|
149
149
|
});
|
|
150
150
|
const body = document.createElement('div');
|
|
151
151
|
body.className = 'jp-ClaudeSessionsPanel-body';
|
|
152
|
-
const status = document.createElement('div');
|
|
153
|
-
status.className = 'jp-ClaudeSessionsPanel-status';
|
|
154
152
|
root.appendChild(header);
|
|
155
153
|
root.appendChild(search);
|
|
156
154
|
root.appendChild(body);
|
|
157
|
-
root.appendChild(status);
|
|
158
155
|
this._bodyEl = body;
|
|
159
|
-
this._statusEl = status;
|
|
160
156
|
}
|
|
161
157
|
/** Normalise strings for filter comparison: NFD-decompose, strip combining
|
|
162
158
|
* diacritic marks, lowercase, and collapse separators (`-`, `_`, `.`, `/`,
|
|
@@ -239,18 +235,17 @@ export class ClaudeCodeSessionsWidget extends Widget {
|
|
|
239
235
|
this._fuzzyMatch(this._lookupName(s), q));
|
|
240
236
|
}
|
|
241
237
|
_showLoading() {
|
|
242
|
-
|
|
238
|
+
// No visual indicator - the spinning refresh button conveys loading state.
|
|
243
239
|
}
|
|
244
240
|
_showError(err) {
|
|
245
241
|
const message = err instanceof Error ? err.message : String(err);
|
|
246
|
-
|
|
242
|
+
console.error('[jupyterlab_claude_code_extension]', message);
|
|
247
243
|
}
|
|
248
244
|
// ------------------------------------------------------------------ data
|
|
249
245
|
async _fetch() {
|
|
250
246
|
var _a;
|
|
251
247
|
const data = await requestAPI('sessions', this._serverSettings);
|
|
252
248
|
this._sessions = (_a = data.sessions) !== null && _a !== void 0 ? _a : [];
|
|
253
|
-
this._statusEl.textContent = '';
|
|
254
249
|
this._render();
|
|
255
250
|
}
|
|
256
251
|
async _toggleFavourite(session) {
|
|
@@ -383,6 +378,12 @@ export class ClaudeCodeSessionsWidget extends Widget {
|
|
|
383
378
|
}
|
|
384
379
|
try {
|
|
385
380
|
const data = await requestAPI(`terminal-cwd/${encodeURIComponent(sessName)}`, this._serverSettings);
|
|
381
|
+
// Only reuse terminals that actually have claude running. Otherwise
|
|
382
|
+
// a plain bash opened at the project cwd would be matched and
|
|
383
|
+
// activated, swallowing the resume click without spawning claude.
|
|
384
|
+
if (!(data === null || data === void 0 ? void 0 : data.has_claude)) {
|
|
385
|
+
continue;
|
|
386
|
+
}
|
|
386
387
|
const cwds = Array.isArray(data === null || data === void 0 ? void 0 : data.cwds) ? data.cwds : [];
|
|
387
388
|
for (const cwd of cwds) {
|
|
388
389
|
if ((cwd || '').replace(/\/+$/, '') === target) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jupyterlab_claude_code_extension",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.43",
|
|
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/widget.ts
CHANGED
|
@@ -78,6 +78,7 @@ function saveExpanded(state: Record<SectionKey, boolean>): void {
|
|
|
78
78
|
interface ITerminalCwdResponse {
|
|
79
79
|
terminal_name: string;
|
|
80
80
|
cwds: string[];
|
|
81
|
+
has_claude: boolean;
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
// Drop any pre-v0.6.18 localStorage entries from previous schemes - they
|
|
@@ -190,16 +191,11 @@ export class ClaudeCodeSessionsWidget extends Widget {
|
|
|
190
191
|
const body = document.createElement('div');
|
|
191
192
|
body.className = 'jp-ClaudeSessionsPanel-body';
|
|
192
193
|
|
|
193
|
-
const status = document.createElement('div');
|
|
194
|
-
status.className = 'jp-ClaudeSessionsPanel-status';
|
|
195
|
-
|
|
196
194
|
root.appendChild(header);
|
|
197
195
|
root.appendChild(search);
|
|
198
196
|
root.appendChild(body);
|
|
199
|
-
root.appendChild(status);
|
|
200
197
|
|
|
201
198
|
this._bodyEl = body;
|
|
202
|
-
this._statusEl = status;
|
|
203
199
|
}
|
|
204
200
|
|
|
205
201
|
/** Normalise strings for filter comparison: NFD-decompose, strip combining
|
|
@@ -289,12 +285,12 @@ export class ClaudeCodeSessionsWidget extends Widget {
|
|
|
289
285
|
}
|
|
290
286
|
|
|
291
287
|
private _showLoading(): void {
|
|
292
|
-
|
|
288
|
+
// No visual indicator - the spinning refresh button conveys loading state.
|
|
293
289
|
}
|
|
294
290
|
|
|
295
291
|
private _showError(err: unknown): void {
|
|
296
292
|
const message = err instanceof Error ? err.message : String(err);
|
|
297
|
-
|
|
293
|
+
console.error('[jupyterlab_claude_code_extension]', message);
|
|
298
294
|
}
|
|
299
295
|
|
|
300
296
|
// ------------------------------------------------------------------ data
|
|
@@ -305,7 +301,6 @@ export class ClaudeCodeSessionsWidget extends Widget {
|
|
|
305
301
|
this._serverSettings
|
|
306
302
|
);
|
|
307
303
|
this._sessions = data.sessions ?? [];
|
|
308
|
-
this._statusEl.textContent = '';
|
|
309
304
|
this._render();
|
|
310
305
|
}
|
|
311
306
|
|
|
@@ -467,6 +462,12 @@ export class ClaudeCodeSessionsWidget extends Widget {
|
|
|
467
462
|
`terminal-cwd/${encodeURIComponent(sessName)}`,
|
|
468
463
|
this._serverSettings
|
|
469
464
|
);
|
|
465
|
+
// Only reuse terminals that actually have claude running. Otherwise
|
|
466
|
+
// a plain bash opened at the project cwd would be matched and
|
|
467
|
+
// activated, swallowing the resume click without spawning claude.
|
|
468
|
+
if (!data?.has_claude) {
|
|
469
|
+
continue;
|
|
470
|
+
}
|
|
470
471
|
const cwds = Array.isArray(data?.cwds) ? data.cwds : [];
|
|
471
472
|
for (const cwd of cwds) {
|
|
472
473
|
if ((cwd || '').replace(/\/+$/, '') === target) {
|
|
@@ -899,7 +900,6 @@ export class ClaudeCodeSessionsWidget extends Widget {
|
|
|
899
900
|
private readonly _app: JupyterFrontEnd;
|
|
900
901
|
private readonly _serverSettings: ServerConnection.ISettings;
|
|
901
902
|
private _bodyEl!: HTMLDivElement;
|
|
902
|
-
private _statusEl!: HTMLDivElement;
|
|
903
903
|
private _refreshBtn: HTMLButtonElement | null = null;
|
|
904
904
|
private _sessions: ISession[] | null = null;
|
|
905
905
|
private _expanded: Record<SectionKey, boolean> = loadExpanded();
|
package/style/base.css
CHANGED
|
@@ -88,14 +88,6 @@
|
|
|
88
88
|
min-height: 0;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
.jp-ClaudeSessionsPanel-status {
|
|
92
|
-
flex: 0 0 auto;
|
|
93
|
-
padding: 4px 8px;
|
|
94
|
-
font-size: var(--jp-ui-font-size0);
|
|
95
|
-
color: var(--jp-warn-color1);
|
|
96
|
-
min-height: 14px;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
91
|
.jp-ClaudeSessionsPanel-empty,
|
|
100
92
|
.jp-ClaudeSessionsPanel-emptySection {
|
|
101
93
|
padding: 8px 12px;
|