Merge lp:~lukas-kde/unity8/fullscreenNotifications-lp1581498 into lp:unity8

Proposed by Lukáš Tinkl
Status: Merged
Approved by: Michael Zanetti
Approved revision: 2401
Merged at revision: 2432
Proposed branch: lp:~lukas-kde/unity8/fullscreenNotifications-lp1581498
Merge into: lp:unity8
Prerequisite: lp:~lukas-kde/unity8/notificationExpansionLogicFixes
Diff against target: 153 lines (+37/-14)
3 files modified
qml/Notifications/Notification.qml (+17/-6)
qml/Notifications/NotificationMenuItemFactory.qml (+3/-0)
qml/Notifications/Notifications.qml (+17/-8)
To merge this branch: bzr merge lp:~lukas-kde/unity8/fullscreenNotifications-lp1581498
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
Unity8 CI Bot continuous-integration Needs Fixing
Albert Astals Cid (community) Abstain
Review via email: mp+294799@code.launchpad.net

Commit message

Fullscreen notification bug fixes

Description of the change

Fullscreen notification bug fixes

- don't let them be pushed down by other snap decisions (e.g. wifi dialog, USB debugging prompt); set their priority higher
- don't allow swiping them away, they must be acted upon
- perform the "reject" action unconditionally (fixes a discrepancy between the mock and the real model)

Fixes lp:1581498

To post a comment you must log in.
2400. By Lukáš Tinkl

perform the "reject" action unconditionally

the real model doesn't have a "count" property, unlike the mock model, grmbl...

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2399
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1222/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/759
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/759
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1639
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1592
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1592
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1585
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1585/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1585
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1585/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1585
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1585/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1585
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1585/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1585
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1585/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1585
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1585/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2400
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1225/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/762
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/762
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1642
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1595
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1595
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1588
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1588/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1588
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1588/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1588
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1588/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1588
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1588/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1588
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1588/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1588
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1588/artifact/output/*zip*/output.zip

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

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

did you base qml/Notifications/Notifications.qml on my branch or did you arrive to the same solution for the same problem independently?

review: Needs Information
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

I partly based it on yours as I needed it here as well and because launchpad can have only one prereq...

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

nope, not fixed yet: http://i.imgur.com/kIbEZwc.png

review: Needs Fixing
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

> nope, not fixed yet: http://i.imgur.com/kIbEZwc.png

That one is special, it's a design decision I think; the model inserts the "confirmations" (e.g. volume dialog) unconditionally at the top of the visible ones.

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

will abstain since mzanetti seems to be taking care of the review.

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

well, can also reproduce it with wifi ones still:

http://i.imgur.com/PxtbFSL.png

review: Needs Fixing
2401. By Lukáš Tinkl

better fix for handling the fullscreen state

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Alright, hopefully better now - can't reproduce with neither wifi dialog or the USB debugging prompt

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2401
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1240/
Executed test runs:
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/775
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/775
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1672
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1622
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1622
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1615
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1615/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1615
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1615/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1615
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1615/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1615
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1615/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1615
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1615/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1615
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1615/artifact/output/*zip*/output.zip

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

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

I can still reproduce it with the WiFi dialog... I think that's a bit of a constructed use case though... The USB port popup seems definitely fixed now.

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

Ok... on more attempts I can't reproduce it with the wifi one any more either. There might be a race somewhere but oh well, probably not worth trying to find that as it will most likely require to refactor the whole thing and there's a notification rework showing up on the horizon anyways.

I'm ok with the code changes. It looks like duct-taping the thing, but not sure I'd come up with something better without ending up at the complete refactor again.

Let's get this in then.

* Tested, ok

