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

fix(sql-editor): Fix run stop button color to improve usability #23892

Merged
merged 3 commits into from
May 3, 2023

Conversation

anamitraadhikari
Copy link
Contributor

@anamitraadhikari anamitraadhikari commented May 1, 2023

SUMMARY

During the running state of a query, users may find it challenging to distinguish between the stop button and the run button due to their similar color schemes. As a result, users may accidentally click the stop button, causing unintended interruption of the query's execution.

This pull request proposes to modify the color of the stop button to make it more distinct from the run button during query execution. By doing so, it will be easier for users to differentiate between the two buttons and avoid accidentally clicking the stop button, thereby preventing unintentional interruption of the query's execution.

Edit:
As part of this PR, we have also updated the explore view's stop button icon, to match it with sql lab stop button icon, for the sake of consistency.

Before:
Screenshot 2023-04-30 at 8 22 07 PM

After:
Screenshot 2023-05-03 at 1 26 46 AM

TESTING INSTRUCTIONS

  • Open SQL Lab
  • Hit the run button to execute a query
  • Check out the updated stop button color

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

@rusackas
Copy link
Member

rusackas commented May 1, 2023

@kasiazjc @yousoph thoughts on the design change? Code is a slam dunk :)

@codecov
Copy link

codecov bot commented May 1, 2023

Codecov Report

Merging #23892 (d406bb9) into master (2a1a061) will increase coverage by 0.00%.
The diff coverage is 83.33%.

❗ Current head d406bb9 differs from pull request most recent head 93062b2. Consider uploading reports for the commit 93062b2 to get more accurate results

@@           Coverage Diff           @@
##           master   #23892   +/-   ##
=======================================
  Coverage   68.10%   68.10%           
=======================================
  Files        1938     1940    +2     
  Lines       74999    75017   +18     
  Branches     8152     8155    +3     
=======================================
+ Hits        51077    51093   +16     
- Misses      21840    21841    +1     
- Partials     2082     2083    +1     
Flag Coverage Δ
javascript 54.46% <77.77%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...set-frontend/src/components/Select/AsyncSelect.tsx 88.46% <ø> (ø)
superset-frontend/src/components/Select/Select.tsx 90.41% <ø> (ø)
...nd/src/explore/components/RunQueryButton/index.tsx 100.00% <ø> (ø)
superset-frontend/src/preamble.ts 0.00% <0.00%> (ø)
superset-frontend/src/setup/setupFormatters.ts 0.00% <ø> (ø)
superset-frontend/src/types/bootstrapTypes.ts 100.00% <ø> (ø)
superset/cli/native_filters.py 0.00% <ø> (ø)
superset/dashboards/api.py 92.54% <ø> (+0.43%) ⬆️
superset/views/base.py 76.87% <ø> (ø)
...s/ExploreChartPanel/useResizeDetectorByObserver.ts 62.50% <62.50%> (ø)
... and 7 more

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

Left a few comments, curious to hear @kasiazjc 's thoughts

@@ -146,7 +146,9 @@ const RunQueryActionButton = ({
),
trigger: 'click',
}
: { buttonStyle: 'primary' })}
: {
buttonStyle: shouldShowStopBtn ? 'danger' : 'primary',
Copy link
Member

@villebro villebro May 2, 2023

Choose a reason for hiding this comment

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

I talked with @kasiazjc about this (she's out today), and she said we should make sure it's in line with the button in Explore. Looking at the code it appears we're using warning instead of danger there:

<Button onClick={onStop} buttonStyle="warning" disabled={!canStopQuery}>

This renders the following button when Explore is fetching data:

image

So if we change this to warning and also change the icon from fa fa-stop to fa fa-stop-circle-o then we get a very similar look and feel:

image

For reference, here's the button with the original icon class and danger style:
image

(btw, I kinda feel like the square stop icon is more intuitive, but I'd vote for using the same icon in both places, so I'm ok either way as long as they're in line)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@villebro Made the changes as requested, please take a look.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks @curious86 ! After chatting with @kasiazjc , we arrived at the following minor adjustment:

  • Let's keep the fa fa-stop class in the SQL Lab button icon.
  • Let's swap out fa fa-stop-circle-o in the Explore button for fa fa-stop

After that good to go!

@villebro villebro merged commit d4b9c18 into apache:master May 3, 2023
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants