Breadcrumbs: Only dedupe breacrumb items for matching node names #78077
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.
What is this feature?
This PR is a follow-up to #75218 but changes the logic to only de-duplicate breadcrumb items when both the base URL and the node names match.
Why do we need this feature?
The new alerting detail page (WIP) injects two additional breadcrumbs when viewing the details for a particular alert.
A
namespace
and thegroup
breadcrumb are added; and we'd like both of them to navigate to the alert rules list view but with some search filters applied.The breadcrumb would roughly look like
Alerting > My Namespace > My group > My alert rule
.My Namespace
would go to/alerting/list?query=namespace:"my+namespace"
My Group
would go to/alerting/list?query=namespace:"my+namespace"+group="my+group"
Both breadcrumb items share the same base path, which currently triggers de-duplication logic in the breadcrumb component.
grafana/public/app/core/components/Breadcrumbs/utils.ts
Lines 35 to 42 in 4a3c148
This PR adds an additional requirement for both the current and the parent breadcrumb item to also share the same text.
Special notes for your reviewer:
This is a proposed change to the breadcrumbs de-dupe logic, feel free to discuss alternatives :)