Skip to content

BaseballHelm: stop non-showcase coaches from seeing showcase Organization routes #367

Description

@njrini99-code

Problem

Non-showcase BaseballHelm coaches can see an Organization hub because events is registered as visible to both roles/programs, and the sidebar shows the Organization hub when any of organization, teams, or events is visible. The destination routes are showcase/org-only and redirect ordinary coaches back to Command Center.

Evidence

  • src/lib/baseball/nav-registry.ts: events is role both with no program/capability gate.
  • src/components/layout/sidebar.tsx: buildCondensedBaseballNavigation() adds COACH_ORGANIZATION_HUB when any of organization, teams, or events is visible.
  • src/app/baseball/(dashboard)/dashboard/events/page.tsx, organization/page.tsx, teams/page.tsx: org/showcase route guards are used.

Why it matters

This creates a polished-looking nav link that routes users into a guard bounce. It makes the shell feel broken and hides real route contract drift.

Acceptance criteria

  • College, high-school, and JUCO coaches do not see showcase-only Organization routes in primary nav.
  • Showcase/academy/club coaches still see the correct org routes.
  • Shared Team Events are either split from Organization Events or explicitly gated by program type.
  • Add a nav contract test for college, high-school, JUCO, showcase, and player contexts.
  • Add a route/shell regression that ensures visible nav links do not redirect immediately to Command Center for authorized users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    baseballBaseballHelmbugIncorrect behavior or regressionfixed-in-pr-421Verified fixed by PR #421; auto-closes on mergetech-debtTech debt to address later

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions