Skip to content

Fix/viewer horizontal wheel - #6265

Open
EchoOfCode wants to merge 3 commits into
ItsNotRexed:mainfrom
EchoOfCode:fix/viewer-horizontal-wheel
Open

EchoOfCode wants to merge 3 commits into
ItsNotRexed:mainfrom
EchoOfCode:fix/viewer-horizontal-wheel

Conversation

@EchoOfCode

Copy link
Copy Markdown

Claimed in the coordination issue as :#6256

What and why

A horizontal-only scroll reduced the map viewer’s camera speed from 40 to 34.78 m/s in a single event. The wheel handler now ignores events with deltaY === 0. Scrolling up still increases speed, and scrolling down still decreases it.

Also fixed the Shift/Ctrl movement test fixture by providing the AbortController and timer APIs used by the viewer’s manifest loader. This lets the test reach its keyboard movement assertions.

Tested

Ran node --test tests/test_viewer_streaming.cjs on Windows. All 58 tests passed, with none skipped. The suite uses synthetic inputs and requires no GPU or driver.

The new regression test failed before the fix and passed afterward. It checks horizontal scrolling and both vertical scroll directions.

AI-assisted: yes

Checklist

  • No game data, keys or decryption, including in logs or reports quoted here.
  • Translator contract table update is inapplicable because this PR changes viewer input handling and tests.

@EchoOfCode EchoOfCode left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@dukefissura

Copy link
Copy Markdown

Tested b7a665d merged onto main 561b65a (Linux, Node 22.23.5, no GPU, no game files): it merges cleanly, and node --test tests/test_viewer_streaming.cjs tests/test_viewer_studio.cjs gives 61/61 passing. The new test only vertical wheel movement adjusts freecam speed fails against main's viewer/index.html and passes with this change, so it covers the bug.

Overlap, for the coordinator:

Suggestion: add e.ctrlKey || to the guard here, together with #3503's Ctrl-wheel test, and #3503 can then be closed; or rebase #3503 and close this one. AI-assisted (Claude).

@EchoOfCode

Copy link
Copy Markdown
Author

Thanks for testing the branch and flagging the overlap. I added the e.ctrlKey guard in 207f23c and a regression test for Ctrl+wheel in both directions. The test reproduced the speed change before the fix, and all 62 viewer streaming and studio tests now pass on Windows.

This branch now covers the horizontal-scroll and browser-zoom cases from #3503. It also includes the test-fixture fix from #5692. I’ll leave it to the coordinator to decide which PRs to keep.

@dukefissura

Copy link
Copy Markdown

Re-check of the new head 207f23c, merged onto main 561b65a (Linux, Node 22.23.5, no GPU, no game files): it merges cleanly, and node --test tests/test_viewer_streaming.cjs tests/test_viewer_studio.cjs gives 62/62. The new browser zoom leaves freecam speed unchanged in both directions test fails against b7a665d's viewer/index.html (no ctrlKey guard) and passes with 207f23c, so it covers the Ctrl+wheel case. With that, this PR covers everything #3503 did: the deltaY === 0 guard, the ctrlKey guard and both tests. It also merges cleanly in either order with #5692 (identical fixture line). Looks good to me. AI-assisted (Claude).

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.

2 participants