Skip to content

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

TypeScript

fix(store): keep game search and unlicensed details concise

domsvoboda4a540ad804fe
diff --git a/assets/locales/en.json b/assets/locales/en.json
index 4bdd5d6..bf10f98 100644
--- a/assets/locales/en.json
+++ b/assets/locales/en.json
@@ -722,7 +722,7 @@
"ui.screenshots_067348c": "Screenshots",
"ui.screenshots_25e204e": "{{game}} screenshots",
"ui.search_49c266b": "Search",
- "ui.search_games_add_ons_and_your_library_55858e9": "Search games, add-ons and your library",
+ "ui.search_games_add_ons_and_your_library_55858e9": "Search games and your library",
"ui.search_library_21a933a": "Search library",
"ui.search_still_works_with_live_microsoft_store_dat_b3eeb72": "Search still works with live Microsoft Store data.",
"ui.search_your_games_17caf33": "Search your games",
diff --git a/assets/locales/es.json b/assets/locales/es.json
index 03b1e10..a6d6b66 100644
--- a/assets/locales/es.json
+++ b/assets/locales/es.json
@@ -940,7 +940,7 @@
"ui.screenshots_067348c": "Capturas de pantalla",
"ui.screenshots_25e204e": "Capturas de pantalla de {{game}}",
"ui.search_49c266b": "Buscar",
- "ui.search_games_add_ons_and_your_library_55858e9": "Busca juegos, complementos y en tu biblioteca",
+ "ui.search_games_add_ons_and_your_library_55858e9": "Busca juegos y en tu biblioteca",
"ui.search_library_21a933a": "Buscar en la biblioteca",
"ui.search_still_works_with_live_microsoft_store_dat_b3eeb72": "La búsqueda sigue funcionando con los datos actuales de Microsoft Store.",
"ui.search_your_games_17caf33": "Busca tus juegos",
diff --git a/assets/locales/pl-PL.json b/assets/locales/pl-PL.json
index cd3fe31..068c20a 100644
--- a/assets/locales/pl-PL.json
+++ b/assets/locales/pl-PL.json
@@ -591,7 +591,7 @@
"ui.screenshots_067348c": "Zrzuty ekranu",
"ui.screenshots_25e204e": "Zrzuty ekranu {{game}}",
"ui.search_49c266b": "Szukaj",
- "ui.search_games_add_ons_and_your_library_55858e9": "Szukaj gier, dodatków i w Twojej bibliotece",
+ "ui.search_games_add_ons_and_your_library_55858e9": "Szukaj gier i przeszukuj bibliotekę",
"ui.search_library_21a933a": "Przeszukaj bibliotekę",
"ui.search_still_works_with_live_microsoft_store_dat_b3eeb72": "Wyszukiwanie nadal działa na bieżących danych Microsoft Store.",
"ui.search_your_games_17caf33": "Szukaj w swoich grach",
diff --git a/assets/locales/pt-BR.json b/assets/locales/pt-BR.json
index 566e0b2..f7db0bb 100644
--- a/assets/locales/pt-BR.json
+++ b/assets/locales/pt-BR.json
@@ -923,7 +923,7 @@
"ui.screenshots_067348c": "Capturas de tela",
"ui.screenshots_25e204e": "Capturas de tela de {{game}}",
"ui.search_49c266b": "Pesquisar",
- "ui.search_games_add_ons_and_your_library_55858e9": "Pesquisar jogos, complementos e sua biblioteca",
+ "ui.search_games_add_ons_and_your_library_55858e9": "Pesquisar jogos e sua biblioteca",
"ui.search_library_21a933a": "Pesquisar na biblioteca",
"ui.search_still_works_with_live_microsoft_store_dat_b3eeb72": "A pesquisa ainda funciona com dados ao vivo da Microsoft Store.",
"ui.search_your_games_17caf33": "Pesquisar seus jogos",
diff --git a/assets/locales/zh-CN.json b/assets/locales/zh-CN.json
index 018e7c5..6c53c7a 100644
--- a/assets/locales/zh-CN.json
+++ b/assets/locales/zh-CN.json
@@ -600,7 +600,7 @@
"ui.screenshots_067348c": "游戏截图",
"ui.screenshots_25e204e": "{{game}} 截图",
"ui.search_49c266b": "搜索",
- "ui.search_games_add_ons_and_your_library_55858e9": "搜索游戏、附加组件和你的游戏库",
+ "ui.search_games_add_ons_and_your_library_55858e9": "搜索游戏和你的游戏库",
"ui.search_library_21a933a": "搜索游戏库",
"ui.search_still_works_with_live_microsoft_store_dat_b3eeb72": "基于实时的 Microsoft Store 数据的搜索仍然可用。",
"ui.search_your_games_17caf33": "搜索你的游戏",
diff --git a/assets/locales/zh-Hant.json b/assets/locales/zh-Hant.json
index c71c82d..28243a1 100644
--- a/assets/locales/zh-Hant.json
+++ b/assets/locales/zh-Hant.json
@@ -600,7 +600,7 @@
"ui.screenshots_067348c": "遊戲截圖",
"ui.screenshots_25e204e": "{{game}} 的截圖",
"ui.search_49c266b": "搜尋",
- "ui.search_games_add_ons_and_your_library_55858e9": "搜尋遊戲、附加元件和你的遊戲庫",
+ "ui.search_games_add_ons_and_your_library_55858e9": "搜尋遊戲和你的遊戲庫",
"ui.search_library_21a933a": "搜尋遊戲庫",
"ui.search_still_works_with_live_microsoft_store_dat_b3eeb72": "基於即時的 Microsoft Store 資料的搜尋仍然可用。",
"ui.search_your_games_17caf33": "搜尋你的遊戲",
diff --git a/src/renderer/CatalogGameDetails.tsx b/src/renderer/CatalogGameDetails.tsx
index 256a95d..e75bdff 100644
--- a/src/renderer/CatalogGameDetails.tsx
+++ b/src/renderer/CatalogGameDetails.tsx
@@ -46,7 +46,7 @@ export function CatalogGameDetails({product,data,back,backLabel,toast,storeAcces
const button=installed?<button className="primary" data-gamepad-play disabled={playDisabled} onClick={()=>void play()}>{busy?<LoaderCircle className="spin"/>:<Play fill="currentColor"/>}{ui('ui.play_436e610')}</button>:licensed?<button className="primary" data-gamepad-play disabled={disabled||!destination.trim()} onClick={()=>void install()}>{busy?<LoaderCircle className="spin"/>:<Download/>}{queued?ui('ui.in_install_queue_7c818f2'):busy?ui('ui.preparing_5d1fa38'):ui('ui.install_569ca49')}</button>:null;
return <GameDetails key={installed?.id??product.productId} game={installed??{id:'catalog:'+product.productId,title:product.title,publisher:product.publisher,heroUrl:product.heroUrl,coverUrl:product.posterUrl}}
detailId={product.productId} catalogProductId={installed?undefined:product.productId} data={data} back={back} backLabel={backLabel} play={<>{button}<button className="secondary" onClick={()=>window.open(product.storeUrl??`https://www.xbox.com/games/store/p/${product.productId}`,'_blank')}>{ui('ui.store_page_9c667df')}</button></>}
- notices={!installed?<section className="gd-install-options"><p className={product.installability==='supported'?'supported':'unsupported'}>{uiText(product.supportNote)}</p>
+ notices={!installed?<section className="gd-install-options">{licensed?<p className={product.installability==='supported'?'supported':'unsupported'}>{uiText(product.supportNote)}</p>:null}
{product.purchasePrice||product.includedWith?<div className="catalog-badges">{product.purchasePrice?<span>{product.purchasePrice}</span>:null}{product.includedWith?<span className="pass">{ui('store.available_with',{plan:product.includedWith})}</span>:null}</div>:null}
{licensed?<label>{ui('ui.install_location_af47896')}<div className="input-action"><input value={destination} disabled={busy||queued} onChange={event=>setDestination(event.target.value)}/><button type="button" disabled={busy||queued} aria-label={ui('ui.choose_folder_3db7410')} onClick={async()=>{const value=await window.launcher.chooseDirectory(destination);if(value&&identity.current===scope)setDestination(value);}}><FolderOpen/></button></div></label>:null}
</section>:undefined}/>
diff --git a/src/renderer/catalog-game-details.test.tsx b/src/renderer/catalog-game-details.test.tsx
index 5ed71cf..fb85b1b 100644
--- a/src/renderer/catalog-game-details.test.tsx
+++ b/src/renderer/catalog-game-details.test.tsx
@@ -43,8 +43,8 @@ it('applies strict public Store eligibility without changing the existing Librar
const data=demoSnapshot();data.games=[];data.downloads=[];
const store=renderToStaticMarkup(<CatalogGameDetails storeMode product={product} data={data} back={()=>{}} toast={()=>{}}/>);
const library=renderToStaticMarkup(<CatalogGameDetails product={product} data={data} back={()=>{}} toast={()=>{}}/>);
- expect(store).not.toContain('>Install</button>');expect(store).not.toContain('Install location');
- expect(library).toContain('>Install</button>');expect(library).toContain('Install location');
+ expect(store).not.toContain('>Install</button>');expect(store).not.toContain('Install location');expect(store).not.toContain(product.supportNote);
+ expect(library).toContain('>Install</button>');expect(library).toContain('Install location');expect(library).toContain(product.supportNote);
const page=renderToStaticMarkup(<StorePage data={data} toast={()=>{}} go={()=>{}} initialQuery=""/>);
expect(page).not.toContain('manual-install');expect(page).not.toContain('Install unlisted ID');
});
diff --git a/src/renderer/store-access.test.tsx b/src/renderer/store-access.test.tsx
index d79f2ac..5427844 100644
--- a/src/renderer/store-access.test.tsx
+++ b/src/renderer/store-access.test.tsx
@@ -28,8 +28,8 @@ it('hides Install and location while access is pending/error, shows verified acc
const node=document.createElement('div'),root=createRoot(node);
const render=()=>act(async()=>root.render(<CatalogGameDetails storeMode product={product} data={data} back={()=>{}} toast={()=>{}}/>));
try{
- await render();expect(node.textContent).toContain('Store page');expect(node.querySelector('input')).toBeNull();expect(node.querySelector('[data-gamepad-play]')).toBeNull();
- await act(async()=>resolve(evidence(data)));expect(node.querySelector('[data-gamepad-play]')?.textContent).toBe('Install');expect(node.querySelector('input')).not.toBeNull();
+ await render();expect(node.textContent).toContain('Store page');expect(node.querySelector('input')).toBeNull();expect(node.querySelector('[data-gamepad-play]')).toBeNull();expect(node.textContent).not.toContain(product.supportNote);
+ await act(async()=>resolve(evidence(data)));expect(node.querySelector('[data-gamepad-play]')?.textContent).toBe('Install');expect(node.querySelector('input')).not.toBeNull();expect(node.textContent).toContain(product.supportNote);
data.auth={...data.auth,username:'different-store'};read.mockRejectedValueOnce(Error('unavailable'));await render();expect(node.querySelector('[data-gamepad-play]')).toBeNull();expect(node.querySelector('input')).toBeNull();
}finally{await act(async()=>root.unmount());}
});