Repository navigation
feat(ui): let the commit graph be hidden so the diff can fill the column - #83
Conversation
Closes #81. The commit graph can now be hidden, handing its space to the bottom panel (diff, history, blame and the rest), and shown again: - Mouse: a chevron at the right end of the bottom panel's tab bar. That bar is on screen in both states, so one control covers both directions. Its tooltip names the shortcut. - Keyboard: Ctrl+Shift+G (`rgitui::ToggleGraph`, rebindable), plus a "View: Toggle Commit Graph" command palette entry. The choice is saved with the rest of the layout and in saved workspaces. Settings files written before it existed load with the graph shown. The diff viewer's own height is kept while the graph is hidden, so showing it again restores the previous split. Focus follows the graph away: a hidden graph is out of the element tree, so focus left on it would strand every shortcut. Requests for the graph go to the diff viewer instead, Tab and Shift+Tab step over it, and Alt+2 and graph search bring it back rather than doing nothing. The diff viewer also loses its fixed 600px ceiling. It can grow until the graph is down to 120px, so on a tall window it is no longer held to a fraction of the column. Rendering enforces both minimums through flex constraints rather than the measured content bounds, which lag a frame behind a resize. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97952c16d3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if graph_hidden && self == Self::Graph { | ||
| Self::DiffViewer |
There was a problem hiding this comment.
Route hidden-graph focus to the visible bottom view
When the graph has focus while File History, Reflog, Submodules, Global Search, or Bisect is the active bottom mode, hiding the graph redirects focus to FocusedPanel::DiffViewer; however, focus_panel only specializes Blame and otherwise focuses the unrendered diff_viewer entity. The visible bottom view therefore receives no focus and keyboard shortcuts remain stranded until the user clicks a panel. Route this redirect according to bottom_panel_mode (or switch the mode to Diff) so it always focuses a rendered entity.
Useful? React with 👍 / 👎.
…draws Addresses the Codex finding on this PR, and a Tab-cycling case of the same bug. - Hiding the graph while it held focus handed focus to the diff viewer even when File History, Reflog, Submodules, Global Search or Bisect filled the bottom panel. The diff viewer is not drawn then, so focus was stranded and shortcuts went dead until a click. Merging main (#84) resolves it: `focus_panel(DiffViewer)` now focuses whichever view the bottom panel draws, and every route here goes through it - the render's hidden-graph redirect, Tab / Shift+Tab, Alt+4, initial focus, and the fallback when an overlay closes. - With the graph hidden and one of those views focused, Tab left focus where it was. `current_focused_panel` recognised only the diff viewer and blame, so the cycle started from nothing, at the graph, which a hidden graph resolves straight back to the bottom panel. A `ProjectTab::bottom_panel_focused` helper now covers every view the bottom panel can show, and the render's focus highlight uses it too, which also adds the Bisect view it had left out. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Thank you for that, I will try this out! 🙂 |
Changelog entry for everything since 0.4.1: #78, #79, #80, #82, #83, #84, #86, #87 and the model-picker follow-up pushed to main. The version is bumped across the workspace, and the AppStream metainfo lists 0.5.0, which the Linux metadata test requires before the crate version can move. The AI work (#79, #80, #82) had no changelog entries; it now has them, with each fix checked against the 0.4.1 code so that only bugs that shipped are listed as fixed. The model-picker fixes in #82 are folded into the feature for that reason: the picker did not exist in 0.4.1. The drafts already under [Unreleased] are checked against the code and corrected where they were off: binary, symlink, submodule and modify/delete conflicts are the whole-file cases (add/add is resolved per region), Stage All skips conflicted files rather than refusing, double-clicking the commit the current branch is on shows a toast, and the diff viewer grows until the graph is down to 120px. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #81.
What it does
The commit graph can now be hidden. The bottom panel (Diff, History, Blame, and the rest) then takes the whole centre column. Two ways to do it:
Ctrl+Shift+G(rgitui::ToggleGraph, rebindable inkeymap.json), plus View: Toggle Commit Graph in the command palette.The setting is saved with the rest of the layout and in saved workspaces. Settings files from before this change load with the graph shown. The diff viewer's height is kept while the graph is hidden, so showing it again restores your split.
Focus
A hidden graph isn't rendered, so focus left on it would silently break every shortcut. To prevent that:
Alt+2(focus graph) and graph search (Ctrl+F,/) bring the graph back rather than doing nothing.Diff viewer height (separate fix)
The diff viewer no longer stops at a fixed 600px. Dragging the splitter or
Ctrl+Downcan now grow it until the graph is down to 120px. On a tall window the diff is no longer stuck at a fraction of the column.Rendering applies both minimums with flex constraints rather than the measured content size. The measurement lags one frame behind a window resize, and I saw that in the running app: after a maximise, the panel stayed at the old size until something else caused a repaint.
Testing
cargo clippy --workspace --all-targets -- -D warnings, with and without--features rgitui/perf.cargo test --workspace.docs/KEYBINDINGS.mdanddocs/keymap.schema.jsonwithRGITUI_BLESS=1, and updated the README shortcut table.Ctrl+Shift+Ghides it.Ctrl+Downgrows the diff to about 830px, leaving about three rows of graph.Found along the way (not changed here)
maintoo, and release builds are fine. For a runnable debug binary:cargo rustc -p rgitui --bin rgitui -- -C link-arg=/STACK:16777216.Ctrl+Shift+Gright after using the palette to toggle. A fix would likely be settingpending_focus_restoreonCommandSelectedandDismissed. It's a separate change.Both items above were fixed by #84, which is now merged into this branch.
Review fixes (0d94585, 9302c92)
main(fix: hand focus back when overlays close, and raise the Windows stack #84) fixes it:focus_panel(DiffViewer)now focuses whichever view the bottom panel draws, and every redirect here goes through it.ProjectTab::bottom_panel_focusednow covers every bottom-panel view. The render's focus highlight also uses it, which adds Bisect to the highlight.Verified on the merged tree with
cargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warningsandcargo test --workspace(1737 passed, 0 failed).🤖 Generated with Claude Code