-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[UnifiedDocViewer] Redesign header and make actions responsive #173780
Conversation
/ci |
/ci |
/ci |
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
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.
Thanks @jughosta ! Sending some design feedback below:
- Show EuiTooltip with the action text for the icon-only version.
![image](https://private-user-images.githubusercontent.com/4016496/293785101-87e08468-d0da-4169-ac6e-a2a0125a6b93.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA5NjMyMDgsIm5iZiI6MTcyMDk2MjkwOCwicGF0aCI6Ii80MDE2NDk2LzI5Mzc4NTEwMS04N2UwODQ2OC1kMGRhLTQxNjktYWM2ZS1hMmEwMTI1YTZiOTMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTRUMTMxNTA4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OWIxYjFmZWFiODUxZmYyMTI3MWQ3ZDFlMGM3ZTM2OGRlNWRhYjc3ZTNkMmE0NzU5YzZhMjQyMTk1OWQ3OTM4NyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.wTJ1pDiFxYe_ySDRxAGY6wNPOeLjnlosCHH2RMpXIa8)
- These buttons should wrap instead of getting cutoff
![image](https://private-user-images.githubusercontent.com/4016496/293790264-e44bf7d5-b613-458f-995b-27c83eac575f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA5NjMyMDgsIm5iZiI6MTcyMDk2MjkwOCwicGF0aCI6Ii80MDE2NDk2LzI5Mzc5MDI2NC1lNDRiZjdkNS1iNjEzLTQ1OGYtOTk1Yi0yN2M4M2VhYzU3NWYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTRUMTMxNTA4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Y2ZmNTA2OGI3OGU1ZDg4OWRhYjI1Nzk3ZTk0ZjljZTIxMWI3ZDgxMDg2YTUyZTZmZTZlZDlhZDEzODIzYmQwMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.IGwygY1r_bl6ojGjoyT2BN9n-zsBlm3WU4F-KShCwgo)
title: 'Example custom flyout', | ||
actions: { | ||
getActionItems: () => | ||
Array.from({ length: 5 }, (_, i) => { |
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.
You can update this number of extra items (2 default ones are always present) during testing to check how it works inside Discover Customization example plugin.
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.
@jughosta Design changes LGTM! Thanks for addressing all the feedback. Amazing job here!
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.
Looks and works great! A nice improvement over the previous design which always bugged me when it overflowed on smaller screens. Just a minor bit of feedback about CMD + click not working for popover menu items, and a question about the removal of the surrounding documents help text.
My only other extremely minor nit is that the spacing on the fullscreen buttons look ever so slightly uneven to me. Personally I'd suggest making EuiButtonEmpty
flush on both sides and bumping the flex gap to 12px to even out the spacing on fullscreen, but this is just me being nit picky and it's certainly not blocking 😅
<EuiIconTip | ||
content={i18n.translate('discover.grid.tableRow.viewSurroundingDocumentsHover', { | ||
defaultMessage: | ||
'Inspect documents that occurred before and after this document. Only pinned filters remain active in the Surrounding documents view.', | ||
})} | ||
type="questionInCircle" | ||
color="subdued" | ||
position="right" | ||
iconProps={{ | ||
className: 'eui-alignTop', | ||
}} | ||
/> |
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.
With this PR we lose the help tooltip for surrounding documents, which might be worth preserving for new users. It was added in a dedicated PR #123890, so I'm guessing there was a reason/need for it, although there's no issue linked so it's not really clear why. Do you think it would be worth adding something like a helpText
prop to FlyoutActionItem
? Or maybe @andreadelrio has some input on this since she was around for the original PR?
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.
@andreadelrio Should we add the help icon back?
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.
Unfortunately, I don't have specific context for why this tooltip was added. @davismcphee how do you envision helpText
prop working?
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 worries, figured it was worth a shot to ask. I was thinking the helpText
prop would allow passing help text that would show the info icon next to the button, but I'm now realizing that might look out of place with the icon-only buttons. I'd be happy to merge this as is if no one feels strongly about the help icon, and maybe we could consider another way to present the information to users as a followup.
cc @kertal in case you have thoughts or context around the help icon.
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.
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.
Good idea, I hadn't thought of that 👍 This works for me if it seems all good to @andreadelrio on the design side.
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.
Looking good, thx!
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 don't love this from a design point of view for the icon-only version but since this is an optional prop I think it should be ok.
} | ||
|
||
export function DiscoverGridFlyoutActions({ flyoutActions }: DiscoverGridFlyoutActionsProps) { | ||
const [isMoreFlyoutActionsPopoverOpen, setIsMoreFlyoutActionsPopover] = useState<boolean>(false); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
key={action.id} | ||
icon={action.iconType as EuiContextMenuItemIcon} | ||
data-test-subj={action.dataTestSubj} | ||
onClick={action.onClick} |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
Thanks for the latest changes! My nitpicks are satisfied, and the only blocking issue IMO was the CMD + click which is now working. I'll leave @andreadelrio to decide if we still need the help icon, or maybe there's another way we could communicate this to users in a followup PR. So in that case, great work and LGTM 👍
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.
Just another quick review to test the help text popover, and it's working as intended 👍
src/plugins/discover/public/components/discover_grid_flyout/discover_grid_flyout_actions.tsx
Outdated
Show resolved
Hide resolved
…scover_grid_flyout_actions.tsx Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
…ic#173780) - Resolves elastic#163239 - Resolves elastic#164660 - Related PR elastic#173765 ## Summary - large screen and max 3 items => it will render an icon and a label for each action: <img width="500" alt="Screenshot 2024-01-03 at 18 02 23" src="https://github.com/elastic/kibana/assets/1415710/f125a544-59c2-4ac9-aa87-9e72dd2c6deb"> - otherwise: max 3 icons and the rest in a context menu: <img width="400" alt="Screenshot 2024-01-03 at 18 02 07" src="https://github.com/elastic/kibana/assets/1415710/942b5cdb-2774-401a-9c68-daeb01b5d459"> - small screen: all items are in the context menu <img width="678" alt="Screenshot 2024-01-03 at 18 01 39" src="https://github.com/elastic/kibana/assets/1415710/52b9fb2a-b022-4a56-ad3c-e022b6876c0a"> I also extended "Discover customization" example plugin to showcase more actions. For testing you can run kibana with `yarn start --run-examples` and update number of additional actions locally via https://github.com/jughosta/kibana/blob/690c38e689d8fb802cce8155c1a300f5ca9cb94f/examples/discover_customization_examples/public/plugin.tsx#L411 ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
…ic#173780) - Resolves elastic#163239 - Resolves elastic#164660 - Related PR elastic#173765 ## Summary - large screen and max 3 items => it will render an icon and a label for each action: <img width="500" alt="Screenshot 2024-01-03 at 18 02 23" src="https://github.com/elastic/kibana/assets/1415710/f125a544-59c2-4ac9-aa87-9e72dd2c6deb"> - otherwise: max 3 icons and the rest in a context menu: <img width="400" alt="Screenshot 2024-01-03 at 18 02 07" src="https://github.com/elastic/kibana/assets/1415710/942b5cdb-2774-401a-9c68-daeb01b5d459"> - small screen: all items are in the context menu <img width="678" alt="Screenshot 2024-01-03 at 18 01 39" src="https://github.com/elastic/kibana/assets/1415710/52b9fb2a-b022-4a56-ad3c-e022b6876c0a"> I also extended "Discover customization" example plugin to showcase more actions. For testing you can run kibana with `yarn start --run-examples` and update number of additional actions locally via https://github.com/jughosta/kibana/blob/690c38e689d8fb802cce8155c1a300f5ca9cb94f/examples/discover_customization_examples/public/plugin.tsx#L411 ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
Summary
I also extended "Discover customization" example plugin to showcase more actions. For testing you can run kibana with
yarn start --run-examples
and update number of additional actions locally via https://github.com/jughosta/kibana/blob/690c38e689d8fb802cce8155c1a300f5ca9cb94f/examples/discover_customization_examples/public/plugin.tsx#L411Checklist