feat: add persistent per-game compatibility profiles (#449)

* feat(profiles): add persistent per-game compatibility profiles

* fix(profiles): show Windows component overrides

Include per-game Windows component selections in the resolved profile summary so the session overlay marks those games as custom and shows the selected components.

* fix(session): detect Proton games across runtime paths

* fix(profiles): select the active Gamescope game

* fix(profiles): improve per-game reset feedback

* fix(profiles): align session components with game overrides

* fix(session): prefer selected Steam game during refresh

* fix(session): resume profile following when reopening games

* chore: keep local dev testing outside the repository

* test(session): remove local dev package path

* fix(session): preserve profiles when refresh fails

* fix(session): reject empty game profile reset scope

* perf(session): cache drawer inventory by refresh revision

* fix(profiles): align game presets and profile reset behavior

* fix(profiles): preserve originals and normalize shortcut ids

* fix(profiles): keep editor scope stable after rebase

* fix(tests): host Compose tests in both build variants

* fix(profiles): recover interrupted component selection saves

---------

Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
This commit is contained in:
Juan MartíandKurt Himebauch authored and GitHub committed 2026-10-11 17:00:28 -04:00
1 parent ef4807fbd0
commit 55c51f843e
46 files changed
+3501 -150

No files matched your search

@@ -0,0 +1,88 @@
package com.droiddeck.launcher.agent
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Test
class AgentGuestSelectionTest {
private val installedAppIds = setOf(646570L, 3180310L)
@Test fun focusedInstalledGameIsSelected() {
assertEquals(3180310L, AgentGuest.focusedInstalledSteamAppId(3180310L, installedAppIds))
}
@Test fun focusedInstalledGameIsActive() {
assertEquals(
3180310L,
AgentGuest.activeInstalledSteamAppId(3180310L, listOf(769L, 3180310L), installedAppIds),
)
}
@Test fun selectedSteamGameWinsOverStaleActiveSteamGame() {
assertEquals(
646570L,
AgentGuest.preferredInstalledSteamAppId(646570L, 3180310L, installedAppIds),
)
}
@Test fun validGamescopeGameFallsBackWhenSteamSelectionFails() {
assertEquals(
3180310L,
AgentGuest.selectedOrActiveInstalledSteamAppId(
Result.failure(IllegalStateException("agent unavailable")),
3180310L,
installedAppIds,
),
)
}
@Test fun absentSelectionAndActiveGameRemainAValidNoSelection() {
assertNull(AgentGuest.selectedOrActiveInstalledSteamAppId(Result.success(null), null, installedAppIds))
}
@Test(expected = IllegalStateException::class)
fun selectionFailureWithoutGamescopeFallbackRemainsAnError() {
AgentGuest.selectedOrActiveInstalledSteamAppId(
Result.failure(IllegalStateException("agent unavailable")),
null,
installedAppIds,
)
}
@Test fun soleFocusableInstalledGameRemainsActiveUnderSteamOverlay() {
assertEquals(
3180310L,
AgentGuest.activeInstalledSteamAppId(769L, listOf(3180310L), installedAppIds),
)
}
@Test fun ambiguousFocusableGamesAreIgnored() {
assertNull(
AgentGuest.activeInstalledSteamAppId(769L, listOf(646570L, 3180310L), installedAppIds),
)
}
@Test fun soleBaselayerGameResolvesAmbiguousSteamOverlayFocus() {
assertEquals(
646570L,
AgentGuest.activeInstalledSteamAppId(
focusedAppId = 769L,
focusableAppIds = listOf(646570L, 3180310L),
installedAppIds = installedAppIds,
baselayerAppIds = listOf(769L, 646570L),
),
)
}
@Test fun steamClientFocusIsIgnored() {
assertNull(AgentGuest.focusedInstalledSteamAppId(769L, installedAppIds))
}
@Test fun unknownGameFocusIsIgnored() {
assertNull(AgentGuest.focusedInstalledSteamAppId(42L, installedAppIds))
}
@Test fun missingFocusSnapshotIsIgnored() {
assertNull(AgentGuest.focusedInstalledSteamAppId(null, installedAppIds))
}
}