Skip to content

Ripple effect for Mouse Highlighter - #48232

Merged
Niels Laute (niels9001) merged 6 commits into
mainfrom
dev/crutkas/ripple_v2.1
Jun 26, 2026
Merged

Niels Laute (niels9001) merged 6 commits into
mainfrom
dev/crutkas/ripple_v2.1

Conversation

@crutkas

@crutkas Clint Rutkas (crutkas) commented May 31, 2026 •

Copy link
Copy Markdown
Member

Summary of the Pull Request

Adds a follow-up metadata fix to the existing Mouse Highlighter ripple v2.1 work by allowing the term xhair in repo spell-check configuration.

PR Checklist

  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

  • Added xhair to .github/actions/spell-check/expect.txt.
  • This addresses spelling feedback on MouseHighlighter ripple/crosshair code without changing runtime behavior.
  • No functional changes to Mouse Highlighter logic were made in this follow-up commit.

Validation Steps Performed

  • Verified the only content change is the new xhair entry in spell-check expected words.
  • Ran secret scanning on changed file (.github/actions/spell-check/expect.txt) with no findings.
  • Ran parallel validation:
    • Code Review: no issues.
    • CodeQL: skipped as trivial metadata-only change.
@github-actions

This comment has been minimized.

@crutkas

Copy link
Copy Markdown
Member Author

Copilot add xhair to spelling allow list

Copilot AI commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Copilot add xhair to spelling allow list

Added xhair to the spell-check expected-word list in commit 17ed28f.

Copilot AI changed the title Dev/crutkas/ripple v2.1 Jun 3, 2026
@crutkas
Clint Rutkas (crutkas) marked this pull request as ready for review June 5, 2026 05:28
@niels9001 Niels Laute (niels9001) added Area-Localization issues regarding to Localization the application Product-Mouse Highlighter Product-Settings The standalone PowerToys Settings application and removed Product-Settings The standalone PowerToys Settings application Area-Localization issues regarding to Localization the application labels Jun 5, 2026
Clint Rutkas (crutkas) and others added 4 commits June 5, 2026 21:59
Adds a third "Ripple" option to the Mouse Highlighter Highlight-mode picker
(alongside the existing Spotlight and Circle modes), inspired by
aurorascharff/ClickLight. Each click spawns a fast cubic-ease-out pulse
composed of an expanding stroked ring and a softer glow halo that fade out
independently, so rapid clicks stack without waiting for the previous pulse.

Implementation details:
- Animates EllipseGeometry.Radius (Vector2KeyFrameAnimation) and
  CompositionColorBrush.Color with CubicBezier(0.215, 0.61, 0.355, 1.0)
  over the existing highlight_fade_duration_ms (clamped 60-2000 ms).
- Ring: 0.20x -> 1.05x base radius, stroke kept crisp via IsStrokeNonScaling.
- Glow: 0.30x -> 1.40x base radius, starting alpha = clickColor.A * 0.35.
- Cleanup uses CompositionScopedBatch.Completed marshalled back to the
  DispatcherQueue, guarded by Highlighter::instance null-check.
- Mode exclusivity: ripple is suppressed when spotlight_mode is true; the
  ripple branch only handles button-down events so the existing trail line
  and fade paths naturally skip.

