Skip to content

Conversation

@branflake2267
Copy link
Contributor

@branflake2267 branflake2267 commented Jul 23, 2017

This works for IDEA. I'm looking at Webstorm next.

The default view for IDEA:
screen shot 2017-07-23 at 11 32 20 am

Todos:

  • Project type selection - Which should it be: radios, Combobox or wizard?
  • Help section - change the background color when the Dracula theme is selected.

flutter.module.create.settings.radios.android.kotlin=Kotlin
flutter.module.create.settings.radios.android.tip=Select an Android language.
flutter.module.create.settings.radios.ios.label=iOS language:
flutter.module.create.settings.radios.ios.object_c=Object C
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixing

@branflake2267 branflake2267 force-pushed the brandon-new-project-settings branch 3 times, most recently from 58a7981 to e603fa7 Compare July 23, 2017 05:03
@branflake2267
Copy link
Contributor Author

branflake2267 commented Jul 23, 2017

I've added the webstorm support. So now both IDEA and Webstorm have support for the additional creation fields.

The webstorm fields.
screen shot 2017-07-23 at 4 26 49 pm

@branflake2267 branflake2267 force-pushed the brandon-new-project-settings branch from 5959f07 to e5e7329 Compare July 23, 2017 23:26
@devoncarew
Copy link
Contributor

devoncarew commented Jul 24, 2017

Wow, @branflake2267 , this is fantastic! Adding @pq as the reviewer since he's worked on the wizards most recently. A couple of drive by thoughts:

  • Android language: should say Java or Kotlin (currently iOS or Kotlin)
  • I'm of two minds about asking the Application / Project question on this page, or having a 2nd wizard (Flutter Application vs. Flutter Plugin). And - not really relevant to whether to use one wizard or two - users very new to Flutter will have difficulty knowing which type of flutter project they want.
  • the android / iOS language choice may do better as a combo box?
  • we might choose to elide the driver test question completely? Either always create a driver test, or never do (with some cli route to create a test in a separate step)

@devoncarew devoncarew requested a review from pq July 24, 2017 04:21
@branflake2267
Copy link
Contributor Author

branflake2267 commented Jul 24, 2017

lol, oops on the Android language choice. Spaced on that. Good catch. :) Thanks.

  • Combos work for me, gets the job done.
  • Fine with me on the driver test removal.

flutter.module.create.settings.description.tip=Enter a project description which shows up in the pubsec.yaml.
flutter.module.create.settings.description.default_text=A new Flutter project.
flutter.module.create.settings.radios.android.label=Android language:
flutter.module.create.settings.radios.android.ios=iOS
Copy link
Contributor Author

Choose a reason for hiding this comment

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

s/ios/java/

@branflake2267 branflake2267 force-pushed the brandon-new-project-settings branch from e5e7329 to b454d30 Compare July 24, 2017 04:35
@branflake2267
Copy link
Contributor Author

The latest rendition, with Java. :)

screen shot 2017-07-23 at 9 34 51 pm

settingsStep.addSettingsField(FlutterBundle.message("flutter.module.create.settings.help.project_name.label"),
new JLabel(FlutterBundle.message("flutter.module.create.settings.help.project_name.description")));
settingsStep.addSettingsField(FlutterBundle.message("flutter.module.create.settings.help.org.label"),
new JLabel(FlutterBundle.message("flutter.module.create.settings.help.org.description")));
Copy link
Contributor Author

@branflake2267 branflake2267 Jul 24, 2017

Choose a reason for hiding this comment

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

Add help for project type, to help distinguish application vs plugin?

