Skip to content

Fix PDF/MediaElement blank left panel bug (resolves #1402)#1404

Merged
demiankatz merged 9 commits intoUniversalViewer:release-4.2.0from
jamesmisson:issue1402
May 9, 2025
Merged

Fix PDF/MediaElement blank left panel bug (resolves #1402)#1404
demiankatz merged 9 commits intoUniversalViewer:release-4.2.0from
jamesmisson:issue1402

Conversation

@jamesmisson
Copy link
Copy Markdown
Contributor

This should fix #1402

When viewing IIIF content, there is a 1ms delay to the 'main' div in the left panel resizing in ContentLeftPanel.ts. For PDFs and media, the thumbsView is rendered in ResourcesLeftPanel.ts, so I think the problem was that the thumbnail div wasn't being resized in the same way/at the same time, so it was resizing before the panel expansion animation had finished. I've added the same delay (1ms) and set the width to 100% after that.

I haven't tested this very thoroughly, please give it a hammering and see what happens!

@vercel
Copy link
Copy Markdown

vercel bot commented May 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
universalviewer ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 8, 2025 3:58pm

Copy link
Copy Markdown
Contributor

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

Thanks, @jamesmisson -- one small observation for starters! :-)

@demiankatz demiankatz changed the title Issue1402 Fix PDF/MediaElement blank left panel bug (resolves #1402) May 8, 2025
Copy link
Copy Markdown
Contributor

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

This definitely solves the problem for me. I'm never in love with using setTimeout, but it seems like it's probably necessary here, at least until we refactor the architecture. I'm going to approve this; feel free to take out of draft mode when comfortable.

I'm definitely interested in hearing from others as well!

@jamesmisson jamesmisson marked this pull request as ready for review May 8, 2025 16:09
@LanieOkorodudu
Copy link
Copy Markdown
Collaborator

@jamesmisson, @demiankatz, Thanks for the fix! I've tested both PDF and media files on my end, and it looks like this change successfully resolves the issue described in #1402. The left panel now displays correctly without going blank. I've attached a screenshot from my testing for reference. Great work on getting this sorted!
Screenshot 2025-05-09 120926
Screenshot 2025-05-09 120848

@jamesmisson, I saw your comment on the issue about how it appears on your side. I tested it again and cleared my browsing history, just to be sure, and everything seems to be working fine now. Just out of curiosity, are you using Chrome or Edge? I've noticed that Edge can sometimes behave a bit differently during testing. I tried both browsers, and things looked good in each case.

@demiankatz demiankatz merged commit 84e822f into UniversalViewer:release-4.2.0 May 9, 2025
5 checks passed
@demiankatz
Copy link
Copy Markdown
Contributor

Merged as per discussion at today's stand-up.

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