From 6cc7a537b64157bf62dbff804ab0dadf23131852 Mon Sep 17 00:00:00 2001 From: akanyan Date: Sun, 27 Apr 2025 05:56:04 +0000 Subject: [PATCH] feat: remember current tab --- CHANGELOG.md | 8 ++++++ rust/src/lib.rs | 2 +- rust/tauri.conf.json | 2 +- src/components/App.vue | 41 ++++++++++++++++++----------- src/components/PatchList.vue | 20 +++++++++++--- src/components/ProfileListEntry.vue | 38 ++++++++++++++++---------- src/components/StartButton.vue | 4 +-- src/components/options/Display.vue | 2 +- src/i18n/en.ts | 1 + src/stores.ts | 9 ++++++- 10 files changed, 86 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6aadb84..fb8b11d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.16.0 + +- Fixed the clear cache button not working +- Fixed Linux builds +- Moved the store tab to the left +- STARTLINER now remembers the recently open tab and re-opens it on the next session +- Added "Beta" to the title as STARTLINER is approaching feature-completeness + ## 0.15.0 - Added internationalization diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 7863a9a..da036bf 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -336,7 +336,7 @@ async fn update(app: tauri::AppHandle) -> tauri_plugin_updater::Result<()> { fn open_window(apph: AppHandle) -> anyhow::Result<()> { let config = apph.config().clone(); tauri::WebviewWindowBuilder::new(&apph, "main", tauri::WebviewUrl::App("index.html".into())) - .title(format!("STARTLINER {}", config.version.unwrap_or_default())) + .title(format!("STARTLINER {} Beta", config.version.unwrap_or_default())) .inner_size(900f64, 600f64) .min_inner_size(900f64, 600f64) .build()?; diff --git a/rust/tauri.conf.json b/rust/tauri.conf.json index ff18264..3e3c1a2 100644 --- a/rust/tauri.conf.json +++ b/rust/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "STARTLINER", - "version": "0.15.0", + "version": "0.16.0", "identifier": "zip.patafour.startliner", "build": { "beforeDevCommand": "bun run dev", diff --git a/src/components/App.vue b/src/components/App.vue index 6817f8c..826f63c 100644 --- a/src/components/App.vue +++ b/src/components/App.vue @@ -20,7 +20,6 @@ import OptionList from './OptionList.vue'; import PatchList from './PatchList.vue'; import ProfileList from './ProfileList.vue'; import StartButton from './StartButton.vue'; -import { invoke } from '../invoke'; import { useClientStore, useGeneralStore, @@ -36,10 +35,10 @@ const prf = usePrfStore(); const general = useGeneralStore(); const client = useClientStore(); +client.load(); + pkg.setupListeners(); -const currentTab: Ref<'users' | 'loc' | 'patches' | 'rmt' | 'cfg' | 'info'> = - ref('users'); const pkgSearchTerm = ref(''); const isProfileDisabled = computed(() => prf.current === null); @@ -60,7 +59,6 @@ onMounted(async () => { await Promise.all([prf.reloadList(), prf.reload()]); if (prf.current !== null) { - currentTab.value = 'loc'; await pkg.reloadAll(); } @@ -205,10 +203,11 @@ listen('download-progress', (event) => { ('download-progress', (event) => {
+
@@ -224,13 +230,7 @@ listen('download-progress', (event) => { value="patches" >
-
+
@@ -243,13 +243,17 @@ listen('download-progress', (event) => {
('download-progress', (event) => { -
+
import { Ref, ref } from 'vue'; +// import Select from 'primevue/select'; import * as path from '@tauri-apps/api/path'; import OptionCategory from './OptionCategory.vue'; import PatchEntry from './PatchEntry.vue'; @@ -32,8 +33,6 @@ invoke('list_patches', { target: prf.current!.data.sgt.target }).then( target: amd, })) as Patch[]; })(); - -const errorMessage = t('patch.noneFound'); diff --git a/src/components/ProfileListEntry.vue b/src/components/ProfileListEntry.vue index 25e8843..7451528 100644 --- a/src/components/ProfileListEntry.vue +++ b/src/components/ProfileListEntry.vue @@ -73,10 +73,12 @@ const promptDeleteProfile = async () => { const dataExists = ref(false); -path.join(general.dataDir, `profile-${props.p!.game}-${props.p!.name}`).then( - async (p) => { - dataExists.value = await invoke('file_exists', { path: p }); - } +general.dataDir.then((dataDir) => + path + .join(dataDir, `profile-${props.p!.game}-${props.p!.name}`) + .then(async (p) => { + dataExists.value = await invoke('file_exists', { path: p }); + }) ); @@ -145,11 +147,15 @@ path.join(general.dataDir, `profile-${props.p!.game}-${props.p!.name}`).then( class="self-center" style="width: 2rem; height: 2rem" @click=" - path - .join(general.configDir, `profile-${p!.game}-${p!.name}`) - .then(async (path) => { - await invoke('open_file', { path }); - }) + async () => + path + .join( + await general.configDir, + `profile-${p!.game}-${p!.name}` + ) + .then(async (path) => { + await invoke('open_file', { path }); + }) " />
diff --git a/src/components/StartButton.vue b/src/components/StartButton.vue index a3b1961..5ee9e17 100644 --- a/src/components/StartButton.vue +++ b/src/components/StartButton.vue @@ -194,9 +194,7 @@ const tryStart = () => { } " /> - - - +