Merge lp:~aacid/unity8/dash_resizing_fixes into lp:unity8

Proposed by Albert Astals Cid on 2016-02-09
Status: Merged
Approved by: Lukáš Tinkl on 2016-02-17
Approved revision: 2175
Merged at revision: 2228
Proposed branch: lp:~aacid/unity8/dash_resizing_fixes
Merge into: lp:unity8
Diff against target: 192 lines (+100/-11)
2 files modified
qml/Dash/Dash.qml (+11/-11)
tests/qmltests/Dash/tst_Dash.qml (+89/-0)
To merge this branch: bzr merge lp:~aacid/unity8/dash_resizing_fixes
Reviewer Review Type Date Requested Status
Lukáš Tinkl (community) 2016-02-09 Approve on 2016-02-17
PS Jenkins bot continuous-integration Needs Fixing on 2016-02-15
Unity8 CI Bot continuous-integration Needs Fixing on 2016-02-15
Michał Sawicz Needs Fixing on 2016-02-11
Review via email: mp+285453@code.launchpad.net

Commit Message

Fix resizing the dash bringing temp scopes size out of sync

Description of the Change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2173
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/294/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/415/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/438
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/456
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/456
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/452
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/452/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/452/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/452
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/452/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/452/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/452
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/452/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/452/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/294/rebuild

review: Needs Fixing (continuous-integration)
Lukáš Tinkl (lukas-kde) wrote :

LGTM, works fine here

* Did you perform an exploratory manual test run of the code change and any related functionality?

Yes

* Did CI run pass? If not, please explain why.

Yes

* Did you make sure that the branch does not contain spurious tags?

Yes

review: Approve
Michał Sawicz (saviq) wrote :

Go to Music scope → click on "New albums from 7digital" → WHITE

review: Needs Fixing
lp:~aacid/unity8/dash_resizing_fixes updated on 2016-02-15
2174. By Albert Astals Cid on 2016-02-15

Fix onOpenScope

2175. By Albert Astals Cid on 2016-02-15

Add a test for open scope

we didn't have it before and it would have caught the regression introduced by the first commit on this branch

Albert Astals Cid (aacid) wrote :

> Go to Music scope → click on "New albums from 7digital" → WHITE

Fixed and added a test that should pick it up next time if it breaks

Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2175
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/347/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/474/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/497
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/515
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/515
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/511
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/511/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/511/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/511
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/511/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/511/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/511
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/511/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/511/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/347/rebuild

