Expand hidden diff sections fully on double-click#11621
Conversation
|
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 |
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
|
@oz-agent assuming the issue will be flipped to ready-to-implement soon, can you review the PR? |
|
Hi @bradleyjames — a reviewer requested changes on this PR and it hasn't had activity from you in 7 days. When you get a chance, please push updates or reply to the review so a reviewer can take another look. Without activity, this PR will be automatically closed after 30 days of inactivity. |
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.
Adds product.md and tech.md under specs/GH11622/ documenting the double-click-to-fully-expand feature implemented in d8d497e. Per CONTRIBUTING.md, feature requests go through a spec PR before code; the spec and implementation share this branch. product.md captures 11 testable behavior invariants and the before/after user experience. tech.md describes the context, the DeferredCall primitive, the platform double-click interval shim, the click_count plumbing through EditorWrapper, and a testing table mapping each invariant to its automated coverage.
4505569 to
89f9b4f
Compare
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:
Single Clicks - Reset - Double Click
https://github.com/user-attachments/assets/e31221db-f70c-46c0-8826-2ec7afc82e3c
Agent Mode
CHANGELOG-IMPROVEMENT: Double-click a collapsed hidden section in the diff editor to fully expand it in one action.