feat(editor): Add Jupyter Notebook (.ipynb) support#291
Open
akshit-sr wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(editor): add Jupyter Notebook (.ipynb) support
What
Adds interactive
.ipynbsupport to the Terax editor, including notebook rendering, cell editing, Python execution, rich output rendering, and Jupyter-style keyboard shortcuts.Why
Terax currently treats notebooks like ordinary files, which blocks common data-science and learning workflows. This lets users open, edit, run, and save Jupyter notebooks without leaving the app.
How
Added a dedicated notebook editor path for
.ipynbfiles:EditorStackroutes notebook files toNotebookPane.NotebookPaneowns notebook parsing, dirty-state updates, cell operations, run-all, clear-output, and command/edit mode shortcuts.NotebookCellrenders each cell with CodeMirror editing, markdown preview, toolbar actions, and inline autocomplete context from previous code cells.NotebookOutputrenders streams, images, HTML, JSON, and plain-text outputs.src-tauri/src/modules/notebook/exec.rsmanages a per-notebook Python kernel process and returns nbformat-style execution results.Keyboard Shortcuts:
Esc: command modeEnter: edit selected cellShift+Enter: run cell and move/select nextCtrl+Enter: run cell and stayAlt+Enter: run cell and insert belowArrowUp/ArrowDown,K/J: select previous/next cellA/B: add code cell above/belowM/Y/R: change selected cell to Markdown/Code/RawDD: delete selected cellX: delete selected cellC: duplicate selected cellTesting
Verified the main notebook flows manually:
Opened an
.ipynbfile and confirmed it renders as notebook cells instead of raw JSON.Edited code and markdown cells, switched cell types, added, moved, duplicated, and deleted cells.
Ran individual cells with the toolbar and keyboard shortcuts.
Confirmed
Shift+Enterruns while typing inside a cell instead of inserting a newline.Confirmed previous executed cells remain available to later cells in the same notebook kernel.
Used
Run AllafterClear Outputsand confirmed code cells execute and outputs repopulate.Rendered stream output and matplotlib image output.
Saved the notebook and confirmed serialized
.ipynbcontent remains valid.pnpm exec tsc --noEmitcleanManual smoke-test of the affected feature
(If you touched
src-tauri/)cargo checkclean(If UI) tested in
pnpm tauri devScreenshots / GIFs
Notes for reviewer
The backend uses a lightweight per-notebook Python process rather than a full Jupyter kernel protocol implementation. This keeps the feature small, but follow-up work could add kernel restart/interrupt controls, richer error output typing, and broader MIME output coverage.