repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

notifications: delete orphaned telemetry/descriptor blobs and drag IPC

302f7c3bb9d6e1bb9f3625e833fc8f48447d52cc

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Removed dead symbols: notificationPanelContract, dragDismissContract,
scrollableListChrome, pointerTrace, recordPointerEvent, dragNotification,
dismissThresholdRatio, persistenceShape, groupedByAppLatestFirst,
horizontalActionRows. Removed the notificationsDrag IPC from shell.qml.
Kept widgetState and its role helpers (still called by notificationWidgetState
IPC) and removalLifecycleLock (still used by closeNotification). Also pruned
transient-only entries from nativeNotifications in dismissToast/dismissToasts
to prevent orphaned native tracking entries.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Changed files (2)

quickshell/nuguland/Notifications.qml

Modified
16 16 property var activeToasts: []
17 17 property var toastById: ({})
18 18 readonly property int defaultToastTimeoutMs: 5000
19 - property var pointerTrace: []
20 19 property var lastAction: ({
22 21 readonly property bool nativeActionRoute: true
23 22 readonly property bool usesNativeNotificationServer: true
24 - readonly property bool groupedByAppLatestFirst: true
25 - readonly property bool horizontalActionRows: true
26 - readonly property real dismissThresholdRatio: 0.35
27 23 readonly property int groupPreviewCount: 1
28 24 readonly property bool removalLifecycleLock: true
29 - readonly property var dragDismissContract: ({
30 - "source": "Nuguland NotifGroupList.qml",
31 - "axis": "x",
32 - "dismissThresholdRatio": dismissThresholdRatio,
33 - "snapBackTransition": "drag-snap-back",
34 - "commitTransition": "drag-dismiss-commit",
35 - "removalLifecycleLock": removalLifecycleLock,
36 - "modelLock": "lock-until-remove-animation-finished"
37 - })
38 - readonly property var persistenceShape: ["id", "appName", "summary", "body", "time", "urgency", "actions"]
40 26 function activeRole() {
41 27 return "ui.focus";
299 285 function dismissToast(id) {
300 - activeToasts = activeToasts.filter((x) => x !== String(id));
286 + const sid = String(id);
287 + const toast = toastById[sid];
288 + activeToasts = activeToasts.filter((x) => x !== sid);
301 289 const map = Object.assign({}, toastById);
302 - delete map[String(id)];
290 + delete map[sid];
303 291 toastById = map;
292 + if (toast && toast.transient) {
293 + const nmap = Object.assign({}, nativeNotifications);
294 + delete nmap[sid];
295 + nativeNotifications = nmap;
304 297 return stateJson();
307 300 function dismissToasts() {
301 + const tmap = toastById;
308 302 activeToasts = [];
309 303 toastById = ({});
304 + const nmap = Object.assign({}, nativeNotifications);
305 + let pruned = false;
306 + for (const tid in tmap) {
307 + if (tmap[tid] && tmap[tid].transient) {
308 + delete nmap[tid];
309 + pruned = true;
312 + if (pruned)
313 + nativeNotifications = nmap;
310 314 return stateJson();
351 355 return result;
354 - function notificationPanelContract() {
355 - return {
356 - "source": "Nuguland NotifGroup.qml NotifGroupList.qml NotifActionList.qml",
357 - "ownedBy": "PopoutHost.qml inline NotificationGroup",
358 - "groupedCardPanel": true,
359 - "appMediaSlot": true,
360 - "expandPill": true,
361 - "animatedExpandHeight": true,
362 - "maskedHorizontalActionRail": true,
363 - "visiblePreviewCount": groupPreviewCount,
364 - "actionRailKinds": ["close", "server-action", "copy-body"],
365 - "pointerParity": ["left-toggle-expand", "middle-close", "horizontal-drag-dismiss"],
366 - "keyboardParity": ["Return", "Space", "Escape"],
367 - "dismissThresholdRatio": dismissThresholdRatio,
368 - "realNotificationServer": true,
369 - "noSyntheticNotifications": true
370 - };
371 - }
373 - function scrollableListChrome(rowCount) {
374 - const count = Math.max(0, Number(rowCount));
375 - const scrollable = count > 1;
376 - return {
377 - "source": "Nuguland ScrollEdgeFade.qml plus Nuguland FlickMonitor.qml",
378 - "scrollEdgeFade": true,
379 - "topEdgeFade": false,
380 - "bottomEdgeFade": scrollable,
381 - "fadeSize": 32,
382 - "scrollHint": {
383 - "visible": scrollable,
384 - "icon": "notifications",
385 - "side": "right",
386 - "tooltip": "scroll notifications"
387 - },
388 - "flickMonitor": {
389 - "enabled": true,
390 - "velocitySamples": 6,
391 - "events": ["pressed", "positionChanged", "released"]
392 - }
393 - };
394 - }
396 - function recordPointerEvent(kind, notificationId, x, y, deltaX) {
397 - const rows = pointerTrace.slice(Math.max(0, pointerTrace.length - 15));
398 - rows.push({
399 - "kind": kind,
400 - "notificationId": notificationId,
401 - "x": x,
402 - "y": y,
403 - "deltaX": deltaX
404 - });
405 - pointerTrace = rows;
406 - }
408 358 function stateObject() {
409 359 const active = notifications.filter((n) => {
410 360 return !n.closed;
416 366 "nativeActionRoute": nativeActionRoute,
417 367 "syntheticNotifications": false,
418 368 "trackedNativeCount": Object.keys(nativeNotifications).length,
419 - "groupedByAppLatestFirst": groupedByAppLatestFirst,
420 - "horizontalActionRows": horizontalActionRows,
421 369 "expandedGroups": expandedGroups.slice(0),
422 370 "groupPreviewCount": groupPreviewCount,
423 - "dismissThresholdRatio": dismissThresholdRatio,
424 - "dragDismissContract": dragDismissContract,
425 - "notificationPanelContract": notificationPanelContract(),
426 371 "dnd": dnd,
427 372 "popupInhibition": dnd || popupInhibition,
428 373 "toastAnchor": {
435 380 "unreadCount": unreadCount,
436 381 "activeCount": active.length,
437 382 "groups": grouped,
438 - "scrollableListChrome": scrollableListChrome(grouped.length),
439 383 "actionKinds": ["close", "server-action", "copy-body"],
440 - "persistenceShape": persistenceShape,
441 384 "discardAll": true,
442 385 "removalLifecycleLock": removalLifecycleLock,
443 - "pointerTrace": pointerTrace,
444 386 "lastAction": lastAction,
445 387 "activeToasts": activeToastRows()
550 492 return stateJson();
553 - function dragNotification(notificationId, deltaX, width) {
554 - const id = String(notificationId);
555 - const x = Number(deltaX);
556 - const rowWidth = Math.max(1, Number(width));
557 - const ratio = Math.abs(x) / rowWidth;
558 - const committed = ratio >= dismissThresholdRatio;
559 - const transition = committed ? "drag-dismiss-commit" : "drag-snap-back";
560 - for (let i = 0; i < notifications.length; i++) {
561 - const n = notifications[i];
562 - if (n.id !== id)
563 - continue;
565 - if (committed)
566 - closeNotification(n);
568 - lastAction = {
569 - "kind": "dragDismiss",
570 - "id": id,
571 - "deltaX": x,
572 - "width": rowWidth,
573 - "ratio": Math.round(ratio * 1000) / 1000,
574 - "committed": committed,
575 - "transition": transition,
576 - "removalLifecycleLock": committed ? removalLifecycleLock : false
577 - };
578 - notifications = notifications.slice(0);
579 - return stateJson();
580 - }
581 - lastAction = {
582 - "kind": "dragDismiss",
583 - "id": id,
584 - "deltaX": x,
585 - "width": rowWidth,
586 - "ratio": Math.round(ratio * 1000) / 1000,
587 - "committed": false,
588 - "transition": "missing",
589 - "removalLifecycleLock": false
590 - };
591 - return stateJson();
592 - }
594 495 function discardAllNotifications() {
595 496 notifications = [];
596 497 unreadCount = 0;

quickshell/nuguland/shell.qml

Modified
584 584 return notifications.toggleGroup(appName);
587 - function notificationsDrag(id: string, deltaX: real, width: real) : string {
588 - return notifications.dragNotification(id, deltaX, width);
591 587 function notificationsDiscardAll() : string {
592 588 return notifications.discardAllNotifications();