Skip to content

Use React button component for image control buttons - #1981

Open
jamesmisson wants to merge 30 commits into
UniversalViewer:UIfrom
jamesmisson:react-image-control-buttons
Open

jamesmisson wants to merge 30 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:

jamesmisson and others added 29 commits November 26, 2026 11:12
…round for choice and image adjust dialogues
@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 Nov 27, 2026 1:38pm 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
"$settings": "Settings",
"$twoPageView": "Two page view",
"$goHome": "Go Home",
"$goHome": "Fit Image",

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.

Do we need to seek translations for this new label for all the other languages?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @demiankatz , I've asked on the translations Slack channel.

@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.

This branch was successfully deployed

1 active deployment
Preview – universalviewer β€” e15a2ce6 Deployed Nov 27, 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