Commit 5854a03
authored
Hide notebook console actions behind existing setting (#11072)
Addresses #9948
### Prior Behavior
When the `console.showNotebookConsoles` setting (Console -> Show
Notebook Consoles) is enabled, a console instance gets automatically
created for a notebook session (for built-in notebooks and Positron
Notebooks).
We also have two commands that allow a user to create/focus a console
instance for a notebook session that we always showed. These actions did
not depend on the `console.showNotebookConsoles` setting to be enabled
to show up or work:
- `workbench.action.positronConsole.showNotebookConsole`: The "Show
Notebook Console" command in the editor toolbar for built-in notebooks
that users could select to show/focus a console for the current notebook
session.
- `positronNotebook.showConsole`: The "Open Notebook Console" command in
the kernel menu dropdown for Positron Notebooks that users could select
to show/focus a console for the current notebook session.
There is also `positronNotebook.executeSelectionInConsole`: The
"Notebook: Execute Selection In Console" menu item that lets you execute
a highlighted portion from a notebook cell in the console for the
current notebook. NOTE: The `Execute Selection in Console` doesn't ever
show up in the Positron Notebook right-click menu. This is a known bug
and unrelated to this change!
### New Behavior
This PR introduces a new setting called
`console.showNotebookConsoleActions` that controls whether a user sees
the commands described above.
The new behavior is as follows:
- Both OFF (default):
- Console instances will NOT be automatically created for open
notebooks. The "Show/Open Notebook Console" and "Notebook: Execute
Selection In Console" menu items will NOT show up for notebooks.
- `console.showNotebookConsoleActions` ON only:
- Console instances will NOT be automatically created for open
notebooks. The "Show/Open Notebook Console" and "Notebook: Execute
Selection In Console" menu items WILL show up for notebooks.
- For users who want control over when a notebook console appear. They
can manually trigger console creation when needed.
- `console.showNotebookConsoles` ON only:
- Console instances WILL BE automatically created for open notebooks.
The "Show/Open Notebook Console" and "Notebook: Execute Selection In
Console" menu items will NOT show up for notebooks.
- For users who want consoles for all notebooks and don't need the
toolbar buttons cluttering their UI.
- Both ON:
- Console instances WILL BE automatically created for open notebooks.
The "Show/Open Notebook Console" and "Notebook: Execute Selection In
Console" menu items WILL show up for notebooks.
Once this PR is merged, I'll leave a comment in
#3801 that introduced this
change to let users know they will need to opt into the new setting to
see the new commands:
```
### Notebook Console Actions Now Opt-In
Hey folks! We've made this notebook console work an opt-in feature for now based o feedback in [#9948](#9948).
**What's new:**
- Added a new setting **Console: Show Notebook Console Actions** (`console.showNotebookConsoleActions`) that controls whether the "Show Notebook Console" and "Execute Selection in Console " commands appear in your notebook toolbar/menu/command palette. It's off by default to keep the UI clean while we refine the experience.
The existing **Console: Show Notebook Consoles** (`console.showNotebookConsoles`) setting hasn't changed and still controls whether consoles are automatically created when you open a notebook.
These two settings are independent, so you can mix and match based on your workflow:
- Turn on **Console: Show Notebook Console Actions** to manually show consoles when you need them
- Turn on **Console: Show Notebook Consoles** if you want consoles for all notebooks without the extra toolbar buttons
- Turn on both if you want all the options!
Both settings are experimental for now as we gather feedback and refine the experience.
```
### Screenshots
**BEFORE - setting OFF**
https://github.com/user-attachments/assets/b048c49c-281c-4312-8a14-8550b971b96f
**BEFORE - setting ON**
https://github.com/user-attachments/assets/9211a94b-c246-416d-a53c-332807a124a7
**AFTER - Both OFF**
https://github.com/user-attachments/assets/bb19b331-a65b-45d7-b64b-33d2f05f65ac
**AFTER - BOTH ON**
https://github.com/user-attachments/assets/1214c36d-0d6e-487e-b74a-87321ae23829
**AFTER - `console.showNotebookConsoles` ON**
https://github.com/user-attachments/assets/ae5d7219-9f99-4855-804a-ec7e42081acb
**AFTER - `console.showNotebookConsoleActions` ON**
https://github.com/user-attachments/assets/ec34edfc-9be2-4808-81fc-a1ead5c1d19d
https://github.com/user-attachments/assets/0cca0ca5-12dc-44ad-ac0d-c0e3cffd5148
### Release Notes
<!--
Optionally, replace `N/A` with text to be included in the next release
notes.
The `N/A` bullets are ignored. If you refer to one or more Positron
issues,
these issues are used to collect information about the feature or
bugfix, such
as the relevant language pack as determined by Github labels of type
`lang: `.
The note will automatically be tagged with the language.
These notes are typically filled by the Positron team. If you are an
external
contributor, you may ignore this section.
-->
#### New Features
- Following up on the shared notebook/console kernel feature
([#3801](#3801)), notebook
console action
buttons are now hidden by default
([#9948](#9948)). Enable
**Console: Show Notebook Console Actions** to
display "Show Notebook Console" option in notebook toolbars.
#### Bug Fixes
- N/A
### QA Notes
@:positron-notebooks
<!--
Positron team members: please add relevant e2e test tags, so the tests
can be
run when you open this pull request.
- Instructions:
https://github.com/posit-dev/positron/blob/main/test/e2e/README.md#pull-requests-and-test-tags
- Available tags:
https://github.com/posit-dev/positron/blob/main/test/e2e/infra/test-runner/test-tags.ts
-->
<!--
Add additional information for QA on how to validate the change,
paying special attention to the level of risk, adjacent areas that
could be affected by the change, and any important contextual
information not present in the linked issues.
-->1 parent 440aa61 commit 5854a03
File tree
5 files changed
+39
-12
lines changed- src/vs/workbench
- contrib
- positronConsole/browser
- positronNotebook/browser
- services/positronConsole/browser
- test/e2e/tests/notebooks-positron
5 files changed
+39
-12
lines changedLines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1064 | 1064 | | |
1065 | 1065 | | |
1066 | 1066 | | |
| 1067 | + | |
1067 | 1068 | | |
1068 | 1069 | | |
1069 | 1070 | | |
1070 | 1071 | | |
1071 | 1072 | | |
1072 | 1073 | | |
1073 | | - | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
1074 | 1078 | | |
1075 | 1079 | | |
1076 | 1080 | | |
| |||
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
56 | | - | |
| 59 | + | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| |||
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1270 | 1270 | | |
1271 | 1271 | | |
1272 | 1272 | | |
1273 | | - | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
1274 | 1277 | | |
1275 | 1278 | | |
1276 | 1279 | | |
1277 | 1280 | | |
1278 | 1281 | | |
1279 | 1282 | | |
1280 | 1283 | | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
1281 | 1288 | | |
1282 | 1289 | | |
1283 | 1290 | | |
| |||
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
| 272 | + | |
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
277 | 285 | | |
278 | 286 | | |
279 | 287 | | |
| |||
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
73 | 72 | | |
74 | 73 | | |
75 | 74 | | |
76 | | - | |
77 | 75 | | |
78 | 76 | | |
79 | 77 | | |
| |||
175 | 173 | | |
176 | 174 | | |
177 | 175 | | |
178 | | - | |
| 176 | + | |
179 | 177 | | |
180 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
| |||
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
206 | 210 | | |
207 | 211 | | |
208 | 212 | | |
| |||
0 commit comments