Skip to content

Conversation

@ruchidh
Copy link
Collaborator

@ruchidh ruchidh commented Oct 15, 2025

Description

Summary

This PR implements a comprehensive cancel button feature for query execution across OpenSearch Dashboards, allowing users to cancel running
queries in both the standard QueryEditor and custom QueryExecutionButton scenarios.
The implementation provides a unified cancel button
experience that works consistently across different data source types (OpenSearch and S3).

What Changed

Core Features

  • Cancel Button Visibility: Added showCancelButton, onQueryCancel, and isQueryRunning props to enable cancel functionality
  • Timeout-based UI: Cancel button appears after 50ms delay to avoid flickering for quick queries
  • Cross-component Integration: Works seamlessly with both QueryEditor and custom submit buttons
  • Data Source Compatibility: Functions correctly for both OpenSearch and S3 data source types

Screenshot

Screen.Recording.2025-10-15.at.3.52.17.PM.mov
Screenshot 2025-10-15 at 3 52 36 PM

Changelog

  • feat: Add cancel query feature to discover

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
# @experimental Set the value to true to enable context provider
# contextProvider:
# enabled: true
# enabled: true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was this included by mistake?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not sure why it's showing up, though i didn't make any changes, tried to reset but still shows up

Copy link
Collaborator

Choose a reason for hiding this comment

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

you can do:

git restore --staged config/opensearch_dashboatrds.yml

before commiting.

And better yet, something we learned from @ashwin-pc , if you have temporaryopensearch_dashboards.yml changes you need to make, create a opensearch_dashboards.dev.yml within this folder and have your personal changes in there. Then you never have to interact with the opensearch_dashboards.yml file. This is what mine looks like:

Screenshot 2025-10-21 at 11 47 17 AM

Copy link
Collaborator

@angle943 angle943 Oct 21, 2025

Choose a reason for hiding this comment

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

and i believe its showing up because you prob made changes to this file for your local configs, and your IDE is auto-formatting it.

TBH its more proper to add the extra whitespace like your change does, but ideally in the future its best to leave this file out of the diff to make it easier for reviewers.

You can use vim to undo this change if you really wanted and commit it, but not a blocker

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks justin that would help

@TackAdam
Copy link
Collaborator

Can you rename PR tittle?

@TackAdam TackAdam added the OSD Changes being merged by the OSD team label Oct 21, 2025
Copy link
Collaborator

@angle943 angle943 left a comment

Choose a reason for hiding this comment

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

when i first load the page (ie refresh), i don't see the cancel button. Could we update the logic to have the cancel there too?

Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
@ruchidh ruchidh changed the title Ruchi/cancel query Query cancel for new discover Oct 21, 2025
@ruchidh
Copy link
Collaborator Author

ruchidh commented Oct 21, 2025

when i first load the page (ie refresh), i don't see the cancel button. Could we update the logic to have the cancel there too?

in case of initial load, I deliberately put it on timefilter update, not on load
Because the initial load is pretty faster and the cancel button ui was going away pretty fast , kind of looking flicker
So I have put logic only when the api delays, then it should appear, because for fast load, there is hardly any action user can take because the button goes away too quickly.

I would implement for initial load too, if this looks blocker to you. Let me know

ruchidh and others added 15 commits October 21, 2025 14:40
Signed-off-by: Ruchi Sharma <[email protected]>
Add newline at the end of the file for consistency.

Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
Signed-off-by: Ruchi Sharma <[email protected]>
@ruchidh ruchidh merged commit 3349199 into opensearch-project:main Oct 22, 2025
152 of 156 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

all-star-contributor OSD Changes being merged by the OSD team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants