Files
paseo/packages/app/e2e/mobile/agent-device/native-compact-workspace-scripts.android.ad
Mohamed Boudra 62ab2deb27 Run and watch workspace scripts from the phone header menu (#7122)
* feat(app): run and watch workspace scripts from the compact header menu

The compact header redesign dropped the mobile scripts button, so phones had
no way to run, stop, or restart workspace scripts. Scripts are now a page of
the ⋯ sheet: the root row shows what is running, tinted by health, and the ⋯
carries a dot while a running service is unhealthy. Desktop keeps its popover;
both surfaces share one set of script actions and one status model.

Script status also froze on native whenever the sidebar was closed and no
agent tab was viewed. DirectorySynchronizer releases its subscriptions,
including script_status_update, when nothing demands the directory, and the
workspace screen never demanded the workspace it shows. Web hid this because
the favicon sync holds demand for the whole session. The focused workspace now
holds directory demand, which also lets Restart's second half (start once the
daemon reports the script stopped) complete.

* perf(app): keep workspace script status live without syncing the directory

The focused workspace held full directory demand so the scripts menu saw
script_status_update on phones with the sidebar closed and no agent tab.
That fetched the host's agent and workspace lists on every focus and
streamed every agent and workspace update for the whole host.

Script status now has its own event subscription, which a workspace
screen can hold alone. It fetches the workspace's scripts once when the
subscription lands, because the subscription only carries changes.
Directory demand also holds it, so the sidebar and agent tabs see the
same updates as before.
2026-10-16 17:26:44 +07:00

46 lines
1.7 KiB
Plaintext

context platform=android timeout=120000 retries=0
env APP_ID=sh.paseo.debug
env SCRIPT=worker
open "${APP_ID}"
wait "id=\"workspace-header-menu-trigger\"" 45000
wait stable 1000 15000
press "id=\"workspace-header-menu-trigger\""
wait "id=\"workspace-header-scripts\"" 10000
press "id=\"workspace-header-scripts\""
wait "id=\"workspace-scripts-row-${SCRIPT}\"" 10000
press "id=\"workspace-scripts-row-${SCRIPT}\""
wait stable 1000 15000
wait "id=\"workspace-header-menu-trigger\"" 10000
press "id=\"workspace-header-menu-trigger\""
wait "id=\"workspace-header-scripts\"" 10000
press "id=\"workspace-header-scripts\""
wait "text" "Running" 10000
press "id=\"workspace-scripts-row-${SCRIPT}\""
wait "id=\"workspace-script-${SCRIPT}-stop\"" 10000
press "id=\"workspace-script-${SCRIPT}-stop\""
wait "id=\"workspace-script-${SCRIPT}-run\"" 10000
press "id=\"workspace-script-${SCRIPT}-run\""
wait stable 1000 15000
wait "id=\"workspace-header-menu-trigger\"" 10000
press "id=\"workspace-header-menu-trigger\""
wait "id=\"workspace-header-scripts\"" 10000
press "id=\"workspace-header-scripts\""
wait "text" "Running" 10000
press "id=\"workspace-scripts-row-${SCRIPT}\""
wait "id=\"workspace-script-${SCRIPT}-restart\"" 10000
press "id=\"workspace-script-${SCRIPT}-restart\""
wait stable 1000 15000
wait "id=\"workspace-header-menu-trigger\"" 10000
press "id=\"workspace-header-menu-trigger\""
wait "id=\"workspace-header-scripts\"" 10000
press "id=\"workspace-header-scripts\""
wait "text" "Running" 15000
press "id=\"workspace-scripts-row-${SCRIPT}\""
wait "id=\"workspace-script-${SCRIPT}-stop\"" 10000
press "id=\"workspace-script-${SCRIPT}-stop\""
wait "id=\"workspace-script-${SCRIPT}-run\"" 10000
back
wait stable 1000 15000
close