* Ci tests did not pass, however, looks really unrelated

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Notifications/Notification.qml'
2--- qml/Notifications/Notification.qml 2016-05-18 18:14:47 +0000
3+++ qml/Notifications/Notification.qml 2016-05-18 18:14:47 +0000
4@@ -55,11 +55,13 @@
5 name: "Ubuntu.Components.Themes.Ambiance"
6 }
7
8+ signal dismissed()
9+
10 readonly property bool expanded: {
11 var result = false;
12
13 if (type === Notification.SnapDecision) {
14- if (ListView.view.currentIndex === index) {
15+ if (ListView.view.currentIndex === index || fullscreen) {
16 result = true;
17 } else {
18 if (ListView.view.count > 2) {
19@@ -103,10 +105,11 @@
20 ListView.view.currentIndex = -1;
21 }
22
23- if (notification.actions.count > 1) { // perform the "reject" action
24- notification.notification.invokeAction(notification.actions.data(1, ActionModel.RoleActionId));
25- }
26+ // perform the "reject" action
27+ notification.notification.invokeAction(notification.actions.data(1, ActionModel.RoleActionId));
28+
29 notification.notification.close();
30+ notification.dismissed()
31 }
32
33 Behavior on x {
34@@ -119,6 +122,12 @@
35 }
36 }
37
38+ onFullscreenChanged: {
39+ if (fullscreen) {
40+ notification.notification.urgency = Notification.Critical;
41+ }
42+ }
43+
44 Behavior on height {
45 UbuntuNumberAnimation {
46 duration: UbuntuAnimation.SnapDuration
47@@ -192,6 +201,7 @@
48 onNameOwnerChanged: {
49 if (lastNameOwner !== "" && nameOwner === "" && notification.notification !== undefined) {
50 notification.notification.close()
51+ notification.dismissed()
52 }
53 lastNameOwner = nameOwner
54 }
55@@ -203,7 +213,7 @@
56 anchors.fill: parent
57 objectName: "interactiveArea"
58
59- drag.target: notification
60+ drag.target: !fullscreen ? notification : undefined
61 drag.axis: Drag.XAxis
62 drag.minimumX: -notification.width
63 drag.maximumX: notification.width
64@@ -386,7 +396,7 @@
65 objectName: "dialogListView"
66 spacing: notification.margins
67
68- visible: count > 0 && notification.expanded
69+ visible: count > 0 && (notification.expanded || notification.fullscreen)
70
71 anchors {
72 left: parent.left
73@@ -417,6 +427,7 @@
74 }
75 onAccepted: {
76 notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
77+ notification.dismissed()
78 }
79 }
80 }
81
82=== modified file 'qml/Notifications/NotificationMenuItemFactory.qml'
83--- qml/Notifications/NotificationMenuItemFactory.qml 2016-04-05 19:29:33 +0000
84+++ qml/Notifications/NotificationMenuItemFactory.qml 2016-05-18 18:14:47 +0000
85@@ -150,15 +150,18 @@
86 onEntered: {
87 menuModel.changeState(menuIndex, passphrase);
88 clear(false);
89+ notification.dismissed()
90 }
91
92 onCancel: {
93 menuModel.activate(menuIndex, false);
94+ notification.dismissed()
95 }
96
97 onEmergencyCall: {
98 shell.startLockedApp("dialer-app");
99 menuModel.activate(menuIndex, false);
100+ notification.dismissed()
101 }
102
103 property var extendedData: menuData && menuData.ext || undefined
104
105=== modified file 'qml/Notifications/Notifications.qml'
106--- qml/Notifications/Notifications.qml 2016-05-18 18:14:47 +0000
107+++ qml/Notifications/Notifications.qml 2016-05-18 18:14:47 +0000
108@@ -41,11 +41,18 @@
109 filterRegExp: RegExp(UnityNotifications.Notification.SnapDecision)
110 }
111
112- property bool topmostIsFullscreen: false
113+ readonly property bool topmostIsFullscreen: fullscreenIndex != -1
114 spacing: topmostIsFullscreen ? 0 : units.gu(1)
115
116 currentIndex: count > 1 ? 1 : -1
117
118+ property int fullscreenIndex: -1
119+ onFullscreenIndexChanged: {
120+ if (fullscreenIndex != -1) {
121+ positionViewAtIndex(fullscreenIndex, ListView.Beginning);
122+ }
123+ }
124+
125 delegate: Notification {
126 objectName: "notification" + index
127 width: parent.width
128@@ -69,16 +76,18 @@
129 // FIXME: disabled all transitions because of LP: #1354406 workaround
130 //layer.enabled: add.running || remove.running || populate.running
131
132- Component.onCompleted: {
133- if (index == 1) {
134- notificationList.topmostIsFullscreen = fullscreen
135+ onFullscreenChanged: updateListTopMostIsFullscreen();
136+
137+ function updateListTopMostIsFullscreen() {
138+ if (fullscreen) {
139+ fullscreenIndex = index;
140 }
141 }
142
143- onFullscreenChanged: {
144- // index 1 because 0 is the PlaceHolder...
145- if (index == 1) {
146- notificationList.topmostIsFullscreen = fullscreen
147+ onDismissed: {
148+ if (fullscreenIndex == index) {
149+ fullscreenIndex = -1;
150+ notificationList.positionViewAtBeginning();
151 }
152 }
153 }

Subscribers

People subscribed via source and target branches