-
Notifications
You must be signed in to change notification settings - Fork 203
Revert "[BD-9759][BpkPopover] Add close button beside body" #3894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert "[BD-9759][BpkPopover] Add close button beside body" #3894
Conversation
This reverts commit 84a880a.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR reverts a previous change that added a close button beside the body content in the BpkPopover component. The revert removes the functionality that allowed placing close buttons within the popover body area and restores the original layout structure.
- Removes close button elements from being rendered beside the body content
- Reverts CSS changes that modified the body layout to use flexbox
- Removes associated test cases and example components for the reverted functionality
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
File | Description |
---|---|
packages/bpk-component-popover/src/BpkPopover.tsx | Reverts popover component logic to remove close button from body area and inline close button elements |
packages/bpk-component-popover/src/BpkPopover.module.scss | Removes flexbox styling from popover body that was used for close button positioning |
packages/bpk-component-popover/src/BpkPopover-test.tsx | Removes test case for close button without title and fixes code style issues |
examples/bpk-component-popover/stories.js | Removes story export for WithNoTitle example |
examples/bpk-component-popover/examples.js | Removes WithNoTitleExample component and fixes formatting |
'bpk-popover__body', | ||
padded && 'bpk-popover__body--padded', | ||
); | ||
const bodyClassNames = getClassName(padded && 'bpk-popover__body--padded'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The getClassName call is missing the base 'bpk-popover__body' class name. This should be getClassName('bpk-popover__body', padded && 'bpk-popover__body--padded')
to ensure the base body class is always applied.
const bodyClassNames = getClassName(padded && 'bpk-popover__body--padded'); | |
const bodyClassNames = getClassName('bpk-popover__body', padded && 'bpk-popover__body--padded'); |
Copilot uses AI. Check for mistakes.
@@ -26,10 +26,10 @@ describe('BpkPopover', () => { | |||
|
|||
beforeEach(() => { | |||
onCloseSpy = jest.fn(); | |||
}); | |||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon after the closing brace. Should be });
to maintain consistent syntax.
}) | |
}); |
Copilot uses AI. Check for mistakes.
|
||
it('should render correctly', () => { | ||
const target = <button type="button">My target</button>; | ||
const target = (<button type="button">My target</button>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Unnecessary parentheses around JSX element. Should be const target = <button type="button">My target</button>;
for consistency with React conventions.
const target = (<button type="button">My target</button>); | |
const target = <button type="button">My target</button>; |
Copilot uses AI. Check for mistakes.
@@ -66,12 +66,12 @@ describe('BpkPopover', () => { | |||
My popover content | |||
</BpkPopover>, | |||
); | |||
}); | |||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon after the closing brace. Should be });
to maintain consistent syntax.
}) | |
}); |
Copilot uses AI. Check for mistakes.
expect(screen.queryByRole('My popover content')).not.toBeInTheDocument(); | ||
}); | ||
|
||
it('should render without an arrow', async () => { | ||
const target = <button type="button">My target</button>; | ||
const target = (<button type="button">My target</button>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Unnecessary parentheses around JSX element. Should be const target = <button type="button">My target</button>;
for consistency with React conventions.
const target = (<button type="button">My target</button>); | |
const target = <button type="button">My target</button>; |
Copilot uses AI. Check for mistakes.
@@ -87,7 +87,7 @@ describe('BpkPopover', () => { | |||
); | |||
await waitFor(async () => { | |||
expect(screen.getByText('My popover content')).toBeVisible(); | |||
}); | |||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon after the closing brace. Should be });
to maintain consistent syntax.
}) | |
}); |
Copilot uses AI. Check for mistakes.
expect(screen.getByRole('button', { name: /Close/i })).toHaveAttribute( | ||
'tabindex', | ||
); | ||
expect(screen.getByRole('button', { name: /Close/i, })).toHaveAttribute('tabindex'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing comma in object literal should be removed. Should be { name: /Close/i }
without the trailing comma.
expect(screen.getByRole('button', { name: /Close/i, })).toHaveAttribute('tabindex'); | |
expect(screen.getByRole('button', { name: /Close/i })).toHaveAttribute('tabindex'); |
Copilot uses AI. Check for mistakes.
Visit https://backpack.github.io/storybook-prs/3894 to see this build running in a browser. |
Reverts #3883