Skip to content

Conversation

@AlexAndBear
Copy link
Contributor

@AlexAndBear AlexAndBear commented May 20, 2025

Description

image

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 force-pushed the issues/709 branch 3 times, most recently from f5b5590 to f575f36 Compare May 20, 2025 12:54
@AlexAndBear AlexAndBear requested a review from kulmann May 20, 2025 19:17
@AlexAndBear
Copy link
Contributor Author

@kulmann unfortantly its not really that easy to check if the image has the aspect ratio 16/9 in the e2e test

@AlexAndBear AlexAndBear marked this pull request as ready for review May 20, 2025 19:17
Copilot AI review requested due to automatic review settings May 20, 2025 19:17
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 a new cropping feature for space images by introducing a dedicated modal and updating the image upload workflow. Key changes include:

  • Implementation of the SpaceImageModal component utilizing cropperjs for image cropping.
  • Updates to both E2E and unit tests to support the new cropping flow.
  • Modifications in space image action handling across web-app-files and related contexts.

Reviewed Changes

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

Show a summary per file
File Description
tests/e2e/support/objects/app-files/spaces/actions.ts Updated response matching to account for cropped images and trigger a confirm button click.
packages/web-pkg/tests/unit/components/Spaces/SpaceImageModal.spec.ts New unit tests for the cropping modal functionality.
packages/web-pkg/src/components/Spaces/SpaceImageModal.vue New modal component for cropping space images using cropperjs.
packages/web-pkg/src/components/Spaces/index.ts Export the new SpaceImageModal component.
packages/web-app-files/tests/unit/composables/actions/spaces/useSpaceActionsUploadImage.spec.ts Updated tests to reflect changes in the image upload action API.
packages/web-app-files/src/composables/actions/spaces/useSpaceActionsUploadImage.ts Refactored to use a modal dispatch instead of direct file upload.
packages/web-app-files/src/components/Spaces/SpaceContextActions.vue Updated change handler for image input to trigger the new modal.
packages/web-app-files/src/components/SideBar/Actions/SpaceActions.vue Consistent update to the image upload action handler via the modal.

errors: [error]
})
}
dispatchModal({
Copy link

Copilot AI May 20, 2025

Choose a reason for hiding this comment

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

Verify that 'selectedSpace' is assigned before dispatching the modal, as it is used in customComponentAttrs; consider adding a guard to handle cases where selectedSpace might be null.

Copilot uses AI. Check for mistakes.
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.

It's crazy how much of a UX improvement this it... love it! I'd prefer if the new vue script code would be script setup syntax, since we want to convert our codebase to that. Didn't check the modal component code in detail, yet, because reviewing the diff would be pointless, so I'll wait for the script setup syntax 🙈

</div>
</template>

<script lang="ts">
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer it if new code would be script setup syntax

@kulmann
Copy link
Contributor

kulmann commented May 21, 2025

@kulmann unfortantly its not really that easy to check if the image has the aspect ratio 16/9 in the e2e test

Maybe @ScharfViktor has an idea?

@ScharfViktor
Copy link
Contributor

ScharfViktor commented May 21, 2025

Maybe @ScharfViktor has an idea?

I'll try to do it via evaluate
get the length and height of the image and calculate the ratio.
as the first of the ideas

@ScharfViktor
Copy link
Contributor

ScharfViktor commented May 21, 2025

I noticed that after cropping the .gif files -> the animation is gone
I couldn't find a way how to upload working .gif

@AlexAndBear
Copy link
Contributor Author

I noticed that after cropping the .dif files -> the animation is gone I couldn't find a way how to upload working .dif

You mean gif ? Expected

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.

Love it! 😍

@ScharfViktor
Copy link
Contributor

You mean gif ? Expected

yeah .gif file

@AlexAndBear AlexAndBear merged commit ed93903 into main May 21, 2025
18 checks passed
@AlexAndBear AlexAndBear deleted the issues/709 branch May 21, 2025 10:05
@openclouders openclouders mentioned this pull request May 21, 2025
1 task
@ScharfViktor
Copy link
Contributor

e2e test here #731

@openclouders openclouders mentioned this pull request Jun 2, 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.

Space image: let user select a 16:9 area

4 participants