Closed Bug 770634 Opened 13 years ago Closed 13 years ago

Build-in transitions for search results and social

Categories

(Pancake Graveyard :: Front-end, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gbrander, Assigned: sfoster)

References

Details

PostListView (Search and social lists) need some sort of build-in transition (a fade perhaps)?
Status: NEW → ASSIGNED
Also want build-in for headingListView.
I think we want this animation to be: * Spinner at smallish size * Grow to eventual size * Spinner disappears * Fade in
Currently, ListView renders data as it comes in. If there are no items, it hides itself. In order to add loading states, we must make our ListView more nuanced. Actions: * An initial `reset` that renders the main DOM framework of the ListView, along with any items for the collection that are present. Called in the `initialize` method. * A `resetViews` call that is bound to collection `reset` events. It empties just the list element and re-renders all items. * `fallback`, which renders a different DOM element or does some hide/show magic when the collection is empty. * `render` for all other view updates. * `addView` * `removeView` * `moveView` This looks a bit like a state machine, but let's avoid that if possible. Chaplain does something similar. They also manage sub-views via a registry, in much the same way we do. <https://github.com/chaplinjs/chaplin/blob/master/src/chaplin/views/collection_view.coffee>
I've made significant progress on transition states as of https://bitbucket.org/mozillapancake/pancake/changeset/e7f944d22af1. Still on the agenda: a decent spinner image and better transition states for search results.
Depends on: 769498
* URLs view fixed * Images view fixed * Suggestions view fixed * Twitter view fixed The height animation can still sometimes be tricked with fast typing.
Fixed by by https://bitbucket.org/mozillapancake/pancake/changeset/117def9dd572, which resolves the final remaining issue with fast typing.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
The height animation + spinner have a significant negative effect on overall performance.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
The changes for this bug should be de-tangled from #769498 changes so we can accurately perf test them, apart and so the drawer can be landed more quickly.
Blocks: 775660
Per meeting, we want to take a simple approach to this so we can ship. The main issue is the initial render. Let's make sure the layout happens invisibly so we don't get a jittery feeling when the item is rendered. Beyond that, maybe a spinner for the initial render? Let's try to avoid making the view a full-blown state machine for now. Emphasis is on wrapping this up with a good enough solution so we can ship.
Assignee: gbrander → sfoster
Blocks: 775112
Have picked at this a bit. I tried various way of laying out the contents off-screen or out of document flow and fading back in to reveal. None really helped much to be honest. I have an idea to include a placeholder element in the listview(s) that we can toggle while loading (and show initially). But shoe-horning it in there without breaking stuff is a trick.
I've added an optional bindPlaceholder call in ListView's bindEvents method. If there's an attachPoint.placeholder and a truthy options.showLoadingPlaceholder property it will bind to the collection and do the loading placeholder and animate in thing. This works great for the stackheadinglist instance on the home screen. It should also work for the social postlistview, but doesn't. I've spent a couple hours troubleshooting and am ready to pronounce it "good enough".
Now using an animated spinner.gif. Looks fine and performs much better than the css-animated class. Also we're back to an external resource for the image, so i preload it using an AMD plugin to mitigate the loading-while-loading issue. Maybe the animated gif can be converted to a data uri too, meantime this works. See https://bitbucket.org/mozillapancake/pancake/changeset/268d0bbf38dc1726d81b8ebfa3d8c7d243b267fb
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.