GNOME Bugzilla – Bug 597919
[lg] Scroll to bottom when pushing a result
Last modified: 2009-10-13 17:11:09 UTC
This makes the evaluator significantly more useful past a few results.
Created attachment 145146 [details] [review] [lg] Scroll to bottom when pushing a result
Review of attachment 145146 [details] [review]: Like the change to use a "structure" rather than an infinitely expanding array of random stuff. Few comments about the details of scrolling to the bottom. ::: js/ui/lookingGlass.js @@ +122,3 @@ + scrollToBottom: function(index) { + let tabData = this._tabs[index]; + tabData._scrollToBottom = true; I think this should immediately adjust the adjustment in addition to setting the flag - otherwise you are implicitly counting on it being called at a point when things are changing. @@ +127,3 @@ + _onScrollContentReallocated: function (tabData) { + tabData._scrollToBottom = false; + }, I don't understand why you do this; I think it's better to to treat scrollToBottom as sticky - sticks until the user explicitly scrolls. (if you do that, good to add a brief comment to the function explaining that it is sticky.) @@ +131,3 @@ + _onAdjustValueChanged: function (tabData) { + tabData._scrollToBottom = false; + }, Probably better to not assume that value::changed is actually a change - I'd probably do: if (vAdjust.value < vAdjust.upper - vAdjust.lower - 0.5) tabDate_scrolltoBottom = false; (The 0.5 here is an "epsilon" to avoid float comparisons for equality - might as well use a whole half pixel) @@ +137,3 @@ + return; + let vAdjust = tabData.scrollView.vscroll.adjustment; + vAdjust.value = vAdjust.upper; I think it's probably clearer to write 'vAdjust.upper - vAdjust.page_size' - yes the adjustment clamps to that internally, but oif you are going to assume that, why not just write vAdjust.value = 10000000; (OK, that would even be less clear :)