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

Update the icon color in onMounted #5237

Merged
merged 1 commit into from
Dec 3, 2024
Merged

Conversation

obulat
Copy link
Contributor

@obulat obulat commented Dec 2, 2024

Fixes

Fixes #5227 by @obulat

Description

This PR replaces the computed values for icon names with ref that are updated in onMounted (which runs after the hydration is done). The license icons and the theme icons are affected, but I can revert the change for the theme switcher if #5236 is the preferred approach, @dhruvkb .

Testing Instructions

Select the "system" mode and refresh a single result page. Make sure your system is set to dark mode by default (or use the browser devtools). Refresh the page and see that there are no client-server mismatch warnings: neither for the theme switcher (sun/moon icons) nor for the license icons on every image result:

Light mode license icon Dark mode license icon

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.

@obulat obulat requested a review from a team as a code owner December 2, 2024 10:11
@obulat obulat requested review from krysal and dhruvkb December 2, 2024 10:11
@openverse-bot openverse-bot added 🧱 stack: frontend Related to the Nuxt frontend 🟧 priority: high Stalls work on the project or its dependents 🛠 goal: fix Bug fix 💻 aspect: code Concerns the software code in the repository labels Dec 2, 2024
Copy link

github-actions bot commented Dec 2, 2024

Latest k6 run output1

     ✓ status was 200

     checks.........................: 100.00% ✓ 390      ✗ 0   
     data_received..................: 93 MB   388 kB/s
     data_sent......................: 51 kB   212 B/s
     http_req_blocked...............: avg=42.14µs  min=2.36µs   med=4.76µs   max=1.64ms   p(90)=146.94µs p(95)=178.17µs
     http_req_connecting............: avg=28.73µs  min=0s       med=0s       max=1.59ms   p(90)=100.52µs p(95)=124.1µs 
     http_req_duration..............: avg=196.34ms min=30.24ms  med=162.49ms max=811.34ms p(90)=362.15ms p(95)=399.83ms
       { expected_response:true }...: avg=196.34ms min=30.24ms  med=162.49ms max=811.34ms p(90)=362.15ms p(95)=399.83ms
   ✓ http_req_failed................: 0.00%   ✓ 0        ✗ 390 
     http_req_receiving.............: avg=166.15µs min=61.52µs  med=138.15µs max=1.21ms   p(90)=277.24µs p(95)=336.63µs
     http_req_sending...............: avg=25.21µs  min=8.57µs   med=22.82µs  max=164.13µs p(90)=39.25µs  p(95)=46.29µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=196.15ms min=30.08ms  med=162.33ms max=810.91ms p(90)=361.98ms p(95)=399.51ms
     http_reqs......................: 390     1.621295/s
     iteration_duration.............: avg=1.05s    min=543.06ms med=1.24s    max=2.14s    p(90)=1.36s    p(95)=1.46s   
     iterations.....................: 73      0.303473/s
     vus............................: 0       min=0      max=6 
     vus_max........................: 60      min=60     max=60

Footnotes

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

@obulat obulat force-pushed the fix/client-server-mismatch branch from ad5ff3c to c5cd4a2 Compare December 2, 2024 11:08
@krysal
Copy link
Member

krysal commented Dec 2, 2024

I'll let you both coordinate on these PRs.

@krysal krysal removed their request for review December 2, 2024 18:46
Copy link
Member

@dhruvkb dhruvkb left a comment

Choose a reason for hiding this comment

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

This change makes sense to me, thanks for the helpful documentation comments.

@obulat obulat force-pushed the fix/client-server-mismatch branch from c5cd4a2 to 65359b7 Compare December 3, 2024 04:10
@obulat obulat merged commit c41449e into main Dec 3, 2024
46 checks passed
@obulat obulat deleted the fix/client-server-mismatch branch December 3, 2024 04:34
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 🛠 goal: fix Bug fix 🟧 priority: high Stalls work on the project or its dependents 🧱 stack: frontend Related to the Nuxt frontend
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Client-server mismatch when the color mode is set to system
4 participants