Up to 38% offBlack Friday · Personal $25 (reg. $39) · Lifetime $49 (reg. $79)Black Friday saleEnds Dec 1View offer
All resources

Engineering Notes · Native Migration

Why we rebuilt Linger as a native Mac app (AppKit, SwiftUI & Rust)

Linger started as a cross-platform WebView desktop app backed by Rust. In November 2026 we dropped Windows maintenance and replaced the WebView UI with AppKit, SwiftUI, and ImageIO while keeping our shared Rust core. Here is the architecture, the exact numbers we measured first, and what those benchmarks do not claim.

On this page

The native Mac stack in Linger

  • No Electron or WebView shell—AppKit powers the view-reusing gallery wall/grid, Project Canvases, focus zoom, and drag interactions, while SwiftUI handles toolbars, inspector, filters, and settings.
  • Shared Rust core & runtime preserved. Rust still handles SQLite, managed library copies, cross-process locking, deduplication, licensing, the optional analysis queue, local stdio MCP, and browser native messaging. The macOS app provides Apple Vision OCR, automatic palettes, and Project Canvas export as PDF, SVG / Figma, or DESIGN.md, plus Copy SVG.
  • Two clearest prototype findings showed view reuse holding scroll-thread responsiveness steady across 169 to 5,000 repeated items, while decoding thumbnails to display pixels (384 px vs. 1024 px) cut host peak RSS by 61%–64% inside the same native prototype.
  • Platform focus centers on Apple Silicon Macs running macOS 14+ after Windows maintenance ended.

ARCHITECTURE SPLIT

Why we chose native UI over our existing Rust core

When we decided to leave the WebView behind, we resisted the temptation to rewrite the entire codebase in Swift from scratch. Our Rust storage, locking, deduplication, and MCP layers were already tested against real libraries, so splitting responsibilities let us replace the interface cleanly without inventing a second persistence engine.

How AppKit, SwiftUI, ImageIO, and Rust divide work in Linger
Layer Owns Hard Constraint
AppKit Gallery wall/grid (NSCollectionView reuse), selection, keyboard navigation, drag-and-drop, focus zoom, Project Canvases Bounded visible views; off-screen decode requests are cancelled and checked by request generation
SwiftUI Toolbar, flat sidebar chrome, auto-saving inspector, Recall filters, and settings views Holds UI drafts and view state only—never writes directly to SQLite
ImageIO Background thumbnail downsampling sized to display pixels (2× Retina) Full-resolution originals decode on demand in Focus view; source files on disk stay untouched
Rust Core (linger-core) Managed library copies, SQLite queries, deduplication, licensing, Recall & separate machine-facet / analysis tables Zero WebView dependencies; preserves untouched-original and optional-note vs. machine-tag isolation
Rust Runtime (linger-runtime) Async imports, optional Ollama / BYOK / Codex / local DigUp recall queue, headless linger-service for stdio MCP & Chrome extension Model connections default off; strict timeouts, cancellation, and process-group cleanup
Thin FFI + JavaScriptCore Typed JSON request bridge from Swift to Rust; system JavaScriptCore runs a few legacy pure scoring/template functions No raw SQL exposed over FFI; no DOM, React, or WebView loaded

Read more about how the Rust core protects your files on disk in our local-first architecture guide.

MEASURED BEFORE COMMITTING

What we measured on November 11, 2026

Before replacing the production app, we ran a controlled gallery baseline on an Apple Silicon Mac (Mac15,3, 24 GiB RAM, 8 cores) using an isolated copy of 169 real reference images (215.5 MB total), plus 1,000-item and 5,000-item UI stress tiers that repeated those 169 images to test view-count scaling. Each tier ran 3 times in a 1440×920 pt (2×) window, reversing engine order on the second pass.

1. Display-pixel thumbnail decoding cut native host RSS by 61%–64%

Inside the exact same native prototype, changing only the ImageIO thumbnail decode max edge from 1024 px down to 384 px (enough for 168×190 pt cards at 2× Retina, while keeping full-size decoding for the Focus viewer) produced the single clearest memory win.

Median host peak RSS inside the native prototype (3 runs per tier)
UI Item Count Native 1024 px Decode (Peak RSS) Native 384 px Decode (Peak RSS) Reduction
169 images 659 MiB 255 MiB −61.3%
1,000 (repeated) 653 MiB 233 MiB −64.3%
5,000 (repeated) 651 MiB 232 MiB −64.4%

2. View reuse kept viewport readiness and scroll-thread ticks flat as item count grew

We also recorded two scaling curves as UI items grew from 169 to 5,000—time until the first viewport finished decoding and laying out, and the p95 interval of a 10 ms main-thread timer during a 6,000 pt (~3 s) scroll, where numbers closer to 10 ms mean less event-loop blocking.

Scaling behavior from 169 to 5,000 UI items (medians of 3 runs)
UI Item Count Legacy Web (Full Mount) Viewport Ready Native 384 px Viewport Ready Legacy Web Scroll 10 ms Timer p95 Native 384 px Scroll 10 ms Timer p95
169 images 584 ms 182 ms 18 ms 10.8 ms
1,000 (repeated) 682 ms 189 ms 81 ms 10.9 ms
5,000 (repeated) 1,801 ms 182 ms 205 ms 10.9 ms

At the 5,000-item tier, the legacy WebView view received only 12–19 timer callbacks during the 3-second scroll because it mounted all 5,000 cards in the DOM, whereas the view-reusing AppKit grid received 292–300 callbacks while holding ~25 visible items (~76 total collection subviews at scroll end).

METHODOLOGY BOUNDARIES

What these numbers do not prove

