Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

[Themes] Revert theme settings when cancelling out of the themes dialog #8405

Merged
merged 3 commits into from
Jul 16, 2014
Merged

[Themes] Revert theme settings when cancelling out of the themes dialog #8405

merged 3 commits into from
Jul 16, 2014

Conversation

MiguelCastillo
Copy link
Contributor

@peterflynn
Copy link
Member

Are all the other settings in the dialog already reverted when you hit Cancel? (That is, bug #8390 only affects the Theme dropdown, and the rest of the dialog was already working correctly?)

@MiguelCastillo
Copy link
Contributor Author

All settings, except for the selected theme are only committed to the preferences when pressing done. So there is nothing to revert, with the exception of the selected theme, which I commit upon selection so that users can see what the theme looks like without having to dismiss the dialog.

@MiguelCastillo
Copy link
Contributor Author

@peterflynn Short answer yes... Sorry I started with the long answer. I do things backwards sometimes :)

@peterflynn
Copy link
Member

Makes sense, thanks! (Though in the future, for consistency I think we should consider making all the controls in this dialog update in real time -- that would be useful for picking out a good font size, etc. too)

@MiguelCastillo
Copy link
Contributor Author

Well, that would fairly easy to do and I think that would really useful too... I will make another PR for that. I didn't do it for the other settings because their result is generally known whereas picking a theme seems to be a bit more trial and error. But I think making all the setting take effect right away would be smoother I think.

@marcelgerber
Copy link
Contributor

@MiguelCastillo @peterflynn Unfortunately, it's probably not that easy, 'cause those changes can be unexpectedly small or big. Let's say one wants to edit 15px to 16px - he'll first delete the trailing 5, so it's only 1px for a short period, which isn't human-readable any more. And I guess these font size updates aren't the right thing to do, as it can affect other states like the scroll position...

@MiguelCastillo
Copy link
Contributor Author

@SAplayer You are correct there are implication if you are just arbitrarily changing the values at a rapid pace... That can be mitigated by adding a bit of a throttle. So, we'll just come up with something that makes sense.

I was referring to the changes in the themes settings themselves being pretty simple though.

Let's stabilize themes first, land this guy #8305 and then worry about saving font settings real time.

@TomMalbran
Copy link
Contributor

You can use onchange for those cases, so that the font updates after blur. But another issue is that the modal dialog is covering most of the screen and makes it hard to see the changes and really play with them. Maybe we could sue a bottom panel instead of a dialog?

@@ -121,6 +121,10 @@ define(function (require, exports, module) {
prefs.set(setting, newSettings[setting]);
});
}
else if (id === "cancel") {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be: } else if (id === "cancel") {

@MiguelCastillo
Copy link
Contributor Author

Man, Crock's jslint is going to be the end of me! :D Will change it shortly.

@TomMalbran
Copy link
Contributor

Just use it in Brackets. You'll get used to it and found any other styling weird and realize that jslint does a good job. Having } before an else makes it more clear where the previous if ends.

@MiguelCastillo
Copy link
Contributor Author

Yeah, that's just personal preference... I prefer my elses and ifs in their own line.

So, I do use the built in linter specifically for Brackets commits. But my team and I all use interactive linter, which uses jshint by default and I forget to switch context when working between my day job and Brackets. :-)

@MiguelCastillo
Copy link
Contributor Author

I am only guessing that Crock is really OCD... :D

@MiguelCastillo MiguelCastillo changed the title [Themes] Revert theme settings when canceling out of the themes dialog [Themes] Revert theme settings when cancelling out of the themes dialog Jul 15, 2014
@peterflynn
Copy link
Member

@SAplayer I don't view it s a huge problem if the user briefly sees silly intermediate values shown as they're typing. But as @MiguelCastillo mentioned, it could easily be solved via a small debouncing delay. I'd prefer that over only updating on blur ("change" event), which might not ever happen before the user closes the dialog (and is sort of an oldschool convention in general).

@TomMalbran Good point that the dialog makes it tricky to see the editor below it. I wonder if making our dialogs draggable would be a nice solution to this? Probably not too hard, and might benefit other cases too (e.g. unsaved changes dialog -- you might want to look at part of the text below the dialog before deciding, etc.).

At any rate -- I agree making those other fields update in real time is not needed for 0.42 :-)

@TomMalbran
Copy link
Contributor

@peterflynn A draggable dialog will not really solve any issue. The panel is still big and you would need to drag it so that part of it is not visible to be able to see most of the screen, which most don't allow it. You also have the black overlay that is not the best for showing the changes. And finally being able to switch documents while checking the preferences would be great, which is not possible with the dialogs.

The best solution is to have the preferences as something similar to a custom viewer as an old design made for the extensions manager.

@peterflynn
Copy link
Member

@MiguelCastillo Re linters: Once something like #7362 lands, you'll be able to set project-specific preferences for which linter(s) are enabled :-)

@MiguelCastillo
Copy link
Contributor Author

@peterflynn yeah that's awesome. I also have plans to add a way to set which linter Interactive Linter runs for you on a language basis... I have jscs, jslint, and jshint without any good way to configure which you run. It would be even cooler if I could do it per project/directory. :D

@dangoor
Copy link
Contributor

dangoor commented Jul 16, 2014

Works fine. If we do change to make the other settings update live for preview purposes, we'll need to restore them as well, but this does the job here.

Thanks!

dangoor added a commit that referenced this pull request Jul 16, 2014
[Themes] Revert theme settings when cancelling out of the themes dialog
@dangoor dangoor merged commit f940f79 into adobe:master Jul 16, 2014
@MiguelCastillo
Copy link
Contributor Author

@dangoor yeah for sure. I just want to make sure we get through show stoppers. But I will make another PR in the next day or two to make the settings live update. Gotta get the integration happen first

@dangoor
Copy link
Contributor

dangoor commented Jul 16, 2014

@MiguelCastillo No worries about live updating settings. It's just a nice to have, not something required to ship this great feature!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants