From 24f781d398e3e33e48a8cf78c7703f74135964e6 Mon Sep 17 00:00:00 2001 From: timmy Date: Sun, 16 Aug 2026 15:58:41 +0000 Subject: [PATCH] feat: add mobile Search Preview navigation (Closes #973) --- .gitea/workflows/ci.yml | 4 +- frontend/dashboard.css | 31 +++- frontend/index.html | 19 ++- frontend/mobile-search-preview-nav.js | 130 +++++++++++++++++ frontend/service-worker.js | 1 + src/frontend_bundle.py | 2 +- .../test_mobile_search_preview_navigation.py | 70 +++++++++ tests/test_ci_workflow.py | 5 +- .../test_mobile_search_preview_navigation.py | 135 ++++++++++++++++++ tests/test_service_worker.py | 1 + 10 files changed, 388 insertions(+), 10 deletions(-) create mode 100644 frontend/mobile-search-preview-nav.js create mode 100644 tests/e2e/test_mobile_search_preview_navigation.py create mode 100644 tests/test_mobile_search_preview_navigation.py diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index cbdef00..1538fa7 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -54,8 +54,8 @@ jobs: run: | pip install -r requirements-e2e.txt python3 -m playwright install --with-deps chromium - - name: Exercise mobile offline filing from the release artifact - run: python3 -m pytest tests/e2e/test_mobile_offline_issue_release.py -q + - name: Exercise mobile offline filing and Search Preview navigation + run: python3 -m pytest tests/e2e/test_mobile_offline_issue_release.py tests/e2e/test_mobile_search_preview_navigation.py -q release-candidate: runs-on: ubuntu-latest diff --git a/frontend/dashboard.css b/frontend/dashboard.css index c172136..8c48178 100644 --- a/frontend/dashboard.css +++ b/frontend/dashboard.css @@ -654,8 +654,10 @@ textarea { resize: vertical; min-height: 120px; } .find-work-detail a { display:flex; align-items:center; justify-content:center; border:1px solid #60a5fa; border-radius:10px; font-weight:700; } .search-preview { position:fixed; inset:0; z-index:60; display:none; justify-content:flex-end; background:rgba(5,12,21,.72); backdrop-filter:blur(4px); } .search-preview.open { display:flex; } -.search-preview-panel { box-sizing:border-box; width:min(560px,100%); height:100dvh; overflow:auto; display:grid; align-content:start; gap:12px; padding:18px; padding-bottom:calc(18px + env(safe-area-inset-bottom)); background:#0b1526; border-left:1px solid #2a496e; overflow-wrap:anywhere; } +.search-preview-panel { box-sizing:border-box; width:min(560px,100%); height:100dvh; overflow:auto; overflow-x:hidden; display:grid; align-content:start; gap:12px; padding:18px; padding-bottom:calc(18px + env(safe-area-inset-bottom)); background:#0b1526; border-left:1px solid #2a496e; overflow-wrap:anywhere; } .search-preview-header { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; } +.mobile-search-preview-nav { display:none; } +.search-preview-overview { display:grid; gap:12px; min-width:0; } .search-preview-header button, .search-preview-actions button, .search-preview-actions a { min-height:44px; } .search-preview-body { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; } .search-preview-conversation { display:grid; gap:8px; padding-top:8px; border-top:1px solid #2a496e; } @@ -678,6 +680,33 @@ textarea { resize: vertical; min-height: 120px; } @media (max-width:420px) { .search-preview-primary-actions { grid-template-columns:1fr; } } +@media (max-width:600px) { + .search-preview-panel { width:100%; border-left:0; padding:14px; padding-top:max(12px,env(safe-area-inset-top)); } + .mobile-search-preview-nav { + position:sticky; top:env(safe-area-inset-top); z-index:6; + display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; + margin-inline:-14px; padding:4px 14px; + background:rgba(11,21,38,.98); border-block:1px solid #2a496e; + } + .mobile-search-preview-nav button { + min-width:0; min-height:44px; padding:4px; overflow-wrap:anywhere; + border-color:transparent; font-size:12px; + } + .mobile-search-preview-nav button[aria-current="location"] { + border-color:#60a5fa; background:#17365a; color:#fff; + } + .mobile-search-preview-nav button[aria-disabled="true"] { opacity:.55; } + .search-preview-navigation { + position:sticky; bottom:0; z-index:5; + margin-inline:-6px; padding:6px; + padding-bottom:calc(6px + env(safe-area-inset-bottom)); + background:rgba(11,21,38,.98); border-block:1px solid #2a496e; + } + #search-preview-overview, #search-preview-conversation, + #search-preview-reply-workspace, #search-preview-actions { scroll-margin-top:72px; } + #search-preview-actions { position:static; } +} +@media (min-width:601px) { .mobile-search-preview-nav { display:none; } } .search-preview-actions a { display:flex; align-items:center; justify-content:center; border:1px solid #60a5fa; border-radius:10px; font-weight:700; } .markdown-content { min-width:0; max-width:100%; overflow-wrap:anywhere; white-space:normal; } .markdown-content > :first-child { margin-top:0; } diff --git a/frontend/index.html b/frontend/index.html index b8ace3e..6a1ca0c 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -533,9 +533,17 @@ -
Choose a search result.
-
-
+ +
+
Choose a search result.
+
+
+

Current conversation

@@ -543,7 +551,7 @@
-