Skip to content

feat(review): diff display options with ConfigStore integration#428

Merged
backnotprop merged 7 commits intomainfrom
feat/pierre-conf
Mar 29, 2026
Merged

feat(review): diff display options with ConfigStore integration#428
backnotprop merged 7 commits intomainfrom
feat/pierre-conf

Conversation

@backnotprop
Copy link
Copy Markdown
Owner

Summary

  • Exposes @pierre/diffs display options as user-configurable settings: overflow (scroll/wrap), diff indicators, inline diff granularity, line numbers, and diff backgrounds
  • Integrates all diff options (including the existing diffStyle toggle) into the ConfigStore system — persisted via cookies and synced to ~/.plannotator/config.json under a diffOptions namespace
  • Adds a Display tab to the review-mode Settings dialog with segmented controls and toggle switches
  • Adds a Scroll/Wrap toolbar toggle for quick access to the primary feature (line wrapping)
  • Fixes ConfigStore write batching to use deep-merge, preventing nested key clobbering when multiple diff options change within the 300ms debounce window

Closes #421

Test plan

  • Open review UI — verify default behavior is unchanged (scroll, split, bars indicators, word-alt diff, line numbers on, backgrounds on)
  • Toggle Wrap in toolbar — long lines wrap correctly, line numbers stay aligned
  • Toggle Wrap in split mode — custom resizable dragger hides, Pierre handles grid layout natively
  • Open Settings > Display tab — all 6 options visible, changes take effect immediately
  • Close and reopen review — settings persist (cookies)
  • Check ~/.plannotator/config.jsondiffOptions object present after changing settings
  • Change two options quickly — both persist to config.json (deep merge batching)
  • Existing review-diff-style cookie users — value migrates to new plannotator-diff-style key

…pport

Extends the server-side config system to support diff display options
namespaced under `diffOptions` in ~/.plannotator/config.json. The
saveConfig deep-merge ensures partial writes (e.g. changing only
overflow) don't clobber sibling keys.

For provenance purposes, this commit was AI assisted.
All six server handlers (plan, review, annotate x Bun + Pi) now
whitelist diffOptions alongside displayName, forwarding it to
saveConfig for deep-merged disk persistence.

For provenance purposes, this commit was AI assisted.
…tching

Adds 6 diff option settings to the ConfigStore registry (diffStyle,
diffOverflow, diffIndicators, diffLineDiffType, diffShowLineNumbers,
diffShowBackground), all synced to disk under the diffOptions namespace.

Fixes write batching for nested server keys — replaces Object.assign
with deepMerge so rapid changes to multiple diff options within the
300ms debounce window don't clobber each other. Includes legacy cookie
migration for the old review-diff-style key.

For provenance purposes, this commit was AI assisted.
Migrates diffStyle from raw cookie storage to ConfigStore. Reads all 6
diff options via useConfigValue and forwards them to FileDiff: overflow,
diffIndicators, lineDiffType, disableLineNumbers, disableBackground.

Adds a Scroll/Wrap toolbar toggle alongside the existing Split/Unified
toggle. Disables the custom resizable split dragger in wrap mode since
Pierre manages its own grid layout. Fixes the unsafeCSS grid override
to only target scroll mode, preventing per-character wrapping in split
view.

For provenance purposes, this commit was AI assisted.
Adds a Display tab when Settings is in review mode, exposing all 6 diff
options: Diff Style, Line Overflow, Change Indicators, Inline Diff
Granularity, Show Line Numbers, and Show Diff Background. Changes take
effect immediately and persist via ConfigStore (cookie + disk).

Extracts reusable SegmentedControl and ToggleSwitch helpers for the
review display controls.

For provenance purposes, this commit was AI assisted.
For provenance purposes, this commit was AI assisted.
@backnotprop
Copy link
Copy Markdown
Owner Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

Add new diff display props to the search highlight and scroll-to-match
effect dependency arrays so highlights are restored after Pierre re-renders.

For provenance purposes, this commit was AI assisted.
@backnotprop backnotprop merged commit 9b016da into main Mar 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQUES] Word wrap toggle in code review diff viewer

1 participant