From 10377d90fba38ea8e0983a29b3b89683fa388a52 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 30 Jul 2026 22:13:07 +0000 Subject: [PATCH] feat(campanha): remove mobile bottom nav (B73) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove CampaignBottomNav and getCampaignBottomNav — mobile navigation is now sidebar-only (Sheet via SidebarTrigger). Drop the pb-24 padding that reserved space for the fixed bar; scroll uses symmetric p-4 on mobile. Impeccable: N/A (shell chrome removal, class B per plan). Plan: docs/plans/remover-bottom-nav-mobile.md --- docs/plans/remover-bottom-nav-mobile.md | 2 +- src/app/(campaign)/campanha/(app)/layout.tsx | 4 +- .../campaign/shell/CampaignBottomNav.tsx | 45 ------------------- src/components/campaign/shell/nav.ts | 21 +-------- .../campaignIntelligenceConcepts.unit.spec.ts | 12 ++--- 5 files changed, 6 insertions(+), 78 deletions(-) delete mode 100644 src/components/campaign/shell/CampaignBottomNav.tsx diff --git a/docs/plans/remover-bottom-nav-mobile.md b/docs/plans/remover-bottom-nav-mobile.md index 82d47c48..e4b4bf09 100644 --- a/docs/plans/remover-bottom-nav-mobile.md +++ b/docs/plans/remover-bottom-nav-mobile.md @@ -1,6 +1,6 @@ # Remover bottom navigation bar no mobile -Status: rascunho +Status: entregue (2026-07-30) Atualizado em: 2026-07-29 Item do roadmap: [docs/roadmap.md](../roadmap.md) (Trilha B — **B73**; chassis UX-1) Impeccable: B — encaixe no shell `(app)`; remove chrome, não cria rota nova diff --git a/src/app/(campaign)/campanha/(app)/layout.tsx b/src/app/(campaign)/campanha/(app)/layout.tsx index ef236ac9..d9270482 100644 --- a/src/app/(campaign)/campanha/(app)/layout.tsx +++ b/src/app/(campaign)/campanha/(app)/layout.tsx @@ -8,7 +8,6 @@ import { BiometricEnrollmentToast, type BiometricEnrollmentOffer, } from '@/components/campaign/shell/BiometricEnrollmentToast' -import { CampaignBottomNav } from '@/components/campaign/shell/CampaignBottomNav' import { CampaignMobileTopBar } from '@/components/campaign/shell/CampaignMobileTopBar' import { CampaignSidebar } from '@/components/campaign/shell/CampaignSidebar' import { CampaignSidebarViewportDefault } from '@/components/campaign/shell/CampaignSidebarViewportDefault' @@ -78,11 +77,10 @@ export default async function CampaignAppLayout({ children }: { children: React.
{children}
- {biometricEnrollment ? : null} diff --git a/src/components/campaign/shell/CampaignBottomNav.tsx b/src/components/campaign/shell/CampaignBottomNav.tsx deleted file mode 100644 index 360405c9..00000000 --- a/src/components/campaign/shell/CampaignBottomNav.tsx +++ /dev/null @@ -1,45 +0,0 @@ -'use client' - -import Link from 'next/link' -import { usePathname } from 'next/navigation' - -import { getCampaignBottomNav, isCampaignNavActive } from '@/components/campaign/shell/nav' -import { cn } from '@/lib/utils' -import type { CampaignUser } from '@/payload-types' - -export const CampaignBottomNav = ({ role }: { role: CampaignUser['role'] }) => { - const pathname = usePathname() - const navItems = getCampaignBottomNav(role) - - return ( - - ) -} diff --git a/src/components/campaign/shell/nav.ts b/src/components/campaign/shell/nav.ts index f3462ea4..d40aa546 100644 --- a/src/components/campaign/shell/nav.ts +++ b/src/components/campaign/shell/nav.ts @@ -46,7 +46,7 @@ const staffNav: CampaignNavItem[] = [ /** * Reference material, not a place to work: sits in its own group at the foot - * of the sidebar, below the destinations, and never in the mobile bottom bar. + * of the sidebar, below the destinations. * Staff-only — every documented number is one a `leader` never sees. * * The href is a literal, not an import from `campaignIntelligenceConcepts.ts`: @@ -76,25 +76,6 @@ export const getCampaignNav = (role: CampaignUser['role']): CampaignNavItem[] => export const getCampaignSecondaryNav = (role: CampaignUser['role']): CampaignNavItem[] => isStaffCampaignRole(role) ? staffSecondaryNav : [] -/** - * Compact set for the mobile bottom bar (max 5 items with a home slot). - * Assessores stays sidebar-only (same as perfil/organizações). - */ -export const getCampaignBottomNav = (role: CampaignUser['role']): CampaignNavItem[] => { - const nav = getCampaignNav(role) - if (role === 'leader') return nav - - return nav - .filter( - (item) => - item.href !== '/campanha/quadro' && - item.href !== '/campanha/territorios' && - item.href !== '/campanha/apoiadores' && - item.href !== '/campanha/assessores', - ) - .slice(0, 5) -} - /** Home matches only exactly; other items also match nested paths. */ export const isCampaignNavActive = (pathname: string, href: string): boolean => { if (href === '/campanha') { diff --git a/tests/unit/campaignIntelligenceConcepts.unit.spec.ts b/tests/unit/campaignIntelligenceConcepts.unit.spec.ts index 21ee709e..5f542b92 100644 --- a/tests/unit/campaignIntelligenceConcepts.unit.spec.ts +++ b/tests/unit/campaignIntelligenceConcepts.unit.spec.ts @@ -2,11 +2,7 @@ import { describe, expect, it } from 'vitest' -import { - getCampaignBottomNav, - getCampaignNav, - getCampaignSecondaryNav, -} from '@/components/campaign/shell/nav' +import { getCampaignNav, getCampaignSecondaryNav } from '@/components/campaign/shell/nav' import { CAMPAIGN_CONCEPT_CATEGORIES, CAMPAIGN_CONCEPTS_PATH, @@ -78,10 +74,8 @@ describe('concepts sidebar entry', () => { expect(getCampaignSecondaryNav('leader')).toHaveLength(0) }) - it('stays out of the work destinations and the mobile bottom bar', () => { - const hrefs = [...getCampaignNav('coordinator'), ...getCampaignBottomNav('coordinator')].map( - (item) => item.href, - ) + it('stays out of the work destinations in the sidebar', () => { + const hrefs = getCampaignNav('coordinator').map((item) => item.href) expect(hrefs).not.toContain(CAMPAIGN_CONCEPTS_PATH) })