feat(native): Geräte-Liste informativ — Trash/Menü raus, chevron-forward → Detail

Entfernen passiert am Gerät selbst (Cooldown, win-App/Mac), nicht aus der
Liste gesteuert. Row-Pfeil öffnet nur das Info-/Detail-Sheet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
chahinebrini 2026-06-08 00:05:23 +02:00
parent db6db547ff
commit e0eb1711db

View File

@ -132,21 +132,6 @@ function MobileDeviceRow({
: null;
const releaseActive = !!releaseAt && new Date(releaseAt).getTime() > Date.now();
function confirmRemove() {
Alert.alert(
t('settings.devices_remove_title'),
t('settings.devices_remove_desc'),
[
{ text: t('common.cancel'), style: 'cancel' },
{
text: t('settings.devices_remove_confirm'),
style: 'destructive',
onPress: () => onRemove(device.id),
},
]
);
}
function confirmRequestRelease() {
Alert.alert(
t('devices.release_request_title'),
@ -301,7 +286,7 @@ function MobileDeviceRow({
</View>
</TouchableOpacity>
{device.isCurrent ? null : releaseActive ? (
{releaseActive ? (
<TouchableOpacity
onPress={confirmCancelRelease}
hitSlop={8}
@ -318,12 +303,14 @@ function MobileDeviceRow({
<Ionicons name="lock-open-outline" size={18} color={colors.error} />
</TouchableOpacity>
) : (
// Entfernen passiert am Gerät selbst (Cooldown), nicht aus der Liste —
// Pfeil öffnet nur das Info-/Detail-Sheet.
<TouchableOpacity
onPress={confirmRemove}
onPress={openDetail}
hitSlop={8}
activeOpacity={0.5}
>
<Ionicons name="trash-outline" size={18} color={colors.error} />
<Ionicons name="chevron-forward" size={18} color={colors.textMuted} />
</TouchableOpacity>
)}
</View>
@ -367,31 +354,6 @@ function ProtectedDeviceRow({
});
}
const menuActions = device.status === 'pending'
? [
{ id: 'remove', title: t('settings.devices_remove_confirm'), attributes: { destructive: true } },
]
: [
{ id: 'remove', title: t('settings.devices_remove_confirm'), attributes: { destructive: true } },
];
function handleMenuSelect(id: string) {
if (id === 'remove') {
Alert.alert(
t('devices.remove_warning_title'),
t('devices.remove_warning_body'),
[
{ text: t('common.cancel'), style: 'cancel' },
{
text: t('settings.devices_remove_confirm'),
style: 'destructive',
onPress: () => onRemove(device.id),
},
]
);
}
}
return (
<View
style={{
@ -456,19 +418,10 @@ function ProtectedDeviceRow({
</View>
</TouchableOpacity>
<MenuView
title={device.label}
actions={menuActions}
onPressAction={({ nativeEvent: { event } }) => handleMenuSelect(event)}
shouldOpenOnLongPress={false}
>
<TouchableOpacity
hitSlop={8}
activeOpacity={0.5}
>
<Ionicons name="ellipsis-horizontal" size={18} color={colors.textMuted} />
</TouchableOpacity>
</MenuView>
{/* Kein Entfernen aus der Liste — Pfeil öffnet nur das Detail-Sheet. */}
<TouchableOpacity onPress={openDetail} hitSlop={8} activeOpacity={0.5}>
<Ionicons name="chevron-forward" size={18} color={colors.textMuted} />
</TouchableOpacity>
</View>
);
}