Skip to content

feat(annotations): Enable drawing/region annotations on rotated files#1644

Open
kduncanhsu wants to merge 3 commits into
box:masterfrom
kduncanhsu:feat/enable-annotations-on-rotated-files
Open

feat(annotations): Enable drawing/region annotations on rotated files#1644
kduncanhsu wants to merge 3 commits into
box:masterfrom
kduncanhsu:feat/enable-annotations-on-rotated-files

Conversation

@kduncanhsu
Copy link
Copy Markdown
Collaborator

@kduncanhsu kduncanhsu commented May 12, 2026

Summary

  • Enables drawing and region annotation creation on rotated documents and images (previously all annotations were disabled on rotation)
  • Keeps highlight annotations disabled (highlight annotation button in toolbar is hidden) when rotated (since highlights depend on text selection which doesn't work correctly when rotated yet)
  • Removes the PDF-only restriction for the rotate feature, allowing all document types to use rotation when the feature flag is enabled

Changes

  • DocBaseViewer: Removed logic that disabled all annotation controls on rotate; now only highlight is gated by rotationAngle === 0. Removed the PDF-only check for enabling the rotate button.
  • ImageViewer: Removed logic that disabled annotation controls on rotated images; annotations now remain enabled regardless of rotation.
  • Tests: Updated tests to reflect new behavior and removed obsolete test cases.

Test plan

  • Verify drawing annotations can be created on a rotated PDF
  • Verify region annotations can be created on a rotated PDF
  • Verify highlight annotations are hidden when a PDF is rotated
  • Verify annotations work on rotated images
  • Verify rotate button appears for non-PDF document types when the feature flag is enabled
  • Run unit tests (npm test)

@kduncanhsu kduncanhsu requested a review from a team as a code owner May 12, 2026 23:57
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Duncan Hsu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@kduncanhsu kduncanhsu force-pushed the feat/enable-annotations-on-rotated-files branch from 2d1328c to 94a6663 Compare May 14, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants