feat: added support for drag-to-scroll for non-touch pointing devices#46
feat: added support for drag-to-scroll for non-touch pointing devices#46
Conversation
There was a problem hiding this comment.
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
DragScrollControllerthat 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.
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>
There was a problem hiding this comment.
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.
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>
There was a problem hiding this comment.
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.
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