Skip to content

[ATL-1107][ATL-1045] Verify/Upload Buttons Hover & "running" style #197

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

Merged
merged 1 commit into from
Mar 17, 2021

Conversation

fstasi
Copy link
Contributor

@fstasi fstasi commented Mar 10, 2021

Creating another PR as I accidentally merged #190

This PR is an amend to the previous one, containing fixes after @kittaakos review

I Will squash merge this PR into main once the review is over, in order to have a single commit on the main branch

@fstasi fstasi changed the title Fstasi/verify button [Toolbar] Hover style and Toggle State [ATL-1107][ATL-1045] Mar 10, 2021
Comment on lines +79 to +87
// even with buttons disabled, better to double check if an upload is already in progress
if (this.uploadInProgress) {
return;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kittaakos

I added this check in order to future-proof the verify-sketch implementation:

https://arduino.atlassian.net/browse/ATL-1045 reports an error (Error: Request upload failed with message: 2 UNKNOWN: exit status 1) when a verify/build is run while another is in progress.

At the moment we only have buttons/menu items, but the check whether or not continue with the action should be inside the action handler itself in my opinion..

Do you have concerns about this approach?

Copy link
Contributor

Choose a reason for hiding this comment

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

but the check whether or not continue with the action should be inside the action handler itself, in my opinion.

It is there; you added the isEnabled method: https://github.com/arduino/arduino-ide/pull/197/files#diff-5c246e36e23a59755c9cc7d5a116eac5be34d188c0eb681f8c449915cbfe9aacR30.

In theory, if the command handler is not enabled, the command should not run. I am fine with this approach. I just wanted to know if you did hit an error or why did you add it.

Comment on lines 422 to 428
id: 'arduino.toolbar.toggleBackground',
defaults: {
dark: 'editor.selectionBackground',
light: 'editor.selectionBackground',
hc: 'activityBar.inactiveForeground'
},
description: 'Toggle color of the toolbar items when they are currently toggled (the command is in progress)'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kittaakos this approach should be valid:

I created a new variable associated to existing theme colors. This way I will be able to have a semantic meaning for the color, while relying on the themes.

Works for you?

@kittaakos
Copy link
Contributor

@fstasi, if the PR is ready for review, please quash the commits, and I look into it. Thank you!

@fstasi fstasi force-pushed the fstasi/verify-button branch from 0bf73a1 to a963e32 Compare March 15, 2021 08:26
@fstasi
Copy link
Contributor Author

fstasi commented Mar 15, 2021

@fstasi, if the PR is ready for review, please quash the commits, and I look into it. Thank you!

@kittaakos squashed and ready for review :)

@kittaakos
Copy link
Contributor

I have a few remarks on the behavior:

  • The toolbar color is not yellow when executing the command and hovering the toolbar. See the screencast. Once I have clicked on it, I have to un-hover the toolbar to see that it's yellow.

screencast 2021-03-15 09-42-38
In the Java IDE, the toolbar is yellow, when running and hover. This does not happen with IDE2.

  • I have noticed another issue, the toolbar hover has a different color:
    Java IDE:
    screencast 2021-03-15 10-46-38

IDE2:
screencast 2021-03-15 10-47-41

  • There is a pixel mismatch or what, one can clearly see how the toolbar shifts to the right a bit when the command is in process, then goes back.
    screencast 2021-03-15 10-49-06

@kittaakos
Copy link
Contributor

I have restarted the build, it was failing due to some issues out of the context of the project:

    gyp http 500 https://electronjs.org/headers/v9.4.3/node-v9.4.3-headers.tar.gz
    gyp WARN install got an error, rolling back install
    gyp ERR! configure error 
    gyp ERR! stack Error: 500 response downloading https://electronjs.org/headers/v9.4.3/node-v9.4.3-headers.tar.gz

HTTP 5xx is a server error, there isn't much we could do. Hopefully, we get back the green build 🤞

@kittaakos
Copy link
Contributor

There is no visual indication of the toolbar items when hovering over them or running the corresponding command with the HC theme.

screencast 2021-03-15 10-56-00

@fstasi fstasi force-pushed the fstasi/verify-button branch 2 times, most recently from 722d79d to dd6a039 Compare March 16, 2021 14:10
@fstasi fstasi changed the title [Toolbar] Hover style and Toggle State [ATL-1107][ATL-1045] Verify/Upload Buttons Hover & "running" style [ATL-1107][ATL-1045] Mar 16, 2021
Copy link

@ubidefeo ubidefeo left a comment

Choose a reason for hiding this comment

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

the behaviour is correct, but disabled buttons (such as the debug button) should not receive a hover when they are disabled.

steps to reproduce:

  • open a sketch
  • select Arduino UNO (does not support debugging)
  • ensure the button is greyed out
  • hover
  • verify it changes colour

fix hover state on toolbar items

Improved statemanagement for ToolbarItem and Menus

Disable Upload buttons while a sketch upload is already in progress

toggled state to have override disabled button opacity

doublecheck internal status before verify/upload a sketch

fixes after code review
@fstasi fstasi force-pushed the fstasi/verify-button branch from dd6a039 to 56fb68f Compare March 17, 2021 09:11
@fstasi
Copy link
Contributor Author

fstasi commented Mar 17, 2021

the behaviour is correct, but disabled buttons (such as the debug button) should not receive a hover when they are disabled.

steps to reproduce:

* open a sketch

* select Arduino UNO (does not support debugging)

* ensure the button is greyed out

* hover

* verify it changes colour

@ubidefeo fixed, thanks for pointing that out. I'm glad I had a spare very old arduino uno to test it 🧪

let me know if we are good to go

@fstasi fstasi requested a review from ubidefeo March 17, 2021 10:20
Copy link

@ubidefeo ubidefeo left a comment

Choose a reason for hiding this comment

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

LGTM

@fstasi fstasi changed the title Verify/Upload Buttons Hover & "running" style [ATL-1107][ATL-1045] [ATL-1107][ATL-1045] Verify/Upload Buttons Hover & "running" style Mar 17, 2021
@fstasi fstasi merged commit 1e0f52b into main Mar 17, 2021
@fstasi fstasi deleted the fstasi/verify-button branch March 17, 2021 16:50
@per1234 per1234 added topic: code Related to content of the project itself type: enhancement Proposed improvement labels Oct 28, 2021
@per1234 per1234 added the topic: theme Related to GUI theming label Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself topic: theme Related to GUI theming type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants