feat(ui): support configurable tree pane position - #295
Draft
winzamark123 wants to merge 6 commits into
Draft
Conversation
- update default keymap generation to swap h/l keys when tree is on the right - add DefaultForTreePosition and LoadOrDefaultForTreePosition helpers - pass tree position config through to keymap loaders - update UI model and navigation tests to verify correct pane switching for both tree positions
- add TreePosition type and constants (TreePositionLeft, TreePositionRight) - replace boolean treeOnRight usage in keymap and UI with the new typed enum - update option parsing to resolve string flags to the new TreePosition type - simplify Load/Default signatures in keymap package to use TreePosition - update all tests and callers to reflect the improved type safety
- remove `tree-position` option from configuration and CLI - simplify `keymap` API to default to left-side pane navigation - update documentation to remove references to tree-position settings - refactor `ModelConfig` to remove unused tree position field BREAKING CHANGE: The `tree-position` configuration option and CLI flag have been removed; the file tree and markdown TOC will now always be displayed on the left.
- add `focus_left` and `focus_right` actions to `keymap` - implement `resolveDirectionalFocus` to map spatial focus to semantic panes based on `treePosition` - remove `TreePosition` dependency from `keymap` package to simplify configuration and decoupling - update default keybindings to use `focus_left`/`focus_right` instead of fixed `h`/`l` logic - update documentation, examples, and tests to reflect the new focus logic
- refactor `resolveDirectionalFocus` to use a dynamic mapping of focus actions - consolidate tree pane X-range calculation into a helper method - unify `TestModel_FocusSwitching` using a table-driven approach - simplify tree positioning tests by explicitly asserting horizontal order
Repository owner
deleted a comment from
rickgonzalez
Aug 11, 2026
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.
What is the problem?
The file tree and Markdown TOC are fixed to the left side. Users whose navigation panes normally live on the right cannot configure revdiff to match that layout.
How does this solve it?
This adds
--tree-position=left|right, withleftremaining the default. The option is also available throughREVDIFF_TREE_POSITIONand the config file.Pane navigation becomes directional:
hfocuses the left panelfocuses the right panefocus_treeandfocus_diffremain available for semantic custom bindingsThe configured position also applies to the Markdown TOC and mouse routing.
Draft status
This is a work in progress and is not ready for review yet! I'm pretty new to Go as a language so let me know if there are any changes that doesn't follow best codebase pattern. I'd rather this be clean so I'm always open to comments.
Completed:
h/lfocusStill in progress:
Closes #279