Repository navigation
Release v1.2.0 - #9
Merged
Merged
Conversation
Work for v1.2.0 so far, committed as one baseline before the KaTeX work: - Save folder setting: choose where auto-save writes (desktop folder dialog only), with a fallback to Downloads and the reason when it is unusable. - Settings as a slide-over drawer with General, Engines, Updates and About; keyboard and focus handling, toasts beside the drawer. - Display settings: layout width (Standard, Wide, Full) and preview text size (A-/A+, seven steps), kept in settings.json and applied before first paint; thin dividers between unrelated Preferences. - Preview: wide tables scroll in their own box, pictures fit the preview. - Theme switch reveal, safer links in previews and release notes, desktop page functions limited to the nine the UI uses.
The preview's HTML sanitiser, ahead of math rendering, which adds MathML to the preview. Same default configuration; both call sites unchanged. - npm tarball verified against the registry's sha512 integrity. - Licence unchanged (MPL-2.0 OR Apache-2.0); LICENSES header and THIRD_PARTY_NOTICES updated to the new version. - Checked in Edge and WebKit: XSS payloads (including MathML namespace confusion) are removed; MathML, style, class and data-* attributes stay.
Adds the files for math rendering; nothing loads them yet. - app/ui/vendor/katex/: katex.min.js, katex.min.css and the 20 woff2 fonts (557 KB; no woff/ttf). npm tarball checked against the registry's sha512; no eval or new Function; conservative JS and CSS that macOS 12's WebKit can run. - app/ui/vendor/VENDOR.json: version, source, upstream integrity and SHA-256 of every bundled UI file (KaTeX, DOMPurify, marked, highlight.js). The bundled marked.min.js is byte-identical to npm marked@15.0.12. - tests/test_vendor_manifest.py fails on a changed, missing or unlisted file, a missing licence file, or versions out of step with the file headers and THIRD_PARTY_NOTICES.md. - .gitattributes: app/ui/vendor/** is never line-ending converted, so the hashes hold on every OS (highlight.min.js was being checked out as CRLF). - LICENSES/KaTeX-MIT.txt (code and fonts, both MIT), THIRD_PARTY_NOTICES and README rows, and CONTRIBUTING steps for updating a bundled library.
LaTeX from Docling's formula recognition and GLM-OCR ($...$, $$...$$, \(...\), \[...\]) was mangled by the preview (a*b became italics, \ a line break). It is now drawn as real formulas with the bundled KaTeX. - One switch, Settings > Add-ons > Math formulas (render_math, on by default), kept in settings.json and set on <html> before first paint. Off, or for a document with no $, \( or \[ (or over 2 MB), the preview goes through the global marked parser exactly as before and KaTeX is never loaded. - Detection: a separate marked.Marked instance with two rules. $ follows Pandoc's rule (no space inside, no digit after the closing $), stays on one line and stops at a backtick; \$ is literal; code is never read. Every search is bounded (512 characters ahead for inline formulas, the current paragraph for block ones, the size caps for closing delimiters), so parsing stays linear: an unbounded first version took ~37 s on an 880 KB log with one $ (found in security review). - Formulas first become escaped LaTeX placeholders carrying a per-session random marker; only those are drawn, never look-alike HTML in a document. - KaTeX (script + CSS together) loads on the first document with math, then draws formulas on screen first and the rest in slices of 6 ms / 8 formulas (no requestIdleCallback, which WebKit lacks). trust: false, maxSize, maxExpand, length re-checked; output sanitised (annotation text dropped); failures keep the LaTeX text; results cached; a new preview cancels the old one's drawing; a load shadowed by the document retries. - Settings > Add-ons: a card per add-on. Built-in add-ons are bundled code; downloadable ones may only ever be data via the signed catalogue. - Saved files, Copy, Download, the Raw tab and the API are unchanged. Tests: tests/math_render_ui.test.js (real marked; detection, false positives, escaping, linear-time parsing, session marker, length caps, scheduling, cancellation, cache, failures, switch), render_math server tests, drawer and layout tests updated.
Two keyboard problems in the Settings drawer, independent of math rendering and kept in their own commit: - Every .toggle-switch hid its checkbox with display: none, which took all switches out of the keyboard. The checkbox is now hidden visually only, so Tab reaches each switch, Space flips it, and the slider shows the focus ring. - WebKit (macOS, Linux) shows :focus-visible for focus moved by script only when the previous focus showed it, and the drawer moves focus itself on Tab, so after a mouse click no ring ever appeared there. The drawer now carries .keyboard-nav while used from the keyboard (Tab or arrow keys) and shows the ring on :focus; a pointer press or closing clears it. Checked in Edge and WebKit: mouse, then Tab shows the ring on every item; the Add-ons switch flips with Space and is saved.
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.
Changed
General, Engines, Updates and About. "Check for updates
daily" has moved to Updates, and About has a short description of InkDoc.
The panel closes from the gear, the X, Esc or a click outside it.
The title bar stays usable while it is open, and dragging a file onto the
window closes it so the file lands in the drop zone. Prompts to install or
fix an engine open it on Engines. While it is open, notifications appear
beside it instead of over its buttons.
(saving, the Docling fallback and the PDF check), so each description sits
clearly with its own switch.
a circle growing from the theme button, as on the website. Where the
system's web engine doesn't support it, or "reduce motion" is on, the
theme switches instantly as before.
Security
longer open inside InkDoc's window: web links open in your browser, and
other links are ignored.
in the desktop app is reachable from page scripts.
Downloads instead.
picking up the upstream security fixes released since.
Added
writes, instead of always using Downloads. Change… opens your system's
folder dialog, the choice is remembered, and the desktop Download button's
Save dialog opens there too. If the folder is missing or can't be written to
(for example an unplugged drive), files are saved to Downloads and InkDoc
says so; the folder is used again once it is back. The folder can only be
chosen in the desktop app: no web page or API request can change it. API
responses report a fallback in the new
save_fallbackfield(#6).
1,400 px, as before), Wide (up to 1,920 px) or Full (the whole
window). On large screens, tables, code and images get the extra room while
paragraphs keep a readable line length; windows narrower than 1,400 px look
the same with any choice. It is remembered between launches of the desktop
app and applied before the window first draws, so the layout never jumps.
GET/POST /settingsreport and accept it aslayout_width.the converted document's text smaller or larger in seven steps (85% to 150%),
in both the Rendered and Raw tabs, with a live sample right below the
buttons. Headings, code and tables keep their proportions, and 100% is
exactly the size used before. It is remembered between launches like the
layout width;
GET/POST /settingsusepreview_text_size(85, 90, 100,110, 120, 135 or 150).
where it can be switched off. LaTeX from Docling's formula recognition and
GLM-OCR (
$…$,$$…$$,\(…\),\[…\]) is drawn as real formulaswith KaTeX instead of showing as mangled text. KaTeX is bundled, works
offline and is loaded only for documents that contain math, so other
documents, startup and saved files are unchanged. Prices such as $5 and
code are left alone; if ordinary text with $ signs is ever shown as math,
turn Math formulas off.
GET/POST /settingsuserender_math.Fixed
moving the whole document, and large pictures shrink to fit the preview.
Space, and keyboard focus in Settings is visible on macOS and Linux too.