Skip to content

fix(mobile): Android 会话编辑框保留横向拖动 - #5536

Draft
DoodleBears wants to merge 1 commit into
mainfrom
codex/android-drawer-composer-5511
Draft

DoodleBears wants to merge 1 commit into
mainfrom
codex/android-drawer-composer-5511

Conversation

@DoodleBears

@DoodleBears DoodleBears commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Why the change

Android 会话的编辑框浮在消息列表上方,旧的触摸查找可能命中被编辑框盖住的代码块或表格,从编辑框抢走光标拖动。

Refs #5511

原 PR #5526 · 任务认领 · codex/local/01a21920-ec15-73a2-bea4-e4a0b53eb44f

Harness / Model

Harness: codex
Model: gpt-6.2-sol

Special things to note

  • Merge risk: 可回退,影响范围小。回退此提交并重建 Android 开发包即可恢复原来的手势行为。评审重点是编辑框、浮层和代码块或表格重叠时的手势归属。
  • Verification: composerRetainsHorizontalDragOverLeadingEdgeScroller 在 fix(mobile): Android 会话抽屉支持从代码块和表格边缘滑开 #5526 的实现上收到 ACTION_CANCEL(Gradle 退出码 1),修复后收到 ACTION_MOVE。Android 模块的 29 项测试、移动端 Vitest 的 86 项测试、移动端类型检查、oxfmt、oxlint、check-source-policy、pnpm lint、Host 构建和 :app:assembleDebug 均通过。补充用例覆盖编辑框位于滚动容器内、浮层层级、多指、未溢出的代码块、UP 和 CANCEL 后的下一次滑动、Android 布局方向,以及越过触摸阈值前横向偏移发生变化的情况。Pixel 7 API 36 的手势实测见下方。
  • Design review: Android 保留既有布局、文案和控件。评审时可在整个会话页面上直接复现,包括宽内容滚到编辑框背后的情况。

No regression test: 本 PR 的回归测试使用 Android Robolectric。regression-proof 门禁只识别 Vitest 文件,Android native CI 运行上述回归用例。

Change outline

按下 → 先找触点最上层可命中的视图 → 沿这一条路径寻找横向滚动容器
       路径命中编辑框 → 编辑框保留手势
       路径命中处于起始边缘的容器 → 越过触摸阈值时复查滚动偏移

初次按下时已经滚动过的内容会保留整次拖动。若容器在按下后、越过阈值前离开起始边缘,也交由容器处理。本次点测没有再出现 Neon 观察到的偶发开启,Robolectric 覆盖了偏移在两个事件之间变化的情况。

Pixel 7 API 36 手势点测

Android 16 模拟器,英文与浅色,使用提交 d266d740e1cdfc4fa460c9e265d4018aac103fff 的 Debug APK 和隔离的 OpenCode Go Host。

操作 结果
当宽代码块覆盖区域与编辑框重叠时,向右拉动文本选择手柄 选区从 Alpha 扩大到 Alpha bravo charlie。输入 QA 后剩下 QA delta,抽屉保持关闭
在同一编辑框内向右拖动 740 像素 抽屉保持关闭,草稿文字保持 QA delta
从代码块或表格起始边缘向右拖动 打开会话抽屉。系统返回关闭抽屉
在已滚动的代码块或表格上向右拖动 滚回起始边缘,本次手势内抽屉保持关闭。抬手后再次右拖可打开抽屉

编辑框拖动前 · 代码块位于编辑框后,最初仅选择 Alpha。

浅色,修复版编辑框在宽代码块上方,拖动前只选中 Alpha

编辑框拖动后 · 选区扩大,抽屉保持关闭。

浅色,拖动后编辑框选中 Alpha bravo charlie,抽屉保持关闭

代码块边缘右拖 · 起始边缘的开抽屉手势仍然有效。

浅色,从宽代码块起始边缘右拖后显示会话抽屉


