Skip to content

Fix 938 mobile sidebars#1337

Closed
LlGC-jop wants to merge 70 commits into
UniversalViewer:devfrom
LlGC-jop:fix-938-mobile-sidebars
Closed

Fix 938 mobile sidebars#1337
LlGC-jop wants to merge 70 commits into
UniversalViewer:devfrom
LlGC-jop:fix-938-mobile-sidebars

Conversation

@LlGC-jop

Copy link
Copy Markdown
Contributor

Changes the layout of the left, center, and right panels to be controlled more via CSS + Media queries than the previous JS.

On larger screens they use a grid layout.

On mobile the center panel is full sized, with the left and right panels hidden off screen via transforms.

JS animations have been removed in favour of CSS transitions, with the timing of the transitions being controlled via CSS custom properties, the main one being set/overridden on the root html element where appropriate via JS, based on UV config.

Also includes work by @jamesmisson on new footer buttons to control the side panels and closing the left panel when a thumbnail is clicked on mobile.

jamesmisson and others added 30 commits February 27, 2025 17:40

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

See below for a few suggestions and TODOs.

In addition to those, I agree that we need to add logic to close any open panels when a new panel is opened at the small size, to prevent confusing overlaps. Is this something @jamesmisson would like to try, or would you like me to look into it?

"feedback": "Feedback",
"fullScreen": "Full Screen",
"moreInfo": "More Information",
"toggleLeftPanel": "Toggle Left Panel",

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.

I think this should be using the shorthand versions of everything for proper translation.

Suggested change
"toggleLeftPanel": "Toggle Left Panel",
"toggleLeftPanel": "$toggleLeftPanel",

"open": "$open",
"share": "$share"
"share": "$share",
"toggleLeftPanel": "Toggle Left Panel"

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.

Same here:

Suggested change
"toggleLeftPanel": "Toggle Left Panel"
"toggleLeftPanel": "$toggleLeftPanel"

"open": "$open",
"share": "$share"
"share": "$share",
"toggleLeftPanel": "Toggle Left Panel"

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.

...and here:

Suggested change
"toggleLeftPanel": "Toggle Left Panel"
"toggleLeftPanel": "$toggleLeftPanel"

"open": "$open",
"share": "$share"
"share": "$share",
"toggleLeftPanel": "Toggle Left Panel"

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.

Suggested change
"toggleLeftPanel": "Toggle Left Panel"
"toggleLeftPanel": "$toggleLeftPanel"

"open": "$open",
"share": "$share"
"share": "$share",
"toggleLeftPanel": "Toggle Left Panel"

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.

Suggested change
"toggleLeftPanel": "Toggle Left Panel"
"toggleLeftPanel": "$toggleLeftPanel"


