Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 510003

Summary: Third party themes don't display properly in Platform Styles preview
Product: [ECD] Orion Reporter: Carolyn MacLeod <Carolyn_MacLeod>
Component: ClientAssignee: Carolyn MacLeod <Carolyn_MacLeod>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: antonm, caseyflynn, emoffatt, kangy, kuschel, Michael_Rennie, steve_northover, wilford
Version: unspecified   
Target Milestone: 14.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
platform-styles.png
none
Exported Vanilla Skies theme to try importing
none
Exported Beetlejuice theme to try importing
none
localStorage theme prefs none

Description Carolyn MacLeod CLA 2017-01-05 15:45:06 EST
Created attachment 266148 [details]
platform-styles.png

While testing the fix for Bug 507788 I noticed that third party themes don't work properly. I've attached a screen snap.
There's a bunch of styles in the Theme: combo and switching those does nothing.
The color inputs remain all light pink.  :)

I will attach an exported style file that you can import on the Editor Styles settings page. (I'm also going to open a bug to fix the import dialog - it needs a file dialog for importing files, not just a place to drop them).

(By the way, the black strip across the top of the preview in the attached snapshot is due to a black banner that is added to the top of each Orion page by the third party app that consumes Orion. Please just ignore it for now).
Comment 1 Michael Rennie CLA 2017-01-05 16:27:52 EST
Raising priority and severity - every consumer of Orion will now see their old themes (if they had any) and if we can't render those properly, thats really bad.

Also really bad is not being able to import existing themes properly.
Comment 2 Carolyn MacLeod CLA 2017-01-05 17:04:12 EST
Created attachment 266149 [details]
Exported Vanilla Skies theme to try importing
Comment 3 Carolyn MacLeod CLA 2017-01-05 17:04:52 EST
Created attachment 266150 [details]
Exported Beetlejuice theme to try importing
Comment 4 Casey Flynn CLA 2017-01-05 17:17:00 EST
Would you mind sending me your theme preferences from localStorage: (in Chrome, open the developers console, and type:  localStorage["/orion/preferences/user/themes"], copy the output from the console).
Comment 5 Casey Flynn CLA 2017-01-05 17:34:39 EST
It would also be very helpful if you can provide steps to reproduce how you are testing the fix, as I am not sure how the legacy styles are being copied into the new container styles. (Did you initially import them from a JSON file? Or were they cached?)
Comment 6 Carolyn MacLeod CLA 2017-01-05 17:52:35 EST
Created attachment 266151 [details]
localStorage theme prefs
Comment 7 Carolyn MacLeod CLA 2017-01-05 18:02:12 EST
(In reply to Casey Flynn in comment 5):
I guess the old themes are cached. I didn't do anything at all to get them - they were just there as soon as I ran the fix for Bug 507788. Originally, I thought maybe the fix had resurrected the old themes, but I see that the fix code actually deletes those old themes. So best guess is cache.
I'm not sure how you could replicate it, but best guess is to try creating some themes and exporting/importing them. Or maybe you can slam them into localStorage from the console.
Seems to me we had trouble, way back, with caches of themes coming back to haunt people.
Anton, do you recall what we did about that, if anything?
Comment 8 Carolyn MacLeod CLA 2017-01-05 19:03:03 EST
Perhaps bug 427696 and the follow-on bug 456816 kind of describe the problem.
Those bugs were fixed, but there's still something in there that allows cached themes to bleed through.
Comment 9 Casey Flynn CLA 2017-01-05 19:23:24 EST
(In reply to Carolyn MacLeod from comment #7)
> (In reply to Casey Flynn in comment 5):
> I guess the old themes are cached. I didn't do anything at all to get them -
> they were just there as soon as I ran the fix for Bug 507788. Originally, I
> thought maybe the fix had resurrected the old themes, but I see that the fix
> code actually deletes those old themes. So best guess is cache.
> I'm not sure how you could replicate it, but best guess is to try creating
> some themes and exporting/importing them. Or maybe you can slam them into
> localStorage from the console.
> Seems to me we had trouble, way back, with caches of themes coming back to
> haunt people.
> Anton, do you recall what we did about that, if anything?

I am removing the import and export buttons from the Platform Styles (currently there isn't support for these, but it wouldn't be hard to add). My next step on this is to load your settings into my local storage to try to reproduce. I will keep you posted on my progress.
Comment 10 Casey Flynn CLA 2017-01-05 20:44:42 EST
(In reply to Carolyn MacLeod from comment #7)
I loaded the localStorage values you provided, but was unable recreate the error shown in the provided screenshot (so I don't think the error is caused by cached values).

After investigation, I think this issue may have been caused when importing themes, as this functionality has not been completed. The fix to remove the import / export buttons is out for review (bug 150006). 

Please let me know if you know of another way to recreate this issue.
Comment 11 Boris Kuschel CLA 2017-01-19 14:11:22 EST
Downgrading to P2, P1 is meant for fatal data loss, crash, etc.
Comment 12 Steve Northover CLA 2017-01-25 12:56:16 EST
Ok, sounds like import/export removed from the theme and the problem is still there (but no longer visible from the UI)?
Comment 13 Casey Flynn CLA 2017-01-25 13:24:41 EST
(In reply to Steve Northover from comment #12)
> Ok, sounds like import/export removed from the theme and the problem is
> still there (but no longer visible from the UI)?

I believe the issue was that we attempted to import legacy style JSON objects into the new style JSON object which would not be recognized. In order to support old styles (which have been disabled for several revisions) we would have to add logic to parse values out of the old style and put them in the new format. I have this on my list to tackle when I add support to import/export IDE themes.
Comment 14 Steve Northover CLA 2017-01-25 13:32:53 EST
If you import bad data, then you should get a warning that you are trying to import something that is not recognized.
Comment 15 Carolyn MacLeod CLA 2017-03-01 17:10:31 EST
This fixes the third-party themes problem: https://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=9727b8d608f2d7032b9e249a7fb5b49ff5becd96

Bug 510048 is still open for "Provide the ability to import and export a platform theme"