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

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michael Zanetti
Approved revision: 789
Merged at revision: 856
Proposed branch: lp:~aacid/unity8/categoryDelegateRangeFixOvershootDetection
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/delegateRangeNeedsOriginY
Diff against target: 25 lines (+9/-6)
1 file modified
qml/Dash/GenericScopeView.qml (+9/-6)
To merge this branch: bzr merge lp:~aacid/unity8/categoryDelegateRangeFixOvershootDetection
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+214764@code.launchpad.net

This proposal supersedes a proposal from 2014-03-26.

Commit message

CategoryDelegateRange: Fix condition for detecting overshooting

Description of the change

This is hard to autotest since what was happening is that all the delegates where being created and then immediately destroyed, so at the end the number of delegates we'd have in a tryCompare would be the same.

For manually testing this:
 * Add to Card.qml root
+ Component.onCompleted: console.log("Created", root)
+ Component.onDestruction: console.log("Destroyed", root)
 * And then start the shell and uncollapse the Available category of the Apps scope

Without it you'll see that there's lots of created and destroyed, without it there's only a few created.

* Are there any related MPs required for this MP to build/function as expected?
Yes, see prerequisite

* Did you perform an exploratory manual test run of your code change and any related functionality?
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
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

PASSED: Continuous integration, rev:785
http://jenkins.qa.ubuntu.com/job/unity8-ci/2641/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4273
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3858
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1511
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1162
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1166
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1166/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1162
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3700
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4357
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4357/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3860
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3860/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6139
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5231

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

review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal

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

 Yes. Everything still works. The code change makes sense to me.

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

Yip

review: Approve
Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

Just realzied a bug in here

788. By Albert Astals Cid

Fixes

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

FAILED: Continuous integration, rev:788
http://jenkins.qa.ubuntu.com/job/unity8-ci/2749/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-trusty-touch/90
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4611
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1619
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1270
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1274
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1274/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1270
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/88
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4204
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4204/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5743
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3970
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4735
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4735/artifact/work/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
789. By Albert Astals Cid

Merge

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

FAILED: Continuous integration, rev:789
http://jenkins.qa.ubuntu.com/job/unity8-ci/2843/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-trusty-touch/306
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4921/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1707
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1364
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1368
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1368/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1364
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/286
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4505
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4505/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/6158
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/4251/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/5074
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/5074/artifact/work/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> This is hard to autotest since what was happening is that all the delegates where being created and then immediately > destroyed, so at the end the number of delegates we'd have in a tryCompare would be the same.

Should be quite easy to detect I think...

Get the pointer to the first item that would be destroyed without this patch, do the overshoot and verify that the pointer didn't change. In case its destroyed and recreated, you'd have a different pointer, no?

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

So it is not hard in principle but it's actually hard in practice, if we want to exercise the new condition of taking into account originY we need a way to modify it, but this only happens internally when modifying adding items on the list, but unfortunately at the moment our tests for GenericScopeView depend on a static fake Scopes that returns the same scope list all the time.

I agree it would be great having a test for this, but at the moment modifying the test to do that is probably too much work.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

 * 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.

Nope, but verified that the offending test passes after merging https://code.launchpad.net/~aacid/unity8/card_optimizations/+merge/213660

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Dash/GenericScopeView.qml'
2--- qml/Dash/GenericScopeView.qml 2014-04-16 13:44:46 +0000
3+++ qml/Dash/GenericScopeView.qml 2014-04-17 08:07:23 +0000
4@@ -238,12 +238,15 @@
5 }
6
7 function updateDelegateCreationRange() {
8- // Do not update the range if we are overshooting up or down, since we'll come back
9- // to the stable position and delete/create items without any reason
10- if (categoryView.contentY < categoryView.originY) {
11- return;
12- } else if (categoryView.contentHeight > categoryView.height && categoryView.contentY + categoryView.height > categoryView.contentHeight) {
13- return;
14+ if (categoryView.moving) {
15+ // Do not update the range if we are overshooting up or down, since we'll come back
16+ // to the stable position and delete/create items without any reason
17+ if (categoryView.contentY < categoryView.originY) {
18+ return;
19+ } else if (categoryView.contentHeight - categoryView.originY > categoryView.height &&
20+ categoryView.contentY + categoryView.height > categoryView.contentHeight) {
21+ return;
22+ }
23 }
24
25 if (item && item.hasOwnProperty("delegateCreationBegin")) {

Subscribers

People subscribed via source and target branches