Enhanced Active Tab Detection for Nova Cards with URL Filter Support #37
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a significant enhancement to the
resource-navigation-link
package by adding the ability to dynamically determine the active state of navigation links based on URL filter parameters. Previously, the active state of navigation links was determined solely by matching the URL path, which limited scenarios where the active state needed to dynamically reflect filters applied within a single resource. This update addresses those limitations by enabling active state determination based on specified URL filters, significantly enhancing the package's flexibility and user experience.Main Contributions:
1. Refinement of
ResourceNavigationLink.vue
:2. Backend Integration in
Link.php
:3. Dynamic Event Listening:
filter-changed
andfilter-reset
events, enabling the component to update its active state in response to filter changes without a page reload.Detailed Enhancements:
Vue Component Adjustments:
ResourceNavigationLink.vue
now includes methods for detecting active filters from URL search parameters, alongside updates to lifecycle hooks for optimized event management.Server-side Logic Enhancement:
activeByFilter
method inLink.php
facilitates specifying filters that influence the active state of navigation links, complete with adjustments to serialization logic for effective frontend communication.Improved Reactivity and UI Responsiveness:
This enhancement significantly augments the
resource-navigation-link
package, providing developers with enhanced control over UI dynamics and navigation precision, particularly beneficial for applications leveraging filters. By enabling active tab identification based on URL filters, we offer an elevated level of control and a more intuitive navigation experience for users.I encourage the maintainers and the community to review and consider this enhancement for inclusion in the
resource-navigation-link
package. Your valuable feedback, insights, and any further suggestions are highly welcomed and appreciated!