Skip to content

Open-source Xbox-inspired desktop launcher for Xodus on Linux

TypeScript

fix(settings): unify runtime status cards and actions

Nexus Maintainer378a5dcc82a5
diff --git a/assets/locales/en.json b/assets/locales/en.json
index 2233a0d..17e2fe0 100644
--- a/assets/locales/en.json
+++ b/assets/locales/en.json
@@ -19,12 +19,8 @@
"runtime.cachyos_current": "This runtime is up to date.",
"runtime.cachyos_active": "Active local build: {{version}}",
"runtime.cachyos_active_label": "ACTIVE",
- "runtime.cachyos_binary": "CachyOS binary",
- "runtime.cachyos_binary_managed": "Read-only path from the verified managed CachyOS family. It does not change the default Wine / Proton binary or any game's runtime choice.",
- "runtime.cachyos_binary_default": "This CachyOS build is the current default runtime, but it is not an installed managed CachyOS family. The path is shown read-only.",
- "runtime.cachyos_binary_missing": "The optional managed CachyOS family is not installed. Check for it in this card; nothing is installed or selected automatically.",
"runtime.cachyos_installed": "CachyOS runtime installed. The default runtime, game runtime choices, prefixes and local saves are unchanged.",
- "runtime.default_title": "Default Wine / Proton runtime",
+ "runtime.default_title": "Default runtime",
"runtime.families_version": "Installed: {{version}}",
"runtime.families_available": "Available: {{version}}",
"runtime.families_requires": "Requires backend {{backend}} and launcher {{launcher}} or newer.",
diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx
index 33b1857..385fce9 100644
--- a/src/renderer/App.tsx
+++ b/src/renderer/App.tsx
@@ -1,5 +1,6 @@
import {useComponentUpdates} from './ComponentUpdates';
import {ManagedRuntimeSettings} from './ManagedRuntimeSettings';
+import {DefaultRuntimeSettings} from './DefaultRuntimeSettings';
import {StatusDot} from './StatusDot';
import {useGameRuntimeReady} from './useGameRuntimeReady';
import {useStoreAccess} from './store-access';
@@ -21,7 +22,7 @@ import {reconcileSettingsDraft, storageSettingsPatch} from './settings-draft';
import {xboxOverlaySettings} from '../shared/xbox-overlay-settings';
import './xbox-desktop-social.css';
import { estimateTimeRemaining, isNewerVersion } from '../shared/utils';
-import { nexusRuntimeUpdateAvailable, runtimeDisplay, activeRuntimeIsCachyos } from '../shared/runtime-display';
+import { nexusRuntimeUpdateAvailable } from '../shared/runtime-display';
import { subscriptionBadge } from '../shared/subscription';
import { defaultLaunchTools, normalizeLaunchTools } from '../shared/launch-tools';
import { DEFAULT_SHADER_CACHE_GIB, shaderCacheLimits } from '../shared/shader-cache';
@@ -1028,8 +1029,6 @@ export function SettingsPage({ data, toast }: { data: AppSnapshot; toast: (value
const caps = data.backend.capabilities;
let cacheLimitValid = true;
try { shaderCacheLimits(form.shaderCacheLimitGiB ?? DEFAULT_SHADER_CACHE_GIB); } catch { cacheLimitValid = false; }
- const runtimeInfo = runtimeDisplay(data.runtime);
- const activeCachyos = activeRuntimeIsCachyos(data.runtime);
const overlay=xboxOverlaySettings(form);
const savedOverlay=xboxOverlaySettings(data.settings);
const overlayDirty=overlay.overlayEnabled!==savedOverlay.overlayEnabled||overlay.overlaySide!==savedOverlay.overlaySide||(form.overlayShortcut??savedOverlay.overlayShortcut)!==savedOverlay.overlayShortcut;
@@ -1117,18 +1116,9 @@ export function SettingsPage({ data, toast }: { data: AppSnapshot; toast: (value
<div className="button-row end"><button className="secondary" disabled={Boolean(busy) || data.backend.checking || data.backend.updating} onClick={() => invoke('backend-check', () => window.launcher.checkBackendUpdate())}>{busy === 'backend-check' || data.backend.checking ? <LoaderCircle className="spin" /> : <RefreshCw />}{ui("ui.check_for_updates_f26f327")}</button>{data.backend.releaseAvailable && data.backend.updateAvailable ? <button className="primary" disabled={Boolean(busy) || data.backend.updating || data.backend.checking} onClick={() => invoke('backend-update', () => window.launcher.updateBackend(), ui("ui.the_nexus_backend_was_verified_installed_and_act_62d374e"))}>{busy === 'backend-update' || data.backend.updating ? <LoaderCircle className="spin" /> : <ArrowDownToLine />}{data.backend.available ? ui("ui.update_backend_bddcd8b") : ui("ui.install_backend_73e7239")}</button> : null}</div>
</section>
- <section className="settings-card">
- <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}
- {activeCachyos ? null : <div className="button-row end">
- <button className="secondary" disabled={Boolean(busy) || data.runtime.nexusChecking} onClick={() => invoke('runtime-check', () => window.launcher.checkNexusRuntime())}>{busy === 'runtime-check' || data.runtime.nexusChecking ? <LoaderCircle className="spin" /> : <RefreshCw />}{ui("ui.check_for_updates_f26f327")}</button>
- {nexusRuntimeUpdateAvailable(data.runtime) ? <button className="primary" disabled={Boolean(busy) || data.runtime.updating} onClick={() => invoke('runtime-install-nexus', () => window.launcher.installNexusRuntime(), ui("ui.nexus_runtime_was_verified_installed_and_selecte_51b0ff1"))}>{busy === 'runtime-install-nexus' || data.runtime.updating ? <LoaderCircle className="spin" /> : <ArrowDownToLine />}{ui("ui.install_nexus_runtime_2cf3608")}{data.runtime.nexusVersion ? ` ${data.runtime.nexusVersion.replace(/^runtime-/, '')}` : ''}</button> : null}
- </div>}
- {data.runtime.updating || runtimeLogs.length > 0 ? <pre className="build-log">{runtimeLogs.join('\n') || ui("ui.waiting_for_output_f05fefe")}</pre> : null}
- </section>
+ <DefaultRuntimeSettings data={data} busy={busy} disabled={componentUpdatesDisabled} runtimeLogs={runtimeLogs} invoke={invoke}/>
- <ManagedRuntimeSettings data={data} disabled={Boolean(busy)||data.componentUpdates?.running===true||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)}/>
+ <ManagedRuntimeSettings data={data} disabled={componentUpdatesDisabled} onBusyChange={value=>setBusy(value?'managed-runtime':undefined)}/>
<div className="settings-storage">
<section className="settings-card compact">
@@ -1160,8 +1150,6 @@ export function SettingsPage({ data, toast }: { data: AppSnapshot; toast: (value
<div className="diagnostics-content">
<DiagnosticReportButton games={data.games} />
<section><h3>{ui("ui.game_logging_6cb644e")}</h3><div className="toggle-row"><CheckField className="toggle" label={ui("ui.verbose_game_logs_58e750b")} description={ui("ui.writes_full_wine_vkd3d_proton_and_xodus_diagnost_dfa1fa3")} checked={form.verboseLogs} onChange={(event) => setForm({ ...form, verboseLogs: event.target.checked })} /></div><div className="button-row"><button className="secondary" disabled={Boolean(busy)} onClick={() => invoke('save-diagnostics', () => window.launcher.updateSettings({ verboseLogs: form.verboseLogs }), ui("ui.logging_settings_saved_5a9dd67"))}>{ui("ui.save_diagnostics_52fe7bd")}</button></div></section>
- <section><h3>{ui("ui.backend_details_522061f")}</h3><p className="diagnostic-path mono">{data.backend.binaryPath ?? ui("ui.no_backend_selected_e322189")}</p><div className="meta-grid"><div><span>{ui("ui.source_56ccd01")}</span><strong>{data.backend.source === 'external' ? ui("ui.external_installation_read_only_9cedb28") : data.backend.delivery === 'release' ? ui("ui.nexus_github_release_44f7ae9") : data.backend.source === 'managed' ? ui("ui.local_versioned_build_284259d") : '—'}</strong></div><div><span>{ui("ui.commit_79663c1")}</span><strong className="mono">{data.backend.commit?.slice(0, 12) ?? '—'}</strong></div></div></section>
- <section><h3>{ui("ui.runtime_details_77fa868")}</h3><p className="diagnostic-path mono">{data.runtime.winePath ?? ui("ui.no_runtime_selected_b8e7445")}</p><div className="meta-grid"><div><span>{ui("ui.source_56ccd01")}</span><strong>{runtimeInfo.source}</strong></div><div><span>{ui("ui.build_3053677")}</span><strong className="mono">{data.runtime.commit ?? '—'}</strong></div></div></section>
</div>
</details>
</main>;
diff --git a/src/renderer/DefaultRuntimeSettings.tsx b/src/renderer/DefaultRuntimeSettings.tsx
new file mode 100644
index 0000000..e003dc4
--- /dev/null
+++ b/src/renderer/DefaultRuntimeSettings.tsx
@@ -0,0 +1,36 @@
+import type {AppSnapshot} from '../shared/types';
+import {activeRuntimeIsCachyos,nexusRuntimeUpdateAvailable,runtimeDisplay} from '../shared/runtime-display';
+import {RuntimeFamilyCard} from './RuntimeFamilyCard';
+import {ui,uiText} from './i18n';
+
+/** The runtime that games use by default. It reports the verified active
+ * runtime truthfully, so an external or custom Wine never looks like a managed
+ * Standard installation. Installing the Standard release is a separate,
+ * explicit action and stays hidden while another family is the default. */
+export function DefaultRuntimeSettings({data,busy,disabled,invoke,runtimeLogs}:{
+ data:AppSnapshot; busy?:string; disabled:boolean; runtimeLogs:string[];
+ invoke:(name:string,fn:()=>Promise<unknown>,success?:string)=>void;
+}) {
+ const info=runtimeDisplay(data.runtime);
+ const activeCachyos=activeRuntimeIsCachyos(data.runtime);
+ const nexusActive=data.runtime.installed===true&&info.source==='Nexus runtime';
+ const updateAvailable=nexusRuntimeUpdateAvailable(data.runtime)&&!activeCachyos;
+ const availableVersion=data.runtime.nexusVersion?.replace(/^runtime-/,'')??'';
+ const checking=busy==='runtime-check'||Boolean(data.runtime.nexusChecking);
+ const installing=busy==='runtime-install-nexus'||data.runtime.updating;
+ return <RuntimeFamilyCard family="default"
+ title={ui('runtime.default_title')}
+ status={{tone:!data.runtime.installed?'amber':nexusActive?'green':'amber',label:!data.runtime.installed?ui('ui.missing_8af1d32'):nexusActive?ui('ui.ready_c2e3ac4'):ui('ui.other_runtime_ce6adfb')}}
+ summary={data.runtime.installed?ui('ui.active_ae2c40a',{runtime:info.title,version:info.version}):ui('ui.no_runtime_selected_b8e7445')}
+ errors={[data.runtime.nexusError,data.runtime.error?uiText(data.runtime.error):undefined].filter((value):value is string=>Boolean(value))}
+ phase={data.runtime.phase?uiText(data.runtime.phase):undefined}
+ available={updateAvailable&&availableVersion?ui('runtime.families_available',{version:availableVersion}):undefined}
+ current={nexusActive&&Boolean(data.runtime.nexusAvailable)&&!updateAvailable}
+ log={data.runtime.updating||runtimeLogs.length?runtimeLogs:undefined}
+ checking={checking}
+ installing={installing}
+ installLabel={updateAvailable?ui('ui.install_nexus_runtime_2cf3608'):undefined}
+ onCheck={()=>invoke('runtime-check',()=>window.launcher.checkNexusRuntime())}
+ onInstall={()=>invoke('runtime-install-nexus',()=>window.launcher.installNexusRuntime(),ui('ui.nexus_runtime_was_verified_installed_and_selecte_51b0ff1'))}
+ disabled={disabled}/>;
+}
diff --git a/src/renderer/ManagedRuntimeSettings.tsx b/src/renderer/ManagedRuntimeSettings.tsx
index 71135ad..855ce70 100644
--- a/src/renderer/ManagedRuntimeSettings.tsx
+++ b/src/renderer/ManagedRuntimeSettings.tsx
@@ -1,9 +1,8 @@
import {useEffect,useRef,useState} from 'react';
-import {ArrowDownToLine,CircleAlert,Gamepad2,LoaderCircle,RefreshCw} from 'lucide-react';
import type {AppSnapshot,ManagedFamilyStatus,ManagedRuntimeOptions} from '../shared/types';
import type {RuntimeFamily} from '../shared/runtime-selection';
import {activeRuntimeIsCachyos,runtimeDisplay} from '../shared/runtime-display';
-import {StatusDot} from './StatusDot';
+import {RuntimeFamilyCard} from './RuntimeFamilyCard';
import {ui} from './i18n';
const family:RuntimeFamily='nexus-cachyos';
@@ -63,29 +62,20 @@ export function ManagedRuntimeSettings({data,disabled,onBusyChange}:{data:AppSna
}
const version=item?.version??item?.installed?.sourceCommit.slice(0,12)??'';
const summary=installed?ui('runtime.families_version',{version}):activeLocal?ui('runtime.cachyos_active',{version:activeVersion}):undefined;
- const managedBinary=item?.installed?.displayWinePath;
- const defaultBinary=activeLocal?data.runtime.winePath:undefined;
- const binary=managedBinary??defaultBinary;
- const binaryNote=managedBinary?ui('runtime.cachyos_binary_managed'):defaultBinary?ui('runtime.cachyos_binary_default'):ui('runtime.cachyos_binary_missing');
- return <section className="settings-card managed-runtime-settings" aria-label={ui('runtime.cachyos_title')}>
- <div className="settings-heading">
- <div className="settings-icon"><Gamepad2 /></div>
- <div><h2>{ui('runtime.cachyos_title')}</h2>{summary?<p>{summary}</p>:null}</div>
- <span className={`status-label ${installed||activeLocal?'ready':'unknown'}`}><StatusDot tone={installed||activeLocal?'green':'amber'} />{installed?ui('ui.ready_c2e3ac4'):activeLocal?ui('runtime.cachyos_active_label'):ui('ui.not_installed_d177cdc')}</span>
- </div>
- <div className="managed-runtime-binary">
- <span className="overline">{ui('runtime.cachyos_binary')}</span>
- <p className="diagnostic-path mono" data-cachyos-binary={managedBinary?'managed':defaultBinary?'default':'missing'}>{binary??ui('ui.not_installed_d177cdc')}</p>
- <small>{binaryNote}</small>
- </div>
- {notice?.scope===scope?<p role={notice.error?'alert':'status'} className={notice.error?'alert amber':'runtime-phase'}>{notice.text}</p>:null}
- {item?.error?<div className="alert amber" role="alert"><CircleAlert /><span>{item.error}</span></div>:null}
- {busy&&item?.phase?<div className="runtime-phase"><LoaderCircle className="spin" /><span>{item.phase}</span></div>:null}
- {available&&item?.updateAvailable===false?<p role="status">{ui('runtime.cachyos_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 end">
- <button className="secondary" disabled={active||!apiReady} onClick={()=>void perform(false)}>{pending==='check'||pending===undefined&&item?.checking?<LoaderCircle className="spin" />:<RefreshCw />}{ui('ui.check_for_updates_f26f327')}</button>
- {available&&item?.updateAvailable!==false?<button className="primary" disabled={active||!apiReady} onClick={()=>void perform(true)}>{pending==='install'||pending===undefined&&item?.installing?<LoaderCircle className="spin" />:<ArrowDownToLine />}{installed?ui('runtime.families_update',{name:ui('runtime.cachyos_title')}):ui('runtime.families_install',{name:ui('runtime.cachyos_title')})}</button>:null}
- </div>
- </section>;
+ const title=ui('runtime.cachyos_title');
+ return <RuntimeFamilyCard family={family} title={title}
+ status={installed||activeLocal?{tone:'green',label:installed?ui('ui.ready_c2e3ac4'):ui('runtime.cachyos_active_label')}:{tone:'amber',label:ui('ui.not_installed_d177cdc')}}
+ summary={summary}
+ errors={item?.error?[item.error]:undefined}
+ phase={busy&&item?.phase?item.phase:undefined}
+ notice={notice?.scope===scope?notice:undefined}
+ available={available&&item?.updateAvailable!==false?ui('runtime.families_available',{version:available.version}):undefined}
+ requires={available&&item?.updateAvailable!==false?ui('runtime.families_requires',{backend:available.requiresBackendVersion,launcher:available.requiresLauncherVersion}):undefined}
+ current={Boolean(available&&item?.updateAvailable===false)}
+ checking={pending==='check'||pending===undefined&&Boolean(item?.checking)}
+ installing={pending==='install'||pending===undefined&&Boolean(item?.installing)}
+ installLabel={available&&item?.updateAvailable!==false?(installed?ui('runtime.families_update',{name:title}):ui('runtime.families_install',{name:title})):undefined}
+ onCheck={()=>void perform(false)}
+ onInstall={()=>void perform(true)}
+ disabled={active||!apiReady}/>;
}
diff --git a/src/renderer/RuntimeFamilyCard.tsx b/src/renderer/RuntimeFamilyCard.tsx
new file mode 100644
index 0000000..91b5abf
--- /dev/null
+++ b/src/renderer/RuntimeFamilyCard.tsx
@@ -0,0 +1,46 @@
+import {ArrowDownToLine,CircleAlert,Gamepad2,LoaderCircle,RefreshCw} from 'lucide-react';
+import {StatusDot} from './StatusDot';
+import {ui} from './i18n';
+
+export interface RuntimeCardStatus {tone:'green'|'amber';label:string}
+
+/** Shared runtime card. The default runtime and every managed family describe
+ * their own verified state in exactly the same layout, so a status or version
+ * difference is about the runtime itself and never about one family's surface.
+ * The phase panel is progress only: an idle ready runtime keeps no stale status
+ * text, so both ready cards stay identical. */
+export function RuntimeFamilyCard({family,title,status,summary,errors,phase,notice,available,requires,current,log,checking,installing,installLabel,onCheck,onInstall,disabled}:{
+ family:string; title:string;
+ status:RuntimeCardStatus;
+ summary?:string;
+ errors?:string[];
+ phase?:string;
+ notice?:{text:string;error:boolean};
+ available?:string;
+ requires?:string;
+ current?:boolean;
+ log?:string[];
+ checking:boolean; installing:boolean;
+ installLabel?:string;
+ onCheck:()=>void; onInstall?:()=>void;
+ disabled:boolean;
+}) {
+ const busy=checking||installing;
+ return <section className="settings-card managed-runtime-settings" data-runtime-family={family} aria-label={title}>
+ <div className="settings-heading">
+ <div className="settings-icon"><Gamepad2 /></div>
+ <div><h2>{title}</h2>{summary?<p>{summary}</p>:null}</div>
+ <span className={`status-label ${status.tone==='green'?'ready':'unknown'}`}><StatusDot tone={status.tone} />{status.label}</span>
+ </div>
+ {notice?<p role={notice.error?'alert':'status'} className={notice.error?'alert amber':'runtime-phase'}>{notice.text}</p>:null}
+ {(errors??[]).map(error=><div key={error} className="alert amber" role="alert"><CircleAlert /><span>{error}</span></div>)}
+ {phase&&busy?<div className="runtime-phase"><LoaderCircle className="spin" /><span>{phase}</span></div>:null}
+ {available?<p>{available}{requires?<><br /><small>{requires}</small></>:null}</p>:null}
+ {current?<p role="status">{ui('runtime.cachyos_current')}</p>:null}
+ {log?<pre className="build-log">{log.join('\n')||ui('ui.waiting_for_output_f05fefe')}</pre>:null}
+ <div className="button-row end">
+ <button className="secondary" disabled={disabled||busy} onClick={onCheck}>{checking?<LoaderCircle className="spin" />:<RefreshCw />}{ui('ui.check_for_updates_f26f327')}</button>
+ {onInstall&&installLabel?<button className="primary" disabled={disabled||busy} onClick={onInstall}>{installing?<LoaderCircle className="spin" />:<ArrowDownToLine />}{installLabel}</button>:null}
+ </div>
+ </section>;
+}
diff --git a/src/renderer/managed-runtime-settings.test.tsx b/src/renderer/managed-runtime-settings.test.tsx
index e27149f..7192587 100644
--- a/src/renderer/managed-runtime-settings.test.tsx
+++ b/src/renderer/managed-runtime-settings.test.tsx
@@ -24,15 +24,16 @@ beforeEach(async()=>{
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('renders one concise CachyOS card with no experimental text, prerelease control or help paragraph',()=>{
+it('renders one concise CachyOS card with no binary path, experimental text, prerelease control or help paragraph',()=>{
expect(document.querySelectorAll('section.settings-card.managed-runtime-settings')).toHaveLength(1);
- expect(document.querySelectorAll('h3,.managed-runtime-family,input[type="checkbox"]')).toHaveLength(0);
+ expect(document.querySelectorAll('h3,.managed-runtime-family,.managed-runtime-binary,input[type="checkbox"]')).toHaveLength(0);
expect([...document.querySelectorAll('h2')].map(node=>node.textContent)).toEqual(['CachyOS runtime']);
expect(text().toLowerCase()).not.toContain('experimental');
expect(card().querySelector('.status-label.unknown')?.textContent).toContain('Not installed');
expect(button('Install CachyOS runtime')).toBeUndefined();
- expect(text()).toContain('CachyOS binary');expect(text()).toContain('The optional managed CachyOS family is not installed.');
- expect(card().querySelector('[data-cachyos-binary="missing"]')).not.toBeNull();
+ expect(text()).not.toContain('Read-only path');expect(text()).not.toContain('binary');
+ expect(card().querySelector('.button-row.end')).not.toBeNull();
+ expect(button('Check for updates')).toBeDefined();
expect(window.launcher.checkManagedRuntime).not.toHaveBeenCalled();expect(window.launcher.installManagedRuntime).not.toHaveBeenCalled();
});
it('never infers an installed family from a Standard snapshot or an unrelated default runtime',async()=>{
@@ -40,6 +41,21 @@ it('never infers an installed family from a Standard snapshot or an unrelated de
expect(text()).toContain('Not installed');expect(text()).not.toContain('Installed: runtime-10.0');
expect(button('Install CachyOS runtime')).toBeUndefined();
});
+it('shows the phase panel only while checking or installing, never as an idle ready status',async()=>{
+ data.runtime.managedFamilies=[installed('stable',false)];await render();
+ expect(card().querySelector('.runtime-phase')).toBeNull();
+ data.runtime.managedFamilies=[{...installed('stable',false),phase:'Runtime is ready.'}];await render();
+ expect(card().querySelector('.runtime-phase')).toBeNull();
+ expect(text()).not.toContain('Runtime is ready.');
+ data.runtime.managedFamilies=[{...installed('stable',false),checking:true,phase:'Checking the CachyOS runtime release.'}];await render();
+ expect(card().querySelector('.runtime-phase')?.textContent).toContain('Checking the CachyOS runtime release.');
+ data.runtime.managedFamilies=[{...installed('stable',false),installing:true,phase:'Installing the verified CachyOS runtime.'}];await render();
+ expect(card().querySelector('.runtime-phase')?.textContent).toContain('Installing the verified CachyOS runtime.');
+ data.runtime.managedFamilies=[{...installed('stable',false),phase:'Runtime is ready.',error:'Backend 0.3.0 or newer is required'}];await render();
+ expect(card().querySelector('.runtime-phase')).toBeNull();
+ expect(alerts()).toContain('Backend 0.3.0 or newer is required');
+});
+
it('checks explicitly and installs the exact captured candidate',async()=>{
await click(button('Check for updates'));
expect(window.launcher.checkManagedRuntime).toHaveBeenCalledWith('nexus-cachyos',{allowCachyos:true,allowPrerelease:false});
@@ -52,8 +68,7 @@ it('checks explicitly and installs the exact captured candidate',async()=>{
it('shows a managed installation with its version and keeps its recorded prerelease channel without a toggle',async()=>{
data.runtime.managedFamilies=[installed('prerelease',true)];await render();
expect(text()).toContain('Installed: runtime-cachyos-10.0');expect(text()).toContain('READY');
- expect(text()).toContain('/managed/cachyos/files/bin/wine');expect(card().querySelector('[data-cachyos-binary="managed"]')).not.toBeNull();
- expect(text()).toContain('Read-only path from the verified managed CachyOS family.');
+ expect(text()).not.toContain('/managed/cachyos/files/bin/wine');expect(text()).not.toContain('Read-only path');
expect(card().querySelector('.status-label.ready')).not.toBeNull();expect(document.querySelector('input[type="checkbox"]')).toBeNull();
await click(button('Update CachyOS runtime'));
expect(window.launcher.installManagedRuntime).toHaveBeenCalledWith('nexus-cachyos',offer.candidateSha256,{allowCachyos:true,allowPrerelease:true});
@@ -61,8 +76,7 @@ it('shows a managed installation with its version and keeps its recorded prerele
it('reports an active local CachyOS default runtime truthfully without claiming a managed installation',async()=>{
data.runtime=activeCachy;await render();
expect(text()).toContain('ACTIVE');expect(text()).toContain('Active local build: cachyos-11.0-experimental-ge36f73cb-local');
- expect(text()).toContain('/local/cachyos/files/bin/wine');expect(card().querySelector('[data-cachyos-binary="default"]')).not.toBeNull();
- expect(text()).toContain('This CachyOS build is the current default runtime, but it is not an installed managed CachyOS family.');
+ expect(text()).not.toContain('/local/cachyos/files/bin/wine');
expect(text()).not.toContain('Installed:');expect(card().querySelector('.status-label.ready')).not.toBeNull();
expect(button('Install CachyOS runtime')).toBeUndefined();
await click(button('Check for updates'));
@@ -71,7 +85,7 @@ it('reports an active local CachyOS default runtime truthfully without claiming
it('does not claim an active local CachyOS runtime when the default runtime is something else',async()=>{
data.runtime={...activeCachy,name:'nexus-runtime-11.0-experimental-g5910703e-local'};await render();
expect(text()).not.toContain('ACTIVE');expect(text()).toContain('Not installed');
- expect(card().querySelector('[data-cachyos-binary="missing"]')).not.toBeNull();expect(text()).not.toContain('/local/cachyos/files/bin/wine');
+ expect(text()).not.toContain('/local/cachyos/files/bin/wine');
});
it('reports a committed uncertain install as attention instead of success',async()=>{
data.runtime.managedFamilies=[available()];await render();
diff --git a/src/renderer/settings.test.tsx b/src/renderer/settings.test.tsx
index 41ebf58..c85aa8f 100644
--- a/src/renderer/settings.test.tsx
+++ b/src/renderer/settings.test.tsx
@@ -29,7 +29,9 @@ describe('Settings diagnostics', () => {
const details = html.match(/<details\b[^>]*class="settings-card settings-diagnostics"[^>]*>[\s\S]*?<\/details>/)?.[0];
expect(details).toBeDefined();
expect(details?.split('>')[0]).not.toMatch(/\bopen\b/);
- expect(details).toContain('COMMIT');
+ expect(details).not.toContain('COMMIT');
+ expect(details).not.toContain('Backend details');
+ expect(details).not.toContain('Runtime details');
expect(details).toContain('Detailed game logs');
expect(details).toContain('Save diagnostics');
expect(details).not.toContain('Build dependencies');
@@ -46,7 +48,7 @@ describe('Settings diagnostics', () => {
expect(main).not.toContain('Rebuild backend');
expect(main).not.toContain('Install / update backend');
expect(html).not.toContain('External Xodus source');
- expect(html).toContain('CachyOS binary');
+ expect(html).not.toContain('CachyOS binary');
expect(main).toContain('Nexus runtime');
expect(main).toContain('Open backend diagnostic log');
expect(main).toContain('No passwords, tokens or account contents');
@@ -82,6 +84,92 @@ describe('Settings diagnostics', () => {
});
+it('shows the default and CachyOS runtime cards with one identical structure and no binary path detail',()=>{
+ const data = demoSnapshot();
+ data.runtime.nexusAvailable = false;
+ data.runtime.managedFamilies = [
+ { id: 'nexus', checking: false, installing: false, version: 'runtime-10.0', channel: 'stable', updateAvailable: false,
+ installed: { id: 'nexus', label: 'Standard', buildId: 'a'.repeat(64), sourceCommit: 'b'.repeat(40), manifestSha256: 'c'.repeat(64), displayWinePath: '/managed/standard/files/bin/wine' } },
+ { id: 'nexus-cachyos', checking: false, installing: false, version: 'runtime-cachyos-10.0', channel: 'stable', updateAvailable: true,
+ installed: { id: 'nexus-cachyos', label: 'CachyOS', buildId: 'd'.repeat(64), sourceCommit: 'e'.repeat(40), manifestSha256: 'f'.repeat(64), displayWinePath: '/managed/cachyos/files/bin/wine' },
+ available: { version: 'runtime-cachyos-11.0', candidateSha256: 'a'.repeat(64), sourceCommit: 'b'.repeat(40), archiveName: 'nexus-runtime-cachyos-x86_64.tar.xz', requiresBackendVersion: '0.2.3', requiresLauncherVersion: '0.5.0' } },
+ ];
+ const html = renderToStaticMarkup(<SettingsPage data={data} toast={() => {}} />);
+ const cards = [...html.matchAll(/<section class="settings-card managed-runtime-settings"[\s\S]*?<\/section>/g)].map(match => match[0]);
+ expect(cards).toHaveLength(2);
+ expect(cards[0]).toContain('data-runtime-family="default"');
+ expect(cards[1]).toContain('data-runtime-family="nexus-cachyos"');
+ for (const card of cards) {
+ expect(card).toContain('class="settings-heading"');
+ expect(card).toContain('class="status-label');
+ expect(card).toContain('class="button-row end"');
+ expect(card).toContain('Check for updates');
+ expect(card).not.toContain('managed-runtime-binary');
+ }
+ expect(cards[0]).toContain('Default runtime');
+ expect(cards[1]).toContain('CachyOS runtime');
+ expect(cards[1]).toContain('Update CachyOS runtime');
+ expect(html).not.toContain('/managed/cachyos/files/bin/wine');
+ expect(html).not.toContain('/managed/standard/files/bin/wine');
+ expect(html).not.toContain('Read-only path');
+});
+
+it('presents a Standard runtime candidate in the same available line as a managed family',()=>{
+ const data = demoSnapshot();
+ data.runtime.nexusAvailable = true;
+ data.runtime.nexusName = 'nexus-runtime-11.0-x86_64.tar.xz';
+ data.runtime.nexusVersion = 'runtime-11.0';
+ data.runtime.managedFamilies = [
+ { id: 'nexus-cachyos', checking: false, installing: false, updateAvailable: true,
+ available: { version: 'runtime-cachyos-11.0', candidateSha256: 'a'.repeat(64), sourceCommit: 'b'.repeat(40), archiveName: 'nexus-runtime-cachyos-x86_64.tar.xz', requiresBackendVersion: '0.2.3', requiresLauncherVersion: '0.5.0' } },
+ ];
+ const html = renderToStaticMarkup(<SettingsPage data={data} toast={() => {}} />);
+ const cards = [...html.matchAll(/<section class="settings-card managed-runtime-settings"[\s\S]*?<\/section>/g)].map(match => match[0]);
+ expect(cards[0]).toContain('Available: 11.0');
+ expect(cards[0]).toContain('Install Nexus runtime');
+ expect(cards[1]).toContain('Available: runtime-cachyos-11.0');
+ expect(cards[1]).toContain('Install CachyOS runtime');
+});
+
+it('keeps both ready runtime cards free of an idle phase panel while keeping real progress and errors',()=>{
+ const data = demoSnapshot();
+ data.runtime.phase = 'Runtime is ready.';
+ const family = () => ({
+ id: 'nexus-cachyos' as const, checking: false, installing: false, version: 'runtime-cachyos-10.0', channel: 'stable' as const, updateAvailable: false,
+ installed: { id: 'nexus-cachyos' as const, label: 'CachyOS', buildId: 'a'.repeat(64), sourceCommit: 'b'.repeat(40), manifestSha256: 'c'.repeat(64) },
+ });
+ data.runtime.managedFamilies = [{ ...family(), phase: 'Runtime is ready.' }];
+ const cards = (html: string) => [...html.matchAll(/<section class="settings-card managed-runtime-settings"[\s\S]*?<\/section>/g)].map(match => match[0]);
+ const ready = renderToStaticMarkup(<SettingsPage data={data} toast={() => {}} />);
+ const readyCards = cards(ready);
+ expect(readyCards).toHaveLength(2);
+ for (const card of readyCards) {
+ expect(card).toContain('class="status-label ready"');
+ expect(card).not.toContain('runtime-phase');
+ }
+ expect(ready).not.toContain('Runtime is ready.');
+
+ data.runtime.phase = 'Checking the selected Standard runtime update.';
+ data.runtime.nexusChecking = true;
+ data.runtime.managedFamilies = [{ ...family(), checking: true, phase: 'Checking the CachyOS runtime release.' }];
+ const busy = renderToStaticMarkup(<SettingsPage data={data} toast={() => {}} />);
+ const busyCards = cards(busy);
+ expect(busyCards[0]).toContain('runtime-phase');
+ expect(busyCards[0]).toContain('Checking the selected Standard runtime update.');
+ expect(busyCards[1]).toContain('runtime-phase');
+ expect(busyCards[1]).toContain('Checking the CachyOS runtime release.');
+
+ data.runtime.nexusChecking = false;
+ data.runtime.phase = 'Runtime is ready.';
+ data.runtime.error = 'SHA-512 verification failed.';
+ data.runtime.managedFamilies = [{ ...family(), phase: 'Runtime is ready.', error: 'Backend 0.3.0 or newer is required' }];
+ const failed = renderToStaticMarkup(<SettingsPage data={data} toast={() => {}} />);
+ expect(failed).not.toContain('Runtime is ready.');
+ for (const card of cards(failed)) expect(card).not.toContain('runtime-phase');
+ expect(failed).toContain('SHA-512 verification failed.');
+ expect(failed).toContain('Backend 0.3.0 or newer is required');
+});
+
it('shows close-to-tray as an optional desktop preference',()=>{
const data=demoSnapshot();data.settings.closeToTray=true;
const html=renderToStaticMarkup(<SettingsPage data={data} toast={()=>{}}/>);