Skip to content

TV UI, part 5: Custom config and custom outbound editors - #6454

Open
eliotcougar wants to merge 2 commits into
2dust:masterfrom
eliotcougar:google-tv-ui-split5-custom-editor
Open

eliotcougar wants to merge 2 commits into
2dust:masterfrom
eliotcougar:google-tv-ui-split5-custom-editor

Conversation

@eliotcougar

Copy link
Copy Markdown
Contributor

Scope

Custom config (a full JSON configuration) and Custom outbound (one JSON outbound) already open the same editor. This slice makes that editor usable with a TV remote, without changing either profile format or duplicating the JSON editor. Import, validation, parsing, and save/delete operations still use the existing paths.

What changes on TV

  • The toolbar, Remarks field, and JSON area are reachable by D-pad. Focusing a field does not open the keyboard. Press Center on the JSON area to start editing.
  • Back closes the keyboard while leaving the cursor active. With the keyboard closed, the arrows move through the document; long content scrolls vertically and horizontally to follow the cursor. Center opens the keyboard again, and a second Back with the keyboard closed returns to screen navigation.
  • After a theme or display-density change recreates the activity, the draft and cursor are restored to the editor without reopening the keyboard. An open delete confirmation also survives recreation.

Phones retain the existing touch layout, JSON editor, and text-input behavior. Retaining the delete confirmation across recreation is shared. The separate phone bug where a visible keyboard loses its text target is addressed in #6453, not here.

Overlap and review order

  1. ServerCustomConfigActivity.kt wires the TV focus and keyboard policy into the existing editor. Line numbers, text state, scrollbars, and profile operations remain shared.
  2. TvJsonFocus.kt handles the JSON editor's three interaction states: screen navigation, cursor movement with the keyboard closed, and text entry with the keyboard open. The second commit handles activity recreation.
  3. FormFields.kt, OutboundEditorFocus.kt, and TvEditorFields.kt are byte-for-byte identical to the versions in slice 3 (TV UI, part 3: Standard outbound profile editors #6452, standard outbound forms) and slice 4 (TV UI, part 4: Policy group and proxy chain editors #6451, policy groups and proxy chains). Slice 5 includes them so it can be reviewed and built directly against master. A local merge simulation at the published tips found no conflicts with either slice.

Validation

  • Android 11 TV (x86), published tip: Changed the system theme in Custom config and the display density in Custom outbound while editing synthetic JSON. Confirmed that the activity recreated, the draft and cursor survived, and the keyboard stayed closed. Verified D-pad cursor movement by deleting the expected character, then reopened the keyboard with Center and continued typing. Also verified that an open delete confirmation survived a second recreation and that Cancel returned to the editor.
  • Earlier TV pass: Exercised horizontal and vertical scrolling with long synthetic JSON in both profile types, plus the Back/Center flow. Saved and reopened a synthetic full configuration.
  • Android 13 phone (Pixel 6a), earlier slice 5 build: Checked touch editing and reproduced the existing focus loss during recreation; the result matched upstream. The separate phone fix was tested on that device for Restore custom profile editing after activity recreation #6453. The final slice 5 build was not rerun on the phone.
  • Build checks on the published tip: Play Store debug Kotlin compilation, x86 APK assembly, and all 148 JVM tests passed. Regression tests and emulator QA files are not included in this PR.

Not run: Spoken TalkBack, physical-device checks, or a full RTL/dynamic-color matrix.

Share the existing JSON editor and profile operations. On TV, separate document navigation from keyboard entry so Back can dismiss the IME without taking focus away from the cursor. Reuse the shared focus, field, and IME inset controls without changing their implementations.
Keep the text target focused without starting the IME until Center is pressed. Preserve a pending delete confirmation through the same configuration change.
@eliotcougar
eliotcougar marked this pull request as ready for review November 14, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant