From d81a4a76de0aa88a1630c9ac892bdff394e6716a Mon Sep 17 00:00:00 2001 From: Ark0N Date: Thu, 24 Sep 2026 23:08:53 +0200 Subject: [PATCH] feat(mobile): search box in the Select Case picker (#488) The phone case picker had no way to narrow a long case list, so finding one meant scrolling a sheet that showed about six rows at a time. - A search field filters rows by name (every typed word must match, any order, case-insensitive), with a "No matching cases" state. Enter picks the case when exactly one row is left; Escape clears, then closes. - The field is not auto-focused, so opening the picker does not raise the keyboard. The list holds its unfiltered height while searching so the sheet does not jump, and the input is 16px so iOS Safari does not zoom. - Layout: the sheet padded the home-indicator inset on top of the footer already doing so, leaving a dead band under Create New Case; the sheet now grows to 80dvh and the list fills it instead of a separate 50vh cap. - Opening scrolls the list (its own box, not scrollIntoView) to the currently selected case. Co-authored-by: Codeman maintainer --- src/web/public/i18n.js | 2 ++ src/web/public/index.html | 5 ++++ src/web/public/mobile.css | 6 ++-- src/web/public/session-ui.js | 55 ++++++++++++++++++++++++++++++++++++ src/web/public/styles.css | 51 ++++++++++++++++++++++++++++++++- 5 files changed, 116 insertions(+), 3 deletions(-) diff --git a/src/web/public/i18n.js b/src/web/public/i18n.js index 363fc253..82d6e6bb 100644 --- a/src/web/public/i18n.js +++ b/src/web/public/i18n.js @@ -106,6 +106,8 @@ 'Manage AI Coding tools in persistent tmux sessions.': '在持久化 tmux 会话中管理 AI 编程工具。', 'Select case': '选择案例', 'Select Case': '选择案例', + 'Search cases': '搜索案例', + 'No matching cases': '没有匹配的案例', 'All cases': '全部案例', 'No directory': '未选择目录', Run: '运行', diff --git a/src/web/public/index.html b/src/web/public/index.html index ba7a254d..a5009b53 100644 --- a/src/web/public/index.html +++ b/src/web/public/index.html @@ -3205,7 +3205,12 @@

Select Case

+
+
diff --git a/src/web/public/mobile.css b/src/web/public/mobile.css index 4565a91b..1a5136f4 100644 --- a/src/web/public/mobile.css +++ b/src/web/public/mobile.css @@ -2165,9 +2165,11 @@ html.mobile-init .file-browser-panel { background: rgba(0, 0, 0, 0.5); } + /* The footer already reserves the home-indicator inset; padding the sheet too + counted it twice and left a dead band under Create New Case. */ .mobile-case-picker-sheet { - max-height: 60vh; - padding-bottom: var(--safe-area-bottom); + max-height: 80vh; + max-height: 80dvh; animation: slideUp 0.2s ease-out; } diff --git a/src/web/public/session-ui.js b/src/web/public/session-ui.js index 6ad55178..307e2ff3 100644 --- a/src/web/public/session-ui.js +++ b/src/web/public/session-ui.js @@ -4589,6 +4589,7 @@ Object.assign(CodemanApp.prototype, { const isSelected = c.name === currentCase; html += `