After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 597919 - [lg] Scroll to bottom when pushing a result
[lg] Scroll to bottom when pushing a result
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-10-09 16:01 UTC by Colin Walters
Modified: 2009-10-13 17:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[lg] Scroll to bottom when pushing a result (4.17 KB, patch)
2009-10-09 16:01 UTC, Colin Walters
committed Details | Review

Description Colin Walters 2009-10-09 16:01:39 UTC
This makes the evaluator significantly more useful past a few
results.
Comment 1 Colin Walters 2009-10-09 16:01:41 UTC
Created attachment 145146 [details] [review]
[lg] Scroll to bottom when pushing a result
Comment 2 Owen Taylor 2009-10-09 18:55:39 UTC
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 :)