From cb6e97ed11ef0aaeb9dd5566a1cf99c2ef46ea8d Mon Sep 17 00:00:00 2001 From: Wawa Date: Thu, 12 Feb 2026 23:58:17 +0100 Subject: [PATCH] Add Leaderboard refresh time (#3190) ## Description: I added a small refresh time text (see screenshots below). > I play ranked a lot since it's been added and I just reached the top 100 (yay !!), I was wondering what was the refresh time so after I found it in the code, I wanted to add a small text for easier understanding :)

Open Screenshots "players" here

Before "players" : image After "players" : image
This can be edited as you want but I did not added the text in the "clans" section. I did not added any test in the tests files since this is a minor UI improvement, but I can if needed, And I do tested everything locally myself to take the screenshots :) ## 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: @noleet --- resources/lang/en.json | 1 + src/client/LeaderboardModal.ts | 5 +++++ tests/client/LeaderboardModal.test.ts | 1 + 3 files changed, 7 insertions(+) diff --git a/resources/lang/en.json b/resources/lang/en.json index 546323c80..0650ae6a3 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -230,6 +230,7 @@ "title": "Leaderboard", "ranked_tab": "1v1 Ranked", "clans_tab": "Clans", + "refresh_time": "Refreshed every 1 hour", "loading": "Loading...", "error": "Error loading leaderboard", "no_stats": "No stats available", diff --git a/src/client/LeaderboardModal.ts b/src/client/LeaderboardModal.ts index 33c4c809f..9c9f40a53 100644 --- a/src/client/LeaderboardModal.ts +++ b/src/client/LeaderboardModal.ts @@ -76,6 +76,10 @@ export class LeaderboardModal extends BaseModal { >(${start} - ${end})`; } + const refreshTime = html`(${translateText("leaderboard_modal.refresh_time")})`; const content = html`
${this.activeTab === "clans" ? dateRange : ""} + ${this.activeTab === "players" ? refreshTime : ""}
`, onBack: this.close, diff --git a/tests/client/LeaderboardModal.test.ts b/tests/client/LeaderboardModal.test.ts index 91a07bde0..5f771604e 100644 --- a/tests/client/LeaderboardModal.test.ts +++ b/tests/client/LeaderboardModal.test.ts @@ -17,6 +17,7 @@ vi.mock("../../src/client/Utils", () => ({ "leaderboard_modal.title": "Leaderboard", "leaderboard_modal.ranked_tab": "Ranked", "leaderboard_modal.clans_tab": "Clans", + "leaderboard_modal.refresh_time": "Refreshed every 1 hour", "leaderboard_modal.error": "Something went wrong", "leaderboard_modal.rank": "Rank", "leaderboard_modal.clan": "Clan",