Flutter-intellij: update the behavior of the run and debug buttons

Created on 3 Nov 2016  路  19Comments  路  Source: flutter/flutter-intellij

We should update the behavior of the run and debug buttons to address some UX issues:

  • [x] the run button should be changed from executing flutter run --release to flutter run (just like the current debug button) (#445)
  • [x] the run button should not set breakpoints and not break on exceptions (it's the same as the debug button, but without debuggability)
  • [ ] we contribute a hot reload and a restart app button to the run toolbar; these should likely be visible when the currently selected config is hot reloadable (or when the device chooser is visible)
  • [x] when an app is executing, the run and debug buttons become disabled (the launch config reports that it can't run if any running apps were launched from that config)
enhancement usability

Most helpful comment

Make sure that you do not modify Run/Debug icons and behavior if currently selected run configuration in the combo box is not the one that you want to hot reload or whatever. It is a valid use case:

  • select 'MyFlutterApp1 (debug)' in the combo box, Debug it
  • select not related 'Some Java Server' run config, Run or Debug it
  • etc.
  • select 'MyFlutterApp1 (debug)' again. Hot reload it

All 19 comments

Details of the 'lightning bolt' behavior are discussed in https://github.com/flutter/flutter-intellij/issues/230

Make sure that you do not modify Run/Debug icons and behavior if currently selected run configuration in the combo box is not the one that you want to hot reload or whatever. It is a valid use case:

  • select 'MyFlutterApp1 (debug)' in the combo box, Debug it
  • select not related 'Some Java Server' run config, Run or Debug it
  • etc.
  • select 'MyFlutterApp1 (debug)' again. Hot reload it

Nice! Thanks for writing out this plan. sgtm, looking forward to trying it out.

@pq, possibly for 0.1.5?

Closing #230 as a covered by this, so including the Android Studio screenshot here:

android-studio-intant-run

I did some digging into this on Friday and I see some challenges on the UI front. In particular, it doesn't look like hijacking the run/debug button icons and tooltips is straightforward. I'm guessing this is a place where AS hacked the platform.

Curious if @alexander-doroshko has any thoughts?

(EDIT: one thought is to go through the ActionManager and update the presentations for the run and debug actions. Not sure how fragile that'd be though.)

I didn't look into AS source code, but I haven't heard of legal ways to manipulate Run/Debug icons, tooltips, etc.

You might be interested in looking how Android plugin in IntelliJ IDEA behaves. It may have different UI tricks than AS itself.

We moved part of this issue out specifically to target 0.1.6: https://github.com/flutter/flutter-intellij/issues/445

Moving to On Deck, but we should spend time during the 0.1.6 release to explore customizing the buttons.

Just some continued discussion: the remaining issue is one of discoverability of the reload and restart buttons. We could solve this a few ways - updating the icons for the main run and debug buttons, adding additional icons to the toolbar when we're running, ...

Regarding discovery, I've been experimenting w/ adding buttons to the main toolbar. It looks like maybe the best we can do is add to the end (or start) of a button group. Here's what it looks like if we add them to the end of the RunGroup:

screen shot 2016-12-08 at 6 34 34 pm

Might be a good start anyway.

Curious what you guys think.

@devoncarew @mit-mit

I like it! Logically in terms of ordering, they should likely go between the starting buttons (run and debug) and the stop button, in order to follow a lifecycle-like order. Sounds like that's not immediately feasible; perhaps we put a new JSeparator between the stop button and the reload+restart, in order to make the ordering not seem random? Or at least, something else to experiment with, to find out which feels most natural.

Yeah, looks pretty good if we add a separator:

car
:

Cool. A separator is easy.

screen shot 2016-12-09 at 6 12 06 am

Looking now at refactoring the way that state is tracked so we get the desired enablement semantics which is a little trickier...

What's the thinking for how to guide developers over to the green+bolt button (which I think is Hot Reload?). Do we gray-out the green button after you initially run the app?

Is it possible to swap icons of the button (changing green run button to green+bolt once you have an app up and running) ?

Is it possible to swap icons of the button (changing green run button to green+bolt once you have an app up and running) ?

Unfortunately, no. Or at least not easily. Once active, the button gets a little dot.

screen shot 2016-12-09 at 10 33 08 am

Actively exploring other refinements. Needless to say, ideas welcome!

Gray-out the green run button once pressed?

I updated the main description above to list what we've already done here and what more is planned.

Screenshot with snazzy new icons.

screen shot 2016-12-20 at 1 01 08 pm

Still WIP but closing in!

Was this page helpful?
0 / 5 - 0 ratings