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

[UnifiedSearch] Relative date picker resets selection #143157

Open
sukhwindersingh-qasource opened this issue Oct 12, 2022 · 12 comments
Open

[UnifiedSearch] Relative date picker resets selection #143157

sukhwindersingh-qasource opened this issue Oct 12, 2022 · 12 comments
Labels
bug Fixes for quality problems that affect the customer experience Feature:Unified search Unified search related tasks impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@sukhwindersingh-qasource

Describe the bug:
45 seconds are considered as 1 minute under relative set time.

Build Details:

VERSION: 8.5.0
BUILD: 56932
COMMIT: 1bb0d052c8d6842b88665c8c489f3a2d4cf4b46a

Preconditions

  1. Kibana should be running.

Steps to Reproduce

  1. Navigate to security in kibana.
  2. Click on rules
  3. Click on time shown at the right side of calendar icon and set seconds at 45s.

Actual Result
45 seconds are considered as 1 minute under relative set time.

Expected Result
60 seconds should be considered as 1 minute under relative set time.

Screen-Recording:

Alerts.-.Kibana.Mozilla.Firefox.2022-10-11.18-16-39.mp4
@sukhwindersingh-qasource sukhwindersingh-qasource added bug Fixes for quality problems that affect the customer experience triage_needed impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. labels Oct 12, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@sukhwindersingh-qasource
Copy link
Author

@karanbirsingh-qasource Please review this.

@ghost ghost assigned MadameSheema and unassigned ghost Oct 12, 2022
@MadameSheema MadameSheema removed their assignment Oct 13, 2022
@MadameSheema MadameSheema added Team:AppServicesSv and removed Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. labels Oct 13, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServicesSv)

@vadimkibana vadimkibana added Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. and removed Team:AppServicesSv labels Jan 15, 2024
@elasticmachine
Copy link
Contributor

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

@kertal kertal added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Jan 16, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@kertal kertal removed the Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. label Jan 16, 2024
@stratoula
Copy link
Contributor

stratoula commented Jan 16, 2024

@sukhwindersingh-qasource I can't replicate it in Discover main
Also this component is an EUI component, the SuperDatePicker so this logic is not in kibana. I recommend:

  • test it in latest main
  • if this persists open the issue in EUI repo

I am removing the visualizations team's assignment

@stratoula stratoula removed the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Jan 16, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Jan 16, 2024
@kertal kertal added the Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. label Jan 16, 2024
@botelastic botelastic bot removed the needs-team Issues missing a team label label Jan 16, 2024
@markov00
Copy link
Member

This is usually the way libraries like momentjs humanize a specific duration. You can test it also on momentjs docs page: https://momentjs.com/docs/#/durations/humanize/

They apply a generalization to that duration and this always be approximate, as you can see with 45 days => a month and so on.

I believe the ~ before the test is there to mean nearly a minute ago.
@stratoula @kertal I don't see the reason to use a humanized version of the relative time here, usually, this is used on blogs, and threads as the user doesn't care much about the precise time a post was submitted, but in our case, this probably could be more precise. Is also easier for us because we just use a single precise duration, that is already expressed in month/year/minutes/weeks, so a precise humanization doesn't create any issue.
Even if someone choose 120 seconds we don't need to humanize it to 2 minutes, but 120 seconds is good too.

@stratoula
Copy link
Contributor

@markov00 I hear this, maybe we need to do these discussions with the EUI team which owns the component though. Kibana is just the consumer here.

@dej611
Copy link
Contributor

dej611 commented Jan 22, 2024

In Kibana there's a special momentjs handler for this cases in https://github.com/elastic/kibana/blob/main/src/plugins/data/common/search/aggs/buckets/lib/time_buckets/calc_es_interval.ts#L85 which takes care to return "precise" human readable durations . Perhaps it can be outsourced to EUI?

@kertal
Copy link
Member

kertal commented Jan 22, 2024

FYI @elastic/eui-team

@stratoula
Copy link
Contributor

In Kibana there's a special momentjs handler for this cases in https://github.com/elastic/kibana/blob/main/src/plugins/data/common/search/aggs/buckets/lib/time_buckets/calc_es_interval.ts#L85 which takes care to return "precise" human readable durations . Perhaps it can be outsourced to EUI?

Yes we are using it in aggregations, it could I guess y not, noone has complained about this afaik

@cee-chen
Copy link
Member

cee-chen commented Jan 22, 2024

EUI has a couple issues related to this:

The problem here is one of intention. It's a UX issue, not a developer one, and it's difficult to know what makes the most sense for all possible scenarios. The best we could likely do at the EUI level is add a doNotRound kind of prop/flag that developers can turn on on a case-by-case basis.

If that's something y'all want, please do feel free to leave a comment on elastic/eui#4026 requesting a reprioritization!

@kertal kertal added Feature:Unified Integrations Unified Integrations view feature Team:Visualizations Visualization editors, elastic-charts and infrastructure and removed Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. labels Feb 7, 2024
@kertal kertal added Feature:Unified search Unified search related tasks and removed Feature:Unified Integrations Unified Integrations view feature labels Feb 15, 2024
@ghudgins ghudgins changed the title [Security Solution]45 seconds are considered as 1 minute under relative set time. [UnifiedSearch] Relative date picker resets Nov 12, 2024
@ghudgins ghudgins changed the title [UnifiedSearch] Relative date picker resets [UnifiedSearch] Relative date picker resets selection Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Unified search Unified search related tasks impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

9 participants