feat(review): configurable default diff type#531
Open
backnotprop wants to merge 3 commits intomainfrom
Open
Conversation
Change the default review diff type from "uncommitted" to "unstaged"
(matching `git diff` semantics) and make it user-configurable via
Settings > Display. A first-run dialog prompts users to choose their
preferred default on their first local review session.
- Add `defaultDiffType` to DiffOptions config (unstaged/uncommitted/staged)
- Add `resolveDefaultDiffType()` helper in shared config
- Register setting in config store with cookie + config.json sync
- Add SegmentedControl in ReviewDisplayTab
- Add DiffTypeSetupDialog with sequenced display (waits for AI setup)
- Wire config into all three entry points (hook, opencode, pi)
- Preserve P4 default ("p4-default") in hook entry point
Closes #287
Co-authored-by: Hendrik Richert <hendrik.richert@swisscom.com>
For provenance purposes, this commit was AI assisted.
|
Seems like a reasonable default (same as with git by default actually). Thanks! |
Gate dialog for P4 users, fix race condition between AI capabilities check and dialog display, and use conditional rendering to prevent stale config state. For provenance purposes, this commit was AI assisted.
Import DefaultDiffType from @plannotator/shared/config instead of duplicating the type locally. Pass the selected diff type back through onComplete so the current review switches immediately when the user picks a different default. For provenance purposes, this commit was AI assisted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
uncommittedtounstaged(matchinggit diffsemantics)~/.plannotator/config.jsonp4-default) for Perforce usersInspired by #521 from @hrichert. Rather than a CLI flag, we made the default a persistent setting with a first-run prompt.
Related: #287
Test plan
/plannotator-reviewon a fresh install (clearplannotator-diff-type-setup-donecookie) — verify the setup dialog appears~/.plannotator/config.jsonhasdiffOptions.defaultDiffType/plannotator-review— verify the dialog does not reappear and the selected default is used