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

Re-ordered targets for flasher. #1820

Merged
merged 3 commits into from
Nov 13, 2019

Conversation

mikeller
Copy link
Member

This moves the selection of Unified / legacy target from the board list into the version list:

image

image

This should address the main reason for user confusion, but there are a couple more things to be cleaned up and improved in the firmware flasher tab:

  • remove the use of the global variables, stick option list related data into jQuery data;
  • improve the 'Release info' display;
  • add support for changeset ids for Unified Target configurations.

@mikeller mikeller added this to the 10.7.0 milestone Nov 11, 2019
@mikeller mikeller force-pushed the reorder_flashing_targets branch 3 times, most recently from 8fd3832 to 38f88fa Compare November 11, 2019 12:27
@Docteh
Copy link
Contributor

Docteh commented Nov 11, 2019

remove the use of the global variables, stick option list related data into jQuery data;

Can we put a pin in that one? If we move away from jQuery we might need to rework it anyways. Embedding a bunch of data into the DOM seemed dirty to me.

@mikeller
Copy link
Member Author

@Docteh:

Can we put a pin in that one? If we move away from jQuery we might need to rework it anyways.

After the experience I had reworking the existing code I'd rather keep the momentum going and clean this up a bit, lest somebody will have to reverse engineer the mess that it is now again next time we change something.

Embedding a bunch of data into the DOM seemed dirty to me.

It is not my preferred approach either, but:

  • we are already doing it for the versions drop down - consistency makes working with the code easier;
  • it is less 'dirty' than having a global variable that is driven by the contents of a drop down.

@mikeller mikeller force-pushed the reorder_flashing_targets branch 2 times, most recently from dc01b63 to df5cd58 Compare November 12, 2019 11:50
McGiverGim
McGiverGim previously approved these changes Nov 12, 2019
Copy link
Member

@McGiverGim McGiverGim left a comment

Choose a reason for hiding this comment

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

To me is ok!!

@@ -219,27 +216,23 @@ TABS.firmware_flasher.initialize = function (callback) {
loadUnifiedBuilds(releases);
};

function checkOneVersionForUnification(version) {
function supportsUnifiedTargets(version) {
return semver.gte(version.split(' ')[0], '4.1.0-RC1');
Copy link
Member

Choose a reason for hiding this comment

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

Not your code, but to me is a little strange continue supporting the RC versions and only starting with the RC1. But I suppose is needed to not break things...

Copy link
Contributor

Choose a reason for hiding this comment

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

I can check tomorrow but at the time it seemed best. 4.1.0 is newer than 4.1.0-RC1 so if we specified 4.1.0 we wouldn't have had unified targets with any RC. Specifying something like gte 4.0.9999 would have worked but then it's not clear to the humans as to what is going on.

Copy link
Member Author

Choose a reason for hiding this comment

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

@McGiverGim: This is not so much about 'supporting 4.1.0-RC1', but about making sure that we are not trying to use custom defaults with any (released) versions that do not support this. And 4.1.0-RC1 is the first released version to support custom defaults.

version.descriptor.date,
versionLabel
))
.css("font-weight", FirmwareCache.has(version.descriptor)
Copy link
Member

Choose a reason for hiding this comment

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

Again not your code, but I prefer to add a class and not a style, to maintain it in the css files.

@mikeller
Copy link
Member Author

@McGiverGim: I made it all classy now.

@Docteh
Copy link
Contributor

Docteh commented Nov 13, 2019

This might be dumbassery on my end, but initial tab contents without a saved board might be worth a look.

image

First item under boards should be this key instead of blank

     "firmwareFlasherOptionLabelSelectBoard": {
        "message": "Choose a Board"
    },

@mikeller
Copy link
Member Author

@Docteh: Well spotted, thanks for testing. Turns out I inadvertently removed some calls to i18n.localizePage(). Also, turns out that re-localising the entire page instead of getting and adding the localised messages is wasteful, so I removed it.

Copy link
Contributor

@Docteh Docteh left a comment

Choose a reason for hiding this comment

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

Looks good to me

@Docteh
Copy link
Contributor

Docteh commented Nov 13, 2019

image

Maybe 'Choose a Firmware Version' should be initially blanked out, to respect the way it worked before? Start from the top and work your way down is sensible enough for me.

@mikeller
Copy link
Member Author

@Docteh:

Maybe 'Choose a Firmware Version' should be initially blanked out, to respect the way it worked before? Start from the top and work your way down is sensible enough for me.

Actually both texts are loaded from the beginning in the UI in master.
And I am not sure about this, to me an empty drop-down looks 'broken'. So if anything the version drop down should be 'Choose a Board first' or similar, and that is very much going out on a limb I think.

@Docteh
Copy link
Contributor

Docteh commented Nov 13, 2019

Actually both texts are loaded from the beginning in the UI in master.

Yeah I've stared at this tab enough to misremember things.

If we get lots of complaints later on we could make "Choose a Board first" the second option :trollface:

@mikeller
Copy link
Member Author

@Docteh:

Yeah I've stared at this tab enough to misremember things.

You might have seen it - the use of i18n.localizePage() to translate the options resulted in the options being rendered empty first, and the translations being added with a bit of delay. But that's fixed now.

@mikeller mikeller merged commit 8297af9 into betaflight:master Nov 13, 2019
@mikeller mikeller deleted the reorder_flashing_targets branch November 13, 2019 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants