Skip to content

feat(desktop): style live headings and tasks and render native math - #188

Merged
frostyard-machines merged 11 commits into
mainfrom
feat/native-line-styles
Nov 11, 2026
Merged

frostyard-machines merged 11 commits into
mainfrom
feat/native-line-styles

Conversation

@bketelsen

@bketelsen bketelsen commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Native live preview sizes headings by hierarchy and strikes completed tasks; selected lines and source mode reveal their source styles. MyGo's per-line layout API keeps wrapping, replacements, caret positions and scrolling consistent.

Native reading view and live preview also render inline/display TeX as bounded, cached vector paths using mathjax-go. Invalid or unsupported formulas remain source. These math changes came from #187, which was merged into this branch.

Part of #146: on the CI runner, live preview's typing is still over #146's 16 ms gate (#193). Closes #147. Uses the pinned line-style capability from bketelsen/mygo#1. Includes #191's merged frostui pin and asynchronous test fixes.

Risk tier

Risk tier: 3 — internal/desktop/editor/live.go and internal/desktop/reading/view.go match L1. Styles derive from parsed lines and do not rewrite note bytes. Math uses a pure-Go renderer with source, nesting, output and cache bounds; it runs no scripts, external processes or network requests. Invalid formulas retain source. The MyGo pin has geometry, folding, replacement and edit-position coverage.

Docs housekeeping

ADR-0041 records native vector math; its design/spec/plan links and index entry are included. The app design, native UI spec, desktop plan and canonical AGENTS.md describe the resulting rendering behavior.

Verification

  • mise exec -- make check and make desktop-build passed on the refreshed branch.
  • Live-preview tests cover heading size, task strike, selection reveal and source mode; math tests cover rendering and bounded fallback.
  • make desktop-bench: source 2.67 ms, live preview 12.50 ms per keystroke in 10,000 lines (16 ms target).
  • Regenerated Flatpak Go sources.
  • The two corrected asynchronous test packages passed three complete race runs.
  • Dependency editor race tests and cross-platform builds/vet passed; its baseline font/layout failures are documented in the dependency PR.

Merge order

Remaining merge order: #191 → #188 → #189 → #190. #187 was merged into #188, so its math changes land with #188. Preserve ancestry with merge commits, or rebase the remaining branches after a squash merge.

Update (2026-11-11): moved onto MyGo v0.9.0 by merging

Local results

On each of #188, #189 and #190, these are green:

  • make check
  • go test -race over ./internal/desktop/... and ./internal/render/
  • make desktop-build

make desktop-evidence on #190: the tree at a median of 369 µs, the switcher at 4.8 ms, and a phone edit in 8.7 ms.

Typing cost: about 2.7 ms a keystroke in source mode, and 11.6 to 12.7 ms in live preview, against main's 9.0 ms without per-line styles and the 16 ms budget.

Not verified yet

@github-actions github-actions Bot added level:L1 Read every line risk:high Touches a path in .github/risk-paths.json labels Nov 11, 2026
@bketelsen bketelsen changed the title feat(desktop): size live headings and strike completed tasks feat(desktop): style live headings and tasks and render native math Nov 11, 2026
# Conflicts:
#	AGENTS.md
#	go.mod
#	go.sum
#	packaging/flatpak/go-sources.json
# Conflicts:
#	AGENTS.md
#	packaging/flatpak/go-sources.json
Live preview ran three regular expressions on every line of the note on
each keystroke to find headings and done tasks, and three more to follow
paragraphs. A line's shape now comes from a cache keyed by its text, as
its pieces do. A keystroke in the 10,000-line note goes from 11.4 ms to
10.1 ms here, and on two cores from 12.0 ms to 9.9 ms, against main's
9.0 ms (#193).
@frostyard-machines
frostyard-machines merged commit 37d6359 into main Nov 11, 2026
10 checks passed
@frostyard-machines
frostyard-machines deleted the feat/native-line-styles branch November 11, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:L1 Read every line risk:high Touches a path in .github/risk-paths.json

Projects

None yet

Development

Successfully merging this pull request may close these issues.

desktop: draw math as TeX

2 participants