fix(web): use client navigation for sidebar dashboard links
Resolves #1408.
Summary
- Routes project-row dashboard button clicks through the existing client navigation helper.
- Preserves normal modified-click behavior for opening links in a new tab/window.
- Adds a sidebar regression test for client navigation.
Root cause
The per-row dashboard action rendered a Link, but its click handler only stopped propagation and allowed the default navigation path, which could trigger a full reload instead of the dashboard client transition.
Approach
Prevent default only for ordinary clicks, then call the sidebar navigate() helper so router navigation and mobile-close behavior stay consistent with the rest of the sidebar.
Verification
pnpm --filter @aoagents/ao-web test -- ProjectSidebar.test.tsxpnpm --filter @aoagents/ao-web... buildpnpm --filter @aoagents/ao-web testwas also run; it still has existing unrelated failures inserialize.test.ts,page.test.tsx,api-routes.test.ts, and the tmux integration test whentmuxis unavailable.
Greptile Summary
This PR fixes client-side navigation for the per-row project dashboard button in the ProjectSidebar. Previously the button's onClick only called stopPropagation and onMobileClose without preventing default or invoking the navigate() helper, so ordinary clicks fell through to a full browser reload instead of a router transition.
- Root fix: The dashboard
Link'sonClicknow callse.preventDefault()+navigate(projectHref)for plain clicks, preserving modifier-key (cmd/ctrl/shift) behavior to open in a new tab/window. - Dead-code removal:
e.button === 1guards removed from three existingonClickhandlers — middle-click firesauxclick, notclick, so these conditions were alwaysfalse. - Regression test added: A new test verifies that a plain click on the dashboard button calls
router.pushwith the correct project path.
Confidence Score: 5/5
Safe to merge — the change is a minimal, targeted fix to a single click handler, backed by a new regression test.
The dashboard button previously skipped client navigation entirely; the fix is straightforward (add preventDefault + call the existing navigate helper) and doesn't touch shared state or routing logic. Modifier-key open-in-new-tab behavior is correctly preserved. No parent click handlers exist on the containing divs, so removing stopPropagation from the early-return branch has no side effects.
No files require special attention.
Important Files Changed
| Filename | Overview |
|---|---|
| packages/web/src/components/ProjectSidebar.tsx | Dashboard button onClick refactored to call navigate() for client-side routing; e.button===1 dead-code removed from three handlers; stopPropagation preserved for plain clicks. |
| packages/web/src/components/tests/ProjectSidebar.test.tsx | New test verifies that clicking the per-row dashboard button invokes router.push with the correct project path. |
Sequence Diagram
sequenceDiagram
participant User
participant DashboardLink
participant ClickHandler
participant Navigate
participant Router
participant MobileClose
User->>DashboardLink: plain click
DashboardLink->>ClickHandler: onClick(e)
ClickHandler->>ClickHandler: e.preventDefault()
ClickHandler->>ClickHandler: e.stopPropagation()
ClickHandler->>Navigate: navigate(projectHref)
Navigate->>Router: router.push(url)
Navigate->>MobileClose: onMobileClose?.()
User->>DashboardLink: cmd/ctrl/shift + click
DashboardLink->>ClickHandler: onClick(e)
ClickHandler->>ClickHandler: modifier detected → return early
Note over DashboardLink: browser opens in new tab/window
Reviews (2): Last reviewed commit: "fix(web): remove unreachable sidebar cli..." | Re-trigger Greptile
can be merged ig @ashish921998
@ashish921998 can we merge this?
Hi @illegalcall @ashish921998 since its approved, can me merge this?
@illegalcall can we get it merged
Closing as part of a backlog sweep: Agent Orchestrator was rewritten from the ground up (Go backend + Electron/React frontend), and this PR's changes target files from the pre-rewrite TypeScript codebase that no longer exist in the current tree, so it cannot be rebased onto main. If the underlying change still makes sense for the current app, please open a fresh PR against the new codebase. Thanks for the contribution!