Project type: Select 'application' to build a mobile application for end users.
_____________ Choose a 'plugin' if you're building native device feature hooks for a developer.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I love this. I wonder if we could do something to set this help apart a bit more. Maybe putting it in it's own group (sorry, that's an eclipse/SWT-ism... not sure what that's called in Swing). Or having a dividing line or styled text? Maybe we could add a hyperlink to get more info as well? (Oops: I guess that assumes there's a good page with flutter create docs but I don't see one. cc @LarkAscending in case I'm missing one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I think you could achieve the grouping effect by compositing a panel and that panel could look like it's in a group, or put a group in that panel. That could be nifty.

screen shot 2017-07-24 at 10 41 02 am

@mit-mit
Copy link
Member

mit-mit commented Jul 24, 2017

This is great @branflake2267 !

I think we need to split this over two pages in the wizard:

  1. select project type (application, plugin, or package)
  2. set properties (name, language, etc.)

The reason is that not all project types have the same properties. For example, a package does not contain any platform code, and thus is does not make sense to ask for android and ios languages for that one.

@branflake2267
Copy link
Contributor Author

branflake2267 commented Jul 24, 2017

Thanks. Ah, I didn't see package on the horizon. In that case I'm with you. I can see explaining the type generation options could be a benefit in specific wizard selecting the generation type. It would be easy to add another wizard and land on the properties for the particular generation type.

Another option I like to use for dimensional properties, on selection is to disable those that don't apply. If the package options were minor, the properties that don't apply could be changed or disabled. Would this be of interest?

Would you be the consensus for adding a wizard to my patch?

@branflake2267
Copy link
Contributor Author

branflake2267 commented Jul 24, 2017

WebStorm only has one step and IDEA has two steps in the project create wizards. It looks possible to add wizard steps to Webstorm, so I would suggest keeping the wizards consistent with IDEA. Then this would mean the flutter SDK selection would have to be extracted into it's own wizard. What are your thoughts on keeping Webstorms and IDEAs steps similar?

@devoncarew
Copy link
Contributor

@branflake2267, we're not optimizing for the webstorm experience - having it be slightly different than IDEA is fine.

In terms of keeping this one page, perhaps a combo box for project type? That way we can default to Flutter Application, and make the common case simple. Options which don't apply - like platform code types for package project - could be disabled.

Copy link
Collaborator

@pq pq left a comment

Choose a reason for hiding this comment

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

A bunch of nits but substantially awesome! 🎉

}

@Nullable
@Override
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: make final?

private JTextField descriptionField;
private RadiosForm androidLanguageRadios;
private RadiosForm iosLanguageRadios;
private JCheckBox includeDriverTextField;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can these all be made final?

}

public FlutterCreateAdditionalSettings getAddtionalSettings() {
return settingsFields.getAddtionalSettings();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm guessing buildUI is sure to have been called before this is accessed and settingsFields is certain not to be null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm moving the instantiation to the ctor.


radio2.setText(label2);

ButtonGroup radioGroup = new ButtonGroup();
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: make final?

}

