Skip to content

fix(dashboard): use Link for navigation buttons to support Ctrl+Click#494

Merged
GenerQAQ merged 3 commits intodevfrom
fix/dashboard-link-navigation
Mar 25, 2026
Merged

fix(dashboard): use Link for navigation buttons to support Ctrl+Click#494
GenerQAQ merged 3 commits intodevfrom
fix/dashboard-link-navigation

Conversation

@GenerQAQ
Copy link
Copy Markdown
Contributor

Why we need this PR?

Navigation action buttons (Messages, Tasks, Details, View Session, etc.) in dashboard list pages use router.push via onClick handlers. This prevents native browser link behaviors — users cannot Ctrl+Click / Cmd+Click / middle-click to open in a new tab, or right-click to copy link.

Describe your solution

Replace <Button onClick={() => router.push(url)}> with <Button asChild><Link href={url}> for all navigation-only buttons. This renders proper <a> tags with button styling, enabling native browser link interactions while keeping the same visual appearance.

Key decisions:

  • Conditional rendering for disabled buttons: Buttons with disabled state (user page counts, task button) render as <Link> when enabled, plain disabled <Button> when not — since <a> tags don't support disabled.
  • SkillList component: Added optional getSkillHref prop. When provided, skill cards render as <Link> instead of <div onClick>, and "View Files" becomes a Link button.
  • Back buttons preserved as router.push: Buttons reading returnTo from query params at click time stay as router.push since URLs depend on runtime state.
  • Non-navigation buttons unchanged: Delete, Config, Edit Meta, Create buttons remain as onClick handlers.

Implementation Tasks

  • Convert session list buttons (Messages, Tasks) to Link — Dashboard + OSS
  • Convert learning spaces list Details button to Link — Dashboard + OSS
  • Convert user list buttons (Disks, Sessions, Agent Skills) to Link with disabled handling — Dashboard
  • Convert learning space detail View Session button to Link — Dashboard + OSS
  • Add getSkillHref prop to SkillList component — Dashboard
  • Convert agent skills viewDetails button to Link — OSS
  • Convert messages page Disk and Task buttons to Link — OSS
  • Clean up unused useRouter imports

Impact Areas

  • Dashboard
  • Client SDK (Python)
  • Client SDK (TypeScript)
  • Core Service
  • API Server
  • CLI Tool
  • Documentation
  • Other: ...

Checklist

  • Open your pull request against the dev branch.
  • All tests pass in available continuous integration systems (e.g., GitHub Actions).
  • Tests are added or modified as needed to cover code changes.

Navigation action buttons in list pages used router.push via onClick,
preventing native browser behaviors like Ctrl+Click / Cmd+Click to open
in a new tab. Replaced with <Button asChild><Link href={...}> pattern
across both Dashboard and Dashboard OSS.
@GenerQAQ GenerQAQ requested a review from a team as a code owner March 25, 2026 09:52
When the card wrapper is a Link, the inner "View Files" button doesn't
need to be a Link too — clicking the card already navigates.
@GenerQAQ GenerQAQ merged commit 97e2c07 into dev Mar 25, 2026
3 checks passed
@GenerQAQ GenerQAQ deleted the fix/dashboard-link-navigation branch March 25, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant