🎉 Add changes notification (#11476)

* 🎉 Add changes notification

* ♻️ Change fn names
This commit is contained in:
Eva Marco 2026-09-03 12:07:09 +02:00 committed by Andrés Moya
parent dcf90f9e28
commit fb3cf431c1
4 changed files with 26 additions and 1 deletions

View File

@ -1269,3 +1269,18 @@
"Check if a commit contains changes that modify the tokens library." "Check if a commit contains changes that modify the tokens library."
[changes] [changes]
(some #(tokens-lib-change-types (:type %)) changes)) (some #(tokens-lib-change-types (:type %)) changes))
(def ^:private notifiable-token-change-types
"Set of change types that modify the structure of the tokens library sets
or themes (as opposed to `:set-token`, which only edits a token's value)."
#{:set-token-set
:set-token-theme
:rename-token-set-group
:move-token-set
:move-token-set-group})
(defn notifiable-token-change-occured?
"Check if a commit contains changes that modify the tokens library sets or
themes structure (renamed/added/removed sets, theme set-membership, etc.)."
[changes]
(some #(notifiable-token-change-types (:type %)) changes))

View File

@ -842,7 +842,9 @@
(rx/delay 5000) (rx/delay 5000)
(rx/map fetch-library-thumbnails)) (rx/map fetch-library-thumbnails))
(when (ch/tokens-lib-changed? changes) (when (ch/tokens-lib-changed? changes)
(rx/of (dwtp/propagate-workspace-tokens)))) (rx/of (dwtp/propagate-workspace-tokens)))
(when (ch/notifiable-token-change-occured? changes)
(rx/of (ntf/info (tr "workspace.tokens.notifications.source-sets-or-themes-updated")))))
(rx/take-until stopper-s)))))) (rx/take-until stopper-s))))))

View File

@ -10159,6 +10159,10 @@ msgstr "This is the current Tokens source"
msgid "workspace.tokens.open-connected-library" msgid "workspace.tokens.open-connected-library"
msgstr "Open connected library" msgstr "Open connected library"
#: src/app/main/data/workspace/libraries.cljs:847
msgid "workspace.tokens.notifications.source-sets-or-themes-updated"
msgstr "Tokens source sets or themes have been modified"
#: src/app/main/ui/workspace/tokens/management/forms/generic_form.cljs #: src/app/main/ui/workspace/tokens/management/forms/generic_form.cljs
#, unused #, unused
msgid "workspace.tokens.warning-name-change" msgid "workspace.tokens.warning-name-change"

View File

@ -9816,6 +9816,10 @@ msgstr "Esta es la actual fuente de Tokens"
msgid "workspace.tokens.open-connected-library" msgid "workspace.tokens.open-connected-library"
msgstr "Abrir librería conectada" msgstr "Abrir librería conectada"
#: src/app/main/data/workspace/libraries.cljs:847
msgid "workspace.tokens.notifications.source-sets-or-themes-updated"
msgstr "Los sets o temas de la fuente de tokens se han modificado"
#: src/app/main/ui/workspace/tokens/management/forms/generic_form.cljs #: src/app/main/ui/workspace/tokens/management/forms/generic_form.cljs
#, unused #, unused
msgid "workspace.tokens.warning-name-change" msgid "workspace.tokens.warning-name-change"