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

refactor: theme state #4310

Merged
merged 15 commits into from
Jul 15, 2024
Merged

refactor: theme state #4310

merged 15 commits into from
Jul 15, 2024

Conversation

Schwehn42
Copy link
Member

@Schwehn42 Schwehn42 commented Jul 15, 2024

Description

Changes the logic how setting of the theme is handled.

Before

Previously, the logic was split weirdly by using the local storage directly to set/get the theme.
Also, the Html component would hold the logic to determine what the system theme preference is.

After

Now, theme ist also part of the application store and can be set/retrieved as such with Actions etc.
The theme is is also still saved to the local storage and retrieved initially, but the local storage key name has been streamlined with the scrumlr prefix to fit with the others.

Additionally, a hook is now used to determine the theme which is set as a global attribute.

Changelog

  • Add theme to the application store (as part of view), including Actions, Reducer, and Middleware.
  • The middleware will now handle setting the local storage implicitly (new key: scrumlr/theme).
  • Added a hook useAutoTheme which will return the currently used theme ("light" | "dark"), even if the theme is set to "auto".
  • Adjust Html.tsx and ThemeSettings.tsx to use the new app state / hook.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • The light- and dark-theme are both supported and tested
  • The application was tested in the most commonly used browsers (e.g. Chrome, Firefox, Safari)

@Schwehn42 Schwehn42 added the Review Needed This pull request is ready for review label Jul 15, 2024
@Schwehn42 Schwehn42 self-assigned this Jul 15, 2024
Copy link

The deployment to the dev cluster was successful. You can find the deployment here: https://4310.development.scrumlr.fra.ics.inovex.io
This deployment is only for testing purposes and will be deleted after 1 week.
To redeploy rerun the workflow.
DO NOT STORE IMPORTANT DATA ON THIS DEPLOYMENT

Deployed Images
  • ghcr.io/inovex/scrumlr.io/scrumlr-frontend:sha-e2d05ab

  • ghcr.io/inovex/scrumlr.io/scrumlr-server:sha-e2d05ab

@Schwehn42 Schwehn42 mentioned this pull request Jul 15, 2024
5 tasks
Copy link

octomind-dev bot commented Jul 15, 2024

🐙 Octomind

Test Report: 13/14 successful.

description status details
About Section Visibility Test Passed ✅ click
change avatar Passed ✅ click
check Privacy Policy Passed ✅ click
check terms & conditions Passed ✅ click
close cookie banner - front page Passed ✅ click
close cookie banner - sign-in Passed ✅ click
create and delete board columns Passed ✅ click
create_and_delete_notes_and_actions_v2 Failed ❌ click
create lean coffee board Passed ✅ click
edit_notes_and_actions_v5 Passed ✅ click
get started Passed ✅ click
share_session Passed ✅ click
sign-in Passed ✅ click
test all ways to open the setup flow Passed ✅ click

commit sha: e2d05ab

Copy link
Contributor

@BenedictHomuth BenedictHomuth left a comment

Choose a reason for hiding this comment

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

LGTM and works in all common browsers

@Schwehn42 Schwehn42 removed the Review Needed This pull request is ready for review label Jul 15, 2024
@Schwehn42 Schwehn42 added this pull request to the merge queue Jul 15, 2024
Merged via the queue into main with commit 053b020 Jul 15, 2024
10 checks passed
@Schwehn42 Schwehn42 deleted the js/refactor-theme-state branch July 15, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants