aminghadersohi opened a new pull request, #40781:
URL: https://github.com/apache/superset/pull/40781
### Summary
`Grid.useBreakpoint()` (Ant Design) returns an empty object `{}` on the
first render before viewport breakpoints are measured. This made `screens.md`
`undefined` (falsy), so `screens.md ? 'horizontal' : 'inline'` evaluated to
`'inline'` on first paint — rendering the navbar as a vertical stack. After the
next render cycle the breakpoint resolved and the nav snapped to horizontal,
producing a visible layout flash on every page load.
**Fix:** Replace `screens.md` with `const isMd = screens.md !== false`,
which treats the initial `undefined` as `true` (desktop/horizontal layout) and
only switches to mobile/inline layout when `screens.md` is explicitly `false`.
All three `screens.md` usages in `Menu.tsx` (`mode`, `align`, and the dropdown
icon spread) are updated to use `isMd`.
### Testing
Tested by loading a Superset workspace and verifying the top navbar renders
horizontally on first paint with no layout flash. Responsive behavior
(switching to inline on narrow viewports) is preserved.
### Checklist
- [x] Local testing done
- [ ] Tests added/updated
- [ ] Documentation updated (if needed)
Fixes: [sc-108034](https://app.shortcut.com/preset/story/108034)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]