Merge lp:~nicolas-doffay/unity8/category-transition-speed-fix into lp:unity8

Proposed by Nicolas d'Offay
Status: Superseded
Proposed branch: lp:~nicolas-doffay/unity8/category-transition-speed-fix
Merge into: lp:unity8
Diff against target: 123 lines (+46/-14)
3 files modified
Components/FilterGrid.qml (+34/-3)
Dash/GenericScopeView.qml (+1/-5)
tests/qmltests/Components/tst_FilterGrid.qml (+11/-6)
To merge this branch: bzr merge lp:~nicolas-doffay/unity8/category-transition-speed-fix
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Michał Sawicz Needs Fixing
Albert Astals Cid (community) Needs Information
Review via email: mp+195203@code.launchpad.net

This proposal has been superseded by a proposal from 2014-01-30.

Commit message

Changed category transition animation to expand and collapse at a constant speed.

To post a comment you must log in.
522. By Nicolas d'Offay

Wrapped onStarted logic in brackets.

Revision history for this message
Michał Sawicz (saviq) wrote :

That's not enough, I'm afraid.

The intermediate height is more complicated: it needs to take y and uncollapsed height into account. Say the category is scrolled up so that its first row is offscreen, you animate its height to genericScopeHeight, but that means the last row of the expanded category won't get animated (just scroll a category up so that it's offscreen and expand it then - you'll see the bottom behaving incorrectly). If uncollapsedHeight is smaller than genericScopeHeight, you animate to genericScopeHeight and then collapse back to uncollapsedHeight (you can see that when expanding "Applications" in Home - the second category disappears for a fraction of a second).

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

Don't call the variable genericScopeHeight, call it height animation limit or something, the filtergrid knows nothing about scopes

review: Needs Fixing
523. By Nicolas d'Offay

Catered for transitions where the uncollapased height is less than the height.

524. By Nicolas d'Offay

Renamed height variable.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:524
http://jenkins.qa.ubuntu.com/job/unity8-ci/1625/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/701
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/687/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/220/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/148
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/149
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/149/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/148
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/637
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/701
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/701/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/687
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/687/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/3316/console
    SUCCESS: http://s-jenkins:8080/job/touch-flash-device/1412

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity8-ci/1625/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

There's something wrong, see how expanding the Apps category on Home scope on the desktop gives you a blinking Files&Folders movement. That doesn't happen without this.

review: Needs Fixing
525. By Nicolas d'Offay

Fixed transitioning bug.

Revision history for this message
Albert Astals Cid (aacid) wrote :

I'd appreciate if you could add a unittests, do you think this is feasible?

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:525
http://jenkins.qa.ubuntu.com/job/unity8-ci/1683/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/924
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/908
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/332
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/206
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/207
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/207/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/206
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/831
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/924
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/924/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/908
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/908/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/3506
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/1596

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/1683/rebuild

review: Needs Fixing (continuous-integration)
526. By Nicolas d'Offay

Updated FilterGrid test to use animation system.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:526
http://jenkins.qa.ubuntu.com/job/unity8-ci/1691/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/948
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/932
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/350
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/214
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/215
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/215/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/214
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/852
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/948
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/948/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/932
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/932/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/3527
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/1626

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/1691/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Doesn't seem constant speed to me when doing this on the desktop:
 * Change to Applications scope
 * I have 3 categories (installed, suggestions, dash plugins)
 * Scroll to bottom (suggestions is almost at the top)
 * Expand the suggestions category
 * Wait
 * Unexpand the suggestions category
 * Wait

My impression is that expansion and unexpansion don't happen at the same speed. I'd appreciate if someone else could comment.

review: Needs Information
Revision history for this message
Michał Sawicz (saviq) wrote :

Yeah, it feels like collapsing happens a lot faster than expansion.

One more thing - the scroll and expansion animations are not in sync:

 * go to top of Applications
 * expand More suggestions

You can see the Dash plugins category for a split second.

review: Needs Fixing
Revision history for this message
Nicolas d'Offay (nicolas-doffay) wrote :

Variable speeds are the only way to get around a noticeable "bounce" if the height is set to the scopeViewHeight then set to collapsed/uncollapsed height onStopped.

527. By Nicolas d'Offay

Attempted fix for speed issue.

528. By Nicolas d'Offay

Fixed up comparison operator.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:528
http://jenkins.qa.ubuntu.com/job/unity8-ci/1753/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/1185/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/1168/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/441
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/276
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/277
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/277/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/276
    ABORTED: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1056/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1185
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1185/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1168
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1168/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/3729/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/1844

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/1753/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

Aborted due to bug #1255578.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Hmmm, i still think there's something weird with the previous scenario i mentioned.

Also in this scenario:
 * Change to Applications scope
 * I have 3 categories (installed, suggestions, dash plugins)
 * Expand the suggestions category
 * Wait
 * Now scroll back to the initial position (so that suggestions is still expanded but you actually only see the same you saw when it was unexpanded)
 * Unexpand the suggestions category

I undestand the unexpansion in this case should be immediate since we're not going to see the animation happen, but still takes some time to change the ^ marker

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:528
http://jenkins.qa.ubuntu.com/job/unity8-ci/1778/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/1261
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/1235/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/469
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/301
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/302
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/302/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/301
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1120
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1261
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1261/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1235
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1235/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/3788/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/1908

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/1778/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:528
http://jenkins.qa.ubuntu.com/job/unity8-ci/1785/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/1282
    ABORTED: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/1256/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/482/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/308
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/309
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/309/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/308
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1140
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1282
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1282/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1256
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1256/artifact/work/output/*zip*/output.zip
    ABORTED: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/3804/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/1924

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/1785/rebuild

