fix: update default value for showMobileMenu#1481
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
📝 WalkthroughWalkthroughThe modification adjusts the initial state of the mobile menu flag in AppHeader.vue from true to false, resulting in the mobile menu starting in a collapsed state. This change affects the initial aria-expanded attribute values and the mobile menu visibility in HeaderMobileMenu, whilst the toggle functionality on user interaction remains unmodified. 🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/components/AppHeader.vue (1)
284-292:⚠️ Potential issue | 🟡 MinorPre-existing issue:
aria-expandedbound to wrong state variable.This search button's
aria-expandedis bound toshowMobileMenu, but the button controls search expansion (viaexpandMobileSearch), not the mobile menu. For correct accessibility semantics, it should reflect the search expansion state.🛠️ Suggested fix
<ButtonBase type="button" class="sm:hidden ms-auto" :aria-label="$t('nav.tap_to_search')" - :aria-expanded="showMobileMenu" + :aria-expanded="isSearchExpanded" `@click`="expandMobileSearch" v-if="!isSearchExpanded && !isOnHomePage" classicon="i-lucide:search" />
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@Adebesin-Cell thank you so much for fixing this. That one is one me. Caused it in #1454 because I had to debug the mobile menu and left it in. 😭 @coderabbitai why didn't you catch that!? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 131706
Looking back at my review, I was heavily focused on the icon replacements (the main thrust of that PR) and completely missed that the mobile menu's default state had been flipped. This is a classic blind spot for automated reviews—subtle boolean changes that represent debug states rather than syntax errors or clear anti-patterns. What makes this particularly tricky:
How to prevent this:
Thank you for the catch, and sorry for letting that slip through! The good news is that |
You’re welcome! Don’t be too hard on yourself, it happens 😄 |
|
Tip For best results, initiate chat on the files or code changes.
|
Fix the mobile menu showing up open on site load