diff --git a/.github/pr-screenshots/2366-android-menu/phone/drawer-menu-dark.png b/.github/pr-screenshots/2366-android-menu/phone/drawer-menu-dark.png new file mode 100644 index 0000000000..aa5679c23b Binary files /dev/null and b/.github/pr-screenshots/2366-android-menu/phone/drawer-menu-dark.png differ diff --git a/.github/pr-screenshots/2366-android-menu/phone/drawer-menu-font.png b/.github/pr-screenshots/2366-android-menu/phone/drawer-menu-font.png new file mode 100644 index 0000000000..79ae3df9ad Binary files /dev/null and b/.github/pr-screenshots/2366-android-menu/phone/drawer-menu-font.png differ diff --git a/.github/pr-screenshots/2366-android-menu/phone/drawer-menu-light.png b/.github/pr-screenshots/2366-android-menu/phone/drawer-menu-light.png new file mode 100644 index 0000000000..61937767e9 Binary files /dev/null and b/.github/pr-screenshots/2366-android-menu/phone/drawer-menu-light.png differ diff --git a/.github/pr-screenshots/2366-android-menu/phone/group-member-menu-dark.png b/.github/pr-screenshots/2366-android-menu/phone/group-member-menu-dark.png new file mode 100644 index 0000000000..bdc107e687 Binary files /dev/null and b/.github/pr-screenshots/2366-android-menu/phone/group-member-menu-dark.png differ diff --git a/.github/pr-screenshots/2366-android-menu/phone/group-member-menu-font.png b/.github/pr-screenshots/2366-android-menu/phone/group-member-menu-font.png new file mode 100644 index 0000000000..33b703550d Binary files /dev/null and b/.github/pr-screenshots/2366-android-menu/phone/group-member-menu-font.png differ diff --git a/.github/pr-screenshots/2366-android-menu/phone/group-member-menu-light.png b/.github/pr-screenshots/2366-android-menu/phone/group-member-menu-light.png new file mode 100644 index 0000000000..36297dc751 Binary files /dev/null and b/.github/pr-screenshots/2366-android-menu/phone/group-member-menu-light.png differ diff --git a/apps/mobile/src/ui/primitives/action-menu-button.android.tsx b/apps/mobile/src/ui/primitives/action-menu-button.android.tsx index 4902c45afd..6dcefa14e9 100644 --- a/apps/mobile/src/ui/primitives/action-menu-button.android.tsx +++ b/apps/mobile/src/ui/primitives/action-menu-button.android.tsx @@ -22,28 +22,6 @@ export function ActionMenuButton({ label, actions }: ActionMenuButtonProps) { const [open, setOpen] = useState(false); return ( - setOpen(true)} - accessibilityRole="button" - accessibilityLabel={label} - accessibilityState={{ expanded: open }} - hitSlop={space.x2} - android_ripple={{ - borderless: true, - radius: theme.touch / 2, - color: theme.layer.sheet.pressed, - }} - style={{ - width: theme.touch, - height: theme.touch, - borderRadius: radius.round, - alignItems: 'center', - justifyContent: 'center', - }} - > - - + setOpen(true)} + accessibilityRole="button" + accessibilityLabel={label} + accessibilityState={{ expanded: open }} + hitSlop={space.x2} + android_ripple={{ + borderless: true, + radius: theme.touch / 2, + color: theme.layer.sheet.pressed, + }} + style={{ + width: theme.touch, + height: theme.touch, + borderRadius: radius.round, + alignItems: 'center', + justifyContent: 'center', + }} + > + + ); } diff --git a/apps/mobile/test/action-menu-android.test.tsx b/apps/mobile/test/action-menu-android.test.tsx index 0f97f2d9bf..3c57f9dc98 100644 --- a/apps/mobile/test/action-menu-android.test.tsx +++ b/apps/mobile/test/action-menu-android.test.tsx @@ -26,7 +26,8 @@ vi.mock('@expo/ui/jetpack-compose', () => { DropdownMenu, DropdownMenuItem, HorizontalDivider: () => createElement('hr'), - Host: pass, + Host: ({ children }: { children?: ReactNode }) => + createElement('section', { 'data-compose-host': '' }, children), Text: pass, }; }); @@ -75,4 +76,23 @@ describe('Android action menu', () => { expect(customize).not.toHaveBeenCalled(); expect(menu()?.getAttribute('data-expanded')).toBe('false'); }); + + it('stacks ⋯ above the Compose host so the host never takes its taps', () => { + host = document.createElement('div'); + document.body.append(host); + root = createRoot(host); + act(() => + root?.render( + createElement(ActionMenuButton, { + label: 'More for Studio', + onOpen: () => undefined, + actions: [{ label: 'Customize', icon: 'settings', run: () => undefined }], + }), + ), + ); + const compose = host.querySelector('[data-compose-host]'); + const trigger = host.querySelector('[aria-label="More for Studio"]'); + expect(compose?.parentElement).toBe(trigger?.parentElement); + expect(compose?.nextElementSibling).toBe(trigger); + }); }); diff --git a/changes/2366-android-drawer-menu.md b/changes/2366-android-drawer-menu.md new file mode 100644 index 0000000000..c71de0b0cc --- /dev/null +++ b/changes/2366-android-drawer-menu.md @@ -0,0 +1,11 @@ +--- +section: Fixed +--- + +## en + +- On Android, the ⋯ menus in the workspace drawer and group members open again ([#2366](https://github.com/BotHarness/DeepSeekBot/pull/2366)). + +## zh + +- Android 手机端工作区抽屉和群成员的 ⋯ 菜单恢复可以打开([#2366](https://github.com/BotHarness/DeepSeekBot/pull/2366))。