Skip to content

Comments

feat: added support for drag-to-scroll for non-touch pointing devices#46

Merged
troinine merged 16 commits intomainfrom
feature/drag-to-scroll
Dec 30, 2025
Merged

feat: added support for drag-to-scroll for non-touch pointing devices#46
troinine merged 16 commits intomainfrom
feature/drag-to-scroll

Conversation

@troinine
Copy link
Owner

This PR adds support for drag-to-scroll when using non-touch pointing devices such as a mouse. Existing functionality should remain unchanged (i.e. scrolling on touch devices).

Closes #32

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds drag-to-scroll functionality for non-touch pointing devices (such as mice) to the weather forecast card, allowing users to drag the forecast containers horizontally. The implementation includes momentum scrolling and snap-to-item behavior for a smooth user experience.

  • Implements a new DragScrollController that handles mouse events for drag-to-scroll behavior
  • Integrates the controller into both simple and chart forecast components
  • Adds CSS styles to support dragging visual states and disable snap scrolling during drag operations

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/controllers/drag-scroll-controller.ts New controller implementing drag-to-scroll with momentum and snap-to-item functionality
src/components/wfc-forecast-simple.ts Integrates DragScrollController and prevents action handling during scroll
src/components/wfc-forecast-chart.ts Integrates DragScrollController and prevents action handling during scroll
src/weather-forecast-card.css Adds styles for dragging cursor and disabling snap behavior during drag
test/weather-forecast-simple.test.ts Adds test coverage for drag-to-scroll functionality
test/weather-forecast-chart.test.ts Adds test coverage for drag-to-scroll functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

troinine and others added 4 commits December 30, 2025 18:27
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

troinine and others added 9 commits December 30, 2025 18:45
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@troinine troinine merged commit 3b74e63 into main Dec 30, 2025
4 checks passed
@troinine troinine deleted the feature/drag-to-scroll branch December 30, 2025 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for drag-to-scroll for non-touch pointing devices

1 participant