fix: always show Create Policy button in page header#1905
Merged
Conversation
jeffredodd
approved these changes
May 21, 2026
The Create Policy button was hidden when the policy list was empty, leaving only the button inside the empty-state illustration. Now the header button renders regardless of list contents for consistent access.
4697284 to
5f85324
Compare
Fresh Eyes ReviewFound 2 issues in this PR. Additional Findings (outside diff)
Download findings.json — drag the file into Claude or use Please 👍🏽 👎🏽 if you found this useful. Generated by Fresh Eyes Reviewer. Get help in #ai-code-reviews |
Comment on lines
+272
to
+273
| const buttons = screen.getAllByRole('button', { name: 'Create policy' }) | ||
| expect(buttons.length).toBeGreaterThanOrEqual(1) |
There was a problem hiding this comment.
🟡 Minor | [fresh_eyes]: test-coverage
The updated test asserts buttons.length >= 1 which doesn't distinguish the header button from the empty-state illustration button. Since the fix specifically makes the header button always visible, consider asserting exactly 2 buttons are present in the empty state (header + empty-state CTA) to pin the new behavior.
Please 👍🏽 👎🏽 if you found this useful. Generated by Fresh Eyes Reviewer. Get help in #ai-code-reviews
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
policies.length > 0condition that hid the Create Policy button when the list was empty.Fixes bug: Create button disappears when there are no policies.
Test plan
PolicyList.test.tsxpasses (26/26)