Skip to content

feat(sidebar): support native href links - #1147

Open
sridharkalaibala wants to merge 1 commit into
frappe:mainfrom
sridharkalaibala:feat/sidebar-native-links
Open

sridharkalaibala wants to merge 1 commit into
frappe:mainfrom
sridharkalaibala:feat/sidebar-native-links

Conversation

@sridharkalaibala

Copy link
Copy Markdown

Closes #1125.

Sidebar destinations outside the router currently need a custom anchor or a button-based navigation workaround. Add href to SidebarItem and SidebarRailItem, rendering the existing link content as a native <a>. This supports normal browser link actions for other apps, documentation, and mail addresses. Frappe's merged Desk shell explicitly copies the rail tile classes around anchors pending this capability (consumer PR).

<SidebarRailItem label="Docs" href="https://docs.frappe.io" icon="lucide-book" />
<SidebarItem label="ERPNext" href="/apps/erpnext" />

An explicitly supplied href takes precedence over to, including an empty href. Native sidebar links use explicit active rather than inferring state from an ignored route. Existing router links, buttons, slots, tooltips, indicators, and click handlers retain their paths. The component guides and generated API tables document the new prop.

Validation:

  • Both Cypress component suites pass in headless Electron: 42 tests. All ten new cases fail on unchanged main, while its 32 existing cases pass. Coverage includes absolute/relative/mail/empty hrefs, a simultaneously supplied to, keyboard focus, unprevented native click delivery, and use without a router.
  • Both vue-tsc app/node projects and the Vite build pass. The build retains its large-chunk warning.
  • Full props generation completed; only the two affected API tables are included. git diff --check passes.
  • Full Vitest run: 1,719 passed, two failures. The migration test relying on chmod permission denial also fails on unchanged main under Windows. The editor's cold import exceeds its five-second timeout; all 13 editor primitive tests pass separately with a 20-second timeout. No test or timeout configuration is changed in this PR.

For the full docs/unit run, tracked sources were temporarily normalized to LF to avoid existing Windows shebang/JSDoc parsing issues, then restored. This contribution was prepared with AI assistance; the validation above was run locally.

@greptile-apps

greptile-apps Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

No actionable issues found; this appears safe to merge.

Reviews (1) · Last reviewed commit: "feat(sidebar): support native href links"

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.

RailItem (and SidebarItem): an anchor form for destinations outside the router

1 participant