Skip to content

feat(gui): scroll the volume bar to change the volume - #1070

Merged
LargeModGames merged 1 commit into
LargeModGames:mainfrom
tridev-tej:fix-issue-1059
Nov 14, 2026
Merged

LargeModGames merged 1 commit into
LargeModGames:mainfrom
tridev-tej:fix-issue-1059

Conversation

@tridev-tej

@tridev-tej tridev-tej commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

scrolling over the volume bar in the gui did nothing. the volume meter now takes an optional onWheelStep and sends the same VolumeUp/VolumeDown as the arrow keys. wheel deltas add up on the meter: one step per 100 (a line counts as 100), the total resets after a 200 ms pause, so a trackpad burst isn't a step per event. seek bar unchanged. ran lint, format:check, typecheck, test and build in gui/.

Fixes #1059

Summary by CodeRabbit

  • New Features
    • Adjust volume with the mouse wheel in the desktop and browser interfaces. Wheel steps match the volume buttons, and trackpad scrolling accumulates into volume steps.
    • Scrolling over the seek bar does not adjust volume.

the wheel over the volume bar sends the same VolumeUp/VolumeDown step as the arrow keys. deltas add up in a running total on the meter, one step per 100 (a line counts as 100), reset after a 200 ms pause, so a trackpad burst is not a step per event. the seek bar still ignores the wheel.

Fixes LargeModGames#1059
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The GUI volume bar now changes volume when the user scrolls over it. Wheel deltas accumulate into steps, and the seek bar does not receive wheel-step handling.

Changes: Volume Bar Wheel Control

Layer / File(s) Summary
Accumulate Meter wheel input
gui/src/Transport.tsx
Meter accepts an optional wheel-step callback. It scales line-mode deltas, accumulates movement into steps, and resets the accumulated total after a pause longer than 200 ms.
Connect wheel steps to volume actions
gui/src/PlayerBar.tsx, gui/src/bars.test.tsx, CHANGELOG.md
The volume Meter maps upward and downward wheel steps to VolumeUp and VolumeDown. Tests cover notch and trackpad input, pauses, line-mode deltas, disabled meters, and missing callbacks. The changelog describes the behavior.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Feature · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant Meter
  participant PlayerBar
  User->>Meter: Scroll over the volume bar
  Meter->>PlayerBar: Call onWheelStep with direction
  Note over PlayerBar: Send VolumeUp or VolumeDown
Loading
Merge Risk: Minimal · up to f377a

Scrolling over the volume bar changes volume by the same step as the arrow keys, and the seek bar ignores the wheel. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the conventional-commit prefix feat with the gui scope, which matches the required format. It states the main change: scrolling over the volume bar changes volume. The title is concise …
Linked Issues check Passed Objective [#1059]: scrolling over the volume bar changes volume by one step per wheel notch. Addressed. Evidence: gui/src/Transport.tsx adds an optional onWheelStep prop to Meter and an onWheel handle…
Out of Scope Changes check Passed All changed files map to #1059. gui/src/Transport.tsx changes the Meter component and its wheel helper, which the issue names as the implementation point. gui/src/PlayerBar.tsx adds one prop line for …
Full details: Title check

Explanation

The title uses the conventional-commit prefix feat with the gui scope, which matches the required format. It states the main change: scrolling over the volume bar changes volume. The title is concise and imperative. The changeset adds a wheel-step callback to the Meter, wires it in PlayerBar, and adds tests and a changelog entry, so the title describes the main change.

Full details: Linked Issues check

Explanation

Objective [#1059]: scrolling over the volume bar changes volume by one step per wheel notch. Addressed. Evidence: gui/src/Transport.tsx adds an optional onWheelStep prop to Meter and an onWheel handler that calls the wheel() helper only when the meter is not disabled and onWheelStep is set. wheel() keeps the running total and last timestamp in event.currentTarget.dataset (wheel, wheelAt), uses event.timeStamp, counts deltaMode 1 lines as 100, steps once per 100 units (up for negative deltaY), subtracts the stepped amount, and resets the total when more than 200 ms passed. It uses no hooks and no preventDefault. Per the PR summary, PlayerBar.tsx passes onWheelStep only to the volume Meter with the same VolumeUp/VolumeDown body as onStep. The seek Meter receives no onWheelStep, so it ignores the wheel. Objective [#1059]: trackpad bursts do not step per event. Addressed. Accumulation to 100 units per step covers this. The test case with ten deltaY -10 events at 8 ms spacing yields one step. Objective [#1059]: test named 'steps the volume once per wheel notch and not once per trackpad event' in gui/src/bars.test.tsx under describe('Meter'). Addressed. The test covers a single notch in both directions, the trackpad burst, the pause reset, line-mode deltas, and disabled and no-callback meters, as the issue requires. Objective [#1059]: tools/gates.count unchanged and a CHANGELOG entry under Unreleased/Added. Addressed per the changed-file evidence, which lists only CHANGELOG.md, PlayerBar.tsx, Transport.tsx, and bars.test.tsx. Stack evidence: no stack members were supplied. This PR alone covers every coding objective, so no stack dependency applies. Limits: I did not run the vitest, lint, or build commands. The PlayerBar wiring and CHANGELOG line rely on the PR summary, because those diffs were not read directly.

Full details: Out of Scope Changes check

Explanation

All changed files map to #1059. gui/src/Transport.tsx changes the Meter component and its wheel helper, which the issue names as the implementation point. gui/src/PlayerBar.tsx adds one prop line for the volume Meter only. gui/src/bars.test.tsx adds the required test. CHANGELOG.md adds one Added entry. No Rust, mobile, desktop, or tools/gates.count change appears in the reviewed file list. The seek bar and mini player are not wired, as the issue requires. No unrelated change was found in the summarized evidence.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Simplify code

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d36f53d and f377a36.

Files selected for processing: 4

  • CHANGELOG.md
  • gui/src/PlayerBar.tsx
  • gui/src/Transport.tsx
  • gui/src/bars.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@codecov

codecov Bot commented Nov 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@LargeModGames
LargeModGames merged commit b86137f into LargeModGames:main Nov 14, 2026
35 checks passed
@LargeModGames

Copy link
Copy Markdown
Owner

@all-contributors please add @tridev-tej for code

@allcontributors

Copy link
Copy Markdown
Contributor

@LargeModGames

I've put up a pull request to add @tridev-tej! 🎉

LargeModGames pushed a commit that referenced this pull request Nov 14, 2026
Adds @tridev-tej as a contributor for code.

This was requested by LargeModGames [in this
comment](#1070 (comment))

[skip ci]

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GUI: the mouse wheel over the volume bar does not change the volume

2 participants