Expand hidden diff sections fully on double-click#11621
Open
bradleyjames wants to merge 1 commit into
Open
Conversation
Single-clicking a hidden-section gutter button in the diff editor still reveals one chunk at a time; double-clicking now fully expands the entire hidden section in one action. To avoid the chunk briefly flashing before the full expand, the single-click action is deferred for the system's configured double-click interval (NSEvent.doubleClickInterval on macOS, GetDoubleClickTime on Windows, 500ms fallback elsewhere) and canceled if a second click arrives. The disambiguation lives behind a new platform primitive, warpui_core::DeferredCall — a cancellable, RAII single-pending deferred callback for views. The diff-editor consumes it; future single-vs-double-click features can reuse it instead of rebuilding the timer + abort dance.
Contributor
|
This PR is not linked to an issue that is marked with Issue-state enforcement details:
To continue, link this PR to a same-repo issue such as Powered by Oz |
Contributor
There was a problem hiding this comment.
This PR is not linked to an issue that is marked with ready-to-implement.
Issue-state enforcement details:
-
Associated same-repo issues checked: none
-
Required readiness label:
ready-to-implement
To continue, link this PR to a same-repo issue such as Closes #123 in the PR description, and make sure that issue has ready-to-implement.
Powered by Oz
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.
Description
Single-clicking a hidden-section gutter button in the diff editor reveals one chunk at a time. This PR adds double-click as a shortcut to fully expand the entire hidden section in one action, instead of needing to click 3–5 times for a large hidden range.
To avoid the chunk briefly flashing before the full expand on a real double-click, the single-click action is deferred for the system's configured double-click interval (
NSEvent.doubleClickIntervalon macOS,GetDoubleClickTimeon Windows, 500ms fallback elsewhere) and canceled if a second click arrives within that window. Result: a single click feels normal (after a barely-perceptible debounce) and a double click goes straight to full expansion with no transient chunk visible.The disambiguation lives behind a new platform primitive —
warpui_core::DeferredCall— a cancellable, RAII single-pending deferred callback for views. The diff editor consumes it; any future single-vs-double-click feature can reuse it instead of rebuilding the timer + abort dance.Linked Issue
Closes #11622
ready-to-specorready-to-implement.Testing
./script/runAutomated coverage:
DeferredCallprimitive (crates/warpui_core/src/core/view/deferred_tests.rs): four cases coveringschedulefiring,cancelaborting,Dropauto-canceling, and reschedule superseding a prior pending call.test_diff_editor_double_click_fully_expands_hidden_sectionincrates/integration/src/test/code_review.rs: boots a real Warp instance, sets up a git repo with a 400-line file producing three hidden ranges, opens the code review panel, and verifies that dispatching theHiddenSectionExpansionaction withclick_count: 2fully removes the first hidden section.cargo run -p integration --bin integration -- <test_name>.Manual coverage:
Agent Mode
CHANGELOG-IMPROVEMENT: Double-click a collapsed hidden section in the diff editor to fully expand it in one action.