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

Change text color to secondary on content-heavy pages #5148

Merged
merged 7 commits into from
Nov 25, 2024
Merged

Conversation

dhruvkb
Copy link
Member

@dhruvkb dhruvkb commented Nov 5, 2024

Fixes

Fixes #5119 by @obulat
Fixes #5151 by @fcoveram

Description

This PR changes the content pages to use text-secondary for the body text, while retaining text-default for the headings.

Testing Instructions

Visit the content pages and see that the text should be a little lighter and less contrasted with the background.

I'll update the snapshots once @fcoveram approves the new designs.

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 (ov just catalog/generate-docs for catalog
    PRs) or the media properties generator (ov just catalog/generate-docs media-props
    for the catalog or ov just api/generate-docs for the API) where 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.

@dhruvkb dhruvkb requested a review from fcoveram November 5, 2024 21:00
@dhruvkb dhruvkb requested a review from a team as a code owner November 5, 2024 21:00
@dhruvkb dhruvkb requested review from krysal and obulat November 5, 2024 21:00
@openverse-bot openverse-bot added 🧱 stack: frontend Related to the Nuxt frontend 🟧 priority: high Stalls work on the project or its dependents ✨ goal: improvement Improvement to an existing user-facing feature 🕹 aspect: interface Concerns end-users' experience with the software labels Nov 5, 2024
Copy link

github-actions bot commented Nov 5, 2024

Latest k6 run output1

     ✓ status was 200

     checks.........................: 100.00% ✓ 6400      ✗ 0   
     data_received..................: 1.5 GB  8.3 MB/s
     data_sent......................: 837 kB  4.7 kB/s
     http_req_blocked...............: avg=9.12µs   min=2µs     med=4.18µs   max=3.66ms  p(90)=5.65µs  p(95)=6.14µs 
     http_req_connecting............: avg=4.66µs   min=0s      med=0s       max=3.62ms  p(90)=0s      p(95)=0s     
     http_req_duration..............: avg=625ms    min=26.37ms med=536.65ms max=2.33s   p(90)=1.13s   p(95)=1.25s  
       { expected_response:true }...: avg=625ms    min=26.37ms med=536.65ms max=2.33s   p(90)=1.13s   p(95)=1.25s  
   ✓ http_req_failed................: 0.00%   ✓ 0         ✗ 6400
     http_req_receiving.............: avg=146.2µs  min=44.25µs med=120.53µs max=12.16ms p(90)=188.1µs p(95)=222.8µs
     http_req_sending...............: avg=22.2µs   min=7.37µs  med=19.78µs  max=4.41ms  p(90)=25.94µs p(95)=28.12µs
     http_req_tls_handshaking.......: avg=0s       min=0s      med=0s       max=0s      p(90)=0s      p(95)=0s     
     http_req_waiting...............: avg=624.83ms min=26.26ms med=536.51ms max=2.33s   p(90)=1.13s   p(95)=1.25s  
     http_reqs......................: 6400    35.708443/s
     iteration_duration.............: avg=3.34s    min=1.13s   med=2.74s    max=9.53s   p(90)=6.52s   p(95)=6.88s  
     iterations.....................: 1200    6.695333/s
     vus............................: 5       min=5       max=30
     vus_max........................: 30      min=30      max=30

Footnotes

  1. This comment will automatically update with new output each time k6 runs for this PR

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.

It looks great 🚀

@dhruvkb
Copy link
Member Author

dhruvkb commented Nov 6, 2024

Thanks @fcoveram! I'll update the visual regression testing snapshots then.

@dhruvkb dhruvkb marked this pull request as draft November 6, 2024 15:48
@fcoveram
Copy link
Contributor

fcoveram commented Nov 7, 2024

I created this ticket requesting the update of text-secondary.

@dhruvkb
Copy link
Member Author

dhruvkb commented Nov 8, 2024

@fcoveram changing the text-secondary color to gray-12 impacts the whole application, not just the text-heavy pages. Can you check out this branch and see if it looks good to you?

