From 50d372ac3da6b1b565bed535e6f5cfcd4314bba6 Mon Sep 17 00:00:00 2001 From: bijx Date: Sat, 27 Jun 2026 19:00:52 -0400 Subject: [PATCH 1/2] added new lang entry --- resources/lang/en.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/lang/en.json b/resources/lang/en.json index 5633e3cd45..1e595764b6 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -982,7 +982,9 @@ "world": "World" }, "map_component": { + "collapse_all": "Collapse all", "error": "Error", + "expand_all": "Expand all", "favorite": "Add to favourites", "favorites_empty": "Click the star on any map to favourite it", "loading": "Loading...", From 089367721571516e81224b9bf6ae5127c71f1173 Mon Sep 17 00:00:00 2001 From: bijx Date: Sat, 27 Jun 2026 19:01:10 -0400 Subject: [PATCH 2/2] added expand all / collapse all to "All" category --- src/client/components/map/MapPicker.ts | 83 +++++++++++++++++++------- 1 file changed, 63 insertions(+), 20 deletions(-) diff --git a/src/client/components/map/MapPicker.ts b/src/client/components/map/MapPicker.ts index 442b08f12e..5dc76aa15f 100644 --- a/src/client/components/map/MapPicker.ts +++ b/src/client/components/map/MapPicker.ts @@ -71,6 +71,17 @@ export class MapPicker extends LitElement { this.expandedCategories = expanded; } + private get allCategories(): MapCategory[] { + return mapCategoryOrder.filter((categoryKey) => categoryKey !== "featured"); + } + + private toggleExpandAll() { + this.expandedCategories = + this.expandedCategories.size > 0 + ? new Set() + : new Set(this.allCategories); + } + private preventImageDrag(event: DragEvent) { event.preventDefault(); } @@ -183,11 +194,42 @@ export class MapPicker extends LitElement { private renderAllTab() { return html`
- ${mapCategoryOrder - .filter((categoryKey) => categoryKey !== "featured") - .map((categoryKey) => - this.renderCategoryBar(categoryKey, mapsInCategory(categoryKey)), - )} + ${this.allCategories.map((categoryKey) => + this.renderCategoryBar(categoryKey, mapsInCategory(categoryKey)), + )} +
`; + } + + private renderExpandToggle() { + const anyExpanded = this.expandedCategories.size > 0; + return html`
+
`; } @@ -271,24 +313,25 @@ export class MapPicker extends LitElement { const isSearching = this.searchQuery.trim().length > 0; return html`
-
+
${isSearching ? null : html`
- ${this.renderTabButton( - "featured", - translateText("map.featured"), - )} - ${this.renderTabButton("all", translateText("map.all"))} - ${this.renderTabButton( - "favorites", - translateText("map.favorites"), - )} -
`} + role="tablist" + aria-label="${translateText("map.map")}" + class="flex-1 grid grid-cols-3 gap-2 rounded-xl border border-white/10 bg-black/20 p-1" + > + ${this.renderTabButton( + "featured", + translateText("map.featured"), + )} + ${this.renderTabButton("all", translateText("map.all"))} + ${this.renderTabButton( + "favorites", + translateText("map.favorites"), + )} +
+ ${this.activeTab === "all" ? this.renderExpandToggle() : null}`}
${isSearching ? this.renderSearchResults() : this.renderActiveTab()}