Built · one session, about four hours
Spaced
A native macOS reader that shows a markdown document one sentence, paragraph or section at a time, built for getting through long documents and agent output with an ADHD-like brain. Space moves on.
Built with: Swift · AppKit · SwiftUI · swift-markdown · NaturalLanguage · AVSpeechSynthesizer
I wanted a macOS app to make reading long documents, and especially agent output, easier for people with ADHD short attention-spans. Show only one paragraph at a time, and hitting the spacebar moves to the next one. Let me leave notes on each section as I read, which I can review and copy at the end as blockquotes and responses. And let me write down the question I’m trying to answer before I start, and keep it visible the whole time, as a reminder of why I’m reading this at all.
I wrote the first version in about an hour, instead of actually reviewing another long document. Building a document reader was more interesting than reviewing the document.
Spaced is the result. The current piece sits in a bordered box over a dimmed, blurred copy of the page, so you can see where you are without being able to read ahead. You can read by sentence, by paragraph or by section, and the styling is very minimal (think Bear and mostly white). There’s a parking lot for stray thoughts that arrive mid-document, reading aloud with the spoken word highlighted, and tabs that survive the app being killed.
The part I didn’t ask for and now can’t do without is spaced --wait. A coding agent runs it with a document, the app opens it as a tab, and the command blocks until I press “Send Notes & Close”, at which point my notes come back on standard output as quoted text and responses. The agent gets a review; I get to read its plan the way my brain works.
How it was built
Swift, as a package built with only the Xcode Command Line Tools, since Xcode isn’t installed on this machine. An AppKit shell owns the windows, native tabs and menu, and hosts SwiftUI views. The markdown is parsed with Apple’s swift-markdown and flattened into blocks in reading order: headings, paragraphs, list items, table rows carrying their column headers, code blocks, quotes. Sentences come from the NaturalLanguage tokenizer. A navigator moves a position through those at one of three focus levels, and that is the whole “Space moves on” idea:
public mutating func next() -> Bool {
guard !document.isEmpty else { return false }
let lastBlock = document.blocks.count - 1
switch level {
case .sentence:
if position.sentence + 1 < document.blocks[position.block].sentences.count {
position.sentence += 1
return true
}
guard position.block < lastBlock else { return false }
position = Position(block: position.block + 1)
case .block:
guard position.block < lastBlock else { return false }
position = Position(block: position.block + 1)
case .section:
let section = document.blocks[position.block].section
guard section + 1 < document.sections.count else { return false }
position = Position(block: document.sections[section + 1].blocks.lowerBound)
}
return true
}
The --wait handover is just files. The CLI writes a request into Application Support and launches the app; the app watches that folder, opens the tab and remembers the request id; when the review is sent it writes a result file, which the CLI is polling for. No sockets, no URL scheme, and it survives the app restarting mid-review. Tabs persist the same way, as one JSON file each, rewritten on every change.
Things that didn’t work the first way: SwiftUI’s @State is a macro in the current SDK and the Command Line Tools don’t ship the macro plugin, so view state lives in observable models instead. Re-serialising markdown nodes to get inline formatting left stray indentation and quote prefixes inside lists, so the attributed strings are now built straight from the syntax tree. And table columns took three attempts before “give every column room for its longest word first, then share the rest”.
About 2,800 lines of Swift including the tests, in ten commits over one evening. Open source under MIT.