Skip to content
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

[ML] Add responsive layout to Index data visualizer, fix doc count chart margin #147137

Merged
merged 22 commits into from
Dec 22, 2022

Conversation

qn895
Copy link
Member

@qn895 qn895 commented Dec 6, 2022

Summary

This PR addresses #137257 and better handles the layout when the screen width decreases. Changes include:

  • The css is now updating based on the body content width (which window's width - side bar navigation's width).
  • The link cards are shown in the bottom instead of on the right side when the content width is smaller
  • Refresh button will only show the refresh icon when the size is small
  • Fix the doc count chart margin too big causing the chart
  • Fix wide time range display with sparse data

For reviewers:

  • kibana-design: 2 .scss files were deleted

Before

After
Screen Shot 2022-12-06 at 14 31 27

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@qn895 qn895 requested a review from darnautov December 6, 2022 20:28
@qn895 qn895 changed the title [ML] Add responsive layout to Index data visualizer [ML] Add responsive layout to Index data visualizer, fix doc count chart margin Dec 6, 2022
@qn895 qn895 marked this pull request as ready for review December 6, 2022 21:40
@qn895 qn895 requested review from a team as code owners December 6, 2022 21:40
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@qn895
Copy link
Member Author

qn895 commented Dec 7, 2022

@elasticmachine merge upstream

Copy link
Contributor

@mdefazio mdefazio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @qn895, just a few notes:

Looks like the top section goes outside the page a bit as we go to lower breakpoints. This might be as simple as removing the min-width on the data view title—I think the breakpoint kicks in before that condenses too much.
I would also recommend putting in some margin between the data view button and the 'use full data' button. I'd suggest 16px to denote that these are different sections, and keep the 8px spacing between items in a section. Tiny nit, but it does clean it up.

image

Not sure how much we should concern ourselves with this small of a breakpoint, but as the table switches to the mobile view, seems like there's some oddities in the order of things. Perhaps something worth exploring separately depending on the need?

image

Should we consider truncating the name to avoid simply cutting off the text? Possible that this could look like a shorter field name that it actually is.

image

I think we could decrease the size of these icons to give the text more room. Again, a tiny nit and not a blocker, but would help clean this up a bit.

image


I will mark this as a blocker, but acknowledge not all of these are required and primarily suggestions. The first point is probably the highest priority IMO. But happy to discuss these further.

@peteharverson
Copy link
Contributor

@mdefazio @qn895 do you think the narrow view would benefit from having bigger padding below the main panel and 'Explore your data', to show that the title and cards belong together?

image

@peteharverson
Copy link
Contributor

For a user without Discover access or the ability to create ML jobs, when there are no available actions, we still leave space on the right for the sidebar. Can the main panel go full width:

image

@mdefazio
Copy link
Contributor

mdefazio commented Dec 8, 2022

@peteharverson I agree and thanks for adding/catching these!

@peteharverson
Copy link
Contributor

peteharverson commented Dec 8, 2022

This behavior isn't from your changes here, but wondering if we should change it as part of this PR. The 'Explore your data' title is tied to the visibility of the Discover card, and isn't shown if just the ML cards are shown. I'm thinking we should show this section title if any of the cards are visible:

With Discover plus ML write access:

image

Without Discover access:

image

Thoughts @qn895 @mdefazio ?

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave this another test and all the layout fixes look good. The only issue I'm still seeing is where the date picker doesn't update with 'Use full data' for users without access to Discover.

Copy link
Contributor

@mdefazio mdefazio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took another look and everything is looking good! Thanks for making those edits!

@qn895
Copy link
Member Author

qn895 commented Dec 19, 2022

@elasticmachine merge upstream

@darnautov
Copy link
Contributor

Some observations regarding the visual part:

  1. Search bar doesn't fit the panel for some breakpoints

image

  1. Probably has to be fixed on the EUI side, but placeholder content is wrapping occasionally

image

  1. Not sure about the "Explore your data" section for smaller screens. Did you consider displaying them inline? cc @mdefazio

image

Comment on lines +165 to +166
// temporary fix to reduce horizontal chart margin until fixed in Elastic Charts itself
labelFormat={useLegacyTimeAxis ? undefined : () => ''}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please create an issue in the elastic-charts repo and mention the link in the comment?

@@ -240,15 +242,36 @@ export const DataVisualizerUrlStateContextProvider: FC<
[history, urlSearchString]
);

const [panelWidth, setPanelWidth] = useState(1600);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we actually need a default static value?

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for the Use Full Data button looks good, and rest of the changes to fix the responsive layout LGTM

Copy link
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@qn895
Copy link
Member Author

qn895 commented Dec 22, 2022

@elasticmachine merge upstream

@qn895 qn895 enabled auto-merge (squash) December 22, 2022 18:56
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
dataVisualizer 309 301 -8

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
dataVisualizer 24 25 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
dataVisualizer 530.1KB 380.0KB -150.2KB
Unknown metric groups

API count

id before after diff
dataVisualizer 28 29 +1

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
dataVisualizer 45 46 +1
enterpriseSearch 19 21 +2
fleet 61 67 +6
osquery 109 115 +6
securitySolution 436 442 +6
total +21

Total ESLint disabled count

id before after diff
dataVisualizer 45 46 +1
enterpriseSearch 20 22 +2
fleet 70 76 +6
osquery 110 117 +7
securitySolution 512 518 +6
total +22

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @qn895

@qn895 qn895 merged commit 602b6d6 into elastic:main Dec 22, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Dec 22, 2022
@qn895 qn895 deleted the ml-index-dv-responsive branch March 28, 2023 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants