Skip to content

Release v1.2.0 - #9

Merged
AbdoslamB merged 5 commits into
mainfrom
release/1.2.0
Oct 14, 2026
Merged

AbdoslamB merged 5 commits into
mainfrom
release/1.2.0

Conversation

@AbdoslamB

Copy link
Copy Markdown
Owner

Changed

  • Settings now opens as a wider panel on the right with four sections:
    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.
  • In Settings → General, thin lines now separate the unrelated preferences
    (saving, the Docling fallback and the PDF check), so each description sits
    clearly with its own switch.
  • Switching between the dark and light theme now reveals the new theme as
    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

  • In the desktop app, links inside converted documents and release notes no
    longer open inside InkDoc's window: web links open in your browser, and
    other links are ignored.
  • The page can now call only the nine desktop functions it uses; nothing else
    in the desktop app is reachable from page scripts.
  • If the save folder's location can't be checked, files are saved to
    Downloads instead.
  • Release notes are shown as plain text if the HTML sanitiser is unavailable.
  • The preview's HTML sanitiser, DOMPurify, is updated from 3.1.6 to 3.4.16,
    picking up the upstream security fixes released since.

Added

  • Save folder setting (Settings → General): choose where auto-save
    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_fallback field
    (#6).
  • Layout width setting (Settings → General → Display): Standard (up to
    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 /settings report and accept it as layout_width.
  • Preview text size (Settings → General → Display): A− and A+ make
    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 /settings use preview_text_size (85, 90, 100,
    110, 120, 135 or 150).
  • Math formulas in the preview, and a new Settings → Add-ons section
    where it can be switched off. LaTeX from Docling's formula recognition and
    GLM-OCR ($…$, $$…$$, \(…\), \[…\]) is drawn as real formulas
    with 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 /settings use render_math.

Fixed

  • A wide table in the preview now scrolls sideways on its own instead of
    moving the whole document, and large pictures shrink to fit the preview.
  • Every switch in Settings can now be reached with Tab and flipped with
    Space, and keyboard focus in Settings is visible on macOS and Linux too.

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.
@AbdoslamB
AbdoslamB merged commit cb7a8d5 into main Oct 14, 2026
3 checks passed
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