Added a clear all notifications button and an AGENTS.md file for llms to

test their effectiveness
This commit is contained in:
2026-05-06 18:34:10 -04:00
parent 79f8a99c86
commit e4ee6c6caa
3 changed files with 110 additions and 68 deletions

23
AGENTS.md Normal file
View File

@@ -0,0 +1,23 @@
# Agent Guidance: Quickshell Project
## Core Architecture
- **Type**: Quickshell/QML based UI.
- **State Management**: Heavily reliant on QML Singletons for global state, configuration, and paths.
- **Main Entry**: `shell.qml`.
## Key Singletons
- `GlobalStates.qml`: Manages global UI visibility (e.g., `mediaControlsOpen`, `notificationPanelOpen`).
- `common/Config.qml`: Manages JSON configuration and watches for file changes.
- `common/Directories.qml`: Defines XDG and repository-specific file paths.
- `common/Appearance.qml`: Handles theme, colors, and transparency.
## Component Structure
- `bar/`: Top bar components.
- `osd/`: On-screen display components.
- `background/`: Background/Wallpaper components.
- `common/`: Shared utility and singleton components.
- `settings/`: Settings/Configuration components.
- `settings.qml`: Settings view entry point.
## Development Workflow
- *TBD*: Check for build/lint/test commands (e.g., `npm`, `make`, or direct `quickshell` execution).

View File

@@ -7,6 +7,12 @@ Singleton {
readonly property list<Notification> notifications: server.trackedNotifications.values readonly property list<Notification> notifications: server.trackedNotifications.values
readonly property int amountNotifications: notifications.length readonly property int amountNotifications: notifications.length
function dismissAll() {
for (let i = notifications.length - 1; i >= 0; i--) {
notifications[i].dismiss();
}
}
NotificationServer { NotificationServer {
id: server id: server
actionsSupported: true actionsSupported: true

View File

@@ -5,80 +5,93 @@ import Quickshell.Wayland
import Quickshell.Services.Notifications import Quickshell.Services.Notifications
import qs import qs
import qs.common import qs.common
import qs.common.widgets
Scope { Scope {
id: root id: root
property bool visible: false property bool visible: false
property int panelWidth: 350 property int panelWidth: 350
Timer { Timer {
id: hideTimer id: hideTimer
interval: Config.options.osd.timeout interval: Config.options.osd.timeout
onTriggered: GlobalStates.notificationPanelOpen = false onTriggered: GlobalStates.notificationPanelOpen = false
}
Loader {
id: notificationPanelLoader
active: GlobalStates.notificationPanelOpen
onActiveChanged: {
if (notificationPanelLoader.active) {
hideTimer.restart();
}
} }
sourceComponent: PanelWindow { Loader {
id: notificationPanelRoot id: notificationPanelLoader
visible: true active: GlobalStates.notificationPanelOpen
onActiveChanged: {
exclusionMode: ExclusionMode.Ignore if (notificationPanelLoader.active) {
exclusiveZone: 0 hideTimer.restart();
}
implicitWidth: root.panelWidth }
sourceComponent: PanelWindow {
anchors { id: notificationPanelRoot
top: true visible: true
right: true
bottom: true exclusionMode: ExclusionMode.Ignore
} exclusiveZone: 0
margins {
top: Config.options.bar.height implicitWidth: root.panelWidth
}
anchors {
Rectangle { top: true
anchors { right: true
fill: parent bottom: true
margins: Config.options.bar.cornerStyle === 1 ? (Appearance.sizes.hyprlandGapsOut) : 0 }
} margins {
color: Config.options.bar.showBackground ? Appearance.colors.colLayer1 : "transparent" top: Config.options.bar.height
} }
MouseArea { Rectangle {
id: notificationArea anchors {
anchors.fill: parent fill: parent
hoverEnabled: true margins: Config.options.bar.cornerStyle === 1 ? (Appearance.sizes.hyprlandGapsOut) : 0
onExited: () => { }
hideTimer.restart(); color: Config.options.bar.showBackground ? Appearance.colors.colLayer1 : "transparent"
} }
onEntered: () => {
hideTimer.stop(); MouseArea {
} id: notificationArea
ColumnLayout { anchors.fill: parent
id: notifs hoverEnabled: true
anchors.margins: 4 onExited: () => {
anchors.left: parent.left hideTimer.restart();
anchors.right: parent.right }
Repeater { onEntered: () => {
model: NotificationService.notifications hideTimer.stop();
NotificationItem { }
required property Notification modelData
notif: modelData ColumnLayout {
textWidth: root.panelWidth - 14 id: notifs
notificationRounding: Appearance.rounding.unsharpenmore anchors.margins: 4
Layout.fillWidth: true
anchors.left: parent.left
anchors.right: parent.right
visible: NotificationService.amountNotifications > 0
// Dismiss All Button
RippleButton {
buttonText: "Dismiss All"
buttonTextColor: Appearance.m3colors.m3onTertiaryContainer
colBackground: Appearance.m3colors.m3tertiaryContainer
releaseAction: NotificationService.dismissAll
buttonRadius: Appearance.rounding.unsharpenmore
}
Repeater {
model: NotificationService.notifications
NotificationItem {
required property Notification modelData
notif: modelData
textWidth: root.panelWidth - 14
notificationRounding: Appearance.rounding.unsharpenmore
}
}
}
} }
}
} }
}
} }
}
} }