From 38e16bf409e256bf5eb9892360f9d66f980a760c Mon Sep 17 00:00:00 2001 From: TheBiemGamer <47662596+TheBiemGamer@users.noreply.github.com> Date: Mon, 9 Nov 2026 14:12:33 +0100 Subject: [PATCH 1/3] fix: show Epic updates from Legendary's assets.json Legendary's list-installed --json never carried update_available or remote_version, so Epic games never showed an update. Compare each installed version with the build_version that assets.json has for that app on its platform. Every list --json refreshes that file for the installed platforms. --- src-tauri/src/library/epic.rs | 86 ++++++++++++++++++++++++++++------- 1 file changed, 70 insertions(+), 16 deletions(-) diff --git a/src-tauri/src/library/epic.rs b/src-tauri/src/library/epic.rs index dadbc88..f1866b4 100644 --- a/src-tauri/src/library/epic.rs +++ b/src-tauri/src/library/epic.rs @@ -234,14 +234,41 @@ fn has_cloud_saves(metadata: &Value) -> bool { !metadata["customAttributes"]["CloudSaveFolder"].is_null() } -/// Legendary's installed games, as `list-installed --json` lists them: the values of its `installed.json`. No file -/// means nothing is installed; an unreadable one is an error, so a scan keeps what it knew. +/// Legendary's installed games, as `list-installed --json` lists them: the values of its `installed.json`, with +/// `remote_version` from `assets.json` (`with_remote_versions`). No file means nothing is installed; an unreadable one +/// is an error, so a scan keeps what it knew. fn installed() -> Result { - let path = config_dir().ok_or("no home folder")?.join("installed.json"); - match std::fs::read(&path) { - Ok(bytes) => installed_from(&bytes), - Err(e) if e.kind() == ErrorKind::NotFound => Ok(Value::Array(Vec::new())), - Err(e) => Err(e.into()), + let dir = config_dir().ok_or("no home folder")?; + let mut installed = match std::fs::read(dir.join("installed.json")) { + Ok(bytes) => installed_from(&bytes)?, + Err(e) if e.kind() == ErrorKind::NotFound => return Ok(Value::Array(Vec::new())), + Err(e) => return Err(e.into()), + }; + // Unreadable or missing, it marks no updates. + let assets = std::fs::read(dir.join("assets.json")) + .ok() + .and_then(|bytes| serde_json::from_slice(&bytes).ok()) + .unwrap_or(Value::Null); + with_remote_versions(&mut installed, &assets); + Ok(installed) +} + +/// Gives each installed entry the `remote_version` that `assets.json` (`{platform: [{app_name, build_version, …}]}`, +/// refreshed for every installed platform by each `list --json`) has for its app on its platform, as +/// `list-installed --check-updates` compares them. +fn with_remote_versions(installed: &mut Value, assets: &Value) { + for g in installed.as_array_mut().into_iter().flatten() { + let platform = g["platform"].as_str().unwrap_or("Windows"); + let remote = assets[platform] + .as_array() + .into_iter() + .flatten() + .find(|a| a["app_name"] == g["app_name"]) + .and_then(|a| a["build_version"].as_str()) + .map(str::to_owned); + if let Some(remote) = remote { + g["remote_version"] = remote.into(); + } } } @@ -813,13 +840,11 @@ fn game(name: &str, title: &str, installed: Option<&Value>, art: Art) -> Game { } } -/// An installed entry marks an update with `update_available`, or by a `remote_version` that differs from `version`. // shortcut: both spellings are read because no real capture with an update exists yet. +/// An installed entry has an update when its `remote_version` (`with_remote_versions`) differs from `version`. fn has_update(local: &Value) -> bool { - local["update_available"].as_bool().unwrap_or_else(|| { - local["remote_version"] - .as_str() - .is_some_and(|remote| local["version"].as_str().is_some_and(|v| v != remote)) - }) + local["remote_version"] + .as_str() + .is_some_and(|remote| local["version"].as_str().is_some_and(|v| v != remote)) } /// Epic catalog `keyImages`: tall box art is the cover, the wide one is header and hero. @@ -962,15 +987,44 @@ mod tests { // Fortnite: the store's version differs. Imported: no remote version, so no update. assert!(all[0].update_available); assert!(!all[2].update_available); - let flagged = - serde_json::json!([{ "app_name": "A", "version": "1", "update_available": true }]); - assert!(games(&Value::Null, &flagged)[0].update_available); let same = serde_json::json!([{ "app_name": "A", "version": "1", "remote_version": "1" }]); assert!(!games(&Value::Null, &same)[0].update_available); // Not installed: nothing to update. assert!(!all[1].update_available); } + #[test] + fn assets_give_the_remote_version() { + let assets = serde_json::json!({ + "Windows": [ + { "app_name": "Old", "build_version": "2" }, + { "app_name": "Current", "build_version": "1" }, + { "app_name": "MacOnly", "build_version": "9" } + ], + "Mac": [{ "app_name": "Mac", "build_version": "1" }] + }); + let mut installed = serde_json::json!([ + { "app_name": "Old", "version": "1", "platform": "Windows" }, + { "app_name": "Current", "version": "1", "platform": "Windows" }, + { "app_name": "Missing", "version": "1", "platform": "Windows" }, + // Only the Windows build is newer; the Mac install is current. + { "app_name": "Mac", "version": "1", "platform": "Mac" }, + { "app_name": "MacOnly", "version": "1", "platform": "Mac" } + ]); + with_remote_versions(&mut installed, &assets); + let mut updates: Vec = games(&Value::Null, &installed) + .into_iter() + .filter(|g| g.update_available) + .map(|g| g.external_id) + .collect(); + updates.sort(); + assert_eq!(updates, ["Old"]); + // No assets.json: no updates. + let mut installed = serde_json::json!([{ "app_name": "Old", "version": "1" }]); + with_remote_versions(&mut installed, &Value::Null); + assert!(!games(&Value::Null, &installed)[0].update_available); + } + #[test] fn installed_json_lists_its_entries() { let bytes = br#"{"Fortnite": {"app_name": "Fortnite", "install_path": "C:\\Fn"}}"#; From 7e8d10d5b9350545a229fe7036ccc2227b8e793c Mon Sep 17 00:00:00 2001 From: TheBiemGamer <47662596+TheBiemGamer@users.noreply.github.com> Date: Mon, 9 Nov 2026 14:33:21 +0100 Subject: [PATCH 2/3] feat: Wine prefix row on the game page's Installation tab On Linux, once a Windows game has run, its Installation tab gets a Wine prefix row with Open, winecfg and winetricks, disabled with the same reason as in Settings when winetricks isn't available. Never for a native Linux GOG build, and without Remove, which stays in Settings and the uninstall confirm. --- DESIGN.md | 2 +- src-tauri/src/commands/game.rs | 12 +++++------ src-tauri/src/commands/wine.rs | 24 +++++++++++++++++++++ src-tauri/src/main.rs | 1 + src/lib/Detail.svelte | 39 ++++++++++++++++++++++++++++++++++ src/lib/bindings.ts | 10 +++++++++ src/lib/i18n/en.json | 3 ++- src/lib/i18n/nl.json | 3 ++- 8 files changed, 85 insertions(+), 9 deletions(-) diff --git a/DESIGN.md b/DESIGN.md index 5cee21b..0a82ea6 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -219,7 +219,7 @@ No UI text below 11px. Counts and numbers use tabular figures. Folder paths in t - **Toolbar,** left to right: search, store selector, Installed, active filter chips, Filters, spacer, Sort, Update (only when one is ready), Downloads (only while something downloads), Add a game, Settings. No sidebar. - **Settings:** a modal panel, max 760px wide, with a 190px section list on the left (stacked under 640px) that works as vertical tabs: only the chosen section shows, from its top. Sections: Accounts (Stores, then Game data with IGDB and SteamGridDB), General, About. Each section is a title, then Label headings over one rounded `glass` group per heading, its rows split by `glass-line` rules. Never a box per row. On Linux a Wine section sits between General and About (Windows never shows it): umu-launcher, with Install only while it is missing; Proton, one row per build found with Default and From Steam as the only labels, Make default (Use newest on an explicit default), and Remove with an inline confirm for builds Guild installed only; Install Proton with GE-Proton and Proton-CachyOS chips that fold out their releases, each with Install (its percent while it runs) or Installed; Prefixes, one row per game prefix with its name (the copy key once the game is gone), its size once measured, Open folder, winecfg, winetricks (disabled with a one-line reason when neither the system nor any Proton build has it) and Remove, whose inline confirm says saves in it are lost unless cloud saves are on. About opens with the 64px app logo beside Guild and its version, the acronym in small italic `text-3`, one line on what Guild is for, and Source code · GPL-3.0 · Credits (the README's Thanks); its Updates row then says only what the last check found. -- **Game page:** covers the content area while the library stays mounted underneath, so its scroll position survives. A column up to 1360px: the 300px hero, a tab row (Overview, DLC, Saves, Launch options, Installation); on Linux, Launch options adds a Proton menu chip (Default follows Settings), also for added games, where it is the only row, and never for a native Linux GOG build. A Windows game's first launch on Linux shows Setting up… in the busy pill, the card badge and Continue until its program runs. Its uninstall confirm offers an Also remove its Wine prefix checkbox, off by default, then three fact tiles and an About / Details grid (1.7fr / 1fr). +- **Game page:** covers the content area while the library stays mounted underneath, so its scroll position survives. A column up to 1360px: the 300px hero, a tab row (Overview, DLC, Saves, Launch options, Installation); on Linux, Launch options adds a Proton menu chip (Default follows Settings), also for added games, where it is the only row, and never for a native Linux GOG build. A Windows game's first launch on Linux shows Setting up… in the busy pill, the card badge and Continue until its program runs. Once a Windows game has run on Linux, Installation gets a Wine prefix row with Open, winecfg and winetricks (disabled with the same reason as in Settings); never for a native Linux build, and never Remove, which stays in Settings and the uninstall confirm. Its uninstall confirm offers an Also remove its Wine prefix checkbox, off by default, then three fact tiles and an About / Details grid (1.7fr / 1fr). ## Elevation and shapes diff --git a/src-tauri/src/commands/game.rs b/src-tauri/src/commands/game.rs index 910f05e..5b6a1b9 100644 --- a/src-tauri/src/commands/game.rs +++ b/src-tauri/src/commands/game.rs @@ -961,12 +961,7 @@ fn has_launch_options(g: &Game) -> bool { pub async fn protons(app: AppHandle, key: String) -> Vec { let game = app.state::().game(&key); blocking(move || { - let native = game - .as_ref() - .filter(|g| g.provider == ProviderKind::Gog) - .and_then(installed_dir) - .is_some_and(|dir| gog::native(dir)); - if native { + if game.as_ref().is_some_and(native_build) { Vec::new() } else { crate::platform::protons() @@ -975,6 +970,11 @@ pub async fn protons(app: AppHandle, key: String) -> Vec { .await } +/// A GOG game installed as its native Linux build, which runs without Proton. +pub(super) fn native_build(game: &Game) -> bool { + game.provider == ProviderKind::Gog && installed_dir(game).is_some_and(|dir| gog::native(dir)) +} + /// The Launch options tab of an installed Epic, GOG or Amazon copy; `None` for others. #[tauri::command] #[specta::specta] diff --git a/src-tauri/src/commands/wine.rs b/src-tauri/src/commands/wine.rs index 6896067..32a41ec 100644 --- a/src-tauri/src/commands/wine.rs +++ b/src-tauri/src/commands/wine.rs @@ -85,6 +85,30 @@ pub async fn prefix_sizes() -> Vec { .await } +#[derive(Serialize, specta::Type)] +pub struct GamePrefix { + /// Whether winetricks can run in it: the system's, or one a Proton build here bundles. + winetricks: bool, +} + +/// The Wine prefix of a copy, for its game page: only on Linux, once its game has run, and never for a native Linux +/// build. +#[tauri::command] +#[specta::specta] +pub async fn game_prefix(app: AppHandle, key: String) -> Option { + let game = app.state::().game(&key); + blocking(move || { + if game.as_ref().is_some_and(super::game::native_build) { + return None; + } + platform::prefixes().iter().find(|(k, _)| *k == key)?; + Some(GamePrefix { + winetricks: platform::runner()?.winetricks, + }) + }) + .await +} + /// Whether the copy `key` is the game watched as running. fn runs(app: &AppHandle, key: &str) -> bool { let state = app.state::(); diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index f6e5db0..42888e3 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -157,6 +157,7 @@ fn bindings() -> tauri_specta::Builder { commands::wine::remove_proton, commands::wine::wine_prefixes, commands::wine::prefix_sizes, + commands::wine::game_prefix, commands::wine::remove_prefix, commands::wine::open_prefix, commands::wine::run_in_prefix, diff --git a/src/lib/Detail.svelte b/src/lib/Detail.svelte index f2a958f..f8d2e43 100644 --- a/src/lib/Detail.svelte +++ b/src/lib/Detail.svelte @@ -51,6 +51,7 @@ type Detail, type Dlc, type GameInfo, + type GamePrefix, type LaunchOptions, type LinkKind, type Progress, @@ -501,6 +502,26 @@ // A tab that went away (the DLC list emptied, the copy was uninstalled) falls back to Overview. const current = $derived(tabs.some((t) => t.id === tab) ? tab : 'overview') + /** Linux: the copy's Wine prefix, asked again each time Installation opens, since the first launch makes it. */ + let winePrefix = $state(null) + let winePrefixOf: string | null = null + $effect(() => { + const key = launchKey + if (key !== winePrefixOf) { + winePrefix = null + winePrefixOf = key + } + if (!key || current !== 'installation') return + let alive = true + commands.gamePrefix(key).then( + (p) => alive && (winePrefix = p), + () => {}, + ) + return () => { + alive = false + } + }) + const showAbout = $derived(!!info && (info.description !== '' || info.screenshots.length > 0)) // Every store game has a store page, so Details always has something to show. const showDetails = $derived(!!game && !custom) @@ -854,6 +875,24 @@ {/if} {/if} + {#if winePrefix} + {@const key = copy!.key} +
+ {t('detail.winePrefix')} + + + + + {#snippet children({ props })} + + + + {/snippet} + +
+ {/if} {#if copy!.updateAvailable}
{t('detail.version')} diff --git a/src/lib/bindings.ts b/src/lib/bindings.ts index 4629aae..4bcbcb3 100644 --- a/src/lib/bindings.ts +++ b/src/lib/bindings.ts @@ -192,6 +192,11 @@ export const commands = { winePrefixes: () => __TAURI_INVOKE("wine_prefixes"), /** Each prefix's size on disk, walked in the background. */ prefixSizes: () => __TAURI_INVOKE("prefix_sizes"), + /** + * The Wine prefix of a copy, for its game page: only on Linux, once its game has run, and never for a native Linux + * build. + */ + gamePrefix: (key: string) => __TAURI_INVOKE("game_prefix", { key }), /** Deletes a copy's prefix, saves and all; not while its game runs. */ removePrefix: (key: string) => __TAURI_INVOKE("remove_prefix", { key }), /** Opens a copy's prefix folder. */ @@ -422,6 +427,11 @@ export type GameInfo = { hasDlc?: boolean | null, }; +export type GamePrefix = { + /** Whether winetricks can run in it: the system's, or one a Proton build here bundles. */ + winetricks: boolean, +}; + export type GridCover = { /** The full image, passed back to `save_custom_game`. */ url: string, diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json index 00b7a5c..3b12ab7 100644 --- a/src/lib/i18n/en.json +++ b/src/lib/i18n/en.json @@ -590,5 +590,6 @@ "msg.noWinetricks": "winetricks isn't installed, and this game's Proton build doesn't include it.", "busy.settingUp": "Setting up…", "detail.removePrefix": "Also remove its Wine prefix", - "settings.protonNow": "Proton: {name}" + "settings.protonNow": "Proton: {name}", + "detail.winePrefix": "Wine prefix" } diff --git a/src/lib/i18n/nl.json b/src/lib/i18n/nl.json index 76c8651..418e7fb 100644 --- a/src/lib/i18n/nl.json +++ b/src/lib/i18n/nl.json @@ -590,5 +590,6 @@ "msg.noWinetricks": "winetricks is niet geïnstalleerd en zit niet in de Proton-versie van deze game.", "busy.settingUp": "Instellen…", "detail.removePrefix": "Ook de Wine-prefix verwijderen", - "settings.protonNow": "Proton: {name}" + "settings.protonNow": "Proton: {name}", + "detail.winePrefix": "Wine-prefix" } From 364273e319b6c87889927ca637482483e02c0bfe Mon Sep 17 00:00:00 2001 From: TheBiemGamer <47662596+TheBiemGamer@users.noreply.github.com> Date: Mon, 9 Nov 2026 14:37:12 +0100 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20redesign=20Settings=20=E2=86=92=20W?= =?UTF-8?q?ine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Proton for Windows games is one menu on top: Newest, naming the build that is now, then each build found. The Proton builds list shows readable names, an in use tag, a Steam tag and each build's size, with Remove for Guild's own builds only. Install another build opens one panel with a GE-Proton / Proton-CachyOS switch. The umu-launcher row shows only while umu is missing. Prefixes show name and size with Open folder, winecfg, winetricks and Remove behind a ⋯ menu, and the heading gives their count and total size. --- DESIGN.md | 10 +- scripts/format.test.ts | 9 + src-tauri/src/commands/wine.rs | 32 ++-- src-tauri/src/main.rs | 2 +- src-tauri/src/platform.rs | 14 ++ src/lib/ActionMenu.svelte | 139 +++++++++++++++ src/lib/Settings.svelte | 312 ++++++++++++++++++++++++--------- src/lib/bindings.ts | 20 ++- src/lib/format.ts | 8 + src/lib/i18n/en.json | 17 +- src/lib/i18n/nl.json | 17 +- 11 files changed, 468 insertions(+), 112 deletions(-) create mode 100644 src/lib/ActionMenu.svelte diff --git a/DESIGN.md b/DESIGN.md index 0a82ea6..544bdf6 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -178,7 +178,7 @@ The last-played game's art, heavily blurred and saturated, tints the whole windo - **Base:** `bg`, `surface`, `surface-2` and `line`, a near-black blue-violet. Text is `text`, `text-2` (white 75%), `text-3` (white 50%) and `muted`. - **Glass:** `glass`, `glass-strong`, `glass-hover`, `glass-line`, `glass-on`, `glass-on-line` fill and border every bar, chip, field, notice and panel. Don't invent a new alpha. - **White pill** (`pill`, `pill-hover`): the primary action only (Play, Install, Log in). Written as literals in `app.css` (`button.pill`). -- **Accent violet** (`accent`, `accent-2`): toggles that are on, links in Settings, progress bars and the Update chip's arrow. Never the main call to action. +- **Accent violet** (`accent`, `accent-2`): toggles that are on, links in Settings, progress bars, the Update chip's arrow and the Proton build that is in use (Settings → Wine). Never the main call to action. - **Status:** - `play` green: a running game only (the Playing badge and the card ring). - `warn` amber: a store needs attention. @@ -218,7 +218,11 @@ No UI text below 11px. Counts and numbers use tabular figures. Folder paths in t | Title | none | - **Toolbar,** left to right: search, store selector, Installed, active filter chips, Filters, spacer, Sort, Update (only when one is ready), Downloads (only while something downloads), Add a game, Settings. No sidebar. -- **Settings:** a modal panel, max 760px wide, with a 190px section list on the left (stacked under 640px) that works as vertical tabs: only the chosen section shows, from its top. Sections: Accounts (Stores, then Game data with IGDB and SteamGridDB), General, About. Each section is a title, then Label headings over one rounded `glass` group per heading, its rows split by `glass-line` rules. Never a box per row. On Linux a Wine section sits between General and About (Windows never shows it): umu-launcher, with Install only while it is missing; Proton, one row per build found with Default and From Steam as the only labels, Make default (Use newest on an explicit default), and Remove with an inline confirm for builds Guild installed only; Install Proton with GE-Proton and Proton-CachyOS chips that fold out their releases, each with Install (its percent while it runs) or Installed; Prefixes, one row per game prefix with its name (the copy key once the game is gone), its size once measured, Open folder, winecfg, winetricks (disabled with a one-line reason when neither the system nor any Proton build has it) and Remove, whose inline confirm says saves in it are lost unless cloud saves are on. About opens with the 64px app logo beside Guild and its version, the acronym in small italic `text-3`, one line on what Guild is for, and Source code · GPL-3.0 · Credits (the README's Thanks); its Updates row then says only what the last check found. +- **Settings:** a modal panel, max 760px wide, with a 190px section list on the left (stacked under 640px) that works as vertical tabs: only the chosen section shows, from its top. Sections: Accounts (Stores, then Game data with IGDB and SteamGridDB), General, About. Each section is a title, then Label headings over one rounded `glass` group per heading, its rows split by `glass-line` rules. Never a box per row. About opens with the 64px app logo beside Guild and its version, the acronym in small italic `text-3`, one line on what Guild is for, and Source code · GPL-3.0 · Credits (the README's Thanks); its Updates row then says only what the last check found. On Linux a Wine section sits between General and About (Windows never shows it), direction A (2026-11-09): + - The top group: an umu-launcher row with Install only while umu is missing, then Proton for Windows games, one menu (Newest, naming the build that is now, then each build) with the subtitle that a game's own choice in Launch options comes first. + - Proton builds: one row per build, by a readable name where the folder name allows ("Proton-CachyOS 11.0 (v3)", `protonName` in `format.ts`), with an accent "in use" tag on the build games run with, a "Steam" tag on Steam's, its size once measured, and Remove with an inline confirm for Guild's own only. The last row, Install another build, folds out one panel with a GE-Proton / Proton-CachyOS segmented control and that source's releases, each with Install (its percent while it runs) or Installed. + - Prefixes: the heading carries the count and total size on the right. One row per game prefix with its name (the copy key and "Game no longer in your library" once the game is gone), its size once measured, and a ⋯ menu with Open folder, winecfg, winetricks (disabled when neither the system nor any Proton build has it; a note under the group says why) and Remove…, which asks in the row that saves in it are lost unless cloud saves are on, with focus on Cancel. + - Rows in these two lists are one height, with or without a button. - **Game page:** covers the content area while the library stays mounted underneath, so its scroll position survives. A column up to 1360px: the 300px hero, a tab row (Overview, DLC, Saves, Launch options, Installation); on Linux, Launch options adds a Proton menu chip (Default follows Settings), also for added games, where it is the only row, and never for a native Linux GOG build. A Windows game's first launch on Linux shows Setting up… in the busy pill, the card badge and Continue until its program runs. Once a Windows game has run on Linux, Installation gets a Wine prefix row with Open, winecfg and winetricks (disabled with the same reason as in Settings); never for a native Linux build, and never Remove, which stays in Settings and the uninstall confirm. Its uninstall confirm offers an Also remove its Wine prefix checkbox, off by default, then three fact tiles and an About / Details grid (1.7fr / 1fr). ## Elevation and shapes @@ -252,6 +256,7 @@ No UI text below 11px. Counts and numbers use tabular figures. Folder paths in t - **Popovers** (Filters, Sort, Downloads, Notes, the ⋯ menu, Play with): `surface-2`, `glass-on-line` border, 12px radius, modal shadow. - Filters, Downloads, Update and Notes are bits-ui `Popover`s: focus moves in on open, Tab stays inside, Escape closes only the top one and returns focus to its button, a click outside closes, and mouse Back and Forward leave them open (`keepOnBackForward`). They follow their button, flip and shift to stay inside the window, and don't lock page scroll. Escape in the Filters rename field cancels only the rename. - Sort, Language (Settings and the install panel), Proton, the install folder menu and Play with are bits-ui `DropdownMenu`s (`ChoiceMenu.svelte`, `PlayButton.svelte`): the caller's chip is the trigger, focus starts on the chosen item, arrows, Home, End and typing a letter move between items, Escape or a pick returns focus to the chip. Mouse Back and Forward leave them open (`keepOnBackForward`). + - A Settings prefix row's ⋯ menu (`ActionMenu.svelte`) is a bits-ui `DropdownMenu` too: focus starts on the first item that can run, a disabled item stays listed, and a pick returns focus to ⋯ (Remove… moves it to the row's Cancel instead). - The game menu (`GameMenu.svelte`) is a bits-ui `DropdownMenu` too: on the game page the ⋯ button is its trigger; a card's right-click opens the one instance in `App.svelte` at the pointer, and a grid scroll closes it. Focus starts on the first item. Right opens Add to collection, Left or Escape closes only the submenu. Menu and submenu flip and shift to stay 8px inside the window. Keys typed into the new collection's name stay in the field, and while it is open hovering does not move focus; Escape there cancels only the name. - The import pickers in Settings (Epic, Amazon) are a bits-ui `Combobox` (`GamePicker.svelte`): the Settings field look, the menu look for the list, opening with the first game picked. Typing filters by part of the title and clears the pick, so Import stays disabled until a game is chosen; a query matching nothing shows one row, "No game with that name". Emptying the field brings back the full list with the first game picked. Arrows and Enter pick, Escape closes only the list, and the list sits above the Settings dialog (z-index 50). Mouse Back and Forward leave it open (`keepOnBackForward`). - Bits-ui menus keep Tab inside the menu (WAI-ARIA menu pattern), and open a submenu on hover as well as Right. None lock page scroll (`preventScroll={false}`): bits-ui's lock also turns off pointer events on the page, which swallowed the first click outside, so moving from one open menu to another chip took two clicks. @@ -320,6 +325,7 @@ No UI text below 11px. Counts and numbers use tabular figures. Folder paths in t - About header A: logo, name, version and acronym, no Made by and no credit list in the app; Credits links to the README (2026-11-09). - Downloads popover layout F2: one two-line row per download where the row itself is the progress bar (2026-11-07). - Install panel direction A: beside the cover in the library, inline under Install on the game page, real folder and drive space, DLC chosen there (2026-11-09). +- Settings → Wine direction A: Proton for Windows games as one menu on top, builds listed with their source, one Install another build panel, prefix actions behind ⋯ (2026-11-09). - Installation tab layout C: rows named after what they're about, words only, no icons (2026-11-08). - Non-goals: a light theme, achievements, friends, chat, store browsing, macOS. diff --git a/scripts/format.test.ts b/scripts/format.test.ts index e951aa3..d954403 100644 --- a/scripts/format.test.ts +++ b/scripts/format.test.ts @@ -8,6 +8,7 @@ import { playtimeLabel, progressLong, progressShort, + protonName, sizeLabel, syncedLabel, ttbLabel, @@ -131,3 +132,11 @@ test('a picked program suggests its file name', () => { assert.equal(nameFromExe('C:/Games/Celeste/Celeste.EXE'), 'Celeste') assert.equal(nameFromExe('D:\\Emu\\pcsx2-qt.v1.7.exe'), 'pcsx2-qt.v1.7') }) + +test('protonName reads Proton folder names', () => { + assert.equal(protonName('proton-cachyos-11.0-20261015-slr-x86_64_v3'), 'Proton-CachyOS 11.0 (v3)') + assert.equal(protonName('proton-cachyos-10.0-20250714-slr-x86_64'), 'Proton-CachyOS 10.0') + assert.equal(protonName('GE-Proton11-12-x86_64'), 'GE-Proton11-12') + assert.equal(protonName('GE-Proton11-12'), 'GE-Proton11-12') + assert.equal(protonName('Proton - Experimental'), 'Proton - Experimental') +}) diff --git a/src-tauri/src/commands/wine.rs b/src-tauri/src/commands/wine.rs index 32a41ec..1fb775a 100644 --- a/src-tauri/src/commands/wine.rs +++ b/src-tauri/src/commands/wine.rs @@ -64,23 +64,35 @@ pub fn wine_prefixes(app: AppHandle) -> Vec { } #[derive(Serialize, specta::Type)] -pub struct PrefixSize { +pub struct DirSize { + /// A prefix's copy key, or a Proton build's name. key: String, bytes: u64, } -/// Each prefix's size on disk, walked in the background. +#[derive(Serialize, specta::Type)] +pub struct WineSizes { + prefixes: Vec, + protons: Vec, +} + +/// Each prefix's and Proton build's size on disk, walked in the background. #[tauri::command] #[specta::specta] -pub async fn prefix_sizes() -> Vec { +pub async fn wine_sizes() -> WineSizes { blocking(|| { - platform::prefixes() - .into_iter() - .map(|(key, path)| PrefixSize { - key, - bytes: super::settings::dir_size(&path), - }) - .collect() + let sizes = |dirs: Vec<(String, std::path::PathBuf)>| { + dirs.into_iter() + .map(|(key, path)| DirSize { + key, + bytes: super::settings::dir_size(&path), + }) + .collect() + }; + WineSizes { + prefixes: sizes(platform::prefixes()), + protons: sizes(platform::proton_dirs()), + } }) .await } diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 42888e3..9c401a1 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -156,7 +156,7 @@ fn bindings() -> tauri_specta::Builder { commands::wine::install_proton, commands::wine::remove_proton, commands::wine::wine_prefixes, - commands::wine::prefix_sizes, + commands::wine::wine_sizes, commands::wine::game_prefix, commands::wine::remove_prefix, commands::wine::open_prefix, diff --git a/src-tauri/src/platform.rs b/src-tauri/src/platform.rs index 7411b7e..e57cef0 100644 --- a/src-tauri/src/platform.rs +++ b/src-tauri/src/platform.rs @@ -676,6 +676,20 @@ pub fn prefixes() -> Vec<(String, std::path::PathBuf)> { .collect() } +/// Each Proton build found by name, with its folder; none on Windows. +#[cfg(windows)] +pub fn proton_dirs() -> Vec<(String, std::path::PathBuf)> { + Vec::new() +} + +#[cfg(target_os = "linux")] +pub fn proton_dirs() -> Vec<(String, std::path::PathBuf)> { + crate::wine::protons() + .into_iter() + .map(|p| (p.name, p.path)) + .collect() +} + /// Deletes a copy's Wine prefix; Windows has none. #[cfg(windows)] pub fn remove_prefix(_key: &str) -> Result<(), crate::msg::Msg> { diff --git a/src/lib/ActionMenu.svelte b/src/lib/ActionMenu.svelte new file mode 100644 index 0000000..4d94b7b --- /dev/null +++ b/src/lib/ActionMenu.svelte @@ -0,0 +1,139 @@ + + + + + + + {#snippet child({ props })} + {@render trigger({ props })} + {/snippet} + + + + {#snippet child({ props, wrapperProps })} +
+
+ {#each actions as a (a.label)} + {#if a.apart}{/if} + (picked = a)}> + {#snippet child({ props })} + + {/snippet} + + {/each} +
+
+ {/snippet} +
+
+
+ + diff --git a/src/lib/Settings.svelte b/src/lib/Settings.svelte index 75fc422..c228fad 100644 --- a/src/lib/Settings.svelte +++ b/src/lib/Settings.svelte @@ -1,15 +1,16 @@