feat: start work from an empty mobile queue (Closes #691)
CI / lint (pull_request) Successful in 1m33s
CI / build-release (pull_request) Successful in 6s
CI / release-candidate (pull_request) Has been skipped

This commit is contained in:
timmy committed 2026-08-13 00:24:04 +00:00
1 parent 52e2c26304
commit ef37a66fd7
7 files changed
+54 -17

No files matched your search

+7 -7
View File
@@ -13,7 +13,7 @@ QUEUE_LAUNCHER = Path(__file__).resolve().parents[1] / "frontend" / "mobile-queu
TIMER = Path(__file__).resolve().parents[1] / "frontend" / "today-timer.js"
def test_mobile_work_entry_prioritizes_continue_resume_start_plan_then_fallback():
def test_mobile_work_entry_prioritizes_continue_resume_start_plan_then_find():
script = f"""
const createEntry = require({json.dumps(str(ENTRY))});
const state = {{active:true, resumable:true, today:2, eligible:3}};
@@ -27,7 +27,7 @@ const entry = createEntry({{
resumeToday: () => calls.push('resume'),
startToday: () => calls.push('start'),
planToday: () => calls.push('plan'),
openFallback: () => calls.push('fallback'),
findWork: () => calls.push('find'),
}});
const modes = [];
modes.push(entry.open());
@@ -43,8 +43,8 @@ process.stdout.write(JSON.stringify({{modes, calls}}));
assert result.returncode == 0, result.stderr
assert json.loads(result.stdout) == {
"modes": ["continue", "resume", "start", "plan", "work"],
"calls": ["continue", "resume", "start", "plan", "fallback"],
"modes": ["continue", "resume", "start", "plan", "find"],
"calls": ["continue", "resume", "start", "plan", "find"],
}
@@ -165,10 +165,10 @@ dock.updateWork('start', 0);
const starting = {{ text:workLabel.textContent, label:work.attributes['aria-label'] }};
dock.updateWork('plan', 0);
const planning = {{ text:workLabel.textContent, label:work.attributes['aria-label'] }};
dock.updateWork('work', 0);
dock.updateWork('find', 0);
process.stdout.write(JSON.stringify({{
continuing, resuming, starting, planning,
fallback:{{ text:workLabel.textContent, label:work.attributes['aria-label'] }},
finding:{{ text:workLabel.textContent, label:work.attributes['aria-label'] }},
}}));
"""
result = subprocess.run(
@@ -184,7 +184,7 @@ process.stdout.write(JSON.stringify({{
"resuming": {"text": "Resume", "label": "Resume Today"},
"starting": {"text": "Start", "label": "Start Today"},
"planning": {"text": "Plan", "label": "Plan Today"},
"fallback": {"text": "Work", "label": "Work"},
"finding": {"text": "Find", "label": "Find work"},
}
+16
View File
@@ -8,6 +8,22 @@ import pytest
from tests.dashboard_bundle import dashboard
@pytest.mark.anyio
async def test_empty_all_work_queue_offers_find_and_create_actions():
markup = (Path(__file__).resolve().parents[1] / "frontend" / "index.html").read_text()
source = await dashboard()
assert 'id="empty-work-start"' in markup
assert 'Ready for something new?' in markup
assert 'id="empty-work-find"' in markup
assert 'id="empty-work-create"' in markup
assert "qs('#empty-work-find').addEventListener('click'" in source
assert "qs('#find-work').click()" in source
assert "qs('#empty-work-create').addEventListener('click'" in source
assert "qs('#new-issue').click()" in source
assert "emptyWorkStart.hidden = !showEmptyStart" in source
MY_WORK = Path(__file__).parents[1] / "frontend" / "my-work.js"
NOTIFICATION_UNDO = Path(__file__).parents[1] / "frontend" / "notification-undo.js"
TODAY_TIMER = Path(__file__).parents[1] / "frontend" / "today-timer.js"