Skip to content

Expand hidden diff sections fully on double-click#11621

Open
bradleyjames wants to merge 1 commit into
warpdotdev:masterfrom
bradleyjames:brad/BRAD-expand-all
Open

Expand hidden diff sections fully on double-click#11621
bradleyjames wants to merge 1 commit into
warpdotdev:masterfrom
bradleyjames:brad/BRAD-expand-all

Conversation

@bradleyjames
Copy link
Copy Markdown
Contributor

@bradleyjames bradleyjames commented May 24, 2026

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.doubleClickInterval on macOS, GetDoubleClickTime on 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

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

  • I have manually tested my changes locally with ./script/run

Automated coverage:

  • Unit tests for the new DeferredCall primitive (crates/warpui_core/src/core/view/deferred_tests.rs): four cases covering schedule firing, cancel aborting, Drop auto-canceling, and reschedule superseding a prior pending call.
  • Integration test test_diff_editor_double_click_fully_expands_hidden_section in crates/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 the HiddenSectionExpansion action with click_count: 2 fully removes the first hidden section.
  • All six pre-existing code-review integration tests still pass alongside the new one — verified locally with cargo run -p integration --bin integration -- <test_name>.

Manual coverage:

  • Single-click on large hidden section → chunked expansion after ~500ms debounce, no flash.
  • Double-click on the same section → full expansion immediately, no chunk visible mid-flight.
  • Two slow single-clicks (>OS double-click window apart) → each chunks independently.
  • Adjacent gutter interactions (diff-hunk sliver toggle, add-context, revert) unchanged.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-IMPROVEMENT: Double-click a collapsed hidden section in the diff editor to fully expand it in one action.

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.
@cla-bot cla-bot Bot added the cla-signed label May 24, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 24, 2026

@bradleyjames

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

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bradleyjames

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

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Double-click hidden-section gutter button to fully expand the section

1 participant