Feat/show stashes#59
Merged
Merged
Conversation
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.
Pull Request
Description
Update
repodetailsview to show stashes and changes in a tabbed viewChanges Made
repodetailsviewrepodetailsview (covers ~90%)repodetailsviewTesting
filters,output, etc...Screenshots
Checklist
Greptile Summary
This PR refactors the
repodetailsview to display uncommitted file changes and stashes in a tabbed layout, with left/right (or h/l) key navigation between tabs. New unit tests covering ~90% of the view are also added alongside atestify/assertdependency.selectedTabIndexis managed via modular arithmetic inUpdate(), andView()dispatches tobuildUncommittedFiles()orbuildStashes()depending on the active tab.main_test.go,update_test.go, and additions toview_test.govalidate tab initialization, key navigation, and rendering — but the test helper file lacks the_test.gosuffix and will be compiled into the production binary.tabStashesis declared without an explicittabKeytype in theconstblock, making it an untyped string constant that bypasses the named-type constraint.Confidence Score: 4/5
The change is self-contained and the tab navigation logic is sound; the issues found are minor conventions and design concerns that don't break runtime behaviour.
Tab switching uses correct modular wrap-around arithmetic, UpdateData keeps tab counts in sync, and the new tests cover the happy paths well. The two noteworthy items are: test_helpers.go lacking the _test.go suffix (causing helper code to land in the production binary) and selectedTab() silently mutating selectedTabIndex through a pointer receiver when called from View(), which contradicts the Elm architecture's expectation of a pure view.
internal/render/tui/repodetails/types.go (selectedTab mutation) and internal/render/tui/repodetails/test_helpers.go (missing _test.go suffix)
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[KeyPressMsg: left/h/right/l] --> B[tui update.go updateReposTable] B --> C[repodetails.Update] C --> D{Key?} D -- right / l --> E["selectedTabIndex = (index+1) % len(tabs)"] D -- left / h --> F["selectedTabIndex = (len(tabs)+index-1) % len(tabs)"] E --> G[Return updated Model] F --> G G --> H[View called] H --> I[selectedTab] I --> J{Active tab key?} J -- tabChanges --> K[buildUncommittedFiles] J -- tabStashes --> L[buildStashes] K --> M[Rendered output] L --> MReviews (1): Last reviewed commit: "docs: updated changelog" | Re-trigger Greptile