Sublime Forum

Issue: Active Theme + Package Control + Sublime Package File

#1

[size=150]Broken UI During Theme Updates[/size]

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:

github.com/buymeasoda/soda-theme/issues/155
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.

[size=150]How it happens[/size]

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.

[size=150]Solutions?[/size]

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?

0 Likes

#2

The packages being ignored is a known bug that has a release in testing. See 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.

0 Likes

#3

Also, it may be better to have this conversation on the Package Control bug tracker (github.com/wbond/sublime_package_control/issues) since we get notifications with that.

0 Likes

#4

Thanks for the details Will.

I’ll follow up over there too.

0 Likes