Skip to content

Commit aa5f0d2

Browse files
committed
feat(rank): add support for "Ranked Premade 5x5" queue type
- Updated `QueueType` enum and related bindings to include `RANKED_PREMADE_5x5`. - Added test coverage to ensure proper deserialization of the new queue type. - Synchronized widget and utility behavior for improved compatibility.
1 parent 954b22f commit aa5f0d2

13 files changed

Lines changed: 67 additions & 35 deletions

File tree

Cargo.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"linter": {
2121
"enabled": true,
2222
"rules": {
23-
"recommended": true,
23+
"preset": "recommended",
2424
"complexity": {
2525
"noExcessiveCognitiveComplexity": {
2626
"level": "error",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "league-jax",
33
"private": true,
4-
"version": "0.2.5",
4+
"version": "0.2.6",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

public/tauri.svg

Lines changed: 10 additions & 4 deletions
Loading

site/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
<a href="#screenshots" data-i18n="navScreenshots">Screenshots</a>
3131
<a href="#open-source" data-i18n="navOpenSource">Open Source</a>
3232
</nav>
33-
<div class="language-switcher" aria-label="Language switcher">
33+
<fieldset class="language-switcher" aria-label="Language switcher">
3434
<button class="is-active" type="button" data-language="en">EN</button>
3535
<button type="button" data-language="zh">中文</button>
3636
<button type="button" data-language="ja">日本語</button>
37-
</div>
37+
</fieldset>
3838
</header>
3939

4040
<main id="top">
@@ -70,7 +70,7 @@ <h1 data-i18n="heroTitle">LeagueJax</h1>
7070
</p>
7171
</div>
7272

73-
<div class="status-board" aria-label="LeagueJax product preview">
73+
<section class="status-board" aria-label="LeagueJax product preview">
7474
<div class="status-bar">
7575
<span></span>
7676
<span></span>
@@ -99,7 +99,7 @@ <h2 data-i18n="previewTitle">Champion select context</h2>
9999
<span data-i18n="previewUpdaterCaption">direct installer links</span>
100100
</section>
101101
</div>
102-
</div>
102+
</section>
103103
</section>
104104

105105
<section class="section band" id="features">
@@ -367,7 +367,7 @@ <h2 data-i18n="originTitle">Why it exists</h2>
367367
aria-labelledby="lightboxTitle"
368368
>
369369
<div class="lightbox-header">
370-
<h2 id="lightboxTitle"></h2>
370+
<h2 id="lightboxTitle">Screenshot preview</h2>
371371
<button
372372
class="lightbox-close"
373373
type="button"

site/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,9 @@ const openScreenshotPreview = (button) => {
379379

380380
const titleKey = button.getAttribute("data-preview-title-key");
381381
const dictionary = translations[currentLanguage] || translations.en;
382-
lightboxTitle.textContent = titleKey ? dictionary[titleKey] || "" : "";
382+
lightboxTitle.textContent = titleKey
383+
? dictionary[titleKey] || "Screenshot preview"
384+
: "Screenshot preview";
383385
lightboxImage.src = image;
384386
lightboxImage.alt = button.getAttribute("data-preview-alt") || "";
385387
screenshotLightbox.hidden = false;

site/styles.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ button {
147147
}
148148

149149
.language-switcher {
150+
min-inline-size: 0;
151+
margin: 0;
152+
border: 0;
150153
gap: 6px;
154+
padding: 0;
151155
}
152156

153157
.language-switcher button {

src-tauri/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "league-jax"
3-
version = "0.2.5"
3+
version = "0.2.6"
44
description = "A League of Legends toolkit built with Tauri"
55
authors = ["tarnishablec@outlook.com"]
66
edition = "2021"
@@ -129,5 +129,6 @@ workspace = true
129129

130130

131131

132+
132133

133134

src-tauri/src/shards/lcu/concepts/rank.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ pub enum Division {
4040
pub enum QueueType {
4141
#[serde(rename = "RANKED_SOLO_5x5")]
4242
RankedSolo5x5,
43+
#[serde(rename = "RANKED_PREMADE_5x5")]
44+
RankedPremade5x5,
4345
#[serde(rename = "RANKED_FLEX_SR")]
4446
RankedFlexSr,
4547
#[serde(rename = "RANKED_TFT")]
@@ -238,7 +240,8 @@ pub fn mmr_reference_scale() -> MmrReferenceScale {
238240

239241
#[cfg(test)]
240242
mod tests {
241-
use super::{mmr_reference_scale, Tier};
243+
use super::{mmr_reference_scale, QueueType, Tier};
244+
use std::collections::HashMap;
242245

243246
#[test]
244247
fn mmr_reference_scale_keeps_rank_anchors_contiguous_until_diamond() {
@@ -274,4 +277,21 @@ mod tests {
274277
assert_eq!(anchor.max_mmr_inclusive, None);
275278
}
276279
}
280+
281+
#[test]
282+
fn queue_type_accepts_ranked_premade_5x5_map_keys() {
283+
let queue_map = serde_json::json!({
284+
"RANKED_PREMADE_5x5": {
285+
"wins": 0
286+
}
287+
});
288+
289+
let parsed: Result<HashMap<QueueType, serde_json::Value>, _> =
290+
serde_json::from_value(queue_map);
291+
292+
assert!(matches!(
293+
parsed,
294+
Ok(map) if map.contains_key(&QueueType::RankedPremade5x5)
295+
));
296+
}
277297
}

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
33
"productName": "LeagueJax",
4-
"version": "0.2.5",
4+
"version": "0.2.6",
55
"identifier": "com.tarnishablec.league-jax",
66
"build": {
77
"beforeDevCommand": "bun run dev",

0 commit comments

Comments
 (0)