xtralab 0.14.1 → 0.15.1

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.
Files changed (236) hide show
  1. package/README.md +10 -0
  2. package/lib/about/icons.d.ts +0 -5
  3. package/lib/about/icons.js +0 -5
  4. package/lib/about/index.d.ts +4 -8
  5. package/lib/about/index.js +6 -17
  6. package/lib/agentSessions.d.ts +9 -29
  7. package/lib/agentSessions.js +2 -7
  8. package/lib/askAgent/editorSelection.d.ts +20 -26
  9. package/lib/askAgent/editorSelection.js +11 -26
  10. package/lib/askAgent/icons.d.ts +2 -3
  11. package/lib/askAgent/icons.js +2 -3
  12. package/lib/askAgent/index.d.ts +4 -26
  13. package/lib/askAgent/index.js +54 -158
  14. package/lib/askAgent/popup.d.ts +12 -16
  15. package/lib/askAgent/popup.js +18 -37
  16. package/lib/askAgent/prompt.d.ts +3 -5
  17. package/lib/askAgent/prompt.js +6 -19
  18. package/lib/askAgent/queue.d.ts +11 -21
  19. package/lib/askAgent/queue.js +9 -19
  20. package/lib/askAgent/queuePanel.d.ts +13 -18
  21. package/lib/askAgent/queuePanel.js +15 -37
  22. package/lib/askAgent/targetPicker.d.ts +2 -9
  23. package/lib/askAgent/targetPicker.js +6 -11
  24. package/lib/askAgent/tokens.d.ts +32 -46
  25. package/lib/askAgent/tokens.js +4 -6
  26. package/lib/commandBar/index.d.ts +4 -13
  27. package/lib/commandBar/index.js +21 -39
  28. package/lib/customPanel/index.d.ts +7 -0
  29. package/lib/customPanel/index.js +89 -0
  30. package/lib/editorBreadcrumbs/index.d.ts +3 -6
  31. package/lib/editorBreadcrumbs/index.js +10 -6
  32. package/lib/editorBreadcrumbs/widget.d.ts +17 -4
  33. package/lib/editorBreadcrumbs/widget.js +11 -17
  34. package/lib/editorIndent/index.d.ts +4 -12
  35. package/lib/editorIndent/index.js +8 -23
  36. package/lib/fileBrowser/commands.d.ts +28 -19
  37. package/lib/fileBrowser/commands.js +51 -98
  38. package/lib/fileBrowser/contents.d.ts +14 -0
  39. package/lib/fileBrowser/contents.js +28 -0
  40. package/lib/fileBrowser/dragAndDrop.d.ts +79 -0
  41. package/lib/fileBrowser/dragAndDrop.js +110 -0
  42. package/lib/fileBrowser/fileBrowser.d.ts +21 -9
  43. package/lib/fileBrowser/fileBrowser.js +211 -405
  44. package/lib/fileBrowser/gitStatus.d.ts +4 -9
  45. package/lib/fileBrowser/gitStatus.js +7 -17
  46. package/lib/fileBrowser/gitignore.d.ts +4 -17
  47. package/lib/fileBrowser/gitignore.js +4 -25
  48. package/lib/fileBrowser/icons.d.ts +7 -17
  49. package/lib/fileBrowser/icons.js +25 -80
  50. package/lib/fileBrowser/index.js +41 -10
  51. package/lib/fileBrowser/widget.d.ts +170 -53
  52. package/lib/fileBrowser/widget.js +242 -18
  53. package/lib/fileTypeIcons/index.js +0 -10
  54. package/lib/git/api.d.ts +5 -13
  55. package/lib/git/api.js +10 -36
  56. package/lib/git/askRequest.d.ts +4 -8
  57. package/lib/git/askRequest.js +6 -20
  58. package/lib/git/commands.d.ts +40 -5
  59. package/lib/git/commands.js +16 -10
  60. package/lib/git/diffModel.js +4 -0
  61. package/lib/git/diffSurface.d.ts +41 -55
  62. package/lib/git/diffSurface.js +42 -117
  63. package/lib/git/diffWidget.d.ts +81 -2
  64. package/lib/git/diffWidget.js +62 -12
  65. package/lib/git/imageDiff.d.ts +5 -6
  66. package/lib/git/imageDiff.js +18 -48
  67. package/lib/git/index.d.ts +0 -3
  68. package/lib/git/index.js +3 -8
  69. package/lib/git/notebookDiff.d.ts +110 -33
  70. package/lib/git/notebookDiff.js +52 -195
  71. package/lib/git/tokens.d.ts +73 -31
  72. package/lib/git/tokens.js +2 -3
  73. package/lib/highlight/index.d.ts +4 -10
  74. package/lib/highlight/index.js +10 -41
  75. package/lib/index.d.ts +0 -9
  76. package/lib/index.js +2 -9
  77. package/lib/launcher/agents.d.ts +55 -51
  78. package/lib/launcher/agents.js +25 -54
  79. package/lib/launcher/availability.d.ts +3 -9
  80. package/lib/launcher/availability.js +3 -9
  81. package/lib/launcher/commands.d.ts +7 -32
  82. package/lib/launcher/commands.js +14 -45
  83. package/lib/launcher/dashboard.d.ts +19 -24
  84. package/lib/launcher/dashboard.js +21 -67
  85. package/lib/launcher/editorRegistry.d.ts +10 -22
  86. package/lib/launcher/editorRegistry.js +14 -18
  87. package/lib/launcher/editors.d.ts +39 -45
  88. package/lib/launcher/editors.js +8 -34
  89. package/lib/launcher/icons.d.ts +0 -12
  90. package/lib/launcher/icons.js +14 -37
  91. package/lib/launcher/index.js +12 -55
  92. package/lib/launcher/invocation.d.ts +4 -10
  93. package/lib/launcher/invocation.js +7 -22
  94. package/lib/launcher/registry.d.ts +9 -7
  95. package/lib/launcher/registry.js +9 -7
  96. package/lib/launcher/schemaDefaults.d.ts +2 -9
  97. package/lib/launcher/schemaDefaults.js +37 -13
  98. package/lib/launcher/tokens.d.ts +10 -22
  99. package/lib/launcher/tokens.js +5 -8
  100. package/lib/menuBar/index.d.ts +3 -10
  101. package/lib/menuBar/index.js +11 -28
  102. package/lib/menus/index.d.ts +3 -9
  103. package/lib/menus/index.js +14 -30
  104. package/lib/omnibox/files.d.ts +2 -4
  105. package/lib/omnibox/files.js +5 -11
  106. package/lib/omnibox/index.d.ts +4 -14
  107. package/lib/omnibox/index.js +9 -27
  108. package/lib/omnibox/model.d.ts +38 -10
  109. package/lib/omnibox/model.js +15 -33
  110. package/lib/omnibox/recents.d.ts +15 -17
  111. package/lib/omnibox/recents.js +12 -17
  112. package/lib/omnibox/tokens.d.ts +5 -10
  113. package/lib/omnibox/tokens.js +2 -6
  114. package/lib/omnibox/widget.d.ts +11 -7
  115. package/lib/omnibox/widget.js +8 -16
  116. package/lib/searchReplace/index.d.ts +4 -20
  117. package/lib/searchReplace/index.js +7 -27
  118. package/lib/showOutput/index.d.ts +3 -12
  119. package/lib/showOutput/index.js +6 -22
  120. package/lib/sidebar/index.d.ts +4 -13
  121. package/lib/sidebar/index.js +73 -46
  122. package/lib/terminalNotifications/index.d.ts +4 -10
  123. package/lib/terminalNotifications/index.js +6 -20
  124. package/lib/terminals/agentTerminals.d.ts +12 -5
  125. package/lib/terminals/agentTerminals.js +25 -44
  126. package/lib/terminals/detection.d.ts +4 -8
  127. package/lib/terminals/detection.js +4 -8
  128. package/lib/terminals/index.d.ts +0 -33
  129. package/lib/terminals/index.js +24 -102
  130. package/lib/terminals/model.d.ts +64 -139
  131. package/lib/terminals/model.js +80 -220
  132. package/lib/terminals/tokens.d.ts +11 -22
  133. package/lib/terminals/tokens.js +2 -2
  134. package/lib/terminals/widget.d.ts +72 -38
  135. package/lib/terminals/widget.js +173 -73
  136. package/lib/topBar/icons.d.ts +3 -8
  137. package/lib/topBar/icons.js +3 -8
  138. package/lib/topBar/index.d.ts +4 -11
  139. package/lib/topBar/index.js +10 -38
  140. package/lib/walkthrough/index.d.ts +4 -9
  141. package/lib/walkthrough/index.js +6 -20
  142. package/lib/walkthrough/panel.d.ts +40 -9
  143. package/lib/walkthrough/panel.js +4 -10
  144. package/package.json +2 -2
  145. package/schema/launcher.json +2 -2
  146. package/schema/sidebar.json +47 -7
  147. package/src/about/icons.ts +0 -5
  148. package/src/about/index.tsx +6 -17
  149. package/src/agentSessions.ts +9 -29
  150. package/src/askAgent/editorSelection.ts +22 -29
  151. package/src/askAgent/icons.ts +2 -3
  152. package/src/askAgent/index.ts +54 -158
  153. package/src/askAgent/popup.tsx +23 -45
  154. package/src/askAgent/prompt.ts +6 -19
  155. package/src/askAgent/queue.ts +13 -24
  156. package/src/askAgent/queuePanel.tsx +21 -46
  157. package/src/askAgent/targetPicker.tsx +5 -15
  158. package/src/askAgent/tokens.ts +32 -46
  159. package/src/commandBar/index.ts +24 -39
  160. package/src/customPanel/index.ts +119 -0
  161. package/src/editorBreadcrumbs/index.ts +10 -6
  162. package/src/editorBreadcrumbs/widget.ts +23 -17
  163. package/src/editorIndent/index.ts +17 -23
  164. package/src/fileBrowser/commands.ts +70 -98
  165. package/src/fileBrowser/contents.ts +33 -0
  166. package/src/fileBrowser/dragAndDrop.ts +188 -0
  167. package/src/fileBrowser/fileBrowser.tsx +259 -440
  168. package/src/fileBrowser/gitStatus.ts +7 -17
  169. package/src/fileBrowser/gitignore.ts +4 -25
  170. package/src/fileBrowser/icons.ts +25 -80
  171. package/src/fileBrowser/index.ts +43 -10
  172. package/src/fileBrowser/widget.tsx +344 -64
  173. package/src/fileTypeIcons/index.ts +0 -10
  174. package/src/git/api.ts +10 -36
  175. package/src/git/askRequest.ts +6 -20
  176. package/src/git/commands.ts +70 -10
  177. package/src/git/diffModel.ts +25 -0
  178. package/src/git/diffSurface.tsx +71 -159
  179. package/src/git/diffWidget.tsx +104 -14
  180. package/src/git/imageDiff.tsx +45 -51
  181. package/src/git/index.ts +3 -8
  182. package/src/git/notebookDiff.tsx +211 -238
  183. package/src/git/tokens.ts +73 -31
  184. package/src/highlight/index.ts +10 -41
  185. package/src/index.ts +2 -9
  186. package/src/launcher/agents.ts +74 -92
  187. package/src/launcher/availability.ts +3 -9
  188. package/src/launcher/commands.ts +14 -51
  189. package/src/launcher/dashboard.tsx +49 -88
  190. package/src/launcher/editorRegistry.ts +21 -29
  191. package/src/launcher/editors.ts +39 -58
  192. package/src/launcher/icons.ts +15 -37
  193. package/src/launcher/index.ts +12 -55
  194. package/src/launcher/invocation.ts +7 -22
  195. package/src/launcher/registry.ts +9 -7
  196. package/src/launcher/schemaDefaults.ts +43 -13
  197. package/src/launcher/tokens.ts +10 -22
  198. package/src/menuBar/index.ts +11 -28
  199. package/src/menus/index.ts +14 -30
  200. package/src/omnibox/files.ts +10 -14
  201. package/src/omnibox/index.ts +9 -27
  202. package/src/omnibox/model.ts +50 -38
  203. package/src/omnibox/recents.ts +17 -22
  204. package/src/omnibox/tokens.ts +5 -10
  205. package/src/omnibox/widget.tsx +14 -19
  206. package/src/searchReplace/index.ts +7 -27
  207. package/src/showOutput/index.ts +6 -22
  208. package/src/sidebar/index.ts +103 -52
  209. package/src/terminalNotifications/index.ts +42 -25
  210. package/src/terminals/agentTerminals.ts +25 -49
  211. package/src/terminals/detection.ts +4 -8
  212. package/src/terminals/index.ts +31 -102
  213. package/src/terminals/model.ts +130 -246
  214. package/src/terminals/tokens.ts +11 -22
  215. package/src/terminals/widget.tsx +229 -113
  216. package/src/topBar/icons.ts +3 -8
  217. package/src/topBar/index.ts +21 -44
  218. package/src/walkthrough/index.ts +6 -20
  219. package/src/walkthrough/panel.ts +40 -10
  220. package/style/about.css +2 -7
  221. package/style/askAgent.css +8 -40
  222. package/style/base.css +25 -73
  223. package/style/chrome.css +108 -308
  224. package/style/commandBar.css +4 -20
  225. package/style/customPanel.css +6 -0
  226. package/style/git.css +22 -184
  227. package/style/highlight.css +1 -3
  228. package/style/index.js +1 -0
  229. package/style/launcher.css +6 -70
  230. package/style/omnibox.css +2 -14
  231. package/style/showOutput.css +0 -6
  232. package/style/sidebar.css +29 -9
  233. package/style/tabs.css +5 -13
  234. package/style/terminals.css +18 -123
  235. package/style/topBar.css +2 -22
  236. package/style/walkthrough.css +0 -8
