mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
fix(mobile): navigate to activity sessions from the More drawer
The activity row navigated and then called onClose, whose mobileTab-only replace navigation resolved against the pre-navigation location and overwrote the new route. Navigating alone drops mobileTab, which closes the drawer without discarding the destination.
This commit is contained in:
1 parent
33d9523666
commit
1d31286904
2 files changed
+3
-8
No files matched your search
@@ -346,7 +346,7 @@ describe('MoreDrawer', () => {
|
||||
expect(screen.queryByText('Session s1')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('navigates to the activity item and closes the drawer when a row is clicked', () => {
|
||||
it('navigates to the activity item without a close that would replace the new route', () => {
|
||||
const navigateMock = vi.fn()
|
||||
vi.mocked(useNavigate).mockReturnValue(navigateMock)
|
||||
mockAuth()
|
||||
@@ -358,6 +358,6 @@ describe('MoreDrawer', () => {
|
||||
fireEvent.click(screen.getByRole('button', { name: /Session s1/ }))
|
||||
|
||||
expect(navigateMock).toHaveBeenCalledWith('/repos/1/sessions/s1')
|
||||
expect(handleClose).toHaveBeenCalled()
|
||||
expect(handleClose).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
@@ -185,12 +185,7 @@ export function MoreDrawer({ isOpen, onClose }: MoreDrawerProps) {
|
||||
</div>
|
||||
<SideDrawerContent className="flex flex-col gap-4 pb-3">
|
||||
{isOpen && (
|
||||
<CompactActivityList
|
||||
onNavigate={(path) => {
|
||||
navigate(path)
|
||||
onClose()
|
||||
}}
|
||||
/>
|
||||
<CompactActivityList onNavigate={(path) => navigate(path)} />
|
||||
)}
|
||||
<MenuSection>
|
||||
{isSessionDetail && (
|
||||
|
||||
Reference in new issue
Block a user