feenkcom / gtoolkit

Glamorous Toolkit is the Moldable Development environment. It empowers you to make systems explainable through experiences tailored for each problem.
https://gtoolkit.com
MIT License
1.08k stars 47 forks source link

Gt needs a way to clear all notifications #1816

Open onierstrasz opened 3 years ago

onierstrasz commented 3 years ago

As notification accumulate in Gt windows, the only way to clear them is to remove them one by one. We need an additional button to remove them all.

NB: Alex Bergel is also working on this.

We looked at GtNotificationsListElement and related classes, but did not yet figure out how to add a button to clear the notifications.

Notes

Adding this to GtNotificationsListElement>>#initialize sort of works, but needs better layout:

self addChild:  
    ((BrButton new
                look: BrGlamorousButtonWithIconLook;
                icon: BrGlamorousIcons cancel;
                label: 'Cancel all';
                action: [  self notifications asArray do: #requestRemoval ])).

Alternatively we can send dismiss to the GtNotificationDebugSessionElement, but this might not work for all kinds of notifications.

offray commented 2 years ago

Hi,

Any advance on this issue?

We have been working with GT as a "glueware" between the file system and TiddlyWiki (TW), taking meta data from a sets of files and creating correspondent cards (tiddlers) in TiddlyWiki. It has been part of introductory educative experience to moldable tools (TW and GT) for non-programmers, starting from practical problems. It has been a pretty enjoyable on, but having to clear manually 250 notifications creates pretty visible friction (and doesn't help for those of us with tendinitis tendencies/episodes).

Migrating Seccion Arte files metadata to TiddlyWiki

onierstrasz commented 2 years ago

Thanks for the reminder. I'll have a look at this again in January when I have some free time.

seandenigris commented 2 years ago

This script does it programmatically. May be a better way but works for now:

    | badges |
    badges := GtWorld allInstances collect: [ :w | 
    w root 
        allChildrenBreadthFirstDetect: [ :e | e class = BrTabGroup ]
        ifFound: [ :tabGroup | 
            tabGroup 
                allChildrenBreadthFirstDetect: [ :e | e class = GtNotificationsBadgeElement ]
                ifFound: [ :bdg | bdg ] ] ].
badges do: [ :badge | badge notifications asArray do: #requestRemoval ]