Many “we rewrote in native” blog posts turn early prototype charts into exaggerated marketing claims. We documented the exact limits of our baseline alongside the numbers so we would not fool ourselves—or you.

  • No cross-stack speedup multiplier. The legacy WebView harness mounted all cards without virtualization and had slightly different first-screen card counts (~16 vs. ~25); the gap shows why view reuse and pixel-sized decoding matter rather than proving a virtualized WebView could never run faster.
  • 10 ms timer p95 is not FPS or 120 Hz certification. It measures main-thread event responsiveness rather than GPU compositing or ProMotion frame pacing.
  • No cross-stack RSS comparison. WKWebView splits memory across separate WebContent, GPU, and Networking processes, so comparing host-process RSS directly against WebView host RSS would be misleading; we only compared 1024 px vs. 384 px inside the same native stack.
  • Repeated items are not 5,000 unique images. Repeating 169 files stress-tests UI view reuse rather than 5,000 distinct SQLite rows and unique disk cache misses.

WHAT NATIVE UNLOCKED IN 0.8.1

Building interruptible pinch-to-zoom reflow on AppKit

The best argument for going native showed up right after the migration, when we worked on trackpad pinch-to-zoom across our Wall and Grid layouts in Linger 0.8.1. A naive desktop gallery zooms by scaling the whole container and then hard-snapping to a new column count—which makes the image under your cursor jump away and forces your eye to re-find your place.

We considered whether this required rewriting the gallery as a custom Metal renderer, and deliberately decided against it. Instead, we built a per-card, interruptible FLIP spring engine directly on top of NSCollectionView and Core Animation.

  • Single-transaction FLIP (First → Last → Invert → Play). At the exact moment a pinch, zoom slider drag, or ⌘+/⌘− crosses a column threshold, we record every visible card’s live screen rect (including any in-flight spring offset and velocity), commit the new column geometry without animation, lock the pointer’s anchor card back to its viewport position (elevated at zPosition = 2), and start the animation from each returning card’s previous visual position.
  • Analytical critically damped springs (GalleryReflowSpringState). Instead of fixed-duration ease curves that stutter when reversed mid-flight, each card follows a critically damped spring with natural frequency ω = 22, carrying forward position and scale velocities within bounded ranges on reversal.
  • CADisplayLink on .common RunLoop mode. Keeping the display link in .common mode ensures animations keep ticking smoothly while live trackpad gestures or slider tracking are active, then cleanly stops as soon as all cards settle back to CATransform3DIdentity (respecting macOS Reduce Motion by disabling spring travel).
  • Deferred high-res re-decoding & regression assertions. High-resolution thumbnail refreshes wait until live zoom settles so decoding does not fight gesture frames, with automated continuity tests across Grid and Wall asserting < 1.5 pt first-frame continuity on threshold crossing and mid-flight reversal at 60 ms.

MAKER’S NOTES

Real trade-offs—and the bugs the rewrite forced us to face

Going native was a product and focus decision as much as a performance one. Because we are a small team building a Mac-first creative tool, dropping Windows maintenance let us stop writing lowest-common-denominator UI and fix interaction details designers actually feel every day.

  • Stale async callbacks on reused cells. Scrolling fast in NSCollectionView lets a late thumbnail decode overwrite a recycled card unless every request carries a generation token and caps both in-flight and queued work beyond cancel().
  • Shared search state leakage. During our parity audit (213 legacy rule tests, 104 Rust workspace tests, 90 real-window interaction checks, and 69 installed-binary checks), we caught and fixed Recall state leaking into Canvas search, late media-preview callbacks hijacking clicks after pressing Space to close, and stale Enter submits racing across library switches.
  • Zero change to your data or Recall rules. Replacing the UI shell did not force users to re-import libraries, did not alter original files, and preserved existing SQLite databases, automatic color/OCR pipelines, optional model facets, and optional local Recall settings (see Finding an image you can almost remember).

Evaluating native Mac reference apps side by side? Read our Eagle alternatives for Mac comparison, or check how the same Rust core powers our local stdio MCP server.

FREQUENTLY ASKED QUESTIONS

Frequently asked questions about Linger’s native Mac architecture

Is Linger built with Electron or a WebView?

No. Linger's current macOS desktop app is built natively with AppKit, SwiftUI, ImageIO, and a shared Rust core backed by SQLite, with a small set of legacy pure scoring rules executed through system JavaScriptCore. It has no Electron or WebView runtime dependency.

Why did Linger keep a Rust core instead of rewriting everything in Swift?

Reusing the existing Rust core and runtime preserved tested SQLite storage, cross-process file locking, deduplication, untouched-original guarantees, licensing, and the standalone stdio MCP and Chrome native messaging services without maintaining two separate persistence engines.

Why does Linger require Apple Silicon and macOS 14 or later?

Targeting Apple Silicon Macs running macOS 14+ lets a small independent team build directly on modern AppKit, SwiftUI, and ImageIO APIs and ship one thoroughly tested Mac architecture instead of splitting engineering time across Intel Macs and Windows.

Does Linger plan to offer a Windows version?

No. In November 2026 we decided to stop maintaining Windows and focus exclusively on macOS. If you need a cross-platform Windows and Mac asset library, we recommend Eagle or refern.

Did the native rewrite change my existing library format or Recall model?

No. The native Mac app reads the exact same managed library folder, SQLite database, originals, optional notes, machine facets, and optional local Recall setup as earlier builds, without forcing a destructive migration or silently replacing search models.

Written by Lucius Miao

Creator of Linger

Lucius Miao builds Linger in AppKit, SwiftUI, and Rust, and documents real engineering benchmarks, regressions, and trade-offs from building local-first Mac software.

For macOS 14+ on Apple Silicon. One-time regular pricing is $39 Personal (2 Macs, 1 year of updates) or $79 Lifetime (4 Macs, all future updates). Start a 7-day full desktop trial, or choose a one-time license.