For example on this page the search query, artist name, duration, genre/category and license icons have all gotten darker.

Screenshot 2024-11-08 at 3 20 25 PM

@fcoveram
Copy link
Contributor

Just for the record, during yesterday's community meeting, I agreed with @dhruvkb's idea to limit the use of a darker shade as text-secondary in text-heavy pages. So let's continue with that 👍

@obulat
Copy link
Contributor

obulat commented Nov 18, 2024

@dhruvkb, I think I've found the reason for visual regression tests not failing. All pixels in the snapshots are the same, only their color is different. And the difference in color is not a reason for failing tests due to threshold[https://playwright.dev/docs/api/class-snapshotassertions#snapshot-assertions-to-match-snapshot-2-option-threshold] set to 0.2 by default.

An acceptable perceived color difference in the YIQ color space between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with TestConfig.expect. Defaults to 0.2

Setting it to 0.18 makes the tests fail. I think we could set it to 0.1 by default:

Subject: [PATCH] Fix unit test warnings
---
Index: frontend/test/playwright/visual-regression/pages/pages.spec.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/frontend/test/playwright/visual-regression/pages/pages.spec.ts b/frontend/test/playwright/visual-regression/pages/pages.spec.ts
--- a/frontend/test/playwright/visual-regression/pages/pages.spec.ts	(revision abac8a12fdcd210e7eeb935685ababdf2813feeb)
+++ b/frontend/test/playwright/visual-regression/pages/pages.spec.ts	(date 1731940873192)
@@ -44,7 +44,6 @@
           await expectSnapshot(page, contentPage, page, {
             dir,
             screenshotOptions: { fullPage: true },
-            snapshotOptions: { maxDiffPixelRatio: 0.0 },
           })
         })
       })
Index: frontend/test/playwright/playwright.config.ts
<+>UTF-8
===================================================================
diff --git a/frontend/test/playwright/playwright.config.ts b/frontend/test/playwright/playwright.config.ts
--- a/frontend/test/playwright/playwright.config.ts	(revision abac8a12fdcd210e7eeb935685ababdf2813feeb)
+++ b/frontend/test/playwright/playwright.config.ts	(date 1731945641913)
@@ -66,6 +66,11 @@
    * to avoid the test also becoming a load test.
    */
   workers: UPDATE_TAPES === "true" || baseURL !== localBaseURL ? 1 : undefined,
+  expect: {
+    toMatchSnapshot: {
+      threshold: 0.1,
+    }
+  }
 }
 
 export default config

@dhruvkb
Copy link
Member Author

dhruvkb commented Nov 18, 2024

Thanks for discovering this @obulat.

@dhruvkb
Copy link
Member Author

dhruvkb commented Nov 25, 2024

I've extracted the snapshot changes to a separate PR #5182 so that this PR only contains relevant to the text-heavy pages.

@dhruvkb dhruvkb marked this pull request as ready for review November 25, 2024 15:44
Copy link
Contributor

@obulat obulat left a comment

Choose a reason for hiding this comment

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

Awesome! ✨
It's interesting that the old snapshots look okay for me, but when I look at the same colors in the app, my eyes get tired very quickly :)

@dhruvkb dhruvkb changed the title Change text to secondary on content-heavy pages Change text color to secondary on content-heavy pages Nov 25, 2024
@dhruvkb dhruvkb merged commit 475b8c6 into main Nov 25, 2024
53 checks passed
@dhruvkb dhruvkb deleted the text_heavy_pages branch November 25, 2024 16:26
@openverse-bot openverse-bot added the 💻 aspect: code Concerns the software code in the repository label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🕹 aspect: interface Concerns end-users' experience with the software ✨ goal: improvement Improvement to an existing user-facing feature 🟧 priority: high Stalls work on the project or its dependents 🧱 stack: frontend Related to the Nuxt frontend
Projects
Status: 🤝 Merged
Development

Successfully merging this pull request may close these issues.

Update the color of text-secondary Text-heavy pages should use text-secondary color for text
4 participants