-
Notifications
You must be signed in to change notification settings - Fork 70
[LG-5523] feat(drawer): add ref and tooltipEnabled props to DrawerLayout toolbarData for ToolbarIconButton integration #3142
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 34f9348 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
ce27183
to
3a4a23a
Compare
Size Change: +81 B (+0.01%) Total Size: 1.55 MB
ℹ️ View Unchanged
|
…mizable tooltip behavior
… props for ToolbarIconButton integration
3a4a23a
to
34f9348
Compare
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 enhances the DrawerLayout
component's toolbarData
prop to support ref
and tooltipEnabled
properties for better integration with ToolbarIconButton
components. These additions enable developers to attach refs to toolbar buttons for positioning overlays like GuideCue
and control tooltip behavior to prevent conflicts with other overlays.
Key changes:
- Added
tooltipEnabled
prop toToolbarIconButton
for controlling tooltip visibility - Extended
toolbarData
interface to includeref
andtooltipEnabled
properties - Enhanced component integration by passing these new props through the drawer layout system
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
packages/toolbar/src/ToolbarIconButton/ToolbarIconButton.types.ts | Added tooltipEnabled prop definition |
packages/toolbar/src/ToolbarIconButton/ToolbarIconButton.tsx | Implemented tooltipEnabled prop functionality |
packages/toolbar/src/ToolbarIconButton/ToolbarIconButton.spec.tsx | Added tests for tooltip enabling/disabling behavior |
packages/toolbar/README.md | Updated documentation for tooltipEnabled prop |
packages/drawer/src/DrawerToolbarLayout/DrawerToolbarLayout/DrawerToolbarLayout.types.ts | Extended interface to include ref and tooltipEnabled properties |
packages/drawer/src/DrawerToolbarLayout/DrawerToolbarLayout/DrawerToolbarLayoutContent.tsx | Added prop forwarding for new properties |
packages/drawer/src/DrawerToolbarLayout/DrawerToolbarLayout/DrawerToolbarLayout.stories.tsx | Added comprehensive story demonstrating GuideCue integration |
packages/drawer/src/DrawerToolbarLayout/DrawerToolbarLayout/DrawerToolbarLayout.spec.tsx | Added test for ref functionality |
packages/drawer/README.md | Updated documentation for new toolbarData properties |
packages/drawer/package.json | Added guide-cue as dev dependency for stories |
packages/drawer/tsconfig.json | Added guide-cue to TypeScript references |
.changeset/rich-dancers-change.md | Changeset for drawer package |
.changeset/bright-doodles-post.md | Changeset for toolbar package |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
); | ||
|
||
const button = getByRole('button'); | ||
userEvent.hover(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.
The userEvent.hover
call should be awaited since it returns a Promise in modern versions of @testing-library/user-event.
Copilot uses AI. Check for mistakes.
); | ||
|
||
const button = getByRole('button'); | ||
userEvent.hover(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.
The userEvent.hover
call should be awaited since it returns a Promise in modern versions of @testing-library/user-event.
Copilot uses AI. Check for mistakes.
✍️ Proposed changes
This PR enhances the
DrawerLayout
component'stoolbarData
prop to supportref
andtooltipEnabled
properties for better integration withToolbarIconButton
components. The changes enable developers to attach refs to toolbar buttons (useful for positioning overlays likeGuideCue
) and control tooltip behavior to prevent conflicts with other overlays.The implementation includes:
ref
prop totoolbarData
for passing refs toToolbarIconButton
instancestooltipEnabled
prop to control tooltip visibility on toolbar buttonsToolbarIconButton
component withtooltipEnabled
prop support🎟️ Jira ticket: LG-5523
✅ Checklist
pnpm changeset
and documented my changes🧪 How to test changes
Test ref functionality:
DrawerLayout
and create a ref usinguseRef<HTMLButtonElement>(null)
toolbarData
array for any toolbar itemToolbarIconButton
Test tooltipEnabled functionality:
tooltipEnabled: false
on a toolbar item intoolbarData
tooltipEnabled: true
(or omit the prop) and verify tooltip shows on hoverTest GuideCue integration (as shown in the new story):