feat(calm-hub-ui): Deeplinks within CalmHub#1853
Conversation
1a15364 to
a878fb3
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds deeplink functionality to CalmHub UI, enabling users to navigate directly to specific resources via URL parameters and maintain their navigation state across page refreshes.
Key Changes:
- Added URL parameter-based routing for namespace, resource type, resource ID, and version
- Refactored TreeNavigation component to initialize state from URL parameters and update the URL on user interactions
- Added comprehensive test coverage for deeplink scenarios
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| calm-hub-ui/src/visualizer/contracts/contracts.ts | Defines HubParams type for URL parameter structure |
| calm-hub-ui/src/App.tsx | Adds parameterized route /artifacts/:namespace?/:type?/:id?/:version? for deeplink support |
| calm-hub-ui/src/hub/components/tree-navigation/TreeNavigation.tsx | Implements deeplink handling by initializing state from URL params, extracting helper functions for loading resources, and calling navigate() on user interactions |
| calm-hub-ui/src/hub/components/tree-navigation/TreeNavigation.test.tsx | Adds test cases for deeplink scenarios and wraps tests with MemoryRouter for routing support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
calm-hub-ui/src/hub/components/tree-navigation/TreeNavigation.tsx
Outdated
Show resolved
Hide resolved
calm-hub-ui/src/hub/components/tree-navigation/TreeNavigation.tsx
Outdated
Show resolved
Hide resolved
calm-hub-ui/src/hub/components/tree-navigation/TreeNavigation.tsx
Outdated
Show resolved
Hide resolved
calm-hub-ui/src/hub/components/tree-navigation/TreeNavigation.test.tsx
Outdated
Show resolved
Hide resolved
|
Currently only concerned with the use of any for the typing. Besides that looks good |
Yes I think I have avoided any now. Please let me know if it's still in there and I will update. |
|
@willosborne are we happy this PR would resolve #1243 ? |
calm-hub-ui/src/hub/components/tree-navigation/TreeNavigation.tsx
Outdated
Show resolved
Hide resolved
|
Action points based on discussion with Aidan:
|
As of 09/03/26, all these points have been resolved. |
requested changes have been addressed
Description
Examples:
Even when you refresh the page, the same thing should come back based on the deeplink.
Type of Change
Affected Components
cli/)shared/)calm-widgets/)calm-hub/)calm-hub-ui/)docs/)calm-plugins/vscode/)Commit Message Format ✅
Testing
Checklist