Skip to content

0.7.0 — Scroll-away header & reading column

Choose a tag to compare

@luca-chen198 luca-chen198 released this 11 Jun 14:11
301c4a5

Highlights

Two big editor-layout features land in this release: an opt-in centered reading column with full-width table breakout (readingWidth), and a scroll-away header API — the engine can now host an embedder-supplied SwiftUI view above the document body that scrolls with the content and collapses to a pinned top row.

Main changes

  • Reading column (readingWidth) — opt-in fixed wrap width, centered by position (no re-wrap on resize); wide tables break out to the full window width like Google Docs (#60).
  • Scroll-away headerNativeTextViewWrapper gains header: AnyView?, headerCollapsedHeight: CGFloat, and headerExpanded: Bool. The hosted view scrolls with the document, stays fully interactive, refreshes on every SwiftUI update, and animates between collapsed and expanded; composes with readingWidth (#61).
  • Empty-document placeholder — new placeholder: NSAttributedString? ghost text rendered at the first-line position inside the scrolled content: it sits below the header band, tracks its reveal animation, and hides on the first keystroke (#61).
  • Band-aware bottom overscroll — the header band counts toward the overscroll activation, so short documents under an expanded header can scroll the band away instead of pinning the caret to the viewport bottom; the comfortable slack stays viewport-based, so long documents behave exactly as before (#61).
  • Spell-check suppression on codeMarkdownASTStyler stamps .spellingState: 0 on fenced code blocks and inline code, completing the existing convention (links, wiki-links, LaTeX, tables) (#64, thanks @Ender-Wang).

Breaking

  • The scroll view's documentView is now always an engine-internal container view, never the NSTextView itself. Embedders that reached into scrollView.documentView must adapt.
  • The enclosing scroll view no longer applies a hard-coded top: 55.4 content inset; the default is 0 on every edge. Opt back in via config.safeAreaInsets = SafeAreaInsets(top: …).

Bundled fixes

Height-neutral trailing empty line (typing on the last line at max overscroll no longer shifts the bottom scroll limit), scroll-to-reveal regressions in the reading column, header/body compositing during responsive scroll, live-resize scroll-position restoration.

Tests

swift test — 89 tests across 10 suites.

Full changelog: 0.6.0...0.7.0

What's Changed

  • docs: update ARCHITECTURE.md for the AST pipeline by @luca-chen198 in #53
  • Add opt-in readingWidth: full-width table breakout by @luca-chen198 in #60
  • feat: stamp .spellingState: 0 on fenced code blocks and inline code by @Ender-Wang in #64
  • Scrolling header API for the markdown editor (+ live-scroll stability) by @Nicolas-Py in #61

New Contributors

Full Changelog: 0.6.0...0.7.0