feat: support deep linking by blip or quadrant - #337
Conversation
|
@will-amaral - appreciate your thoughts on this PR |
There was a problem hiding this comment.
Pull request overview
Adds deep-linking support to the radar UI via query-string parameters so users can navigate directly to a specific blip (?blipId=<id>) or quadrant (?quadrant=<first|second|third|fourth>), addressing the need for quadrant-specific links (Issue #5).
Changes:
- Added URL utility helpers to read
blipIdandquadrantfrom the query string. - Added a radar render-time deep-link handler that selects a quadrant and optionally focuses a blip.
- Refactored quadrant table click logic into a reusable
performBlipClickhelper and documented deep-linking in the README.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/util/urlUtils.js |
Adds query-string parsing helpers for blipId and quadrant. |
src/graphing/radar.js |
Applies deep-link behavior after rendering quadrants/blips. |
src/graphing/components/quadrantTables.js |
Extracts blip-click behavior into performBlipClick for reuse (incl. deep links). |
spec/util/urlUtils-spec.js |
Adds unit tests for the new URL helpers. |
README.md |
Documents supported deep-link query parameters. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function renderDeepLinkViewIfPresent(quadrants) { | ||
| let quadrant | ||
|
|
||
| // Deep link by blip id | ||
| const blipIdToShow = getBlipIdFromUrl() | ||
| if (blipIdToShow) { | ||
| for (const q of quadrants) { | ||
| for (const b of q.quadrant.blips()) { | ||
| if (b.id() === blipIdToShow) { | ||
| quadrant = q | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Deep link by quadrant order | ||
| const quadrantToShow = getQuadrantFromURL() | ||
| if (quadrantToShow && !blipIdToShow) { | ||
| for (const q of quadrants) { | ||
| if (q.order === quadrantToShow) { | ||
| quadrant = q | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if (quadrant) { | ||
| selectRadarQuadrant(quadrant.order, quadrant.startAngle, quadrant.quadrant.name()) | ||
|
|
||
| if (blipIdToShow) { | ||
| const blipLink = document.getElementById(`blip-link-${blipIdToShow}`) | ||
| performBlipClick(blipLink) | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Deep-link behavior is introduced in renderDeepLinkViewIfPresent, but there are no end-to-end tests asserting that ?quadrant=... selects the correct quadrant and that ?blipId=... expands/highlights the blip. Since the repo already has Cypress coverage for quadrant/blip interactions, add e2e coverage for the URL-driven path to prevent regressions.
|
Refreshed this branch (Aug 2026):
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- rename getQuadrantFromURL to getQuadrantFromUrl for naming consistency - use explicit radix in parseInt - avoid unnecessary quadrant scan when no quadrant is present in the URL - use explicit null checks instead of truthy checks for blipIdToShow - guard performBlipClick against a missing blip link element
This PR adds optional support for deep-linking via query string arguments
?blipId=<id>?quadrant=<first|second|third|fourth>Note: blip id takes precedence when both are present