Run Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Issue: #5511
Agent-Task: codex/local/01a21920-ec15-73a2-bea4-e4a0b53eb44f
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Product Terms Follow The Glossary Warning Checked the PR description (in scope per the check) and the PR commit d266d74, which changes .agents/skills/verify-deepseekbot/features/phone-sessions-navigation.md, SessionDrawerContentGate.kt… Edit the PR description (the check covers it; the diff's doc and code changes need no edit): - Replace "消息列表" with "会话时间线" (Conversation Timeline). Example: "Android Session 的编辑框浮在会话时间线上方" or, with the English term, "Android Session 的 Compo…
Passed Passed checks: 3 passed

Check name Status Explanation
Fix Targets The Root Cause Passed The check applies because the PR title starts with "fix(mobile):". Root cause is changed in the owning module. Commit d266d74 changes SessionDrawerContentGate.kt, the module that owns the lea…
Consistent With Adrs And Existing Features Passed The PR is a single commit (d266d74) on top of abbd9dd. Its diff touches SessionDrawerContentGate.kt and its Robolectric test, plus one verify-skill feature note. It changes nothing under docs/decisi…
Touched Features Are Verified Passed Summary: The PR touches one mapped feature, phone-sessions-navigation, and its verification notes name a run of that feature's journey. The check passes. Scope. The PR head d266d740e1 sits…
Full details: Fix Targets The Root Cause

Explanation

The check applies because the PR title starts with "fix(mobile):". Root cause is changed in the owning module. Commit d266d74 changes SessionDrawerContentGate.kt, the module that owns the leading-edge drawer gesture decision. The old horizontalScrollerAt walked children in tree order and returned the first horizontal scroller it found. It did not account for a composer EditText drawn on top of a wide code block or table. The new code replaces it with topmostViewAt, which resolves the hit view by z-order and PointerEvents. horizontalScrollerAt then returns null when the topmost hit is an EditText. It also checks isShown and the scroll offset again when the touch slop is crossed. This corrects the hit-test logic. It does not special-case a caller. No symptom masking. The diff adds no retry, timeout, catch-and-ignore, or hiding flag. It does not duplicate the logic beside the faulty module. Regression test named. The PR description names composerRetainsHorizontalDragOverLeadingEdgeScroller. That test exists in SessionDrawerContentGateTest.kt (line 103). It drives an ACTION_DOWN and ACTION_MOVE over a composer overlay and asserts the drawer receives no events. The description says the test receives ACTION_CANCEL on the #5526 implementation and ACTION_MOVE after this fix. The description also includes a "No regression test" note for the Vitest-only gate. That note does not reduce the result, because the Android test is named and present. Every condition for the check is met.

Full details: Consistent With Adrs And Existing Features

Explanation

The PR is a single commit (d266d74) on top of abbd9dd. Its diff touches SessionDrawerContentGate.kt and its Robolectric test, plus one verify-skill feature note. It changes nothing under docs/decisions/. The check applies because the PR changes gesture behaviour. ADR consistency: the only ADR text on this behaviour is docs/decisions/mobile-ui.md §43 (Amended by #5255). It says "a rightward swipe anywhere on a Drawer-style Session root opens it" and that Android hands the gesture to Compose ModalNavigationDrawer. The repository uses a custom SessionDrawerContentGate view for this gesture instead; that mismatch predates this PR. The PR narrows "anywhere" in one case: a rightward drag over an editor on a leading-edge scroller no longer opens the drawer. The parent code already excluded EditText from drawer-opening targets, so the PR extends an existing exclusion. The ADR records no decision that composer overlays must open the drawer. §5 of the same ADR says native components own gestures where delegated; the PR keeps gesture ownership in the existing native gate. Duplication: the PR modifies the existing dismissible-drawer module and adds topmostViewAt, a z-ordered hit test, inside the same gate file. It does not add a second implementation of a capability another module provides. EndSheetView.kt has its own horizontalTarget for the profile sheet, but that predates this PR. No shared hit-test utility exists in the mobile modules. Residual risk: the "anywhere" wording in mobile-ui.md §43 no longer matches the composer-over-scroller case. A maintainer may want to amend that sentence. The failure condition is not met.

Full details: Touched Features Are Verified

Explanation

Summary: The PR touches one mapped feature, phone-sessions-navigation, and its verification notes name a run of that feature's journey. The check passes. Scope. The PR head d266d740e1 sits on top of the merge abbd9dd0a3 (PR #5526). The branch is 253 commits ahead of origin/main. I used the changes this fix carries: the d266 commit (3 files) and the #5526 content it builds on. These are in the diff from abbd9dd0a3 to d266d740e1, plus the #5526 merge diff. Older commits on the branch that touch other features, such as phone-composer (composer.tsx, from 216123089d), are not part of this fix. They are outside the scope I assessed. Feature mapping. Matching the ## Sources globs of every feature file against the changed files: - phone-sessions-navigation.md Sources include apps/mobile/modules/dismissible-drawer/.../SessionDrawer{View,ContentGate}.kt and apps/mobile/src/features/sessions/session-drawer.android.tsx. - SessionDrawerContentGate.kt (runtime) changed in d266 and session-drawer.android.tsx changed in #5526. The SessionDrawerContentGateTest.kt and apps/mobile/test/session-drawer-android.test.tsx changes are test-only. - No other feature's Sources match the PR's own changed files. Verification notes. The PR description names a run of the feature's journey. Journey step 7 in phone-sessions-navigation.md covers a wide block behind the Composer with a horizontal drag. The PR's Pixel 7 API 36 run covers: - Dragging the text selection handle over a wide code block under the Composer. The selection grew, and the drawer stayed closed. - Dragging from the leading edge of a code block or table. The drawer opened, and Back closed it. - Dragging a scrolled block back to the leading edge within one gesture. The drawer stayed closed until the finger lifted, then reopened. The notes also list Robolectric tests for the same cases and passing Android, Vitest, lint, and build results. Conclusion. The mapped feature's runtime code changed, and the verification notes name a run of its journey. The check does not fail.

Full details: Product Terms Follow The Glossary

Explanation

Checked the PR description (in scope per the check) and the PR commit d266d74, which changes .agents/skills/verify-deepseekbot/features/phone-sessions-navigation.md, SessionDrawerContentGate.kt and its test. The diff itself adds no user-visible UI copy. The PR description fails on two product nouns, using the Chinese words that GLOSSARY.zh.md lists under 避免使用 (avoid): 1. Conversation Timeline (GLOSSARY.zh.md line 1330: _避免使用_:聊天列表、消息列表(单独使用)、FlatList、Recycler). The description says "Android 会话的编辑框浮在消息列表上方" ("the Android session editor floats above the 消息列表"). Here "消息列表" means the ordered list of one conversation's messages, which is the Conversation Timeline sense, and it is used alone. The preferred term is Conversation Timeline (会话时间线). 2. Session / Session drawer (GLOSSARY.zh.md line 211 lists the avoid word conversation; the Session drawer entry is "Session 抽屉"). The description uses 会话 for the product noun, in "Android 会话的编辑框" and in the verification table ("打开会话抽屉", "会话抽屉"). The English Session entry avoids "conversation", and the zh glossary uses 会话 as the Chinese rendering of conversation (会话页 is the Conversation screen). The preferred terms are Session and Session drawer (Session 抽屉). Checked and passed: - "编辑框" and "editor" for the Composer. Its avoid list is "input box, text field" (输入框, 文本框), and neither term appears in the added text. - "New Session page". The New Session screen avoid list is "create Session form, blank Session". "page" is not listed. - "drawer" in "抽屉保持关闭". The only entry with "drawer (alone)" in its avoid list is the Component term entry, not a product noun. - "Harness: codex" in the description. This is the coding tool name, not the BotHarness product noun. The check's wording counts an avoid word used in the glossary's sense of a product noun. Both instances in the description are that sense.

Resolution

Edit the PR description (the check covers it; the diff's doc and code changes need no edit): - Replace "消息列表" with "会话时间线" (Conversation Timeline). Example: "Android Session 的编辑框浮在会话时间线上方" or, with the English term, "Android Session 的 Composer 浮在 Conversation Timeline 上方". - Replace "会话" used for the product noun with "Session". Replace "会话抽屉" with "Session 抽屉" (Session drawer). Example: "打开 Session 抽屉。系统返回关闭抽屉。" - Keep "编辑框" only if the reader needs the Chinese word. The glossary's preferred term for the input area is Composer.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added harness:codex model:gpt-6.2-sol Code authored by GPT-6.2 Sol labels Nov 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

harness:codex model:gpt-6.2-sol Code authored by GPT-6.2 Sol

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant