-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Use push flyout for Discover document flyout #166406
Use push flyout for Discover document flyout #166406
Conversation
@@ -251,6 +254,15 @@ export function DiscoverGridFlyout({ | |||
textBasedHits={isPlainRecord ? hits : undefined} | |||
/> | |||
</EuiFlyoutBody> | |||
<EuiFlyoutFooter> |
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.
From the EUI docs (https://elastic.github.io/eui/#/layout/flyout#push-versus-overlay):
Also, it is good to include a close button in the footer for a larger hit target than the small close button provides.
…n/kibana into unified-doc-viewer/push-flyout
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
<EuiFlexGroup> | ||
<EuiFlexItem grow={false}> | ||
<EuiButtonEmpty iconType="cross" onClick={onClose} flush="left"> | ||
Close |
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.
yes, this make sense, one ask, pls add i18n for Close
🙏
@elasticmachine merge upstream |
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 overall! A couple point of feedback from testing:
Now that the sidebar is resizable and the doc flyout pushes the content, the sidebar and main panels can become squished when the flyout is open and the screen is on the smaller side of XL (so still a push flyout). It seems like reducing the min width of the main panel improves this. I'd recommend updating discover_resizable_layout.tsx
to use const minMainPanelWidth = euiTheme.base * 24;
instead of the current value.
I also noticed that since the flyout pushes the content when it opens, you can lose sight of the selected document row as the data grid resizes. I wonder if it's possible to do something like auto-scroll to the selected doc after opening the flyout?
It also looks like after I close the push flyout, there are some rendering issues with the data grid. This is likely just a bug with EuiDataGrid
, but I wonder if we can do something about it. It's possible that implementing some sort of auto-scroll functionality might force the data grid to render and fix this issue as well:
Otherwise I do find the flyout a bit wide overall. Even on a large screen it took up about half the space, but I think this could be reduced when we migrate to floating actions in the doc viewer table, so I wouldn't consider it blocking unless others feel strongly about it.
I feel like, given there were new changes under the hood, like the sizable field list, and also the potential vanishing of the actually selected row when the autosized document column is rendered, it should be reviewed again for design changes, and in the context of our ongoing redesign FYI @andreadelrio @MichaelMarcialis @ninoslavmiskovic |
Seeing this in action, I think I would not implement this change until we implement #164617. The left white space for me is a blocker to implement this push flyout. When we move to floating actions we'll be able to reduce the width of this flyout. I also think that when we implement the push flyout it should come with the ability to drag-to-resize, similar to what we now have for the field list. |
The vanishing row is a bug in my opinion. Also I did not expect the push fly out to be that "aggressive" on resizing. Could we e.g work with how it pushes the content or collapse the field list automatically? Agree on next iteration with working on the re-sizing, however before see it as a blocker. Is there anything we can work on how it renders ? |
size="m" | ||
pushMinBreakpoint="xl" | ||
data-test-subj="docTableDetailsFlyout" | ||
onKeyDown={onKeyDown} | ||
ownFocus={false} |
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 think ownFocus
should be true now, this would not apply for the push, but for the overlay style
ownFocus={false} | |
ownFocus={true} |
…n/kibana into unified-doc-viewer/push-flyout
|
||
it('should not display a log level badge when not available', async () => { |
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.
For some reason this test (and the others below) were failing because the web elements had become "stale", and were throwing errors. I'm not sure how the changes in this PR would affect this, but breaking these into separate it()
statements seems to fix the issue and still test the same behavior.
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 PR will actually remove most of these tests after moving the doc view implementation, I'll take care of the conflicts but this LGTM.
@@ -81,7 +81,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { | |||
await dataGrid.clickRowToggle({ columnIndex: 4 }); | |||
await testSubjects.existOrFail('logsExplorerFlyoutLogLevel'); | |||
await dataGrid.closeFlyout(); | |||
}); |
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.
Nit: I think the flyouts no longer need to be closed in those tests, since we navigate to Discover before each test
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.
LGTM, looking great and working snappy 👍
Tests locally with Safari, Firefox, Chrome, all fine and work as expected.
A note about the tests, that's pretty strange, it seems when using the push flyout our code in the test to get the row cells no longer works. Might be caused because when the push flyout is closed, this leads the table / layout to be pre-rendered. Not a blocker but we might need to investigate what's happening here , what also might have worked instead of creating separate tests, is just to not close the flout when showing another row, since this should work with the push flyout
…n/kibana into unified-doc-viewer/push-flyout
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 about good to go on my end! A couple of minor points of feedback, but it's just about there IMO.
I did notice that my workaround to prevent breaking the Discover layout doesn't work when there's a nav sidebar like in serverless or the O11y solution nav, but I don't think there's much we can do about that unless we make all of Discover responsive based on container width, so I think it's good for now:
@@ -230,6 +232,10 @@ export function DiscoverGridFlyout({ | |||
minWidth={minWidth} | |||
maxWidth={maxWidth} | |||
onResize={setFlyoutWidth} | |||
css={{ | |||
maxWidth: `${isXlScreen ? `calc(100vw - ${defaultWidth}px)` : '90vw'} !important`, |
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 didn't realize this when I originally opened my touchups PR, but there's going to be an issue with using defaultWidth
here since it could be a string value when overridden by a customization (e.g. Logs Explorer uses 60%
). I think we can just split out euiTheme.base * 34
into a separate const to use here and we should be safe.
css={{ | ||
maxWidth: `${isXlScreen ? `calc(100vw - ${defaultWidth}px)` : '90vw'} !important`, | ||
}} | ||
className="dscGridFlyout" |
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.
Rather than using a class with a new style, we should be able to instead use paddingSize="m"
to get the 16px padding. This will also apply the padding to the header which right now is still 24px.
test/accessibility/apps/discover.ts
Outdated
@@ -133,7 +133,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { | |||
it('a11y test for actions on a field', async () => { | |||
await PageObjects.discover.clickDocViewerTab('doc_view_table'); | |||
if (await testSubjects.exists('openFieldActionsButton-Cancelled')) { | |||
await testSubjects.click('openFieldActionsButton-Cancelled'); | |||
await testSubjects.click('openFieldActionsButton-Cancelled'); // Open the actions | |||
await testSubjects.click('openFieldActionsButton-Cancelled'); // Close the actions |
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 think we should close the menu after we call await a11y.testAppSnapshot();
to make sure our a11y snapshot includes the open menu.
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.
LGTM, thanks!
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.
LGTM
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
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 like my remaining concerns are addressed, so in that case this LGTM 👍 Great work on this, and I'm excited to get it merged!
I noticed one minor issue where the Logs Explorer flyout default width isn't being set now, but that's actually unrelated to these changes and is a separate bug with the customization framework, so I'll open up a separate PR to address it.
…er (#181788) ## Summary This PR fixes an issue where the `useCustomization` hook in Discover always returns `undefined` on the first render, which can have unintended consequences. This went unnoticed before, but the work in #166406 revealed the issue, resulting in the Logs Explorer flyout initializing to the wrong width. With this fix, the width initializes correctly, but the default value of `60%` causes the layout to become crammed, so I updated it to what seemed like a more reasonable default of `650px`. I can change this to something else if we feel there's a better default. **Before (`60%`):** <img width="1997" alt="before" src="https://github.com/elastic/kibana/assets/25592674/50994ca9-f232-4c5c-a948-46a0e9202864"> **Now (`650px`):** <img width="1997" alt="after" src="https://github.com/elastic/kibana/assets/25592674/dcc8f53f-0f17-4b2f-9e33-9b1ba134d4ae"> ### Checklist - [ ] 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) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] 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)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Summary
Closes #163798.
Closes #160306
Uses
"push"
style for the document viewer flyout in Discover.Before:
After:
Checklist