fix(app): keep diff typography and colours native to the host

This commit is contained in:
2026-10-21 18:40:49 +01:00
parent ada25a59e5
commit 32e1cac46f
10 changed files with 63 additions and 210 deletions
+27 -16
View File
@@ -1,8 +1,22 @@
# D1 — run changes and the file diff viewer
New feature under `lib/features/changes/` plus a bundled code font. The only
tracked-file change is `pubspec.yaml` (the font family/assets declaration that
Flutter web needs); no server, web or Android changes.
New feature under `lib/features/changes/`; no server, legacy web/Android or
pubspec changes remain after manager acceptance corrections.
## Current manager acceptance (supersedes earlier presentation evidence below)
The pipeline's bundled font and fixed green/red palette were rejected against
the user's native-defaults requirement. Manager removed both and the font assets
without changing raw patch, capture or visit semantics. Typography inherits the
host; colours use native semantic roles and no row tint. The original candidate
and its review evidence remain referenced at15cca17; later font/palette evidence
in this note is historical, NOT evidence for the final native-defaults patch.
Updated regressions failed against the original overrides, then all47 focused
tests passed after correction; analyzer clean. Fresh fixture web build and
changes_probe passed (including absence of custom font), producing18 new captures
under approved temp/native-diff-manager-captures. Manager inspected both native
phone2x rendered views. Preview/shell integration and mobile remain unverified.
## Public API
@@ -105,13 +119,12 @@ The manager owns shell/run-detail registration; this item does not edit them.
keeps each recorded line on one line and scrolls sideways, like the web's
`white-space: pre` pane, so a wrapped continuation can never be mistaken for a
new patch line.
- Code text uses **Roboto Mono**, bundled as `assets/fonts/RobotoMono.ttf` and
declared in `pubspec.yaml`. Flutter web's CanvasKit cannot resolve a system
`monospace` family, so before the bundle the browser diff rendered in a
proportional face. The font is SIL OFL 1.1; its licence ships beside it as
`assets/fonts/OFL.txt`. The size, weight and text scaler come from the theme
style, so code follows the operator's text size; no fixed content
width/height.
- Patch/path text inherits the native host typography without a font-family,
size or weight override. Manager removed the candidate's bundled code font:
a previous visual review requested it, but that contradicts the user's
explicit native-defaults requirement, which also applies to diffs. The web
default may be proportional; no monospace guarantee is claimed. Raw patch
bytes are unchanged. No bundled font or pubspec change remains.
- Rendered/Raw is a native Material `SegmentedButton` or Cupertino
`CupertinoSlidingSegmentedControl`. Copy patch and Close are native Material
buttons/icon button or Cupertino buttons with exact labels.
@@ -121,12 +134,10 @@ The manager owns shell/run-detail registration; this item does not edit them.
- Binary uses the honest binary message; truncated-with-patch shows the note plus
the retained text; truncated-without-patch and mode-only show the recorded
reason, never an invented empty diff.
- Additions and removals use distinguishable theme-aware hues, never two shades
of one container role: light `#116B33` text on `#E3F3E7` for additions and
`#B3261E` on `#FBE7E5` for removals; dark `#7FE0A8` and `#FF9E9E` on a 16%
wash of the same hue. `+N` and `-M` are separate spans in those hues. Each
changed line paints a tint across the whole hunk content width (at least the
dialog width), so short lines no longer produce short colour bars.
- Add/remove markers and stats use native semantic colours (Material primary/
error; Cupertino systemGreen/destructiveRed), with no bespoke palette or added
tint. +/- and recorded gutter numbers distinguish changes without colour.
Rows share the hunk width, at least the dialog width.
- A Cupertino list row lets its recorded path wrap instead of inheriting the
tile's single ellipsized line, and the Cupertino dialog surface is inset from
the window edge (16 on phones, 40 on wide windows) so its native rounded