Skip to content

Share dialogue simplified to readonly inputs#1318

Merged
LanieOkorodudu merged 27 commits into
UniversalViewer:devfrom
crhallberg:manifest-readonly
Mar 12, 2025
Merged

Share dialogue simplified to readonly inputs#1318
LanieOkorodudu merged 27 commits into
UniversalViewer:devfrom
crhallberg:manifest-readonly

Conversation

@crhallberg

@crhallberg crhallberg commented Feb 26, 2025

Copy link
Copy Markdown
Contributor

Resolves #1308.

image

  • No tabs it is!
  • "Link to this Page"
  • Manifest explanation? deferred.
  • Make sure Embed share button isn't confused
  • IIIF icon (color and return)
  • Add copy buttons
  • Investigate iframe element removed
  • Double-check tab removal tabs returned
  • Focus control (keyboard) could not replicate, focus seems properly trapped
  • There seems to be many elements included in the ShareDialogue type definition. I think we can reduce this list significantly. (old definition, new definition)

@vercel

vercel Bot commented Feb 26, 2025

Copy link
Copy Markdown

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 Mar 11, 2025 7:18pm

@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 one small comment. I haven't read through all of the code changes yet, but a few general thoughts and observations:

1.) Are you confident that it's safe to fully rip out all of the things being ripped out here? For example, are we sure there are no other use of tabs that might rely on the tab styles being removed?

2.) Is it possible that we can/should separate some of the general cleanup work from the functional changes so that the history is easier to read/understand? If all of these things are truly entangled, I can live with it... but this is currently a very large change, which makes it a bit hard to conceptualize.

3.) There is a keyboard problem that impacts both this PR and the current dev branch. If I click into a text box and try to navigate with the keyboard (for example, using Home and End keys to see the beginning or end of the URLs), the left panel takes over control, and my keypresses navigate the thumbnails instead of moving the cursor, even though focus is on the text box. Can we do anything about this? It seems less than ideal. Obviously, it's a separate issue, and should be addressed as such. Depending on what the solution is, though, I wonder if it makes more sense to address as a fix to dev first, or to try to fix after we do this refactor. Let me know if I should file a separate issue to track it!

4.) I wonder if we need a better label than "Share" for the top box. I think "Share" should be the overall dialog box name, but the top link is something like "Link to this Page".

5.) Should we have copy to clipboard buttons for any/all of these? (Maybe that's a separate issue, but it seems like it would be helpful, especially in light of other keyboard weirdness).

6.) This PR seems to lose the drag-and-drop IIIF logo. I think there may be reason to keep that; it just likely needs a better label, and possibly a config setting to enable/disable.

Comment thread src/content-handlers/iiif/IIIFContentHandler.ts
@erinburnand

Copy link
Copy Markdown

