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 to secondary on content-heavy pages #5148

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

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.6 MB/s
     data_sent......................: 837 kB  4.8 kB/s
     http_req_blocked...............: avg=10.59µs  min=1.95µs  med=4.27µs   max=4.34ms   p(90)=5.69µs   p(95)=6.15µs  
     http_req_connecting............: avg=5.99µs   min=0s      med=0s       max=4.28ms   p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=605.42ms min=41.26ms med=524.43ms max=2.36s    p(90)=1.1s     p(95)=1.2s    
       { expected_response:true }...: avg=605.42ms min=41.26ms med=524.43ms max=2.36s    p(90)=1.1s     p(95)=1.2s    
   ✓ http_req_failed................: 0.00%   ✓ 0         ✗ 6400
     http_req_receiving.............: avg=148.33µs min=41.22µs med=119.3µs  max=21.06ms  p(90)=186.11µs p(95)=223.51µs
     http_req_sending...............: avg=20.75µs  min=6.76µs  med=20.11µs  max=427.63µs p(90)=25.62µs  p(95)=27.57µs 
     http_req_tls_handshaking.......: avg=0s       min=0s      med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=605.25ms min=41.08ms med=524.3ms  max=2.36s    p(90)=1.1s     p(95)=1.2s    
     http_reqs......................: 6400    36.710781/s
     iteration_duration.............: avg=3.23s    min=1.13s   med=2.62s    max=9.72s    p(90)=6.28s    p(95)=6.59s   
     iterations.....................: 1200    6.883272/s
     vus............................: 6       min=6       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.

Copy link

Playwright failure test results: https://github.com/WordPress/openverse/actions/runs/11899883311

It looks like some of the Playwright tests failed. If you made changes to the frontend UI without updating snapshots, this might be the cause. You can download zipped patches containing the updated snapshots alongside a general trace of the tests under the "Artifacts" section in the above page. They're named in the form *_snapshot_diff and *_test_results respectively.

You can read more on how to use these artifacts in the docs.

If the test is flaky, follow the flaky test triage procedure.

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: high Stalls work on the project or its dependents 🧱 stack: frontend Related to the Nuxt frontend
Projects
Status: 🚧 Draft
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