From f55266f70ba000e06c59f6c64b6ecf53bed70840 Mon Sep 17 00:00:00 2001 From: Horizontal42 <75383519+Horizontal42@users.noreply.github.com> Date: Thu, 11 Jun 2026 12:57:39 +0300 Subject: [PATCH] v1.1.0: bug fixes, atomic writes, safe quit, .sum files, CI Engine: fix BigInt crash on NaN, KM/KG case-insensitive units, space-grouped and comma-decimal number parsing, variable-vs-unit shadowing, small value display (1 mm in km), DST-safe date arithmetic, month-end clamp, log mustTouch, avg counted, 50% of 50%, 100 USD + 20 after conversion, percent power. Rust: atomic writes (temp+rename) for documents.json, safe quit (app-quit event + 2s watchdog so tray-quit doesn't lose edits), .sum file association + open, migration safety (canonicalize + all_copied guard), opener API for backups and extensions folders. UI: decimal separator setting, hotkey rollback on failure, corrupted JSON guard, ru welcome sheet, orange cursor visibility. CI: windows-latest workflow (tsc + vitest + cargo clippy). --- .github/workflows/ci.yml | 31 +++ .gitignore | 6 + ARCHITECTURE.md | 5 +- README.md | 6 +- index.html | 6 + package.json | 2 +- src-tauri/Cargo.lock | 383 ++++++++++++++++---------------------- src-tauri/Cargo.toml | 4 +- src-tauri/src/main.rs | 86 ++++++--- src-tauri/tauri.conf.json | 4 +- src/engine/datetime.ts | 22 ++- src/engine/edge.test.ts | 65 +++++++ src/engine/evaluator.ts | 36 +++- src/engine/formatter.ts | 7 +- src/engine/index.ts | 9 +- src/engine/lexer.ts | 41 +++- src/engine/parser.ts | 47 ++++- src/engine/registry.ts | 45 ++++- src/engine/tokenizer.ts | 5 +- src/i18n.ts | 6 + src/main.ts | 58 ++++-- src/storage.ts | 38 +++- src/ui/editor.ts | 7 +- 23 files changed, 595 insertions(+), 324 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..55ac160 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + engine: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + - run: npm ci + - run: npx tsc --noEmit + - run: npx vitest run + + rust: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy + - uses: Swatinem/rust-cache@v2 + with: + workspaces: src-tauri + - run: cargo clippy --manifest-path src-tauri/Cargo.toml diff --git a/.gitignore b/.gitignore index 29dd4b6..b8505f2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,9 @@ dist/ src-tauri/target/ src-tauri/gen/ *.log + +# local reference copy of the original macOS Numi bundle — not ours to ship +Contents/ + +# one-off debugging artifacts +scripts/smoke-* diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 7142d22..d584d50 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -114,6 +114,7 @@ snapshot price) plus the mirror list in `src-tauri/src/main.rs`. ## Tests -`npm test` runs ~80 vitest cases over the engine (`src/engine/*.test.ts`): -every expression class, both languages, deterministic injected rates. +`npm test` runs ~94 vitest cases over the engine (`src/engine/*.test.ts`): +every expression class, both languages, deterministic injected rates, +plus a regression suite covering all known-fixed bugs. UI is exercised manually; the engine is where the complexity lives. diff --git a/README.md b/README.md index 73667ff..c54932d 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,8 @@ the sheet total; select a few lines to see just their sum. - **Click a result** to copy it. Copying a line copies it *with* the answer (`rent * 3 = $1,500`). **Ctrl+Shift+C** copies the whole sheet with answers. - **Drag the divider** to resize the results column. -- **Drop a `.numi` or `.txt` file** into the window to open it as a sheet. +- **Drop a `.numi`, `.sum`, `.txt` or `.md` file** into the window to open it + as a sheet. - **Backups are automatic**: a daily snapshot of all sheets (last 14 kept), and deleted sheets sit in a bin for 14 days (configurable) — restore one by dragging the file back in. Settings → Backups opens the folder. @@ -116,7 +117,8 @@ npm run tauri build # build the installer To build from source you need: -- [Node.js](https://nodejs.org/) 20 or newer +- [Node.js](https://nodejs.org/) 22.6 or newer (`npm run icons` relies on + Node's built-in TypeScript support) - [Rust](https://rustup.rs/) (stable, MSVC toolchain) - [Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) with the "Desktop development with C++" workload (the MSVC linker) diff --git a/index.html b/index.html index 11d7326..9806666 100644 --- a/index.html +++ b/index.html @@ -52,6 +52,12 @@ +