File path in the header: the directory is muted, the basename emphasized.
prev *
string
n/a
Pre-change source. Diffed against next via the LCS computeLineDiff.
next *
string
n/a
Post-change source. Pass prev="" for a new file (all-added).
language
'typescript' | 'kotlin' | 'swift'
n/a
Drives the cyan-soft language pill in the header.
view
'unified' | 'split'
'unified'
Unified (one column, +/- gutter) or split (old left / new right, equal columns).
collapseContext
number
0
Fold unchanged runs longer than this behind an Expand control. 0 = never fold. Unified only.
The header shows a +N / -M add/remove stat (warm status), each hunk gets an
@@ -a,b +c,d @@ band, and a removed→added pair gets an intra-line word
highlight on the changed span. Added = status.success wash, removed =
status.error wash, context = muted, never the brand cyan, never color-alone.
Parameter
Type
Default
Description
filePath *
String
n/a
DiffView header path; the basename is shown beside the EditNote icon.
diffLines *
List<DiffLine>
n/a
From computeLineDiff(old, new). Each DiffLine(type, text, lineNumber) is ADDED / REMOVED / UNCHANGED.
newContent *
String
n/a
The resulting content the header copy button writes to the clipboard.
old / new
String
n/a
computeLineDiff(old, new) inputs. old = "" → all-green new file; returns emptyList() past 500 combined lines (raw fallback).
DiffLineType
enum
n/a
ADDED · REMOVED · UNCHANGED. Drives the wash (success / error / transparent) + the + / - / space prefix.
SwiftUI ships no diff viewer. Voice has no Edit/Write tool surface yet, so there
is nothing to diff; a before/after would be two raw .monospacedText blocks.
Style
Type
Default
Description
.font(.system(design: .monospaced))
View modifier
n/a
The only mono affordance today: no file header, gutter, +/- glyph, washes, hunks, or split. Queued behind the Code block surface.
Cross-platform drift (tracked for reconciliation)
Sourced from the shipped Android DiffView + computeLineDiff; these are the real divergences:
Split view, hunk @@ headers, +N/-M stats, intra-line word highlight, and
collapse/expand(resolved): these are web-only
(documented). Android’s DiffView stays a single unified column (one gutter, +/- prefix,
warm washes); the richer affordances are the dedicated web viewer’s, not a drift to reconcile.
Swift has no component. Voice ships no diff (no tool-call surface). The web/Compose
API is the target; Swift is queued.
Line numbers(resolved): line numbering unifies on
the dual oldNo / newNo shape everywhere. Android (today one DiffLine.lineNumber) adopts
the dual-number model the web computeLineDiff already carries.
Language pill: there is no file-type token for Swift, so its pill falls back
to a categorical violet. Add file-type.swift when Voice gains a real surface.