feat(desktop): offer every stage-cli diff setting in a Files changed popover
Summary
Third in the Pierre stack, now on main. #3229 and #3233 have merged.
The developer asked for all of stage-cli's diff viewing settings (diff-settings-form.tsx, use-diff-settings.tsx, diff-typography.ts), built from Luke's own controls and mirrored on the Settings page. They chose:
-
system fonts only;
-
today's look as the defaults;
-
line numbers and wrap shared with the File tab;
-
option A: real app settings.
-
App settings. Every diff setting, plus the File tabs' line numbers and word wrap, is now an
APP_SETTING_SCHEMAentry, stored in Luke's settings file.- They are drawn as schema rows in a new Diffs group on Settings › Appearance.
- The Settings search finds them, they reset with Appearance, and every window gets them on the settings document.
- Each has an id in
APP_SETTING_ID. - The words a diff is drawn by (layouts, indicators, inline diffs, fonts, sizes, line heights, syntax themes, and their labels) move to
@luke/settings/diff-view, a door that imports nothing. The diff bundle reads it without pulling in the settings machinery. - A schema choice row can now search (
choiceSetting({ search })→SelectRowplaceholder), as the two theme rows do.
-
Diff settings button in the Files changed bar, beside the ⋯. It opens a popover that reads and writes the same settings through the one settings write (
useAct().updateSetting):- Layout: Unified / Split. Below 640px the diff draws unified and the row says "Needs a wider panel".
- Indicators: Classic (+/-) / Bars / None.
- Inline diffs: Word-alt / Word / Character / None.
- Backgrounds, Word wrap, Line numbers.
- Dark theme and Light theme, each kept separately and searchable. These are Shiki's bundled themes of that appearance plus Pierre's two, each loaded lazily as a chunk.
- Font: SF Mono / Menlo / Monaco / Courier New / Andale Mono, all shipped with macOS, so nothing is fetched.
- Font size: 10–15px plus 11.5.
- Line height: Compact / Normal 1.6 / Spacious.
- Ligatures and Minimize inline comments (the next PR reads the latter).
-
Style. It follows an audit against the app's own style. Rows are in groups set apart by rules, like the context popover. Segmented rows wrap like Settings' rows do. The popover has the context popover's look, enter motion, and contained scroll. Labels are sentence case, and each row shows the settings' changed mark.
-
⋯ menu. It keeps the Split view and Highlight changed words quick toggles.
-
Bundle.
DiffLookcarries every setting. Pierre gets them as options, and the type is set through--diffs-font-*on the host via the CSSOM, so the CSP holds. The theme's own ground fills the diff, and the GitHub defaults match the File tab. -
Also includes a fix Devin flagged on #3233 after that PR was queued: a diff is drawn again when
excerptchanges.
Evidence
-
agent-changes-tab.test.tscovers:- the default look;
- the popover setting layout, indicators, ligatures and backgrounds for this view and the next;
- Highlight changed words;
- the narrow fallback, with the popover saying so.
The settings come from main's document through a new
#testing/app-statehandSettingsfake, which stores each write and delivers the document again, as main does. -
desktop-settings.test.tschecks that Appearance draws the 13 rows in a Diffs group, and that the Settings search finds "Minimize inline comments" and "Dark theme" under Appearance alone. -
settings-store.test.tschecks that each new field survives a reopen with a non-default value. -
pnpm check:affectedis green exceptsrc/main/app-menu.test.ts, which can't load Electron in the sandbox (environmental; CI installs Electron).mainre-recorded the bundle budget meanwhile, and this branch builds within it.
Notes
- File tab line numbers and word wrap used to live in this window's localStorage (
luke.file-view). A choice kept there isn't carried over, so it starts again at the default (on). No migration was written. - Each popover change is now counted like any setting change: the setting's id only, never its value.
- Next: inline review comments in Files changed (#3245), restacked on this.