From 578ecd5ce185abf8b915ba193465aeb3e8cb9ea1 Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Fri, 20 Nov 2026 08:54:35 +0800 Subject: [PATCH 01/16] Notification center: Today and the notifications (SHELL-SPEC, step 3) A surface over upstream's notification history: what is on screen and what timed out, was swiped away or was replaced, grouped by app (opened and withdrawn ones are done with). "Today" has a large clock, the date and the weather from the weather panel, hosted for its data once the center has been opened; no agenda, as there is no calendar behind it. An iPad in landscape has Today and the notifications side by side, portrait and a phone stacked. Cards in the banners' family: the app's icon and name, the time, a bold title, the body and only the sender's own buttons; "n more" opens a stack. A tap opens the notification (a history entry its app), a finger sliding a card sideways clears it (kinetic), a collapsed stack whole. Focus (Do Not Disturb) and Clear all in the header. It moves as the control center: a finger pulls it down from the bar's left two thirds holding the bottom of what it shows, a spring carries it, it is pushed up on the empty screen or by its handle; the clock opens it as a popup; Super+Ctrl+2 (with a migration for existing rc.xml), Home, Escape and a tap on the empty screen. It, the control center, the launcher and the bar's popups put each other away, the bar stays reachable, and no banner shows under it. Keyboard: Up/Down, Enter, Delete, Escape. Software rendering skips the fades. Assisted-by: LLM --- desktop/shell/bin/omarchy-home-button | 5 + desktop/shell/default/i18n/en/shell.json | 7 + desktop/shell/labwc-rc.xml | 4 + desktop/shell/migrations/1795135939.sh | 11 + .../shell/controlcenter/ControlCenter.qml | 2 + desktop/shell/shell/launcher/Launcher.qml | 1 + .../notificationcenter/NotificationCenter.qml | 929 ++++++++++++++++++ desktop/shell/shell/plugins/bar/Bar.qml | 20 + .../shell/plugins/notifications/Service.qml | 102 +- .../shell/plugins/panels/clock/BarWidget.qml | 3 + desktop/shell/shell/shell.qml | 3 + 11 files changed, 1085 insertions(+), 2 deletions(-) create mode 100644 desktop/shell/migrations/1795135939.sh create mode 100644 desktop/shell/shell/notificationcenter/NotificationCenter.qml diff --git a/desktop/shell/bin/omarchy-home-button b/desktop/shell/bin/omarchy-home-button index 289d217c..311037e3 100755 --- a/desktop/shell/bin/omarchy-home-button +++ b/desktop/shell/bin/omarchy-home-button @@ -22,6 +22,11 @@ if [[ -e $runtime/omarchy-control-center-open ]]; then control_center=1 omarchy-shell omarchy.controlcenter close >/dev/null 2>&1 & fi +# The notification center likewise. +if [[ -e $runtime/omarchy-notification-center-open ]]; then + control_center=1 + omarchy-shell omarchy.notificationcenter close >/dev/null 2>&1 & +fi # In the overview Home goes back to the desktop (omarchy-overview-changed # keeps the note). diff --git a/desktop/shell/default/i18n/en/shell.json b/desktop/shell/default/i18n/en/shell.json index 39fbe195..a4bf8a90 100644 --- a/desktop/shell/default/i18n/en/shell.json +++ b/desktop/shell/default/i18n/en/shell.json @@ -534,6 +534,13 @@ "notifications.copyThisCode": "Copy %1", "notifications.minutesAgo": "%1m", "notifications.reply": "Reply", + "notificationCenter.title": "Notifications", + "notificationCenter.focusOn": "Focus on", + "notificationCenter.focusOff": "Focus off", + "notificationCenter.clearAll": "Clear all", + "notificationCenter.empty": "No notifications", + "notificationCenter.more": "%1 more", + "notificationCenter.less": "Show less", "notifications.noneRecent": "No recent notifications", "notifications.redactedBody": "Code hidden", "notifications.redactedSummary": "Verification notification", diff --git a/desktop/shell/labwc-rc.xml b/desktop/shell/labwc-rc.xml index 6d9d15c5..895255c3 100644 --- a/desktop/shell/labwc-rc.xml +++ b/desktop/shell/labwc-rc.xml @@ -87,6 +87,10 @@ + + + + diff --git a/desktop/shell/migrations/1795135939.sh b/desktop/shell/migrations/1795135939.sh new file mode 100644 index 00000000..9f92de6d --- /dev/null +++ b/desktop/shell/migrations/1795135939.sh @@ -0,0 +1,11 @@ +echo "Super+Ctrl+2 opens the notification center" + +# A new user's rc.xml has the binding; an existing one gets it before the +# launcher's (Super+Space), unless the key is bound already. +rc="$HOME/.config/labwc/rc.xml" +if [[ -f $rc ]] && ! grep -q 'key="W-C-2"' "$rc" && grep -q '^ ' "$rc"; then + sed '0,/^ /s## \n \n \n #' "$rc" > "$rc.new" + mv -- "$rc.new" "$rc" + labwc=${LABWC_PID:-$(pgrep -u "$(id -u)" -x labwc | head -1 || true)} + [[ -z $labwc ]] || kill -HUP "$labwc" +fi diff --git a/desktop/shell/shell/controlcenter/ControlCenter.qml b/desktop/shell/shell/controlcenter/ControlCenter.qml index d86fc899..20a3ede6 100644 --- a/desktop/shell/shell/controlcenter/ControlCenter.qml +++ b/desktop/shell/shell/controlcenter/ControlCenter.qml @@ -335,6 +335,7 @@ Item { function show() { root.closePopout() if (root.shell && root.shell.launcher && root.shell.launcher.opened) root.shell.launcher.close() + if (root.shell && root.shell.notificationCenter && root.shell.notificationCenter.opened) root.shell.notificationCenter.close() root.prepare() root.opened = true root.mapped = true @@ -399,6 +400,7 @@ Item { root.popupStyle = false if (!root.opened) { root.closePopout() + if (root.shell && root.shell.notificationCenter && root.shell.notificationCenter.opened) root.shell.notificationCenter.close() root.prepare() root.reveal = 0 root.mapped = true diff --git a/desktop/shell/shell/launcher/Launcher.qml b/desktop/shell/shell/launcher/Launcher.qml index dc38be2f..631d7a92 100644 --- a/desktop/shell/shell/launcher/Launcher.qml +++ b/desktop/shell/shell/launcher/Launcher.qml @@ -665,6 +665,7 @@ Item { var bar = root.shell ? root.shell.bar : null if (bar && bar.activePopout && typeof bar.activePopout.close === "function") bar.activePopout.close() if (root.shell && root.shell.controlCenter && root.shell.controlCenter.opened) root.shell.controlCenter.close() + if (root.shell && root.shell.notificationCenter && root.shell.notificationCenter.opened) root.shell.notificationCenter.close() if (root.appLibrary) root.appLibrary.refreshIcons() if (root.appsStale || root.apps.length === 0) root.rebuild() // Stop Screenrecording and the session list follow what is true now. diff --git a/desktop/shell/shell/notificationcenter/NotificationCenter.qml b/desktop/shell/shell/notificationcenter/NotificationCenter.qml new file mode 100644 index 00000000..4b04b84e --- /dev/null +++ b/desktop/shell/shell/notificationcenter/NotificationCenter.qml @@ -0,0 +1,929 @@ +import QtQuick +import QtQuick.Effects +import Quickshell +import Quickshell.Io +import Quickshell.Wayland +import qs.Commons +import qs.Commons as Commons +import qs.Ui +import "../plugins/panels/weather" as Weather + +// The notification center (SHELL-SPEC, step 3): "Today" (a large clock, the +// date, the weather) and the notifications, over upstream's notification +// history: what is on screen and what timed out, was swiped away or was +// replaced, grouped by app. An iPad in landscape has the two side by side, +// portrait and a phone have them stacked. A finger pulls it down from the +// bar's left two thirds (the control center has the right third), the clock +// opens it as a popup, Home, Escape or a tap on the empty screen put it away. +// It moves as the control center does: the finger holds the bottom of what +// it shows, a spring carries it on, and software rendering skips the fades. +Item { + id: root + + property var shell: null + property bool opened: false + property bool mapped: false + property real reveal: 0 + // Opened once: the weather is fetched from then on, not from shell start. + property bool everOpened: false + + readonly property bool gpu: Quickshell.env("QT_QUICK_BACKEND") !== "software" + readonly property real screenWidth: panel.width > 0 ? panel.width : 1024 + readonly property real screenHeight: panel.height > 0 ? panel.height : 768 + readonly property bool phone: Math.min(screenWidth, screenHeight) < 600 + readonly property bool wide: !phone && screenWidth > screenHeight + readonly property int barInset: Style.bar.sizeHorizontal + readonly property color text: Commons.Color.popups.text + readonly property color dim: Qt.darker(text, 1.45) + readonly property color cardFill: { + var c = Commons.Color.notifications.background + return Qt.rgba(c.r, c.g, c.b, 1) + } + readonly property color outline: Style.normalBorderFor(text, Commons.Color.accent) + readonly property real hairline: Style.normalBorderWidth > 0 ? 1 / Math.max(1, panel.devicePixelRatio) : 0 + + // Columns: the design's margins and widths, a phone's narrower. + readonly property real margin: phone ? Style.space(16) : wide ? Style.space(64) : Style.space(40) + readonly property real todayWidth: wide ? Style.space(300) : screenWidth - margin * 2 + readonly property real listWidth: wide ? Math.min(Style.space(548), screenWidth - margin * 2 - todayWidth - Style.space(48)) + : screenWidth - margin * 2 + + readonly property var service: shell ? shell.firstPartyServiceFor("omarchy.notifications") : null + + // ------------------------------------------------------------ content + + // Groups of entries, newest first; a group of several shows its newest + // with "n more" until it is opened. + readonly property var groups: { + var revision = service ? service.centerRevision : 0 + return root.opened || root.mapped ? (service ? service.centerGroups() : []) : [] + } + property var openGroups: ({}) + function toggleGroup(key) { + var next = {} + for (var k in openGroups) next[k] = openGroups[k] + if (next[key]) delete next[key]; else next[key] = true + openGroups = next + } + + // The time, to the minute, for the clock and the cards' ages. + property double now: Date.now() + Timer { + interval: 1000 * (60 - new Date().getSeconds()) + running: root.mapped + repeat: true + triggeredOnStart: true + onTriggered: { root.now = Date.now(); interval = 1000 * (60 - new Date().getSeconds()) } + } + function ago(ts) { + var s = Math.max(0, (root.now - ts * 1000) / 1000) + if (s < 60) return I18n.t("agents.durationNow") + if (s < 3600) return Math.round(s / 60) + " min" + if (s < 86400) return Math.round(s / 3600) + " h" + return Qt.locale(I18n.formatLocale).toString(new Date(ts * 1000), "ddd") + } + + // The weather panel, hosted for its data only (never shown). + QtObject { + id: weatherHost + readonly property color foreground: root.text + readonly property color barForeground: root.text + readonly property color urgent: Commons.Color.urgent + readonly property string fontFamily: Style.font.family + readonly property var shell: root.shell + readonly property string position: "top" + readonly property bool vertical: false + readonly property int barSize: Style.bar.sizeHorizontal + readonly property var activePopout: null + readonly property bool foregroundAnimationEnabled: false + readonly property int sizeHorizontal: Style.bar.sizeHorizontal + readonly property int iconFont: Style.font.icon + readonly property int iconSize: Style.font.icon + readonly property int iconSlot: Style.space(28) + readonly property bool iconCanvas: false + readonly property var clickTargets: [] + function barSizeFor() { return Style.bar.sizeHorizontal } + function showTooltip() {} + function hideTooltip() {} + function requestPopout() { return false } + function releasePopout() {} + function notePopoutCard() {} + function popoutCardFor() { return null } + function targetBelongsToWindow() { return false } + function run(command) { Quickshell.execDetached(["sh", "-c", command]) } + function switchPanelFrom(panel, direction) { return false } + function showPage(panel) {} + function leavePage(panel) {} + } + Item { + visible: false + Loader { + id: weatherLoader + active: root.everOpened + sourceComponent: Weather.Panel { host: weatherHost; bar: weatherHost; moduleName: "omarchy.weather" } + } + } + readonly property var weather: weatherLoader.item + readonly property bool hasWeather: !!weather && weather.reportTempNum !== "" + readonly property string weatherHighLow: { + if (!weather || !weather.forecastDays || weather.forecastDays.length === 0) return "" + var day = weather.forecastDays[0] + var high = weather.bareTempForDay(day, "max"), low = weather.bareTempForDay(day, "min") + return high !== "" && low !== "" ? "H " + high + " · L " + low : "" + } + + // ------------------------------------------------------------ opening + + function closePopout() { + var bar = root.shell ? root.shell.bar : null + var popout = bar ? bar.activePopout : null + if (popout && typeof popout.close === "function") popout.close() + } + // Nothing else of the shell's lies under it: a bar popup, the control + // center and the launcher go first, and they put it away in turn. + function clearOthers() { + root.closePopout() + if (root.shell && root.shell.controlCenter && root.shell.controlCenter.opened) root.shell.controlCenter.close() + if (root.shell && root.shell.launcher && root.shell.launcher.opened) root.shell.launcher.close() + } + Connections { + target: root.shell ? root.shell.bar : null + function onActivePopoutChanged() { if (root.opened && root.shell.bar.activePopout) root.close() } + } + + function show() { + root.clearOthers() + root.everOpened = true + root.focusIndex = -1 + root.opened = true + root.mapped = true + if (panel.contentRevealed) root.animateIn() + Qt.callLater(function() { keyCatcher.forceActiveFocus() }) + } + function open() { root.popupStyle = false; root.show() } + function close() { + root.touchSpent = false + if (!root.opened) return + root.closingFromOpen = true + root.opened = false + if (root.popupStyle) { spring.running = false; popupOut.restart() } + else root.settle(0, 0) + } + function toggle() { root.opened ? root.close() : root.open() } + // From the clock, with a mouse: a popup's fade, no slide, the bar not dimmed. + property bool popupStyle: false + function togglePopup() { + if (root.opened) { root.close(); return } + root.popupStyle = !root.phone + root.show() + } + function animateIn() { + if (root.popupStyle) { spring.running = false; popupOut.stop(); popupIn.restart() } + else root.settle(1, 0) + } + NumberAnimation { + id: popupIn + target: root; property: "reveal"; to: 1 + duration: root.gpu ? Style.duration(180) : 0 + easing.type: Easing.Bezier + easing.bezierCurve: Style.easeOut + } + NumberAnimation { + id: popupOut + target: root; property: "reveal"; to: 0 + duration: root.gpu ? Style.duration(140) : 0 + easing.type: Easing.InOutCubic + onFinished: if (!root.opened) root.mapped = false + } + + // While open, a note for the Home button (omarchy-home-button closes it), + // written by one writer until it matches. + readonly property string openNote: (Quickshell.env("XDG_RUNTIME_DIR") || "/tmp") + "/omarchy-notification-center-open" + property bool noteWritten: true + function writeOpenNote() { + if (noteWriter.running || root.noteWritten === root.opened) return + noteWriter.writing = root.opened + noteWriter.command = root.opened ? ["touch", root.openNote] : ["rm", "-f", root.openNote] + noteWriter.running = true + } + Process { + id: noteWriter + property bool writing: false + onExited: { root.noteWritten = writing; root.writeOpenNote() } + } + Component.onCompleted: writeOpenNote() + onOpenedChanged: writeOpenNote() + + ShellIpc { + target: "omarchy.notificationcenter" + function toggle(): void { root.toggle() } + function open(): void { if (!root.opened) root.open() } + function close(): void { root.close() } + } + + // ------------------------------------------------------------ the pull + + // A finger pulls it down from the bar, or pushes it up to put it away: the + // bottom of what it shows follows the finger; let go, a spring carries it + // on or back by how far and fast it moved. + property bool pulling: false + property bool touchSpent: false + property real pullFrom: 0 + readonly property real pullSpan: Math.max(1, root.barInset + Math.min(content.height, root.screenHeight - root.barInset)) + + function beginPull() { + spring.running = false + popupIn.stop() + popupOut.stop() + root.popupStyle = false + if (!root.opened) { + root.clearOthers() + root.everOpened = true + root.reveal = 0 + root.mapped = true + } + root.pullFrom = root.reveal + root.pulling = true + } + function pullTo(distance) { + if (!root.pulling) return + var r = root.pullFrom + distance / root.pullSpan + if (r > 1) r = 1 + (1 - 1 / (1 + (r - 1) * 2)) * 0.08 + root.reveal = Math.max(0, r) + } + function endPull(velocity) { + if (!root.pulling) return + root.pulling = false + var flick = Style.space(400) + var keep = velocity > flick || (velocity > -flick && root.reveal > 0.4) + root.closingFromOpen = !keep && root.pullFrom > 0.5 + root.opened = keep + root.settle(keep ? 1 : 0, velocity / root.pullSpan) + if (keep) Qt.callLater(function() { keyCatcher.forceActiveFocus() }) + } + + property real springTarget: 0 + property real springVelocity: 0 + function settle(target, velocity) { + root.springTarget = target + root.springVelocity = velocity + spring.running = true + } + property bool closingFromOpen: false + readonly property bool leaving: root.pulling ? root.pullFrom > 0.5 : (!root.opened && root.closingFromOpen) + FrameAnimation { + id: spring + onTriggered: { + var elapsed = Math.min(frameTime, 0.25) + var stiffness = root.springTarget > 0 ? 260 : 195 + var damping = 2 * Math.sqrt(stiffness) * (root.springTarget > 0 ? 0.78 : 1.0) + var steps = Math.max(1, Math.ceil(elapsed / (1 / 240))) + var dt = elapsed / steps + var reveal = root.reveal, velocity = root.springVelocity + for (var i = 0; i < steps; i++) { + velocity += (-stiffness * (reveal - root.springTarget) - damping * velocity) * dt + reveal += velocity * dt + } + root.springVelocity = velocity + root.reveal = reveal + if (Math.abs(root.reveal - root.springTarget) < 0.002 && Math.abs(root.springVelocity) < 0.02) { + root.reveal = root.springTarget + root.springVelocity = 0 + running = false + if (!root.opened) root.mapped = false + } + } + } + readonly property bool moving: spring.running || root.pulling || popupIn.running || popupOut.running + + // ------------------------------------------------------------ keyboard + + // Up and Down walk Focus, Clear all and the cards; Enter opens or presses, + // Delete clears a card, Escape closes. + property int focusIndex: -1 + readonly property int focusCount: 2 + root.groups.length + function moveFocus(step) { + if (root.focusCount === 0) return + root.focusIndex = root.focusIndex < 0 ? (step > 0 ? 0 : root.focusCount - 1) + : Math.max(0, Math.min(root.focusCount - 1, root.focusIndex + step)) + } + function activateFocused() { + if (root.focusIndex === 0) root.toggleFocus() + else if (root.focusIndex === 1) root.clearAll() + else if (root.focusIndex >= 2) root.openGroup(root.groups[root.focusIndex - 2]) + } + function forgetFocused() { + if (root.focusIndex >= 2) root.forgetGroup(root.groups[root.focusIndex - 2], false) + } + + // ------------------------------------------------------------ actions + + readonly property bool focusOn: !!service && service.doNotDisturb === true + function toggleFocus() { if (service) service.setDoNotDisturb(!root.focusOn) } + function clearAll() { if (service) service.clearCenter() } + function openEntry(entry) { + if (!service || !entry) return + service.openEntry(entry) + root.close() + } + function openGroup(group) { if (group && group.rows.length) root.openEntry(group.rows[0]) } + // A collapsed stack goes whole; an open one, the card swiped. + function forgetGroup(group, single, entry) { + if (!service || !group) return + if (single && entry) { service.forgetEntry(entry.key); return } + for (var i = 0; i < group.rows.length; i++) service.forgetEntry(group.rows[i].key) + } + + // ------------------------------------------------------------ window + + OverlayWindow { + id: panel + shown: root.mapped + // Above everything, the on-screen keyboard included. + shownLayer: WlrLayer.Overlay + WlrLayershell.namespace: "omarchy-notification-center" + // The bar stays the bar's: a pull from it or a click on its items reaches it. + mask: Region { item: belowBar } + Item { + id: belowBar + y: root.barInset + width: parent.width + height: Math.max(0, parent.height - root.barInset) + } + + onContentRevealedChanged: if (contentRevealed && root.opened && !root.pulling) { + root.reveal = 0 + root.animateIn() + keyCatcher.forceActiveFocus() + } + + // The screen under it dims (a phone's is the sheet itself), and a tap on + // what is not a card puts it away. + Rectangle { + id: scrim + y: root.barInset + width: parent.width + height: parent.height - y + // Dark enough that the cards read as the page (the design's), the + // wallpaper only a hint behind; a phone's is the opaque sheet. + readonly property color base: Commons.Color.menu.background + color: root.phone ? base : Qt.rgba(base.r, base.g, base.b, 0.88) + opacity: !root.gpu ? (root.reveal > 0 ? 1 : 0) + : root.leaving ? sheet.opacity + : 1 - Math.pow(1 - Math.max(0, Math.min(1, root.reveal)), 2.5) + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton | Qt.RightButton + onClicked: root.close() + } + // Pushed up on the empty screen, it follows and goes away. + DragHandler { + target: null + xAxis.enabled: false + acceptedDevices: PointerDevice.TouchScreen + enabled: root.opened || root.pulling + onActiveChanged: active ? root.beginPull() : root.endPull(centroid.velocity.y) + onTranslationChanged: if (active) root.pullTo(translation.y) + } + } + + Item { + id: keyCatcher + anchors.fill: parent + focus: true + Keys.onPressed: function(event) { + switch (event.key) { + case Qt.Key_Escape: root.close(); break + case Qt.Key_Down: case Qt.Key_Tab: root.moveFocus(1); break + case Qt.Key_Up: case Qt.Key_Backtab: root.moveFocus(-1); break + case Qt.Key_Return: case Qt.Key_Enter: case Qt.Key_Space: root.activateFocused(); break + case Qt.Key_Delete: case Qt.Key_Backspace: root.forgetFocused(); break + default: return + } + event.accepted = true + } + } + PointHandler { onActiveChanged: if (active) root.focusIndex = -1 } + + // What it shows, sliding down from under the bar: its bottom is where the + // finger is. As a popup it fades and grows from 97 % instead. + Item { + id: sheet + y: root.barInset + width: parent.width + height: parent.height - root.barInset + clip: true + layer.enabled: root.moving && root.gpu + layer.smooth: true + readonly property real follow: Math.min(content.height, height) + readonly property real grow: !root.gpu ? 1 : (root.popupStyle ? 0.97 + 0.03 * root.reveal : 1) + transform: [ + Scale { origin.x: sheet.width / 2; origin.y: 0; xScale: sheet.grow; yScale: sheet.grow }, + Translate { y: root.popupStyle ? 0 : Math.min(0, (root.reveal - 1) * sheet.follow) } + ] + opacity: !root.gpu ? (root.reveal > 0 ? 1 : 0) : root.popupStyle ? root.reveal : root.leaving + ? Math.max(0, Math.min(1, root.reveal * 1.2 - 0.2)) + : 1 - Math.pow(1 - Math.max(0, Math.min(1, root.reveal / 0.3)), 2) + + Flickable { + id: scroller + anchors.fill: parent + contentWidth: width + contentHeight: content.height + boundsBehavior: Flickable.StopAtBounds + interactive: contentHeight > height + + Item { + id: content + width: scroller.width + height: Math.max(todayColumn.y + todayColumn.height, listColumn.y + listColumn.height) + Style.space(root.phone ? 24 : 40) + + // ---- Today + Column { + id: todayColumn + x: root.margin + y: Style.space(root.phone ? 24 : 40) + width: root.todayWidth + spacing: Style.space(root.phone ? 6 : 8) + + // A phone: the date over a centred clock, as its lock does. + Text { + visible: root.phone + width: parent.width + horizontalAlignment: Text.AlignHCenter + textFormat: Text.PlainText + text: Qt.locale(I18n.formatLocale).toString(new Date(root.now), "dddd, d MMMM") + color: root.dim + font.family: Style.font.family + font.pixelSize: Style.font.subtitle + } + Text { + width: parent.width + horizontalAlignment: root.phone ? Text.AlignHCenter : Text.AlignLeft + textFormat: Text.PlainText + text: Qt.locale(I18n.formatLocale).toString(new Date(root.now), "HH:mm") + color: root.text + font.family: Style.font.family + font.pixelSize: Style.space(root.phone ? 60 : 72) + font.bold: true + } + Text { + visible: !root.phone + textFormat: Text.PlainText + text: Qt.locale(I18n.formatLocale).toString(new Date(root.now), "dddd, d MMMM") + color: root.text + font.family: Style.font.family + font.pixelSize: Style.font.subtitle + } + Item { width: 1; height: Style.space(root.phone ? 10 : 16); visible: root.hasWeather } + + // The weather, as the weather panel reads it. + Rectangle { + visible: root.hasWeather + width: parent.width + height: weatherRow.implicitHeight + Style.space(24) + color: root.cardFill + border.width: root.hairline + border.color: root.outline + Row { + id: weatherRow + x: Style.space(14) + anchors.verticalCenter: parent.verticalCenter + spacing: Style.space(12) + Text { + anchors.verticalCenter: parent.verticalCenter + textFormat: Text.PlainText + text: root.weather ? root.weather.label : "" + color: Commons.Color.accent + font.family: Style.font.family + font.pixelSize: Style.font.displayLarge + } + Column { + anchors.verticalCenter: parent.verticalCenter + spacing: Style.space(2) + Text { + textFormat: Text.PlainText + text: root.weather ? root.weather.reportTempNum + root.weather.tempUnit : "" + color: root.text + font.family: Style.font.family + font.pixelSize: Style.font.title + font.bold: true + } + Text { + textFormat: Text.PlainText + text: [root.weatherHighLow, root.weather ? root.weather.reportLocation : ""] + .filter(function(part) { return part !== "" }).join(" · ") + color: root.dim + font.family: Style.font.family + font.pixelSize: Style.font.caption + } + } + } + } + } + + // ---- Notifications + Column { + id: listColumn + x: root.wide ? root.screenWidth - root.margin - root.listWidth : root.margin + y: root.wide ? Style.space(40) : todayColumn.y + todayColumn.height + Style.space(root.phone ? 28 : 40) + width: root.listWidth + spacing: Style.space(12) + + // The header: Focus (Do Not Disturb) and Clear all. + Item { + width: parent.width + height: Math.max(heading.implicitHeight, headerButtons.height) + Text { + id: heading + anchors.verticalCenter: parent.verticalCenter + textFormat: Text.PlainText + text: I18n.t("notificationCenter.title") + color: root.text + font.family: Style.font.family + font.pixelSize: Style.font.title + font.bold: true + } + Row { + id: headerButtons + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + spacing: Style.space(8) + HeaderButton { + glyph: "󰽥" + label: root.focusOn ? I18n.t("notificationCenter.focusOn") : I18n.t("notificationCenter.focusOff") + lit: root.focusOn + focused: root.focusIndex === 0 + onActivated: root.toggleFocus() + } + HeaderButton { + label: I18n.t("notificationCenter.clearAll") + enabled: root.groups.length > 0 + focused: root.focusIndex === 1 + onActivated: root.clearAll() + } + } + } + + Text { + visible: root.groups.length === 0 + width: parent.width + topPadding: Style.space(24) + horizontalAlignment: Text.AlignHCenter + textFormat: Text.PlainText + text: I18n.t("notificationCenter.empty") + color: root.dim + font.family: Style.font.family + font.pixelSize: Style.font.subtitle + } + + Repeater { + model: root.groups + Column { + id: groupColumn + required property var modelData + required property int index + readonly property bool open: !!root.openGroups[modelData.key] + readonly property int more: modelData.rows.length - 1 + width: listColumn.width + spacing: Style.space(8) + Repeater { + model: groupColumn.open ? groupColumn.modelData.rows : [groupColumn.modelData.rows[0]] + CenterCard { + required property var modelData + required property int index + width: groupColumn.width + entry: modelData + more: groupColumn.open ? (index === 0 ? -1 : 0) : groupColumn.more + focused: index === 0 && root.focusIndex === groupColumn.index + 2 + onOpened: root.openEntry(entry) + onSwiped: root.forgetGroup(groupColumn.modelData, groupColumn.open, entry) + onMoreToggled: root.toggleGroup(groupColumn.modelData.key) + onActionPressed: function(id) { + if (root.service && entry.live) { root.service.invokeAction(entry.key, id); root.close() } + } + } + } + } + } + } + } + } + } + + // Pushed up from its bottom edge: the handle a finger finds. + Item { + anchors.bottom: parent.bottom + width: parent.width + height: Style.space(28) + visible: root.mapped && !root.popupStyle + Rectangle { + anchors.centerIn: parent + width: Style.space(48) + height: Style.space(4) + radius: height / 2 + color: root.dim + opacity: sheet.opacity + } + DragHandler { + target: null + xAxis.enabled: false + acceptedDevices: PointerDevice.TouchScreen + enabled: root.opened || root.pulling + onActiveChanged: active ? root.beginPull() : root.endPull(centroid.velocity.y) + onTranslationChanged: if (active) root.pullTo(translation.y) + } + } + } + + // ------------------------------------------------------------ parts + + // A small outlined button of the header; lit in the accent while on. + component HeaderButton: Rectangle { + id: button + property string glyph: "" + property string label: "" + property bool lit: false + property bool focused: false + signal activated() + width: buttonRow.implicitWidth + Style.space(20) + height: Style.space(30) + color: lit ? Util.alpha(Commons.Color.accent, 0.18) : "transparent" + border.width: root.hairline + border.color: focused ? Commons.Color.accent : root.outline + opacity: enabled ? 1 : 0.45 + scale: buttonArea.pressed && buttonArea.containsMouse ? 0.96 : 1 + Row { + id: buttonRow + anchors.centerIn: parent + spacing: Style.space(6) + Text { + visible: button.glyph !== "" + anchors.verticalCenter: parent.verticalCenter + textFormat: Text.PlainText + text: button.glyph + color: button.lit ? Commons.Color.accent : root.dim + font.family: Style.font.family + font.pixelSize: Style.font.body + } + Text { + anchors.verticalCenter: parent.verticalCenter + textFormat: Text.PlainText + text: button.label + color: button.lit ? Commons.Color.accent : root.text + font.family: Style.font.family + font.pixelSize: Style.font.body + } + } + MouseArea { + id: buttonArea + anchors.fill: parent + enabled: button.enabled + preventStealing: true + onClicked: button.activated() + } + } + + // One notification: the app's icon and name, the time, a bold title, the + // body and the sender's own buttons; "n more" opens its stack. A tap opens + // it, a finger sliding it sideways clears it (kinetic, as the banners). + component CenterCard: Item { + id: card + property var entry: ({}) + property int more: 0 // >0 collapsed with more behind, -1 the head of an open stack + property bool focused: false + signal opened() + signal swiped() + signal moreToggled() + signal actionPressed(string id) + height: box.height + (more > 0 ? Style.space(6) * Math.min(2, more) : 0) + + readonly property string iconUrl: root.service ? root.service.iconFor(entry) : "" + readonly property string appName: root.service ? root.service.nameFor(entry) : "" + + // The cards behind a collapsed stack, as shapes. + Repeater { + model: card.more > 0 ? Math.min(2, card.more) : 0 + Rectangle { + required property int index + x: Style.space(8) * (index + 1) + y: box.height + Style.space(6) * index - Style.space(6) * 0 + width: card.width - Style.space(16) * (index + 1) + height: Style.space(6) + color: root.cardFill + border.width: root.hairline + border.color: root.outline + opacity: 0.8 - index * 0.25 + } + } + + property real swipeX: 0 + property real flingVelocity: 0 + property string fling: "" + Rectangle { + id: box + x: card.swipeX + width: card.width + height: column.implicitHeight + Style.space(28) + color: root.cardFill + border.width: root.focused ? Math.max(1, root.hairline) : root.hairline + border.color: card.focused ? Commons.Color.accent : root.outline + opacity: Math.max(0, 1 - Math.abs(card.swipeX) / (card.width * 0.5)) + layer.enabled: root.gpu && (card.fling !== "" || swipe.active) + + MouseArea { + anchors.fill: parent + onClicked: card.opened() + } + + Column { + id: column + x: Style.space(14) + y: Style.space(14) + width: parent.width - Style.space(28) + spacing: Style.space(6) + + Item { + width: parent.width + height: Style.space(20) + Rectangle { + id: tile + width: Style.space(20) + height: width + color: Util.alpha(Commons.Color.accent, 0.12) + Image { + anchors.centerIn: parent + width: Style.space(14) + height: width + visible: card.iconUrl !== "" + source: card.iconUrl + sourceSize.width: width * 2 + sourceSize.height: height * 2 + fillMode: Image.PreserveAspectFit + asynchronous: true + } + Text { + anchors.centerIn: parent + visible: card.iconUrl === "" + textFormat: Text.PlainText + text: String(card.entry.glyph || "") || "󰂚" + color: Commons.Color.accent + font.family: Style.font.family + font.pixelSize: Style.font.caption + } + } + Text { + anchors.left: tile.right + anchors.leftMargin: Style.space(8) + anchors.right: meta.left + anchors.rightMargin: Style.space(8) + anchors.verticalCenter: parent.verticalCenter + textFormat: Text.PlainText + text: card.appName.toUpperCase() + elide: Text.ElideRight + color: root.dim + font.family: Style.font.family + font.pixelSize: Style.font.caption + font.letterSpacing: 1 + } + Row { + id: meta + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + spacing: Style.space(8) + Text { + visible: card.more !== 0 + textFormat: Text.PlainText + text: card.more > 0 ? I18n.t("notificationCenter.more").arg(card.more) : I18n.t("notificationCenter.less") + color: Commons.Color.accent + font.family: Style.font.family + font.pixelSize: Style.font.caption + MouseArea { + anchors.fill: parent + anchors.margins: -Style.space(10) + preventStealing: true + onClicked: card.moreToggled() + } + } + Text { + textFormat: Text.PlainText + text: root.ago(card.entry.ts || 0) + color: root.dim + font.family: Style.font.family + font.pixelSize: Style.font.caption + } + } + } + + Text { + width: parent.width + textFormat: Text.PlainText + text: String(card.entry.summary || "") + color: root.text + font.family: Style.font.family + font.pixelSize: Style.font.title + font.bold: true + elide: Text.ElideRight + } + Text { + visible: text !== "" + width: parent.width + textFormat: Text.PlainText + text: String(card.entry.body || "") + color: root.dim + font.family: Style.font.family + font.pixelSize: Style.font.subtitle + wrapMode: Text.Wrap + maximumLineCount: 3 + elide: Text.ElideRight + } + + // The sender's own buttons: the first in the accent, the rest outlined. + Row { + visible: actions.length > 0 + readonly property var actions: card.entry.actions || [] + width: parent.width + spacing: Style.space(8) + topPadding: Style.space(4) + Repeater { + model: parent.actions + Rectangle { + required property var modelData + required property int index + width: (column.width - Style.space(8) * (card.entry.actions.length - 1)) / card.entry.actions.length + height: Style.space(32) + color: index === 0 ? Commons.Color.accent : "transparent" + border.width: index === 0 ? 0 : root.hairline + border.color: root.outline + scale: actionArea.pressed && actionArea.containsMouse ? 0.96 : 1 + Text { + anchors.centerIn: parent + width: parent.width - Style.space(12) + horizontalAlignment: Text.AlignHCenter + textFormat: Text.PlainText + text: String(parent.modelData.text || "") + color: parent.index === 0 ? Commons.Color.background : root.text + font.family: Style.font.family + font.pixelSize: Style.font.body + font.bold: parent.index === 0 + elide: Text.ElideRight + } + MouseArea { + id: actionArea + anchors.fill: parent + preventStealing: true + onClicked: card.actionPressed(String(parent.modelData.id)) + } + } + } + } + } + } + + // A finger slides it sideways; let go, kinetic as a banner's: thrown it + // clears, kept it springs back. + DragHandler { + id: swipe + target: null + yAxis.enabled: false + acceptedDevices: PointerDevice.TouchScreen + grabPermissions: PointerHandler.CanTakeOverFromItems | PointerHandler.CanTakeOverFromHandlersOfDifferentType + onActiveChanged: { + if (active) { card.fling = ""; return } + var v = centroid.velocity.x + var away = Math.abs(card.swipeX) > card.width * 0.35 || Math.abs(v) > Style.space(500) + if (!root.gpu) { if (away) card.swiped(); else card.swipeX = 0; return } + if (away) { + var direction = card.swipeX + v * 0.05 >= 0 ? 1 : -1 + card.flingVelocity = direction * Math.max(Math.abs(v), Style.space(900)) + card.fling = "away" + } else { + card.flingVelocity = v + card.fling = "back" + } + } + onTranslationChanged: if (active) card.swipeX = translation.x + } + FrameAnimation { + running: card.fling !== "" + onTriggered: { + var elapsed = Math.min(frameTime, 0.05) + var steps = Math.max(1, Math.ceil(elapsed / (1 / 240))) + var dt = elapsed / steps, x = card.swipeX, v = card.flingVelocity + for (var i = 0; i < steps; i++) { + if (card.fling === "away") { + v *= Math.pow(0.35, dt) + if (Math.abs(v) < Style.space(900)) v = (v < 0 ? -1 : 1) * Style.space(900) + } else { + v += (-260 * x - 2 * Math.sqrt(260) * 0.85 * v) * dt + } + x += v * dt + } + card.flingVelocity = v + card.swipeX = x + if (card.fling === "away" && Math.abs(x) >= card.width * 0.5) { card.fling = ""; card.swiped(); card.swipeX = 0 } + else if (card.fling === "back" && Math.abs(x) < 0.5 && Math.abs(v) < Style.space(10)) { card.fling = ""; card.swipeX = 0 } + } + } + } +} diff --git a/desktop/shell/shell/plugins/bar/Bar.qml b/desktop/shell/shell/plugins/bar/Bar.qml index 4ce54d96..c48ae01c 100644 --- a/desktop/shell/shell/plugins/bar/Bar.qml +++ b/desktop/shell/shell/plugins/bar/Bar.qml @@ -1858,6 +1858,26 @@ Item { // thirds will be the notification center's. Only a vertical drag takes // the touch from the icons under it: a tap still reaches them. The // touch stays this surface's while the finger moves down the screen. + // The left two thirds: the notification center, the same way. + Item { + width: parent.width * 2 / 3 + height: parent.height + visible: root.position === "top" && !!root.shell && !!root.shell.notificationCenter + + DragHandler { + target: null + xAxis.enabled: false + acceptedDevices: PointerDevice.TouchScreen + grabPermissions: PointerHandler.CanTakeOverFromItems | PointerHandler.CanTakeOverFromHandlersOfDifferentType + readonly property var center: root.shell ? root.shell.notificationCenter : null + onActiveChanged: { + if (!center) return + if (active) center.beginPull() + else center.endPull(centroid.velocity.y) + } + onTranslationChanged: if (active && center) center.pullTo(translation.y) + } + } Item { x: parent.width * 2 / 3 width: parent.width - x diff --git a/desktop/shell/shell/plugins/notifications/Service.qml b/desktop/shell/shell/plugins/notifications/Service.qml index 954d5743..16e32857 100644 --- a/desktop/shell/shell/plugins/notifications/Service.qml +++ b/desktop/shell/shell/plugins/notifications/Service.qml @@ -125,7 +125,8 @@ Item { // pauses meanwhile (they take the keyboard; its text and the on-screen // keyboard stay) and goes on once they close. readonly property bool shellCovered: !!shell - && ((shell.controlCenter && shell.controlCenter.mapped) || (shell.launcher && shell.launcher.mapped)) + && ((shell.controlCenter && shell.controlCenter.mapped) || (shell.launcher && shell.launcher.mapped) + || (shell.notificationCenter && shell.notificationCenter.mapped)) property bool replyPaused: false onShellCoveredChanged: { if (shellCovered && replying) { replyPaused = true; replying = false } @@ -1390,6 +1391,101 @@ Item { return kept } + // ------------------------------------------------------- notification center + // + // Orchard: what the notification center (SHELL-SPEC, step 3) lists: the + // cards on screen and the history behind them, newest first, grouped by + // app. A notification opened (activated) or withdrawn by its sender is + // done with; one that timed out, was swiped away or replaced by a newer + // banner stays until it is cleared here. + readonly property var centerDone: ({ activated: true, closed: true, cleared: true }) + // Bumped by everything the list depends on; the center binds to it. + readonly property int centerRevision: toasts.count + historyEntries.length * 1000 + refsRevision * 1000000 + function centerEntries() { + var out = [], seen = {} + for (var i = 0; i < toasts.count; i++) { + var live = toasts.get(i) + var key = String(live.key) + if (leaving[key] || key.indexOf("placeholder") === 0) continue + seen[key] = true + out.push({ key: key, live: true, app: String(live.app || ""), appIcon: String(live.appIcon || ""), + glyph: String(live.glyph || ""), source: String(live.source || ""), + summary: String(live.summary || ""), body: String(live.body || ""), + groupKey: String(live.groupKey || live.app || ""), ts: Number(live.ts || 0), + actions: senderActions(refs[key]) }) + } + var history = currentHistory() + for (var h = 0; h < history.length; h++) { + var e = history[h] + if (seen[e.key] || centerDone[e.closed_reason]) continue + seen[e.key] = true + out.push({ key: String(e.key), live: false, app: String(e.app || ""), appIcon: String(e.appIcon || ""), + glyph: String(e.glyph || ""), source: String(e.source || ""), + summary: String(e.summary || ""), body: String(e.body || ""), + groupKey: String(e.groupKey || e.app || ""), ts: Number(e.ts || 0), actions: [] }) + } + out.sort(function(a, b) { return b.ts - a.ts }) + return out + } + function centerGroups() { + var entries = centerEntries(), groups = [], at = {} + for (var i = 0; i < entries.length; i++) { + var g = entries[i].groupKey + if (at[g] === undefined) { at[g] = groups.length; groups.push({ key: g, rows: [] }) } + groups[at[g]].rows.push(entries[i]) + } + return groups + } + // An entry gone from the center: a card on screen closes, a history entry + // is forgotten. + function forgetEntry(key) { + if (rowIndexFor(key) >= 0) closeToast(key, "cleared") + var kept = historyEntries.filter(function(e) { return e.key !== key }) + if (kept.length !== historyEntries.length) { historyEntries = kept; saveSoon("history") } + } + function clearCenter() { + clearAll("cleared", true) + historyEntries = [] + saveSoon("history") + } + // A tap: a card on screen as on screen; a history entry has no sender left, + // so its app's window, else the app. + function openEntry(entry) { + if (entry.live && rowIndexFor(entry.key) >= 0) { activate(entry.key); return } + var app = String(entry.app || entry.source || "") + if (!app) return + if (usingHyprland) { Util.execArgv(["omarchy-hyprland-focus-app", app]); return } + if (service.shell && service.shell.appLibrary && service.shell.appLibrary.focusToplevel(app)) return + var desktop = DesktopEntries.heuristicLookup(app) + if (desktop) desktop.execute() + } + // The app's name for a center card: its desktop entry's, else what it sent. + function nameFor(entry) { + var app = String(entry.app || entry.source || "") + if (!app || app === "notify-send" || app === "omarchy-action") return "" + var want = Icons.candidates(entry) + for (var i = 0; i < want.entries.length; i++) { + var desktop = DesktopEntries.heuristicLookup(want.entries[i]) + if (desktop && String(desktop.name || "")) return String(desktop.name) + } + return app + } + + // The app's icon for a center card, as the cards find theirs. + function iconFor(entry) { + var want = Icons.candidates(entry) + for (var i = 0; i < want.themed.length; i++) { + var found = Quickshell.iconPath(want.themed[i], true) + if (found) return found + } + for (var j = 0; j < want.entries.length; j++) { + var desktop = DesktopEntries.heuristicLookup(want.entries[j]) + var icon = desktop ? String(desktop.icon || "") : "" + if (icon) return icon.charAt(0) === "/" ? Util.fileUrl(icon) : Quickshell.iconPath(icon, true) + } + return "" + } + function saveSoon(file) { unsaved[file] = true if (!saveTimer.running) saveTimer.start() @@ -1687,7 +1783,9 @@ Item { readonly property var margins: service.marginsFor(String(modelData.name)) readonly property bool stepAside: service.fullscreenOn(String(modelData.name)) readonly property bool hasSomethingToShow: showingNotifications && toasts.count > 0 - visible: !stepAside || hasSomethingToShow + // Under the open notification center no banner shows: it is listed there. + readonly property bool centerOpen: !!service.shell && !!service.shell.notificationCenter && service.shell.notificationCenter.mapped + visible: (!stepAside || hasSomethingToShow) && !centerOpen color: "transparent" WlrLayershell.namespace: "omarchy-notifications" diff --git a/desktop/shell/shell/plugins/panels/clock/BarWidget.qml b/desktop/shell/shell/plugins/panels/clock/BarWidget.qml index 2a531fb3..d4c623c5 100644 --- a/desktop/shell/shell/plugins/panels/clock/BarWidget.qml +++ b/desktop/shell/shell/plugins/panels/clock/BarWidget.qml @@ -170,6 +170,9 @@ BarWidget { onPressed: function(b) { if (b === Qt.RightButton) root.cycleFormat() else if (b === Qt.MiddleButton) { if (root.bar) root.bar.run("omarchy-menu-timezone") } + // Orchard: the date and time open the notification center (SHELL-SPEC, + // step 3); upstream's calendar panel stays where there is none. + else if (root.bar && root.bar.shell && root.bar.shell.notificationCenter) root.bar.shell.notificationCenter.togglePopup() else root.togglePanel() } diff --git a/desktop/shell/shell/shell.qml b/desktop/shell/shell/shell.qml index 4235da59..11763778 100644 --- a/desktop/shell/shell/shell.qml +++ b/desktop/shell/shell/shell.qml @@ -11,6 +11,7 @@ import qs.Commons as Commons import "plugins/bar" import "launcher" import "controlcenter" +import "notificationcenter" import "services" import "services/AuthServiceStore.js" as AuthServiceStore @@ -31,8 +32,10 @@ ShellRoot { Launcher { id: appGrid; shell: shell; appLibrary: shell.appLibrary } // Orchard: the control center (`omarchy-shell omarchy.controlcenter toggle`). ControlCenter { id: controlCenter; shell: shell } + NotificationCenter { id: notificationCenter; shell: shell } // The bar pulls it down from the top edge's right third (Bar.qml). readonly property var controlCenter: controlCenter + readonly property var notificationCenter: notificationCenter readonly property var launcher: appGrid ShellIpc { target: "omarchy.dock" From 6202a2e756b35bd40d7962abf99a0c8bc6d9608c Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Fri, 20 Nov 2026 09:07:31 +0800 Subject: [PATCH 02/16] Notification center: compact in portrait, opaque, scrolls; bottom swipe closes - Portrait and a phone: Today is one row over the notifications (the clock and the date at the left, the weather at the right) instead of a large clock taking the top of the screen; landscape keeps its column. - The background is the theme's, opaque: a translucent dark over the wallpaper only muddied it. - A quick swipe in a long list scrolls it: the background's push-up closed the center instead, taking the swipe from the list, and often caught a swipe down too. It only applies while there is nothing to scroll; the handle, Home and Escape always close. - Stacks open closed again, and the list starts at the top, each time. - A swipe up from the bottom edge puts the notification center, or the control center, away instead of opening the keyboard over it (omarchy-bottom-swipe as labwc's bottomSwipeCommand, with a migration for an existing rc.xml). Assisted-by: LLM --- desktop/shell/bin/omarchy-bottom-swipe | 16 ++ desktop/shell/labwc-rc.xml | 2 +- desktop/shell/migrations/1795136700.sh | 12 ++ .../notificationcenter/NotificationCenter.qml | 169 +++++++++++------- 4 files changed, 131 insertions(+), 68 deletions(-) create mode 100755 desktop/shell/bin/omarchy-bottom-swipe create mode 100644 desktop/shell/migrations/1795136700.sh diff --git a/desktop/shell/bin/omarchy-bottom-swipe b/desktop/shell/bin/omarchy-bottom-swipe new file mode 100755 index 00000000..1f0a5cdd --- /dev/null +++ b/desktop/shell/bin/omarchy-bottom-swipe @@ -0,0 +1,16 @@ +#!/bin/bash + +# omarchy:summary=A swipe up from the screen's bottom edge: put the notification center or the control center away, else open the on-screen keyboard +# omarchy:hidden=true + +# labwc runs this for the bottom-edge swipe (bottomSwipeCommand). Over the +# shell's own sheets the swipe dismisses them, as it does on a phone; over +# an app it brings the keyboard up. +runtime="${XDG_RUNTIME_DIR:-/run/user/$UID}" +if [[ -e $runtime/omarchy-notification-center-open ]]; then + exec omarchy-shell omarchy.notificationcenter close +fi +if [[ -e $runtime/omarchy-control-center-open ]]; then + exec omarchy-shell omarchy.controlcenter close +fi +exec omarchy-keyboard show diff --git a/desktop/shell/labwc-rc.xml b/desktop/shell/labwc-rc.xml index 895255c3..49412f65 100644 --- a/desktop/shell/labwc-rc.xml +++ b/desktop/shell/labwc-rc.xml @@ -183,7 +183,7 @@ diff --git a/desktop/shell/migrations/1795136700.sh b/desktop/shell/migrations/1795136700.sh new file mode 100644 index 00000000..0a9122d5 --- /dev/null +++ b/desktop/shell/migrations/1795136700.sh @@ -0,0 +1,12 @@ +echo "A swipe up from the bottom puts the notification center away" + +# labwc's bottom-edge swipe ran omarchy-keyboard show; omarchy-bottom-swipe +# puts the notification center or the control center away first, else +# opens the keyboard as before. +rc="$HOME/.config/labwc/rc.xml" +if [[ -f $rc ]] && grep -q 'bottomSwipeCommand="omarchy-keyboard show"' "$rc"; then + sed 's/bottomSwipeCommand="omarchy-keyboard show"/bottomSwipeCommand="omarchy-bottom-swipe"/' "$rc" > "$rc.new" + mv -- "$rc.new" "$rc" + labwc=${LABWC_PID:-$(pgrep -u "$(id -u)" -x labwc | head -1 || true)} + [[ -z $labwc ]] || kill -HUP "$labwc" +fi diff --git a/desktop/shell/shell/notificationcenter/NotificationCenter.qml b/desktop/shell/shell/notificationcenter/NotificationCenter.qml index 4b04b84e..99bd1c84 100644 --- a/desktop/shell/shell/notificationcenter/NotificationCenter.qml +++ b/desktop/shell/shell/notificationcenter/NotificationCenter.qml @@ -154,6 +154,9 @@ Item { function show() { root.clearOthers() root.everOpened = true + // Stacks open closed again, and the list starts at the top. + root.openGroups = ({}) + scroller.contentY = 0 root.focusIndex = -1 root.opened = true root.mapped = true @@ -239,6 +242,8 @@ Item { if (!root.opened) { root.clearOthers() root.everOpened = true + root.openGroups = ({}) + scroller.contentY = 0 root.reveal = 0 root.mapped = true } @@ -364,10 +369,9 @@ Item { y: root.barInset width: parent.width height: parent.height - y - // Dark enough that the cards read as the page (the design's), the - // wallpaper only a hint behind; a phone's is the opaque sheet. - readonly property color base: Commons.Color.menu.background - color: root.phone ? base : Qt.rgba(base.r, base.g, base.b, 0.88) + // Opaque, the theme's background: a translucent dark over the + // wallpaper only muddies it, and the cards read as the page. + color: Commons.Color.menu.background opacity: !root.gpu ? (root.reveal > 0 ? 1 : 0) : root.leaving ? sheet.opacity : 1 - Math.pow(1 - Math.max(0, Math.min(1, root.reveal)), 2.5) @@ -376,12 +380,14 @@ Item { acceptedButtons: Qt.LeftButton | Qt.RightButton onClicked: root.close() } - // Pushed up on the empty screen, it follows and goes away. + // Pushed up on the empty screen, it follows and goes away; only while + // there is nothing to scroll, or it would take a scroll's swipe and + // close instead (the handle at the bottom, Home and Escape always do). DragHandler { target: null xAxis.enabled: false acceptedDevices: PointerDevice.TouchScreen - enabled: root.opened || root.pulling + enabled: (root.opened || root.pulling) && !scroller.interactive onActiveChanged: active ? root.beginPull() : root.endPull(centroid.velocity.y) onTranslationChanged: if (active) root.pullTo(translation.y) } @@ -436,89 +442,74 @@ Item { Item { id: content width: scroller.width - height: Math.max(todayColumn.y + todayColumn.height, listColumn.y + listColumn.height) + Style.space(root.phone ? 24 : 40) + height: Math.max(root.wide ? todayColumn.y + todayColumn.height : 0, listColumn.y + listColumn.height) + Style.space(root.phone ? 24 : 40) // ---- Today + // Landscape: a column of its own at the left, the clock large. + // Portrait and a phone: one row over the notifications, the clock + // and the date at the left and the weather at the right, so the + // notifications start near the top. Column { id: todayColumn + visible: root.wide x: root.margin - y: Style.space(root.phone ? 24 : 40) + y: Style.space(40) width: root.todayWidth - spacing: Style.space(root.phone ? 6 : 8) + height: root.wide ? implicitHeight : todayRow.height + spacing: Style.space(8) - // A phone: the date over a centred clock, as its lock does. - Text { - visible: root.phone - width: parent.width - horizontalAlignment: Text.AlignHCenter - textFormat: Text.PlainText - text: Qt.locale(I18n.formatLocale).toString(new Date(root.now), "dddd, d MMMM") - color: root.dim - font.family: Style.font.family - font.pixelSize: Style.font.subtitle - } Text { - width: parent.width - horizontalAlignment: root.phone ? Text.AlignHCenter : Text.AlignLeft textFormat: Text.PlainText text: Qt.locale(I18n.formatLocale).toString(new Date(root.now), "HH:mm") color: root.text font.family: Style.font.family - font.pixelSize: Style.space(root.phone ? 60 : 72) + font.pixelSize: Style.space(72) font.bold: true } Text { - visible: !root.phone textFormat: Text.PlainText text: Qt.locale(I18n.formatLocale).toString(new Date(root.now), "dddd, d MMMM") color: root.text font.family: Style.font.family font.pixelSize: Style.font.subtitle } - Item { width: 1; height: Style.space(root.phone ? 10 : 16); visible: root.hasWeather } + Item { width: 1; height: Style.space(16); visible: root.hasWeather } + WeatherCard { width: parent.width; visible: root.hasWeather } + } - // The weather, as the weather panel reads it. - Rectangle { - visible: root.hasWeather - width: parent.width - height: weatherRow.implicitHeight + Style.space(24) - color: root.cardFill - border.width: root.hairline - border.color: root.outline - Row { - id: weatherRow - x: Style.space(14) - anchors.verticalCenter: parent.verticalCenter - spacing: Style.space(12) - Text { - anchors.verticalCenter: parent.verticalCenter - textFormat: Text.PlainText - text: root.weather ? root.weather.label : "" - color: Commons.Color.accent - font.family: Style.font.family - font.pixelSize: Style.font.displayLarge - } - Column { - anchors.verticalCenter: parent.verticalCenter - spacing: Style.space(2) - Text { - textFormat: Text.PlainText - text: root.weather ? root.weather.reportTempNum + root.weather.tempUnit : "" - color: root.text - font.family: Style.font.family - font.pixelSize: Style.font.title - font.bold: true - } - Text { - textFormat: Text.PlainText - text: [root.weatherHighLow, root.weather ? root.weather.reportLocation : ""] - .filter(function(part) { return part !== "" }).join(" · ") - color: root.dim - font.family: Style.font.family - font.pixelSize: Style.font.caption - } - } + Item { + id: todayRow + visible: !root.wide + x: root.margin + y: Style.space(root.phone ? 16 : 28) + width: root.screenWidth - root.margin * 2 + height: Math.max(clockBlock.implicitHeight, compactWeather.visible ? compactWeather.height : 0) + Column { + id: clockBlock + anchors.verticalCenter: parent.verticalCenter + spacing: Style.space(2) + Text { + textFormat: Text.PlainText + text: Qt.locale(I18n.formatLocale).toString(new Date(root.now), "HH:mm") + color: root.text + font.family: Style.font.family + font.pixelSize: Style.space(root.phone ? 34 : 40) + font.bold: true } + Text { + textFormat: Text.PlainText + text: Qt.locale(I18n.formatLocale).toString(new Date(root.now), "dddd, d MMMM") + color: root.dim + font.family: Style.font.family + font.pixelSize: Style.font.body + } + } + WeatherCard { + id: compactWeather + visible: root.hasWeather + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + width: Math.min(implicitWidth, parent.width - clockBlock.implicitWidth - Style.space(16)) } } @@ -526,7 +517,7 @@ Item { Column { id: listColumn x: root.wide ? root.screenWidth - root.margin - root.listWidth : root.margin - y: root.wide ? Style.space(40) : todayColumn.y + todayColumn.height + Style.space(root.phone ? 28 : 40) + y: root.wide ? Style.space(40) : todayRow.y + todayRow.height + Style.space(root.phone ? 20 : 28) width: root.listWidth spacing: Style.space(12) @@ -638,6 +629,50 @@ Item { // ------------------------------------------------------------ parts + // The weather, as the weather panel reads it. + component WeatherCard: Rectangle { + implicitWidth: weatherRow.implicitWidth + Style.space(28) + height: weatherRow.implicitHeight + Style.space(20) + color: root.cardFill + border.width: root.hairline + border.color: root.outline + clip: true + Row { + id: weatherRow + x: Style.space(14) + anchors.verticalCenter: parent.verticalCenter + spacing: Style.space(12) + Text { + anchors.verticalCenter: parent.verticalCenter + textFormat: Text.PlainText + text: root.weather ? root.weather.label : "" + color: Commons.Color.accent + font.family: Style.font.family + font.pixelSize: Style.font.displayLarge + } + Column { + anchors.verticalCenter: parent.verticalCenter + spacing: Style.space(2) + Text { + textFormat: Text.PlainText + text: root.weather ? root.weather.reportTempNum + root.weather.tempUnit : "" + color: root.text + font.family: Style.font.family + font.pixelSize: Style.font.title + font.bold: true + } + Text { + textFormat: Text.PlainText + text: [root.weatherHighLow, root.weather ? root.weather.reportLocation : ""] + .filter(function(part) { return part !== "" }).join(" · ") + color: root.dim + font.family: Style.font.family + font.pixelSize: Style.font.caption + } + } + } + } + // A small outlined button of the header; lit in the accent while on. component HeaderButton: Rectangle { id: button From 61b96cd2b4d68c69cf9fe3a56004564ba055500d Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Fri, 20 Nov 2026 09:08:36 +0800 Subject: [PATCH 03/16] Notification center: the lock screen's scrim over the wallpaper Opaque, the wallpaper was gone. It has the lock screen's scrim: even, the theme's lock scrim, taken toward black on a dark theme so it does not grey the wallpaper to mud. Assisted-by: LLM --- .../shell/notificationcenter/NotificationCenter.qml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/desktop/shell/shell/notificationcenter/NotificationCenter.qml b/desktop/shell/shell/notificationcenter/NotificationCenter.qml index 99bd1c84..db90e000 100644 --- a/desktop/shell/shell/notificationcenter/NotificationCenter.qml +++ b/desktop/shell/shell/notificationcenter/NotificationCenter.qml @@ -369,9 +369,12 @@ Item { y: root.barInset width: parent.width height: parent.height - y - // Opaque, the theme's background: a translucent dark over the - // wallpaper only muddies it, and the cards read as the page. - color: Commons.Color.menu.background + // The lock screen's scrim: even, the theme's lock scrim, and on a dark + // theme taken toward black so it does not grey the wallpaper to mud. + // The wallpaper stays a hint behind the cards. + readonly property color lockScrim: Commons.Color.lock.scrim + readonly property bool darkTheme: (0.2126 * lockScrim.r + 0.7152 * lockScrim.g + 0.0722 * lockScrim.b) < 0.5 + color: darkTheme ? Qt.rgba(lockScrim.r * 0.42, lockScrim.g * 0.42, lockScrim.b * 0.42, lockScrim.a) : lockScrim opacity: !root.gpu ? (root.reveal > 0 ? 1 : 0) : root.leaving ? sheet.opacity : 1 - Math.pow(1 - Math.max(0, Math.min(1, root.reveal)), 2.5) From c5a37e8f4049e9a2bcb4721fa515bdd726f85e7d Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Fri, 20 Nov 2026 09:13:10 +0800 Subject: [PATCH 04/16] Notification center: cards as banners; stacks open with a transition - A card is laid out as a banner: the app's icon at the left, a bold title with the time at its end, the body, the sender's buttons under the text, and the app's name only when there is no icon. "n more" sits on the title line. - Opening a stack, its cards slide out from under its head and fade in while what follows moves down with them, and closing reverses it (300 ms, at once in software); the shapes behind a closed stack fade as it opens. Its other cards are built only while they show. Assisted-by: LLM --- .../notificationcenter/NotificationCenter.qml | 258 +++++++++++------- 1 file changed, 154 insertions(+), 104 deletions(-) diff --git a/desktop/shell/shell/notificationcenter/NotificationCenter.qml b/desktop/shell/shell/notificationcenter/NotificationCenter.qml index db90e000..21965c35 100644 --- a/desktop/shell/shell/notificationcenter/NotificationCenter.qml +++ b/desktop/shell/shell/notificationcenter/NotificationCenter.qml @@ -573,28 +573,67 @@ Item { Repeater { model: root.groups - Column { + Item { id: groupColumn required property var modelData required property int index readonly property bool open: !!root.openGroups[modelData.key] readonly property int more: modelData.rows.length - 1 + // 0 closed, 1 open: the stack's cards slide out from under its + // head and fade in, what follows moving down with them. + property real openness: open ? 1 : 0 + Behavior on openness { + enabled: root.gpu + NumberAnimation { duration: Style.duration(300); easing.type: Easing.InOutCubic } + } width: listColumn.width - spacing: Style.space(8) - Repeater { - model: groupColumn.open ? groupColumn.modelData.rows : [groupColumn.modelData.rows[0]] - CenterCard { - required property var modelData - required property int index + height: head.height + (rest.active && rest.item ? rest.item.height : 0) + + CenterCard { + id: head + z: 1 + width: groupColumn.width + entry: groupColumn.modelData.rows[0] + more: groupColumn.open ? -1 : groupColumn.more + shade: groupColumn.open ? 0 : 1 - groupColumn.openness + focused: root.focusIndex === groupColumn.index + 2 + onOpened: root.openEntry(entry) + onSwiped: root.forgetGroup(groupColumn.modelData, groupColumn.open, entry) + onMoreToggled: root.toggleGroup(groupColumn.modelData.key) + onActionPressed: function(id) { + if (root.service && entry.live) { root.service.invokeAction(entry.key, id); root.close() } + } + } + // The rest of the stack, built only while it shows. + Loader { + id: rest + active: groupColumn.more > 0 && (groupColumn.open || groupColumn.openness > 0) + y: head.height + width: groupColumn.width + sourceComponent: Column { width: groupColumn.width - entry: modelData - more: groupColumn.open ? (index === 0 ? -1 : 0) : groupColumn.more - focused: index === 0 && root.focusIndex === groupColumn.index + 2 - onOpened: root.openEntry(entry) - onSwiped: root.forgetGroup(groupColumn.modelData, groupColumn.open, entry) - onMoreToggled: root.toggleGroup(groupColumn.modelData.key) - onActionPressed: function(id) { - if (root.service && entry.live) { root.service.invokeAction(entry.key, id); root.close() } + topPadding: Style.space(8) * groupColumn.openness + spacing: Style.space(8) * groupColumn.openness + opacity: groupColumn.openness + Repeater { + model: groupColumn.modelData.rows.slice(1) + Item { + required property var modelData + width: groupColumn.width + height: restCard.height * groupColumn.openness + CenterCard { + id: restCard + width: parent.width + // From under the head: each card starts higher up. + y: -(1 - groupColumn.openness) * height + entry: parent.modelData + onOpened: root.openEntry(entry) + onSwiped: root.forgetGroup(groupColumn.modelData, true, entry) + onActionPressed: function(id) { + if (root.service && entry.live) { root.service.invokeAction(entry.key, id); root.close() } + } + } + } } } } @@ -722,36 +761,44 @@ Item { } } - // One notification: the app's icon and name, the time, a bold title, the - // body and the sender's own buttons; "n more" opens its stack. A tap opens - // it, a finger sliding it sideways clears it (kinetic, as the banners). + // One notification, laid out as a banner: the app's icon at the left, a + // bold title with the time at its end, the body, the sender's own buttons + // under the text; the app's name only when there is no icon. "n more" + // opens its stack. A tap opens it, a finger sliding it sideways clears it + // (kinetic, as the banners). component CenterCard: Item { id: card property var entry: ({}) - property int more: 0 // >0 collapsed with more behind, -1 the head of an open stack + property int more: 0 // >0 the head of a stack (closed), -1 the head of an open one + // How much of a closed stack's shapes behind it shows (1 closed, 0 open). + property real shade: 1 property bool focused: false signal opened() signal swiped() signal moreToggled() signal actionPressed(string id) - height: box.height + (more > 0 ? Style.space(6) * Math.min(2, more) : 0) + readonly property int shapes: more > 0 ? Math.min(2, more) : 0 + height: box.height + Style.space(6) * shapes * shade readonly property string iconUrl: root.service ? root.service.iconFor(entry) : "" + readonly property string glyph: String(entry.glyph || "") + readonly property bool hasIcon: iconUrl !== "" || glyph !== "" readonly property string appName: root.service ? root.service.nameFor(entry) : "" + readonly property real iconSize: root.phone ? Style.space(36) : Style.space(40) - // The cards behind a collapsed stack, as shapes. + // The cards behind a closed stack, as shapes; they fade as it opens. Repeater { - model: card.more > 0 ? Math.min(2, card.more) : 0 + model: card.shapes Rectangle { required property int index x: Style.space(8) * (index + 1) - y: box.height + Style.space(6) * index - Style.space(6) * 0 + y: box.height + Style.space(6) * index * card.shade width: card.width - Style.space(16) * (index + 1) height: Style.space(6) color: root.cardFill border.width: root.hairline border.color: root.outline - opacity: 0.8 - index * 0.25 + opacity: (0.8 - index * 0.25) * card.shade } } @@ -762,7 +809,7 @@ Item { id: box x: card.swipeX width: card.width - height: column.implicitHeight + Style.space(28) + height: content.implicitHeight + Style.space(24) color: root.cardFill border.width: root.focused ? Math.max(1, root.hairline) : root.hairline border.color: card.focused ? Commons.Color.accent : root.outline @@ -775,24 +822,23 @@ Item { } Column { - id: column - x: Style.space(14) - y: Style.space(14) - width: parent.width - Style.space(28) - spacing: Style.space(6) + id: content + x: Style.space(12) + y: Style.space(12) + width: parent.width - Style.space(26) + spacing: Style.space(10) - Item { + Row { width: parent.width - height: Style.space(20) - Rectangle { - id: tile - width: Style.space(20) + spacing: Style.space(12) + + Item { + id: icon + width: card.hasIcon ? card.iconSize : 0 height: width - color: Util.alpha(Commons.Color.accent, 0.12) + visible: card.hasIcon Image { - anchors.centerIn: parent - width: Style.space(14) - height: width + anchors.fill: parent visible: card.iconUrl !== "" source: card.iconUrl sourceSize.width: width * 2 @@ -802,93 +848,97 @@ Item { } Text { anchors.centerIn: parent - visible: card.iconUrl === "" + visible: card.iconUrl === "" && card.glyph !== "" textFormat: Text.PlainText - text: String(card.entry.glyph || "") || "󰂚" - color: Commons.Color.accent + text: card.glyph + color: root.text font.family: Style.font.family - font.pixelSize: Style.font.caption + font.pixelSize: Style.font.displayLarge } } - Text { - anchors.left: tile.right - anchors.leftMargin: Style.space(8) - anchors.right: meta.left - anchors.rightMargin: Style.space(8) - anchors.verticalCenter: parent.verticalCenter - textFormat: Text.PlainText - text: card.appName.toUpperCase() - elide: Text.ElideRight - color: root.dim - font.family: Style.font.family - font.pixelSize: Style.font.caption - font.letterSpacing: 1 - } - Row { - id: meta - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - spacing: Style.space(8) - Text { - visible: card.more !== 0 - textFormat: Text.PlainText - text: card.more > 0 ? I18n.t("notificationCenter.more").arg(card.more) : I18n.t("notificationCenter.less") - color: Commons.Color.accent - font.family: Style.font.family - font.pixelSize: Style.font.caption - MouseArea { - anchors.fill: parent - anchors.margins: -Style.space(10) - preventStealing: true - onClicked: card.moreToggled() + + Column { + width: parent.width - (icon.visible ? icon.width + parent.spacing : 0) + spacing: Style.space(3) + + Item { + width: parent.width + height: title.implicitHeight + Text { + id: title + width: parent.width - meta.width - Style.space(8) + textFormat: Text.PlainText + text: String(card.entry.summary || "") + color: root.text + font.family: Style.font.family + font.pixelSize: Style.font.title + font.bold: true + elide: Text.ElideRight + } + Row { + id: meta + anchors.right: parent.right + anchors.verticalCenter: title.verticalCenter + spacing: Style.space(8) + Text { + visible: !card.hasIcon && card.appName !== "" + textFormat: Text.PlainText + text: card.appName + color: root.dim + font.family: Style.font.family + font.pixelSize: Style.font.caption + } + Text { + visible: card.more !== 0 + textFormat: Text.PlainText + text: card.more > 0 ? I18n.t("notificationCenter.more").arg(card.more) : I18n.t("notificationCenter.less") + color: Commons.Color.accent + font.family: Style.font.family + font.pixelSize: Style.font.caption + MouseArea { + anchors.fill: parent + anchors.margins: -Style.space(10) + preventStealing: true + onClicked: card.moreToggled() + } + } + Text { + textFormat: Text.PlainText + text: root.ago(card.entry.ts || 0) + color: root.dim + font.family: Style.font.family + font.pixelSize: Style.font.caption + } } } Text { + visible: text !== "" + width: parent.width textFormat: Text.PlainText - text: root.ago(card.entry.ts || 0) + text: String(card.entry.body || "") color: root.dim font.family: Style.font.family - font.pixelSize: Style.font.caption + font.pixelSize: Style.font.subtitle + wrapMode: Text.Wrap + maximumLineCount: 3 + elide: Text.ElideRight } } } - Text { - width: parent.width - textFormat: Text.PlainText - text: String(card.entry.summary || "") - color: root.text - font.family: Style.font.family - font.pixelSize: Style.font.title - font.bold: true - elide: Text.ElideRight - } - Text { - visible: text !== "" - width: parent.width - textFormat: Text.PlainText - text: String(card.entry.body || "") - color: root.dim - font.family: Style.font.family - font.pixelSize: Style.font.subtitle - wrapMode: Text.Wrap - maximumLineCount: 3 - elide: Text.ElideRight - } - - // The sender's own buttons: the first in the accent, the rest outlined. + // The sender's own buttons under the text: the first in the accent. Row { - visible: actions.length > 0 readonly property var actions: card.entry.actions || [] - width: parent.width + visible: actions.length > 0 + x: icon.visible ? icon.width + Style.space(12) : 0 + width: parent.width - x spacing: Style.space(8) - topPadding: Style.space(4) Repeater { model: parent.actions Rectangle { required property var modelData required property int index - width: (column.width - Style.space(8) * (card.entry.actions.length - 1)) / card.entry.actions.length + width: (parent.width - Style.space(8) * (card.entry.actions.length - 1)) / card.entry.actions.length height: Style.space(32) color: index === 0 ? Commons.Color.accent : "transparent" border.width: index === 0 ? 0 : root.hairline From 714e36ce85a65f05844b2ca7c91dee5344e759f6 Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Fri, 20 Nov 2026 09:14:41 +0800 Subject: [PATCH 05/16] Notification center: a stack's shapes fade with its opening Opening a stack dropped the shapes behind its head at once (their count followed the open state); they fade and fold away with the opening and come back with the closing. Assisted-by: LLM --- .../shell/shell/notificationcenter/NotificationCenter.qml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/desktop/shell/shell/notificationcenter/NotificationCenter.qml b/desktop/shell/shell/notificationcenter/NotificationCenter.qml index 21965c35..a01dc4ef 100644 --- a/desktop/shell/shell/notificationcenter/NotificationCenter.qml +++ b/desktop/shell/shell/notificationcenter/NotificationCenter.qml @@ -595,7 +595,9 @@ Item { width: groupColumn.width entry: groupColumn.modelData.rows[0] more: groupColumn.open ? -1 : groupColumn.more - shade: groupColumn.open ? 0 : 1 - groupColumn.openness + // The shapes fade and fold away with the opening, not at once. + stacked: groupColumn.more + shade: 1 - groupColumn.openness focused: root.focusIndex === groupColumn.index + 2 onOpened: root.openEntry(entry) onSwiped: root.forgetGroup(groupColumn.modelData, groupColumn.open, entry) @@ -770,6 +772,8 @@ Item { id: card property var entry: ({}) property int more: 0 // >0 the head of a stack (closed), -1 the head of an open one + // How many cards it heads (its shapes stay while they fade out). + property int stacked: more > 0 ? more : 0 // How much of a closed stack's shapes behind it shows (1 closed, 0 open). property real shade: 1 property bool focused: false @@ -777,7 +781,7 @@ Item { signal swiped() signal moreToggled() signal actionPressed(string id) - readonly property int shapes: more > 0 ? Math.min(2, more) : 0 + readonly property int shapes: Math.min(2, stacked) height: box.height + Style.space(6) * shapes * shade readonly property string iconUrl: root.service ? root.service.iconFor(entry) : "" From 0625566153a6c3d8383efa641b2af1966bc79d16 Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Fri, 20 Nov 2026 09:18:33 +0800 Subject: [PATCH 06/16] Notification center: the bottom swipe is its drag; one line under a stack - labwc leaves the bottom-edge swipe to the notification center and the control center (bottomSwipeIgnoreNamespace lists them beside the keyboard, labwc's 0009; with a migration for an existing rc.xml): a swipe up from the bottom follows the finger and closes on release, instead of the gesture's command closing it at once mid-touch. - The shapes behind a closed stack lie behind the card above and reach up under it: their outlines met the card's on one row of pixels and added up to a brighter line. Needs labwc 1:0.20.2-6 (OrchardLinux/packages, 0009). Assisted-by: LLM --- desktop/shell/bin/omarchy-bottom-swipe | 6 ++++-- desktop/shell/labwc-rc.xml | 6 +++++- desktop/shell/migrations/1795137309.sh | 12 ++++++++++++ .../shell/notificationcenter/NotificationCenter.qml | 9 +++++++-- 4 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 desktop/shell/migrations/1795137309.sh diff --git a/desktop/shell/bin/omarchy-bottom-swipe b/desktop/shell/bin/omarchy-bottom-swipe index 1f0a5cdd..3d4cbb06 100755 --- a/desktop/shell/bin/omarchy-bottom-swipe +++ b/desktop/shell/bin/omarchy-bottom-swipe @@ -4,8 +4,10 @@ # omarchy:hidden=true # labwc runs this for the bottom-edge swipe (bottomSwipeCommand). Over the -# shell's own sheets the swipe dismisses them, as it does on a phone; over -# an app it brings the keyboard up. +# notification center and the control center labwc leaves the swipe to +# them (bottomSwipeIgnoreNamespace), so it follows the finger; should it +# still come here over one (an older labwc), it puts that one away. Over an +# app it brings the keyboard up. runtime="${XDG_RUNTIME_DIR:-/run/user/$UID}" if [[ -e $runtime/omarchy-notification-center-open ]]; then exec omarchy-shell omarchy.notificationcenter close diff --git a/desktop/shell/labwc-rc.xml b/desktop/shell/labwc-rc.xml index 49412f65..d901c760 100644 --- a/desktop/shell/labwc-rc.xml +++ b/desktop/shell/labwc-rc.xml @@ -182,9 +182,13 @@ + + bottomSwipeIgnoreNamespace="wvkbd,omarchy-notification-center,omarchy-control-center" /> no diff --git a/desktop/shell/migrations/1795137309.sh b/desktop/shell/migrations/1795137309.sh new file mode 100644 index 00000000..e77e0fa8 --- /dev/null +++ b/desktop/shell/migrations/1795137309.sh @@ -0,0 +1,12 @@ +echo "A swipe up from the bottom moves the notification center with the finger" + +# labwc leaves the bottom-edge swipe to the notification center and the +# control center (bottomSwipeIgnoreNamespace takes a list since labwc's +# 0009), so it is their own drag rather than the gesture's command. +rc="$HOME/.config/labwc/rc.xml" +if [[ -f $rc ]] && grep -q 'bottomSwipeIgnoreNamespace="wvkbd"' "$rc"; then + sed 's/bottomSwipeIgnoreNamespace="wvkbd"/bottomSwipeIgnoreNamespace="wvkbd,omarchy-notification-center,omarchy-control-center"/' "$rc" > "$rc.new" + mv -- "$rc.new" "$rc" + labwc=${LABWC_PID:-$(pgrep -u "$(id -u)" -x labwc | head -1 || true)} + [[ -z $labwc ]] || kill -HUP "$labwc" +fi diff --git a/desktop/shell/shell/notificationcenter/NotificationCenter.qml b/desktop/shell/shell/notificationcenter/NotificationCenter.qml index a01dc4ef..1591b979 100644 --- a/desktop/shell/shell/notificationcenter/NotificationCenter.qml +++ b/desktop/shell/shell/notificationcenter/NotificationCenter.qml @@ -793,12 +793,17 @@ Item { // The cards behind a closed stack, as shapes; they fade as it opens. Repeater { model: card.shapes + // Each lies behind the card above and reaches up under it, so that + // card's opaque face covers its top edge: two half-transparent + // outlines on one row of pixels would add up to a brighter line. Rectangle { required property int index + readonly property real under: Style.space(6) + z: -1 - index x: Style.space(8) * (index + 1) - y: box.height + Style.space(6) * index * card.shade + y: box.height + Style.space(6) * index * card.shade - under width: card.width - Style.space(16) * (index + 1) - height: Style.space(6) + height: Style.space(6) + under color: root.cardFill border.width: root.hairline border.color: root.outline From 595065dc99866a0b05ccfc9371697d4d30a12c9c Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Fri, 20 Nov 2026 09:20:17 +0800 Subject: [PATCH 07/16] Notification center: ready before it opens; grows as it comes - Its list is kept up to date while closed: built only as it opened, the cards were made in the opening's first frames and it stuttered. - Pulled, it grows out of its top centre from 94 % as the control center does from 86 %, the bottom of what it shows staying at the finger. Assisted-by: LLM --- .../shell/notificationcenter/NotificationCenter.qml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/desktop/shell/shell/notificationcenter/NotificationCenter.qml b/desktop/shell/shell/notificationcenter/NotificationCenter.qml index 1591b979..f2d944a9 100644 --- a/desktop/shell/shell/notificationcenter/NotificationCenter.qml +++ b/desktop/shell/shell/notificationcenter/NotificationCenter.qml @@ -54,9 +54,11 @@ Item { // Groups of entries, newest first; a group of several shows its newest // with "n more" until it is opened. + // Kept up to date while closed too: built only as it opened, its first + // frames went into making the cards and the opening stuttered. readonly property var groups: { var revision = service ? service.centerRevision : 0 - return root.opened || root.mapped ? (service ? service.centerGroups() : []) : [] + return service ? service.centerGroups() : [] } property var openGroups: ({}) function toggleGroup(key) { @@ -425,10 +427,15 @@ Item { layer.enabled: root.moving && root.gpu layer.smooth: true readonly property real follow: Math.min(content.height, height) - readonly property real grow: !root.gpu ? 1 : (root.popupStyle ? 0.97 + 0.03 * root.reveal : 1) + // As the control center: pulled, it grows out of its top centre (from + // 94 %, a whole screen moving less than a card) while the bottom of + // what it shows stays at the finger; as a popup from 97 %. + readonly property real grow: !root.gpu ? 1 + : root.popupStyle ? 0.97 + 0.03 * root.reveal + : 0.94 + 0.06 * Math.min(1, root.reveal) transform: [ Scale { origin.x: sheet.width / 2; origin.y: 0; xScale: sheet.grow; yScale: sheet.grow }, - Translate { y: root.popupStyle ? 0 : Math.min(0, (root.reveal - 1) * sheet.follow) } + Translate { y: root.popupStyle ? 0 : Math.min(0, root.reveal * root.pullSpan - root.barInset - sheet.follow * sheet.grow) } ] opacity: !root.gpu ? (root.reveal > 0 ? 1 : 0) : root.popupStyle ? root.reveal : root.leaving ? Math.max(0, Math.min(1, root.reveal * 1.2 - 0.2)) From 5ea2abe2d990b1b7951506803d8eff7035b58556 Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Fri, 20 Nov 2026 09:21:59 +0800 Subject: [PATCH 08/16] Notification center and control center: one spring, a small swing - The notification center slides without growing, and its motion is no longer capped at its place: it stopped dead where the control center, on the same spring, swung past. It lands with the swing now. - Both springs are damped a little more going in (0.86 of critical rather than 0.78): the control center's landing read as a bounce. Assisted-by: LLM --- .../shell/shell/controlcenter/ControlCenter.qml | 3 ++- .../notificationcenter/NotificationCenter.qml | 14 ++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/desktop/shell/shell/controlcenter/ControlCenter.qml b/desktop/shell/shell/controlcenter/ControlCenter.qml index 20a3ede6..b4712a0f 100644 --- a/desktop/shell/shell/controlcenter/ControlCenter.qml +++ b/desktop/shell/shell/controlcenter/ControlCenter.qml @@ -449,7 +449,8 @@ Item { var elapsed = Math.min(frameTime, 0.25) // Softer going out: it is seen to travel up rather than vanish. var stiffness = root.springTarget > 0 ? 260 : 195 - var damping = 2 * Math.sqrt(stiffness) * (root.springTarget > 0 ? 0.78 : 1.0) + // A touch under critical going in: it lands with a small swing, not a bounce. + var damping = 2 * Math.sqrt(stiffness) * (root.springTarget > 0 ? 0.86 : 1.0) var steps = Math.max(1, Math.ceil(elapsed / (1 / 240))) var dt = elapsed / steps var reveal = root.reveal, velocity = root.springVelocity diff --git a/desktop/shell/shell/notificationcenter/NotificationCenter.qml b/desktop/shell/shell/notificationcenter/NotificationCenter.qml index f2d944a9..8a729809 100644 --- a/desktop/shell/shell/notificationcenter/NotificationCenter.qml +++ b/desktop/shell/shell/notificationcenter/NotificationCenter.qml @@ -283,7 +283,7 @@ Item { onTriggered: { var elapsed = Math.min(frameTime, 0.25) var stiffness = root.springTarget > 0 ? 260 : 195 - var damping = 2 * Math.sqrt(stiffness) * (root.springTarget > 0 ? 0.78 : 1.0) + var damping = 2 * Math.sqrt(stiffness) * (root.springTarget > 0 ? 0.86 : 1.0) var steps = Math.max(1, Math.ceil(elapsed / (1 / 240))) var dt = elapsed / steps var reveal = root.reveal, velocity = root.springVelocity @@ -427,15 +427,13 @@ Item { layer.enabled: root.moving && root.gpu layer.smooth: true readonly property real follow: Math.min(content.height, height) - // As the control center: pulled, it grows out of its top centre (from - // 94 %, a whole screen moving less than a card) while the bottom of - // what it shows stays at the finger; as a popup from 97 %. - readonly property real grow: !root.gpu ? 1 - : root.popupStyle ? 0.97 + 0.03 * root.reveal - : 0.94 + 0.06 * Math.min(1, root.reveal) + // Pulled, it slides (the bottom of what it shows at the finger) and + // lands with the spring's small swing past its place; as a popup it + // grows from 97 %. + readonly property real grow: !root.gpu ? 1 : (root.popupStyle ? 0.97 + 0.03 * root.reveal : 1) transform: [ Scale { origin.x: sheet.width / 2; origin.y: 0; xScale: sheet.grow; yScale: sheet.grow }, - Translate { y: root.popupStyle ? 0 : Math.min(0, root.reveal * root.pullSpan - root.barInset - sheet.follow * sheet.grow) } + Translate { y: root.popupStyle ? 0 : (root.reveal - 1) * sheet.follow } ] opacity: !root.gpu ? (root.reveal > 0 ? 1 : 0) : root.popupStyle ? root.reveal : root.leaving ? Math.max(0, Math.min(1, root.reveal * 1.2 - 0.2)) From fc879b0e08876b5e7609b9cfbb4734ea663cd8b5 Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Fri, 20 Nov 2026 09:23:40 +0800 Subject: [PATCH 09/16] Notification center: the handle moves with the sheet The handle's pill stood still at the screen's bottom while the sheet slid and swung. It is drawn in the sheet now and moves, fades and swings with it; where it is grabbed stays at the screen's edge, so the drag measures against something still. Assisted-by: LLM --- .../notificationcenter/NotificationCenter.qml | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/desktop/shell/shell/notificationcenter/NotificationCenter.qml b/desktop/shell/shell/notificationcenter/NotificationCenter.qml index 8a729809..9e6b63d6 100644 --- a/desktop/shell/shell/notificationcenter/NotificationCenter.qml +++ b/desktop/shell/shell/notificationcenter/NotificationCenter.qml @@ -439,6 +439,18 @@ Item { ? Math.max(0, Math.min(1, root.reveal * 1.2 - 0.2)) : 1 - Math.pow(1 - Math.max(0, Math.min(1, root.reveal / 0.3)), 2) + Rectangle { + // The handle's pill, at the bottom of the screen, moving with it. + visible: !root.popupStyle + z: 1 + anchors.horizontalCenter: parent.horizontalCenter + y: parent.height - Style.space(14) - height / 2 + width: Style.space(48) + height: Style.space(4) + radius: height / 2 + color: root.dim + } + Flickable { id: scroller anchors.fill: parent @@ -651,20 +663,14 @@ Item { } } - // Pushed up from its bottom edge: the handle a finger finds. + // Pushed up from its bottom edge: the handle a finger finds. The pill + // moves with the sheet (it is drawn there); where it is grabbed stays + // put at the screen's edge, so the drag measures against something still. Item { anchors.bottom: parent.bottom width: parent.width height: Style.space(28) visible: root.mapped && !root.popupStyle - Rectangle { - anchors.centerIn: parent - width: Style.space(48) - height: Style.space(4) - radius: height / 2 - color: root.dim - opacity: sheet.opacity - } DragHandler { target: null xAxis.enabled: false From ebb5ad0196f4461836854f66afa94ddc52c3442a Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Fri, 20 Nov 2026 09:25:50 +0800 Subject: [PATCH 10/16] Notification center: no handle drawn The pill at the bottom goes. A swipe up from the screen's bottom edge still pushes the center away, following the finger: the place where it lands stays, undrawn. Assisted-by: LLM --- .../notificationcenter/NotificationCenter.qml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/desktop/shell/shell/notificationcenter/NotificationCenter.qml b/desktop/shell/shell/notificationcenter/NotificationCenter.qml index 9e6b63d6..9eeda3ac 100644 --- a/desktop/shell/shell/notificationcenter/NotificationCenter.qml +++ b/desktop/shell/shell/notificationcenter/NotificationCenter.qml @@ -439,18 +439,6 @@ Item { ? Math.max(0, Math.min(1, root.reveal * 1.2 - 0.2)) : 1 - Math.pow(1 - Math.max(0, Math.min(1, root.reveal / 0.3)), 2) - Rectangle { - // The handle's pill, at the bottom of the screen, moving with it. - visible: !root.popupStyle - z: 1 - anchors.horizontalCenter: parent.horizontalCenter - y: parent.height - Style.space(14) - height / 2 - width: Style.space(48) - height: Style.space(4) - radius: height / 2 - color: root.dim - } - Flickable { id: scroller anchors.fill: parent @@ -663,9 +651,10 @@ Item { } } - // Pushed up from its bottom edge: the handle a finger finds. The pill - // moves with the sheet (it is drawn there); where it is grabbed stays - // put at the screen's edge, so the drag measures against something still. + // Pushed up from the screen's bottom edge (labwc leaves that swipe to + // it), it follows the finger and goes: nothing drawn, only where a swipe + // from the edge lands, which stays put so the drag measures against + // something still. Item { anchors.bottom: parent.bottom width: parent.width From a9b4a46800fb1332dcc5d1ce9abe442c8ec98c21 Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Fri, 20 Nov 2026 09:31:36 +0800 Subject: [PATCH 11/16] Notification center: buttons close it, inline reply, arrivals, placeholder icon - A sender's button closes the center before it acts: the press changes the list and remade the card it came from, which dropped the close. - Inline reply on a card, as on a banner: the field takes the keyboard on its tap (opening the on-screen keyboard for a finger, which then lies over the center), Escape ends it. - A notification arriving while the center is open comes in with a transition: a new app's group grows in at the top and fades in, what follows moving down; a group that was there fades its head in. What was there on opening does not move. - Without an icon, a card (and a banner) has a quiet square with a bell in the icon's place, so every card's text lines up. Assisted-by: LLM --- .../notificationcenter/NotificationCenter.qml | 187 ++++++++++++++++-- .../shell/plugins/notifications/Service.qml | 2 +- .../shell/plugins/notifications/Toast.qml | 17 +- 3 files changed, 191 insertions(+), 15 deletions(-) diff --git a/desktop/shell/shell/notificationcenter/NotificationCenter.qml b/desktop/shell/shell/notificationcenter/NotificationCenter.qml index 9eeda3ac..fd3fb5ec 100644 --- a/desktop/shell/shell/notificationcenter/NotificationCenter.qml +++ b/desktop/shell/shell/notificationcenter/NotificationCenter.qml @@ -61,6 +61,15 @@ Item { return service ? service.centerGroups() : [] } property var openGroups: ({}) + // What was on the list while it was open: something newer arriving then + // comes in with a transition; what was there on opening does not. + property var seen: ({}) + function markAllSeen() { + var next = {} + for (var g = 0; g < root.groups.length; g++) + for (var r = 0; r < root.groups[g].rows.length; r++) next[root.groups[g].rows[r].key] = true + root.seen = next + } function toggleGroup(key) { var next = {} for (var k in openGroups) next[k] = openGroups[k] @@ -158,6 +167,7 @@ Item { root.everOpened = true // Stacks open closed again, and the list starts at the top. root.openGroups = ({}) + root.markAllSeen() scroller.contentY = 0 root.focusIndex = -1 root.opened = true @@ -217,7 +227,10 @@ Item { onExited: { root.noteWritten = writing; root.writeOpenNote() } } Component.onCompleted: writeOpenNote() - onOpenedChanged: writeOpenNote() + onOpenedChanged: { + writeOpenNote() + if (!opened && typing) endReply() + } ShellIpc { target: "omarchy.notificationcenter" @@ -245,6 +258,7 @@ Item { root.clearOthers() root.everOpened = true root.openGroups = ({}) + root.markAllSeen() scroller.contentY = 0 root.reveal = 0 root.mapped = true @@ -334,6 +348,39 @@ Item { root.close() } function openGroup(group) { if (group && group.rows.length) root.openEntry(group.rows[0]) } + // A sender's button, or its inline reply: the center goes first, since the + // press changes the list and so remakes the card it came from. + function pressAction(entry, id) { + var key = entry.key, live = entry.live + root.close() + if (service && live) service.invokeAction(key, id) + } + function sendReply(entry, text) { + var key = entry.key + root.endReply() + root.close() + if (service) service.sendReply(key, text) + } + // A reply field being typed in: the on-screen keyboard (opened for a + // finger) lies over the center then, and goes with the reply. + property bool typing: false + property bool replyKeyboard: false + function beginReply(byTouch) { + root.typing = true + if (byTouch && !root.replyKeyboard) { + root.replyKeyboard = true + Quickshell.execDetached([(Quickshell.env("OMARCHY_PATH") || "/usr/share/omarchy") + "/bin/omarchy-keyboard", "show"]) + } + } + function endReply() { + root.typing = false + if (root.replyKeyboard) { + root.replyKeyboard = false + Quickshell.execDetached([(Quickshell.env("OMARCHY_PATH") || "/usr/share/omarchy") + "/bin/omarchy-keyboard", "hide"]) + } + keyCatcher.forceActiveFocus() + } + // A collapsed stack goes whole; an open one, the card swiped. function forgetGroup(group, single, entry) { if (!service || !group) return @@ -346,8 +393,9 @@ Item { OverlayWindow { id: panel shown: root.mapped - // Above everything, the on-screen keyboard included. - shownLayer: WlrLayer.Overlay + // Above everything, the on-screen keyboard included, except while a + // reply is typed: then under it, so the keyboard is there to type with. + shownLayer: root.typing ? WlrLayer.Top : WlrLayer.Overlay WlrLayershell.namespace: "omarchy-notification-center" // The bar stays the bar's: a pull from it or a click on its items reaches it. mask: Region { item: belowBar } @@ -592,11 +640,45 @@ Item { NumberAnimation { duration: Style.duration(300); easing.type: Easing.InOutCubic } } width: listColumn.width - height: head.height + (rest.active && rest.item ? rest.item.height : 0) + // Arriving while open: a new app's group grows in from + // nothing at the top and fades in, what follows moving down; + // a group that was there takes its new message as a fade of + // its head. + property real appear: 1 + property real headAppear: 1 + NumberAnimation on appear { + id: appearRun + running: false + to: 1 + duration: root.gpu ? Style.duration(320) : 0 + easing.type: Easing.Bezier + easing.bezierCurve: Style.easeOut + } + NumberAnimation on headAppear { + id: headAppearRun + running: false + to: 1 + duration: root.gpu ? Style.duration(260) : 0 + easing.type: Easing.InOutCubic + } + Component.onCompleted: { + var rows = modelData.rows, unseen = 0 + for (var i = 0; i < rows.length; i++) if (!root.seen[rows[i].key]) unseen++ + if (root.mapped && unseen > 0) { + if (unseen === rows.length) { appear = 0; appearRun.start() } + else { headAppear = 0; headAppearRun.start() } + } + for (var j = 0; j < rows.length; j++) root.seen[rows[j].key] = true + } + clip: appear < 1 + opacity: appear + height: (head.height + (rest.active && rest.item ? rest.item.height : 0)) * appear CenterCard { id: head z: 1 + y: -(1 - groupColumn.appear) * Style.space(16) + opacity: groupColumn.headAppear width: groupColumn.width entry: groupColumn.modelData.rows[0] more: groupColumn.open ? -1 : groupColumn.more @@ -607,9 +689,8 @@ Item { onOpened: root.openEntry(entry) onSwiped: root.forgetGroup(groupColumn.modelData, groupColumn.open, entry) onMoreToggled: root.toggleGroup(groupColumn.modelData.key) - onActionPressed: function(id) { - if (root.service && entry.live) { root.service.invokeAction(entry.key, id); root.close() } - } + onActionPressed: function(id) { root.pressAction(entry, id) } + onReplySent: function(text) { root.sendReply(entry, text) } } // The rest of the stack, built only while it shows. Loader { @@ -636,9 +717,8 @@ Item { entry: parent.modelData onOpened: root.openEntry(entry) onSwiped: root.forgetGroup(groupColumn.modelData, true, entry) - onActionPressed: function(id) { - if (root.service && entry.live) { root.service.invokeAction(entry.key, id); root.close() } - } + onActionPressed: function(id) { root.pressAction(entry, id) } + onReplySent: function(text) { root.sendReply(entry, text) } } } } @@ -781,6 +861,7 @@ Item { signal swiped() signal moreToggled() signal actionPressed(string id) + signal replySent(string text) readonly property int shapes: Math.min(2, stacked) height: box.height + Style.space(6) * shapes * shade @@ -841,11 +922,25 @@ Item { width: parent.width spacing: Style.space(12) + // Without an icon, a quiet square with a bell keeps every card's + // text in line. Item { id: icon - width: card.hasIcon ? card.iconSize : 0 + width: card.iconSize height: width - visible: card.hasIcon + Rectangle { + anchors.fill: parent + visible: !card.hasIcon + color: Util.alpha(root.text, 0.08) + Text { + anchors.centerIn: parent + textFormat: Text.PlainText + text: "󰂚" + color: root.dim + font.family: Style.font.family + font.pixelSize: Style.font.title + } + } Image { anchors.fill: parent visible: card.iconUrl !== "" @@ -974,6 +1069,74 @@ Item { } } } + + // The sender's inline reply, as on a banner. + Row { + visible: String(card.entry.reply || "") !== "" + x: icon.visible ? icon.width + Style.space(12) : 0 + width: parent.width - x + spacing: Style.space(8) + Rectangle { + width: parent.width - sendBox.width - parent.spacing + height: Style.space(34) + color: Util.alpha(Commons.Color.background, 0.7) + border.width: replyInput.activeFocus && root.typing ? Math.max(1, root.hairline) : root.hairline + border.color: replyInput.activeFocus && root.typing ? Commons.Color.accent : root.outline + TextInput { + id: replyInput + anchors.fill: parent + anchors.leftMargin: Style.space(10) + anchors.rightMargin: Style.space(10) + verticalAlignment: TextInput.AlignVCenter + color: root.text + font.family: Style.font.family + font.pixelSize: Style.font.body + clip: true + activeFocusOnPress: false + onAccepted: if (text.trim() !== "") card.replySent(text) + Keys.onEscapePressed: { text = ""; root.endReply() } + Text { + anchors.verticalCenter: parent.verticalCenter + visible: parent.text === "" + textFormat: Text.PlainText + text: String(card.entry.reply || "") + color: root.dim + font: parent.font + } + } + Item { + anchors.fill: parent + visible: !(replyInput.activeFocus && root.typing) + TapHandler { + onTapped: function(point) { + root.beginReply(point.device.type === PointerDevice.TouchScreen) + replyInput.forceActiveFocus() + } + } + } + } + Rectangle { + id: sendBox + width: Style.space(34) + height: Style.space(34) + color: Commons.Color.accent + scale: sendArea.pressed && sendArea.containsMouse ? 0.96 : 1 + Text { + anchors.centerIn: parent + textFormat: Text.PlainText + text: "\uf1d8" + color: Commons.Color.background + font.family: Style.font.family + font.pixelSize: Style.font.title + } + MouseArea { + id: sendArea + anchors.fill: parent + preventStealing: true + onClicked: if (replyInput.text.trim() !== "") card.replySent(replyInput.text) + } + } + } } } diff --git a/desktop/shell/shell/plugins/notifications/Service.qml b/desktop/shell/shell/plugins/notifications/Service.qml index 16e32857..dc7dfe7a 100644 --- a/desktop/shell/shell/plugins/notifications/Service.qml +++ b/desktop/shell/shell/plugins/notifications/Service.qml @@ -1412,7 +1412,7 @@ Item { glyph: String(live.glyph || ""), source: String(live.source || ""), summary: String(live.summary || ""), body: String(live.body || ""), groupKey: String(live.groupKey || live.app || ""), ts: Number(live.ts || 0), - actions: senderActions(refs[key]) }) + actions: senderActions(refs[key]), reply: replyOf(key, refsRevision) }) } var history = currentHistory() for (var h = 0; h < history.length; h++) { diff --git a/desktop/shell/shell/plugins/notifications/Toast.qml b/desktop/shell/shell/plugins/notifications/Toast.qml index 4639c67a..adc5fe8c 100644 --- a/desktop/shell/shell/plugins/notifications/Toast.qml +++ b/desktop/shell/shell/plugins/notifications/Toast.qml @@ -464,11 +464,24 @@ Item { spacing: Style.space(12) readonly property real iconSize: card.width < Style.space(380) ? Style.space(36) : Style.space(40) + // Without an icon, a quiet square with a bell keeps the text in line. Item { id: bannerIcon - width: card.bannerHasIcon ? parent.iconSize : 0 + width: parent.iconSize height: width - visible: card.bannerHasIcon + Rectangle { + anchors.fill: parent + visible: !card.bannerHasIcon + color: Util.alpha(Commons.Color.notifications.text, 0.08) + Text { + anchors.centerIn: parent + textFormat: Text.PlainText + text: "󰂚" + color: card.dimColor + font.family: Style.font.family + font.pixelSize: Style.font.title + } + } Image { anchors.fill: parent visible: thumb.pictured From 9bdbe2e217bf26314706183eebcd234289e89614 Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Fri, 20 Nov 2026 09:34:00 +0800 Subject: [PATCH 12/16] Notification center: a group a new message sorts up slides there The list was made again on every change, so a group a new message sorted to the top jumped there. The groups are a model keyed by app now, kept in step by moves, inserts and removals: the group's card stays and slides to the top while the others make room (320 ms ease-out). The slide applies only while re-sorting; a stack opening keeps its own motion. Assisted-by: LLM --- .../notificationcenter/NotificationCenter.qml | 46 ++++++++++++++++--- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/desktop/shell/shell/notificationcenter/NotificationCenter.qml b/desktop/shell/shell/notificationcenter/NotificationCenter.qml index fd3fb5ec..f2133063 100644 --- a/desktop/shell/shell/notificationcenter/NotificationCenter.qml +++ b/desktop/shell/shell/notificationcenter/NotificationCenter.qml @@ -60,6 +60,30 @@ Item { var revision = service ? service.centerRevision : 0 return service ? service.centerGroups() : [] } + // The groups as a model keyed by app, kept in step with `groups` by + // moves, inserts and removals: a group that a new message sorts to the top + // moves (its card stays and slides there) instead of every card being + // made again in the new order. + ListModel { id: groupModel } + property var groupMap: ({}) + property bool reordering: false + Timer { id: reorderDone; interval: 450; onTriggered: root.reordering = false } + function syncGroups() { + var map = {}, keys = [] + for (var g = 0; g < root.groups.length; g++) { map[root.groups[g].key] = root.groups[g]; keys.push(root.groups[g].key) } + root.groupMap = map + var moved = false + for (var i = 0; i < keys.length; i++) { + if (i < groupModel.count && groupModel.get(i).key === keys[i]) continue + var at = -1 + for (var j = i + 1; j < groupModel.count; j++) if (groupModel.get(j).key === keys[i]) { at = j; break } + if (at >= 0) { groupModel.move(at, i, 1); moved = true } + else groupModel.insert(i, { key: keys[i] }) + } + while (groupModel.count > keys.length) groupModel.remove(groupModel.count - 1) + if (moved && root.mapped && root.gpu) { root.reordering = true; reorderDone.restart() } + } + onGroupsChanged: syncGroups() property var openGroups: ({}) // What was on the list while it was open: something newer arriving then // comes in with a transition; what was there on opening does not. @@ -226,7 +250,7 @@ Item { property bool writing: false onExited: { root.noteWritten = writing; root.writeOpenNote() } } - Component.onCompleted: writeOpenNote() + Component.onCompleted: { writeOpenNote(); syncGroups() } onOpenedChanged: { writeOpenNote() if (!opened && typing) endReply() @@ -576,6 +600,13 @@ Item { y: root.wide ? Style.space(40) : todayRow.y + todayRow.height + Style.space(root.phone ? 20 : 28) width: root.listWidth spacing: Style.space(12) + // Re-sorting slides the groups to their new places; otherwise + // (a stack opening, a card leaving) positions follow at once. + move: root.reordering ? reorderMove : null + Transition { + id: reorderMove + NumberAnimation { properties: "y"; duration: Style.duration(320); easing.type: Easing.Bezier; easing.bezierCurve: Style.easeOut } + } // The header: Focus (Do Not Disturb) and Clear all. Item { @@ -625,11 +656,12 @@ Item { } Repeater { - model: root.groups + model: groupModel Item { id: groupColumn - required property var modelData + required property string key required property int index + readonly property var modelData: root.groupMap[key] || ({ key: key, rows: [{}] }) readonly property bool open: !!root.openGroups[modelData.key] readonly property int more: modelData.rows.length - 1 // 0 closed, 1 open: the stack's cards slide out from under its @@ -661,15 +693,17 @@ Item { duration: root.gpu ? Style.duration(260) : 0 easing.type: Easing.InOutCubic } - Component.onCompleted: { + function arrive() { var rows = modelData.rows, unseen = 0 - for (var i = 0; i < rows.length; i++) if (!root.seen[rows[i].key]) unseen++ + for (var i = 0; i < rows.length; i++) if (rows[i].key && !root.seen[rows[i].key]) unseen++ if (root.mapped && unseen > 0) { if (unseen === rows.length) { appear = 0; appearRun.start() } else { headAppear = 0; headAppearRun.start() } } - for (var j = 0; j < rows.length; j++) root.seen[rows[j].key] = true + for (var j = 0; j < rows.length; j++) if (rows[j].key) root.seen[rows[j].key] = true } + Component.onCompleted: arrive() + onModelDataChanged: arrive() clip: appear < 1 opacity: appear height: (head.height + (rest.active && rest.item ? rest.item.height : 0)) * appear From a1d1785b305098be8f909406aef1c4f1873eefd2 Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Fri, 20 Nov 2026 09:37:17 +0800 Subject: [PATCH 13/16] Notifications: the launcher's app icons Banners and the notification center looked an app's icon up in the icon theme, which found Firefox's own icon before the icon set's drawing the launcher shows (Papercraft by default, in the theme's colours; other apps have no themed icon, so they fell back to the drawing anyway). They ask the app library first now, as the launcher does. Assisted-by: LLM --- .../shell/plugins/notifications/Service.qml | 22 ++++++++++++++++++- .../shell/plugins/notifications/Toast.qml | 5 ++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/desktop/shell/shell/plugins/notifications/Service.qml b/desktop/shell/shell/plugins/notifications/Service.qml index dc7dfe7a..ec0c32af 100644 --- a/desktop/shell/shell/plugins/notifications/Service.qml +++ b/desktop/shell/shell/plugins/notifications/Service.qml @@ -1471,9 +1471,29 @@ Item { return app } - // The app's icon for a center card, as the cards find theirs. + // Orchard: the launcher's drawing of an app (the icon set's, Papercraft + // by default, in the theme's colours), else "": the app library knows it + // by the name a desktop entry gives or by the app's own. + function appIconFor(names, entries) { + var library = service.shell ? service.shell.appLibrary : null + if (!library || !library.iconIndex) return "" + var index = library.iconIndex + for (var i = 0; i < names.length; i++) + if (names[i] && index[names[i]]) return library.iconSource(names[i]) + for (var j = 0; j < entries.length; j++) { + var desktop = DesktopEntries.heuristicLookup(entries[j]) + var icon = desktop ? String(desktop.icon || "") : "" + if (icon && index[icon]) return library.iconSource(icon) + } + return "" + } + + // The app's icon for a center card: the launcher's drawing first, as the + // banners find theirs. function iconFor(entry) { var want = Icons.candidates(entry) + var drawn = appIconFor(want.themed, want.entries) + if (drawn) return drawn for (var i = 0; i < want.themed.length; i++) { var found = Quickshell.iconPath(want.themed[i], true) if (found) return found diff --git a/desktop/shell/shell/plugins/notifications/Toast.qml b/desktop/shell/shell/plugins/notifications/Toast.qml index adc5fe8c..4f018f51 100644 --- a/desktop/shell/shell/plugins/notifications/Toast.qml +++ b/desktop/shell/shell/plugins/notifications/Toast.qml @@ -746,7 +746,10 @@ Item { readonly property var sources: { var appsRevision = DesktopEntries.applications.values.length var want = Icons.candidates(card.row) - var found = [sent, + // Orchard: the launcher's drawing of the app (the icon set's, in + // the theme's colours) before the icon theme's. + var drawn = card.scene && card.scene.appIconFor ? card.scene.appIconFor(want.themed, want.entries) : "" + var found = [sent, drawn, firstOf(want.themed, function(name) { return Quickshell.iconPath(name, true) }), firstOf(want.entries, function(name) { var entry = DesktopEntries.heuristicLookup(name) From 2138e87f95b423496e5ae909a680bd7311b53549 Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Fri, 20 Nov 2026 09:47:00 +0800 Subject: [PATCH 14/16] Notification center: the weather fits a phone; the clock turns with the bar - A phone's weather card shows the temperature and the day's high and low without the place, which did not fit and was cut off at the card's edge; a line too long elsewhere ends in an ellipsis. The card's width comes from its texts' full widths. - The clock is checked every second while the center shows: its minute timer was set once and could lag the bar's by a minute. Assisted-by: LLM --- .../notificationcenter/NotificationCenter.qml | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/desktop/shell/shell/notificationcenter/NotificationCenter.qml b/desktop/shell/shell/notificationcenter/NotificationCenter.qml index f2133063..1b00ff03 100644 --- a/desktop/shell/shell/notificationcenter/NotificationCenter.qml +++ b/desktop/shell/shell/notificationcenter/NotificationCenter.qml @@ -103,12 +103,16 @@ Item { // The time, to the minute, for the clock and the cards' ages. property double now: Date.now() + // Checked every second while it shows, so its clock turns with the bar's. Timer { - interval: 1000 * (60 - new Date().getSeconds()) + interval: 1000 running: root.mapped repeat: true triggeredOnStart: true - onTriggered: { root.now = Date.now(); interval = 1000 * (60 - new Date().getSeconds()) } + onTriggered: { + var t = Date.now() + if (Math.floor(t / 60000) !== Math.floor(root.now / 60000)) root.now = t + } } function ago(ts) { var s = Math.max(0, (root.now - ts * 1000) / 1000) @@ -789,7 +793,12 @@ Item { // The weather, as the weather panel reads it. component WeatherCard: Rectangle { - implicitWidth: weatherRow.implicitWidth + Style.space(28) + id: weatherCard + // Room the text has inside the card as it is laid out. + readonly property real maxTextWidth: Math.max(0, width - Style.space(28) - weatherIcon.width - Style.space(12)) + // From the texts' full widths, not the shortened ones it lays out. + implicitWidth: weatherIcon.implicitWidth + Style.space(12) + + Math.max(tempLine.implicitWidth, detailLine.implicitWidth) + Style.space(28) height: weatherRow.implicitHeight + Style.space(20) color: root.cardFill border.width: root.hairline @@ -801,6 +810,7 @@ Item { anchors.verticalCenter: parent.verticalCenter spacing: Style.space(12) Text { + id: weatherIcon anchors.verticalCenter: parent.verticalCenter textFormat: Text.PlainText text: root.weather ? root.weather.label : "" @@ -809,9 +819,11 @@ Item { font.pixelSize: Style.font.displayLarge } Column { + id: weatherText anchors.verticalCenter: parent.verticalCenter spacing: Style.space(2) Text { + id: tempLine textFormat: Text.PlainText text: root.weather ? root.weather.reportTempNum + root.weather.tempUnit : "" color: root.text @@ -819,10 +831,15 @@ Item { font.pixelSize: Style.font.title font.bold: true } + // A phone's card is too narrow for the place; too long a line ends + // in an ellipsis rather than at the card's edge. Text { + id: detailLine + width: Math.min(implicitWidth, weatherCard.maxTextWidth) textFormat: Text.PlainText - text: [root.weatherHighLow, root.weather ? root.weather.reportLocation : ""] + text: [root.weatherHighLow, root.weather && !root.phone ? root.weather.reportLocation : ""] .filter(function(part) { return part !== "" }).join(" · ") + elide: Text.ElideRight color: root.dim font.family: Style.font.family font.pixelSize: Style.font.caption From 4ba4da1ea7376e72c20e9704478742c82281a476 Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Fri, 20 Nov 2026 09:49:31 +0800 Subject: [PATCH 15/16] Changelog: the notification center Assisted-by: LLM --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 934edc90..a6b96558 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,10 @@ is missing or empty. with a reply field where the app offers one, or stacked (Trigger > Toggle > Stack Notifications). Swipe a banner away, or tap it to open the app. - The control center opens over the on-screen keyboard and leaves it open. +- A notification center: pull down from the top left or click the clock to + see the weather and all recent notifications, grouped by app. Tap one to + open it, reply where the app offers it, swipe it away, or clear them all. + A swipe up from the bottom puts it, or the control center, away. ## [0.3.2] - 2026-11-19 From b7dcae4782a050bf9bfb8e508b2ee6eddac400e5 Mon Sep 17 00:00:00 2001 From: Henrik Klee Date: Fri, 20 Nov 2026 09:51:27 +0800 Subject: [PATCH 16/16] Control center: a tap on a phone's empty sheet closes it On a phone the card is the whole screen and took every tap, so the empty sheet under the tiles did not close it. Only its content takes taps there now; a tap below closes, as a tap beside an iPad's card and on the notification center's empty screen do. Assisted-by: LLM --- desktop/shell/shell/controlcenter/ControlCenter.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desktop/shell/shell/controlcenter/ControlCenter.qml b/desktop/shell/shell/controlcenter/ControlCenter.qml index b4712a0f..cdea124d 100644 --- a/desktop/shell/shell/controlcenter/ControlCenter.qml +++ b/desktop/shell/shell/controlcenter/ControlCenter.qml @@ -699,7 +699,10 @@ Item { ? Math.max(0, Math.min(1, (root.reveal - barShare) / (1 - barShare))) : 1 - Math.pow(1 - Math.max(0, Math.min(1, root.reveal / 0.25)), 2) - MouseArea { anchors.fill: parent } // taps inside never close + // Taps on it never close it; on a phone, where the card is the whole + // screen, only its content counts, and a tap on the empty sheet below + // closes as a tap beside an iPad's card does. + MouseArea { width: parent.width; height: root.phone ? Math.min(parent.height, card.follow) : parent.height } Column { id: content