Repository navigation
feat(native-list): add native context menus to content rows - #351
limichange wants to merge 3 commits into
Conversation
Content rows (identity, rail, activity, message, data, media tile, metric card and market) can declare `contextMenu` with 1 to 8 entries. iOS 16+ presents it with the system context menu and the row's own cell as the lifted preview. Android opens a themed popup next to the row from the platform long click. A chosen entry emits one `onRowAction`; iOS 15 and Web ignore the field and keep `longPressActionKey`. Snapshot replacements and patches keep an open menu while its row still offers one through the same renderer; a removed row closes it. Whole-row reorder and nested controls keep their own long press.
|
@codex review |
|
@codex security review |
|
Cursor review failed. Remote error: |
|
Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings. |
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. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. 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". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b54b831f04
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
The adapter now wires the context menu on its own rows, so a row nested in a wallet group never opens one, even when it shares a key with a list row. The Android popup stays inside the window. Entries that do not fit, for example in landscape or split screen, scroll.
On Android a chosen entry waits for the menu to leave. A snapshot or patch that invalidated the menu in that time closed the popup before the list took the update, so the choice was checked against the old rows and still emitted. The update now drops the waiting choice.
Summary
OneKey's Market Favorites list opens a JS overlay ("Move to top" / "Remove") on long press. This adds a native long-press menu to NativeList, so the platform draws it. The contract is the same for every content row, so another list can adopt it later with row data and an
onRowActioncase, without a native release.contextMenu?: { title?, actions }on identity, rail, activity, message, data, media tile, metric card and market rows. 1 to 8 entries withactionKey,title,iosSystemImage?,icon?,destructive?,disabled?. It is also a patch field;nullclears it. Section headers, actions, button groups, system rows and wallet groups reject it.UICollectionViewcontext menu. The row's own cell is the lifted preview: an edge-to-edge row lifts as an inset rounded card, a narrower row in its own shape. A dark fill rises one tone while lifted; without that, the card and the dimmed page were#0f0f0fand#0f0f14.PopupMenuis not used: under the app theme it stays light and square-cornered in dark mode.onRowActionwith the row's key and the entry'sactionKey, without an anchor.longPressActionKey.longPressActionKey, so consumers send both.longPressActionKeyuses the same listener and keeps its behavior.Validation
tsc -b, test integrity andgit diff --checkpass. ESLint reports the same 4 Prettier errors invalidation.test.tsasmain.NativeListContextMenuActionsTestandNativeListContextMenuPresentationTest(wired and nested rows, the long-press fallback, popup height in a short window, a chosen entry that runs or is dropped).NativeListContextMenuTests6/6 on an iOS 26.5 simulator hosted in the OneKey app. CI'sios-nativeandios-xctestpassed on the first commit; two icon tests that failed only in the OneKey host pass there.longPressActionKeyunchanged).Consumer: OneKeyHQ/app-monorepo#14886 (draft), which bumps the package once this is released.