Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add source links to creator pages #3780

Merged
merged 7 commits into from
Mar 14, 2024
Merged

Conversation

obulat
Copy link
Contributor

@obulat obulat commented Feb 9, 2024

Fixes

Fixes #3496 by @AetherUnbound

Description

This PR updates the collection header component to match the updated designs.

The creator page has a scrollable area with a button linking to the source page in Openverse.

On narrow screens, the icons next to the h1 heading are replaced with the words. To make this heading accessible, I wrapped the h1 around the icon/collection name, as well as the name of the tag/source/creator. This is not perfect, especially for i18n, but it gives the screen reader user a better context.

The newly-added source button is scrollable to allow for long source names. To implement this, I extracted the scrolling features from VByLine into a separate component, and reused it for this button as well. Some of the extra margin/padding values were added to keep the height of the button correct while also making the focus ring visible (this is a problem for buttons in containers that have overflow set to anything other than visible.

This PR adds a link to the creator view results label. Due to limitations in how v.8 vue-i18n's i18n functional component works, we cannot use it with the pluralization settings (we need pluralization because the label has "x results"). This is why I didn't use <i18n path="the creator label"> but created a workaround splitting the creator result label by the source name instead.

Testing Instructions

Go to /preferences page and make sure the additional_search_views switch is on.
Go to a single result page, and click on a creator link button underneath the image or audio. On the source view, you should see the link to a source with an "external link" icon next to it. When you click it, you should see an analytics event logged in the console (and should see the source page open in a new tab).

Checklist

  • My pull request has a descriptive title (not a vague title likeUpdate index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.
  • I ran the DAG documentation generator (if applicable).

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@github-actions github-actions bot added the 🧱 stack: frontend Related to the Nuxt frontend label Feb 9, 2024
@openverse-bot openverse-bot added 🟨 priority: medium Not blocking but should be addressed soon ✨ goal: improvement Improvement to an existing user-facing feature 🕹 aspect: interface Concerns end-users' experience with the software labels Feb 9, 2024
@obulat obulat marked this pull request as ready for review February 12, 2024 15:17
@obulat obulat requested a review from a team as a code owner February 12, 2024 15:17
Copy link
Collaborator

@AetherUnbound AetherUnbound left a comment

Choose a reason for hiding this comment

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

Oops, that's not quite what I had in mind, sorry I should have been more explicit! I was thinking of linking to our own source view, using the link with the little institution icon we have 😮 What do you think?

@obulat
Copy link
Contributor Author

obulat commented Feb 13, 2024

Oops, that's not quite what I had in mind, sorry I should have been more explicit! I was thinking of linking to our own source view, using the link with the little institution icon we have 😮 What do you think?

@fcoveram, this was how I first understood this suggestion, and then I saw the mockup and added the link to the source site.
What do you think, should we add the link button to the Openverse source page (i.e., https://openverse.org/source/flickr instead of flickr.com) to the creator page?

@obulat obulat marked this pull request as draft February 13, 2024 08:54
@fcoveram
Copy link
Contributor

Oh, now I understand. And yes, it makes more sense linking to the source view as this page has a button to the external site on the far right side. I considered that option but read the sentence twice and understood we wanted to link the external source, but jumping between Openverse views make more sense.

I tried a few things that tap into a spacing improvement suggestion I shared time ago (in a ticket I can not find), and it looks like this.

Mockups of additional views on desktop

Mockups of additional views on mobile

Adding the small button next to results label on creator page requires a spacing update in the three views on desktop, but the change is minor and only impacts the results label area. But on small breakpoints, the changes involve more elements as the header variants (source, creator, and tag) initially designed have a width: auto button and the page type icon that make the layout more complex once small button is placed in the results label area.

I do not want to creep the PR scope, but worth discussing how this proposal feels to us, and if we agree on going with it, what changes belong to this ticket scope.

@AetherUnbound
Copy link
Collaborator

That design for the wider viewports was exactly what I had in mind Francisco! On the smaller breakpoints, do you think it would make sense to break the source over to a new line, separate from the results count text?

@fcoveram
Copy link
Contributor

You are right @AetherUnbound, I don't know why I didn't consider that option.

Here is the new version and other spacing tweaks to the rest of views to keep consistency. Note that single result changes the small button style and one padding-left value.

Mockups of additional search views and single result view on mobile

Curious to hear @obulat's thought on this idea.

@obulat
Copy link
Contributor Author

obulat commented Feb 21, 2024

Here is the new version and other spacing tweaks to the rest of views to keep consistency. Note that single result changes the small button style and one padding-left value.

I like the latest version where the source link is on a separate line. However, still having it as a sentence, split into 2 lines, might be a problem for accessibility because the sentence will be split into two, and a user who has a screen reader might not understand what it means.

Did we replace the "tag"/"source"/"creator" icon with the word on mobile?

@fcoveram
Copy link
Contributor

Still having it as a sentence, split into 2 lines, might be a problem for accessibility because the sentence will be split into two, and a user who has a screen reader might not understand what it means.

True, thanks for noticing it. I think we can change the copy to something like

  • [number] images by this creator in the following source
  • [number] images by this creator in this source

Did we replace the "tag"/"source"/"creator" icon with the word on mobile?

Yes. And in the single result page, the small buttons change from filled: gray to transparent: gray plus other spacing values in the same area.

@obulat obulat force-pushed the add/source-link-to-creator-view branch from 518fb01 to f8a41b0 Compare February 23, 2024 15:42
@fcoveram
Copy link
Contributor

fcoveram commented Mar 7, 2024

I updated the mockups and added dev notes.

@obulat obulat force-pushed the add/source-link-to-creator-view branch 3 times, most recently from 40c7f7f to c93e83f Compare March 12, 2024 11:15
Copy link

Full-stack documentation: https://docs.openverse.org/_preview/3780

Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again.

You can check the GitHub pages deployment action list to see the current status of the deployments.

@obulat obulat force-pushed the add/source-link-to-creator-view branch from c93e83f to 59c9a44 Compare March 12, 2024 12:32
@obulat obulat self-assigned this Mar 12, 2024
@obulat obulat requested a review from AetherUnbound March 12, 2024 15:28
@obulat obulat marked this pull request as ready for review March 12, 2024 15:28
@obulat obulat requested a review from fcoveram March 13, 2024 04:03
Copy link
Contributor

@fcoveram fcoveram left a comment

Choose a reason for hiding this comment

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

The changes look great. I have just three comments:

Small breakpoints

  • The external link in Creator and Source pages needs to be full-width.
  • The results label in Tag and Source pages needs to have a padding bottom of 8px to reach the the total spacing of 16px. Figma dev notes show this more clearly and this is the element I'm referring to.

Bigger breakpoints

  • The results label in Tag page needs to be inside an area of 32px height. Figma dev notes show this more clearly.

@obulat obulat force-pushed the add/source-link-to-creator-view branch from 59c9a44 to 5abb04a Compare March 13, 2024 14:49
Copy link
Member

@zackkrida zackkrida left a comment

Choose a reason for hiding this comment

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

Very nice; lgtm. It is behaving correctly in multiple browsers in MacOS and Linux on my local machines. Tested in Firefox, Safari, and Chrome.

@fcoveram
Copy link
Contributor

I checked the last changes and it looks perfect ✨

@obulat obulat requested a review from fcoveram March 14, 2024 10:52
Copy link
Contributor

@fcoveram fcoveram left a comment

Choose a reason for hiding this comment

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

Looks great ✨ 🚀

@obulat obulat force-pushed the add/source-link-to-creator-view branch from e566cd0 to 769de3f Compare March 14, 2024 11:25
@obulat obulat dismissed AetherUnbound’s stale review March 14, 2024 11:26

The change request was addressed

@obulat obulat merged commit 07be593 into main Mar 14, 2024
40 checks passed
@obulat obulat deleted the add/source-link-to-creator-view branch March 14, 2024 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕹 aspect: interface Concerns end-users' experience with the software ✨ goal: improvement Improvement to an existing user-facing feature 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Link to source on creator view
5 participants