Skip to content

Native macOS Architecture & UI System

Kalc is built from the ground up as a first-class macOS citizen using Apple's AppKit and modern TextKit 2 text layout architectures. It eschews cross-platform abstractions in favor of native macOS controls, fluid animations, and deep system integrations.


The TextKit 2 Editor Core (KalcTextView)

At the center of Kalc is a custom NSTextView backed by NSTextLayoutManager and NSTextContentStorage:

  • Vertical Line Fragment Centering: TextKit 2 aligns text baselines with strict vertical centering, eliminating the subtle jitter and baseline wobble common in cross-platform editors.
  • Configurable Typography: Choose from high-legibility coding typefaces:
    • JetBrains Mono
    • SF Mono
    • Geist Mono
    • Menlo
    • Courier New
    • System Monospaced
  • Baseline Rhythm: Four configurable line height rhythms to fit your density preference:
    • Compact: 20 pt
    • Standard: 24 pt (Default)
    • Relaxed: 28 pt
    • Spacious: 32 pt
  • Animated Cursor Glow: A subtle, breathing mint glow around the insertion point that enhances visual focus without distraction.
  • Interactive Number Scrubbing: Hold (Option) and drag across any numeric literal to dynamically tweak its value in real time.

Synchronized Results Gutter (ResultGutterView)

Unlike standard calculators where output replaces input, Kalc renders results in a dedicated, right-aligned rail pinned beside your text.

1:1 Fragment Baseline Synchronization

When an expression wraps across multiple visual lines due to window resizing, the result does not stick to the top line. Instead, ResultGutterView aligns with the baseline of the final visual line fragment, ensuring that results always feel anchored to the conclusion of your thought.

600ms Ease-Out Flash Animations

Whenever a value recalculates (for instance, when you scrub a number on line 1 and line 20 updates), the result flashes with a smooth 600ms ease-out pulse. This gives you instant visual confirmation of which lines were affected by your change.

Responsive Reflow Mode

When the gutter width shrinks below 160 pt or the window width is compressed below 640 pt, results automatically reflow cleanly beneath their respective expression lines rather than being clipped.

One-Click Clipboard Copy

Clicking any result in the gutter immediately copies its formatted value to your macOS pasteboard and displays a non-modal confirmation toast.


Obsidian Kinetic Visual Design System

Kalc features Obsidian Kinetic, a dark-first design system calibrated for high contrast, low eye fatigue, and typography hierarchy.

The 8 Curated Themes

ThemeCanvasAccents & ResultsMood & Use Case
Obsidian Dark (Default)Deep Charcoal (#0E1118)Mint (#10B981), Glow (#34D399), Violet (#8B80F8), Amber (#FBBF24)Calm, distraction-free environment for deep work.
Midnight SlateGitHub Dark Slate (#0D1117)Electric Cyan (#58A6FF), Soft Green (#7EE787)Tailored for software engineers and dark code editors.
High Contrast OLEDPitch Black (#000000)Neon Mint (#00FF88), Vivid Purple (#BB86FC)Optimized for OLED MacBook displays and low-light environments.
NordArctic Polar Night (#2E3440)Frost Cyan (#88C0D0), Aurora Teal (#8FBCBB), Violet (#B48EAD)Clean, icy Scandinavian aesthetic with soft balanced contrast.
Tokyo NightDeep Tokyo Indigo (#16161E)Cyber Teal (#73DACA), Cyan (#2AC3DE), Neon Purple (#BB9AF7)Modern, vibrant dark aesthetic inspired by nocturnal cityscapes.
Paper LightWarm Off-White (#F6F8FA)Emerald (#059669), Deep Purple (#7C3AED), Dark Ink (#1F2328)Crisp, daylight editorial reading mode.
Solarized LightWarm Cream & Parchment (#FDF6E3)Solarized Teal (#2AA198), Blue (#268BD2), Warm Amber (#B58900)Timeless analog reading paper aesthetic, easy on tired eyes.
Catppuccin LatteSoothing Latte White (#EFF1F5)Latte Green (#40A02B), Teal (#179299), Lavender (#8839EF)Warm pastel modern light theme with soft contrast.

System Integrations

Clicking the Kalc menu-bar icon (or pressing your configured global hotkey) summons a lightweight scratchpad popover:

  • Allows fast calculations without switching focus away from full-screen apps or IDEs.
  • Pressing Esc dismisses the popover while preserving your text.
  • Click the Expand button in the top right to promote your scratchpad into the main multi-tab window.

Global Carbon Hotkeys (HIToolbox)

Kalc registers system-wide global hotkeys via Apple's low-level Carbon framework (RegisterEventHotKey). Presets include:

  • ⌥ Space (Option + Space)
  • ⇧ ⌘ N (Shift + Command + N)
  • ⌥ ⌘ Space
  • Fully customizable key combinations recorded via Preferences.

Command Palette (⌘ K)

A centered modal HUD that allows you to trigger document actions, insert formula templates, convert units, switch themes, or jump to settings without lifting your hands from the keyboard.

Formula Templates Browser (⇧ ⌘ T)

A searchable catalog of ready-to-use computational templates across Finance, Commerce, Engineering, Physics, and Fitness. Features a split-view preview with a live synchronized evaluation gutter.

Plain-Text .kalc Files & Autosave

  • Git-Friendly: Kalc documents save as UTF-8 plain-text files using the .kalc extension. They can be version-controlled, grepped, and opened in any text editor.
  • Atomic Scratchpad Autosave: Your open tabs, cursor positions, and scroll offsets are continuously saved to ~/Library/Application Support/Kalc/scratchpad.json. Quitting or restarting macOS immediately restores your exact workspace state.

Native macOS Computational Notepad • Pure Swift with Strict Concurrency