Merge lp:~diegosarmentero/unity8/unity-rates-and-scroll into lp:unity8

Proposed by Diego Sarmentero
Status: Merged
Approved by: Diego Sarmentero
Approved revision: 352
Merged at revision: 352
Proposed branch: lp:~diegosarmentero/unity8/unity-rates-and-scroll
Merge into: lp:unity8
Diff against target: 143 lines (+45/-0)
4 files modified
Dash/Apps/AppPreview.qml (+7/-0)
Dash/Apps/AppReviews.qml (+3/-0)
Dash/DashPreview.qml (+13/-0)
tests/qmltests/Dash/Apps/tst_AppPreview.qml (+22/-0)
To merge this branch: bzr merge lp:~diegosarmentero/unity8/unity-rates-and-scroll
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michał Sawicz Approve
Alejandro J. Cura (community) Approve
Review via email: mp+186131@code.launchpad.net

Commit message

- Remove "Reviews and Comments" section from Application Preview until the feature is ready (BUG: #1226632)
- Detect when the keyboard is being shown to allow the user to scroll the Preview even more if necessary to interact with the components at the bottom of that preview, and don't leave those components obscured behind the keyboard (BUG: #1226638).

Description of the change

Remove the "Reviews and Comments" section for the Application Preview until the feature is complete (as requested by design).
Add the size of the keyboard to the content height of the scrollable area of any preview if the keyboard is being shown so the components at the bottom of that preview are not covered by the keyboard, and the user can keep scrolling the preview to interact with that part of the page.
Fixed and added tests related to this.

To post a comment you must log in.
Revision history for this message
Alejandro J. Cura (alecu) wrote :

Looks good

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

You should use bottomMargin for the keyboard size. [1]

You should also scroll the content when keyboard size changes, so that you're not left with the keyboard obscuring the text field you've just focused.

Also, use skip() instead of commenting out the tests. Same for the AppReviews itself - just make it invisible to reduce diff size and ease the review.

[1] http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-flickable.html#bottomMargin-prop

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

PASSED: Continuous integration, rev:324
http://jenkins.qa.ubuntu.com/job/unity8-ci/1032/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/3542
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/1070
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/1738
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/56
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1033
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1033/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1032
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/3554
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/3554/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-saucy/3001
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1072
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1072/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/890
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/902

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

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

FAILED: Continuous integration, rev:325
http://jenkins.qa.ubuntu.com/job/unity8-ci/1058/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/3740
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/1268
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/1783
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/82
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1059
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1059/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1058
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/86
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/3752
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/3752/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1270
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1270/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1062
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1074

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

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

FAILED: Continuous integration, rev:326
http://jenkins.qa.ubuntu.com/job/unity8-ci/1068/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/3825
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/1353
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/1797
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/92
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1069
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1069/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1068
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/167
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/3837
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/3837/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1355
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1355/artifact/work/output/*zip*/output.zip
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1142
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1153

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

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

FAILED: Continuous integration, rev:326
http://jenkins.qa.ubuntu.com/job/unity8-ci/1083/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/3899
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/1465
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/1822/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/107
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1084
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1084/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1083
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/230
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/3949
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/3949/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1467
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1467/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1236
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1247

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

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

PASSED: Continuous integration, rev:326
http://jenkins.qa.ubuntu.com/job/unity8-ci/1089/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/3910
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/1482
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/1828
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/113
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1090
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1090/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1089
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/241
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/3966
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/3966/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1484
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1484/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1251
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1261

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

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

Something's wrong here, when I enable the ratings (visible: true) and focus the text field, I get:
http://ubuntuone.com/5aRajAiMMtuiecHwESy9TY

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

As discussed, let's merge as-is right now, since the issue isn't visible anyway. There will be a bug opened for the issue I've mentioned above.

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

PASSED: Continuous integration, rev:328
http://jenkins.qa.ubuntu.com/job/unity8-ci/1140/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/4045
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/1662
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/1889
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/163
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1140
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1140/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1139
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/357
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/4145
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-i386/4145/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1664
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/1664/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1393
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1405

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

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
352. By Diego Sarmentero

resolve conflict

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 :
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Dash/Apps/AppPreview.qml'
2--- Dash/Apps/AppPreview.qml 2013-09-24 13:54:29 +0000
3+++ Dash/Apps/AppPreview.qml 2013-09-26 18:55:40 +0000
4@@ -191,12 +191,19 @@
5 ListItem.ThinDivider { }
6
7 AppReviews {
8+ id: appReviews
9 objectName: "appReviews"
10+ // TODO: This should make this visible when the feature for reviews/comments is complete.
11+ visible: false
12 anchors { left: parent.left; right: parent.right }
13
14 model: root.previewData.infoMap["comments"] ? root.previewData.infoMap["comments"].value : undefined
15
16 onSendReview: root.sendUserReview(review);
17+
18+ onEditing: {
19+ root.ensureVisible(appReviews.textArea);
20+ }
21 }
22 }
23 }
24
25=== modified file 'Dash/Apps/AppReviews.qml'
26--- Dash/Apps/AppReviews.qml 2013-08-09 09:37:50 +0000
27+++ Dash/Apps/AppReviews.qml 2013-09-26 18:55:40 +0000
28@@ -23,8 +23,10 @@
29 id: root
30
31 property var model
32+ property alias textArea: reviewField
33
34 signal sendReview(string review)
35+ signal editing
36
37 spacing: units.gu(2)
38 state: ""
39@@ -93,6 +95,7 @@
40 if(reviewField.focus){
41 root.state = "editing";
42 reviewField.selectAll();
43+ root.editing();
44 }
45 }
46
47
48=== modified file 'Dash/DashPreview.qml'
49--- Dash/DashPreview.qml 2013-08-09 09:48:56 +0000
50+++ Dash/DashPreview.qml 2013-09-26 18:55:40 +0000
51@@ -20,6 +20,7 @@
52 Rectangle {
53 id: root
54
55+ property int keyboardSize: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
56 property var previewData
57
58 property string title: ""
59@@ -38,6 +39,14 @@
60 color: Qt.rgba(0, 0, 0, .3)
61 clip: true
62
63+ function ensureVisible(item) {
64+ var o = leftFlickable.mapFromItem(item, 0, 0, item.width, item.height);
65+ var keyboardY = shell.height - root.keyboardSize;
66+ if ((o.y + o.height) > keyboardY) {
67+ leftFlickable.contentY += o.y + o.height - keyboardY;
68+ }
69+ }
70+
71 Connections {
72 target: shell.applicationManager
73 onMainStageFocusedApplicationChanged: {
74@@ -128,12 +137,16 @@
75
76 Flickable {
77 id: leftFlickable
78+ objectName: "leftFlickable"
79 anchors.top: parent.top
80 anchors.bottom: parent.bottom
81 width: root.narrowMode ? contentRow.width : contentRow.width * root.previewWidthRatio
82 contentHeight: leftColumn.height
83+ anchors.bottomMargin: root.keyboardSize
84 clip: true
85
86+ Behavior on contentY { NumberAnimation { duration: 300 } }
87+
88 Column {
89 id: leftColumn
90 objectName: "leftColumn"
91
92=== modified file 'tests/qmltests/Dash/Apps/tst_AppPreview.qml'
93--- tests/qmltests/Dash/Apps/tst_AppPreview.qml 2013-09-25 19:58:58 +0000
94+++ tests/qmltests/Dash/Apps/tst_AppPreview.qml 2013-09-26 18:55:40 +0000
95@@ -25,6 +25,9 @@
96 width: units.gu(60)
97 height: units.gu(80)
98
99+ // Fake shell
100+ QtObject { id: shell; property int height: appPreview.height }
101+
102 property var calls: []
103
104 SignalSpy {
105@@ -114,6 +117,9 @@
106 reviewField.text = "";
107 data.rating = rating.value;
108 dataProgress.infoMap["progressbar_source"].value = "service";
109+ var appReviews = findChild(appPreview, "appReviews");
110+ appReviews.visible = false;
111+ appPreview.keyboardSize = 0;
112 }
113
114 function test_actions() {
115@@ -149,6 +155,7 @@
116
117 function test_review_focus() {
118 var appReviews = findChild(appPreview, "appReviews");
119+ appReviews.visible = true;
120 var sendButton = findChild(appReviews, "sendButton");
121 var reviewField = findChild(appReviews, "reviewField");
122
123@@ -213,5 +220,20 @@
124 compare(root.calls[0][1], {"error": "DOWNLOAD ERROR"}, "Data of action not found.");
125 }
126
127+ function test_automatic_scroll_on_keyboard_shown() {
128+ waitForRendering(appPreview);
129+ var appReviews = findChild(appPreview, "appReviews");
130+ appReviews.visible = true;
131+
132+ var leftFlickable = findChild(appPreview, "leftFlickable");
133+ leftFlickable.contentY = leftFlickable.contentHeight;
134+ var reviewField = findChild(appReviews, "reviewField");
135+ appPreview.keyboardSize = 400;
136+ appReviews.editing(reviewField);
137+ var newFlickPos = leftFlickable.contentY;
138+ var keyboardY = shell.height - appPreview.keyboardSize;
139+ verify(newFlickPos < keyboardY);
140+ }
141+
142 }
143 }

Subscribers

People subscribed via source and target branches