public List<String> getArgs() {
List<String> args = new ArrayList<String>();
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: final?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, I think you can simplify to:

new ArrayList<>();

// keep as the last argument
args.add(appDir.getName());

String[] vargs = args.stream().toArray(String[]::new);
Copy link
Collaborator

Choose a reason for hiding this comment

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

And final here too...


List<String> args1 = addtionalSettings1.getArgs();
List<String> args2 = addtionalSettings2.getArgs();
List<String> args3 = addtionalSettings3.getArgs();
Copy link
Collaborator

Choose a reason for hiding this comment

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

More opportunities to go final...

List<String> args2 = addtionalSettings2.getArgs();
List<String> args3 = addtionalSettings3.getArgs();

assertTrue(args1.size() == 1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not a big deal but failure would read a little better if this were:

assertEquals(1, args1.size());

assertEquals("--plugin", args1.get(0));

assertTrue(args2.size() == 0);
assertTrue(args3.size() == 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similarly preferring assertEquals here?

}

@Test
public void descriptionPropertyTest() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Comments in generatePluginPropertyTest apply here to and below. 👍

@branflake2267
Copy link
Contributor Author

I like the current config I've proposed in this patch the best with radio selection. My solution to the selection complexity would be to add notes to the help section and probably a link to get started if that were possible. And I like disabling vs adding wizards. Although a combo has the exact same effect I'd go after except, I might want to add some verbiage to a combo's list to explain the option in more detail. I just want more options, so I'll build however you like it.

@branflake2267
Copy link
Contributor Author

I've appended a commit with the latest nit fixes and added help section.

screen shot 2017-07-24 at 10 17 29 pm

Todos:

  1. Fix the background color for dracula. I'm not sure how to change it yet, ran out of time to look for docs. Do you have any notes on changing colors based on theme?
  2. Figure out what the consensus is for project type selection, combo or radio? Or is the latest rendition worth trying?
  3. Test creating projects based on my latest changes, possibly add mockito to start mocking wizards...

@branflake2267
Copy link
Contributor Author

Webstorm scrolls with help, hm...

screen shot 2017-07-24 at 10 27 24 pm

@branflake2267
Copy link
Contributor Author

branflake2267 commented Jul 25, 2017

What do you think of having a link to the getting started guide? I've appended a commit for this.

screen shot 2017-07-24 at 11 08 44 pm

@branflake2267 branflake2267 force-pushed the brandon-new-project-settings branch 3 times, most recently from abdf591 to e2d6f2e Compare July 26, 2017 03:51
@branflake2267
Copy link
Contributor Author

branflake2267 commented Jul 26, 2017

Latest rendition.

IntelliJ IDEA Dracula:
screen shot 2017-07-25 at 8 46 50 pm

IntelliJ IDEA Default:
screen shot 2017-07-25 at 8 47 16 pm

WebStorm:
screen shot 2017-07-25 at 8 48 35 pm

@pq @devoncarew What do you think so far? Let me know if you want to try out the combos for project selection. I imagine some more tuning will need to be done on the helps. How do you want to proceed?

@devoncarew
Copy link
Contributor

@branflake2267, the UI looks great! We may follow up with some tweaks and iterations after it lands (like trying out a combo for project selection to see how it feels).

I'll let @pq speak to the code in terms of a lgtm. We're more or less in feature freeze for M16 (releasing this week), so we'll likely wait to land for a day or two until after we push M16.

@devoncarew
Copy link
Contributor

Let me know if you want to try out the combos for project selection

And - I would like to see how this looks - but it's not something we need to do for this PR. Happy to iterate a bit in follow-ups if that's your preference.

@pq
Copy link
Collaborator

pq commented Jul 26, 2017

Cool!

As @devoncarew said, let's wait until M16 goes out (#1153) and then land this and iterate. 🎉

<properties/>
<border type="none"/>
<children>
<component id="26e7" class="javax.swing.JTextPane" binding="gettingStartedUrl">
Copy link
Collaborator

Choose a reason for hiding this comment

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

I notice the styling of this looks a little different in your screenshot. I wonder if using a LinkLabel (as we do for the SDK install link) would look more consistent?

image

@branflake2267
Copy link
Contributor Author

@devoncarew @pq Sounds good on iteration. I think a combo might be nice, I'll wait and see what you do.

@pq I didn't use a LinkLabel, that looks like a better choice. I used a JTextPane with html. I'll change that over tonight. Thanks.

@pq
Copy link
Collaborator

pq commented Jul 26, 2017

Great! No worries about the LinkLabel. If you don't get to it we can pick that up on another pass. The important bits are here and thanks a million for that!

@branflake2267 branflake2267 force-pushed the brandon-new-project-settings branch from e2d6f2e to c3d2fa9 Compare July 27, 2017 03:01
@branflake2267 branflake2267 force-pushed the brandon-new-project-settings branch from c3d2fa9 to 5f793ef Compare July 27, 2017 03:16
@branflake2267
Copy link
Contributor Author

I rebased onto the head. That'll be it until Monday for me. I'll be out of pocket until then, just in case.

@pq
Copy link
Collaborator

pq commented Jul 27, 2017

Super, thanks! M16 should be out by then too. 🎉

@pq
Copy link
Collaborator

pq commented Jul 31, 2017

As per the plan, I'll land this now and we can iterate/fiddle.

Thanks!

@pq pq merged commit d77887a into flutter:master Jul 31, 2017
@branflake2267
Copy link
Contributor Author

Sounds nifty :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants