Skip to content

[stable34] fix: restore initial crop selection for uploaded signatures - #9750

Merged
vitormattos merged 6 commits into
stable34from
backport/9528/stable34
Nov 29, 2026
Merged

vitormattos merged 6 commits into
stable34from
backport/9528/stable34

Conversation

@backportbot-libresign

@backportbot-libresign backportbot-libresign Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Backport of #9528

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Review and verify the backported changes
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
style: format cropper canvas constraints for ESLint

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>

[skip ci]
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

The PR backports a cropper fix to stable34. It changes src/components/Draw/FileUpload.vue and its spec. The diff matches the raw summary.

  • Removed: the computed defaultStencilSize, the container-width and ResizeObserver logic, and the related onMounted/onBeforeUnmount hooks. The cropper now receives no defaultSize, so it chooses the initial selection.
  • Added: a canvas prop with maxWidth and maxHeight set to 3x the signature base size, and maxArea of 1,000,000 px. The comment links this to a 5000 KiB backend limit. This was not checked against the backend.
  • Watcher: clearing the image now also resets imageData.

Risks:

  • Images wider or taller than 3x the base size are downscaled on export.
  • The spec's name says small images keep their source resolution. The test checks only the prop values, not the export output.

Tests: the spec changes were read, not run. CI results are not available.

Changes: Uploaded signature cropping

Layer / File(s) Summary
Cropper constraints and reset
src/components/Draw/FileUpload.vue, src/tests/components/Draw/FileUpload.spec.ts
The cropper receives maximum dimensions based on configured signature dimensions and a maximum area of 1,000,000 pixels. The component removes default stencil sizing and resize-observer logic. Clearing the image resets zoom, pending centering, and image data; tests cover these changes.

Possibly related issues

Possibly related PRs

Change: Bug fix

Merge Risk: Minimal · up to 13351

This backport restores the cropper's initial selection for uploaded signatures by letting the cropper manage its own sizing within canvas limits. No concrete regression was identified, so merge risk is minimal. Remember to remove the skip-CI instruction from the HEAD commit before merging.

Security architecture risk: Minimal · up to 13351

The change adjusts the initial crop and caps the exported image size without changing who can upload a signature or how a user confirms it. No new architecture-level risk was identified.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI (base), Organization UI (inherited)
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: e8b01529-abf2-4d28-9be7-b83c48d7d4e6
Commits

Reviewing files that changed from the base of the PR and between 75e59a9 and 133512f.

Files selected for processing: 2

  • src/components/Draw/FileUpload.vue
  • src/tests/components/Draw/FileUpload.spec.ts
Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Recent review details

Context from checks skipped due to timeout: 6

  • GitHub Check: php-lint (8.5)
  • GitHub Check: test
  • GitHub Check: CodeRabbit
  • GitHub Check: NPM build
  • GitHub Check: test
  • GitHub Check: openapi
Additional context used

Code guidelines: 4

AGENTS.md — configured
3 cross-repository guideline sources
Path-based instructions: 4

Source excerpt: Frontend unit tests should mirror the source tree under `src/tests/`.

CodeRabbit inference engine (AGENTS.md)

Files:

  • src/tests/components/Draw/FileUpload.spec.ts
Source excerpt: Prefer named independent cases for inputs that share the **same** setup, action, contract and expectation.

CodeRabbit inference engine

Files:

  • src/components/Draw/FileUpload.vue
  • src/tests/components/Draw/FileUpload.spec.ts
Source excerpt: Tests are also code to review.

CodeRabbit inference engine

Files:

  • src/components/Draw/FileUpload.vue
  • src/tests/components/Draw/FileUpload.spec.ts
Source excerpt: For integration tests changing persistent state, snapshot only the relevant pre-test values and restore them in a reliable teardown/finally path; preserve absent-vs-empty and types.

CodeRabbit inference engine

Files:

  • src/components/Draw/FileUpload.vue
  • src/tests/components/Draw/FileUpload.spec.ts
Learnings: 1

Common learnings

Learnt from: CR
Repo: LibreSign/libresign PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-11-26T12:28:40.957Z
Learning: Applies to src/tests/** : Source excerpt:
# LibreSign operational guide

## Command discovery and testing map

### Frontend

Frontend unit tests should mirror the source tree under `src/tests/`.

Complete the template change from #9528 while preserving the stable branch layout.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos
vitormattos marked this pull request as ready for review November 29, 2026 19:41
@vitormattos
vitormattos requested a review from a team as a code owner November 29, 2026 19:41
@vitormattos
vitormattos merged commit 2597f62 into stable34 Nov 29, 2026
61 checks passed
@vitormattos
vitormattos deleted the backport/9528/stable34 branch November 29, 2026 19:51
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.

1 participant