UI/settings:
- New ripple_mode bool in MouseHighlighterSettings (C++) and
  MouseHighlighterProperties (C#); schema is additive and back-compat.
- New tri-state HighlightModeIndex VM property (0=Spotlight, 1=Circle,
  2=Ripple) drives the ComboBox SelectedIndex directly.
- New HighlightMode_Ripple_Mode.Content "Ripple" string in en-us
  Resources.resw; updated HighlightMode.Description.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ed size/intensity/duration sliders

Follow-up to dev/crutkas/clickRipple. Brings the new ClickLight features
(drag visualization, release echo, and per-axis ripple tuning) into the
PowerToys MouseHighlighter ripple mode.

Adds 5 new settings (
ipple_size, 
ipple_intensity, 
ipple_duration_ms,

ipple_show_drag_trail, 
ipple_show_release_pulse) exposed as new cards in
the existing Mouse Highlighter expander, with full C++/C#/XAML/resw plumbing.

Behavior matches ClickLight ClickOverlayView.swift visual recipe:
  alpha = fade * (0.18 + intensity * 0.78)
  lineWidth = max(2.25, size * (0.035 + intensity * 0.045))
  Press: optional intensity-gated glow halo + ring + center dot
  Release: contracting echo at 0.76 -> 0.34 base radius
  Drag: small dot per ~3 px of motion, faded to ~25% lifetime

All new settings are scoped to ripple mode and leave the legacy circle-mode
fields (highlight_radius, highlight_fade_duration_ms) untouched, so the two
modes can be tuned independently.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…k polish from #48201

Folds the compatible bits of niels9001's PR #48201 into the v2 ripple work
on top of dev/crutkas/clickRipple-v2.

Behavior changes
- Ripple is now a single press → hold → release animation: button-down
  expands a ring + glow to a "held" size; button-up continues the
  expansion and fades both to transparent. Right-click release adds
  expanding crosshair lines around the ring.
- The held ring/glow can follow the cursor while a button is held
  (replaces the v2 per-pixel drag-dot trail).
- The basic circle (non-ripple) and spotlight modes now squeeze briefly
  while a mouse button is held — a press-down polish absorbed verbatim
  from #48201.
- New defaults: highlight_radius=30, fade_delay=400 ms, fade_duration=400 ms,
  ripple_mode=true (was 20 / 0 / 600 / false).

Settings (kept from v2 as tuning knobs)
- ripple_size — base radius of the held ring (replaces highlight_radius
  in ripple visuals).
- ripple_intensity — alpha + stroke thickness.
- ripple_duration_ms — release expansion + fade duration.
- ripple_show_drag_trail — re-purposed to "Follow cursor while held";
  gates whether the held ring tracks the cursor when dragged.
- ripple_show_release_pulse — re-purposed to "Show crosshairs on
  right-click release"; gates the crosshair animation.

Implementation
- Removed RippleKind enum, m_lastRippleDragPt, m_rippleLeftPressed,
  m_rippleRightPressed, and the kind-switched SpawnRipplePulse body.
- Added SpawnRippleHoldDot (press), FadeRippleHoldDot (release with
  optional crosshairs), SpotlightAnimatePress, SpotlightAnimateRelease.
- New composition members: m_left/rightGeometry,
  m_left/rightRippleGlow, m_left/rightGlowGeometry, m_spotlightPressed.
- AddDrawingPoint adds a press-shrink animation on the circle geometry.
- StartDrawingPointFading stops the press-shrink animation before fading.
- UpdateDrawingPointPosition tracks the held glow alongside the ring
  (gated by m_rippleShowDragTrail) and handles the pressed-spotlight
  branch.
- ApplySettings resets m_spotlightPressed.
- Hook handlers (WM_L/RBUTTON{DOWN,UP,MOVE}) route through
  Spotlight/Ripple/Circle as appropriate; ripple uses m_left/rightButtonPressed
  (the same flags as the basic circle path) for press tracking.

Co-authored-by: Niels Laute <niels.laute@live.nl>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@niels9001

Copy link
Copy Markdown
Collaborator
MouseHighligther.mp4

Clint Rutkas (@crutkas) Few things:

  • Why is there a double ripple when doing a single click? Feels unintuitive because I'd expect that effect for a double click?
  • Customization settings aren't collapsed when changing from e.g. Ripple => Spotlight
  • SettingsCards within SettingsExpanders should use a checkbox vs toggleswitch for boolean options
…-click double ripple

- Rework the settings expander into 'Highlight mode': move the mode selector
  into the expander content, collapse cards irrelevant to the selected mode,
  convert ripple toggles to checkboxes, and simplify ripple/fade strings.
- Fix the double-ripple on a single click: defer the held indicator behind a
  hold timer, emit a single self-contained ripple on quick release, and fade
  the held indicator in at the held radius instead of growing it outward so
  only the release produces an outward expansion.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@niels9001

Copy link
Copy Markdown
Collaborator

MouseHighligther.mp4
Clint Rutkas (@crutkas) Few things:

  • Why is there a double ripple when doing a single click? Feels unintuitive because I'd expect that effect for a double click?
  • Customization settings aren't collapsed when changing from e.g. Ripple => Spotlight
  • SettingsCards within SettingsExpanders should use a checkbox vs toggleswitch for boolean options

Fixed it:

Recording.2026-06-24.214543.mp4
@github-actions github-actions Bot added the Area-Localization issues regarding to Localization the application label Jun 24, 2026
@niels9001
Niels Laute (niels9001) enabled auto-merge (squash) June 24, 2026 19:49
@niels9001 Niels Laute (niels9001) changed the title Dev/crutkas/ripple v2.1 + spelling allow-list follow-up Jun 24, 2026
@crutkas

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).
Run XAML Styler on the Mouse Highlighter SettingsCards so the file passes
the CI XAML format check (.\.pipelines\applyXamlStyling.ps1).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@niels9001
Niels Laute (niels9001) merged commit 6dd1ce5 into main Jun 26, 2026
8 checks passed
@niels9001
Niels Laute (niels9001) deleted the dev/crutkas/ripple_v2.1 branch June 26, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Localization issues regarding to Localization the application Needs-Review This Pull Request awaits the review of a maintainer. Product-Mouse Highlighter

5 participants