Skip to content

Conversation

@Holocraft
Copy link
Contributor

@Holocraft Holocraft commented Dec 31, 2025

Description

This fixes the environment selector filter bug.

Motivation and Context

When going to PZ details and using the environment selector to select an environment, the total object count updates. But when you select "All environments", the count doesn't update.
Resolves: BED-6874

How Has This Been Tested?

Updated unit tests and tested manually

Screenshots (optional):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

Summary by CodeRabbit

  • New Features

    • Environment aggregation now supports filtering by collection status for improved environment selection control.
  • Bug Fixes

    • Environment selection is reset when switching between environment aggregation modes to prevent inconsistent state.
  • Refactor

    • Improved environment resolution logic in Privilege Zones views for better consistency with aggregation configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

@Holocraft Holocraft self-assigned this Dec 31, 2025
@Holocraft Holocraft added bug Something isn't working user interface A pull request containing changes affecting the UI code. labels Dec 31, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 31, 2025

Walkthrough

Changes enhance environment aggregation handling by introducing a collectedOnly parameter to filter environments, clearing the selected environment ID when aggregation mode changes, adding deterministic sorting for cache stability, and defining a new routing constant for privilege zones environment aggregation support.

Changes

Cohort / File(s) Summary
Environment hook enhancements
useAvailableEnvironments/useAvailableEnvironments.tsx, useEnvironmentIdList.tsx
Added collectedOnly boolean parameter to control environment filtering; environmentId is now cleared when environment aggregation changes; added deterministic sorting of aggregation IDs for cache stability
Routing configuration
routes/index.tsx
New export ENVIRONMENT_AGGREGATION_SUPPORTED_ROUTES constant defining privilege zones route with wildcard path matching (/{privilegeZonesPath}/\\*)
PrivilegeZones component updates
views/PrivilegeZones/Details/Details.tsx, views/PrivilegeZones/Details/ObjectCountPanel.tsx
Updated to use new ENVIRONMENT_AGGREGATION_SUPPORTED_ROUTES constant and pass collectedOnly flag (false) to useEnvironmentIdList calls

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • urangel
  • specter-flq
  • mistahj67

Poem

🐰 Hop along through aggregated lands,
Where environments clear with gentle hands,
Collected or not, the filter now stands,
Sorted with care—a stable command! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'PR feedback' is generic and vague, failing to convey the actual changes made. It does not communicate that this is a bug fix for environment selector filtering in privilege zones details. Revise the title to be more specific and descriptive of the bug being fixed, such as 'Fix environment selector filter bug in Privilege Zones details' or 'Fix all environments count update in PZ object count panel'.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description is largely complete, covering the bug being fixed, motivation/context with a Jira ticket reference, testing approach, change type, and relevant checklist items marked as complete.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Holocraft Holocraft changed the title PR feedback fix: environment selector filter bug BED-6874 Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working user interface A pull request containing changes affecting the UI code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants