B91 — Mount drawer search only when expanded; unify body export

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
This commit is contained in:
Cursor Agent 2026-08-01 05:46:42 +00:00
parent 5ec167f8dc
commit c73034aa77
No known key found for this signature in database
3 changed files with 5 additions and 7 deletions

View file

@ -2,10 +2,9 @@
import type { ReactNode } from 'react'
import { CampaignGlobalSearchProvider } from '@/components/campaign/dashboard/CampaignGlobalSearchMount'
import { CampaignGlobalSearchBody, CampaignGlobalSearchProvider } from '@/components/campaign/dashboard/CampaignGlobalSearchMount'
import { CampaignHomeLayout } from '@/components/campaign/dashboard/CampaignHomeLayout'
import { CampaignHomeSearch } from '@/components/campaign/dashboard/CampaignHomeSearch'
import { CampaignStaffGlobalSearchBody } from '@/components/campaign/dashboard/CampaignStaffGlobalSearch'
import { useHomeSearch } from '@/components/campaign/dashboard/HomeSearchContext'
import {
HomeSearchResultsProvider,
@ -45,7 +44,7 @@ const CampaignHomeStaffChromeInner = ({
searchResults ? (
<CampaignHomeStaffSearchSlot searchResults={searchResults} />
) : (
<CampaignStaffGlobalSearchBody />
<CampaignGlobalSearchBody />
)
}
summarySlot={summarySlot}

View file

@ -104,7 +104,7 @@ export const CampaignQuickActionsDrawer = ({
) : (
<p className="text-sm text-muted-foreground">Nenhuma ação rápida nesta página.</p>
)}
<CampaignGlobalSearchMount />
{expanded ? <CampaignGlobalSearchMount /> : null}
</div>
</DrawerContent>
</Drawer>

View file

@ -34,12 +34,11 @@ describe('CampaignQuickActionsDrawer (B91)', () => {
render(<CampaignQuickActionsDrawer actions={[]} />)
const context = document.getElementById('quickActionContext')
expect(context?.className).toContain('hidden')
expect(context?.getAttribute('data-snap')).toBe('collapsed')
expect(screen.queryByLabelText('Buscar na campanha')).toBeNull()
fireEvent.click(screen.getByRole('button', { name: 'Mostrar ações rápidas' }))
const context = document.getElementById('quickActionContext')
expect(context?.className).not.toContain('hidden')
expect(context?.getAttribute('data-snap')).toBe('expanded')
expect(screen.getByLabelText('Buscar na campanha')).toBeTruthy()