Skip to content

Use React button component for image control buttons - #1981

Merged
jamesmisson merged 14 commits into
UniversalViewer:UIfrom
jamesmisson:react-image-control-buttons
Dec 4, 2026
Merged

jamesmisson merged 14 commits into
UniversalViewer:UIfrom
jamesmisson:react-image-control-buttons

Conversation

@jamesmisson

Copy link
Copy Markdown
Contributor

Pull request description

Summary of changes

Builds on top of #1980 so that should be merged first.

This implements the new React button component for the image control buttons, now contained in a parent React component (ImageControls.tsx).

The dialogues for the choice menu and image adjust feature still expect the original jquery elements to return focus to when they've closed, so I've added a workaround to keep that with the getters in the center panel. Ultimately I think we need an image control menu component that gets rendered within the ImageControls component to keep these tidy - something for if/when we redesign those control menus.

Related issues

#1957

Contributor checklist

Accessibility & internationalisation

  • Accessibility: Changes have been checked against WCAG 2.2 Level AA, with no known accessibility failures introduced.
  • Keyboard accessibility: All new or modified interactive elements can be operated using a keyboard, with appropriate focus management and visible focus indicators.
  • Internationalisation: Contextual language switching works correctly and all new or modified interface strings have translations available in English, Welsh, Polish, French and Swedish.

Compatibility & interoperability

  • IIIF compatibility: Changes have been tested against relevant IIIF Presentation and Image API resources, with no known regressions in supported functionality.
  • Extension compatibility: Changes have been checked for compatibility with existing Universal Viewer extensions and extension points.
  • Backwards compatibility: Changes do not unintentionally break existing public APIs, integrations or configuration options.
  • Browser & device compatibility: Changes have been tested across relevant supported browsers, devices and screen sizes, including responsive layouts.

Code quality & testing

  • Automated testing: Relevant automated tests have been added or updated, and existing applicable tests pass.
  • Regression testing: Existing functionality affected by the changes has been tested to ensure no unintended regressions.
  • Code quality: Changes follow the project's coding conventions, and relevant linting, formatting and type checks pass.
  • Performance: Changes have been reviewed for potential performance impacts, with no known significant regressions.
  • Security: Changes have been checked for potential security vulnerabilities, including unsafe handling of external data, URLs and user input.

Configuration & documentation

  • Configuration: New or modified configuration options have been added to the appropriate configuration files and documented in 'manual/CONFIG.md`.
  • Documentation: The repository README and any other affected documentation have been reviewed and updated where necessary.
  • User experience: Changes have been reviewed for usability, consistency with existing interface patterns and clarity of user interactions.

Additional notes for reviewers:

@vercel

vercel Bot commented Nov 27, 2026

Copy link
Copy Markdown

@jamesmisson is attempting to deploy a commit to the Universal Viewer Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
universalviewer Ready Ready Preview Dec 4, 2026 9:20am UTC

Request Review

@demiankatz demiankatz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, @jamesmisson! Since this builds on #1980, I'll review it more carefully after that one is merged (so I can see which changes here are unique). I did have one question based on a quick skim, though (see below):

Comment thread src/locales/en-GB.json Resolved

@LanieOkorodudu LanieOkorodudu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @jamesmisson, The tooltip looks really nice! Just a small suggestion, could we perhaps increase the font size to 12px or 13px? It might make it a little easier to read, especially for users with visual impairments.

@jamesmisson

Copy link
Copy Markdown
Contributor Author

Thanks @demiankatz and @LanieOkorodudu . I've added the other translations for 'fit screen'. We will consider the text size when we think about the tooltip styling properly here #1975

@demiankatz demiankatz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please merge the UI branch back into this PR so that the redundant changes from #1980 are eliminated and the remaining changes are easier to review? Once that's done, I'll be happy to take a more careful look at this.

@demiankatz demiankatz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, @jamesmisson -- the new approach definitely seems more elegant and readable than the old. The stopgap bridge to jQuery is reasonable until it can be fully eliminated. :-)

@demiankatz

Copy link
Copy Markdown
Contributor

I meant to approve rather than request changes, but I see there are conflicts that need to be resolved, so I guess changes are needed after all! Once you've had a chance to sort that out, let me know and I'll be happy to approve again. (This conflict was probably introduced by the recent merge from dev to UI).

@jamesmisson

Copy link
Copy Markdown
Contributor Author

Thanks @demiankatz , merging UI seems to have resolved those conflicts.

@demiankatz demiankatz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, @jamesmisson, looks good to me now!

@jamesmisson
jamesmisson merged commit 3005013 into UniversalViewer:UI Dec 4, 2026
4 of 5 checks passed

This branch was successfully deployed

1 active deployment
Preview – universalviewer β€” ac9efea2 Deployed Dec 4, 2026 by vercel[bot]
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.

3 participants