review: Needs Fixing (continuous-integration)

Unmerged revisions

528. By Nicolas d'Offay

Fixed up comparison operator.

527. By Nicolas d'Offay

Attempted fix for speed issue.

526. By Nicolas d'Offay

Updated FilterGrid test to use animation system.

525. By Nicolas d'Offay

Fixed transitioning bug.

524. By Nicolas d'Offay

Renamed height variable.

523. By Nicolas d'Offay

Catered for transitions where the uncollapased height is less than the height.

522. By Nicolas d'Offay

Wrapped onStarted logic in brackets.

521. By Nicolas d'Offay

Added two step animation for category expansion and collapse.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Components/FilterGrid.qml'
2--- Components/FilterGrid.qml 2013-10-15 12:28:14 +0000
3+++ Components/FilterGrid.qml 2013-11-27 14:01:33 +0000
4@@ -71,22 +71,53 @@
5
6 NumberAnimation {
7 property bool filterEndValue
8+ property real filterGridAnimationHeight
9 id: filterAnimation
10 target: root
11 property: "height"
12- to: filterEndValue ? root.collapsedHeight : root.uncollapsedHeight
13+ to: {
14+ //Collapse
15+ if (filterEndValue) {
16+ if (root.collapsedHeight < filterGridAnimationHeight) {
17+ return root.collapsedHeight;
18+ } else {
19+ return filterGridAnimationHeight;
20+ }
21+ }
22+ //Expand
23+ else {
24+ if (root.uncollapsedHeight < filterGridAnimationHeight) {
25+ return root.uncollapsedHeight;
26+ } else {
27+ return filterGridAnimationHeight;
28+ }
29+ }
30+ }
31+
32 // Duration and easing here match the ListViewWithPageHeader::m_contentYAnimation
33 // otherwise since both animations can run at the same time you'll get
34 // some visual weirdness.
35 duration: 200
36 easing.type: Easing.InOutQuad
37 onStopped: {
38+ if (root.height === filterGridAnimationHeight) {
39+ //Collapse
40+ if (filterEndValue) {
41+ root.height = root.collapsedHeight;
42+ }
43+ //Expand
44+ else {
45+ root.height = root.uncollapsedHeight;
46+ }
47+ }
48+
49 root.filter = filterEndValue;
50 }
51 }
52
53- function startFilterAnimation(filter) {
54- filterAnimation.filterEndValue = filter
55+ function startFilterAnimation(filter, scopeViewHeight) {
56+ filterAnimation.filterGridAnimationHeight = scopeViewHeight;
57+ filterAnimation.filterEndValue = filter;
58 filterAnimation.start();
59 }
60
61
62=== modified file 'Dash/GenericScopeView.qml'
63--- Dash/GenericScopeView.qml 2013-11-19 14:33:40 +0000
64+++ Dash/GenericScopeView.qml 2013-11-27 14:01:33 +0000
65@@ -226,11 +226,7 @@
66 var shrinkingVisible = shouldFilter && y + item.collapsedHeight < categoryView.height;
67 var growingVisible = !shouldFilter && y + height < categoryView.height;
68 if (!previewListView.open || !shouldFilter) {
69- if (shrinkingVisible || growingVisible) {
70- item.startFilterAnimation(shouldFilter)
71- } else {
72- item.filter = shouldFilter;
73- }
74+ item.startFilterAnimation(shouldFilter, scopeView.height)
75 if (!shouldFilter && !previewListView.open) {
76 categoryView.maximizeVisibleArea(index, item.uncollapsedHeight);
77 }
78
79=== modified file 'tests/qmltests/Components/tst_FilterGrid.qml'
80--- tests/qmltests/Components/tst_FilterGrid.qml 2013-08-09 07:41:12 +0000
81+++ tests/qmltests/Components/tst_FilterGrid.qml 2013-11-27 14:01:33 +0000
82@@ -49,6 +49,10 @@
83 CheckBox {
84 id: filterCheckBox
85 checked: true
86+
87+ onCheckedChanged: {
88+ filterGrid.startFilterAnimation(!checked, filterGrid.height);
89+ }
90 }
91 }
92 }
93@@ -84,7 +88,7 @@
94 maximumNumberOfColumns: 3
95 collapsedRowCount:
96 collapsedRowCountSelector.values[collapsedRowCountSelector.selectedIndex]
97- filter: filterCheckBox.checked
98+ filter: false
99 minimumHorizontalSpacing: units.gu(1)
100 delegateWidth: units.gu(6)
101 delegateHeight: units.gu(6)
102@@ -109,15 +113,16 @@
103 name: "FilterGrid"
104 when: windowShown
105
106+ function initTestCase() {
107+ filterCheckBox.checked = false;
108+ }
109+
110 function test_turningFilterOffShowsAllElements() {
111+ filterCheckBox.checked = false
112 tryCompareFunction(countVisibleDelegates, 6)
113
114- filterCheckBox.checked = false
115-
116+ filterCheckBox.checked = true
117 tryCompareFunction(countVisibleDelegates, 12)
118-
119- // back to initial state
120- filterCheckBox.checked = true
121 }
122
123 function test_collapsedRowCount() {

Subscribers

People subscribed via source and target branches