-
Notifications
You must be signed in to change notification settings - Fork 196
feat: AI drawer header actions #3824
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
Conversation
9345d9e
to
a2d9ca3
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3824 +/- ##
==========================================
- Coverage 97.14% 97.13% -0.02%
==========================================
Files 844 844
Lines 24515 24549 +34
Branches 8645 8658 +13
==========================================
+ Hits 23815 23845 +30
- Misses 693 697 +4
Partials 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
96be15b
to
638e75a
Compare
8e1780c
to
5e46e42
Compare
expect(onToggle).toHaveBeenCalledWith({ isOpen: false, initiatedByUserAction: true }); | ||
}); | ||
|
||
(type === 'global-ai' ? test : test.skip)( |
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.
I started a new file for this new API: https://github.com/cloudscape-design/components/blob/main/src/app-layout/__tests__/runtime-drawers-widgetized.test.tsx
It is better to add new exclusive features there
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.
this test is no longer specific for the ai drawer - it now applies for to both global and global-ai
00e0963
to
97b03bf
Compare
fc85522
to
4a7b1ba
Compare
4a7b1ba
to
c2175eb
Compare
591b7b2
to
77cc90b
Compare
if (!root) { | ||
return; | ||
} | ||
refs.close = { current: root.querySelector('[data-itemid="close"]') as unknown as Focusable }; |
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.
I'm open to any suggestion to make it better
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.
Ok to merge as a temporary solution.
But let's ask in the P&C channel for help. Most likely we should expose a new package-private API to assign refs on button group items
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.
All comments ⛳ are merge blocking, the rest are follow ups
id: 'add', | ||
iconName: 'add-plus', | ||
text: 'Add', | ||
popoverFeedback: <StatusIndicator type="success">Message copied</StatusIndicator>, |
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.
⛳ This is not going to work in the real world when the React instance used in the widget and version used in app layout are different
Perhaps we should omit all slot properties from this API (or print a warning they are not supported in this mode)
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.
Printed a warning for unsupported props
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.
We need to remove these instances, because having them with a warning may confuse if this use-case is supported or not (it is not supported)
const animationDisabled = | ||
(activeGlobalDrawer?.defaultActive && !drawersOpenQueue.includes(activeGlobalDrawer.id)) || | ||
(wasExpanded && !isExpanded); | ||
let drawerActions: ReadonlyArray<ButtonGroupProps.InternalItemOrGroup> = [ |
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.
⛳ Is it the same code as above?
This needs to be deduplicated
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.
no, it might look similar, but it's not the same. global drawer and left global drawer have slightly different set of props
if (!root) { | ||
return; | ||
} | ||
refs.close = { current: root.querySelector('[data-itemid="close"]') as unknown as Focusable }; |
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.
Ok to merge as a temporary solution.
But let's ask in the P&C channel for help. Most likely we should expose a new package-private API to assign refs on button group items
src/button-group/interfaces.ts
Outdated
popoverFeedback?: React.ReactNode; | ||
} | ||
|
||
export interface InternalIconButton extends IconButton { |
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.
⛳ This lives inside ButtonGroupProps
namespace which is public.
You need to move all private additions outside this namespace to avoid exporting to public
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.
addressed
7efd67a
to
8e36467
Compare
…ions in runtime api
177de3f
to
1bc402d
Compare
Description
This PR adds a new API for declaring header actions in global panels registered through the plugin API. The goal is to make it easier to add actions to panel headers. Currently, teams have to create custom buttons
with absolute positioning, which causes accessibility issues. This PR fixes that by using the existing
ButtonGroup
component instead.Related links, issue #, if available: n/a
How has this been tested?
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md
.CONTRIBUTING.md
.Security
checkSafeUrl
function.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.