fix: foreground mobile delivery attention handoffs (Closes #1018)
CI / lint (pull_request) Successful in 3m1s
CI / build-release (pull_request) Successful in 6s
CI / browser-journey (pull_request) Successful in 2m22s
CI / release-candidate (pull_request) Has been skipped

This commit is contained in:
timmy committed 2026-08-17 10:42:19 +00:00
1 parent 6913fc8257
commit 3fde7cf3ad
5 files changed
+156 -14

No files matched your search

@@ -194,6 +194,40 @@ def test_release_artifact_keeps_mobile_delivery_recovery_single_flight(tmp_path:
page.evaluate("Promise.all([window.__firstRecovery, window.__secondRecovery])")
expect(action).to_be_enabled()
assert page.evaluate("window.__deliveryAttempts") == 1
page.evaluate(
"""
() => {
const destination = document.createElement('button');
destination.type = 'button';
destination.className = 'draft-resume';
destination.dataset.draftIndex = '0';
destination.textContent = 'Open current review';
window.__attentionAttempts = 0;
window.__attentionSettled = new Promise(resolve => { window.__finishAttention = resolve; });
destination.onclick = async () => {
window.__attentionAttempts += 1;
await window.__attentionSettled;
return true;
};
document.querySelector('#my-work-list').append(destination);
window.__attentionRecovery = createMobileDeliveryRecovery({
getItems: () => [{outbox_id:'review-attention', status:'attention', title:'Review feedback'}],
getIndex: () => 0,
});
window.__attentionRecovery.open();
window.__firstAttention = window.__attentionRecovery.activate();
window.__secondAttention = window.__attentionRecovery.activate();
}
"""
)
expect(page.locator("#mobile-delivery-recovery")).to_be_hidden()
expect(page.locator("#my-work-list .draft-resume")).to_be_focused()
assert page.evaluate("window.__attentionAttempts") == 1
assert page.evaluate("document.documentElement.scrollWidth <= window.innerWidth")
page.evaluate("window.__finishAttention()")
page.evaluate("Promise.all([window.__firstAttention, window.__secondAttention])")
assert page.evaluate("window.__attentionAttempts") == 1
assert browser_errors == []
browser.close()
finally: