Skip to content

chore: Discarding environment query params on Summary view BED-8766 #2947

Open
LucasParraF wants to merge 5 commits into
mainfrom
BED-8766-Differing-total-object-count
Open

chore: Discarding environment query params on Summary view BED-8766 #2947
LucasParraF wants to merge 5 commits into
mainfrom
BED-8766-Differing-total-object-count

Conversation

@LucasParraF

@LucasParraF LucasParraF commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Description

On the Privilege Zones page, there was a discrepancy between the displayed objects and the total count when an environment was selected.

This issue occurred because the object count request continued to include the environmentId parameter from the Details view, causing the Summary view to display counts for the previously selected environment instead of the current context.

Motivation and Context

Resolves BED-8766

How Has This Been Tested?

Tested locally

Screenshots (optional):

Types of changes

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

Checklist:

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes
    • Refined tab navigation for Zones and Labels to handle URL query parameters more precisely—query parameters are discarded only when navigating back to the summary page, reducing unexpected filtering or state carryover.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: ba9b8fc8-5c22-4304-be83-e60f8f37940b

📥 Commits

Reviewing files that changed from the base of the PR and between 7fd228e and 27600b5.

📒 Files selected for processing (1)
  • packages/javascript/bh-shared-ui/src/views/PrivilegeZones/PrivilegeZones.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/javascript/bh-shared-ui/src/views/PrivilegeZones/PrivilegeZones.tsx

📝 Walkthrough

Walkthrough

Updates PrivilegeZones.tsx so the zonesPath and labelsPath tab navigation passes discardQueryParams when calling navigate.

Changes

Tab Navigation Update

Layer / File(s) Summary
Query params discarded on tab navigation
packages/javascript/bh-shared-ui/src/views/PrivilegeZones/PrivilegeZones.tsx
The navigate call for the zonesPath and labelsPath tab cases now includes discardQueryParams, set from whether the target path is summaryPath.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: discarding environment query params on the Summary view.
Description check ✅ Passed The description includes the bug context, resolution ticket, testing note, type of change, and checklist, so it is mostly complete.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch BED-8766-Differing-total-object-count

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.

@LucasParraF LucasParraF changed the title chore: discarding query params on Summary view chore: discarding query params on Summary view BED-8766 Jul 1, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/javascript/bh-shared-ui/src/views/PrivilegeZones/PrivilegeZones.tsx (1)

156-159: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider adding a test for this branch.

No test currently covers the new conditional discardQueryParams for the zones/labels tab switch. Since this determines whether query params are silently dropped or preserved depending on isSummaryPage, a regression here would be easy to miss.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/javascript/bh-shared-ui/src/views/PrivilegeZones/PrivilegeZones.tsx`
around lines 156 - 159, Add a test that covers the labelsPath branch in
PrivilegeZones.tsx and verifies the discardQueryParams behavior when switching
tabs. Focus on the navigate call inside the switch case for labelsPath, and
assert that isSummaryPage/summaryPath causes discardQueryParams to be set for
the summary tab while it is not set for the other tab, so query params are
preserved correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@packages/javascript/bh-shared-ui/src/views/PrivilegeZones/PrivilegeZones.tsx`:
- Around line 156-159: Add a test that covers the labelsPath branch in
PrivilegeZones.tsx and verifies the discardQueryParams behavior when switching
tabs. Focus on the navigate call inside the switch case for labelsPath, and
assert that isSummaryPage/summaryPath causes discardQueryParams to be set for
the summary tab while it is not set for the other tab, so query params are
preserved correctly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 5ece032c-0480-431d-a37e-de2f0bfc0f78

📥 Commits

Reviewing files that changed from the base of the PR and between 3ef386c and af95ab7.

📒 Files selected for processing (1)
  • packages/javascript/bh-shared-ui/src/views/PrivilegeZones/PrivilegeZones.tsx

@LucasParraF LucasParraF self-assigned this Jul 1, 2026
@LucasParraF LucasParraF added the user interface A pull request containing changes affecting the UI code. label Jul 1, 2026
@LucasParraF LucasParraF changed the title chore: discarding query params on Summary view BED-8766 chore: Discarding environment query params on Summary view BED-8766 Jul 1, 2026
@cweidenkeller

Copy link
Copy Markdown
Contributor

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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