fix(7) [orphan/adopt]: properly display checked out branches#33
Merged
fix(7) [orphan/adopt]: properly display checked out branches#33
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.
fixes #7
This pull request refactors how branch trees are rendered and displayed in the CLI, especially after operations like adopt, orphan, and reparent. The main change is the introduction of a new
render_focused_context_treefunction, which allows for more flexible and accurate rendering of the current branch context, including handling of orphaned branches and improved visibility logic. Additionally, the tree rendering logic and data structures have been updated to support these new features, and several tests have been added or updated to ensure correctness.Rendering and visibility improvements:
Added a new
render_focused_context_treefunction to handle rendering the focused branch context, including support for suffixes (such as marking a branch as "(orphaned)"). This function is now used in the adopt, orphan, reparent, and sync CLI commands, replacing the previous two-step approach of building a view and then rendering it. [1] [2] [3] [4] [5] [6]Enhanced the
TreeViewstruct to includecurrent_branch_name,is_current_visible, andcurrent_branch_suffixfields, enabling more nuanced rendering of the current branch and its visibility.Updated the tree rendering logic in
render_stack_treeto display the current branch at the bottom of the tree if it is not visible in the main tree structure, including support for suffixes (e.g., "(orphaned)").Tree building and filtering logic:
Rendering style changes:
Testing improvements: