feat: add navigation, help overlay, yank, CLI parsing and file history - #7
Merged
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f863e4a33a
ℹ️ 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".
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.
Move the details/diff/files fetch onto a worker thread and add the
bindings users of this kind of tool expect.
Fetches were synchronous: opening the Diff pane on a large commit read
the entire patch into a
Vec<String>on the UI thread, and everyselection change while a pane was open re-read it. DetailWorker now
does that work off-thread, with three separate guarantees: requests
coalesce (drain the queue, keep the last) so a keypress burst costs one
fetch; replies carry a sequence number so a slow fetch cannot repaint a
pane the user has already left; and
cancel()stops a closed pane beingrepopulated. The main loop polls on the tick it already had.
Navigation:
g/GandHome/Endfor the top and bottom of the focusedpane,
PageUp/PageDownby a screenful, andJ/Kto walk commits with apane open so a diff can be followed down the history.
Discoverability:
?opens a modal keymap overlay. The keymap is data inui::help, so the same table is rendered, measured, and checked by atest that fails when main.rs handles a key the overlay omits. The
status bar had room for about eight bindings.
ysends the selected commit's full hash to the terminal via OSC 52,which works over SSH and needs no dependency. The message reads "sent
to clipboard" because OSC 52 gives no acknowledgement.
Arguments are parsed before the terminal enters raw mode, so
--helpprints to a normal screen instead of being handed to
Repository::discover as a path named "--help". Unknown flags are anerror with a non-zero exit rather than a mystery repository.
l in the changed-files pane scopes the graph to that path, Esc leaves.
file_history decides "touched" by comparing the blob oid at the path
against the first parent, matching
git log -- <path>; the filtered listis laid out with
GraphEngine::build_linearbecause the graph engineholds a lane open for parents that filtering removed, and would widen
into a staircase one lane per row.
Also fixes a pre-existing bug in the refs pane: it copied its
ListStateby value before rendering, discarding the scroll offset the widget
wrote back, which pinned the pane to its first screenful.