StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.
Kotlin iptv-player
test(catalog): validate dashboard shelf customization
David Nashashad591ce2af09
diff --git a/docs/COMPOSE_REDUCTION_AND_UI_ARCHITECTURE_PLAN.md b/docs/COMPOSE_REDUCTION_AND_UI_ARCHITECTURE_PLAN.mdindex 1b043e8b..60dffe48 100644--- a/docs/COMPOSE_REDUCTION_AND_UI_ARCHITECTURE_PLAN.md+++ b/docs/COMPOSE_REDUCTION_AND_UI_ARCHITECTURE_PLAN.md@@ -985,7 +985,9 @@ paths, plus reversible quick-filter save/reload/remove persistence. The full`tools/catalog_xtream_fixture.py` now provides a rerunnable developmentseed, and `tools/catalog_connected_validation.py` provides a semantic ADBjourney for the fixture-backed Home/Movies/Series/detail/favorite/saved/- Search path; the remaining action/direct-Favorites/accessibility journeys,+ Search path plus the Settings-owned Dashboard shelf customization+ cancel/save/reset flow; the remaining browse/action/direct-Favorites/+ accessibility journeys,successfuldiagnostic Dashboard benchmark rerun after populating a scrollable seededHome shelf, open paired benchmark gate, refreshed release-like profiles, anddiff --git a/docs/COMPOSE_REDUCTION_PHASE5_CATALOG_REPORT.md b/docs/COMPOSE_REDUCTION_PHASE5_CATALOG_REPORT.mdindex afcf5202..9da068cd 100644--- a/docs/COMPOSE_REDUCTION_PHASE5_CATALOG_REPORT.md+++ b/docs/COMPOSE_REDUCTION_PHASE5_CATALOG_REPORT.md@@ -113,9 +113,14 @@ now available as the checked-in development toolby `tools/catalog_connected_validation.py`. This remains diagnostic evidence,not a production-provider pass.-The remaining Dashboard customization, load-more/reorder/return, download,-Cast chooser, direct Favorites-host, touch/phone/tablet, RTL,-reduced-motion/accessibility, and long screenshot/logcat matrix are still open.+The same semantic harness now also opens the Settings-owned Dashboard shelf+customization dialog through TV focus, proves cancel leaves the persisted+seven-shelf order unchanged, saves a six-shelf edit, and resets/saves the+default order again. The rerun and surface list are recorded in+`validation/phase5_catalog/task14-xtream-fixture-journeys.md`. The remaining+browse load-more/reorder/return, download, Cast chooser, direct Favorites-host,+touch/phone/tablet, RTL, reduced-motion/accessibility, and long screenshot/logcat+matrix are still open.## Build isolation and performance@@ -170,9 +175,8 @@ execution-time project access.## Next acceptance work1. Use the checked-in Xtream fixture (or approved provider data) to execute the- remaining Dashboard, browse, detail-action, direct Favorites, and- accessibility journeys, and keep the fixture invocation in the validation- protocol.+ remaining browse, detail-action, direct Favorites, and accessibility+ journeys, and keep the fixture invocation in the validation protocol.2. Capture a cache-equivalent pre-extraction run and pair it with thesuccessful Dashboard benchmark evidence, using the same seeded content,device, iteration count, and compilation mode. Keep app lint remediation anddiff --git a/docs/COMPOSE_REDUCTION_PHASE5_ROADMAP.md b/docs/COMPOSE_REDUCTION_PHASE5_ROADMAP.mdindex e3029e62..b92c6794 100644--- a/docs/COMPOSE_REDUCTION_PHASE5_ROADMAP.md+++ b/docs/COMPOSE_REDUCTION_PHASE5_ROADMAP.md@@ -120,9 +120,9 @@ filters, and cross-type Search; the semantic evidence is recorded in theCatalog validation directory. The checked-in `tools/catalog_xtream_fixture.py`now provides a rerunnable development seed, and`tools/catalog_connected_validation.py` provides a semantic ADB journey for-the fixture-backed Home/Movies/Series/detail/favorite/saved/Search path. The-remaining Dashboard/action/direct-Favorites/accessibility journeys remain-open.+the fixture-backed Home/Movies/Series/detail/favorite/saved/Search path and+Settings-owned Dashboard shelf customization cancel/save/reset flow. The+remaining browse/action/direct-Favorites/accessibility journeys remain open.A focused Dashboard macrobenchmark rerun passed 1/1 with five warm iterationsonce public-M3U live-channel activity populated a scrollable Home shelf(`frameCount` min/median/max 88/91/98; `frameOverrunMs` P50/P90/P95/P99diff --git a/docs/superpowers/plans/2026-09-02-catalog-feature-extraction.md b/docs/superpowers/plans/2026-09-02-catalog-feature-extraction.mdindex ee16a383..d01c7d5c 100644--- a/docs/superpowers/plans/2026-09-02-catalog-feature-extraction.md+++ b/docs/superpowers/plans/2026-09-02-catalog-feature-extraction.md@@ -35,8 +35,9 @@ Search in the production activity; its semantic evidence is in`validation/phase5_catalog/task14-xtream-fixture-journeys.md`. The checked-in`tools/catalog_xtream_fixture.py` now provides a rerunnable development seed,and `tools/catalog_connected_validation.py` provides a semantic ADB journey-for the fixture-backed Home/Movies/Series/detail/favorite/saved/Search path.-The remaining Dashboard/action/direct-Favorites/accessibility journeys;+for the fixture-backed Home/Movies/Series/detail/favorite/saved/Search path and+the Settings-owned Dashboard shelf customization cancel/save/reset flow. The+remaining browse/action/direct-Favorites/accessibility journeys;repository-wide app lint remains open.A focused Dashboard macrobenchmark rerun now passes after public-M3Ulive-channel activity populates a scrollable seeded Home shelf, but it isdiff --git a/tools/catalog_connected_validation.py b/tools/catalog_connected_validation.pyindex 8c8b377a..e3512dba 100644--- a/tools/catalog_connected_validation.py+++ b/tools/catalog_connected_validation.py@@ -329,6 +329,63 @@ class AdbClient:self.key("KEYCODE_DPAD_RIGHT")raise CatalogValidationError("Could not focus a matching detail action.")+ def focus_and_activate_dialog_action(+ self,+ patterns: Sequence[str],+ *,+ timeout: float = DEFAULT_TIMEOUT_SECONDS,+ max_steps: int = 10,+ ) -> str:+ """Walk a scrollable TV dialog to a matching footer/action control."""++ compiled = [re.compile(pattern, re.IGNORECASE) for pattern in patterns]+ deadline = time.monotonic() + timeout+ # The dialog's body owns vertical focus until its footer row is reached.+ # Batch those transitions without a dump after every key; a UIAutomator+ # dump/pull is comparatively slow on the TV emulator and can otherwise+ # exhaust the journey timeout before the footer receives focus.+ for _ in range(max_steps):+ self.key("KEYCODE_DPAD_DOWN")+ for _ in range(3):+ self.key("KEYCODE_DPAD_LEFT")+ self.key("KEYCODE_DPAD_DOWN")+ for _ in range(4):+ if time.monotonic() >= deadline:+ break+ dump = self.snapshot("focus_dialog_action")+ if _focused_target_matches(dump, compiled):+ self.key("KEYCODE_DPAD_CENTER")+ return "activated"+ self.key("KEYCODE_DPAD_RIGHT")+ raise CatalogValidationError("Could not focus a matching dialog action.")++ def open_settings_customization(self, *, timeout: float = DEFAULT_TIMEOUT_SECONDS) -> None:+ """Open the Settings-owned Dashboard shelf dialog through TV focus."""++ # App Settings starts on the Providers category. Move to Browsing,+ # select it, then move into the remembered content row for Customize+ # Home. This keeps the probe on the production remote path instead of+ # relying on coordinate taps that are unreliable in TV touch mode.+ self.key("KEYCODE_DPAD_DOWN")+ self.key("KEYCODE_DPAD_DOWN")+ self.key("KEYCODE_DPAD_CENTER")+ self.wait_for(+ "settings_customization_ready",+ required=("Customize Home", "7 shelves"),+ timeout=timeout,+ )+ time.sleep(0.5)+ self.key("KEYCODE_DPAD_RIGHT")+ time.sleep(0.2)+ deadline = time.monotonic() + timeout+ while time.monotonic() < deadline:+ dump = self.snapshot("focus_customize_home")+ if _focused_target_contains(dump, "Customize Home"):+ self.key("KEYCODE_DPAD_CENTER")+ return+ self.key("KEYCODE_DPAD_DOWN")+ raise CatalogValidationError("Could not focus the Settings Customize Home row.")+def navigate(self, route: str, package: str, activity: str) -> None:if route not in TOP_LEVEL_DESTINATIONS:raise CatalogValidationError(f"Unknown top-level route '{route}'.")@@ -434,7 +491,11 @@ def run_journey(client: AdbClient, package: str, activity: str, timeout: float)# SearchInput is already the focused TV control when Search opens; center activates its# editable field (a coordinate tap does not reliably switch TV read-only mode).client.key("KEYCODE_DPAD_CENTER")- client.shell("input", "text", "Fixture")+ # Send one character at a time. API 36 TV occasionally drops an adjacent+ # key when the Compose text field is still switching out of read-only mode.+ for character in "Fixture":+ client.shell("input", "text", character)+ time.sleep(0.1)# Commit the TV text field before attempting to scroll the result column. Without an IME# action, DPAD/swipe input remains owned by the editable control and the result rows stay# below the viewport.@@ -451,6 +512,57 @@ def run_journey(client: AdbClient, package: str, activity: str, timeout: float)required=("Fixture Movie One", "Fixture Series One"),timeout=timeout,)+ client.navigate("settings", package, activity)+ client.wait_for(+ "settings_route",+ required=("streamvault.destination:settings",),+ timeout=timeout,+ )+ client.open_settings_customization(timeout=timeout)+ client.wait_for(+ "dashboard_customization",+ required=("Customize Home", "Visible on Home", "Cancel", "Save Order"),+ timeout=timeout,+ )+ # The dialog initially focuses the first enabled shelf's Remove action.+ # Remove it, then cancel through the footer to prove the draft is not persisted.+ client.key("KEYCODE_DPAD_CENTER")+ client.wait_for(+ "dashboard_customization_removed",+ required=("Recent Channels", "Save Order"),+ forbidden=("Favorite Channels",),+ timeout=timeout,+ )+ client.focus_and_activate_dialog_action((r"^Cancel$",), timeout=timeout)+ client.wait_for(+ "dashboard_customization_cancelled",+ required=("streamvault.destination:settings", "Customize Home", "7 shelves"),+ forbidden=("Visible on Home",),+ timeout=timeout,+ )++ # Repeat the edit, save it, then reset and save the default order. The row+ # count is the durable semantic signal for both save operations.+ client.key("KEYCODE_DPAD_CENTER")+ client.wait_for("dashboard_customization_resave", required=("Visible on Home", "Save Order"), timeout=timeout)+ client.key("KEYCODE_DPAD_CENTER")+ client.focus_and_activate_dialog_action((r"^Save Order$",), timeout=timeout)+ client.wait_for(+ "dashboard_customization_saved",+ required=("streamvault.destination:settings", "Customize Home", "6 shelves"),+ forbidden=("Visible on Home",),+ timeout=timeout,+ )+ client.key("KEYCODE_DPAD_CENTER")+ client.wait_for("dashboard_customization_reset", required=("Visible on Home", "Save Order"), timeout=timeout)+ client.focus_and_activate_dialog_action((r"^Reset$",), timeout=timeout)+ client.focus_and_activate_dialog_action((r"^Save Order$",), timeout=timeout)+ client.wait_for(+ "dashboard_customization_restored",+ required=("streamvault.destination:settings", "Customize Home", "7 shelves"),+ forbidden=("Visible on Home",),+ timeout=timeout,+ )return ["home","movies_browse",@@ -460,6 +572,12 @@ def run_journey(client: AdbClient, package: str, activity: str, timeout: float)"series_detail","search_fixture","search_fixture_content",+ "settings_route",+ "settings_customization_ready",+ "dashboard_customization",+ "dashboard_customization_cancelled",+ "dashboard_customization_saved",+ "dashboard_customization_restored",]diff --git a/tools/tests/test_catalog_connected_validation.py b/tools/tests/test_catalog_connected_validation.pyindex 5efb0899..2db502b3 100644--- a/tools/tests/test_catalog_connected_validation.py+++ b/tools/tests/test_catalog_connected_validation.py@@ -1,7 +1,9 @@+import reimport unittestfrom tools.catalog_connected_validation import (+ _focused_target_matches,assert_snapshot,extract_ui_strings,parse_bounds,@@ -31,6 +33,15 @@ class CatalogConnectedValidationTest(unittest.TestCase):with self.assertRaisesRegex(AssertionError, "forbidden marker 'Sync needed'"):assert_snapshot(dump, forbidden=("Sync needed",))+ def test_focused_target_matches_walks_to_clickable_parent(self):+ dump = """<hierarchy>+ <node text="" clickable="true" focused="false" bounds="[0,0][300,100]">+ <node text="Save Order" clickable="false" focused="true" bounds="[10,10][200,80]" />+ </node>+ </hierarchy>"""++ self.assertTrue(_focused_target_matches(dump, [re.compile(r"^Save Order$")]))+if __name__ == "__main__":unittest.main()diff --git a/validation/phase5_catalog/task14-xtream-fixture-journeys.md b/validation/phase5_catalog/task14-xtream-fixture-journeys.mdindex 6d2c545b..aa820462 100644--- a/validation/phase5_catalog/task14-xtream-fixture-journeys.md+++ b/validation/phase5_catalog/task14-xtream-fixture-journeys.md@@ -54,6 +54,14 @@ the five grouped fixture results. The report and UI dumps are local ignoredartifacts under `build/catalog-validation-fixture`; no provider credentials orraw URLs are checked in.+A follow-up run with the same fixture and emulator also passed the Settings-+owned Dashboard shelf customization dialog. It opened the dialog through the+TV focus path, removed a shelf and cancelled without changing the persisted+`7 shelves` setting, saved the removal to `6 shelves`, then reset and saved the+default order back to `7 shelves`. The semantic report is under+`build/catalog-validation-customization-8` and includes the settings route,+dialog, cancel, save, and restore surfaces.+The fixture test uses an ephemeral loopback port and does not require Android.The production-activity run uses port 8765 because that is the emulator-hostmapping used by `10.0.2.2`.@@ -101,7 +109,6 @@ The run does not close the full Phase 5 acceptance gate. The public M3U flowremains live-only, and the following journeys still need to be executed againstthe checked-in fixture (or approved provider data):-- Dashboard customization save/cancel and focus traversal;- browse load-more, reorder, return-route, download enqueue, and Cast chooser;- direct Favorites host rendering and reorder/save/cancel;- touch-mode, phone/tablet, RTL, reduced-motion, and accessibility variants;