@@ -8,35 +8,67 @@ import { Panel } from '@lumino/widgets';
8
8
  * A rich visual embedded in a step (rendered through the rendermime registry).
9
9
  */
10
10
  export interface IWalkthroughMedia {
11
+ /**
12
+ * The MIME type of the media payload.
13
+ */
11
14
  mimeType: string;
15
+ /**
16
+ * The payload handed to the renderer for the MIME type.
17
+ */
12
18
  data: ReadonlyPartialJSONValue;
13
19
  }
14
20
  /**
15
21
  * One step of a walkthrough. Every field is optional, but a step needs at least one.
16
22
  */
17
23
  export interface IWalkthroughStep {
24
+ /**
25
+ * A heading rendered above the step content.
26
+ */
18
27
  title?: string;
28
+ /**
29
+ * The body of the step, rendered as Markdown.
30
+ */
19
31
  body?: string;
32
+ /**
33
+ * A rich visual rendered after the body.
34
+ */
20
35
  media?: IWalkthroughMedia;
36
+ /**
37
+ * The file the step points at; when set, the step renders a jump link.
38
+ */
21
39
  path?: string;
40
+ /**
41
+ * The first line to highlight when the jump link is followed.
42
+ */
22
43
  line?: number;
44
+ /**
45
+ * The last line of the highlighted range.
46
+ */
23
47
  endLine?: number;
24
48
  }
