Open-source Xbox-inspired desktop launcher for Xodus on Linux
TypeScript
feat(settings): manage installed runtime families explicitly
domsvoboda26512ef9ba99
diff --git a/assets/locales/en.json b/assets/locales/en.jsonindex fcca6a2..e9e1820 100644--- a/assets/locales/en.json+++ b/assets/locales/en.json@@ -1,4 +1,20 @@{+ "runtime.default_title": "Default Wine / Proton runtime",+ "runtime.families_current": "This family is up to date.",+ "runtime.families_title": "Per-game runtime families",+ "runtime.families_help": "Choose a family in Game settings. Family updates reuse its existing prefix and local saves. Installing here keeps your current default Wine / Proton selection unchanged.",+ "runtime.families_not_installed": "Not installed as a per-game family",+ "runtime.families_version": "Installed: {{version}}",+ "runtime.families_available": "Available: {{version}}",+ "runtime.families_requires": "Requires backend {{backend}} and launcher {{launcher}} or newer.",+ "runtime.families_cachyos_optin": "Allow this optional experimental CachyOS runtime",+ "runtime.families_prerelease": "Include prereleases",+ "runtime.families_show_cachyos": "Show experimental CachyOS runtime",+ "runtime.families_update": "Update {{name}}",+ "runtime.families_install": "Install {{name}}",+ "runtime.families_installed": "Runtime family installed. Game family choices and local saves were kept.",+ "runtime.families_committed_attention": "The runtime was activated, but finishing setup needs attention. Check its status before retrying.",+ "runtime.families_failed": "The runtime operation could not be completed. Check its status and try again.","auth.sign_out_unknown_help": "Signs out active accounts and removes device registration. Saved Store accounts may remain available.","auth.active_signed_out_unknown": "Active accounts signed out. Refresh account status to check saved Store accounts.","auth.manage_multiple": "Manage multiple accounts",diff --git a/src/renderer/App.tsx b/src/renderer/App.tsxindex e16c095..10a543c 100644--- a/src/renderer/App.tsx+++ b/src/renderer/App.tsx@@ -1,3 +1,4 @@+import {ManagedRuntimeSettings} from './ManagedRuntimeSettings';import {useGameRuntimeReady} from './useGameRuntimeReady';import {useStoreAccess} from './store-access';import {GameRuntimeFields} from './GameRuntimeFields';@@ -1049,7 +1050,7 @@ export function SettingsPage({ data, toast }: { data: AppSnapshot; toast: (value</section><section className="settings-card">- <div className="settings-heading"><div className="settings-icon"><Gamepad2 /></div><div><h2>{ui("ui.nexus_runtime_9578a00")}</h2><p>{data.runtime.installed ? ui("ui.active_ae2c40a", { runtime: runtimeInfo.title, version: runtimeInfo.version }) : ui("ui.no_runtime_selected_b8e7445")}</p></div><span className={`status-label ${data.runtime.installed && runtimeInfo.source === 'Nexus runtime' ? 'ready' : 'unknown'}`}><StatusDot tone={data.runtime.installed && runtimeInfo.source === 'Nexus runtime' ? 'green' : 'amber'} />{!data.runtime.installed ? ui("ui.missing_8af1d32") : runtimeInfo.source === 'Nexus runtime' ? ui("ui.ready_c2e3ac4") : ui("ui.other_runtime_ce6adfb")}</span></div>+ <div className="settings-heading"><div className="settings-icon"><Gamepad2 /></div><div><h2>{ui("runtime.default_title")}</h2><p>{data.runtime.installed ? ui("ui.active_ae2c40a", { runtime: runtimeInfo.title, version: runtimeInfo.version }) : ui("ui.no_runtime_selected_b8e7445")}</p></div><span className={`status-label ${data.runtime.installed && runtimeInfo.source === 'Nexus runtime' ? 'ready' : 'unknown'}`}><StatusDot tone={data.runtime.installed && runtimeInfo.source === 'Nexus runtime' ? 'green' : 'amber'} />{!data.runtime.installed ? ui("ui.missing_8af1d32") : runtimeInfo.source === 'Nexus runtime' ? ui("ui.ready_c2e3ac4") : ui("ui.other_runtime_ce6adfb")}</span></div>{data.runtime.nexusError ? <div className="alert amber"><CircleAlert /><span>{data.runtime.nexusError}</span></div> : null}{data.runtime.error ? <div className="alert amber"><CircleAlert /><span>{uiText(data.runtime.error)}</span></div> : null}{data.runtime.phase ? <div className="runtime-phase"><LoaderCircle className={data.runtime.updating ? 'spin' : ''} /><span>{uiText(data.runtime.phase)}</span></div> : null}<div className="button-row end">@@ -1059,6 +1060,8 @@ export function SettingsPage({ data, toast }: { data: AppSnapshot; toast: (value{data.runtime.updating || runtimeLogs.length > 0 ? <pre className="build-log">{runtimeLogs.join('\n') || ui("ui.waiting_for_output_f05fefe")}</pre> : null}</section>+ <ManagedRuntimeSettings data={data} disabled={Boolean(busy)||data.auth.running||data.backend.updating||data.runtime.updating||Boolean(data.launcherUpdate?.updating)||Boolean(data.gameOperation&&['preparing','running','stopping'].includes(data.gameOperation.status))||data.downloads.some(task=>['queued','running','paused'].includes(task.status))} onBusyChange={value=>setBusy(value?'managed-runtime':undefined)}/>+<div className="settings-storage"><section className="settings-card compact"><div className="settings-heading"><div className="settings-icon"><HardDrive /></div><div><h2>{ui("ui.shader_cache_d7b5738")}</h2><p>{ui("ui.limit_mesa_and_nvidia_driver_caches_per_game_13f5b89")}</p></div></div>diff --git a/src/renderer/ManagedRuntimeSettings.tsx b/src/renderer/ManagedRuntimeSettings.tsxnew file mode 100644index 0000000..2bfba36--- /dev/null+++ b/src/renderer/ManagedRuntimeSettings.tsx@@ -0,0 +1,82 @@+import {useEffect,useRef,useState} from 'react';+import {ArrowDownToLine,RefreshCw,LoaderCircle} from 'lucide-react';+import type {AppSnapshot,ManagedFamilyStatus,ManagedRuntimeOptions} from '../shared/types';+import {runtimeFamilyLabels,type RuntimeFamily} from '../shared/runtime-selection';+import {CheckField} from './CheckField';+import {ui} from './i18n';++/** Explicit component operations only. Installing a family never selects it for a game. */+export function ManagedRuntimeSettings({data,disabled,onBusyChange}:{data:AppSnapshot;disabled:boolean;onBusyChange:(busy:boolean)=>void}) {+ const [experimental,setExperimental]=useState(false),[allowCachyos,setAllowCachyos]=useState(false);+ const [prerelease,setPrerelease]=useState<Partial<Record<RuntimeFamily,boolean>>>({});+ const [local,setLocal]=useState<{scope:string;statuses:Partial<Record<RuntimeFamily,ManagedFamilyStatus>>}>();+ const [invalidated,setInvalidated]=useState<Partial<Record<RuntimeFamily,boolean>>>({});+ const [pending,setPending]=useState<RuntimeFamily>();+ const [notice,setNotice]=useState<{scope:string;text:string;error:boolean}>();+ const scope=JSON.stringify([data.settings.runtimeRoot,data.backend.binaryPath,data.backend.commit,data.backend.version,data.launcherUpdate?.currentVersion]);+ const live=useRef(scope),inFlight=useRef(false),mounted=useRef(true);live.current=scope;+ useEffect(()=>{mounted.current=true;return()=>{mounted.current=false;};},[]);+ useEffect(()=>{setAllowCachyos(false);setPrerelease({});setInvalidated({});setNotice(undefined);},[scope]);+ const statuses=(data.runtime.managedFamilies??[]);+ const snapshotKey=JSON.stringify(statuses);+ useEffect(()=>setLocal(undefined),[scope,snapshotKey]);+ const status=(family:RuntimeFamily)=>local?.scope===scope&&local.statuses[family]||statuses.find(item=>item.id===family);+ const cachyosInstalled=Boolean(status('nexus-cachyos')?.installed);+ const apiReady=typeof window!=='undefined'&&typeof window.launcher?.checkManagedRuntime==='function'&&typeof window.launcher?.installManagedRuntime==='function';+ const active=disabled||Boolean(pending)||statuses.some(item=>item.checking||item.installing);+ const channel=(family:RuntimeFamily)=>prerelease[family]??status(family)?.channel==='prerelease';+ const options=(family:RuntimeFamily):ManagedRuntimeOptions=>({allowCachyos:family==='nexus-cachyos'&&(cachyosInstalled||allowCachyos),allowPrerelease:channel(family)});+ async function perform(family:RuntimeFamily,install:boolean) {+ if(active||inFlight.current||!apiReady||family==='nexus-cachyos'&&!cachyosInstalled&&!allowCachyos)return;+ const candidate=status(family)?.available;+ if(install&&!candidate)return;+ const captured=scope;inFlight.current=true;setPending(family);setNotice(undefined);onBusyChange(true);+ try {+ if(install) {+ const result=await window.launcher.installManagedRuntime(family,candidate!.candidateSha256,options(family));+ if(!mounted.current||live.current!==captured)return;+ const success=result.family===family&&result.success&&result.committed&&result.durability==='confirmed';+ setNotice({scope:captured,error:!success,text:success?ui('runtime.families_installed'):result.error??(result.committed?ui('runtime.families_committed_attention'):ui('runtime.families_failed'))});+ // The next authoritative snapshot owns post-install identity and availability.+ setLocal(undefined);+ } else {+ const result=await window.launcher.checkManagedRuntime(family,options(family));+ if(!mounted.current||live.current!==captured)return;+ if(result.id!==family)throw Error(ui('runtime.families_failed'));+ setInvalidated(current=>({...current,[family]:false}));+ setLocal(current=>({scope:captured,statuses:{...(current?.scope===captured?current.statuses:{}),[family]:result}}));+ }+ }catch(error){if(mounted.current&&live.current===captured)setNotice({scope:captured,error:true,text:error instanceof Error?error.message:String(error)});}+ finally{inFlight.current=false;if(mounted.current){setPending(undefined);onBusyChange(false);}}+ }+ function changePrerelease(family:RuntimeFamily,value:boolean) {+ setPrerelease(current=>({...current,[family]:value}));setInvalidated(current=>({...current,[family]:true}));+ // Changing discovery policy invalidates a previously offered candidate.+ setLocal(current=>({scope,statuses:{...(current?.scope===scope?current.statuses:{}),[family]:{...(status(family)??{id:family,checking:false,installing:false}),available:undefined}}}));+ }+ function row(family:RuntimeFamily) {+ const item=status(family),installed=item?.installed,available=invalidated[family]?undefined:item?.available;+ const busy=pending===family||item?.checking||item?.installing;+ const allowed=family!=='nexus-cachyos'||cachyosInstalled||allowCachyos;+ return <section className="managed-runtime-family" key={family} aria-label={runtimeFamilyLabels[family]}>+ <h3>{runtimeFamilyLabels[family]}</h3>+ <p>{installed?ui('runtime.families_version',{version:item?.version??installed.sourceCommit.slice(0,12)}):ui('runtime.families_not_installed')}</p>+ {item?.phase?<p role="status">{item.phase}</p>:null}+ {item?.error?<p className="alert amber" role="alert">{item.error}</p>:null}+ {family==='nexus-cachyos'&&!installed?<CheckField label={ui('runtime.families_cachyos_optin')} checked={allowCachyos} disabled={active} onChange={event=>{setAllowCachyos(event.target.checked);setInvalidated(current=>({...current,'nexus-cachyos':true}));}}/>:null}+ <CheckField label={ui('runtime.families_prerelease')} checked={channel(family)} disabled={active||!allowed} onChange={event=>changePrerelease(family,event.target.checked)}/>+ {available&&item?.updateAvailable===false?<p role="status">{ui('runtime.families_current')}</p>:null}+ {available&&item?.updateAvailable!==false?<p>{ui('runtime.families_available',{version:available.version})}<br/><small>{ui('runtime.families_requires',{backend:available.requiresBackendVersion,launcher:available.requiresLauncherVersion})}</small></p>:null}+ <div className="button-row">+ <button className="secondary" disabled={active||!apiReady||!allowed} onClick={()=>void perform(family,false)}>{busy?<LoaderCircle className="spin"/>:<RefreshCw/>}{ui('ui.check_for_updates_f26f327')}</button>+ {available&&item?.updateAvailable!==false?<button className="primary" disabled={active||!apiReady||!allowed} onClick={()=>void perform(family,true)}><ArrowDownToLine/>{installed?ui('runtime.families_update',{name:runtimeFamilyLabels[family]}):ui('runtime.families_install',{name:runtimeFamilyLabels[family]})}</button>:null}+ </div>+ </section>;+ }+ return <section className="settings-card managed-runtime-settings" aria-label={ui('runtime.families_title')}>+ <h2>{ui('runtime.families_title')}</h2><p>{ui('runtime.families_help')}</p>+ {notice?.scope===scope?<p role={notice.error?'alert':'status'} className={notice.error?'alert amber':'runtime-phase'}>{notice.text}</p>:null}+ {row('nexus')}+ {experimental||cachyosInstalled?row('nexus-cachyos'):<button className="secondary" disabled={active} onClick={()=>setExperimental(true)}>{ui('runtime.families_show_cachyos')}</button>}+ </section>;+}diff --git a/src/renderer/game-runtime-readiness.test.tsx b/src/renderer/game-runtime-readiness.test.tsxindex ccd63b0..aaab0e2 100644--- a/src/renderer/game-runtime-readiness.test.tsx+++ b/src/renderer/game-runtime-readiness.test.tsx@@ -17,12 +17,12 @@ beforeEach(()=>{document.body.innerHTML='<div id="root"></div>';root=createRoot(document.getElementById('root')!);});afterEach(async()=>{await act(async()=>root.unmount());vi.restoreAllMocks();vi.unstubAllGlobals();});-it('uses exact approved readiness even with no current family, and avoids rerender request loops',async()=>{+it('uses verified main-process readiness without requiring a snapshot descriptor, and avoids rerender request loops',async()=>{const request=pending();vi.mocked(window.launcher.getGameRuntimeReadiness).mockReturnValue(request.promise);await render();expect(enabled()).toBe(false);await act(async()=>request.resolve(true));expect(enabled()).toBe(true);await render();await render();expect(window.launcher.getGameRuntimeReadiness).toHaveBeenCalledTimes(1);});-it('never borrows current B availability when approved A is missing or verification fails',async()=>{+it('never borrows snapshot availability when current verification fails',async()=>{data.runtime.variants=[{id:'nexus-cachyos',label:'B',buildId:'d'.repeat(64),manifestSha256:'e'.repeat(64),sourceCommit:'f'.repeat(40)}];vi.mocked(window.launcher.getGameRuntimeReadiness).mockResolvedValue(false);await render();expect(enabled()).toBe(false);vi.mocked(window.launcher.getGameRuntimeReadiness).mockRejectedValue(Error('verification failed'));data.settings.runtimeRoot+='-changed';await render();expect(enabled()).toBe(false);@@ -51,7 +51,7 @@ it('ignores held A readiness after switching to B',async()=>{await act(async()=>a.resolve(true));expect(enabled()).toBe(false);await act(async()=>b.resolve(true));expect(enabled()).toBe(true);});-it('enables the actual Home Play action for verified retained A with no current descriptor',async()=>{+it('enables actual Home Play only after fresh main-process verification, even without a snapshot descriptor',async()=>{const request=pending();vi.mocked(window.launcher.getGameRuntimeReadiness).mockReturnValue(request.promise);window.launcher.getGameLaunchOptions=vi.fn(async()=>({cloudSaves:false,vcInstall:false}));data.games[0].installState='ready';data.backend.capabilities.run=true;@@ -59,3 +59,7 @@ it('enables the actual Home Play action for verified retained A with no currentconst play=()=>document.querySelector<HTMLButtonElement>('[data-gamepad-key="home-play"]');expect(play()).toBeNull();await act(async()=>request.resolve(true));expect(play()?.disabled).toBe(false);});++it('rechecks readiness after a managed installation revision even when descriptor identity stays unchanged',async()=>{+ await render();expect(enabled()).toBe(true);const next=pending();vi.mocked(window.launcher.getGameRuntimeReadiness).mockReturnValueOnce(next.promise);data.runtime.managedRevision=1;await render();expect(enabled()).toBe(false);expect(window.launcher.getGameRuntimeReadiness).toHaveBeenCalledTimes(2);await act(async()=>next.resolve(true));expect(enabled()).toBe(true);+});diff --git a/src/renderer/managed-runtime-settings.test.tsx b/src/renderer/managed-runtime-settings.test.tsxnew file mode 100644index 0000000..90503d2--- /dev/null+++ b/src/renderer/managed-runtime-settings.test.tsx@@ -0,0 +1,61 @@+// @vitest-environment jsdom+import {act} from 'react';+import {createRoot,type Root} from 'react-dom/client';+import {afterEach,beforeEach,expect,it,vi} from 'vitest';+import {ManagedRuntimeSettings} from './ManagedRuntimeSettings';+import {demoSnapshot} from '../shared/demo-data';+import type {ManagedFamilyStatus} from '../shared/types';+let root:Root,data:ReturnType<typeof demoSnapshot>,busy:ReturnType<typeof vi.fn>;+const offer={version:'runtime-11.0',candidateSha256:'a'.repeat(64),sourceCommit:'b'.repeat(40),archiveName:'nexus-runtime.tar.xz',requiresBackendVersion:'0.2.3',requiresLauncherVersion:'0.5.0'};+const available=(id:'nexus'|'nexus-cachyos'='nexus'):ManagedFamilyStatus=>({id,checking:false,installing:false,available:offer,updateAvailable:true});+const render=async(disabled=false)=>act(async()=>root.render(<ManagedRuntimeSettings data={data} disabled={disabled} onBusyChange={busy}/>));+const click=async(node:Element)=>act(async()=>(node as HTMLElement).click());+const button=(text:string)=>[...document.querySelectorAll('button')].find(node=>node.textContent===text)!;+const checkbox=(text:string)=>[...document.querySelectorAll('label')].find(node=>node.textContent?.includes(text))!.querySelector('input')!;+beforeEach(async()=>{+ vi.stubGlobal('IS_REACT_ACT_ENVIRONMENT',true);data=demoSnapshot();data.runtime.managedFamilies=[];busy=vi.fn();+ window.launcher={checkManagedRuntime:vi.fn(async()=>available()),installManagedRuntime:vi.fn(async()=>({family:'nexus',success:true,committed:true,durability:'confirmed'}))} as unknown as Window['launcher'];+ document.body.innerHTML='<div id="root"></div>';root=createRoot(document.getElementById('root')!);await render();+});+afterEach(async()=>{await act(async()=>root.unmount());vi.restoreAllMocks();vi.unstubAllGlobals();document.body.innerHTML='';});+it('starts simple and performs no discovery or optional installation on render',()=>{+ expect(document.querySelectorAll('.managed-runtime-family')).toHaveLength(1);expect(document.body.textContent).toContain('Not installed');expect(window.launcher.checkManagedRuntime).not.toHaveBeenCalled();expect(window.launcher.installManagedRuntime).not.toHaveBeenCalled();expect(document.body.textContent).toContain('default Wine / Proton selection unchanged');+});+it('checks Standard explicitly then installs the exact captured candidate without selecting games',async()=>{+ await click(button('Check for updates'));expect(window.launcher.checkManagedRuntime).toHaveBeenCalledWith('nexus',{allowCachyos:false,allowPrerelease:false});expect(document.body.textContent).toContain(offer.version);+ await click(button('Install Nexus Runtime'));expect(window.launcher.installManagedRuntime).toHaveBeenCalledWith('nexus',offer.candidateSha256,{allowCachyos:false,allowPrerelease:false});expect(document.querySelector('[role="status"]')?.textContent).toContain('Game family choices and local saves were kept');expect(busy.mock.calls).toEqual([[true],[false],[true],[false]]);+});+it('requires distinct CachyOS and prerelease opt-ins for both API actions',async()=>{+ await click(button('Show experimental CachyOS runtime'));const row=document.querySelector('[aria-label="Nexus Runtime (CachyOS, experimental)"]')!;const check=row.querySelector('button')!;expect(check.disabled).toBe(true);+ await click(checkbox('Allow this optional'));vi.mocked(window.launcher.checkManagedRuntime).mockResolvedValue(available('nexus-cachyos'));+ const prerelease=[...row.querySelectorAll('input')][1];await click(prerelease);await click(check);+ expect(window.launcher.checkManagedRuntime).toHaveBeenCalledWith('nexus-cachyos',{allowCachyos:true,allowPrerelease:true});+ vi.mocked(window.launcher.installManagedRuntime).mockResolvedValue({family:'nexus-cachyos',success:true,committed:true,durability:'confirmed'});await click(row.querySelector('button.primary')!);expect(window.launcher.installManagedRuntime).toHaveBeenCalledWith('nexus-cachyos',offer.candidateSha256,{allowCachyos:true,allowPrerelease:true});+});+it('reports a committed uncertain result as attention, never success or old-runtime-kept',async()=>{+ data.runtime.managedFamilies=[available()];await render();vi.mocked(window.launcher.installManagedRuntime).mockResolvedValue({family:'nexus',success:false,committed:true,durability:'unknown'});+ await click(button('Install Nexus Runtime'));expect(document.querySelector('[role="alert"]')?.textContent).toContain('runtime was activated');expect(document.body.textContent).not.toContain('Runtime family installed.');expect(document.body.textContent).not.toContain('previous runtime was kept');+});+it('discards a held old-root discovery response and releases local busy state',async()=>{+ let resolve!:(value:ManagedFamilyStatus)=>void;vi.mocked(window.launcher.checkManagedRuntime).mockReturnValue(new Promise(done=>resolve=done));await click(button('Check for updates'));+ data={...data,settings:{...data.settings,runtimeRoot:'/new/root'}};await render();await act(async()=>resolve(available()));expect(button('Install Nexus Runtime')).toBeUndefined();expect(busy).toHaveBeenLastCalledWith(false);+});+it('invalidates offered prerelease-policy candidates until a new explicit check',async()=>{+ await click(button('Check for updates'));expect(button('Install Nexus Runtime')).toBeDefined();await click(checkbox('Include prereleases'));expect(button('Install Nexus Runtime')).toBeUndefined();expect(window.launcher.installManagedRuntime).not.toHaveBeenCalled();await click(button('Check for updates'));expect(button('Install Nexus Runtime')).toBeDefined();+});+it('shows installed optional families with their recorded channel and no fresh installation opt-in',async()=>{+ data.runtime.managedFamilies=[{...available('nexus-cachyos'),installed:{id:'nexus-cachyos',label:'CachyOS',buildId:'c'.repeat(64),manifestSha256:'d'.repeat(64),sourceCommit:'e'.repeat(40)},version:'installed-v1',channel:'prerelease',updateAvailable:false}];await render();+ expect(document.querySelectorAll('.managed-runtime-family')).toHaveLength(2);expect(document.body.textContent).not.toContain('Allow this optional');expect(checkbox('Include prereleases').checked).toBe(false);expect(document.querySelector<HTMLInputElement>('[aria-label="Nexus Runtime (CachyOS, experimental)"] input')?.checked).toBe(true);expect(document.body.textContent).toContain('Installed: installed-v1');expect(document.body.textContent).toContain('up to date');expect(button('Update Nexus Runtime (CachyOS, experimental)')).toBeUndefined();expect(window.launcher.checkManagedRuntime).not.toHaveBeenCalled();+});+it('blocks controls during other activity and prevents duplicate held requests',async()=>{+ await render(true);expect(button('Check for updates').disabled).toBe(true);await click(button('Check for updates'));expect(window.launcher.checkManagedRuntime).not.toHaveBeenCalled();await render();let resolve!:(value:ManagedFamilyStatus)=>void;vi.mocked(window.launcher.checkManagedRuntime).mockReturnValue(new Promise(done=>resolve=done));await click(button('Check for updates'));await click(button('Check for updates'));expect(window.launcher.checkManagedRuntime).toHaveBeenCalledOnce();await act(async()=>resolve(available()));+});++it('reuses installed CachyOS opt-in and prerelease channel for an ordinary update',async()=>{+ data.runtime.managedFamilies=[{...available('nexus-cachyos'),installed:{id:'nexus-cachyos',label:'CachyOS',buildId:'c'.repeat(64),manifestSha256:'d'.repeat(64),sourceCommit:'e'.repeat(40)},channel:'prerelease'}];await render();+ vi.mocked(window.launcher.installManagedRuntime).mockResolvedValue({family:'nexus-cachyos',success:true,committed:true,durability:'confirmed'});await click(button('Update Nexus Runtime (CachyOS, experimental)'));expect(window.launcher.installManagedRuntime).toHaveBeenCalledWith('nexus-cachyos',offer.candidateSha256,{allowCachyos:true,allowPrerelease:true});+});++it('uses a later authoritative snapshot instead of retaining a stale locally checked offer',async()=>{+ await click(button('Check for updates'));expect(button('Install Nexus Runtime')).toBeDefined();data.runtime.managedFamilies=[{...available(),installed:{id:'nexus',label:'Nexus',buildId:'c'.repeat(64),manifestSha256:'d'.repeat(64),sourceCommit:offer.sourceCommit},updateAvailable:false}];await render();expect(button('Install Nexus Runtime')).toBeUndefined();expect(document.body.textContent).toContain('up to date');+});diff --git a/src/renderer/styles.css b/src/renderer/styles.cssindex 6e16328..8c91441 100644--- a/src/renderer/styles.css+++ b/src/renderer/styles.css@@ -666,3 +666,8 @@ button.primary, button.secondary { border-radius: 5px; min-height: 40px; font-si.cloud-save-warning p { margin: 5px 0 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }.cloud-save-warning > button { flex-shrink: 0; }@media (max-width: 800px) { .cloud-save-warning { margin: 8px 12px 0; flex-wrap: wrap; } .cloud-save-warning > div { flex-basis: 100%; } }++.managed-runtime-family { margin-top: 20px; min-width: 0; }+.managed-runtime-family + .managed-runtime-family { padding-top: 20px; border-top: 1px solid var(--line); }+.managed-runtime-family p { overflow-wrap: anywhere; }+.managed-runtime-settings > button { margin-top: 16px; }diff --git a/src/renderer/useGameRuntimeReady.ts b/src/renderer/useGameRuntimeReady.tsindex f6b1e9b..7b6c268 100644--- a/src/renderer/useGameRuntimeReady.ts+++ b/src/renderer/useGameRuntimeReady.ts@@ -4,7 +4,7 @@ import type {AppSnapshot,Game} from '../shared/types';* and errors never borrow another build's availability. */export function useGameRuntimeReady(game:Game|undefined,data:AppSnapshot):boolean {const managed=Boolean(game?.runtime&&game.runtime!=='default');- const scope=JSON.stringify([game?.id,game?.runtime,game?.runtimeSeparatePrefix,game?.runtimeBuild?.buildId,game?.runtimeBuild?.manifestSha256,game?.runtimeBuild?.sourceCommit,game?.runtimePrefixes,data.settings.runtimeRoot,data.settings.winePath,data.runtime.winePath,(data.runtime.variants??[]).map(item=>[item.id,item.buildId,item.manifestSha256,item.sourceCommit])]);+ const scope=JSON.stringify([game?.id,game?.runtime,game?.runtimeSeparatePrefix,game?.runtimeBuild?.buildId,game?.runtimeBuild?.manifestSha256,game?.runtimeBuild?.sourceCommit,game?.runtimePrefixes,data.settings.runtimeRoot,data.settings.winePath,data.runtime.winePath,data.runtime.managedRevision,(data.runtime.variants??[]).map(item=>[item.id,item.buildId,item.manifestSha256,item.sourceCommit])]);const current=useRef({scope,version:0});if(current.current.scope!==scope)current.current={scope,version:current.current.version+1};const version=current.current.version;