Skip to content

Conversation

@AlexAndBear
Copy link
Contributor

@AlexAndBear AlexAndBear commented Sep 22, 2025

Description

Related Issue

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@AlexAndBear AlexAndBear changed the title adjust feat: add shift + mouse scroll for zoom out and zoom in in preview app Sep 22, 2025
@AlexAndBear AlexAndBear marked this pull request as ready for review September 22, 2025 23:04
Copilot AI review requested due to automatic review settings September 22, 2025 23:04
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 shift + mouse scroll functionality to zoom in and out in the preview app's image viewer. The changes simplify the image controls by removing position tracking and introducing a more straightforward zoom control mechanism.

  • Replaces complex pan-zoom event handling with direct wheel event handling
  • Implements shift + scroll wheel zoom functionality with 0.1 step increments
  • Uses event bus pattern for image reset functionality instead of direct prop passing

Reviewed Changes

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

File Description
useImageControls.ts Removes position tracking state and pan-zoom event handler, adds event bus for reset functionality
MediaImage.vue Implements wheel event handler for shift+scroll zoom, replaces pan-zoom change events with direct zoom emission
App.vue Updates component props to remove position tracking and use simplified zoom event handler

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

:alt="file.name"
:data-id="file.id"
class="max-w-full max-h-full pt-4 cursor-move object-contain"
:style="`transform: rotate(${currentImageRotation}deg)`"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not needed anymore

:src="file.url"
:alt="file.name"
:data-id="file.id"
class="max-w-full max-h-full pt-4 cursor-move object-contain"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

cursor-move object-contain are obsolete

AlexAndBear and others added 2 commits September 23, 2025 01:06
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@AlexAndBear AlexAndBear requested a review from kulmann September 22, 2025 23:49
@AlexAndBear
Copy link
Contributor Author

  • refactoring ;)

Copy link
Contributor

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

Wow, nice one! 🤓 🕵️

@kulmann kulmann merged commit 676cdb5 into main Sep 23, 2025
28 checks passed
@kulmann kulmann deleted the img-zoom branch September 23, 2025 06:23
@openclouders openclouders mentioned this pull request Sep 23, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preview app: allow zooming with a mouse wheel

3 participants