review: Needs Fixing (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2175
http://jenkins.qa.ubuntu.com/job/unity8-ci/7284/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6471
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/699/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1989
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/692
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1884
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1884
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/691
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/690
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4949
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6482
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6482/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27586
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/360/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/697
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/697/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27587

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

review: Needs Fixing (continuous-integration)
Lukáš Tinkl (lukas-kde) wrote :

Re-tested, fixes both issues, tests passing

* Did you perform an exploratory manual test run of the code change and any related functionality?

Yes

* Did CI run pass? If not, please explain why.

Yes

* Did you make sure that the branch does not contain spurious tags?

Yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Dash/Dash.qml'
2--- qml/Dash/Dash.qml 2015-11-19 16:55:31 +0000
3+++ qml/Dash/Dash.qml 2016-02-15 10:15:31 +0000
4@@ -37,6 +37,7 @@
5 }
6
7 property bool windowActive: window.active
8+ property bool showOverlayScope: false
9
10 DashCommunicatorService {
11 objectName: "dashCommunicatorService"
12@@ -80,7 +81,7 @@
13 return
14 }
15
16- closeOverlayScope();
17+ dash.showOverlayScope = false;
18
19 dashContent.closePreview();
20
21@@ -93,12 +94,6 @@
22 dashContent.setCurrentScopeAtIndex(scopeIndex, animate, reset)
23 }
24
25- function closeOverlayScope() {
26- if (dashContent.x != 0) {
27- dashContent.x = 0;
28- }
29- }
30-
31 Scopes {
32 id: scopes
33 }
34@@ -133,12 +128,13 @@
35 height: dash.height
36 scopes: scopes
37 visible: x != -width
38+ x: dash.showOverlayScope ? -width : 0
39 onGotoScope: {
40 dash.setCurrentScope(scopeId, true, false);
41 }
42 onOpenScope: {
43 scopeItem.scope = scope;
44- x = -width;
45+ dash.showOverlayScope = true;
46 }
47 Behavior on x {
48 UbuntuNumberAnimation {
49@@ -207,7 +203,7 @@
50 bottomEdgeController.enableAnimation = true;
51 bottomEdgeController.progress = 0;
52 scopeItem.scope = scope;
53- dashContent.x = -dashContent.width;
54+ dash.showOverlayScope = true;
55 }
56 onGotoScope: {
57 bottomEdgeController.enableAnimation = true;
58@@ -226,7 +222,7 @@
59 id: scopeItem
60 objectName: "dashTempScopeItem"
61
62- x: dashContent.x + width
63+ x: dash.showOverlayScope ? 0 : width
64 y: dashContent.y
65 width: parent.width
66 height: parent.height
67@@ -234,7 +230,7 @@
68 hasBackAction: true
69 isCurrent: visible
70 onBackClicked: {
71- closeOverlayScope();
72+ dash.showOverlayScope = false;
73 closePreview();
74 }
75
76@@ -250,6 +246,10 @@
77 scopes.closeScope(oldScope);
78 }
79 }
80+
81+ Behavior on x {
82+ UbuntuNumberAnimation { }
83+ }
84 }
85
86 Rectangle {
87
88=== modified file 'tests/qmltests/Dash/tst_Dash.qml'
89--- tests/qmltests/Dash/tst_Dash.qml 2015-12-11 09:10:01 +0000
90+++ tests/qmltests/Dash/tst_Dash.qml 2016-02-15 10:15:31 +0000
91@@ -70,6 +70,42 @@
92 waitForRendering(findChild(dash, "scopeLoader0").item);
93 }
94
95+ function scrollToCategory(categoryName) {
96+ var dashContentList = findChild(dash, "dashContentList");
97+ var genericScopeView = dashContentList.currentItem;
98+ var categoryListView = findChild(genericScopeView, "categoryListView");
99+ tryCompareFunction(function() {
100+ var category = findChild(genericScopeView, categoryName);
101+ if (category && category.y > 0 && category.y < genericScopeView.height) return true;
102+ touchFlick(genericScopeView, genericScopeView.width/2, units.gu(20),
103+ genericScopeView.width/2, genericScopeView.y)
104+ tryCompare(categoryListView, "moving", false);
105+ return false;
106+ }, true);
107+
108+ tryCompareFunction(function() { return findChild(genericScopeView, "delegate0") !== null; }, true);
109+ return findChild(genericScopeView, categoryName);
110+ }
111+
112+ function clickCategoryDelegate(category, delegate) {
113+ var dashContentList = findChild(dash, "dashContentList");
114+ var genericScopeView = dashContentList.currentItem;
115+ if (category === undefined) category = 0;
116+ if (delegate === undefined) delegate = 0;
117+ tryCompareFunction(function() {
118+ var cardGrid = findChild(genericScopeView, "dashCategory"+category);
119+ if (cardGrid != null) {
120+ var tile = findChild(cardGrid, "delegate"+delegate);
121+ return tile != null;
122+ }
123+ return false;
124+ },
125+ true);
126+ var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);
127+ waitForRendering(tile);
128+ mouseClick(tile);
129+ }
130+
131 function test_manage_dash_clickscope_unfavoritable() {
132 // Show the manage dash
133 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
134@@ -565,5 +601,58 @@
135 tryCompare(dashTempScopeItem, "x", dashTempScopeItem.width);
136 tryCompare(dashTempScopeItem, "visible", false);
137 }
138+
139+ function test_openScope()
140+ {
141+ scrollToCategory("dashCategory2");
142+ clickCategoryDelegate(2, 2);
143+
144+ var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
145+ tryCompare(dashTempScopeItem, "x", 0);
146+ tryCompare(dashTempScopeItem, "visible", true);
147+ tryCompare(dashContent, "x", -dash.width);
148+
149+ // Go back
150+ var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
151+ var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
152+ mouseClick(backButton);
153+
154+ // Check temp scope is gone
155+ tryCompare(dashTempScopeItem, "x", dash.width);
156+ tryCompare(dashTempScopeItem, "visible", false);
157+ tryCompare(dashContent, "x", 0);
158+ }
159+
160+ function test_tempScopeItemXOnResize()
161+ {
162+ // Go to a temp scope
163+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
164+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
165+ tryCompare(bottomEdgeController, "progress", 1);
166+ var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
167+ var nonfavScopesListCategoryList = findChild(nonfavScopesListCategory, "scopesListCategoryInnerList");
168+ tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
169+ mouseClick(nonfavScopesListCategoryList.currentItem);
170+ var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
171+ tryCompare(dashTempScopeItem, "x", 0);
172+ tryCompare(dashTempScopeItem, "visible", true);
173+
174+ shell.width = units.gu(80);
175+ tryCompare(dashTempScopeItem, "x", 0);
176+ tryCompare(dashContent, "x", -dash.width);
177+
178+ shell.width = units.gu(40);
179+ tryCompare(dashTempScopeItem, "x", 0);
180+
181+ // Go back
182+ var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
183+ var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
184+ mouseClick(backButton);
185+
186+ // Check temp scope is gone
187+ tryCompare(dashTempScopeItem, "x", dash.width);
188+ tryCompare(dashTempScopeItem, "visible", false);
189+ tryCompare(dashContent, "x", 0);
190+ }
191 }
192 }

Subscribers

People subscribed via source and target branches