Its much clearer where the manifest link is and how to copy it.
I agree that the drag and drop IIIF icon is a nice feature (for those that know it exists, i didn't!) and would be good to keep. Could we possibly have the 2 tabs at the top for share and embed that we do in the current version so we can keep it without the box being too cluttered? This might solve the label for the share box issue that Demian highlighted above?

@crhallberg

Copy link
Copy Markdown
Contributor Author

I did use the label that was on the tab to label the only box in that tab. I feel strongly that adding tabs back in and having three tabs with one input each is a worst UX solution than presenting them as a list.

Yes we can add a copy button.

Yes I’ll add the deaf and drop back. Is this what the iframe is for?

@demiankatz

Copy link
Copy Markdown
Contributor

@crhallberg, the iframe is for embedding the entire viewer (e.g. in a blog post, etc.). The drag and drop is a separate mechanism; there was a movement a few years ago to add drag and drop support to IIIF viewers so that you could open manifests by just dragging them from one place to another. The use case for this isn't really strong for UV, which is designed for a simple viewing experience... it possibly makes more sense with some of the more scholarship-oriented tools that involve multiple open documents, annotations, etc., where you may have multiple documents open at once and want to move them around. But we might as well continue to support the technical standard, even if it's not our primary use case!

@crhallberg

Copy link
Copy Markdown
Contributor Author

@demiankatz what I mean is that there is an actual iframe embedded in the share dialogue. It is the reason why there is blank space in the screenshot above. I'll dig into it more - but it was one of the things I didn't think was wise to remove without understanding.

@demiankatz

Copy link
Copy Markdown
Contributor

@demiankatz what I mean is that there is an actual iframe embedded in the share dialogue. It is the reason why there is blank space in the screenshot above. I'll dig into it more - but it was one of the things I didn't think was wise to remove without understanding.

Oh, strange, I don't know why that would be the case!

@crhallberg

Copy link
Copy Markdown
Contributor Author

So. Looking into the code. It seems that the share iframe is supposed to show the manifest in the share menu? As it is, it is too small to do so and also comes up as an invisible white on white square.

For now, I will remove the iframe. If we get clarification on what feature the iframe is intended to provide, I will build that bridge ro cross myself.

@demiankatz

Copy link
Copy Markdown
Contributor

So. Looking into the code. It seems that the share iframe is supposed to show the manifest in the share menu? As it is, it is too small to do so and also comes up as an invisible white on white square.

For now, I will remove the iframe. If we get clarification on what feature the iframe is intended to provide, I will build that bridge ro cross myself.

No objection here -- I don't see an advantage to embedding the viewer inside its own share dialog. That just seems like a road to madness in the hall of mirrors.

@crhallberg

Copy link
Copy Markdown
Contributor Author

See updated screenshots in description (top).

@crhallberg

Copy link
Copy Markdown
Contributor Author

Would it make sense to checkout/not commit the docs until the end of this process? It seemed to happen automatically when dev updated docs.

@demiankatz

Copy link
Copy Markdown
Contributor

Would it make sense to checkout/not commit the docs until the end of this process? It seemed to happen automatically when dev updated docs.

There's a GitHub Action that automatically generates and commits the docs so that we don't forget and let them get out of sync. It's just a bit distracting when you make changes low in the config hierarchy because that ends up impacting a lot of documentation pages. I can't think of a way around this, though, without risking the docs getting out of date again (which was a frequent problem in the past).

@LanieOkorodudu

Copy link
Copy Markdown
Contributor

I did some testing in this PR, and here’s what I’m seeing in the attached screenshot. I know it's still a work in progress, so I will test it again once it's ready.
Screenshot 2025-03-05 133030

@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, @crhallberg, this is looking better! See below for a couple of comments based on an admittedly less-than-thorough review.


if (triggerButton && $(triggerButton).is(".embed.btn")) {
// after setTimeout in Dialogue super class
setTimeout(() => {

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.

How important is this focusing behavior? Feels fragile to rely on a setTimeout if there's any other possible way...

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.

I find the focus to be accessibility and intuition critical, since we want to take users directly to the embed code. I agree that a timeout isn't ideal but I'm fighting fire with slightly incremented fire.

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.

Makes sense. Do you think it's worth opening an issue about improving focus handling, so we don't lose track of the need to improve upon this (and maybe revisit default behavior, if any of it could be more accessible than it currently is)?

Comment thread src/content-handlers/iiif/modules/uv-dialogues-module/ShareDialogue.ts Outdated
@demiankatz

Copy link
Copy Markdown
Contributor

Thanks for the progress here, @crhallberg, this is looking good to me functionally speaking. One more question: would it make sense to put a "Share" heading at the top of the dialog box, for consistency with the Download dialog, and so the contents and button label match up? I certainly don't insist on this, but it feels like it might make things slightly nicer.

@erinburnand

Copy link
Copy Markdown

Looks great @crhallberg!

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

Looks good to me now, @crhallberg. Thanks again!

Future consideration: once we're in a position to write a help page about IIIF, maybe we can put a label on the draggable icon (like "Draggable IIIF Icon:") with a help button next to it leading to the explanation. I think that would make things feel even more consistent, and would provide access to the explanation without embedding a chunk of text in the box.

@LanieOkorodudu

Copy link
Copy Markdown
Contributor

@crhallberg This looks good, Thanks for the work you've done here. Merging it now.

@LanieOkorodudu LanieOkorodudu merged commit 75fbb35 into UniversalViewer:dev Mar 12, 2025
This was referenced Apr 1, 2025
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.

put manifest url in a (readonly) input box

4 participants