Demand-load Today and Planning workspace on mobile #1469

Merged
rockachopa merged 7 commits from timmy/1468-demand-load-mobile-workspace into main 2026-08-27 14:46:11 +00:00
3 changed files with 10 additions and 1 deletions
Showing only changes of commit 4a99f54f12 - Show all commits

View File

@ -127,6 +127,8 @@ def test_release_artifact_reopens_human_gates_with_one_fresh_mobile_snapshot(
popup.close()
page.reload(wait_until="networkidle")
hydrate_workspace(page)
page.wait_for_load_state("networkidle")
page.evaluate("document.querySelector('#open-human-gates').click()")
expect(page.locator("#human-gates")).to_be_visible()
expect(page.locator('[data-gate-checklist="exact_hash"]')).to_be_checked()
@ -148,6 +150,8 @@ def test_release_artifact_reopens_human_gates_with_one_fresh_mobile_snapshot(
assert len(decision_requests) == 1
page.reload(wait_until="networkidle")
hydrate_workspace(page)
page.wait_for_load_state("networkidle")
page.evaluate("document.querySelector('#open-human-gates').click()")
expect(page.locator("#human-gates")).to_be_visible()
expect(page.locator("#human-gate-detail")).to_contain_text("Decision outcome unknown")
@ -246,6 +250,7 @@ def test_release_artifact_reviews_live_human_gate_history_and_receipt_on_phone(t
page.locator("#submit-sign-in").click()
page.wait_for_url(origin + "/", wait_until="networkidle")
hydrate_workspace(page)
page.wait_for_load_state("networkidle")
page.evaluate("document.querySelector('#open-human-gates').click()")
expect(page.locator("#human-gates")).to_be_visible()
cached_before = page.evaluate("Object.keys(localStorage).sort()")

View File

@ -282,6 +282,7 @@ def test_release_artifact_files_one_mobile_issue_exactly_once_after_offline_relo
assert fake.created_issues == []
page.reload(wait_until="domcontentloaded")
hydrate_workspace(page)
expect(page.locator('[data-mobile-task="new"]')).to_be_visible()
durable_after_reload = indexed_issue_records(page)
assert [(item["title"], item["body"]) for item in durable_after_reload] == [(TITLE, BODY)]

View File

@ -12,7 +12,7 @@ pytest.importorskip("playwright.sync_api")
from playwright.sync_api import expect, sync_playwright
from fake_gitea import FakeGiteaServer
from test_mobile_offline_issue_release import ACCESS_TOKEN, ROOT, release_server
from test_mobile_offline_issue_release import ACCESS_TOKEN, ROOT, hydrate_workspace, release_server
def open_today_action(page, selector: str):
@ -269,6 +269,7 @@ def test_release_artifact_plans_hands_off_and_opens_next_mobile_issue(tmp_path:
localStorage.setItem(prefix + 'broken', '{not-json');
}""")
page.reload(wait_until="networkidle")
hydrate_workspace(page)
expect(page.locator("#my-work-status")).to_contain_text("2")
expect(page.locator("#today-sync-status")).to_have_text(
"Today queue recovered · discarded 1 unreadable device record."
@ -446,6 +447,7 @@ def test_release_artifact_pauses_today_across_mobile_work_and_insights_detours(t
return timer.entries[timer.active_identity].running === false && timer.detour_interruption?.reason === 'insights';
}""")
page.reload(wait_until="networkidle")
hydrate_workspace(page)
restored_pause = page.locator("#insights-sheet > [data-today-detour]")
expect(restored_pause).to_be_visible()
expect(restored_pause).to_contain_text("Today paused · Ship mobile capture")
@ -562,6 +564,7 @@ def test_release_artifact_recovers_admitted_blocker_after_reload_and_opens_next_
}));
}""")
page.reload(wait_until="networkidle")
hydrate_workspace(page)
expect(page.locator("#my-work-status")).to_contain_text("2")
if page.locator("#issue-sheet").get_attribute("class") == "issue-sheet open":
page.locator("#close-issue-sheet").click()