Home Download Buy Blog Forum Support

Issue: Active Theme + Package Control + Sublime Package File

Issue: Active Theme + Package Control + Sublime Package File

Postby buymeasoda on Fri Aug 16, 2013 1:29 am

Broken UI During Theme Updates

There are some ongoing challenges with the combination of the new Sublime Text package format, active UI themes and Package Control. When updating an active theme via Package Control, it causes the UI rendering of Sublime Text to completely break during the update.

This is causing some understandable confusion:

https://github.com/buymeasoda/soda-theme/issues/155
https://github.com/buymeasoda/soda-theme/issues/159

There also appears to be a secondary issue with packages being moved to "ignored_packages" and not being moved out again. I've had this happen while manually editing theme files (with lots of editor restarts in between), and also while updating packages. The package declaration pops in and out of "ignored_packages" and sometimes remains stuck there after a restart.

How it happens

Here's my understanding of the flow for a package update, and where things currently come unstuck:

1) Package Control: Upgrade Package (new update found)
2) Package declaration is moved to the "ignored_packages" list [UI breaks if the package is the active theme]
3) Updated "sublime-package" is downloaded
4) Existing package file is replaced with the new version [UI attempts to re-instate, usually only partially successful]
5) Package declaration rule is removed from the "ignored_packages" list

At this point, if the update is complete and you quit and restart Sublime Text everything will be fine - other than the awkward user experience of the temporarily broken UI.

But things can get worse if the user (understandably) freaks out and quits Sublime Text at the point where they see the UI initially break in step 2 above. If the update is not complete, the theme rule can remain in "ignored_packages" and continue to be broken on subsequent restarts without a clear reason why.

Solutions?

I've expanded the Soda Theme troubleshooting page with info, and I'm looking at the Package Control messages file as an option to alert people to the situation and suggest workarounds.

Are there existing features of Package Control that can solve this? For example, is there a way to force Package Control to not remove / replace a package until the next restart? Any suggestions there are greatly appreciated.

Otherwise, is it something best tackled at the Sublime Text core or Package Control layer, to get a smooth solution and user experience.

Does anyone else got any ideas on how to solve this? Jon and Will do you have any thoughts on this?
buymeasoda
 
Posts: 65
Joined: Mon Jul 18, 2011 11:40 pm
Location: Brisbane, Australia

Re: Issue: Active Theme + Package Control + Sublime Package File

Postby wbond on Fri Aug 16, 2013 2:26 pm

The packages being ignored is a known bug that has a release in testing. See https://github.com/wbond/sublime_packag ... issues/558 for details.

In terms of disabling a theme during the upgrade - I haven't tested the intricacies of it yet. It might just need to be a feature to look for the currently activated theme and have Package Control not disable it during upgrade. However, it is like it will be necessary for themes to all be installed unpacked - this way individual files are written one at a time and I don't have to worry about Windows locking file access. With .sublime-package files, Sublime Text actually locks the file in Windows, so I can't replace it without disabling the package first, overwriting the file and then re-enabling the package.

Without changes to Sublime Text's package handling/importing, I don't think it would be possible to delay package installs for .sublime-package files until the next time Sublime Text starts. This is because by the time Package Control runs, packages are loaded, so we run into the issue of having to disable a package to upgrade it. I'm pretty sure disabling the package is causing the theme UI resources to be unloaded, causing the graphical corruption.
wbond
 
Posts: 528
Joined: Mon Feb 28, 2011 5:33 am

Re: Issue: Active Theme + Package Control + Sublime Package File

Postby wbond on Fri Aug 16, 2013 2:28 pm

Also, it may be better to have this conversation on the Package Control bug tracker (https://github.com/wbond/sublime_package_control/issues) since we get notifications with that.
wbond
 
Posts: 528
Joined: Mon Feb 28, 2011 5:33 am

Re: Issue: Active Theme + Package Control + Sublime Package File

Postby buymeasoda on Thu Aug 22, 2013 12:20 am

Thanks for the details Will.

I'll follow up over there too.
buymeasoda
 
Posts: 65
Joined: Mon Jul 18, 2011 11:40 pm
Location: Brisbane, Australia


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot] and 29 guests