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

Bug 365341

Summary: flashing of commands on search results page
Product: [ECD] Orion Reporter: Susan McCourt <susan>
Component: ClientAssignee: Susan McCourt <susan>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: libingw
Version: 0.3   
Target Milestone: 0.4 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Susan McCourt CLA 2011-12-01 12:37:02 EST
When you click "next page" on search results, the pagination commands switch to text while the progress message is showing, and then the icons appear again when it is done.
Comment 1 Susan McCourt CLA 2011-12-01 12:39:24 EST
I'll look into this.  I think it's something with the way that page is defining and rendering commands.  As an experiment, I hacked the git log page to use icons, and there is no such flashing during pagination.
Comment 2 libing wang CLA 2011-12-05 13:17:45 EST
In search.js, I am using dojo.empty("pageNavigationActions") as work around to reduce the flashing now.
Please remove them (2 places) when you fix this.
Comment 3 Susan McCourt CLA 2011-12-08 16:29:31 EST
the workaround looks a lot like what git log does, so let's leave this alone until M2, we are okay for now.

If you are rerendering the commands into the same dom element, then it is your responsibility to empty the dom element where you originally rendered, so it may be that your workaround is the correct fix....I'll double check in M2
Comment 4 Susan McCourt CLA 2011-12-14 17:22:19 EST
fixed in df3f5b3ac4c961b857a16fb4d716760570bfe1d0.

All of the search commands were being recreated, re-added, reregistered, etc. every time the search model (query) changed.  This was causing a lot of churn and flash.

I did some refactoring as follows:

- moved the "save search" command definition to the glue code.  (That is where most commands go)
- changed the "initCommands" in the explorer to only do the dojo.empty and rerender of the pageNavigationActions area.  Moved the creation, adding, registering to a method called once, "declareCommands"
- changed "generateDomCommandsInBanner" to let the caller specify a handler and an item.  (Before, it used the handler as the item, and this was the first page where they were diferent).  I also added a flag to let the caller say whether they are managing the page navigation actions or not.  This way, the command service won't try to render those before you are ready.  I think there would have been a better way to do this...by having the page commands declared in the glue code, but that would have required the glue code knowing how to access the explorer, and I just couldn't follow that.

I made some unrelated changes:
- changed next/previous to be text commands (like git log).  I had mentioned this in some other bug.
- fixed random jslint errors

I tested flat and tree views, all the pagination commands, search commands.  I think I put everything back together correctly.  Can you give the search page in HEAD a spin in case there's something I wouldn't know to check?