25
49
  export declare namespace WalkthroughPanel {
50
+ /**
51
+ * The instantiation options for a walkthrough panel.
52
+ */
26
53
  interface IOptions {
54
+ /**
55
+ * The rendermime registry used to render step bodies and media.
56
+ */
27
57
  rendermime: IRenderMimeRegistry;
58
+ /**
59
+ * The command registry used to execute the jump-to-line command.
60
+ */
28
61
  commands: CommandRegistry;
62
+ /**
63
+ * The translation bundle for UI strings.
64
+ */
29
65
  trans: TranslationBundle;
30
66
  }
31
67
  }
32
68
  /**
33
69
  * A read-only, scrollable column of walkthrough steps for the side area.
34
- *
35
- * The agent appends steps as it narrates, so the explanation lives beside the
36
- * code the user is looking at and persists for them to read at their own pace,
37
- * rather than scrolling away in the chat. Each step renders Markdown (with code
38
- * snippets, Mermaid, math), can embed a rich visual, and can offer a button
39
- * that opens the referenced file and highlights its lines.
70
+ * The agent appends steps as it narrates, so the explanation persists beside
71
+ * the code instead of scrolling away in the chat.
40
72
  */
41
73
  export declare class WalkthroughPanel extends Panel {
42
74
  constructor(options: WalkthroughPanel.IOptions);
@@ -45,9 +77,8 @@ export declare class WalkthroughPanel extends Panel {
45
77
  */
46
78
  clear(): void;
47
79
  /**
48
- * Dispose on close (e.g. the close button when the panel has been dragged to
49
- * the main area) rather than leaving a detached, reusable widget behind. The
50
- * next `xtralab:walkthrough` call recreates the panel in the side area.
80
+ * Dispose on close (e.g. after a drag to the main area) instead of leaving a
81
+ * detached widget; the next `xtralab:walkthrough` call recreates the panel.
51
82
  */
52
83
  protected onCloseRequest(msg: Message): void;
53
84
  /**
@@ -6,12 +6,8 @@ import { Panel, Widget } from '@lumino/widgets';
6
6
  const HIGHLIGHT_LINES_COMMAND = 'xtralab:highlight-lines';
7
7
  /**
8
8
  * A read-only, scrollable column of walkthrough steps for the side area.
9
- *
10
- * The agent appends steps as it narrates, so the explanation lives beside the
11
- * code the user is looking at and persists for them to read at their own pace,
12
- * rather than scrolling away in the chat. Each step renders Markdown (with code
13
- * snippets, Mermaid, math), can embed a rich visual, and can offer a button
14
- * that opens the referenced file and highlights its lines.
9
+ * The agent appends steps as it narrates, so the explanation persists beside
10
+ * the code instead of scrolling away in the chat.
15
11
  */
16
12
  export class WalkthroughPanel extends Panel {
17
13
  constructor(options) {
@@ -30,9 +26,8 @@ export class WalkthroughPanel extends Panel {
30
26
  }
31
27
  }
32
28
  /**
33
- * Dispose on close (e.g. the close button when the panel has been dragged to
34
- * the main area) rather than leaving a detached, reusable widget behind. The
35
- * next `xtralab:walkthrough` call recreates the panel in the side area.
29
+ * Dispose on close (e.g. after a drag to the main area) instead of leaving a
30
+ * detached widget; the next `xtralab:walkthrough` call recreates the panel.
36
31
  */
37
32
  onCloseRequest(msg) {
38
33
  super.onCloseRequest(msg);
@@ -60,7 +55,6 @@ export class WalkthroughPanel extends Panel {
60
55
  if (step.path) {
61
56
  card.addWidget(this._jumpButton(step.path, step.line, step.endLine));
62
57
  }
63
- // Bring the newest step into view.
64
58
  this.node.scrollTop = this.node.scrollHeight;
65
59
  }
66
60
  async _render(parent, mimeType, data) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtralab",
3
- "version": "0.14.1",
3
+ "version": "0.15.1",
4
4
  "description": "An opinionated JupyterLab meta-package that bundles a curated set of extensions, ships a path-first file browser, renders jupyterlab-git's text, notebook and image diffs with its own viewers, and applies a quieter default workspace configuration.",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -90,7 +90,7 @@
90
90
  "@lumino/polling": "^2.1.5",
91
91
  "@lumino/signaling": "^2.1.5",
92
92
  "@lumino/widgets": "^2.8.0",
93
- "@pierre/diffs": "^1.2.11",
93
+ "@pierre/diffs": "^1.4.1",
94
94
  "@pierre/trees": "1.0.0-beta.4",
95
95
  "detect-indent": "^7.0.2",
96
96
  "ignore": "^5.3.2",
@@ -8,7 +8,7 @@
8
8
  "properties": {
9
9
  "agents": {
10
10
  "title": "Agents",
11
- "description": "Override or extend the built-in list of agents shown on the launcher. Each entry must include an `id`. When the id matches a built-in (claude, codex, antigravity, copilot, goose, opencode, kiro, mistral-vibe), the fields you set override the corresponding defaults; leave a field out to keep the default. New ids define brand-new cards. Set `enabled: false` to hide a default. Changing a built-in's `command` (for example to a shell alias like `ccm`) keeps the card visible even though the alias isn't on PATH; use `requireAvailable: false` only when you want to skip the check without changing the command. The full built-in list is shown as the default below, so you can copy an entry and tweak it in place.",
11
+ "description": "Override or extend the built-in list of agents shown on the launcher. Each entry must include an `id`. When the id matches a built-in (claude, codex, antigravity, copilot, goose, opencode, kiro, mistral-vibe, pi), the fields you set override the corresponding defaults; leave a field out to keep the default. New ids define brand-new cards. Set `enabled: false` to hide a default. Changing a built-in's `command` (for example to a shell alias like `ccm`) keeps the card visible even though the alias isn't on PATH; use `requireAvailable: false` only when you want to skip the check without changing the command. The full built-in list is shown as the default below, so you can copy an entry and tweak it in place. Saved entries are merged into the built-in list by id, so this settings view always shows every built-in agent alongside your overrides.",
12
12
  "type": "array",
13
13
  "default": [],
14
14
  "items": {
@@ -69,7 +69,7 @@
69
69
  },
70
70
  "editors": {
71
71
  "title": "Editors",
72
- "description": "Override or extend the terminal editors offered in the launcher's Open section (and recognized in the Terminals panel). Each entry must include an `id`. When the id matches a built-in (nvim, vim), the fields you set override the corresponding defaults; leave a field out to keep the default. New ids define additional editors. The launcher shows a single tile — the first editor, by `rank`, whose `command` is on PATH (Neovim before Vim by default). Set `enabled: false` to hide a built-in; disable both to remove the tile entirely. Changing a built-in's `command` (for example to a shell alias) keeps the tile visible even though the alias isn't on PATH; use `requireAvailable: false` only when you want to skip the check without changing the command. The full built-in list is shown as the default below, so you can copy an entry and tweak it in place.",
72
+ "description": "Override or extend the terminal editors offered in the launcher's Open section (and recognized in the Terminals panel). Each entry must include an `id`. When the id matches a built-in (nvim, vim), the fields you set override the corresponding defaults; leave a field out to keep the default. New ids define additional editors. The launcher shows a single tile — the first editor, by `rank`, whose `command` is on PATH (Neovim before Vim by default). Set `enabled: false` to hide a built-in; disable both to remove the tile entirely. Changing a built-in's `command` (for example to a shell alias) keeps the tile visible even though the alias isn't on PATH; use `requireAvailable: false` only when you want to skip the check without changing the command. The full built-in list is shown as the default below, so you can copy an entry and tweak it in place. Saved entries are merged into the built-in list by id, so this settings view always shows every built-in editor alongside your overrides.",
73
73
  "type": "array",
74
74
  "default": [],
75
75
  "items": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "title": "xtralab sidebar",
3
- "description": "Visibility of selected JupyterLab sidebar tabs.",
3
+ "description": "Visibility of individual sidebar tabs.",
4
4
  "jupyter.lab.shortcuts": [],
5
5
  "jupyter.lab.menus": {
6
6
  "main": [
@@ -17,16 +17,32 @@
17
17
  "type": "submenu",
18
18
  "rank": 12.5,
19
19
  "submenu": {
20
- "id": "jp-mainmenu-view-appearance-left-sidebar",
21
- "label": "Left Sidebar",
20
+ "id": "jp-mainmenu-view-appearance-sidebars",
21
+ "label": "Sidebars",
22
22
  "items": [
23
23
  {
24
- "command": "xtralab:toggle-default-filebrowser",
24
+ "command": "xtralab:toggle-terminals",
25
25
  "rank": 1
26
26
  },
27
27
  {
28
- "command": "xtralab:toggle-running-sessions",
28
+ "command": "xtralab:toggle-file-browser",
29
29
  "rank": 2
30
+ },
31
+ {
32
+ "command": "xtralab:toggle-git-panel",
33
+ "rank": 3
34
+ },
35
+ {
36
+ "command": "xtralab:toggle-default-filebrowser",
37
+ "rank": 4
38
+ },
39
+ {
40
+ "command": "xtralab:toggle-running-sessions",
41
+ "rank": 5
42
+ },
43
+ {
44
+ "command": "xtralab:toggle-search-replace",
45
+ "rank": 6
30
46
  }
31
47
  ]
32
48
  }
@@ -40,16 +56,40 @@
40
56
  },
41
57
  "type": "object",
42
58
  "properties": {
59
+ "showTerminals": {
60
+ "type": "boolean",
61
+ "title": "Show the terminals panel",
62
+ "description": "When false, hides the xtralab Terminals (`xtralab-running-terminals`) tab from the sidebar.",
63
+ "default": true
64
+ },
65
+ "showFileBrowser": {
66
+ "type": "boolean",
67
+ "title": "Show the xtralab file browser",
68
+ "description": "When false, hides the xtralab file browser (`xtralab:file-browser`) tab from the sidebar. The default JupyterLab file browser is unaffected.",
69
+ "default": true
70
+ },
71
+ "showGitPanel": {
72
+ "type": "boolean",
73
+ "title": "Show the Git panel",
74
+ "description": "When false, hides the `jp-git-sessions` (Git) tab from the sidebar.",
75
+ "default": true
76
+ },
43
77
  "showDefaultFileBrowser": {
44
78
  "type": "boolean",
45
79
  "title": "Show the default JupyterLab file browser",
46
- "description": "When false, hides the default `filebrowser` tab from the left sidebar. The xtralab file browser is unaffected.",
80
+ "description": "When false, hides the default `filebrowser` tab from the sidebar. The xtralab file browser is unaffected.",
47
81
  "default": true
48
82
  },
49
83
  "showRunningSessions": {
50
84
  "type": "boolean",
51
85
  "title": "Show running terminals and kernels",
52
- "description": "When false, hides the `jp-running-sessions` (Running Terminals and Kernels) tab from the left sidebar.",
86
+ "description": "When false, hides the `jp-running-sessions` (Running Terminals and Kernels) tab from the sidebar.",
87
+ "default": true
88
+ },
89
+ "showSearchReplace": {
90
+ "type": "boolean",
91
+ "title": "Show search and replace",
92
+ "description": "When false, hides the `jp-search-replace` (Search and Replace) tab from the sidebar.",
53
93
  "default": true
54
94
  }
55
95
  },
@@ -2,11 +2,6 @@ import { LabIcon } from '@jupyterlab/ui-components';
2
2
 
3
3
  import logoSvgstr from '../../logo.svg';
4
4
 
5
- /**
6
- * The project logo mark — `logo.svg` at the repository root, the same file
7
- * the README and the docs site use. The labextension build inlines it as a
8
- * raw string, so the dialog always shows the current artwork.
9
- */
10
5
  export const aboutLogoIcon = new LabIcon({
11
6
  name: 'xtralab:about-logo',
12
7
  svgstr: logoSvgstr
@@ -11,11 +11,6 @@ import { aboutLogoIcon } from './icons';
11
11
 
12
12
  const PLUGIN_ID = 'xtralab:about';
13
13
 
14
- /**
15
- * Upstream command id. Reusing it keeps the Help menu entry (contributed by
16
- * `schema/about.json` at the same rank as upstream), the command palette
17
- * muscle memory, and any external caller of `help:about` working.
18
- */
19
14
  const CommandIDs = {
20
15
  about: 'help:about'
21
16
  };
@@ -23,14 +18,10 @@ const CommandIDs = {
23
18
  const REPO_URL = 'https://github.com/jtpio/xtralab';
24
19
 
25
20
  /**
26
- * An "About xtralab" dialog replacing the stock "About JupyterLab" one.
27
- *
28
- * The upstream `@jupyterlab/help-extension:about` plugin is disabled via
29
- * `jupyterlab.disabledExtensions` (package.json), which removes both its
30
- * `help:about` command and its Help menu contribution; this plugin registers
31
- * the same command id and restores the menu entry through its own schema.
32
- * The dialog leads with the xtralab version and keeps the underlying
33
- * JupyterLab version visible underneath.
21
+ * An "About xtralab" dialog replacing the stock "About JupyterLab" one. The
22
+ * upstream plugin is disabled via `jupyterlab.disabledExtensions`, which also
23
+ * removes its Help menu entry; this plugin re-registers `help:about` and
24
+ * restores the menu entry through its own schema.
34
25
  */
35
26
  const plugin: JupyterFrontEndPlugin<void> = {
36
27
  id: PLUGIN_ID,
@@ -56,10 +47,8 @@ const plugin: JupyterFrontEndPlugin<void> = {
56
47
  }
57
48
  },
58
49
  execute: async () => {
59
- // The settings payload carries the version of the installed
60
- // labextension (read server-side from its package.json), which is
61
- // the release actually running — the page config only knows the
62
- // JupyterLab version. 'N/A' is jupyterlab_server's not-found value.
50
+ // The settings payload carries the installed labextension's version
51
+ // (page config only knows JupyterLab's); 'N/A' is jupyterlab_server's not-found value.
63
52
  const version = await settingRegistry
64
53
  .load(PLUGIN_ID)
65
54
  .then(settings =>
@@ -3,28 +3,14 @@ import { Token } from '@lumino/coreutils';
3
3
  import { ISignal, Signal } from '@lumino/signaling';
4
4
 
5
5
  /**
6
- * A shared map from a terminal session name to the agent command it was
7
- * *launched* with (e.g. `claude`).
8
- *
9
- * This is the optimistic half of the running-agent badge: when the launcher
10
- * (or the terminals panel's `+` menu) starts an agent via a
11
- * `xtralab:start-agent:<id>` command, it records the session here so the
12
- * panel can show the agent's logo immediately, before the server-side
13
- * process detection has had a chance to confirm it. Server detection is the
14
- * authoritative source once it reports on a session; this tag only fills the
15
- * gap right after launch (and serves as a fallback if detection is
16
- * unavailable).
17
- *
18
- * It exists as its own token, provided by a tiny dependency-free plugin,
19
- * specifically so the launcher (the writer) and the terminals panel (the
20
- * reader) can share it without depending on each other — a direct
21
- * launcher↔terminals token pair would form an activation cycle.
6
+ * Shared map from terminal session name to the agent command it was launched
7
+ * with — the optimistic half of the running-agent badge, shown until server
8
+ * detection confirms. Its own token so the launcher (writer) and terminals
9
+ * panel (reader) can share it without an activation cycle.
22
10
  */
23
11
  export interface IAgentSessions {
24
12
  /**
25
- * The agent command a session was launched with, or `null` if we never
26
- * launched an agent into it (e.g. a plain terminal, or one started before
27
- * this ran).
13
+ * The agent command a session was launched with, or `null` if unknown.
28
14
  */
29
15
  get(sessionName: string): string | null;
30
16
 
@@ -34,21 +20,16 @@ export interface IAgentSessions {
34
20
  set(sessionName: string, command: string): void;
35
21
 
36
22
  /**
37
- * Forget a session — called when it shuts down so the map stays bounded.
23
+ * Forget a session so the map stays bounded.
38
24
  */
39
25
  delete(sessionName: string): void;
40
26
 
41
27
  /**
42
- * Emitted with the affected session name whenever a record is added or
43
- * removed, so readers can re-render.
28
+ * Emitted with the session name whenever a record is added or removed.
44
29
  */
45
30
  readonly changed: ISignal<IAgentSessions, string>;
46
31
  }
47
32
 
48
- /**
49
- * DI token for {@link IAgentSessions}. Provided by `xtralab:agent-sessions`;
50
- * consumed (optionally) by both `xtralab:launcher` and `xtralab:terminals`.
51
- */
52
33
  export const IAgentSessions = new Token<IAgentSessions>(
53
34
  'xtralab:IAgentSessions',
54
35
  'A shared map from terminal session name to the agent command it was launched with.'
@@ -82,9 +63,8 @@ class AgentSessions implements IAgentSessions {
82
63
  }
83
64
 
84
65
  /**
85
- * Provides {@link IAgentSessions}. Deliberately has no dependencies so it can
86
- * sit underneath both the launcher and the terminals panel without creating
87
- * a dependency cycle between them.
66
+ * Provides {@link IAgentSessions}; dependency-free so it can sit underneath
67
+ * both the launcher and the terminals panel.
88
68
  */
89
69
  const plugin: JupyterFrontEndPlugin<IAgentSessions> = {
90
70
  id: 'xtralab:agent-sessions',
@@ -8,13 +8,21 @@ import type { Widget } from '@lumino/widgets';
8
8
  import type { IAskAgentContext, IAskAgentRequest } from './tokens';
9
9
 
10
10
  /**
11
- * A CodeMirror view a selection can be asked about, plus the context needed
12
- * to describe it to an agent: the document path and, for notebooks, which
13
- * cell the view belongs to.
11
+ * A CodeMirror view a selection can be asked about, plus the document path
12
+ * and, for notebooks, the owning cell.
14
13
  */
15
14
  interface IEditorTarget {
15
+ /**
16
+ * The CodeMirror view holding the selection.
17
+ */
16
18
  view: EditorView;
19
+ /**
20
+ * The path of the document the view belongs to.
21
+ */
17
22
  path: string;
23
+ /**
24
+ * The index and type of the owning notebook cell; absent for file editors.
25
+ */
18
26
  cell?: {
19
27
  index: number;
20
28
  type: string;
@@ -22,19 +30,10 @@ interface IEditorTarget {
22
30
  }
23
31
 
24
32
  /**
25
- * Resolve the CodeMirror view a selection in `widget` would live in, or
26
- * `null` when the widget holds no such editor. Two widget shapes are
27
- * recognized:
28
- *
29
- * - a notebook panel, where the active cell carries the editor and
30
- * `activeCellIndex` names its 0-based position in the nbformat `cells`
31
- * array. A rendered markdown cell keeps its (hidden) editor, but a
32
- * selection in the rendered HTML never passes {@link domSelectionInView},
33
- * so no pill appears there; and
34
- * - a document widget whose content is a `FileEditor`. The wrapper is not
35
- * checked with `instanceof DocumentWidget`: `@jupyterlab/docregistry` is
36
- * not a core singleton, so another copy of the class could be in play.
37
- * `FileEditor` and `NotebookPanel` come from singleton packages.
33
+ * Resolve the CodeMirror view a selection in `widget` would live in — the
34
+ * active notebook cell or a `FileEditor` document — or `null`. The wrapper is
35
+ * duck-typed, not `instanceof DocumentWidget`: `@jupyterlab/docregistry` is
36
+ * not a core singleton, unlike `FileEditor` and `NotebookPanel`.
38
37
  */
39
38
  export function resolveEditorTarget(
40
39
  widget: Widget | null
@@ -63,10 +62,8 @@ export function resolveEditorTarget(
63
62
  }
64
63
 
65
64
  /**
66
- * Whether the current DOM selection lives inside `view`. Guards the
67
- * selection-change listener against selections made elsewhere (a terminal,
68
- * a sidebar, another notebook cell) while the widget owning `view` happens
69
- * to be the shell's current widget.
65
+ * Whether the current DOM selection lives inside `view`; guards against
66
+ * selections made elsewhere while the owning widget is current.
70
67
  */
71
68
  export function domSelectionInView(
72
69
  view: EditorView,
@@ -80,12 +77,9 @@ export function domSelectionInView(
80
77
 
81
78
  /**
82
79
  * Build an ask-agent request from the current selection in the shell's
83
- * current widget — a file editor or the active notebook cell — or return
84
- * `null` when that widget holds no CodeMirror document editor.
85
- *
86
- * With `allowEmpty`, a collapsed selection falls back to the cursor's line
87
- * (used by the command/shortcut path so it works without a mouse
88
- * selection); otherwise an empty selection yields `null`.
80
+ * current widget, or `null` when it holds no CodeMirror document editor.
81
+ * With `allowEmpty`, a collapsed selection falls back to the cursor's line;
82
+ * otherwise it yields `null`.
89
83
  */
90
84
  export function editorAskRequest(
91
85
  app: JupyterFrontEnd,
@@ -110,15 +104,14 @@ export function editorAskRequest(
110
104
  endLine = startLine;
111
105
  text = state.doc.lineAt(main.from).text;
112
106
  } else {
113
- // A selection that ends exactly at the start of a line (the common
114
- // "drag over whole lines" gesture) should not count that line.
107
+ // A selection ending exactly at a line start (the whole-line drag
108
+ // gesture) should not count that line.
115
109
  const endPos =
116
110
  main.to === state.doc.lineAt(main.to).from ? main.to - 1 : main.to;
117
111
  endLine = state.doc.lineAt(endPos).number;
118
112
  text = state.sliceDoc(main.from, main.to);
119
113
  }
120
114
 
121
- // Anchor the popup at the selection head (where the cursor ended up).
122
115
  // `coordsAtPos` returns `null` for positions scrolled out of view.
123
116
  const coords = view.coordsAtPos(main.head);
124
117
  const anchor = coords
@@ -1,9 +1,8 @@
1
1
  import { LabIcon } from '@jupyterlab/ui-components';
2
2
 
3
3
  /**
4
- * Four-point sparkle used by the ask-agent affordances (selection pill,
5
- * command palette entry). Drawn in-repo; the `jp-icon3` class lets the
6
- * active theme recolor the glyph like other JupyterLab UI icons.
4
+ * Four-point sparkle used by the ask-agent affordances; the `jp-icon3`
5
+ * class lets the active theme recolor the glyph.
7
6
  */
8
7
  export const askAgentIcon = new LabIcon({
9
8
  name: 'xtralab:ask-agent',