Skip to content

feat: Tauri notebook app — text cells, plotting, save/load, factorial fix#1

Open
msollami wants to merge 1 commit intostblake:mainfrom
msollami:feat/notebook-clean
Open

feat: Tauri notebook app — text cells, plotting, save/load, factorial fix#1
msollami wants to merge 1 commit intostblake:mainfrom
msollami:feat/notebook-clean

Conversation

@msollami
Copy link
Copy Markdown
Contributor

@msollami msollami commented Apr 8, 2026

Summary

  • New notebook-tauri/ desktop app (Tauri v2 + React + TypeScript) — a Mathematica-style notebook UI for PicoCAS
    • Code cells with CodeMirror 6 syntax highlighting, KaTeX output rendering, and Shift+Enter to evaluate
    • Text/Markdown cells: editable on click, Shift+Enter to commit; supports # H1, ## H2, **bold**, *italic*
    • Plot[expr, {x, min, max}] renders an interactive line chart (Recharts)
    • Save / Open notebooks as .pico JSON files via native file dialogs
    • Pre-loaded hello world notebook with examples on first launch
    • Rust backend spawns picocas through a Python PTY wrapper so picocas sees a TTY and line-buffers output correctly; async Tauri IPC commands bridge to the blocking I/O thread via tokio::sync::oneshot channels
  • Factorial fix (src/arithmetic.c): n! for n > 20 now evaluates using double (up to n = 170), returning Overflow beyond that, instead of a parse error

Test plan

  • make in repo root to build picocas
  • Copy picocas and pty_wrap.py to notebook-tauri/src-tauri/resources/ (see README)
  • cd notebook-tauri && npm install && npm run tauri dev
  • Evaluate 2 + 3, 10!, Plot[x^2, {x, -2, 2}] in the hello world notebook
  • Add a text cell, type markdown, Shift+Enter to commit
  • Save notebook as .pico, close, reopen

- New notebook-tauri/ desktop app (Tauri v2 + React + TypeScript)
  - Code cells with CodeMirror 6 syntax highlighting and KaTeX output
  - Text/Markdown cells: editable on click, Shift+Enter to commit
  - Plot[expr, {x, min, max}] renders an interactive Recharts line chart
  - Save / Open notebooks as .pico JSON files (native file dialogs)
  - Pre-loaded hello world notebook with examples on first launch
  - Rust backend spawns picocas via Python PTY wrapper for correct
    line-buffering; async Tauri commands bridge via oneshot channels
- Fix factorial for n > 20: use double for n <= 170, Overflow beyond
@msollami msollami force-pushed the feat/notebook-clean branch from ceb564d to 6291779 Compare April 8, 2026 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant