Commit graph

163 commits

Author SHA1 Message Date
Horizontal42
5af7c66c3c refactor: pull cross-sheet search and PNG export out of main.ts
Both were self-contained enough to live in their own modules —
src/ui/search.ts (Ctrl+F overlay, text and result-value queries) and
src/ui/export.ts (render the sheet + results to a PNG, clipboard or
file). Trims main.ts by about 150 lines.

Also fixes a real bug while it's in there: the PNG export's clipboard
fallback did btoa(String.fromCharCode(...bytes)), which blows the
call stack on large sheets (spreading a big array as call arguments).
Chunks the conversion in 0x8000-byte pieces instead.
2026-07-03 11:57:33 +03:00
Horizontal42
8b4e6fc0fe market data: switch to Yahoo v8 chart, drop delisted tickers
v7/finance/quote returns 401 now — Yahoo stopped issuing anonymous
clients the cookie+crumb pair it requires. v8 chart still answers
without auth, one symbol per request instead of one bulk call.
Also dropped SBER/GAZP from the tracked symbols; Yahoo delisted
Russian tickers in 2022, so those two always missed anyway.
2026-07-03 11:51:40 +03:00
Horizontal42
d0d13ec1c0 historical rates: point at frankfurter.dev, fetch on cold start too
api.frankfurter.app 301-redirects to frankfurter.dev now, and the old
host is flaky over reqwest/rustls-tls — talk to the new one directly
(Rust backend, the vite-dev web fallback, and the CSP allowlist).

Separately, a sheet reopened on boot with "on 2024-01-01" in it never
fetched historical rates at all: the fetch only ran from switchDoc()
and the editor's onChange, and the editor's initial text is seeded
directly, bypassing both.
2026-07-03 11:46:47 +03:00
Horizontal42
d28ab6d095 style: cargo fmt src-tauri
Whitespace only, no behavior change — makes the next couple of Rust
commits smaller and easier to read.
2026-07-03 11:44:36 +03:00
Horizontal42
0b2293f92f engine: configurable date formats, both input and display
Besides ISO, the lexer now accepts D.M.YYYY / M/D/YYYY literals
(31.12.2024, 12/31/2024) with a round-trip validity check so
out-of-range components (2026-13-45, 32.13.2024) fall back to plain
arithmetic instead of silently rolling over to a nearby valid date —
that rollover bug affected ISO literals too, not just the new forms.

Day/month order for ambiguous literals and display layout both come
from a new dateFormat setting (system/iso/dmy/mdy); "system" resolves
once via Intl against the OS locale. Intl.DateTimeFormat instances
are now cached by options key instead of rebuilt on every render.

