Skip to content

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

TypeScript

refactor(settings): manage prebuilt components and show CachyOS binary

Nexus Maintainer7c4efa87b8ff
diff --git a/assets/locales/en.json b/assets/locales/en.json
index aea7097..40d29fc 100644
--- a/assets/locales/en.json
+++ b/assets/locales/en.json
@@ -19,6 +19,10 @@
"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.families_version": "Installed: {{version}}",
diff --git a/src/main/backend-update-outcomes.test.ts b/src/main/backend-update-outcomes.test.ts
index 94ec9c8..fd07685 100644
--- a/src/main/backend-update-outcomes.test.ts
+++ b/src/main/backend-update-outcomes.test.ts
@@ -19,15 +19,18 @@ afterEach(async () => { await fs.rm(root, { recursive: true, force: true }); });
function manager() { const result = new BackendManager(root, '', () => {}, () => false); vi.spyOn(result, 'externalDownloadRunning').mockResolvedValue(false); return result; }
function refreshSelected(m: BackendManager) { return vi.spyOn(m, 'refresh').mockImplementation(async () => { expect(m.current.available).toBe(false); expect(m.current.capabilities.login).toBe(false); Object.assign((m as unknown as { status: object }).status, { available: true }); return m.current; }); }
describe('backend mutation boundaries', () => {
- it.each(['update', 'rebuild'] as const)('reserves %s before activity await and excludes both mutations', async operation => {
+ it('reserves update before activity await and excludes a second mutation', async () => {
const m = manager(), gate = deferred<boolean>(); vi.mocked(m.externalDownloadRunning).mockReturnValue(gate.promise);
- const pending = m[operation](() => {}).catch(e => e); expect(m.current.updating).toBe(true);
- await expect(m.update(() => {})).rejects.toThrow('already running'); await expect(m.rebuild(() => {})).rejects.toThrow('already running');
- gate.resolve(true); expect(await pending).toMatchObject({ committed: false, operation }); expect(m.current.updating).toBe(false); expect(installBackend).not.toHaveBeenCalled();
+ const pending = m.update(() => {}).catch(e => e); expect(m.current.updating).toBe(true);
+ await expect(m.update(() => {})).rejects.toThrow('already running');
+ gate.resolve(true); expect(await pending).toMatchObject({ committed: false, operation: 'update' }); expect(m.current.updating).toBe(false); expect(installBackend).not.toHaveBeenCalled();
});
- it.each(['update', 'rebuild'] as const)('releases %s reservation when first notification throws', async operation => {
- const m = manager(); const error = await m[operation](() => { throw Error('notify'); }).catch(e => e);
- expect(error).toBeInstanceOf(BackendMutationError); expect(error).toMatchObject({ committed: false, operation }); expect(m.current.updating).toBe(false); expect(discoverBackend).not.toHaveBeenCalled();
+ it('releases update reservation when first notification throws', async () => {
+ const m = manager(); const error = await m.update(() => { throw Error('notify'); }).catch(e => e);
+ expect(error).toBeInstanceOf(BackendMutationError); expect(error).toMatchObject({ committed: false, operation: 'update' }); expect(m.current.updating).toBe(false); expect(discoverBackend).not.toHaveBeenCalled();
+ });
+ it('does not expose a source-build backend mutation', () => {
+ expect((manager() as unknown as {rebuild?: unknown}).rebuild).toBeUndefined();
});
it('preserves the old pointer when installation fails', async () => {
const m = manager(), pointer = path.join(root, 'xodus-backends/current.json'); await fs.writeFile(pointer, 'old-pointer'); vi.mocked(installBackend).mockRejectedValue(Error('download failed'));
diff --git a/src/main/backend.test.ts b/src/main/backend.test.ts
index 85162fd..90095fa 100644
--- a/src/main/backend.test.ts
+++ b/src/main/backend.test.ts
@@ -175,7 +175,10 @@ describe('prebuilt backend', () => {
expect(pointer.delivery).toBe('release');
expect(pointer.recipeSha256).toBe(backendRecipeSha256);
expect(manager.current.available).toBe(true);
- expect(manager.current.prerequisites.cargo).toBe(false);
+ // No source-build toolchain version probes. Git remains only for the
+ // optional legacy external backend commit metadata.
+ expect(vi.mocked(run).mock.calls.some(([command, args]) => command === 'cargo' || command === 'rustc' || command === 'protoc'
+ || command === 'git' && args.includes('--version'))).toBe(false);
expect((await manager.checkUpdate()).updateAvailable).toBe(false);
await manager.update(() => {}); // Reinstall identical bytes safely.
} else {
diff --git a/src/main/backend.ts b/src/main/backend.ts
index 06a9466..6a50a4b 100644
--- a/src/main/backend.ts
+++ b/src/main/backend.ts
@@ -4,21 +4,19 @@ import { randomUUID, createHash } from 'node:crypto';
import type { BackendCapabilities, BackendStatus } from '../shared/types.js';
import { parseBackendHelp } from '../shared/utils.js';
import { run } from './process.js';
-import { backendLock, backendRecipeSha256, compareVersions } from './backend-package.js';
+import { backendLock, compareVersions } from './backend-package.js';
import { discoverBackend, installBackend, backendHttpStatus, type BackendArtifact, BackendInstallError, type BackendUpdateStage } from './backend-releases.js';
import { backendDiagnostic } from './backend-diagnostics.js';
import type { PreparedComponentUpdate } from './component-updates.js';
import { BackendPrerequisiteError, backendPrerequisiteFailure } from './backend-prerequisites.js';
-const REPOSITORY = backendLock.repository;
export const LINUX_RUN_PATCH = backendLock.compatibility;
-const LINUX_RUN_RELEASE = backendLock.commit.slice(0, 12);
const EMPTY_CAPABILITIES: BackendCapabilities = {
commands: [], account: false, login: false, logout: false, download: false, streaming: false, run: false,
};
interface ManagedPointer { commit: string; binaryPath: string; builtAt: string; linuxRunPatch?: string; recipeSha256?: string; version?: string; delivery?: 'release' | 'local' }
-type BackendMutation = 'update' | 'rebuild';
+type BackendMutation = 'update';
export type BackendMutationTarget = Readonly<Pick<ManagedPointer, 'commit' | 'binaryPath' | 'version' | 'delivery' | 'linuxRunPatch' | 'recipeSha256'>>;
/** Publication of current.json is a commit boundary, not a durability claim. */
export class BackendMutationError extends Error {
@@ -60,7 +58,6 @@ export class BackendManager {
updating: false,
externalRoot,
capabilities: EMPTY_CAPABILITIES,
- prerequisites: { git: false, cargo: false, rustc: false, protoc: false },
};
}
@@ -68,10 +65,6 @@ export class BackendManager {
setExternalRoot(root: string): void { this.status.externalRoot = root; this.reconciliationEpoch++; }
- private async commandExists(command: string): Promise<boolean> {
- try { return (await run(command, ['--version'], { maxOutput: 20_000 })).code === 0; } catch { return false; }
- }
-
private async validate(binaryPath: string): Promise<BackendCapabilities | null> {
try {
await fs.access(binaryPath, constants.X_OK);
@@ -130,11 +123,6 @@ export class BackendManager {
const epoch = this.reconciliationEpoch, sequence = ++this.refreshSequence;
const externalRoot = this.status.externalRoot;
const current = () => epoch === this.reconciliationEpoch && sequence === this.refreshSequence;
- const [git, cargo, rustc, protoc] = await Promise.all([
- this.commandExists('git'), this.commandExists('cargo'), this.commandExists('rustc'), this.commandExists('protoc'),
- ]);
- if (!current()) return this.current;
- this.status.prerequisites = { git, cargo, rustc, protoc };
let validationFailure: string | undefined;
const validate = (binary: string) => this.validate(binary).catch(error => {
@@ -400,87 +388,4 @@ export class BackendManager {
}
}
- async rebuild(onStatus: () => void): Promise<void> {
- if (this.status.updating) throw new Error('A backend installation is already running.');
- this.status.updating = true;
- this.reconciliationEpoch++;
- this.status.blockReason = undefined;
- const staging = path.join(this.managedRoot, `.staging-${randomUUID()}`);
- const log = (line: string) => this.emitLog('backend', line);
- let committed = false, reconciled = false;
- let failure: BackendMutationError | undefined;
- let targetIdentity: BackendMutationTarget | undefined;
- try {
- onStatus();
- await this.assertUpdateAllowed();
- if (!this.status.prerequisites.git || !this.status.prerequisites.cargo || !this.status.prerequisites.rustc || !this.status.prerequisites.protoc) {
- throw new Error('Git, Cargo, Rust, or protoc is missing. Check the build dependencies in Settings.');
- }
- await fs.mkdir(path.join(this.managedRoot, 'releases'), { recursive: true });
- log(`Cloning the pinned Xodus source ${backendLock.commit}…`);
- let result = await run('git', ['clone', '--no-checkout', REPOSITORY, staging], { onLine: log });
- if (result.code !== 0) throw new Error(`git clone exited with code ${result.code}`);
- result = await run('git', ['-C', staging, 'checkout', '--detach', backendLock.commit], { onLine: log });
- if (result.code !== 0) throw new Error('Pinned backend checkout failed.');
- const commit = (await run('git', ['-C', staging, 'rev-parse', 'HEAD'])).output.trim();
- if (commit !== backendLock.commit || createHash('sha256').update(await fs.readFile(path.join(staging, 'Cargo.lock'))).digest('hex') !== backendLock.cargoLockSha256) throw new Error('Backend source lock mismatch.');
- if (createHash('sha256').update(await fs.readFile(path.join(staging, 'build-config.json'))).digest('hex') !== backendLock.buildConfigSha256)
- throw new Error('Backend build configuration mismatch.');
- const compiler = await run('rustc', ['--version']);
- if (compiler.code !== 0 || !compiler.output.startsWith(`rustc ${backendLock.rust} `))
- throw new Error(`The source build requires Rust ${backendLock.rust}.`);
- const target = path.join(staging, 'target');
- log(`Building ${commit.slice(0, 10)} with Cargo…`);
- result = await run('cargo', ['build', '--locked', '--release', '--no-default-features', '-p', 'xodus-cli', '-p', 'xodus-service'], {
- cwd: staging,
- env: { ...process.env, CARGO_TARGET_DIR: target },
- onLine: log,
- maxOutput: 5_000_000,
- });
- if (result.code !== 0) throw new Error(`cargo build exited with code ${result.code}`);
- const builtCli = path.join(target, 'release', 'xodus-cli');
- const capabilities = await this.validate(builtCli);
- if (!capabilities?.login || !capabilities.streaming || !capabilities.account || !capabilities.externalAuth || !capabilities.packageSelection) throw new Error('The built backend failed command validation.');
- const runHelp = await run(builtCli, ['run', '--help'], { maxOutput: 100_000 });
- if (runHelp.code !== 0 || !runHelp.output.includes('--materialize-chain')) throw new Error('The built backend lacks launch-chain support.');
- await this.assertUpdateAllowed();
-
- const releaseDir = path.join(this.managedRoot, 'releases', `${commit}-${LINUX_RUN_RELEASE}-local-${randomUUID()}`);
- await fs.mkdir(releaseDir, { recursive: true });
- const managedCli = path.join(releaseDir, 'xodus-cli');
- await fs.copyFile(builtCli, managedCli);
- await fs.chmod(managedCli, 0o755);
- const builtService = path.join(target, 'release', 'xodus-service');
- await fs.copyFile(builtService, path.join(releaseDir, 'xodus-service'));
- await fs.chmod(path.join(releaseDir, 'xodus-service'), 0o755);
- await fs.writeFile(path.join(releaseDir, 'metadata.json'), JSON.stringify({ commit, builtAt: new Date().toISOString(), capabilities, linuxRunPatch: LINUX_RUN_PATCH }, null, 2));
- const pointer: ManagedPointer = { commit, binaryPath: managedCli, builtAt: new Date().toISOString(), linuxRunPatch: LINUX_RUN_PATCH,
- recipeSha256: backendRecipeSha256, version: backendLock.version, delivery: 'local' };
- targetIdentity = { commit, binaryPath: managedCli, version: pointer.version, delivery: pointer.delivery, linuxRunPatch: pointer.linuxRunPatch, recipeSha256: pointer.recipeSha256 };
- const pointerTmp = `${this.pointerFile}.${randomUUID()}.tmp`;
- try {
- await fs.writeFile(pointerTmp, JSON.stringify(pointer, null, 2));
- await fs.rename(pointerTmp, this.pointerFile);
- committed = true;
- this.reconciliationEpoch++;
- } finally { if (!committed) await fs.rm(pointerTmp, { force: true }); }
- Object.assign(this.status, {
- available: false, source: 'managed', binaryPath: managedCli, commit,
- upstreamCommit: commit, updateAvailable: false, capabilities: EMPTY_CAPABILITIES, linuxRunPatch: LINUX_RUN_PATCH,
- });
- const refreshed = await this.refresh();
- if (!refreshed.available || refreshed.source !== 'managed' || refreshed.binaryPath !== managedCli) throw new Error('The selected backend could not be confirmed after activation.');
- reconciled = true;
- log('The new backend passed validation and was activated atomically. Older builds were preserved.');
- } catch (error) {
- if (committed && !reconciled) Object.assign(this.status, { available: false, capabilities: EMPTY_CAPABILITIES,
- source: 'managed', ...targetIdentity });
- failure = this.mutationFailure('rebuild', error, committed, targetIdentity);
- throw failure;
- } finally {
- await fs.rm(staging, { recursive: true, force: true }).catch(() => undefined);
- this.status.updating = false;
- this.notifyMutation('rebuild', onStatus, committed, targetIdentity, failure);
- }
- }
}
diff --git a/src/main/component-updates-ipc.test.ts b/src/main/component-updates-ipc.test.ts
index 2b088c2..b2ddce7 100644
--- a/src/main/component-updates-ipc.test.ts
+++ b/src/main/component-updates-ipc.test.ts
@@ -9,14 +9,14 @@ const ast=ts.createSourceFile('index.ts',source,ts.ScriptTarget.ES2022,true);
const names=new Set(['ensureIdle','ensureActivityIdle','componentActivityRunning','prepareFirstRunBackend']);
const functions=ast.statements.filter(node=>ts.isFunctionDeclaration(node)&&node.name&&names.has(node.name.text)).map(node=>node.getText(ast)).join('\n');
const register=ast.statements.find(node=>ts.isFunctionDeclaration(node)&&node.name?.text==='registerIpc') as ts.FunctionDeclaration;
-const routes=new Set(['backend-update','backend-rebuild','runtime-family-install','install-launcher-update','rollback-launcher-update','restart-launcher']);
+const routes=new Set(['backend-update','runtime-family-install','install-launcher-update','rollback-launcher-update','restart-launcher']);
const handlerSource=register.body!.statements.filter(node=>ts.isExpressionStatement(node)&&ts.isCallExpression(node.expression)&&node.expression.expression.getText(ast)==='ipcMain.handle'&&ts.isStringLiteral(node.expression.arguments[0])&&routes.has(node.expression.arguments[0].text)).map(node=>node.getText(ast)).join('\n');
const activityExpressions:string[]=[];let contextExpression='';
function collect(node:ts.Node):void{if(ts.isNewExpression(node)){const name=node.expression.getText(ast);if(name==='RuntimeManager')activityExpressions.push(node.arguments![2].getText(ast));if(name==='BackendManager')activityExpressions.push(node.arguments![3].getText(ast));if(name==='ComponentUpdates')contextExpression=node.arguments![4].getText(ast);}ts.forEachChild(node,collect);}collect(ast);
function fixture(){
const handlers=new Map<string,Function>();
const ctx:any={componentUpdates:undefined,authState:{running:false},authJob:undefined,offlinePermissionChanging:false,keyringSupport:{busy:false},shutdownStarted:false,downloadCancellations:new Set(),preparingInstall:false,preparingContent:false,preparingLaunch:false,finalizingGame:false,checkingGameUpdates:false,gameRemovalInProgress:false,gameOperation:undefined,operations:new Map(),installQueue:{size:0},store:{settings:{firstRunCompleted:false},downloads:[]},assertActivityCompatible,
- backend:{current:{available:false,updating:false,releaseAvailable:true,updateAvailable:true},update:vi.fn(async()=>{}),rebuild:vi.fn(async()=>{}),checkUpdate:vi.fn(async()=>{})},runtime:{busy:false,current:{updating:false},installManagedRuntime:vi.fn(async()=>{})},launcherUpdater:{busy:false,state:{restartRequired:true},targetPath:'/synthetic/AppImage',install:vi.fn(async()=>{}),rollback:vi.fn(async()=>{}),assertRestartReady:vi.fn(async()=>{})},
+ backend:{current:{available:false,updating:false,releaseAvailable:true,updateAvailable:true},update:vi.fn(async()=>{}),checkUpdate:vi.fn(async()=>{})},runtime:{busy:false,current:{updating:false},installManagedRuntime:vi.fn(async()=>{})},launcherUpdater:{busy:false,state:{restartRequired:true},targetPath:'/synthetic/AppImage',install:vi.fn(async()=>{}),rollback:vi.fn(async()=>{}),assertRestartReady:vi.fn(async()=>{})},
emitSnapshot:vi.fn(),refreshAccount:vi.fn(async()=>{}),refreshInitialAccount:vi.fn(async()=>{}),backendDiagnostic:vi.fn(),mainWindow:{isVisible:()=>false},app:{relaunch:vi.fn(),quit:vi.fn()},externalLauncherEnvironment:()=>({}),process:{env:{}},ipcMain:{handle:(name:string,fn:Function)=>handlers.set(name,fn)}};
runInNewContext(ts.transpileModule(functions+'\n'+handlerSource,{compilerOptions:{target:ts.ScriptTarget.ES2022}}).outputText,ctx);
ctx.componentUpdateAdmission=new ComponentUpdateAdmission(()=>ctx.ensureActivityIdle());
@@ -24,7 +24,10 @@ function fixture(){
return {ctx,handlers,activity,gate:ctx.componentUpdateAdmission as ComponentUpdateAdmission};
}
describe('actual main component admission',()=>{
- it.each(['backend-update','backend-rebuild','runtime-family-install','install-launcher-update','rollback-launcher-update','restart-launcher'])('blocks %s while a batch holds ownership',async name=>{
+ it('does not register the removed public backend rebuild route',()=>{
+ expect(source).not.toContain('backend-rebuild');
+ });
+ it.each(['backend-update','runtime-family-install','install-launcher-update','rollback-launcher-update','restart-launcher'])('blocks %s while a batch holds ownership',async name=>{
const {ctx,handlers,gate}=fixture(),owner=gate.reserve();await expect(Promise.resolve().then(()=>handlers.get(name)!({},'nexus','sha',{}))).rejects.toThrow('Component updates');
expect(ctx.backend.update).not.toHaveBeenCalled();expect(ctx.runtime.installManagedRuntime).not.toHaveBeenCalled();expect(ctx.launcherUpdater.install).not.toHaveBeenCalled();expect(ctx.app.relaunch).not.toHaveBeenCalled();gate.release(owner);
});
diff --git a/src/main/index.ts b/src/main/index.ts
index 53d5ced..f964efc 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -1747,7 +1747,6 @@ function registerDemoIpc(catalogMarket: () => string): void {
ipcMain.handle('backend-refresh', () => snapshot().backend);
ipcMain.handle('backend-check-update', () => snapshot().backend);
ipcMain.handle('backend-update', () => {});
- ipcMain.handle('backend-rebuild', () => {});
ipcMain.handle('runtime-refresh', () => snapshot().runtime);
ipcMain.handle('runtime-families', () => []);
ipcMain.handle('runtime-check-update', () => snapshot().runtime);
@@ -1921,7 +1920,6 @@ function registerIpc(): void {
catch (error) { backendDiagnostic({ operation: 'update', event: 'failure', stage: 'update-blocked', committed: false }); throw error; }
await backend.update(emitSnapshot); await refreshAccount();
});
- ipcMain.handle('backend-rebuild', async () => { ensureIdle(); await backend.rebuild(emitSnapshot); await refreshAccount(); });
ipcMain.handle('runtime-refresh', async () => {
ensureIdle();
return runtime.refreshSelection(emitSnapshot, async () => {
diff --git a/src/main/managed-runtime.test.ts b/src/main/managed-runtime.test.ts
index b5953a6..8abdf20 100644
--- a/src/main/managed-runtime.test.ts
+++ b/src/main/managed-runtime.test.ts
@@ -357,5 +357,5 @@ it('installs an exact issued target after a later check selects another release,
const latest=f.remote,original=vi.mocked(f.fetcher).getMockImplementation()!;
vi.mocked(f.fetcher).mockImplementation(async(input,init)=>{const name=String(input).split('/').pop()!;const bytes=old.assets.get(name);return bytes?new Response(bytes):original(input,init);});
const forged=await f.manager.installPreparedManagedRuntime('nexus-cachyos',{...prepared},policy);expect(forged.committed).toBe(false);expect(forged.success).toBe(false);
- const result=await f.manager.installPreparedManagedRuntime('nexus-cachyos',prepared,policy);expect(result.success).toBe(true);expect(f.manager.current.managedFamilies!.find(row=>row.id==='nexus-cachyos')!.installed!.sourceCommit).toBe(selectedCommit);expect(latest.commit).not.toBe(selectedCommit);await f.preserved();
+ const result=await f.manager.installPreparedManagedRuntime('nexus-cachyos',prepared,policy);expect(result.success).toBe(true);const installed=f.manager.current.managedFamilies!.find(row=>row.id==='nexus-cachyos')!.installed!;expect(installed.sourceCommit).toBe(selectedCommit);expect(installed.displayWinePath).toBe((await resolveRuntimeFamily(f.runtimeRoot,'nexus-cachyos','x64')).winePath);expect(latest.commit).not.toBe(selectedCommit);await f.preserved();
});
diff --git a/src/main/managed-runtime.ts b/src/main/managed-runtime.ts
index 4e8f9e3..8ca4402 100644
--- a/src/main/managed-runtime.ts
+++ b/src/main/managed-runtime.ts
@@ -101,7 +101,8 @@ export class ManagedRuntimeManager {
if (root !== this.context.root() || epoch !== this.selectionEpoch)
return;
state.installed = {
- id: verified.id, label: verified.label, buildId: verified.buildId, sourceCommit: verified.sourceCommit, manifestSha256: verified.manifestSha256
+ id: verified.id, label: verified.label, buildId: verified.buildId, sourceCommit: verified.sourceCommit, manifestSha256: verified.manifestSha256,
+ displayWinePath: verified.winePath
};
state.version = provenance?.tag as string | undefined;
state.channel = provenance ? (provenance.prerelease ? 'prerelease' : 'stable') : undefined;
diff --git a/src/main/runtime-families.test.ts b/src/main/runtime-families.test.ts
index e1ebe39..4f88a3d 100644
--- a/src/main/runtime-families.test.ts
+++ b/src/main/runtime-families.test.ts
@@ -37,7 +37,7 @@ it('accepts only known IDs, defaults only an absent preference, rejects hostile
});
it('only lists a complete verified managed installation',async()=>{
expect(await installedRuntimeFamilies(root,'x64')).toEqual([]);await fixture();
- expect(await installedRuntimeFamilies(root,'x64')).toEqual([expect.objectContaining({id:family,buildId})]);
+ expect(await installedRuntimeFamilies(root,'x64')).toEqual([expect.objectContaining({id:family,buildId,displayWinePath:path.join(release,'files/bin/wine')})]);
await fs.writeFile(path.join(release,'files/bin/wine'),'changed');
expect(await installedRuntimeFamilies(root,'x64')).toEqual([]);
await expect(resolveRuntimeFamily(root,family,'x64')).rejects.toThrow('default was not used');
diff --git a/src/main/runtime-families.ts b/src/main/runtime-families.ts
index e95d991..c1ade59 100644
--- a/src/main/runtime-families.ts
+++ b/src/main/runtime-families.ts
@@ -199,8 +199,8 @@ export async function retainRuntimeFamilyBuild(runtimeRoot:string,selection:unkn
}finally{await fs.unlink(temporary).catch(()=>undefined);}
}
export async function installedRuntimeFamilies(runtimeRoot:string,arch:string=process.arch):Promise<InstalledRuntimeFamily[]> {
- const results=await Promise.all(runtimeFamilies.map(async id=>{
- try{const value=await resolveRuntimeFamily(runtimeRoot,id,arch);return {id:value.id,label:value.label,buildId:value.buildId,sourceCommit:value.sourceCommit,manifestSha256:value.manifestSha256};}catch{return undefined;}
+ const results=await Promise.all(runtimeFamilies.map(async (id):Promise<InstalledRuntimeFamily|undefined>=>{
+ try{const value=await resolveRuntimeFamily(runtimeRoot,id,arch);return {id:value.id,label:value.label,buildId:value.buildId,sourceCommit:value.sourceCommit,manifestSha256:value.manifestSha256,displayWinePath:value.winePath};}catch{return undefined;}
}));
return results.filter((value):value is InstalledRuntimeFamily=>Boolean(value));
}
diff --git a/src/preload/index.cts b/src/preload/index.cts
index fca094d..1e1b3ff 100644
--- a/src/preload/index.cts
+++ b/src/preload/index.cts
@@ -81,7 +81,6 @@ const api: LauncherApi = {
refreshBackend: () => ipcRenderer.invoke('backend-refresh'),
checkBackendUpdate: () => ipcRenderer.invoke('backend-check-update'),
updateBackend: () => ipcRenderer.invoke('backend-update'),
- rebuildBackend: () => ipcRenderer.invoke('backend-rebuild'),
refreshRuntime: () => ipcRenderer.invoke('runtime-refresh'),
getRuntimeFamilies: () => ipcRenderer.invoke('runtime-families'),
checkRuntimeUpdate: () => ipcRenderer.invoke('runtime-check-update'),
diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx
index cca0574..911b844 100644
--- a/src/renderer/App.tsx
+++ b/src/renderer/App.tsx
@@ -11,13 +11,13 @@ import { useDialogFocus } from './use-dialog-focus';
import { lazy, Suspense, useEffect, useLayoutEffect, useMemo, useRef, useState, type FormEvent } from 'react';
import {
ArrowDownToLine, Check, ChevronRight, CircleAlert, CircleUserRound,
- Clock3, Cog, Download, FolderOpen, Gamepad2, Github, HardDrive, Home, Library,
+ Clock3, Cog, Download, FolderOpen, Gamepad2, HardDrive, Home, Library,
LoaderCircle, LogIn, MoreHorizontal, PackageCheck, Pause, Play, Plus, RefreshCw, Rocket, Search, Settings2,
Store, Terminal, Trash2, Copy, PanelLeft, X,
} from 'lucide-react';
import type { AccountLibraryPage, AppSnapshot, CatalogProduct, CatalogSearchResult, DiagnosticLog, Game, GameContentPlan, GameLaunchOptions, Page, Settings, XboxProfileRequest } from '../shared/types';
import {OverlayShortcutRecorder} from './OverlayShortcutRecorder';
-import {reconcileSettingsDraft} from './settings-draft';
+import {reconcileSettingsDraft, storageSettingsPatch} from './settings-draft';
import {xboxOverlaySettings} from '../shared/xbox-overlay-settings';
import './xbox-desktop-social.css';
import { estimateTimeRemaining } from '../shared/utils';
@@ -61,7 +61,6 @@ const emptySnapshot: AppSnapshot = {
available: false, source: 'none', updateAvailable: false, checking: false, updating: false,
externalRoot: '',
capabilities: { commands: [], account: false, login: false, logout: false, download: false, streaming: false, run: false },
- prerequisites: { git: false, cargo: false, rustc: false, protoc: false },
},
runtime: {
installed: false, checking: false, updating: false,
@@ -932,10 +931,6 @@ export function DownloadsPage({ data, toast }: { data: AppSnapshot; toast: (valu
</main>;
}
-function ToggleStatus({ ok, label }: { ok: boolean; label: string }) {
- return <span className={`dependency ${ok ? 'ok' : ''}`}>{ok ? <Check /> : <X />}{label}</span>;
-}
-
export function SettingsPage({ data, toast }: { data: AppSnapshot; toast: (value: Toast) => void }) {
const confirm = useConfirmation();
const [form, setForm] = useState<Settings>(data.settings);
@@ -956,7 +951,6 @@ export function SettingsPage({ data, toast }: { data: AppSnapshot; toast: (value
setAccountManagement(enabled);
setForm(current => ({ ...current, multiAccountEnabled: enabled }));
}
- const [logs, setLogs] = useState<string[]>([]);
const [runtimeLogs, setRuntimeLogs] = useState<string[]>([]);
useEffect(() => {
const previous = previousSettings.current;
@@ -964,7 +958,6 @@ export function SettingsPage({ data, toast }: { data: AppSnapshot; toast: (value
setForm(current => reconcileSettingsDraft(current, previous, data.settings));
}, [data.settings]);
useEffect(() => window.launcher.onOperationLog(({ scope, line }) => {
- if (scope === 'backend') setLogs((items) => [...items.slice(-199), line]);
if (scope === 'runtime') setRuntimeLogs((items) => [...items.slice(-199), line]);
}), []);
@@ -975,11 +968,11 @@ export function SettingsPage({ data, toast }: { data: AppSnapshot; toast: (value
finally { setBusy(undefined); }
}
- async function pick(kind: 'install' | 'backend' | 'runtime' | 'wine') {
+ async function pick(kind: 'install' | 'runtime' | 'wine') {
const selected = kind === 'wine'
? await window.launcher.chooseFile(form.winePath)
- : await window.launcher.chooseDirectory(kind === 'install' ? form.installRoot : kind === 'backend' ? form.externalXodusRoot : form.runtimeRoot);
- if (selected) setForm((current) => ({ ...current, [kind === 'install' ? "installRoot" : kind === 'backend' ? "externalXodusRoot" : kind === 'runtime' ? "runtimeRoot" : "winePath"]: selected }));
+ : await window.launcher.chooseDirectory(kind === 'install' ? form.installRoot : form.runtimeRoot);
+ if (selected) setForm((current) => ({ ...current, [kind === 'install' ? "installRoot" : kind === 'runtime' ? "runtimeRoot" : "winePath"]: selected }));
}
const caps = data.backend.capabilities;
@@ -1098,7 +1091,7 @@ export function SettingsPage({ data, toast }: { data: AppSnapshot; toast: (value
<div className="form-grid"><label>{ui("ui.download_speed_limit_mib_s_1b1cf51")}<input type="number" min="0" max="1024" step="0.1" value={form.downloadLimitMiB ?? 0} onChange={event => setForm({...form, downloadLimitMiB:Number(event.target.value)})} /></label></div>
<div className="save-row"><span>{ui("ui.0_unlimited_applies_to_active_and_future_game_do_2374ba9")}</span><button className="primary" disabled={Boolean(busy) || Boolean((form.downloadLimitMiB ?? 0) > 0 && !data.backend.capabilities.streamingBandwidthLimit)} onClick={() => invoke('save-bandwidth', () => window.launcher.updateSettings({downloadLimitMiB:form.downloadLimitMiB ?? 0}), ui("ui.download_speed_limit_saved_8fd9160"))}>{busy === 'save-bandwidth' ? <LoaderCircle className="spin" /> : <Check />}{ui("ui.save_download_limit_8abf702")}</button></div>
</section>
- <section className="settings-card compact"><div className="settings-heading"><div className="settings-icon"><HardDrive /></div><div><h2>{ui("ui.storage_and_launch_paths_d3c8c4d")}</h2></div></div><div className="form-grid"><label>{ui("ui.default_game_location_5e830cb")}<div className="input-action"><input value={form.installRoot} onChange={(event) => setForm({ ...form, installRoot: event.target.value })} /><button type="button" aria-label={ui('ui.browse_3227aa9')} onClick={() => pick('install')}><FolderOpen /></button></div></label><label>{ui("ui.market_5238d9b")}<input value={form.market} onChange={(event) => setForm({ ...form, market: event.target.value })} /></label><label>{ui("ui.parallel_streams_e81513c")}<input type="number" min="1" max="16" value={form.parallelDownloads} onChange={(event) => setForm({ ...form, parallelDownloads: Number(event.target.value) })} /></label><label>{ui("ui.external_xodus_source_ef00493")}<div className="input-action"><input value={form.externalXodusRoot} onChange={(event) => setForm({ ...form, externalXodusRoot: event.target.value })} /><button type="button" aria-label={ui('ui.browse_3227aa9')} onClick={() => pick('backend')}><FolderOpen /></button></div></label><label>{ui("ui.versioned_runtime_directory_3764480")}<div className="input-action"><input value={form.runtimeRoot} onChange={(event) => setForm({ ...form, runtimeRoot: event.target.value })} /><button type="button" aria-label={ui('ui.browse_3227aa9')} onClick={() => pick('runtime')}><FolderOpen /></button></div></label><label>{ui("ui.wine_proton_binary_2b08a4a")}<div className="input-action"><input value={form.winePath} onChange={(event) => setForm({ ...form, winePath: event.target.value })} placeholder={ui("ui.selected_automatically_by_the_runtime_manager_0722211")} /><button type="button" aria-label={ui('ui.browse_3227aa9')} onClick={() => pick('wine')}><FolderOpen /></button></div></label></div><div className="save-row"><button className="primary" disabled={busy === 'save'} onClick={() => invoke('save', () => window.launcher.updateSettings(form), ui("ui.settings_saved_ae493e2"))}>{busy === 'save' ? <LoaderCircle className="spin" /> : <Check />}{ui("ui.save_1509f56")}</button></div></section>
+ <section className="settings-card compact"><div className="settings-heading"><div className="settings-icon"><HardDrive /></div><div><h2>{ui("ui.storage_and_launch_paths_d3c8c4d")}</h2></div></div><div className="form-grid"><label>{ui("ui.default_game_location_5e830cb")}<div className="input-action"><input value={form.installRoot} onChange={(event) => setForm({ ...form, installRoot: event.target.value })} /><button type="button" aria-label={ui('ui.browse_3227aa9')} onClick={() => pick('install')}><FolderOpen /></button></div></label><label>{ui("ui.market_5238d9b")}<input value={form.market} onChange={(event) => setForm({ ...form, market: event.target.value })} /></label><label>{ui("ui.parallel_streams_e81513c")}<input type="number" min="1" max="16" value={form.parallelDownloads} onChange={(event) => setForm({ ...form, parallelDownloads: Number(event.target.value) })} /></label><label>{ui("ui.versioned_runtime_directory_3764480")}<div className="input-action"><input value={form.runtimeRoot} onChange={(event) => setForm({ ...form, runtimeRoot: event.target.value })} /><button type="button" aria-label={ui('ui.browse_3227aa9')} onClick={() => pick('runtime')}><FolderOpen /></button></div></label><label>{ui("ui.wine_proton_binary_2b08a4a")}<div className="input-action"><input value={form.winePath} onChange={(event) => setForm({ ...form, winePath: event.target.value })} placeholder={ui("ui.selected_automatically_by_the_runtime_manager_0722211")} /><button type="button" aria-label={ui('ui.browse_3227aa9')} onClick={() => pick('wine')}><FolderOpen /></button></div></label></div><div className="save-row"><button className="primary" disabled={busy === 'save'} onClick={() => invoke('save', () => window.launcher.updateSettings(storageSettingsPatch(form)), ui("ui.settings_saved_ae493e2"))}>{busy === 'save' ? <LoaderCircle className="spin" /> : <Check />}{ui("ui.save_1509f56")}</button></div></section>
</div>
<details className="settings-card settings-guide" aria-label={ui('settings.guide_title')}>
<summary><PanelLeft aria-hidden="true"/><span className="guide-summary-text"><strong>{ui('settings.guide_title')}</strong><small>{ui('settings.guide_summary')}</small></span><span className={`guide-state${savedOverlay.overlayEnabled?' on':''}`}>{savedOverlay.overlayEnabled?ui('settings.guide_on'):ui('settings.guide_off')}</span><ChevronRight aria-hidden="true"/></summary>
@@ -1117,9 +1110,8 @@ 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><div className="button-row"><button className="secondary" disabled={Boolean(busy) || data.backend.updating || data.backend.checking} onClick={() => invoke('backend-rebuild', () => window.launcher.rebuildBackend(), ui("ui.pinned_backend_source_was_built_and_activated_70c1519"))}><Github />{ui("ui.build_backend_from_source_e654dac")}</button></div>{data.backend.updating || logs.length > 0 ? <pre className="build-log">{logs.join('\n') || ui("ui.waiting_for_backend_output_1ad8939")}</pre> : null}</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>
- <section><h3>{ui("ui.build_dependencies_8926e84")}</h3><div className="dependency-grid"><ToggleStatus ok={data.backend.prerequisites.git} label="Git" /><ToggleStatus ok={data.backend.prerequisites.cargo} label="Cargo" /><ToggleStatus ok={data.backend.prerequisites.rustc} label="Rust 1.99" /><ToggleStatus ok={data.backend.prerequisites.protoc} label="protoc" /></div><p className="fine-print">{ui("ui.building_xodus_also_requires_a_c_c_toolchain_cma_a847b06")}</p></section>
</div>
</details>
</main>;
diff --git a/src/renderer/ManagedRuntimeSettings.tsx b/src/renderer/ManagedRuntimeSettings.tsx
index aaa36d8..71135ad 100644
--- a/src/renderer/ManagedRuntimeSettings.tsx
+++ b/src/renderer/ManagedRuntimeSettings.tsx
@@ -63,12 +63,21 @@ 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}
diff --git a/src/renderer/managed-runtime-settings.test.tsx b/src/renderer/managed-runtime-settings.test.tsx
index 9d1e51a..e27149f 100644
--- a/src/renderer/managed-runtime-settings.test.tsx
+++ b/src/renderer/managed-runtime-settings.test.tsx
@@ -7,7 +7,7 @@ import {demoSnapshot} from '../shared/demo-data';
import type {ManagedFamilyStatus,ManagedFamilyInstallResult} from '../shared/types';
let root:Root,data:ReturnType<typeof demoSnapshot>,busy:ReturnType<typeof vi.fn>;
const offer={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 build={id:'nexus-cachyos' as const,label:'CachyOS',buildId:'c'.repeat(64),manifestSha256:'d'.repeat(64),sourceCommit:'e'.repeat(40)};
+const build={id:'nexus-cachyos' as const,label:'CachyOS',buildId:'c'.repeat(64),manifestSha256:'d'.repeat(64),sourceCommit:'e'.repeat(40),displayWinePath:'/managed/cachyos/files/bin/wine'};
const available=():ManagedFamilyStatus=>({id:'nexus-cachyos',checking:false,installing:false,available:offer,updateAvailable:true});
const installed=(channel:'stable'|'prerelease'='stable',updateAvailable=false):ManagedFamilyStatus=>({...available(),installed:build,version:'runtime-cachyos-10.0',channel,updateAvailable});
const standard:ManagedFamilyStatus={id:'nexus',checking:false,installing:false,installed:{...build,id:'nexus',label:'Standard'},version:'runtime-10.0',channel:'stable',updateAvailable:false};
@@ -31,6 +31,8 @@ it('renders one concise CachyOS card with no experimental text, prerelease contr
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(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()=>{
@@ -50,6 +52,8 @@ 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(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});
@@ -57,6 +61,8 @@ 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('Installed:');expect(card().querySelector('.status-label.ready')).not.toBeNull();
expect(button('Install CachyOS runtime')).toBeUndefined();
await click(button('Check for updates'));
@@ -65,6 +71,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');
});
it('reports a committed uncertain install as attention instead of success',async()=>{
data.runtime.managedFamilies=[available()];await render();
diff --git a/src/renderer/settings-draft.test.ts b/src/renderer/settings-draft.test.ts
index b4659a9..9f6b03e 100644
--- a/src/renderer/settings-draft.test.ts
+++ b/src/renderer/settings-draft.test.ts
@@ -1,7 +1,7 @@
import {expect,it} from 'vitest';
import {demoSnapshot} from '../shared/demo-data';
import type {Settings} from '../shared/types';
-import {reconcileSettingsDraft} from './settings-draft';
+import {reconcileSettingsDraft,storageSettingsPatch} from './settings-draft';
it('preserves the recorded shortcut and other unsaved edits through cloned status snapshots',()=>{
const saved={...demoSnapshot().settings,overlayShortcut:'Super+G',overlaySide:'left' as const};
@@ -34,6 +34,18 @@ it('reflects normalized saved paths while preserving a different pending field',
expect(reconcileSettingsDraft(draft,saved,{...saved,installRoot:'/new-games'})).toEqual({...draft,installRoot:'/new-games'});
});
+it('saves only visible storage fields and never re-applies the hidden external source',()=>{
+ const saved={...demoSnapshot().settings,externalXodusRoot:'/legacy/external-xodus',verboseLogs:true,overlayShortcut:'Super+G'};
+ const draft={...saved,installRoot:'/games/../new-games',market:'DE',parallelDownloads:3,runtimeRoot:'/new/runtime',winePath:'/new/wine',shaderCacheLimitGiB:8};
+ const patch=storageSettingsPatch(draft);
+ expect(patch).toEqual({installRoot:'/games/../new-games',market:'DE',parallelDownloads:3,runtimeRoot:'/new/runtime',winePath:'/new/wine'});
+ expect(patch).not.toHaveProperty('externalXodusRoot');
+ expect(patch).not.toHaveProperty('verboseLogs');
+ expect(patch).not.toHaveProperty('shaderCacheLimitGiB');
+ expect(patch).not.toHaveProperty('overlayShortcut');
+ expect(saved.externalXodusRoot).toBe('/legacy/external-xodus');
+});
+
it('removes deleted optional preferences without mutating any input',()=>{
const saved={...demoSnapshot().settings,overlayShortcut:'Shift+Tab'};
const next:Settings={...saved};delete next.overlayShortcut;
diff --git a/src/renderer/settings-draft.ts b/src/renderer/settings-draft.ts
index bf07ace..bb85244 100644
--- a/src/renderer/settings-draft.ts
+++ b/src/renderer/settings-draft.ts
@@ -1,5 +1,19 @@
import type {Settings} from '../shared/types';
+export type StorageSettingsPatch = Pick<Settings,'installRoot'|'market'|'parallelDownloads'|'runtimeRoot'|'winePath'>;
+
+/** Save only the visible storage fields. The hidden legacy external Xodus root
+ * and unrelated preferences are never re-applied from a stale form. */
+export function storageSettingsPatch(settings: Settings): StorageSettingsPatch {
+ return {
+ installRoot: settings.installRoot,
+ market: settings.market,
+ parallelDownloads: settings.parallelDownloads,
+ runtimeRoot: settings.runtimeRoot,
+ winePath: settings.winePath,
+ };
+}
+
/** Snapshots clone settings even when only operation or shortcut status changed. */
export function reconcileSettingsDraft(draft:Settings,previous:Settings,next:Settings):Settings {
let result=draft;
diff --git a/src/renderer/settings.test.tsx b/src/renderer/settings.test.tsx
index d961694..41ebf58 100644
--- a/src/renderer/settings.test.tsx
+++ b/src/renderer/settings.test.tsx
@@ -29,11 +29,11 @@ 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('Build dependencies');
expect(details).toContain('COMMIT');
expect(details).toContain('Detailed game logs');
expect(details).toContain('Save diagnostics');
- expect(details).toContain('Build backend from source');
+ expect(details).not.toContain('Build dependencies');
+ expect(details).not.toContain('Build backend from source');
expect(details).not.toContain('Install upstream snapshot');
expect(details).not.toContain('Check upstream snapshot');
const main = html.replace(details!, '');
@@ -45,6 +45,8 @@ describe('Settings diagnostics', () => {
expect(main).not.toContain('Build backend from source');
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(main).toContain('Nexus runtime');
expect(main).toContain('Open backend diagnostic log');
expect(main).toContain('No passwords, tokens or account contents');
@@ -69,7 +71,7 @@ describe('Settings diagnostics', () => {
it('keeps actionable errors visible and unsupported sign-in disabled', () => {
const data = demoSnapshot();
data.backend.capabilities.login = false;
- data.backend.blockReason = 'Cargo is missing. Install it before building.';
+ data.backend.blockReason = 'The prebuilt backend could not start on this system.';
data.runtime.error = 'SHA-512 verification failed.';
const html = renderToStaticMarkup(<SettingsPage data={data} toast={() => {}} />);
const main = html.replace(/<details\b[^>]*>[\s\S]*?<\/details>/, '');
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index 111fdf7..3651b22 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -672,6 +672,9 @@ button.primary, button.secondary { border-radius: 5px; min-height: 40px; font-si
@media (max-width: 800px) { .cloud-save-warning { margin: 8px 12px 0; flex-wrap: wrap; } .cloud-save-warning > div { flex-basis: 100%; } }
.managed-runtime-settings p { overflow-wrap: anywhere; }
+.managed-runtime-binary { display: grid; gap: 5px; margin: 10px 0 0; }
+.managed-runtime-binary .diagnostic-path { margin: 0; }
+.managed-runtime-binary small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.component-update-results { list-style: none; padding: 0; margin: 8px 0 0; }
.component-update-results li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
diff --git a/src/shared/demo-data.ts b/src/shared/demo-data.ts
index 710561f..841d595 100644
--- a/src/shared/demo-data.ts
+++ b/src/shared/demo-data.ts
@@ -56,7 +56,6 @@ export function demoSnapshot(versions: DemoVersions = { launcher: '0.0.0', backe
backend: {
available: true, source: 'managed', binaryPath: '/home/demo/.config/xodus-nexus/xodus-backends/current', commit: versions.backendCommit, upstreamCommit: versions.backendCommit, updateAvailable: false, checking: false, updating: false, externalRoot: '',
capabilities: { commands: ['login', 'logout', 'download', 'streaming', 'run', 'license', 'extract', 'profile', 'library'], nativeSocial: true, account: true, profile: true, library: true, login: true, externalAuth: true, logout: true, download: true, streaming: true, streamingProgressJson: true, streamingControls: true, run: true, version: '0.5.0' },
- prerequisites: { git: true, cargo: true, rustc: true, protoc: true },
linuxRunPatch: versions.backendCompatibility,
version: versions.backend, delivery: 'release', releaseAvailable: true, releaseVersion: versions.backend,
},
diff --git a/src/shared/runtime-selection.ts b/src/shared/runtime-selection.ts
index 2111ede..269e5cf 100644
--- a/src/shared/runtime-selection.ts
+++ b/src/shared/runtime-selection.ts
@@ -23,6 +23,9 @@ export function sameRuntimeBuild(a:unknown,b:unknown):boolean {
}
export interface InstalledRuntimeFamily {
id: RuntimeFamily; label: string; buildId: string; sourceCommit: string; manifestSha256:string;
+ /** Read-only display path from the verified managed payload. It is never a
+ * launch, approval or selection input. */
+ displayWinePath?: string;
}
/** A chosen managed family never borrows the global runtime's availability. */
export function gameRuntimeAvailable(selection:unknown,separatePrefix:unknown,defaultAvailable:boolean,installed:readonly InstalledRuntimeFamily[]):boolean {
diff --git a/src/shared/types.ts b/src/shared/types.ts
index fa35c6a..53a1213 100644
--- a/src/shared/types.ts
+++ b/src/shared/types.ts
@@ -70,7 +70,6 @@ export interface BackendStatus {
updating: boolean;
externalRoot: string;
capabilities: BackendCapabilities;
- prerequisites: { git: boolean; cargo: boolean; rustc: boolean; protoc: boolean };
blockReason?: string;
linuxRunPatch?: string;
recipeSha256?: string;
@@ -626,7 +625,6 @@ export interface LauncherApi {
refreshBackend(): Promise<BackendStatus>;
checkBackendUpdate(): Promise<BackendStatus>;
updateBackend(): Promise<void>;
- rebuildBackend(): Promise<void>;
refreshRuntime(): Promise<RuntimeStatus>;
getRuntimeFamilies(): Promise<InstalledRuntimeFamily[]>;
checkRuntimeUpdate(): Promise<RuntimeStatus>;