From 54ff44462ecf09b7249357ddc9ce418b62876b05 Mon Sep 17 00:00:00 2001 From: timmy Date: Wed, 12 Aug 2026 10:53:56 +0000 Subject: [PATCH] fix: keep mobile inline review above keyboard (Closes #643) --- frontend/dashboard.css | 2 ++ frontend/dashboard.js | 5 ++++- frontend/service-worker.js | 2 +- tests/test_comment_next.py | 2 +- tests/test_frontend_bundle.py | 2 +- tests/test_later_sync.py | 2 +- tests/test_markdown_renderer.py | 2 +- tests/test_mobile_composer_integration.py | 6 +++++- tests/test_mobile_device_setup.py | 2 +- tests/test_plan_today.py | 2 +- tests/test_service_worker.py | 20 ++++++++++---------- tests/test_today_readiness.py | 2 +- tests/test_today_sync.py | 2 +- 13 files changed, 30 insertions(+), 21 deletions(-) diff --git a/frontend/dashboard.css b/frontend/dashboard.css index 9e88eb1..45679c1 100644 --- a/frontend/dashboard.css +++ b/frontend/dashboard.css @@ -593,11 +593,13 @@ textarea { resize: vertical; min-height: 120px; } .create-issue-panel.composer-keyboard-active, .issue-sheet-panel.composer-keyboard-active, .pull-sheet-panel.composer-keyboard-active, + .review-sheet-panel.composer-keyboard-active, .update-sheet-panel.composer-keyboard-active { position:fixed; top:var(--composer-viewport-top,0px); right:0; height:var(--composer-viewport-height,100dvh); overscroll-behavior:contain; padding-bottom:calc(14px + env(safe-area-inset-bottom)); } .composer-keyboard-active .create-issue-form :is(input,textarea,select,button) { scroll-margin-block:12px; } .composer-keyboard-active .create-issue-form, .composer-keyboard-active .issue-comment-composer, .composer-keyboard-active .pull-comment-composer, + .composer-keyboard-active .review-inline-composer, .composer-keyboard-active .update-reply { scroll-margin-block:12px; padding-bottom:env(safe-area-inset-bottom); } .mobile-task-dock { position:fixed; inset:auto 0 0; z-index:45; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:2px; padding:6px 8px; padding-bottom:env(safe-area-inset-bottom); border-top:1px solid #2a496e; background:rgba(11,21,38,.98); backdrop-filter:blur(12px); } .mobile-queue-sheet { width:100%; max-width:none; margin:auto 0 0; padding:0; border:0; border-radius:18px 18px 0 0; color:var(--text); background:#102641; } diff --git a/frontend/dashboard.js b/frontend/dashboard.js index cf7f79b..f6d9fd4 100644 --- a/frontend/dashboard.js +++ b/frontend/dashboard.js @@ -9,6 +9,7 @@ { panel:qs('#issue-sheet .issue-sheet-panel'), workspace:qs('.issue-comment-composer'), composer:qs('#issue-comment'), submit:qs('#send-issue-comment'), status:qs('#issue-comment-status') }, { panel:qs('#pull-sheet .pull-sheet-panel'), workspace:qs('.pull-comment-composer'), composer:qs('#pull-comment'), submit:qs('#send-pull-comment'), status:qs('#pull-comment-status') }, { panel:qs('#update-sheet .update-sheet-panel'), workspace:qs('.update-reply'), composer:qs('#update-reply'), submit:qs('#send-update-reply'), status:qs('#update-reply-status') }, + { panel:qs('#review-sheet .review-sheet-panel'), workspace:qs('#review-inline-composer'), composer:qs('#review-inline-body'), submit:qs('#save-inline-comment'), status:qs('#review-submit-status') }, { panel:qs('.create-issue-panel'), workspace:qs('#create-issue-form'), focusWithin:true }, ], }); @@ -942,7 +943,7 @@ qs('#retry-work-route').addEventListener('click', () => workRoute.sync()); function closeOpenWorkSheets() { - ['#issue-sheet .issue-sheet-panel', '#pull-sheet .pull-sheet-panel', '#update-sheet .update-sheet-panel'] + ['#issue-sheet .issue-sheet-panel', '#pull-sheet .pull-sheet-panel', '#review-sheet .review-sheet-panel', '#update-sheet .update-sheet-panel'] .forEach(selector => mobileComposerViewport.close(qs(selector))); ['#issue-sheet', '#pull-sheet', '#review-sheet', '#update-sheet'].forEach(selector => qs(selector).classList.remove('open') @@ -3406,6 +3407,7 @@ } function closeInlineComposer() { + mobileComposerViewport.close(qs('#review-sheet .review-sheet-panel')); qs('#review-inline-composer').hidden = true; qs('#review-inline-body').value = ''; activeInlineTarget = null; @@ -3539,6 +3541,7 @@ workRoute.close(); return; } + mobileComposerViewport.close(qs('#review-sheet .review-sheet-panel')); qs('#review-sheet').classList.remove('open'); selectedReview = null; offlineReview = false; diff --git a/frontend/service-worker.js b/frontend/service-worker.js index b914f05..2fa4270 100644 --- a/frontend/service-worker.js +++ b/frontend/service-worker.js @@ -1,6 +1,6 @@ const BASE = new URL('./', self.location.href).pathname; importScripts(BASE + 'static/background-issue-sync.js'); -const CACHE = 'stackchain-dashboard-shell-v95'; +const CACHE = 'stackchain-dashboard-shell-v96'; const OFFLINE_LEASE_URL = new URL(BASE + '__offline-session-lease', self.location.origin).href; const OUTAGE_STATUSES = new Set([500, 502, 503, 504]); const NAVIGATION_TIMEOUT_MS = self.__STACKCHAIN_NAVIGATION_TIMEOUT_MS || 4000; diff --git a/tests/test_comment_next.py b/tests/test_comment_next.py index 9cec075..c9cb61c 100644 --- a/tests/test_comment_next.py +++ b/tests/test_comment_next.py @@ -303,4 +303,4 @@ async def test_unread_update_offers_reply_mark_read_and_next_independent_of_toda assert '.update-reply-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr));' in html assert '.update-reply-actions button { min-height:44px;' in html worker = (Path(__file__).parents[1] / "frontend" / "service-worker.js").read_text() - assert "stackchain-dashboard-shell-v95" in worker + assert "stackchain-dashboard-shell-v96" in worker diff --git a/tests/test_frontend_bundle.py b/tests/test_frontend_bundle.py index ba09a0b..54cd2aa 100644 --- a/tests/test_frontend_bundle.py +++ b/tests/test_frontend_bundle.py @@ -187,7 +187,7 @@ def test_legacy_cache_marker_is_normalized_out_of_build_identity(tmp_path): worker = changed_frontend / "service-worker.js" worker.write_text( worker.read_text().replace( - "const CACHE = 'stackchain-dashboard-shell-v95';", + "const CACHE = 'stackchain-dashboard-shell-v96';", "const CACHE = 'stackchain-dashboard-shell-v999';", ) ) diff --git a/tests/test_later_sync.py b/tests/test_later_sync.py index 5137f83..f0717b9 100644 --- a/tests/test_later_sync.py +++ b/tests/test_later_sync.py @@ -347,5 +347,5 @@ async def test_dashboard_syncs_every_later_change_and_exposes_account_status(): def test_later_sync_ships_atomically_in_the_offline_shell(): source = (Path(__file__).parents[1] / "frontend" / "service-worker.js").read_text() - assert "stackchain-dashboard-shell-v95" in source + assert "stackchain-dashboard-shell-v96" in source assert "BASE + 'static/later-sync.js'" in source diff --git a/tests/test_markdown_renderer.py b/tests/test_markdown_renderer.py index 58b2bd5..944d2e3 100644 --- a/tests/test_markdown_renderer.py +++ b/tests/test_markdown_renderer.py @@ -137,4 +137,4 @@ def test_markdown_work_bodies_are_mobile_safe_block_containers(): assert ".markdown-content { min-width:0; max-width:100%; overflow-wrap:anywhere;" in css assert ".markdown-content pre { max-width:100%; overflow-x:auto;" in css assert ".markdown-content a { min-height:44px;" in css - assert "stackchain-dashboard-shell-v95" in worker + assert "stackchain-dashboard-shell-v96" in worker diff --git a/tests/test_mobile_composer_integration.py b/tests/test_mobile_composer_integration.py index e814253..da902f7 100644 --- a/tests/test_mobile_composer_integration.py +++ b/tests/test_mobile_composer_integration.py @@ -20,6 +20,7 @@ def test_all_text_entry_flows_are_wired_to_keyboard_safe_panels(): ("#issue-sheet .issue-sheet-panel", ".issue-comment-composer", "#issue-comment", "#send-issue-comment", "#issue-comment-status"), ("#pull-sheet .pull-sheet-panel", ".pull-comment-composer", "#pull-comment", "#send-pull-comment", "#pull-comment-status"), ("#update-sheet .update-sheet-panel", ".update-reply", "#update-reply", "#send-update-reply", "#update-reply-status"), + ("#review-sheet .review-sheet-panel", "#review-inline-composer", "#review-inline-body", "#save-inline-comment", "#review-submit-status"), ]: for selector in (panel, workspace, composer, submit, status): assert repr(selector) in dashboard @@ -27,10 +28,13 @@ def test_all_text_entry_flows_are_wired_to_keyboard_safe_panels(): assert "workspace:qs('#create-issue-form')" in dashboard assert "focusWithin:true" in dashboard assert "mobileComposerViewport.close(qs('.create-issue-panel'))" in dashboard + assert "mobileComposerViewport.close(qs('#review-sheet .review-sheet-panel'))" in dashboard assert "height:var(--composer-viewport-height,100dvh)" in css assert "top:var(--composer-viewport-top,0px)" in css assert ".composer-keyboard-active" in css assert ".create-issue-panel.composer-keyboard-active" in css + assert ".review-sheet-panel.composer-keyboard-active" in css + assert ".composer-keyboard-active .review-inline-composer" in css assert ".composer-keyboard-active .create-issue-form :is(input,textarea,select,button) { scroll-margin-block:12px;" in css @@ -41,7 +45,7 @@ def test_offline_shell_contains_every_local_dashboard_runtime_asset(): shell_assets = set(re.findall(r"BASE \+ '([^']+)'", worker.split("async function sessionCsrf", 1)[0])) assert local_assets <= shell_assets, f"Offline shell is missing: {sorted(local_assets - shell_assets)}" - assert "stackchain-dashboard-shell-v95" in worker + assert "stackchain-dashboard-shell-v96" in worker def test_all_conversation_composers_offer_accessible_mobile_mentions(): diff --git a/tests/test_mobile_device_setup.py b/tests/test_mobile_device_setup.py index 97fd928..5e10eb8 100644 --- a/tests/test_mobile_device_setup.py +++ b/tests/test_mobile_device_setup.py @@ -186,7 +186,7 @@ def test_mobile_dashboard_mounts_phone_safe_device_setup_flow(): assert "promptStorage:localStorage" in dashboard assert "pushControllerReady.then(ensureDeviceSetup)" in dashboard assert "BASE + 'static/mobile-device-setup.js'" in worker - assert "stackchain-dashboard-shell-v95" in worker + assert "stackchain-dashboard-shell-v96" in worker assert ".device-setup-panel" in css assert ".device-readiness-card" in css assert "overflow-x:hidden" in css diff --git a/tests/test_plan_today.py b/tests/test_plan_today.py index 602e32c..22622a3 100644 --- a/tests/test_plan_today.py +++ b/tests/test_plan_today.py @@ -410,7 +410,7 @@ async def test_plan_today_wires_cancel_back_and_success_through_overlay_history( def test_plan_today_controller_is_available_in_the_offline_shell(): source = SERVICE_WORKER.read_text() - assert "stackchain-dashboard-shell-v95" in source + assert "stackchain-dashboard-shell-v96" in source assert "BASE + 'static/plan-today.js'" in source assert "BASE + 'static/plan-today-readiness.js'" in source assert "BASE + 'static/plan-today-preview.js'" in source diff --git a/tests/test_service_worker.py b/tests/test_service_worker.py index 401f1ff..762a37e 100644 --- a/tests/test_service_worker.py +++ b/tests/test_service_worker.py @@ -145,7 +145,7 @@ async function dispatchPush(payload) {{ def test_resumable_today_session_ships_in_a_new_offline_shell(): source = WORKER.read_text() - assert "stackchain-dashboard-shell-v95" in source + assert "stackchain-dashboard-shell-v96" in source assert "BASE + 'static/my-work.js'" in source assert "BASE + 'static/dashboard.js'" in source assert "BASE + 'static/dashboard.css'" in source @@ -154,14 +154,14 @@ def test_resumable_today_session_ships_in_a_new_offline_shell(): def test_ownership_exit_runtime_rolls_the_offline_shell_cache(): source = WORKER.read_text() - assert "stackchain-dashboard-shell-v95" in source + assert "stackchain-dashboard-shell-v96" in source assert "BASE + 'static/dashboard.js'" in source def test_offline_review_next_ships_today_completion_atomically(): source = WORKER.read_text() - assert "stackchain-dashboard-shell-v95" in source + assert "stackchain-dashboard-shell-v96" in source assert "BASE + 'static/today-completion.js'" in source assert "BASE + 'static/dashboard.js'" in source @@ -169,7 +169,7 @@ def test_offline_review_next_ships_today_completion_atomically(): def test_duplicate_aware_capture_ships_in_a_new_offline_shell(): source = WORKER.read_text() - assert "stackchain-dashboard-shell-v95" in source + assert "stackchain-dashboard-shell-v96" in source assert "BASE + 'static/create-issue-sheet.js'" in source assert "BASE + 'static/dashboard.js'" in source @@ -177,14 +177,14 @@ def test_duplicate_aware_capture_ships_in_a_new_offline_shell(): def test_exact_later_picker_ships_atomically_in_a_new_offline_shell(): source = WORKER.read_text() - assert "stackchain-dashboard-shell-v95" in source + assert "stackchain-dashboard-shell-v96" in source assert "BASE + 'static/later-picker.js'" in source def test_navigation_deadline_ships_in_a_new_shell_cache(): source = WORKER.read_text() - assert "stackchain-dashboard-shell-v95" in source + assert "stackchain-dashboard-shell-v96" in source assert "BASE + 'static/dashboard.css'" in source assert "BASE + 'static/dashboard.js'" in source assert "BASE + 'static/install-app.js'" in source @@ -193,21 +193,21 @@ def test_navigation_deadline_ships_in_a_new_shell_cache(): def test_today_convergence_ships_in_a_new_shell_cache(): source = WORKER.read_text() - assert "stackchain-dashboard-shell-v95" in source + assert "stackchain-dashboard-shell-v96" in source assert "BASE + 'static/today-sync.js'" in source def test_mobile_search_viewport_ships_in_a_new_offline_shell(): source = WORKER.read_text() - assert "stackchain-dashboard-shell-v95" in source + assert "stackchain-dashboard-shell-v96" in source assert "BASE + 'static/mobile-search-viewport.js'" in source def test_update_ownership_flow_ships_atomically_in_a_new_offline_shell(): source = WORKER.read_text() - assert "stackchain-dashboard-shell-v95" in source + assert "stackchain-dashboard-shell-v96" in source assert "BASE + 'static/update-ownership.js'" in source @@ -654,7 +654,7 @@ def test_one_session_bound_csrf_proof_is_reused_for_a_background_drain(): def test_queue_today_ships_atomically_in_a_new_offline_shell(): source = WORKER.read_text() - assert "stackchain-dashboard-shell-v95" in source + assert "stackchain-dashboard-shell-v96" in source assert "BASE + 'static/queue-today.js'" in source diff --git a/tests/test_today_readiness.py b/tests/test_today_readiness.py index a9e30c0..975b120 100644 --- a/tests/test_today_readiness.py +++ b/tests/test_today_readiness.py @@ -221,7 +221,7 @@ async def test_today_blocker_opens_existing_preview_and_preserves_readiness_gate def test_readiness_runtime_is_available_in_offline_shell(): service_worker = SERVICE_WORKER.read_text() - assert "const CACHE = 'stackchain-dashboard-shell-v95';" in service_worker + assert "const CACHE = 'stackchain-dashboard-shell-v96';" in service_worker assert "BASE + 'static/today-readiness.js'" in service_worker diff --git a/tests/test_today_sync.py b/tests/test_today_sync.py index 6ae65e6..961a89c 100644 --- a/tests/test_today_sync.py +++ b/tests/test_today_sync.py @@ -127,7 +127,7 @@ sync.enqueueConfiguration(120, {{'issue:r:1:':60}}); def test_inflight_today_drain_ships_in_a_new_offline_shell(): source = (Path(__file__).parents[1] / "frontend" / "service-worker.js").read_text() - assert "stackchain-dashboard-shell-v95" in source + assert "stackchain-dashboard-shell-v96" in source assert "BASE + 'static/today-sync.js'" in source -- 2.43.0