Repository navigation
fix: stop iOS popover sheets opening scrolled away inside the collapsible pager and limit the activity description action to its text - #261
Conversation
… lookup Overlay content (popover, sheet, dialog) stays mounted inside its host view until the overlay window presents it, and the host can sit in a page's subtree. A Fabric scroll view outranks a verified native list in the candidate tiers, so the collapsible pager adopted the staged sheet scroller as the page owner and applied the collapsed-header offset to it. The sheet then opened scrolled past its content until a drag bounced it back. Every scroll view lookup now skips overlay host subtrees.
The description label spans the identity column and took the action for a tap anywhere on its line, so tapping the blank area beside a contract label opened the label instead of the row. iOS and Android now take touches on the drawn text only (plus a small slop), and of a "time • address" description only on the address, as the Web renderer does. Other touches fall through to the row press.
… on wrapped rows The touch area excluded the leading time only on a single-line description; once "time • address" wrapped, the whole text took the action again, on iOS and Android. The touchable area is now computed per laid-out line: a line before the address takes no touches, the line that holds the separator takes them from the address on, and later lines take them on their text. The vertical slop only grows away from the text, so it cannot reach into the time's line.
…the row's column split The row-level cases assumed the identity column keeps most of a 366pt row. With a short amount the amounts column takes its full half, the label is about 119pt wide, and the blank area beside "08:48 • Uniswap" is narrower than the touch slop, so the right-edge assertions failed on the test geometry, not on the hit area. The row-level cases now use a row wide enough to leave blank space in any split and assert it, and the wrapped case sizes the label directly.
|
请按以下审计要求修改后再合入。审计基于当前 head 原生与业务层边界:避免阻断业务 OTA通用原生组件只负责明确契约下的渲染、布局和交互,不应通过业务文案、分隔符、具体动作名或其他隐含格式推断业务行为。业务语义及其格式应由业务层决定,并通过显式、可校验且可扩展的数据契约传入。 原生代码的修改需要重新构建并随 App 发版,不能靠 JS OTA 替换已安装的原生实现。把业务规则写死在原生层,会让原本可通过 JS OTA 完成的标签、文案或格式调整依赖原生升级,阻断对应业务变更的 OTA 交付。因此本 PR 及后续原生改动都应将这类严重业务耦合作为 review 阻断项;字段设计要允许业务变化在既有原生能力内完成,避免每次业务格式变化都修改原生代码。 这里要求移除的是对业务语义的隐式推断;明确声明的模板字段、组件生命周期和滚动所有权等技术契约可以保留。 [P0] 移除通过显示分隔符推断点击范围的业务格式耦合位置:
当前实现将描述中第一个 这是本次审计的 P0 合入阻断项:通用 NativeList 不应通过显示文案猜测哪部分是时间、地址或标签。 要求修改:
[P1] 修正 iOS 首行纯时间时,下一行地址热区向上侵入的问题位置: 当前先过滤掉纯时间行,再对剩余数组的第一行向上扩 6pt。如果物理首行只有 **要求修改:**按完整布局中的物理首/末行确定垂直容差,或将扩展限制在不会覆盖相邻物理行的范围。补一条首行纯时间、地址从第二行开始的测试,断言分界线上方约 2pt 的时间区域不会触发地址动作。 此项来自源码几何分析,尚未实机复现。当前 Home 显式单行不受这个换行边界影响,但通用 Activity 默认两行,且这是本 PR 已承诺支持的行为。 收敛内部属性,避免重复可变状态将
绑定、无动作重绑和 recycle 都应统一设置或清空这一状态,避免开关与起点不同步。这个内部默认行为应与上面的公共字段缺省语义分别写清楚。 保留的设计边界
聚焦验收
|
The first " • " of the description decided which part of it opens descriptionActionKey: on Web before, and on iOS and Android since this branch. A label is free text, so "Router • V2" lost its first word, and any change of the description format needed a native release. ActivityRow.descriptionActionStart is the UTF-16 offset the action text starts at; absent means the whole text. Web, iOS and Android consume it and no renderer parses the string. Validation checks the type and, on a complete row, the range; production drops a malformed value and the renderers clamp. A patch that changes the description without restating the offset clears it. The native text views hold one optional start in place of a switch and a start, so the two cannot disagree.
…ove on iOS The vertical slop was added after the lines without action text had been dropped. With the time alone on the first line, the address line became the first touchable line and reached 6pt up into the time, which is not part of the action. The slop now belongs to the first and last line of the whole layout, so it never reaches into another line, touchable or not.
…spatch on Android The JVM test covers the geometry only. This instrumented case binds rich Activity rows in a NativeListView and taps the description line with sendPointerSync: the text from descriptionActionStart on emits the description action, the text before it and the blank width emit the row press. It also covers an emoji prefix, a start at or past the end, and rebinding, removing the action and recycling.
|
审计各项已修改,head
需要说明的几点:
|
…ong prefix The prefix element did not shrink and could take the whole line, so a prefix wider than the row squeezed a non-empty action button to zero width and left it without a pointer target. While action text follows, the prefix is capped at the row width less 3em and truncates itself. A prefix that fits keeps its width and the action still truncates first, as the tail of the native label does.
|
要带到 6.7 的话,更新一下版本号 |
|
复审基于最新 head 原 P0 业务耦合已修复,原 P1 垂直上侵已修复;目前仍有一项 P1,修正后再合入。 已确认:
仍需修改:[P1] [🔵 High] 水平热区越过显式动作范围。 已发 inline:#261 (comment) 。 合法短前缀 此外,动作的逻辑后缀在混合方向排版中可能不是一个连续矩形,例如 另有 [P2] [🔵 High] Android 超长偏移的整数窄化。
对新增处理的结论:建议保留。 换行折叠后的偏移映射、替换描述时重置未重述的旧偏移、末尾起点取消动作和按钮语义,都直接服务于新增字段的正确性;生产态输入降级也符合已有容错路径。Web 长前缀预留动作空间属于明确的布局策略,已写入 SPEC,不是通过业务文案猜行为。这些无需删除。 验证与交付边界:
|
…Android The start was read with optInt. JSON carries any safe integer, and one past Int range, 4294967296 for example, came back as 0: the whole description became the action instead of none of it. The start is read as a Long and clamped to the description length before it is narrowed. iOS reads a 64-bit Int and Web a number, so only Android was affected; all three have a case for it now.
The horizontal slop widened the action area by 8 units on both sides, also on the side where the plain text before descriptionActionStart sits. A prefix narrower than the slop, the "i" of "iRouter" with start 1, opened the action it is not part of. The slop now reaches into blank space only and stops at plain text on the same line. The area is built from the layout engine's own rects for the action's character range (TextKit enclosing rects, the Android layout's selection) instead of one box per line, so a suffix that mixed-direction text splits into several visual runs is hit on each run and not on the plain text between them. An ellipsis belongs to the action while action text is visible before it; once truncation hides the action text, nothing is left to touch.
Automated review needs attentionReview of commit Publication requires a retry or human review. This is not an automated approval. |
|
@codex review |
|
@codex security review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Cursor review failed. Remote error: |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings. |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Problem
Two reports against the Home History list in App-6.7.0:
Root cause
react-native-pager-view(iOS). A native Popover keeps its content mounted inside the NativeOverlay host view until the overlay window presents it, and the host sits where the Popover element is, so inside the pager page.resolveScrollCandidateInView:ranks a Fabric scroll view (tier 3) above a verified NativeList (tier 2), so the staged sheetRCTScrollViewComponentViewbecame the page's scroll owner and received the collapsed-header offset. A view hierarchy dump taken while the body was empty shows the sheet scroll view atcontentOffset {0, 268}withcontentSize {335, 60.5}: the content is scrolled out of view, and a drag lets UIKit bounce it back. With the header expanded the applied offset is 0, which is why the list has to be scrolled first.react-native-native-list(iOS and Android). The Activity description label spans the identity column, and the action was bound to the whole label (UITapGestureRecognizeron the label,setOnClickListeneron theTextView). The Web renderer bound the action to an element it cut out of the description at the first•.Fix
Pager (iOS)
RNCCollapsiblePagerViewComponentView.mm: the four scroll lookups (resolveScrollCandidateInView:,findExplicitNativeScrollerInView:,findFabricScrollViewInView:,findVerticalScrollViewInView:) skipRCTNativeOverlayComponentViewsubtrees. The class is looked up by name, so nothing changes when the overlay package is absent, and a scroll view outside a host keeps its priority.docs/SPEC.mdrecords the overlay host as a discovery boundary.Description action (iOS, Android, Web)
New field
ActivityRow.descriptionActionStart. The caller that assembles the description states where its action text starts; no renderer reads that out of the displayed string any more. This removes the•inference from Web, where it already was, and from iOS and Android, where the first version of this PR had copied it.descriptionas supplied (a JavaScript string index). The text from the offset on opensdescriptionActionKey; the text before it is plain and belongs to the row press.0: the whole description text is the action.description.lengthleaves no action text; the row then has no description action and no button semantics on any platform. The field is ignored withoutdescriptionActionKey.description.length. Production drops a malformed value, which restores the default, and the renderers clamp a value past the text to its end.descriptionActionStartis a patch field. A patch that changesdescriptionwithout restating the offset clears the stored one, because it pointed into the previous string.descriptionActionKeykeeps its meaning. There is no rich text, no second action and no segment list.Renderers.
ActivityRowRenderer.ts): the description is a plain prefix element and the action button, split at the offset. The time, dot and address elements are gone. Measured in Chrome, the button of08:48 • Router • V2starts 0.4px further left than before (two spaces instead of two 4px margins); truncation still ends in an ellipsis.3emand truncates itself, so a prefix wider than the row no longer squeezes the action button to zero width. iOS and Android draw one label and do not reserve room.NativeListTextLabel.swift) and Android (NativeListTextView.kt): one optionaltouchableTextStartreplaces thetouchesTextOnlyswitch and its start. No value keeps the view's own hit testing (rows without the action),0limits touches to all of the text, a positive value to the text from there on. Binding, rebinding without the action and recycling set or clear that one value.ABC אבג XYZfrom offset 6, is hit on each run and not on the plain text between them.iRouterand start 1 thei, which is narrower than the slop, no longer opens the action. On iOS the 6pt vertical slop applies to the first and last line of the whole layout only. Before, it was applied after the lines without action text had been dropped, so with the time alone on the first line the address line reached 6pt up into it.optInt, a safe integer past Int range such as 4294967296 came back as 0 and made the whole text the action.docs/SPEC.mdanddocs/ROW_TEMPLATES.mddescribe the field, its default, validation, the patch rule and the hit area.Callers
The only callers of
descriptionActionKeyare in app-monorepo (the Home history list and a gallery fixture). They passdescriptionActionStartin the dependency upgrade that follows this release; that change is prepared and was used for the runtime checks below. Until a caller passes the field, the whole description text is the action.Validation
yarn jestinreact-native-native-list, 529 tests pass;yarn typecheckis clean. New cases cover the accepted range, rejected values, the production fallback, the patch rule, and the Web DOM forRouter • V2,08:48 • Router • V2, an emoji prefix, a start at the end, a row without the action and a prefix wider than the row.Router42px,V2its full 18px.08:48 •with a long label in a 243px row is unchanged: prefix 52.7px, label 190.3px with an ellipsis.NativeListDescriptionTouchPolicyTest, 7 tests pass (run through the app-monorepo Android project with these sources), including the slop stopping at a 3px prefix, two runs with plain text between them, and offsets past Int range.native-tests/android/NativeListDescriptionActionTouchTest.ktbinds rich Activity rows in aNativeListViewand taps the description line withsendPointerSync, so the events travel window → RecyclerView → row. On an arm64 emulator (API 36):OK (7 tests). WithiRouterand start 1, a tap on theiemits the row press and a tap on theRthe description action. WithABC אבג XYZand start 6, taps onABCand on the two plain Hebrew letters emit the row press, taps on the last Hebrew letter and onXYZthe action; the tap positions come fromPaint.measureText, not from the regions under test. The existingNativeListTouchDeliveryTest(4) andNativeListRiskAccessoryTest(23) also pass with these sources. The test APK was built through the app-monorepo Android project with an init script equivalent toreorder-test.init.gradle; the example project's Gradle build does not complete on my machine. Not run inside the OneKey app on Android.NativeListTextLabel.swiftfrom this branch was compiled into a simulator binary and run on iOS 26.5.iRouterfrom 1: the region starts at 3.3pt, the width of thei, and still reaches 8pt past the end of the text.ABC אבג XYZfrom 6: two regions, 32.0–37.7 and 54.9–94.1, with the two plain letters between them. With the time alone on the first line the address region starts at the line boundary (y = 20). A truncated label is touchable up to its ellipsis; a prefix that pushes the action out of view leaves no region. These are the values the XCTest cases assert.native-testsworkflow of this PR (I did not set up the iOS test workspace locally).--shell local) and exercised on an iPhone SE (3rd generation) simulator, iOS 26.5.17:29 • Router • V2, start 8), six taps along the description line: the time and the separator right before the label (6pt left of the label, inside the former slop) open the transaction details; the start of the label andV2open the sheet; the blank 5pt after the text, inside the slop, opens the sheet; the blank 35pt after the text opens the transaction details.descriptionActionStart: 0) open the sheet on the label and the transaction details on the blank beside it, and a labelRouter • V2without a time opens the sheet on both of its words.Release note
Merging publishes the next stable revision. The app picks the fixes up with the following dependency upgrade in app-monorepo, which also has to pass
descriptionActionStartfrom the Home history list.