Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 22 additions & 22 deletions apps/mobile/src/ui/primitives/action-menu-button.android.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,6 @@ export function ActionMenuButton({ label, actions }: ActionMenuButtonProps) {
const [open, setOpen] = useState(false);
return (
<View style={{ width: theme.touch, height: theme.touch }}>
<Pressable
testID="action-menu-trigger"
onPress={() => 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',
}}
>
<MoreIcon color={theme.color.muted} size={theme.type.title.size + space.x2} />
</Pressable>
<Host
colorScheme={theme.scheme}
seedColor={theme.color.accent}
Expand Down Expand Up @@ -76,6 +54,28 @@ export function ActionMenuButton({ label, actions }: ActionMenuButtonProps) {
</DropdownMenu.Items>
</DropdownMenu>
</Host>
<Pressable
testID="action-menu-trigger"
onPress={() => 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',
}}
>
<MoreIcon color={theme.color.muted} size={theme.type.title.size + space.x2} />
</Pressable>
</View>
);
}
22 changes: 21 additions & 1 deletion apps/mobile/test/action-menu-android.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
});
Expand Down Expand Up @@ -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);
});
});
11 changes: 11 additions & 0 deletions changes/2366-android-drawer-menu.md
Original file line number Diff line number Diff line change
@@ -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))。
Loading