From bed194386a612e39b68d45a132d4b2a930213cc2 Mon Sep 17 00:00:00 2001 From: JOJO <1498581755@qq.com> Date: Thu, 28 May 2026 20:50:44 +0800 Subject: [PATCH] fix(mobile): align conversation overlay in app --- AGENTS.md | 4 ++-- android-webview-app/APP_CHANGELOG.md | 4 ++++ android-webview-app/app/build.gradle.kts | 4 ++-- .../app/src/main/java/com/cyjai/agent/MainActivity.kt | 10 +++++++--- static/src/styles/components/overlays/_overlays.scss | 9 +++++++-- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index cab88d9..f79c1b2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -42,7 +42,7 @@ ### Frontend(根目录) - 安装依赖:`npm install` -- 构建:`npm run build --silent`(默认使用 silent,减少无关输出) +- 构建:`npm run build --silent 2>&1 | tail -n 5`(默认只看最后 5 行,减少 Vite 构建资源列表等无关输出) - 开发监听(当前脚本是 build watch):`npm run dev` - Lint:`npm run lint` @@ -84,7 +84,7 @@ - CLI React/TS:保留现有 Ink 渲染方式与光标修正逻辑,不要轻易重写输入框定位策略。 - 日志:优先复用现有 logger/日志路径,不引入大量临时 `print`。 - 提交前至少做与改动相关的最小验证(命令输出或手工步骤要可复现)。 -- 运行根目录前端构建时,默认使用 `npm run build --silent`。 +- 运行根目录前端构建时,默认使用 `npm run build --silent 2>&1 | tail -n 5`。 ### CLI 当前交互约束(2026-05-15) diff --git a/android-webview-app/APP_CHANGELOG.md b/android-webview-app/APP_CHANGELOG.md index 6d5768f..085a3f6 100644 --- a/android-webview-app/APP_CHANGELOG.md +++ b/android-webview-app/APP_CHANGELOG.md @@ -1,5 +1,9 @@ # App 更新说明 +# 1.0.21 +- 修复 Android App 内手机端展开“对话记录”时仍沿用旧宽度的问题,面板宽度与桌面端对话侧栏保持一致 +- 修复 Android App 内对话记录展开面板顶部残留系统栏空白的问题,内容从面板顶端开始显示 + # 1.0.20 - 新增“新用户欢迎弹窗 + 新手教程”持久化机制:普通账号首次进入会提示是否开始教程,选择“开始吧”或“不再提示”后将状态写入 `data/users.json` - 新增后端教程状态接口(查询/更新),并排除宿主机模式用户,避免 host 模式触发教程弹窗 diff --git a/android-webview-app/app/build.gradle.kts b/android-webview-app/app/build.gradle.kts index 6b1568d..619424c 100644 --- a/android-webview-app/app/build.gradle.kts +++ b/android-webview-app/app/build.gradle.kts @@ -16,8 +16,8 @@ android { applicationId = "com.cyjai.agent" minSdk = 24 targetSdk = 35 - versionCode = 22 - versionName = "1.0.20" + versionCode = 23 + versionName = "1.0.21" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } diff --git a/android-webview-app/app/src/main/java/com/cyjai/agent/MainActivity.kt b/android-webview-app/app/src/main/java/com/cyjai/agent/MainActivity.kt index d8a1b82..43a2f0c 100644 --- a/android-webview-app/app/src/main/java/com/cyjai/agent/MainActivity.kt +++ b/android-webview-app/app/src/main/java/com/cyjai/agent/MainActivity.kt @@ -45,7 +45,7 @@ class MainActivity : AppCompatActivity() { ViewCompat.setOnApplyWindowInsetsListener(webView) { view, insets -> val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) - view.setPadding(0, systemBars.top, 0, systemBars.bottom) + view.setPadding(0, 0, 0, systemBars.bottom) insets } ViewCompat.requestApplyInsets(webView) @@ -207,8 +207,12 @@ class MainActivity : AppCompatActivity() { var styleId = '__android_mobile_overlay_width_patch'; var css = [ '.mobile-panel-sheet.mobile-panel-sheet--conversation {', - ' width: min(420px, 65vw) !important;', - ' max-width: 65vw !important;', + ' width: min(var(--conversation-expanded-width, 306px), 100vw) !important;', + ' max-width: 100vw !important;', + ' padding-top: 0 !important;', + '}', + '.mobile-panel-sheet--conversation .mobile-overlay-content {', + ' height: 100% !important;', '}', '.mobile-panel-sheet.mobile-panel-sheet--workspace {', ' width: fit-content !important;', diff --git a/static/src/styles/components/overlays/_overlays.scss b/static/src/styles/components/overlays/_overlays.scss index 3fb3214..ce84bfa 100644 --- a/static/src/styles/components/overlays/_overlays.scss +++ b/static/src/styles/components/overlays/_overlays.scss @@ -1794,8 +1794,9 @@ .mobile-panel-sheet--conversation { background: var(--claude-left-rail); - width: min(420px, 65vw); - max-width: 65vw; + width: min(var(--conversation-expanded-width, 306px), 100vw); + max-width: 100vw; + padding-top: 0; } .mobile-panel-sheet--workspace { @@ -1853,6 +1854,10 @@ height: 100%; } +.mobile-panel-sheet--conversation .mobile-overlay-content { + height: 100%; +} + @media (max-width: 768px) { .mobile-panel-sheet .left-sidebar, .mobile-panel-sheet .right-sidebar {