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

[Discover] fix: set smaller max width for mobile devices #199798

Merged

Conversation

akowalska622
Copy link
Contributor

@akowalska622 akowalska622 commented Nov 12, 2024

Summary

Closes #199620

The const for max width of pop over container was too big for mobile devices. I use useIsWithinBreakpoints within the component and pass isMobile check to the style object.
Had to choose ...(isMobile && { maxWidth: MAX_MOBILE_WIDTH }), over isMobile: MAX_MOBILE_WIDTH : undefined, because underlying function was not falling back undefined into the const set in calculateWidthFromCharCount.

Checklist

Delete any items that are not applicable to this PR.

  • Any UI touched in this PR does not create any new axe failures (run axe in browser: FF, Chrome)
  • This renders correctly on smaller devices using a responsive layout. (You can test this in your browser)
  • This was checked for cross-browser compatibility

For maintainers

@akowalska622 akowalska622 self-assigned this Nov 12, 2024
@akowalska622 akowalska622 added Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. Feature:Unified search Unified search related tasks backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Discover Discover Application release_note:skip Skip the PR/issue when compiling release notes labels Nov 12, 2024
@akowalska622 akowalska622 marked this pull request as ready for review November 12, 2024 17:27
@akowalska622 akowalska622 requested a review from a team as a code owner November 12, 2024 17:27
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@akowalska622 akowalska622 enabled auto-merge (squash) November 12, 2024 17:28
@akowalska622 akowalska622 changed the title fix: set smaller max width for mobile devices [Discover] fix: set smaller max width for mobile devices Nov 12, 2024
Copy link
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

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

Thanks for improving this! LGTM 👍

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #35 / Screenshots - serverless security UI response ops docs security cases security case settings case settings screenshot

Metrics [docs]

Async chunks

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

id before after diff
unifiedSearch 354.9KB 355.0KB +86.0B

History

cc @akowalska622

Copy link
Contributor

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

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

Changes look fine to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

It does seems strange that eui does not size the popover to contain the contents of the popover. Maybe just an edge case 🤷‍♂️.

Copy link
Contributor Author

@akowalska622 akowalska622 Nov 14, 2024

Choose a reason for hiding this comment

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

Yeah and it's apparently the case in more places (for example [Discover][Alerts] Layout issues on mobile when data view has a long name, maybe something worth mentioning to the EUI team?

@akowalska622 akowalska622 merged commit fbd06a3 into elastic:main Nov 14, 2024
24 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11839704329

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 14, 2024
…) (#200202)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Discover] fix: set smaller max width for mobile devices
(#199798)](#199798)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Ania
Kowalska","email":"63072419+akowalska622@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-11-14T14:55:16Z","message":"[Discover]
fix: set smaller max width for mobile devices
(#199798)","sha":"fbd06a347f2d6b4c312848723ecdf490bfbf8feb","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Discover","release_note:skip","v9.0.0","Team:DataDiscovery","Feature:Unified
search","backport:prev-minor"],"title":"[Discover] fix: set smaller max
width for mobile
devices","number":199798,"url":"https://github.com/elastic/kibana/pull/199798","mergeCommit":{"message":"[Discover]
fix: set smaller max width for mobile devices
(#199798)","sha":"fbd06a347f2d6b4c312848723ecdf490bfbf8feb"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199798","number":199798,"mergeCommit":{"message":"[Discover]
fix: set smaller max width for mobile devices
(#199798)","sha":"fbd06a347f2d6b4c312848723ecdf490bfbf8feb"}}]}]
BACKPORT-->

Co-authored-by: Ania Kowalska <63072419+akowalska622@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Discover Discover Application Feature:Unified search Unified search related tasks release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Discover][UnifiedSearch] Issues with long names for Data View picker on mobile
5 participants