App-side wiring (settings UI, persistence) comes in a follow-up commit.
2026-07-03 11:35:47 +03:00
Horizontal42
3a264c4a3f registry: split buildRegistry into per-category functions
The 290-line function is now registerCoreVocab / registerUnits /
registerAreaVolume / registerCurrencies / registerExtraUnits /
registerCrypto / registerCompletions, called in the same order —
phrase-collision priority depends on that order, unchanged. Pure
reorganization, no behavior change.
2026-07-03 11:31:02 +03:00
Horizontal42
af83ac6539 a URL in a line got truncated at the comment marker
rawLine.indexOf("//") matched the "//" inside "https://..." too, so
any line with a URL lost everything after it. A comment now only
starts at the beginning of a line or after whitespace.
2026-07-03 11:30:45 +03:00
Horizontal42
a9aaff5490 "time in Europe/Berlin" dropped the second word
Two independent traps. The noise filter only keeps word tokens right
after a conversion token (in/as/...); any other token type resets
that, so the "/" in a slash-form IANA id ("Europe/Berlin") reset it
before the parser ever saw "Berlin". The word-collecting loop in
parseTarget() had the same blind spot even once the token was there.
Both needed the same exception, or "Europe/Berlin" still degrades to
just "Europe".
2026-07-03 11:25:56 +03:00
Horizontal42
ef6244dc84 exp() silently evaluated as a no-op
"exp" was also listed as a scientific-notation alias ("123456 in
exp"). Phrases register first-come-first-served, and that alias was
registered before the exp() function, so the function itself never
got the phrase — exp(1) parsed as a bare (1) and returned 1. Drop
exp from the scientific-notation aliases; sci/exponent/exponential
still work.
2026-07-03 11:25:29 +03:00
Horizontal42
deea37ba21 multiplying same-dimension quantities keeps a sane unit
"2 kg * 500 g" multiplied the raw numbers (1000) and slapped the
left unit on top, giving "1000 kg" instead of "1 kg". Convert the
right operand into the left unit first for same-dimension products;
cross-dimension multiplication ($12 * 3, 5 hours * 2) is unaffected.
2026-07-03 11:25:01 +03:00
Horizontal42
df7761401b random() with no arguments threw before reaching its own branch
evalCall checked args[0] and threw "needs an argument" before ever
falling into the random case, which is the one built-in that's
valid with zero args. Dispatch it first.
2026-07-03 11:21:24 +03:00
Horizontal42
01697daaac bump version to 1.1.0 2026-07-02 06:20:32 +03:00
Horizontal42
5ed74c2cd6 workspace: fix cache-stability test to actually exercise the cycle-poisoning fix 2026-07-02 06:04:04 +03:00
Horizontal42
0345d2a33f workspace: don't cache exports from a cycle-interrupted evaluation
In an A<->B cycle, exportsFor(B) run while A is mid-resolution would
compute a wrong export set (assignments dropped by the nested
"circular reference" error) and cache it anyway. Later queries then
served that stale, cycle-broken result even after the cycle-causing
outer call had unwound, giving inconsistent error messages across
repeated evaluations of the same cyclic setup.

Skip caching whenever any line in the result carries a "circular
reference" error - that's a precise, local signal the pass was
cycle-affected, so the sheet gets re-evaluated fresh until an edit
actually breaks the cycle. Normal (non-cyclic) caching is untouched.

Also adds a positive-path test confirming LineResult.error stays
undefined on an ordinary successful line, and a workspace-level test
proving a genuine cycle now reports a stable error across repeated
queries.
2026-07-02 05:50:40 +03:00
Horizontal42
26a6bc283b document cross-sheet references 2026-07-02 05:43:33 +03:00
Horizontal42
90c19e343f show unresolved cross-sheet references as a visible #ref? marker 2026-07-02 05:41:17 +03:00
Horizontal42
9d8f977c46 wire cross-sheet references into the editor and document lifecycle 2026-07-02 05:38:02 +03:00
Horizontal42
8fb9ee3a31 workspace: sheet dependency graph, export cache, cycle guard, rename rewrite 2026-07-02 05:32:12 +03:00
Horizontal42
677f940043 engine: @Sheet.key cross-sheet reference syntax and resolver hook 2026-07-02 05:26:25 +03:00
Horizontal42
b509a65fc5 docs: update README and ARCHITECTURE for v2.0 features 2026-07-01 22:32:03 +03:00
Horizontal42
fbeca06f2e historical rates: 1000 USD in EUR on 2024-01-01 via frankfurter.app 2026-07-01 22:23:35 +03:00
Horizontal42
d5f458dce3 goal seek: ? * 1.2 = 1000 → 833.33 2026-07-01 22:11:55 +03:00
Horizontal42
bbbcc0497c export sheet as PNG — clipboard + file-save fallback 2026-07-01 20:44:04 +03:00
Horizontal42
661a4500ca live market data via Yahoo Finance: AAPL TSLA NVDA etc 2026-07-01 20:40:40 +03:00
Horizontal42
f1427d08f3 search by result value: >1000, <50, =100, ~100 2026-07-01 20:33:20 +03:00
Horizontal42
4b5381d7e7 sheet organization: pin and reorder with up/down arrows 2026-07-01 20:31:43 +03:00
Horizontal42
f8f9095fca add ISO date literals and days until/since 2026-07-01 20:27:55 +03:00
Horizontal42
eff90d3219 add chart/spark sparkline keyword — renders inline SVG in results column 2026-07-01 20:05:24 +03:00
Horizontal42
1d77ee45d8 add random() with deterministic line-seeded PRNG 2026-07-01 20:01:40 +03:00
Horizontal42
532c3265ad add block aggregates count/min/max/product, Ctrl+W close sheet 2026-07-01 19:58:54 +03:00
Horizontal42
55a2b6a492 bump version to 1.0.1 2026-07-01 17:37:43 +03:00
Horizontal42
0d0e6901b9 fix vite dev server: bind 127.0.0.1, ignore src-tauri/target
Vite defaulted to an IPv6-only bind, so tauri dev's readiness probe
(which checks 127.0.0.1) waited forever even though Vite was up.
Separately, its file watcher was watching Rust's build output and
crashed on a locked .pdb file mid-compile.
2026-07-01 17:35:26 +03:00
Horizontal42
f33381adc2 force monochrome rendering for the search icon
The magnifying glass emoji defaults to full-color presentation,
standing out next to the plain-glyph settings/sidebar buttons; the
U+FE0E text-presentation selector makes it inherit color like the rest
of the titlebar.
2026-07-01 17:25:03 +03:00
Horizontal42
cfe5336aa3 serialize release matrix builds to fix duplicate-release race
Running x64/arm64 tauri-action in parallel let both jobs race on
find-or-create-release for the same tag, producing two release objects
that each only got their own arch's assets (and a latest.json missing
the other platform's entry, breaking auto-update for it).
2026-07-01 16:28:52 +03:00
Horizontal42
a2dcd6ebba retag as v1.0.0 — first public release under PolyForm Noncommercial 2026-07-01 16:02:00 +03:00
Horizontal42
055c0b6144 document search, always-on-top, auto-update, arm64 build 2026-07-01 15:45:58 +03:00
Horizontal42
d168bf9af9 auto-generate release notes from commit log since last tag 2026-07-01 15:41:53 +03:00
Horizontal42
ca408f9bab bump version to 1.3.0 2026-07-01 14:56:09 +03:00
Horizontal42
9aca062add add search across all sheets and always-on-top toggle
Ctrl+F opens an overlay that searches every document's lines, not just
the active one, and jumps to the hit on click. Always-on-top is a
plain window pin, off by default, toggleable in settings.
2026-07-01 14:54:44 +03:00
Horizontal42
6efae0c706 add auto-update via tauri-plugin-updater
Signed by a new key (public half embedded in tauri.conf.json, private
half + password live in GitHub secrets). CI now signs release artifacts
and publishes latest.json; the app checks on boot and prompts to
install and restart.
2026-07-01 13:58:32 +03:00
Horizontal42
6602e4bbf5 switch license to PolyForm Noncommercial 1.0.0
MIT allowed unrestricted resale of the code; noncommercial-only license
matches actual intent (free personal use, no repackaging/reselling).
2026-07-01 13:21:01 +03:00
Horizontal42
7f9c83bbfe add fluid ounce (fl oz) unit, EN/RU 2026-07-01 13:10:06 +03:00
Horizontal42
1eec0cbec1 add release workflow for windows x64/arm64 builds 2026-07-01 12:57:03 +03:00
Horizontal42
e23d8d3874 bump version to 1.2.0 2026-06-24 00:40:15 +03:00
Horizontal42
b0c46c390c RU math phrases, half/полтора constants, export button
- vocab: EN+RU aliases for abs/log/ln/round; RU already had sqrt/cbrt
- engine: "half"/"a half"/"one half"/"половина" → 0.5; "one and a half"/"полтора"/"полторы" → 1.5 as named constants; widen const union in parser/tokenizer/evaluator/registry
- export: ⤓ button in statusbar dropdown — copy sheet, save .sum, export .txt, print/PDF; write_text_file Tauri command; print media CSS hides chrome
2026-06-24 00:27:06 +03:00
Horizontal42
db37218b66 кк = млн, ккк = млрд 2026-06-23 23:57:48 +03:00
Horizontal42
b0ad123fcc add trillion scale; RU к = тысяча 2026-06-23 23:56:13 +03:00
Horizontal42
4c05d63b55 expand vocab: more RU cases for currencies/units, Tab-only autocomplete
- EUR: add "Euros"; CHF: add "franc,francs"; INR: add "rupee,rupees"; USD: add "buck,bucks"; CNY: add "renminbi"
- RU USD: full declension + slang бакс/баксов/...; JPY: all 8 cases for иена/йена; UAH: all гривна cases; TRY: bare лира declension; CNY: жэньминьби + full cases; CHF: all франк cases; BRL/KRW/PLN: extended declension
- RU units: fill missing dative/instrumental/prepositional/accusative for час/минута/секунда/день/неделя/месяц/год/метр/грамм/литр/тонна/унция/фут/дюйм/миля/ярд
- RU scales: тысяча/миллион/миллиард full declension
- RU conversion: добавить "перевести в / конвертировать в"
- editor: autocompletion defaultKeymap:false so Enter only newlines, Tab accepts suggestion
2026-06-23 23:48:40 +03:00
Horizontal42
37fd32501b add sterling/quid/стерлинг phrases for GBP 2026-06-23 23:30:11 +03:00
Horizontal42
0c193a406c v1.1.3 2026-06-19 17:30:55 +03:00