From 1b311c9cd41362041d7250e8312b5ce95c0bb1df Mon Sep 17 00:00:00 2001 From: timmy Date: Thu, 13 Aug 2026 02:51:25 +0000 Subject: [PATCH] feat: launch fresh mobile work in Agenda (Closes #701) --- frontend/dashboard.js | 1 + frontend/mobile-launch.js | 5 +++-- tests/test_mobile_launch.py | 13 ++++++++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/frontend/dashboard.js b/frontend/dashboard.js index edc5fe5..90566e7 100644 --- a/frontend/dashboard.js +++ b/frontend/dashboard.js @@ -2164,6 +2164,7 @@ if (!launchFilterResolved) { selectedWorkFilter = mobileLaunch.chooseFilter({ saved: savedWorkFilter, today: counts.today, attention: counts.attention, + agenda: counts.agenda, }); launchFilterResolved = true; document.querySelectorAll('[data-work-filter]').forEach(item => diff --git a/frontend/mobile-launch.js b/frontend/mobile-launch.js index 482e6d0..37cd982 100644 --- a/frontend/mobile-launch.js +++ b/frontend/mobile-launch.js @@ -4,13 +4,14 @@ else root.mobileLaunch = api; })(typeof globalThis !== 'undefined' ? globalThis : this, function () { const allowedFilters = new Set([ - 'all', 'today', 'attention', 'issue', 'pull', 'review', 'update', 'later', 'draft', + 'all', 'today', 'attention', 'agenda', 'issue', 'pull', 'review', 'update', 'later', 'draft', ]); - function chooseFilter({ saved, today = 0, attention = 0 } = {}) { + function chooseFilter({ saved, today = 0, attention = 0, agenda = 0 } = {}) { if (allowedFilters.has(saved)) return saved; if (today > 0) return 'today'; if (attention > 0) return 'attention'; + if (agenda > 0) return 'agenda'; return 'all'; } diff --git a/tests/test_mobile_launch.py b/tests/test_mobile_launch.py index e9252dd..e062cd3 100644 --- a/tests/test_mobile_launch.py +++ b/tests/test_mobile_launch.py @@ -14,10 +14,11 @@ def test_mobile_launch_selects_priority_queue_without_overriding_saved_choice(): script = f""" const mobileLaunch = require({json.dumps(str(MOBILE_LAUNCH))}); process.stdout.write(JSON.stringify({{ - today: mobileLaunch.chooseFilter({{saved:null, today:2, attention:4}}), - attention: mobileLaunch.chooseFilter({{saved:null, today:0, attention:4}}), - all: mobileLaunch.chooseFilter({{saved:null, today:0, attention:0}}), - saved: mobileLaunch.chooseFilter({{saved:'review', today:2, attention:4}}), + today: mobileLaunch.chooseFilter({{saved:null, today:2, attention:4, agenda:6}}), + attention: mobileLaunch.chooseFilter({{saved:null, today:0, attention:4, agenda:6}}), + agenda: mobileLaunch.chooseFilter({{saved:null, today:0, attention:0, agenda:6}}), + all: mobileLaunch.chooseFilter({{saved:null, today:0, attention:0, agenda:0}}), + saved: mobileLaunch.chooseFilter({{saved:'agenda', today:2, attention:4, agenda:6}}), }})); """ result = subprocess.run(["node", "-e", script], capture_output=True, text=True) @@ -26,8 +27,9 @@ process.stdout.write(JSON.stringify({{ assert json.loads(result.stdout) == { "today": "today", "attention": "attention", + "agenda": "agenda", "all": "all", - "saved": "review", + "saved": "agenda", } @@ -64,6 +66,7 @@ async def test_mobile_launch_progressively_discloses_secondary_controls(): service_worker = (Path(__file__).resolve().parents[1] / "frontend" / "service-worker.js").read_text() assert "BASE + 'static/mobile-launch.js'" in service_worker assert "mobileLaunch.chooseFilter" in html + assert "agenda: counts.agenda" in html assert "mobileLaunch.createDisclosure" in html assert "@media (max-width: 600px)" in html assert "header { min-height:56px; max-height:64px;" in html