feat: compact active Today controls on mobile (Closes #1074)
CI / lint (pull_request) Successful in 2m46s
CI / build-release (pull_request) Successful in 6s
CI / browser-journey (pull_request) Successful in 2m17s
CI / release-candidate (pull_request) Has been skipped

This commit is contained in:
timmy committed 2026-08-18 09:36:34 +00:00
1 parent fb7bfe0a5d
commit b77be4f5b0
11 files changed
+308 -31

No files matched your search

+31 -7
View File
@@ -15,6 +15,13 @@ from fake_gitea import FakeGiteaServer
from test_mobile_offline_issue_release import ACCESS_TOKEN, ROOT, release_server
def open_today_action(page, selector: str):
page.locator("[data-mobile-today-more]").click()
expect(page.locator("#mobile-today-actions")).to_be_visible()
page.locator(selector).click()
expect(page.locator("#mobile-today-actions")).to_be_hidden()
def test_release_artifact_plans_hands_off_and_opens_next_mobile_issue(tmp_path: Path):
archives = sorted((ROOT / "dist").glob("stackchain-dashboard-*.tar.gz"))
assert len(archives) == 1, "browser job must download exactly one assembled release archive"
@@ -87,11 +94,14 @@ def test_release_artifact_plans_hands_off_and_opens_next_mobile_issue(tmp_path:
if page.locator("#plan-today-sheet").is_visible():
page.locator("#cancel-plan-today").click()
expect(page.locator("[data-mobile-today-hud]")).to_be_visible()
page.locator("[data-mobile-today-more]").click()
expect(page.locator("#mobile-today-actions")).to_be_visible()
blocked = page.locator("[data-mobile-today-blocked]")
expect(blocked).to_be_visible()
blocked_bounds = blocked.bounding_box()
assert blocked_bounds and blocked_bounds["height"] >= 44
blocked.click()
expect(page.locator("#mobile-today-actions")).to_be_hidden()
expect(page.locator("#today-progress-sheet")).to_be_visible()
expect(page.locator("#today-progress-title")).to_have_text("Report blocker")
expect(page.locator("#today-progress-target")).to_contain_text("Ship mobile capture")
@@ -116,7 +126,7 @@ def test_release_artifact_plans_hands_off_and_opens_next_mobile_issue(tmp_path:
"created_at": "2026-08-18T00:00:00Z",
}]
}
page.locator("[data-mobile-today-update]").click()
open_today_action(page, "[data-mobile-today-update]")
expect(page.locator("#today-progress-sheet")).to_be_visible()
progress = page.locator("#today-progress-body")
progress.fill("Pairing with @al")
@@ -143,7 +153,7 @@ def test_release_artifact_plans_hands_off_and_opens_next_mobile_issue(tmp_path:
assert admitted and admitted["repository"] == "acme/mobile"
assert admitted["body"] == "Pairing with @alex"
page.locator("[data-mobile-today-update]").click()
open_today_action(page, "[data-mobile-today-update]")
expect(page.locator("#today-progress-sheet")).to_be_visible()
owned = page.locator('[data-comment-id="701"]')
try:
@@ -178,9 +188,12 @@ def test_release_artifact_plans_hands_off_and_opens_next_mobile_issue(tmp_path:
assert page.evaluate("document.documentElement.scrollWidth <= window.innerWidth")
page.locator("#cancel-today-progress").click()
expect(page.locator("#today-progress-sheet")).to_be_hidden()
page.locator("[data-mobile-today-more]").click()
expect(page.locator("#mobile-today-actions")).to_be_visible()
take_break = page.locator("[data-today-break-open]")
expect(take_break).to_be_visible()
take_break.click()
expect(page.locator("#mobile-today-actions")).to_be_hidden()
expect(page.locator("#today-break-sheet")).to_be_visible()
for control in page.locator(".today-break-actions button").all():
bounds = control.bounding_box()
@@ -188,7 +201,7 @@ def test_release_artifact_plans_hands_off_and_opens_next_mobile_issue(tmp_path:
page.go_back()
expect(page.locator("#today-break-sheet")).to_be_hidden()
take_break.click()
open_today_action(page, "[data-today-break-open]")
page.locator('[data-today-break-minutes="5"]').click()
expect(page.locator("#today-break-status")).to_have_text("On break · resume in 5:00")
expect(page.locator("[data-mobile-today-toggle]")).to_have_text("Resume timer")
@@ -219,7 +232,18 @@ def test_release_artifact_plans_hands_off_and_opens_next_mobile_issue(tmp_path:
if page.locator("#plan-today-sheet").is_visible():
page.locator("#cancel-plan-today").click()
page.set_viewport_size({"width": 320, "height": 568})
page.locator("[data-today-break-open]").click()
layout = page.evaluate("""() => {
const hud = document.querySelector('[data-mobile-today-hud]').getBoundingClientRect();
const dock = document.querySelector('.mobile-task-dock').getBoundingClientRect();
const padding = parseFloat(getComputedStyle(document.body).paddingBottom);
return {hudHeight:hud.height, hudTop:hud.top, dockTop:dock.top, padding, viewport:window.innerHeight};
}""")
assert layout["hudHeight"] <= 116
assert layout["padding"] >= layout["viewport"] - min(layout["hudTop"], layout["dockTop"])
for control in page.locator("[data-mobile-today-hud] button").all():
bounds = control.bounding_box()
assert bounds and bounds["height"] >= 44
open_today_action(page, "[data-today-break-open]")
expect(page.locator("#today-break-sheet")).to_be_visible()
assert page.evaluate("document.documentElement.scrollWidth <= window.innerWidth")
custom = page.locator("#today-break-custom-minutes")
@@ -313,12 +337,12 @@ def test_release_artifact_recovers_admitted_blocker_after_reload_and_opens_next_
page.locator("#cancel-plan-today").click()
expect(page.locator("[data-mobile-today-hud]")).to_be_visible()
page.locator("[data-mobile-today-update]").click()
open_today_action(page, "[data-mobile-today-update]")
expect(page.locator("#today-progress-sheet")).to_be_visible()
page.locator("#today-progress-body").fill("Blocked waiting for the design owner")
page.locator("#post-today-progress").click()
expect(page.locator("#today-progress-sheet")).to_be_hidden()
page.locator("[data-today-break-open]").click()
open_today_action(page, "[data-today-break-open]")
page.locator('[data-today-break-minutes="5"]').click()
expect(page.locator("#resume-today-break")).to_be_visible()
@@ -345,7 +369,7 @@ def test_release_artifact_recovers_admitted_blocker_after_reload_and_opens_next_
page.locator("#resume-today-break").click()
expect(page.locator("#issue-sheet")).to_have_class("issue-sheet open")
page.locator("#close-issue-sheet").click()
page.locator("[data-mobile-today-update]").click()
open_today_action(page, "[data-mobile-today-update]")
expect(page.locator("#today-progress-sheet")).to_be_visible()
expect(page.locator("#today-progress-blocker-recovery")).to_be_visible()
expect(page.locator("#today-progress-blocker-recovery")).to_contain_text("Blocker queued")