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

Proposed by Albert Astals Cid
Status: Merged
Approved by: Lukáš Tinkl
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) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Unity8 CI Bot continuous-integration Needs Fixing
Michał Sawicz Needs Fixing
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.
Revision history for this message
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)
Revision history for this message
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
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
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
2174. By Albert Astals Cid

Fix onOpenScope

2175. By Albert Astals Cid

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

Revision history for this message
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

Revision history for this message
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)
Revision history for this message
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)
Revision history for this message
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
=== modified file 'qml/Dash/Dash.qml'
--- qml/Dash/Dash.qml 2015-11-19 16:55:31 +0000
+++ qml/Dash/Dash.qml 2016-02-15 10:15:31 +0000
@@ -37,6 +37,7 @@
37 }37 }
3838
39 property bool windowActive: window.active39 property bool windowActive: window.active
40 property bool showOverlayScope: false
4041
41 DashCommunicatorService {42 DashCommunicatorService {
42 objectName: "dashCommunicatorService"43 objectName: "dashCommunicatorService"
@@ -80,7 +81,7 @@
80 return81 return
81 }82 }
8283
83 closeOverlayScope();84 dash.showOverlayScope = false;
8485
85 dashContent.closePreview();86 dashContent.closePreview();
8687
@@ -93,12 +94,6 @@
93 dashContent.setCurrentScopeAtIndex(scopeIndex, animate, reset)94 dashContent.setCurrentScopeAtIndex(scopeIndex, animate, reset)
94 }95 }
9596
96 function closeOverlayScope() {
97 if (dashContent.x != 0) {
98 dashContent.x = 0;
99 }
100 }
101
102 Scopes {97 Scopes {
103 id: scopes98 id: scopes
104 }99 }
@@ -133,12 +128,13 @@
133 height: dash.height128 height: dash.height
134 scopes: scopes129 scopes: scopes
135 visible: x != -width130 visible: x != -width
131 x: dash.showOverlayScope ? -width : 0
136 onGotoScope: {132 onGotoScope: {
137 dash.setCurrentScope(scopeId, true, false);133 dash.setCurrentScope(scopeId, true, false);
138 }134 }
139 onOpenScope: {135 onOpenScope: {
140 scopeItem.scope = scope;136 scopeItem.scope = scope;
141 x = -width;137 dash.showOverlayScope = true;
142 }138 }
143 Behavior on x {139 Behavior on x {
144 UbuntuNumberAnimation {140 UbuntuNumberAnimation {
@@ -207,7 +203,7 @@
207 bottomEdgeController.enableAnimation = true;203 bottomEdgeController.enableAnimation = true;
208 bottomEdgeController.progress = 0;204 bottomEdgeController.progress = 0;
209 scopeItem.scope = scope;205 scopeItem.scope = scope;
210 dashContent.x = -dashContent.width;206 dash.showOverlayScope = true;
211 }207 }
212 onGotoScope: {208 onGotoScope: {
213 bottomEdgeController.enableAnimation = true;209 bottomEdgeController.enableAnimation = true;
@@ -226,7 +222,7 @@
226 id: scopeItem222 id: scopeItem
227 objectName: "dashTempScopeItem"223 objectName: "dashTempScopeItem"
228224
229 x: dashContent.x + width225 x: dash.showOverlayScope ? 0 : width
230 y: dashContent.y226 y: dashContent.y
231 width: parent.width227 width: parent.width
232 height: parent.height228 height: parent.height
@@ -234,7 +230,7 @@
234 hasBackAction: true230 hasBackAction: true
235 isCurrent: visible231 isCurrent: visible
236 onBackClicked: {232 onBackClicked: {
237 closeOverlayScope();233 dash.showOverlayScope = false;
238 closePreview();234 closePreview();
239 }235 }
240236
@@ -250,6 +246,10 @@
250 scopes.closeScope(oldScope);246 scopes.closeScope(oldScope);
251 }247 }
252 }248 }
249
250 Behavior on x {
251 UbuntuNumberAnimation { }
252 }
253 }253 }
254254
255 Rectangle {255 Rectangle {
256256
=== modified file 'tests/qmltests/Dash/tst_Dash.qml'
--- tests/qmltests/Dash/tst_Dash.qml 2015-12-11 09:10:01 +0000
+++ tests/qmltests/Dash/tst_Dash.qml 2016-02-15 10:15:31 +0000
@@ -70,6 +70,42 @@
70 waitForRendering(findChild(dash, "scopeLoader0").item);70 waitForRendering(findChild(dash, "scopeLoader0").item);
71 }71 }
7272
73 function scrollToCategory(categoryName) {
74 var dashContentList = findChild(dash, "dashContentList");
75 var genericScopeView = dashContentList.currentItem;
76 var categoryListView = findChild(genericScopeView, "categoryListView");
77 tryCompareFunction(function() {
78 var category = findChild(genericScopeView, categoryName);
79 if (category && category.y > 0 && category.y < genericScopeView.height) return true;
80 touchFlick(genericScopeView, genericScopeView.width/2, units.gu(20),
81 genericScopeView.width/2, genericScopeView.y)
82 tryCompare(categoryListView, "moving", false);
83 return false;
84 }, true);
85
86 tryCompareFunction(function() { return findChild(genericScopeView, "delegate0") !== null; }, true);
87 return findChild(genericScopeView, categoryName);
88 }
89
90 function clickCategoryDelegate(category, delegate) {
91 var dashContentList = findChild(dash, "dashContentList");
92 var genericScopeView = dashContentList.currentItem;
93 if (category === undefined) category = 0;
94 if (delegate === undefined) delegate = 0;
95 tryCompareFunction(function() {
96 var cardGrid = findChild(genericScopeView, "dashCategory"+category);
97 if (cardGrid != null) {
98 var tile = findChild(cardGrid, "delegate"+delegate);
99 return tile != null;
100 }
101 return false;
102 },
103 true);
104 var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);
105 waitForRendering(tile);
106 mouseClick(tile);
107 }
108
73 function test_manage_dash_clickscope_unfavoritable() {109 function test_manage_dash_clickscope_unfavoritable() {
74 // Show the manage dash110 // Show the manage dash
75 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));111 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
@@ -565,5 +601,58 @@
565 tryCompare(dashTempScopeItem, "x", dashTempScopeItem.width);601 tryCompare(dashTempScopeItem, "x", dashTempScopeItem.width);
566 tryCompare(dashTempScopeItem, "visible", false);602 tryCompare(dashTempScopeItem, "visible", false);
567 }603 }
604
605 function test_openScope()
606 {
607 scrollToCategory("dashCategory2");
608 clickCategoryDelegate(2, 2);
609
610 var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
611 tryCompare(dashTempScopeItem, "x", 0);
612 tryCompare(dashTempScopeItem, "visible", true);
613 tryCompare(dashContent, "x", -dash.width);
614
615 // Go back
616 var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
617 var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
618 mouseClick(backButton);
619
620 // Check temp scope is gone
621 tryCompare(dashTempScopeItem, "x", dash.width);
622 tryCompare(dashTempScopeItem, "visible", false);
623 tryCompare(dashContent, "x", 0);
624 }
625
626 function test_tempScopeItemXOnResize()
627 {
628 // Go to a temp scope
629 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
630 var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
631 tryCompare(bottomEdgeController, "progress", 1);
632 var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
633 var nonfavScopesListCategoryList = findChild(nonfavScopesListCategory, "scopesListCategoryInnerList");
634 tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
635 mouseClick(nonfavScopesListCategoryList.currentItem);
636 var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
637 tryCompare(dashTempScopeItem, "x", 0);
638 tryCompare(dashTempScopeItem, "visible", true);
639
640 shell.width = units.gu(80);
641 tryCompare(dashTempScopeItem, "x", 0);
642 tryCompare(dashContent, "x", -dash.width);
643
644 shell.width = units.gu(40);
645 tryCompare(dashTempScopeItem, "x", 0);
646
647 // Go back
648 var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
649 var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
650 mouseClick(backButton);
651
652 // Check temp scope is gone
653 tryCompare(dashTempScopeItem, "x", dash.width);
654 tryCompare(dashTempScopeItem, "visible", false);
655 tryCompare(dashContent, "x", 0);
656 }
568 }657 }
569}658}

Subscribers

People subscribed via source and target branches