-
Notifications
You must be signed in to change notification settings - Fork 189
feat: Left global panel #3660
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
Merged
Merged
feat: Left global panel #3660
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
1a59785
feat: Global left drawer
georgylobko ed9361c
fix: AI drawer focus outline size
georgylobko 89cb2bb
chore: Disable resize handler under certain conditions
georgylobko 299ffda
chore: Small a11y fix
georgylobko d9c7b80
chore: Small a11y fix
georgylobko ed99370
fix: Hide ai trigger tooltip after closing the drawer
georgylobko 009ef0a
chore: Increase size limit
georgylobko 6c289ab
fix: AI drawer content height
georgylobko 19efd38
small fix
georgylobko 83db0fe
fix: AI drawer background issue
georgylobko 7d94f5a
fix: AI drawer header overscrolling issue
georgylobko cfc6808
fix: AI drawer mobile overlapping
georgylobko 8abc38c
fix: AI drawer mobile overlapping
georgylobko d65281a
chore: Increase size limit
georgylobko 41130c8
chore: Temp skip app-layout-toolbar-split-panel-trigger-tooltip.test.ts
georgylobko 8b80000
fix: Address a11y feedback
georgylobko b14f152
chore: Consider AI drawer minimum size when deciding which panel to c…
georgylobko bc763b8
chore: Make the AI drawer always take precedence over all other drawe…
georgylobko 401de0a
fix: AI drawer animation behavior
georgylobko 95e96f5
chore: Prevent body scrolling when AI drawer or any global drawer is …
georgylobko 233b74d
chore: Add waitFor
georgylobko e20419f
chore: Align AI drawer trigger with latest design changes
georgylobko cbbef9d
chore: Align AI drawer exit expanded mode with latest design changes
georgylobko 97acabf
chore: Increase limit size
georgylobko 2140cfd
chore: Adjusted AI drawer's trigger block size
georgylobko 2d6c549
chore: Set default size
georgylobko 7a0b425
chore: Increase limit size
georgylobko ba171fc
fix: AI drawer's slider bug in firefox
georgylobko 6c80414
fix: Border radius bug
georgylobko e0fc645
chore: Transition for hiding AI drawer
georgylobko e5b1677
chore: Prevent content inside the AI drawer wrapping on enter transition
georgylobko e8e313b
chore: Hide resize handler only after ending expanded mode transition
georgylobko 4b1cc23
feat: Widgetized plugin api (#3776)
georgylobko 9f31b53
chore: Apply last design changes
georgylobko af25820
chore: Apply last design changes
georgylobko 7a76326
fix: AI drawer animation behavior
georgylobko 9728f0b
chore: Mezzanine border on sidecar demo page
georgylobko b83d12c
fix: Animation behavior for entering expanded mode
georgylobko e406994
chore: Cleanup
georgylobko 7dd7d04
chore: Cleanup
georgylobko 9b62604
chore: Skip flaky tests
georgylobko 6b95420
chore: Get rid of trademarks
georgylobko f838874
chore: AI drawer's border refactoring
georgylobko fce83a7
chore: Small refactoring
georgylobko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
86 changes: 86 additions & 0 deletions
86
pages/app-layout/utils/external-global-left-panel-widget.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import React from 'react'; | ||
import ReactDOM, { unmountComponentAtNode } from 'react-dom'; | ||
|
||
import { Box } from '~components'; | ||
import Button from '~components/button'; | ||
import ButtonDropdown from '~components/button-dropdown'; | ||
import { registerLeftDrawer } from '~components/internal/plugins/widget'; | ||
|
||
const AIDrawer = () => { | ||
return ( | ||
<Box padding="m"> | ||
<Box variant="h2" padding={{ bottom: 'm' }}> | ||
Chat demo | ||
</Box> | ||
{new Array(100).fill(null).map((_, index) => ( | ||
<div key={index}>Tela content</div> | ||
))} | ||
</Box> | ||
); | ||
}; | ||
|
||
registerLeftDrawer({ | ||
id: 'amazon-q', | ||
resizable: true, | ||
isExpandable: true, | ||
defaultSize: 420, | ||
preserveInactiveContent: true, | ||
|
||
ariaLabels: { | ||
closeButton: 'Close AI Panel drawer', | ||
content: 'AI Panel', | ||
triggerButton: 'AI Panel', | ||
resizeHandle: 'Resize handle', | ||
expandedModeButton: 'Expanded mode button', | ||
exitExpandedModeButton: 'Console', | ||
}, | ||
|
||
trigger: { | ||
customIcon: ` | ||
<svg width="94" height="24" viewBox="0 0 94 24" fill="none" focusable="false" aria-hidden="true"> | ||
<rect width="94" height="24" rx="4" fill="url(#paint0_linear_145_32649)"/> | ||
<defs> | ||
<linearGradient id="paint0_linear_145_32649" x1="135.919" y1="21" x2="108.351" y2="74.1863" gradientUnits="userSpaceOnUse"> | ||
<stop stop-color="#B8E7FF"/> | ||
<stop offset="0.255" stop-color="#0099FF"/> | ||
<stop offset="0.514134" stop-color="#5C7FFF"/> | ||
<stop offset="0.732534" stop-color="#8575FF"/> | ||
<stop offset="1" stop-color="#962EFF"/> | ||
</linearGradient> | ||
</defs> | ||
</svg> | ||
`, | ||
}, | ||
|
||
onResize: event => { | ||
console.log('resize', event.detail); | ||
}, | ||
onToggle: event => { | ||
console.log('toggle', event.detail); | ||
}, | ||
|
||
mountContent: container => { | ||
ReactDOM.render(<AIDrawer />, container); | ||
}, | ||
unmountContent: container => unmountComponentAtNode(container), | ||
|
||
mountHeader: container => { | ||
ReactDOM.render( | ||
<div style={{ inlineSize: '100%', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}> | ||
<div>AI Panel</div> | ||
<div> | ||
<ButtonDropdown | ||
items={[{ id: 'settings', text: 'Settings' }]} | ||
ariaLabel="AI Panel additional options" | ||
variant="icon" | ||
/> | ||
<Button iconName="add-plus" variant="icon" ariaLabel="Add a new chat" /> | ||
</div> | ||
</div>, | ||
container | ||
); | ||
}, | ||
unmountHeader: container => unmountComponentAtNode(container), | ||
}); |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
When are we going to fix these tests?
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.
After release. Created a follow-up item in the doc q
kCSlAib5IKly