@NicolasB3645 I remember early days of Theme-Cosmos, like 8.5, we had a bug with this and tried to fix it but it was a bit like ‘whack a mole’… I’d hope this all works natively nowadays (but its been a while since I’ve worked on Theme-Cosmos). It might be good to check which version of Theme-cosmos UI you are on, this has to be manually updated (from memory) and a lot of project didn’t do this, so it could be working in the latest version. [Updated: I see in your title, you are on Theme-cosmos - 04-01, which is the latest]
I also remember it was VERY important to use the right modal template to launch for Theme-Cosmos in order to get everything working as expected. Although UI Kit templates were in the list, there were specific ones made for theme-cosmos. Unfortunately, I can not find any details on dirty flags or modal templates in my notes to give you specifics, hopefully there are those working in this UI architecture that can share.
I only mention this story as, I would not attempt to manually fix the dirty flag again(caution!).
@NicolasB3645 if you are working on theme-cosmos, you might find these useful. I found this list whilst i was unsuccessfully trying to answer your question. It may help you in your future work, until you get to Constellation then we have the Constellation 101 online for you
Title
URL
Refreshing files and documents widget in Theme Cosmos