fix(input): show the main screen layout editor first, like the second screen (#3019)

The Screen visibility group sat above the Layout group on the Main screen page, so in landscape its description pushed Edit on screen below the fold and the page looked like it had no editor. The Layout group now comes first on both screens.
This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-11-22 10:56:03 -05:00
1 parent a9b5994a91
commit cb7edbefd2
2 files changed
+18 -6

No files matched your search

@@ -267,12 +267,6 @@ private fun InputSettingsContent(onBack: () -> Unit, onChanged: () -> Unit, embe
}
}
InputPage.SOURCE -> {
if (role == InputRole.PRIMARY) SettingsGroup(stringResource(R.string.input_screen_visibility)) {
ChoiceRow(host, "controller-osc", stringResource(R.string.mode_osc), stringResource(R.string.input_visibility_shared),
listOf(SessionPrefs.OSC_AUTO to stringResource(R.string.common_auto), SessionPrefs.OSC_ALWAYS to stringResource(R.string.common_always),
SessionPrefs.OSC_STEAM_TOUCH to stringResource(R.string.osc_steam_touch), SessionPrefs.OSC_STEAM_QAM to stringResource(R.string.mode_osc_qam), SessionPrefs.OSC_NEVER to stringResource(R.string.common_never)),
oscMode) { SessionPrefs.setOscMode(context, it); oscMode = it; onChanged() }
}
if (layout != null) SettingsGroup(stringResource(R.string.ctrl_layout)) {
if (layout.editable) InputNavigationRow(stringResource(R.string.input_edit_layout), layout.name, Modifier.testTag("input-surface-${role.name.lowercase()}")) { surface = true }
else InputHint(layout.name)
@@ -288,6 +282,12 @@ private fun InputSettingsContent(onBack: () -> Unit, onChanged: () -> Unit, embe
}
if (role == InputRole.SECONDARY) InputHint(stringResource(R.string.input_second_screen_enable))
}
if (role == InputRole.PRIMARY) SettingsGroup(stringResource(R.string.input_screen_visibility)) {
ChoiceRow(host, "controller-osc", stringResource(R.string.mode_osc), stringResource(R.string.input_visibility_shared),
listOf(SessionPrefs.OSC_AUTO to stringResource(R.string.common_auto), SessionPrefs.OSC_ALWAYS to stringResource(R.string.common_always),
SessionPrefs.OSC_STEAM_TOUCH to stringResource(R.string.osc_steam_touch), SessionPrefs.OSC_STEAM_QAM to stringResource(R.string.mode_osc_qam), SessionPrefs.OSC_NEVER to stringResource(R.string.common_never)),
oscMode) { SessionPrefs.setOscMode(context, it); oscMode = it; onChanged() }
}
SettingsGroup(stringResource(R.string.input_assign_actions)) {
val users = library.usersOfBindings(preset.id)
if (users.size > 1) InputHint(stringResource(R.string.input_shared_with, users.filterNot { it.id == profileId }.joinToString { it.name }))
@@ -258,6 +258,18 @@ class InputSettingsTest {
compose.onNodeWithTag("input-layout-canvas").assertExists()
}
@Test fun everyScreenOpensWithItsEditorFirst() {
compose.setContent { DroidDeckTheme { InputSettingsPage({}) } }
compose.onNodeWithTag("input-profile-game").performScrollTo().performClick()
val tops = listOf("primary", "secondary").map { screen ->
compose.onNodeWithTag("input-part-$screen").performScrollTo().performClick()
val top = compose.onNodeWithTag("input-surface-$screen").assertIsDisplayed().fetchSemanticsNode().boundsInRoot.top
compose.onNodeWithText(context.getString(R.string.mode_back)).performClick()
top
}
assertEquals(tops[1], tops[0])
}
@Test fun deviceSettingsAreInlineBelowProfiles() {
compose.setContent { DroidDeckTheme { InputSettingsPage({}) } }
compose.onNodeWithTag("input-more").assertDoesNotExist()