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

Upgrade Storybook to 8.3.4 and fix theme-toggle #111

Merged
merged 2 commits into from
Oct 4, 2024

Conversation

GODrums
Copy link
Collaborator

@GODrums GODrums commented Oct 4, 2024

Motivation

To avoid conflicts between Spartan's Storybook integration and ours, we should upgrade our version (8.2.9) to match theirs (8.3.4).

Description

Currently npm install gives a bunch of warning related to conflicting Storybook versions. Example:

npm warn ERESOLVE overriding peer dependency
npm warn While resolving: @storybook/[email protected]
npm warn Found: [email protected]
npm warn node_modules/storybook
npm warn   dev storybook@"8.2.9" from the root project
npm warn   22 more (@storybook/addon-actions, ...)
npm warn

In addition, I added a adjusted the theme-toggle fix for the new Storybook version (tested on Chrome 129.0 & Firefox 131.0).

Testing

  1. Optional: delete node_modules in /webapp
  2. Execute npm install and check for errors or warning related to Storybook
  3. Run npm run storybook and check if the Storybook's theme-toggle still works correctly

Checklist

General

  • PR title is clear and descriptive
  • PR description explains the purpose and changes
  • Code follows project coding standards
  • Self-review of the code has been done
  • Changes have been tested locally

Client (if applicable)

  • UI changes look good on all screen sizes and browsers
  • No console errors or warnings
  • User experience and accessibility have been tested
  • Added Storybook stories for new components
  • Components follow design system guidelines (if applicable)

@GODrums GODrums added bug Something isn't working client priority:high Crucial tasks needing prompt attention. labels Oct 4, 2024
@GODrums GODrums self-assigned this Oct 4, 2024
@github-actions github-actions bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Oct 4, 2024
@FelixTJDietrich
Copy link
Collaborator

The theme switcher looks broken to me:
https://66a8981a27ced8fef3190d41-xctiftuyge.chromatic.com/?path=/docs/components-core-themeswitcher--docs&globals=theme:dark

Is this just a Storybook issue?

el!.dataset['theme'] = currentTheme;
const theme = props?.context.store.globals.globals.theme === 'dark' ? themes.dark: themes.light;
const el = document.querySelector('html');
const currentTheme = (el?.dataset['colorMode'] as 'light' | 'dark') || 'light';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah you mean you fixed the storybook theme switcher not the app theme switcher, but the app theme switcher does not work as expected in storybook. Maybe that is also not too important

@FelixTJDietrich
Copy link
Collaborator

Nevermind it works now

@FelixTJDietrich FelixTJDietrich merged commit 4bde64b into develop Oct 4, 2024
5 checks passed
@FelixTJDietrich FelixTJDietrich deleted the chore/upgrade-storybook-834 branch October 4, 2024 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client priority:high Crucial tasks needing prompt attention. size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants