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

feat: Add img component for light and dark src #3675

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

calvin-codecov
Copy link
Contributor

Description

Closes codecov/engineering-team#2812

Code Example

Notable Changes

Screenshots

Link to Sample Entry

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@codecov-qa
Copy link

codecov-qa bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.79%. Comparing base (c763e30) to head (bfcdda7).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3675      +/-   ##
==========================================
- Coverage   98.79%   98.79%   -0.01%     
==========================================
  Files         824      825       +1     
  Lines       14812    14808       -4     
  Branches     4206     4195      -11     
==========================================
- Hits        14633    14629       -4     
  Misses        170      170              
  Partials        9        9              
Files with missing lines Coverage Δ
...ecovAIPage/CodecovAICommands/CodecovAICommands.tsx 100.00% <ø> (ø)
...age/CoverageOnboarding/GitHubActions/TokenStep.tsx 95.74% <100.00%> (-0.26%) ⬇️
.../RepoPage/FailedTestsTab/CodecovCLI/CodecovCLI.tsx 100.00% <ø> (ø)
...age/FailedTestsTab/GitHubActions/GitHubActions.tsx 100.00% <ø> (ø)
src/ui/LightDarkImg/LightDarkImg.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.69% <ø> (ø)
Pages 98.41% <100.00%> (-0.01%) ⬇️
Services 99.27% <ø> (ø)
Shared 99.36% <ø> (ø)
UI 99.07% <100.00%> (+<0.01%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c763e30...bfcdda7. Read the comment docs.

@codecov-staging
Copy link

codecov-staging bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3675      +/-   ##
==========================================
- Coverage   98.79%   98.79%   -0.01%     
==========================================
  Files         824      825       +1     
  Lines       14812    14808       -4     
  Branches     4206     4195      -11     
==========================================
- Hits        14633    14629       -4     
  Misses        170      170              
  Partials        9        9              
Files with missing lines Coverage Δ
...ecovAIPage/CodecovAICommands/CodecovAICommands.tsx 100.00% <ø> (ø)
...age/CoverageOnboarding/GitHubActions/TokenStep.tsx 95.74% <100.00%> (-0.26%) ⬇️
.../RepoPage/FailedTestsTab/CodecovCLI/CodecovCLI.tsx 100.00% <ø> (ø)
...age/FailedTestsTab/GitHubActions/GitHubActions.tsx 100.00% <ø> (ø)
src/ui/LightDarkImg/LightDarkImg.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.69% <ø> (ø)
Pages 98.41% <100.00%> (-0.01%) ⬇️
Services 99.27% <ø> (ø)
Shared 99.36% <ø> (ø)
UI 99.07% <100.00%> (+<0.01%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c763e30...bfcdda7. Read the comment docs.

Copy link

codecov bot commented Jan 21, 2025

Bundle Report

Changes will increase total bundle size by 25 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-system 6.19MB 9 bytes (0.0%) ⬆️
gazebo-production-esm 6.24MB 16 bytes (0.0%) ⬆️

Copy link

codecov-public-qa bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.79%. Comparing base (c763e30) to head (bfcdda7).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3675      +/-   ##
==========================================
- Coverage   98.79%   98.79%   -0.01%     
==========================================
  Files         824      825       +1     
  Lines       14812    14808       -4     
  Branches     4206     4203       -3     
==========================================
- Hits        14633    14629       -4     
  Misses        170      170              
  Partials        9        9              
Files with missing lines Coverage Δ
...ecovAIPage/CodecovAICommands/CodecovAICommands.tsx 100.00% <ø> (ø)
...age/CoverageOnboarding/GitHubActions/TokenStep.tsx 95.74% <100.00%> (-0.26%) ⬇️
.../RepoPage/FailedTestsTab/CodecovCLI/CodecovCLI.tsx 100.00% <ø> (ø)
...age/FailedTestsTab/GitHubActions/GitHubActions.tsx 100.00% <ø> (ø)
src/ui/LightDarkImg/LightDarkImg.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.69% <ø> (ø)
Pages 98.41% <100.00%> (-0.01%) ⬇️
Services 99.27% <ø> (ø)
Shared 99.36% <ø> (ø)
UI 99.07% <100.00%> (+<0.01%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c763e30...bfcdda7. Read the comment docs.

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Jan 21, 2025

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
ccbd58f Tue, 21 Jan 2025 22:26:50 GMT Expired Expired
a75c5f6 Thu, 23 Jan 2025 18:17:06 GMT Expired Expired
88878f0 Thu, 23 Jan 2025 18:32:19 GMT Expired Expired
609cb2e Sat, 25 Jan 2025 10:52:40 GMT Expired Expired
bfcdda7 Wed, 29 Jan 2025 20:07:47 GMT Cloud Enterprise

Comment on lines 9 to 17
const renderWithTheme = (ui: React.ReactElement, theme: Theme) => {
return render(
<ThemeContext.Provider value={{ theme, setTheme: vi.fn() }}>
{ui}
</ThemeContext.Provider>
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Thoughts on converting this to a wrapper component, similar to how we do it in other tests?

@codecov-staging
Copy link

codecov-staging bot commented Jan 23, 2025

Bundle Report

Changes will increase total bundle size by 25 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-staging-system 6.22MB 9 bytes (0.0%) ⬆️
gazebo-staging-esm 6.27MB 16 bytes (0.0%) ⬆️

Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.81%. Comparing base (02d5b6b) to head (609cb2e).
Report is 7 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #3675    +/-   ##
========================================
  Coverage   98.80%   98.81%            
========================================
  Files         820      826     +6     
  Lines       14784    14888   +104     
  Branches     4206     4238    +32     
========================================
+ Hits        14608    14712   +104     
  Misses        167      167            
  Partials        9        9            
Files with missing lines Coverage Δ
...ecovAIPage/CodecovAICommands/CodecovAICommands.tsx 100.00% <ø> (ø)
...age/CoverageOnboarding/GitHubActions/TokenStep.tsx 95.74% <100.00%> (-0.26%) ⬇️
.../RepoPage/FailedTestsTab/CodecovCLI/CodecovCLI.tsx 100.00% <ø> (ø)
...age/FailedTestsTab/GitHubActions/GitHubActions.tsx 100.00% <ø> (ø)
src/ui/LightDarkImg/LightDarkImg.tsx 100.00% <100.00%> (ø)

... and 20 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (+<0.01%) ⬆️
Pages 98.43% <100.00%> (+<0.01%) ⬆️
Services 99.30% <ø> (+0.01%) ⬆️
Shared 99.37% <ø> (+<0.01%) ⬆️
UI 99.14% <100.00%> (+<0.01%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 02d5b6b...609cb2e. Read the comment docs.

Copy link
Contributor

@nicholas-codecov nicholas-codecov left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@calvin-codecov calvin-codecov added this pull request to the merge queue Jan 29, 2025
Merged via the queue into main with commit a2f8a95 Jan 29, 2025
54 checks passed
@calvin-codecov calvin-codecov deleted the cy/light_dark_switch branch January 29, 2025 20:10
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.

[UI] Create Image Component To Automatically Handle Light & Dark Mode
3 participants