Repository navigation
Description
Description
The sidebar and the mobile menu render the same dashboardNav, but only the sidebar applies the rules that come with it. Two things fall out of that.
1. Shopping appears for brands that have it turned off.
NavItem.requiresBrandPref exists so an item can be hidden outright — not shown locked, hidden — when the active brand isn't meant to see it. Shopping is the only item using it. The sidebar honours it:
// web/src/components/layout/sidebar.tsx:119
if (item.requiresBrandPref && !brandPrefs[item.requiresBrandPref]) {
return null;
}mobile-nav.tsx has no equivalent. It applies the plan check (requiredFeature → locked with a Crown badge) and nothing else, so on a phone Shopping sits in the menu for a brand whose shopping mode is off, and tapping it opens a page with nothing to show.
2. Four labels never reach i18n.
The sidebar's navKeyMap (sidebar.tsx#L54-L68) covers all thirteen nav titles. The mobile menu's getLabel (mobile-nav.tsx#L43-L56) covers nine, and map[title] ?? title falls through to the raw English title for the four it misses: Agent, Topics, Shopping, Site Audit. The brand-scoped Prompts link above the loop (#L92) is a hardcoded string too.
The same map carries two keys — Overview and Settings — that match no item in dashboardNav.
Steps to reproduce
- Open a brand with shopping mode off (Brand settings → Shopping).
- Narrow the window below the
mdbreakpoint, or open the app on a phone. - Open the menu from the hamburger button.
Expected behavior
The mobile menu shows the same items as the sidebar under the same conditions: no Shopping entry for that brand, and every label resolved through t().
Actual behavior
Shopping is listed and tappable. Agent, Topics, Shopping and Site Audit render their raw titles.
Deployment mode
Cloud (ansvisor.com)
Environment
Any viewport below the md breakpoint.
Notes for whoever picks this up
Everything needed already exists in sidebar.tsx — this is bringing the two components level, not designing anything new.
- The preference is read from the brand store at sidebar.tsx#L36-L40:
useBrandStore((s) => s.brands.find((b) => b.id === s.activeBrandId) ?? null), then{ shoppingModeEnabled: !!activeBrand?.shoppingModeEnabled }.mobile-nav.tsxalready callsuseBrandStoreforactiveBrandId, so this widens a selector rather than adding a dependency. navKeyMapis complete. Rather than copying it a third time, consider exporting it from one place — the two components already comment on mirroring each other.- The
navnamespace inweb/messages/en.jsonalready hasagent,topics,shoppingandaudit, so no new keys are needed for the four missing labels. en.jsonis the only locale file today, so this is about routing strings throught(), not producing translations.
Worth confirming on a real narrow viewport, not only in the React tree — the menu renders inside a Sheet and the two components mount independently.
Activity