Repository navigation
feat(native): a long press opens a row's menu as the system's - #489
Conversation
`Menu.longPressMenu` puts a menu's own entries on an element as the iOS `context-menu` island, so a long press opens the same menu its "⋯" trigger does and the choice comes back as the same `ChoseFromNativeMenu`. Sidebar channel and DM rows get it; message rows move onto the same items (`nativeMenuItems`, their entries now carrying their words) with their quick reactions above. The host builds the menu with the `menu` island's builder, and a press on nested regions opens the innermost. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…land does Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
This comment has been minimized.
This comment has been minimized.
| childAttributes( | ||
| nativeContextMenu( | ||
| h, | ||
| { items: found, quick: { choices: TOP_EMOJIS, prefix: Overlays.NATIVE_REACTION } }, |
There was a problem hiding this comment.
Warning
Message row's new context-menu props shape is pinned by no test
F1 · Warning · tests
The row's island props change from {reactions, reactionPrefix, groups} to {items, quick} — a contract with context_menu.rs:163 that no test pins on either side; menu-long-press.scene.test.ts only exercises longPressMenu on a synthetic view. A mismatch between the two renders an empty system menu and nothing fails.
Add a scene test over `rowLongPress` (or a rendered message row) asserting `data-native-props` carries `items` and `quick.choices`/`quick.prefix`.
🤖 Prompt to fix with an AI agent
In `apps/web-foldkit/src/page/chat/row-context.ts:181`: Message row's new `context-menu` props shape is pinned by no test.
The row's island props change from `{reactions, reactionPrefix, groups}` to `{items, quick}` — a contract with `context_menu.rs:163` that no test pins on either side; `menu-long-press.scene.test.ts` only exercises `longPressMenu` on a synthetic view. A mismatch between the two renders an empty system menu and nothing fails.
Suggested fix: Add a scene test over `rowLongPress` (or a rendered message row) asserting `data-native-props` carries `items` and `quick.choices`/`quick.prefix`.
Verify the problem exists at that location before changing it, and keep the fix to those lines.
There was a problem hiding this comment.
Fixed in 9baf011: messages.scene.test.ts now renders the channel and pins both rows' exact data-native-props (own and other's message: items with words, symbols and destructive, quick.choices/quick.prefix) plus the row's change handler. I checked it fails if the shape drifts (renaming quick breaks it).
…ract Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| ), | ||
| }), | ||
| rowMenuView(h, menu), | ||
| rowLongPress(h, menu), |
There was a problem hiding this comment.
Warning
Sidebar rows' long-press menus are wired by no test
F2 · Warning · tests
rowLongPress/dmLongPress reach the rows only through positional args of channelItem/dmItem, and no test pins that a sidebar row carries the island. One rowMenuEntries leaf losing its textValue makes nativeMenuItems return None, so a sidebar row's menu silently disappears on iOS with every test green; only the message row is pinned.
Render the sidebar in a scene test and assert a channel row and a DM row each carry `data-native="context-menu"` with their entries' words (Mute, Favorite, Move to section, Settings, Leave / Hide conversation).
🤖 Prompt to fix with an AI agent
In `apps/web-foldkit/src/shell/channels-sidebar/view.ts:151`: Sidebar rows' long-press menus are wired by no test.
`rowLongPress`/`dmLongPress` reach the rows only through positional args of `channelItem`/`dmItem`, and no test pins that a sidebar row carries the island. One `rowMenuEntries` leaf losing its `textValue` makes `nativeMenuItems` return `None`, so a sidebar row's menu silently disappears on iOS with every test green; only the message row is pinned.
Suggested fix: Render the sidebar in a scene test and assert a channel row and a DM row each carry `data-native="context-menu"` with their entries' words (Mute, Favorite, Move to section, Settings, Leave / Hide conversation).
Verify the problem exists at that location before changing it, and keep the fix to those lines.
There was a problem hiding this comment.
Fixed in 210f1dd: shell/channels-sidebar/long-press.scene.test.ts renders the sidebar's sections with a channel and a DM row and pins each row's exact context-menu props (Mute, Favorite, Settings, Leave / Hide conversation, with symbols and danger), plus that the dots' menu island carries the identical items. Checked it fails when a row entry loses its textValue.
…e items as their dots Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Maple review🟢 Confidence 10/10 · safe to merge. Only the sidebar scene test changed since the last pass; it asserts the props the code actually emits at this head. A long press on a sidebar or message row now opens the row's own menu as the iOS system menu, built from the same entries its "⋯" trigger uses. The one file new since the last pass is the sidebar scene test, and it holds.
Before merge
|
|
Merged with 1 step from "Before merge" still open. If it is done, tick it on the review comment; if not, now is the time.
|
Stacked on #488. Merge that first.
A long press on a row opens the row's own menu as the iOS system menu.
The abstraction:
Menu.longPressMenu(h, { menu, entries, native, toParentMessage })inui/menu-view.ts. It takes the same Menu model and entries a "⋯" trigger opens and emits thecontext-menuisland. The choice comes back as the sameChoseFromNativeMenu, so a feature handles one path whatever the trigger was. It adds nothing when the entries aren't all words, and nothing in a browser. Underneath it,nativeContextMenu(platform/native-island.ts) takes themenuisland'sNativeMenuItemlist plus an optionalquickrow.Uses
rowMenu,dmMenu) and shared by the dots button and the long press. That gives Mute, Favorite, the Move to section submenu, Settings, and Delete/Leave in red.contextMenuEntriesnow carries its words (textValue, which also gives the web menu typeahead), and the separate label/group builder is deleted. Quick reactions stay on top.host/ios/src/context_menu.rs): builds the menu with themenuisland's own builder, so submenus, checked, disabled and destructive items all work. When regions are nested, the innermost one under the finger wins.Verification
bun run typecheckpasses, and the full web-foldkit suite passes: 2644 tests, includingui/menu-long-press.scene.test.ts(a row carries its entries, words and symbols; a choice goes through the menu's own update; a menu without words gets nothing). The native suites andcargo test --libalso pass.GotRowMenuMessage/ChoseFromNativeMenu, thenchannelMember.update.ChoseNativeAction, thenmessageReaction.toggle.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit