@notebook-intelligence/notebook-intelligence 1.3.0 → 1.3.2

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/api.js CHANGED
@@ -52,7 +52,7 @@ class NBIAPI {
52
52
  static async initializeWebsocket() {
53
53
  const serverSettings = ServerConnection.makeSettings();
54
54
  const wsUrl = URLExt.join(serverSettings.wsUrl, 'notebook-intelligence', 'copilot');
55
- this._webSocket = new WebSocket(wsUrl);
55
+ this._webSocket = new serverSettings.WebSocket(wsUrl);
56
56
  this._webSocket.onmessage = msg => {
57
57
  this._messageReceived.emit(msg.data);
58
58
  };
@@ -151,9 +151,11 @@ function ChatResponse(props) {
151
151
  };
152
152
  const markFormConfirmed = (contentId) => {
153
153
  answeredForms.set(contentId, 'confirmed');
154
+ setRenderCount(prev => prev + 1);
154
155
  };
155
156
  const markFormCanceled = (contentId) => {
156
157
  answeredForms.set(contentId, 'canceled');
158
+ setRenderCount(prev => prev + 1);
157
159
  };
158
160
  const runCommand = (commandId, args) => {
159
161
  props.getApp().commands.execute(commandId, args);
@@ -272,7 +274,7 @@ function ChatResponse(props) {
272
274
  React.createElement("a", { href: item.content.uri, target: "_blank" }, item.content.title)));
273
275
  case ResponseStreamDataType.Progress:
274
276
  // show only if no more message available
275
- return index === groupedContents.length - 1 ? (React.createElement("div", { key: `key-${index}` },
277
+ return index === groupedContents.length - 1 ? (React.createElement("div", { className: "chat-response-progress", key: `key-${index}` },
276
278
  "\u2713 ",
277
279
  item.content)) : null;
278
280
  case ResponseStreamDataType.Confirmation:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@notebook-intelligence/notebook-intelligence",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "AI coding assistant for JupyterLab",
5
5
  "keywords": [
6
6
  "AI",
package/src/api.ts CHANGED
@@ -92,7 +92,7 @@ export class NBIAPI {
92
92
  'copilot'
93
93
  );
94
94
 
95
- this._webSocket = new WebSocket(wsUrl);
95
+ this._webSocket = new serverSettings.WebSocket(wsUrl);
96
96
  this._webSocket.onmessage = msg => {
97
97
  this._messageReceived.emit(msg.data);
98
98
  };
@@ -314,9 +314,11 @@ function ChatResponse(props: any) {
314
314
 
315
315
  const markFormConfirmed = (contentId: string) => {
316
316
  answeredForms.set(contentId, 'confirmed');
317
+ setRenderCount(prev => prev + 1);
317
318
  };
318
319
  const markFormCanceled = (contentId: string) => {
319
320
  answeredForms.set(contentId, 'canceled');
321
+ setRenderCount(prev => prev + 1);
320
322
  };
321
323
 
322
324
  const runCommand = (commandId: string, args: any) => {
@@ -517,7 +519,9 @@ function ChatResponse(props: any) {
517
519
  case ResponseStreamDataType.Progress:
518
520
  // show only if no more message available
519
521
  return index === groupedContents.length - 1 ? (
520
- <div key={`key-${index}`}>&#x2713; {item.content}</div>
522
+ <div className="chat-response-progress" key={`key-${index}`}>
523
+ &#x2713; {item.content}
524
+ </div>
521
525
  ) : null;
522
526
  case ResponseStreamDataType.Confirmation:
523
527
  return answeredForms.get(item.id) ===
package/style/base.css CHANGED
@@ -275,6 +275,10 @@ pre:has(.code-block-header) {
275
275
  margin: 5px 0;
276
276
  }
277
277
 
278
+ .chat-response-progress {
279
+ margin: 5px 0;
280
+ }
281
+
278
282
  .chat-confirmation-form {
279
283
  border: 1px solid var(--jp-border-color1);
280
284
  padding: 5px;