Skip to content

bug: the mobile menu ignores the brand-preference check and four labels bypass i18n #766

Closed

Description

@gkhngyk

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

  1. Open a brand with shopping mode off (Brand settings → Shopping).
  2. Narrow the window below the md breakpoint, or open the app on a phone.
  3. 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.tsx already calls useBrandStore for activeBrandId, so this widens a selector rather than adding a dependency.
  • navKeyMap is complete. Rather than copying it a third time, consider exporting it from one place — the two components already comment on mirroring each other.
  • The nav namespace in web/messages/en.json already has agent, topics, shopping and audit, so no new keys are needed for the four missing labels.
  • en.json is the only locale file today, so this is about routing strings through t(), 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

  1. added
    bug
    good first issue
    help wanted
    on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions