From cde2967ef6004d14bc962b0ec99dcb0641d59936 Mon Sep 17 00:00:00 2001 From: Thomas Cruveilher <38007824+Sorikairox@users.noreply.github.com> Date: Sat, 8 Nov 2025 08:49:17 +0900 Subject: [PATCH] feat: display changelog modal on new version to improve awareness (#2403) ## Description: Following discussion on discord, some people (including me) thought it would be nice to show the changelog whenever there is a new version, as people seemed not to be aware of the gameplay change https://github.com/user-attachments/assets/00b9531d-ea7a-4e69-8a01-64ef3b39536b ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: sorikairo --- src/client/components/NewsButton.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/client/components/NewsButton.ts b/src/client/components/NewsButton.ts index c1c4d22d5..7318dc054 100644 --- a/src/client/components/NewsButton.ts +++ b/src/client/components/NewsButton.ts @@ -19,19 +19,30 @@ export class NewsButton extends LitElement { try { const lastSeenVersion = localStorage.getItem("version"); this.isActive = lastSeenVersion !== version; + if (this.isActive) { + setTimeout(() => { + this.openNewsModel(); + }, 500); + } } catch (error) { // Fallback to NOT showing notification if localStorage fails this.isActive = false; } + localStorage.setItem("version", version); } private handleClick() { localStorage.setItem("version", version); this.isActive = false; + this.openNewsModel(); + } + private openNewsModel() { const newsModal = document.querySelector("news-modal") as NewsModal; if (newsModal) { newsModal.open(); + } else { + console.log("no newsModal"); } }