Commit 3f5a43f
authored
Fix save-as making it easy to save without extension for positron notebooks (#8858)
Addresses #8857.
@:notebooks
Adds proper file dialog configuration to `PositronNotebookEditorInput`
to prevent users from
saving notebooks without `.ipynb` extensions. Uses VS Code's
`showSaveDialog` with filters, title,
and localized labels to provide a native save experience that
automatically handles extension
enforcement. The dialog's built-in extension enforcement ensures users
cannot accidentally save
notebooks un-extensioned files that causes the file to display as raw
json.
### Release Notes
#### New Features
#### Bug Fixes
- Properly configured the save as dialog for positron notebooks to
prevent mangled file names
### QA Notes
Updated the positron notebook save e2e test to make sure this behavior
is working. At least for the case of saving without a file extension.
Test the enhanced save dialog by creating a new untitled notebook and
saving it. The dialog
should provide a native experience with proper labeling and automatic
extension handling.
1. Create a new untitled notebook
2. Add some content (e.g., a code cell with `print("test")`)
3. Use "Save As" and observe:
- Dialog shows "Save Notebook As" title
- Type `mynotebook` (should automatically become `mynotebook.ipynb`)
Expected behavior: The save dialog automatically enforces`.ipynb`
extensions, preventing users from accidentally saving raw JSON notebook
content.1 parent 48330b2 commit 3f5a43f
File tree
2 files changed
+21
-9
lines changed- src/vs/workbench/contrib/positronNotebook/browser
- test/e2e/tests/notebook
2 files changed
+21
-9
lines changedLines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
241 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
242 | 250 | | |
243 | 251 | | |
244 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | | - | |
99 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
100 | 103 | | |
101 | 104 | | |
102 | | - | |
103 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
104 | 108 | | |
105 | 109 | | |
106 | 110 | | |
107 | | - | |
| 111 | + | |
108 | 112 | | |
109 | 113 | | |
0 commit comments