Skip to content

UI coherence with the upcoming new website#10

Merged
GitGab19 merged 3 commits into
stratum-mining:mainfrom
pavlenex:new-ui
Feb 11, 2026
Merged

UI coherence with the upcoming new website#10
GitGab19 merged 3 commits into
stratum-mining:mainfrom
pavlenex:new-ui

Conversation

@pavlenex
Copy link
Copy Markdown
Contributor

@pavlenex pavlenex commented Feb 6, 2026

Stylistic changes to ensure wizard has the same style as the upcoming website stratum-mining/stratumprotocol.org#300

Screen.Recording.2026-02-06.at.17.51.24.mov

@GitGab19
Copy link
Copy Markdown
Member

GitGab19 commented Feb 6, 2026

@lucasbalieiro can you take a look at this please?

Comment thread src/hooks/useTheme.tsx
Comment on lines +80 to +87
useEffect(() => {
const observer = new MutationObserver(() => {
const isDark = document.documentElement.classList.contains('dark');
setThemeState(isDark ? 'dark' : 'light');
});
observer.observe(document.documentElement, { attributes: true, attributeFilter: ['class'] });
return () => observer.disconnect();
}, []);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

TODO: check if this MutationOberver is really necessary. Is a good strategy, but might introduce a loop.

Where the user clicks the SetTheme button -> React changes the DOM -> MutationObserver capture the DOM changes and trigger React again, which triggers the DOM again and so on.

Have to check the stratumprotocol.org how it is handling the transition between themes. Because I think it is using localstorage also. So, we problably don't need the MutationObserver

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

from what I understand from both projects’ code, this MutationObserver doesn’t seem necessary. I might be missing some context, but based on what I could understand and test, we should be able to remove this useEffect entirely.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just one thing wrt theme selector, unrelated to this,I focused on is that it's coherent with website, so for example if user's settings are dark, website is dark so is wizard, otherwise things look messy if wizard goes into light and website was in dark mode, so just ensure there's consistency in the approach.

Comment thread src/hooks/useTheme.tsx
}

// 3. Fall back to system preference
if (typeof window !== 'undefined') {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (typeof window !== 'undefined') {
typeof window !== 'undefined' && 'matchMedia' in window {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this will force the matchMedia to be used only if it is actually implemented by the client side

@lucasbalieiro
Copy link
Copy Markdown
Collaborator

@GitGab19, I reviewed the changes. Most of them adjust Tailwind styling, so I focused mainly on the new theme selector feature. The rest appears to be CSS updates.

I noticed some borders seem to be missing, but I’m not sure if that’s intentional. For example, I see this when I point the stratumprotocol.org project to this wizard with the changes from this PR:

image

@pavlenex
Copy link
Copy Markdown
Contributor Author

pavlenex commented Feb 7, 2026

@lucasbalieiro when testing within against a website, best is to do it in context of stratum-mining/stratumprotocol.org#300, as explained here, to me it seems you tested with current stratumprotocol.org. Locally I don't see the issue with the borders.
Screenshot 2026-02-08 at 00 10 19

@pavlenex
Copy link
Copy Markdown
Contributor Author

pavlenex commented Feb 7, 2026

About the theme selector, feel free to take it over guys you know this shit way better than I do :)

@GitGab19
Copy link
Copy Markdown
Member

GitGab19 commented Feb 9, 2026

I ran this locally and I have seen no issues with the borders you mentioned @lucasbalieiro.

Given that both the new website and sv2-wizard are using tailwind, are we gonna maintain styling compatibility by keeping in sync the two tailwind.config.js files? Or do we also need to sync the two styles.css in some way?

@lucasbalieiro
Copy link
Copy Markdown
Collaborator

I ran this locally and I have seen no issues with the borders you mentioned @lucasbalieiro.

Given that both the new website and sv2-wizard are using tailwind, are we gonna maintain styling compatibility by keeping in sync the two tailwind.config.js files? Or do we also need to sync the two styles.css in some way?

We only need to keep the theme contract in sync, not the entire configs. Both projects must define the same semantic color keys in tailwind.config.js so the wizard utilities gets the definition in style.css inside stratumprotocol.org. The CSS files only need syncing if we want identical branding in the demo, that’s where the actual color values live. If they differ, nothing breaks, the wizard just uses a different theme.

@GitGab19 GitGab19 merged commit 5cfcb8a into stratum-mining:main Feb 11, 2026
3 checks passed
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.

3 participants