Skip to content

Expand hidden diff sections fully on double-click#11621

Open
bradleyjames wants to merge 2 commits into
warpdotdev:masterfrom
bradleyjames:brad/BRAD-expand-all
Open

Expand hidden diff sections fully on double-click#11621
bradleyjames wants to merge 2 commits 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.

Single Clicks - Reset - Double Click
https://github.com/user-attachments/assets/e31221db-f70c-46c0-8826-2ec7afc82e3c

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.

@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
@bradleyjames
Copy link
Copy Markdown
Contributor Author

@oz-agent here's the issue and yes, it's not marked as ready-to-implement yet: #11622

@bradleyjames
Copy link
Copy Markdown
Contributor Author

@oz-agent assuming the issue will be flipped to ready-to-implement soon, can you review the PR?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 7, 2026

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.
@bradleyjames bradleyjames force-pushed the brad/BRAD-expand-all branch from 4505569 to 89f9b4f Compare June 7, 2026 22:54
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