Open-source Xbox-inspired desktop launcher for Xodus on Linux
TypeScript
fix(library): wrap filters without shrinking search controls
domsvoboda205220945d1f
diff --git a/scripts/ui/library-location-smoke.cjs b/scripts/ui/library-location-smoke.cjsindex 8fc0dda..5aabd6f 100644--- a/scripts/ui/library-location-smoke.cjs+++ b/scripts/ui/library-location-smoke.cjs@@ -11,6 +11,7 @@ if (!output || !path.isAbsolute(output)) throw Error('Set XODUS_UI_SMOKE_OUTPUTif (process.argv.some(value=>value==='--launch-game'||value==='--nexus-profile')) throw Error('Demo fixture does not accept game or profile arguments');process.env.XODUS_DEMO = '1';const language=process.env.XODUS_UI_SMOKE_LANG || 'en-US';+const fixtureFolder=process.env.XODUS_UI_SMOKE_LONG_PATH==='1' ? '/run/media/deck/External Games and Archives/Shared Xbox Installations/Very long directory name for removable storage' : undefined;app.commandLine.appendSwitch('lang',language);// Never inherit another capture action or a developer server from the caller.for (const name of ['VITE_DEV_SERVER_URL','XODUS_DEMO_CAPTURE_DIR','XODUS_DEMO_TOUR','XODUS_NEXUS_SMOKE_SCREENSHOT','XODUS_NEXUS_SMOKE_STORE','XODUS_NEXUS_SMOKE_STORE_QUERY','XODUS_NEXUS_FONTCONFIG','XODUS_NEXUS_FONTCONFIG_ORIGINAL','XODUS_NEXUS_FONTCONFIG_ORIGINAL_SET']) delete process.env[name];@@ -38,26 +39,29 @@ async function capture(window) {await ready(window,'.sidebar nav button:nth-child(2)');await evaluate(window,()=>document.querySelector('.sidebar nav button:nth-child(2)').click());await ready(window,'.library-filter-location select');+ if(fixtureFolder)snapshot.games[0].path=fixtureFolder+'/SyntheticDemoGame';for(const [width,height] of [[1280,800],[800,600]]) {- window.setContentSize(width,height);await settle(window);- await evaluate(window,()=>{+ window.setContentSize(width,height);+ if(fixtureFolder)window.webContents.send('snapshot',snapshot);+ await settle(window);+ await evaluate(window,fixtureFolder=>{const select=document.querySelector('.library-filter-location select');- const folder=[...select.options].find(option=>option.value);+ const folder=[...select.options].find(option=>fixtureFolder ? option.value===fixtureFolder : option.value);if(!folder)throw Error('No demo installation folder');select.value=folder.value;select.dispatchEvent(new Event('change',{bubbles:true}));select.focus();- });+ },fixtureFolder);await settle(window);const layout=await evaluate(window,()=>{const selector=document.querySelector('.library-filter-location select');const controls=[...document.querySelectorAll('.library-filters select,.library-filters input,.library-refresh')].map(control=>{- const r=control.getBoundingClientRect();return {label:control.getAttribute('aria-label'),left:r.left,right:r.right,top:r.top,bottom:r.bottom,height:r.height};+ const r=control.getBoundingClientRect();return {label:control.getAttribute('aria-label'),left:r.left,right:r.right,top:r.top,bottom:r.bottom,height:r.height,width:r.width,search:control.matches('.library-filter-search input'),location:control.matches('.library-filter-location select')};});return {viewport:[innerWidth,innerHeight],documentWidth:document.documentElement.scrollWidth,lang:document.documentElement.lang,languages:navigator.languages,controls,focusIsLocation:document.activeElement===selector,selected:selector.value,installedState:document.querySelector('.library-filters label:nth-child(2) select').value,localCards:document.querySelectorAll('.library-card').length,accountCards:document.querySelectorAll('.catalog-card-install').length,allLocations:selector.options[0].text};});- if(layout.viewport[0]!==width||layout.viewport[1]!==height||layout.documentWidth>width||!layout.focusIsLocation||layout.installedState!=='installed'||!layout.localCards||layout.accountCards||layout.controls.some(control=>control.left<0||control.right>width||control.top<0||control.bottom>height))throw Error('Demo library bounds/focus failed: '+JSON.stringify(layout));+ if(layout.viewport[0]!==width||layout.viewport[1]!==height||layout.documentWidth>width||!layout.focusIsLocation||layout.installedState!=='installed'||!layout.localCards||layout.accountCards||layout.controls.some(control=>control.left<0||control.right>width||control.top<0||control.bottom>height||control.height<44||(control.search&&control.width<150)||(control.location&&control.width>300)))throw Error('Demo library bounds/focus failed: '+JSON.stringify(layout));await fs.writeFile(path.join(output,`library-${width}x${height}.png`),(await window.webContents.capturePage()).toPNG());window.webContents.sendInputEvent({type:'keyDown',keyCode:'TAB'});window.webContents.sendInputEvent({type:'keyUp',keyCode:'TAB'});await settle(window);@@ -69,7 +73,7 @@ async function capture(window) {if(!shiftTabRestored)throw Error('Shift+Tab did not restore location focus');results.push({...layout,width,height,tabReachedSearch,shiftTabRestored});}- await fs.writeFile(path.join(output,'library-location-results.json'),JSON.stringify({source,language,results,scope:'Actual integrated demo launcher, network blocked, isolated profile, recorded demo folder only'},null,2)+'\n');+ await fs.writeFile(path.join(output,'library-location-results.json'),JSON.stringify({source,language,fixtureFolder,results,scope:fixtureFolder ? 'Actual demo renderer with explicitly synthetic in-memory long-path snapshot, network blocked, isolated profile' : 'Actual demo launcher, network blocked, isolated profile, recorded demo folder only'},null,2)+'\n');completed=true;clearTimeout(timer);app.exit(0);}(async()=>{diff --git a/src/renderer/styles.css b/src/renderer/styles.cssindex 2df951d..34de9f8 100644--- a/src/renderer/styles.css+++ b/src/renderer/styles.css@@ -254,11 +254,11 @@ button.primary svg, button.secondary svg { width: 17px; height: 17px; }.library-filters { grid-column: 1 / -1; display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }.library-filters label { display: grid; gap: 5px; color: #b8bec6; font-size: 11px; }.library-filters select, .library-filters input { height: 36px; background: #292e35; color: #f1f3f5; border: 1px solid #4b515b; border-radius: 6px; padding: 7px 10px; }-.library-filters .library-refresh { flex: 0 0 36px; width: 36px; min-height: 36px; height: 36px; padding: 0; display: grid; place-items: center; }+.library-filters .library-refresh { flex: 0 0 var(--control-height); width: var(--control-height); min-height: var(--control-height); height: var(--control-height); padding: 0; display: grid; place-items: center; }.library-refresh svg { width: 17px; height: 17px; }-.library-filter-location { min-width: 0; max-width: min(100%, 300px); }+.library-filters .library-filter-location { min-width: 0; max-width: min(100%, 300px); }.library-filter-location select { width: 100%; text-overflow: ellipsis; }-.library-filter-search { flex: 1; min-width: 150px; }+.library-filters .library-filter-search { flex: 1 1 180px; min-width: 150px; }.library-filter-search input { width: 100%; }.library-license { display: block; margin: 8px 10px 0; color: #b8bec6; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.account-library-note { color: #9da2a8; font-size: 11px; line-height: 1.5; margin-top: 20px; }