@notebook-intelligence/notebook-intelligence 1.3.3 → 1.3.4

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
@@ -11,10 +11,16 @@ See blog posts for features and usage.
11
11
 
12
12
  ### Code generation with inline chat
13
13
 
14
+ Use the sparkle icon on cell toolbar or the keyboard shortcuts to show the inline chat popover.
15
+
16
+ Keyboard shortcuts: `Ctrl + G` / `Cmd + G` is the shortcut to show the inline chat popover and `Ctrl + Enter` / `Cmd + Enter` is the shortcut to accept the suggestion. Clicking `Escape` key closes the popover.
17
+
14
18
  ![Generate code](media/generate-code.gif)
15
19
 
16
20
  ### Auto-complete
17
21
 
22
+ Auto-complete suggestions are shown as you type. Clicking `Tab` key accepts the suggestion. NBI provides auto-complete suggestions in code cells and Python file editors.
23
+
18
24
  <img src="media/inline-completion.gif" alt="Auto-complete" width=700 />
19
25
 
20
26
  ### Chat interface
package/lib/index.js CHANGED
@@ -759,7 +759,19 @@ const plugin = {
759
759
  return editorRect;
760
760
  }
761
761
  const yOffset = 30;
762
- const rect = new DOMRect(editorRect.left, coords.top - yOffset, editorRect.right - editorRect.left, coords.bottom - coords.top);
762
+ const diffViewHeight = 300;
763
+ let top = coords.top - yOffset;
764
+ const height = coords.bottom - coords.top;
765
+ // adjust top to fit in file editor rect
766
+ if (!isCodeCell) {
767
+ if (top + height + diffViewHeight > editorRect.bottom) {
768
+ top = editorRect.bottom - height - diffViewHeight;
769
+ if (top < editorRect.top) {
770
+ top = editorRect.top;
771
+ }
772
+ }
773
+ }
774
+ const rect = new DOMRect(editorRect.left, top, editorRect.right - editorRect.left, height);
763
775
  return rect;
764
776
  };
765
777
  const rect = getRectAtCursor();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@notebook-intelligence/notebook-intelligence",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "AI coding assistant for JupyterLab",
5
5
  "keywords": [
6
6
  "AI",
package/src/index.ts CHANGED
@@ -1018,12 +1018,28 @@ const plugin: JupyterFrontEndPlugin<INotebookIntelligence> = {
1018
1018
  return editorRect;
1019
1019
  }
1020
1020
  const yOffset = 30;
1021
+ const diffViewHeight = 300;
1022
+
1023
+ let top = coords.top - yOffset;
1024
+ const height = coords.bottom - coords.top;
1025
+
1026
+ // adjust top to fit in file editor rect
1027
+ if (!isCodeCell) {
1028
+ if (top + height + diffViewHeight > editorRect.bottom) {
1029
+ top = editorRect.bottom - height - diffViewHeight;
1030
+ if (top < editorRect.top) {
1031
+ top = editorRect.top;
1032
+ }
1033
+ }
1034
+ }
1035
+
1021
1036
  const rect: DOMRect = new DOMRect(
1022
1037
  editorRect.left,
1023
- coords.top - yOffset,
1038
+ top,
1024
1039
  editorRect.right - editorRect.left,
1025
- coords.bottom - coords.top
1040
+ height
1026
1041
  );
1042
+
1027
1043
  return rect;
1028
1044
  };
1029
1045