dart-lang/spark — pull request #2391 by ussuri (2014-06-08 19:22:45+00:00)
Title: Outline: resizable + better button + much more responsive + bug fixes

@umop Eric, sorry for the last-minute large change and for butchering the class like this. It all started with just adding a resizing capability and a better button, but I ran into problems with `Outline` not liking the new DOM layout, started fixing them, one thing led to another, and I ended up changing, fixing and optimizing a lot of things. Feel free to push back until later: I understand the inconvenience. However, this CL:

* Adds a resizing capability to the outline view, with minimum and maximum allowed width.
* Changes the button to a better one.
* Makes the outline a lot more responsive: this is achieved by numerous means, but the primary ones are:
* Do not use a `Map` from offsets to items, store items in a flat list, and just walk it when searching for items.
* Do not use the hack with invisible scrolling target `` readjusted to items' screen coordinates and scrolled into view: apply `scrollIntoView` directly on the found relevant items (I know you had problems with that, but I think I've fixed them).
* The above and other changes fixes lagging, especially at the top and bottom of a file: the old code would almost never scroll the outline all the way to the top or bottom when the file was scrolled there, it would would N items before. The new code always reliably scrolls all the way, regardless of how large the file is and how fast scrolling is.
* Scrolling behavior is more intuitive now: when you scroll down, the bottom-most items in the file and the outline are synced, when scrolling up, the top-most items. Before it would always synchronize the bottom-most.
* Etc.

![screen shot 2014-06-08 at 12 09 09 pm](https://cloud.githubusercontent.com/assets/5606182/3212062/43642daa-ef42-11e3-8fb7-3f0c06216a60.png)