Add --collapsed flag to start in collapsed diff mode#14
Merged
Conversation
allow users to persist collapsed mode preference via CLI flag, config file, or REVDIFF_COLLAPSED env var
There was a problem hiding this comment.
Pull request overview
Adds a --collapsed startup option so revdiff can begin in collapsed diff mode (mirroring the existing --wrap pattern) and wires it through CLI/config/env into the UI model.
Changes:
- Add
Collapsedtoui.ModelConfigand initialize the model’s collapsed state from config. - Add
--collapsed/REVDIFF_COLLAPSED/collapsed = trueoption plumbing incmd/revdiff. - Document the new flag and add argument/model config tests.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ui/model.go | Adds ModelConfig.Collapsed and initializes collapsed mode from config at model creation. |
| ui/model_test.go | Adds tests for collapsed mode config defaulting; adjusts an existing navigation comment. |
| cmd/revdiff/main.go | Introduces --collapsed CLI/config/env option and passes it to ui.NewModel. |
| cmd/revdiff/main_test.go | Adds coverage for parsing --collapsed via flag/env/config. |
| README.md | Documents the new --collapsed option and env var. |
| .claude-plugin/skills/revdiff/references/config.md | Updates config reference table with --collapsed. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ui/model_test.go
Outdated
| assert.Equal(t, 2, model.diffCursor, "cursor should move to second match") | ||
|
|
||
| // N should navigate to previous search match | ||
| // n should navigate to previous search match |
There was a problem hiding this comment.
The comment says n navigates to the previous search match, but this assertion is for the N (uppercase) key. Update the comment to match the behavior being tested to avoid confusion when reading/debugging the test.
Suggested change
| // n should navigate to previous search match | |
| // N should navigate to previous search match |
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.
Add
--collapsedCLI flag to start revdiff in collapsed diff mode by default.--collapsed, config filecollapsed = true, env varREVDIFF_COLLAPSED--wrapflag pattern exactly~/.config/revdiff/configand toggle withvper-session