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 stimulus nav controllers to follow stimulus best practices #4422

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

martinemde
Copy link
Member

@martinemde martinemde commented Feb 2, 2024

Change nav stimulus controllers to be more true to stimulus best practices (and be much simpler).

Also fixes the original error that triggered this PR.

@martinemde martinemde requested a review from segiddins February 2, 2024 04:52
Copy link

codecov bot commented Feb 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (89b2171) 97.13% compared to head (16ea06d) 97.13%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4422   +/-   ##
=======================================
  Coverage   97.13%   97.13%           
=======================================
  Files         385      385           
  Lines        8200     8200           
=======================================
  Hits         7965     7965           
  Misses        235      235           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@martinemde martinemde force-pushed the martinemde/nav-while-logged-out branch from b3df888 to b2997aa Compare February 2, 2024 19:14
@martinemde martinemde force-pushed the martinemde/nav-while-logged-out branch 2 times, most recently from 171ead7 to 896c06b Compare February 9, 2024 03:35
@martinemde martinemde changed the title Fix stimulus nav error in browser console Refactor stimulus nav controllers to follow stimulus best practices Feb 9, 2024
@martinemde martinemde force-pushed the martinemde/nav-while-logged-out branch from 896c06b to dffcfed Compare February 9, 2024 04:27
@martinemde
Copy link
Member Author

I made a major refactor of these now that @colby-swandale got me started on learning more about stimulus.

The header search box has some very weird behavior. I hid it on the home page, but it doesn't always solve the problem. Sometimes you can tab to it and then it stays visible, so I started hiding it purposely when the sandwich is clicked to close. It's better than it was, but you can still get in a weird state depending on the browser behavior for tabbing.

@@ -185,25 +185,25 @@
border-radius: 22px; }

@media (min-width: 1020px) {
.header__popup__nav-links, .home__header__popup__nav-links {
Copy link
Member Author

@martinemde martinemde Feb 9, 2024

Choose a reason for hiding this comment

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

The CSS changes are flipping the logic from is-expanded to hidden to be in line with the stimulus-dropdown component (which I'm not using, but still conformed to for simplicity).

@martinemde martinemde force-pushed the martinemde/nav-while-logged-out branch 2 times, most recently from dd6b79c to 9d119c8 Compare February 10, 2024 01:51
@martinemde martinemde force-pushed the martinemde/nav-while-logged-out branch from 9d119c8 to cb401be Compare February 18, 2024 03:27
Copy link
Member

@simi simi left a comment

Choose a reason for hiding this comment

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

Looks good to me, but I'm total stimulus noob. Better to wait for @colby-swandale review. 🙏

@martinemde martinemde force-pushed the martinemde/nav-while-logged-out branch from 16ea06d to e1dec5f Compare February 19, 2024 19:51
@martinemde
Copy link
Member Author

Hey, I'm going to merge this so I can use it as a base for autocomplete and fix the console errors. If there's any feedback, please let me know and I'll update.

@martinemde martinemde enabled auto-merge (squash) February 19, 2024 19:54
@martinemde martinemde merged commit 11c620b into master Feb 19, 2024
15 checks passed
@martinemde martinemde deleted the martinemde/nav-while-logged-out branch February 19, 2024 19:58
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