if (this.isFullyExpanded) {
this.$element.width(this.$element.parent().width());
//this.$element.width(this.$element.parent().width());

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.

Should this remain commented out, or can/should it be fully removed?

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 missed this one. I'll remove it.

Comment thread src/locales/cy-GB.json
"$feedback": "Adborth",
"$fullScreen": "Sgrin lawn",
"$moreInfo": "Mwy o Wybodaeth",
"$toggleLeftPanel": "Toggle Left Panel",

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.

Translation needed!

Comment thread src/locales/fr-FR.json
"$feedback": "Commentaire",
"$fullScreen": "Affichage en plein écran",
"$moreInfo": "Informations",
"$toggleLeftPanel": "Toggle Left Panel",

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.

Translation needed!

Comment thread src/locales/pl-PL.json
"$feedback": "Feedback",
"$fullScreen": "Pełny ekran",
"$moreInfo": "Więcej informacji",
"$toggleLeftPanel": "Toggle Left Panel",

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.

Translation needed!

Comment thread src/locales/sv-SE.json
"$feedback": "Feedback",
"$fullScreen": "Helskärm",
"$moreInfo": "Mer information",
"$toggleLeftPanel": "Toggle Left Panel",

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.

Translation needed!

@jamesmisson

Copy link
Copy Markdown
Contributor

Thanks Jonathan this is really great. I have some non-functional UX/UI thoughts we can discuss when it gets to that stage (you're probably aware of these already):

  • The expansion animation feels very different from the current version - a bit slower, and has an ease-in I think? Should we try to match the previous animation, which felt a bit snappier to me. The animations are not the same on left and right panel in desktop mode (right feels faster).
  • I am seeing brief flashes of the panel content being re-arranged, and a horizontal scrollbar appearing on the bottom, when the panels are opening/closing in desktop. Is it possible to hide the content before the animation? I think the current version does this.
  • Selecting the thumbnail in mobile view re-centres the thumbnail in the scroll area while the panel is closing, which I didn't spot when I was working on this. I'll see if I can prevent that.
  • The margins on the outer and upper sides of the panels in desktop are smaller in this version, and almost invisible with the low contrast between the grey and black. I think to maintain the illusion that the panels are floating above the black canvas we should bring these back to 8px. But we should return to this when we think about the header design in the future (I think, for instance, that the header panel should be 30px, just as tall as its buttons, so the panel widths and margins would need to be rebalanced if we do this). The prototype team may have addressed this already @erinburnand @LlGC-szw @Saira-A

Checked on an actual mobile, and it's vastly improved the UX!

@demiankatz yes I can look into auto-closing the opposite panel when one is opened.

@LlGC-jop

Copy link
Copy Markdown
Contributor Author

@jamesmisson

Re the points above:

  • I think I changed the default config (in uv-iiif-config.json) for the left panel expansion to be 400ms rather than the default 250ms in order to see where it was set from and how to use it. I'll take this out so it's all back to 250ms.
  • Good idea - I'll look into hiding the content sooner
  • Thanks
  • I'll have a look at changing the margins back to what they were before.

@LlGC-jop LlGC-jop linked an issue Mar 12, 2025 that may be closed by this pull request
3 tasks
@jamesmisson

Copy link
Copy Markdown
Contributor

I've made the autoclosing adjustments in this PR: #1343

The issue of the thumbnail autoscrolling when selected is more in depth, but as it's barely visible now that the left panel content is hidden before the animation I don't think it's a priority.

@demiankatz

Copy link
Copy Markdown
Contributor

Thanks, @jamesmisson! Should @LlGC-jop just merge your branch from #1343 into this one, so we can close #1343?

Also, who is the right person to address my outstanding review comments? Do we have translations in progress? Do you want me to take care of doing the search-and-replace to fix all those configs that need adjusting?

@demiankatz

Copy link
Copy Markdown
Contributor

Also, I see there are conflicts here now -- resolving these should be as simple as merging the dev branch into this branch, running npm run docs and then adding/committing all changes to the docs folder.

@jamesmisson

jamesmisson commented Mar 13, 2025

Copy link
Copy Markdown
Contributor

Hi both, I based #1343 off of this branch so @LlGC-jop should be able to just merge it.

@demiankatz there are translations for 'Open...' and 'Close...' in the comments here, but I'll need to fix the mechanism to adjust the labels according to the panel state before we can use them. I'll look at that today and make a new PR based on this one too.
#1334

@LlGC-jop

Copy link
Copy Markdown
Contributor Author

#1343 is merged in now. Lots of conflicts from those docs files - I seem to keep getting them as conflicts. Are they something that can be put in the gitignore?

@demiankatz

Copy link
Copy Markdown
Contributor

#1343 is merged in now. Lots of conflicts from those docs files - I seem to keep getting them as conflicts. Are they something that can be put in the gitignore?

We need to commit them because they are used to publish the documentation to the website. There's probably a way to adjust things to make this less annoying, but it would require some changes to infrastructure (e.g. changing how we publish the website, changing the timing/behavior of GitHub Actions, etc.).

@demiankatz

Copy link
Copy Markdown
Contributor

This has all been merged into #1343, so I'm closing this to reduce confusion.

@demiankatz demiankatz closed this Mar 14, 2025
demiankatz pushed a commit that referenced this pull request Mar 26, 2025
This commit makes side panel functionality fully accessible in the mobile view, where critical features were previously unreachable.

It makes responsive behavior more CSS-based and less dependent on Javascript logic.

It incorporates work from #1321, #1325, #1330, #1333 and #1337.
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.

Responsive mode for small screens prevents access to sidebar content

3 participants