Skip to content
Open
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
4 changes: 4 additions & 0 deletions .jules/palette.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 2024-05-16 - Add Accessible Props to Icon-Only Touchables

**Learning:** When using React Native `<TouchableOpacity>` for icon-only buttons, screen readers cannot interpret their function, and small touch targets reduce usability.
**Action:** Always include `accessible={true}`, `accessibilityRole="button"`, a descriptive `accessibilityLabel` using `t()`, and a `hitSlop` prop to enlarge the touchable area for better usability and screen reader support.
9 changes: 8 additions & 1 deletion src/components/DrawerMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,14 @@ export default function DrawerMenu({ visible, onClose, onSelect }: Props) {
style={styles.headerGradient}
>
<AeroStaffLogo variant="large" monochrome />
<TouchableOpacity onPress={onClose} style={styles.closeIconBtn}>
<TouchableOpacity
onPress={onClose}
style={styles.closeIconBtn}
accessible={true}
accessibilityRole="button"
accessibilityLabel={t('close')}
hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}
>
<MaterialIcons name="close" size={20} color="rgba(255,255,255,0.7)" />
</TouchableOpacity>
</LinearGradient>
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const it = {
overlayNotepad: 'Blocco Note', overlayPhonebook: 'Rubrica', overlayPasswords: 'Password',
overlayManuals: 'Manuali DCS', overlaySettings: 'Impostazioni',
// Common
cancel: 'Annulla', save: 'Salva', delete: 'Elimina', error: 'Errore',
cancel: 'Annulla', close: 'Chiudi', save: 'Salva', delete: 'Elimina', error: 'Errore',
confirm: 'Conferma', ok: 'OK', add: 'Aggiungi',
profileTitle: 'Profili aeroporto',
profileSubtitle: 'Salva aeroporto e compagnie diverse, poi cambia profilo con un tap.',
Expand Down Expand Up @@ -192,7 +192,7 @@ const en: typeof it = {
overlayNotepad: 'Notepad', overlayPhonebook: 'Phonebook', overlayPasswords: 'Password',
overlayManuals: 'DCS Manuals', overlaySettings: 'Settings',
// Common
cancel: 'Cancel', save: 'Save', delete: 'Delete', error: 'Error',
cancel: 'Cancel', close: 'Close', save: 'Save', delete: 'Delete', error: 'Error',
confirm: 'Confirm', ok: 'OK', add: 'Add',
profileTitle: 'Airport profiles',
profileSubtitle: 'Save different airports and airline sets, then switch profiles with one tap.',
Expand Down
9 changes: 8 additions & 1 deletion src/screens/NotepadScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,14 @@ export default function NotepadScreen() {
<Text style={s.title}>{t('notepadTitle')}</Text>
</View>
<View style={s.actions}>
<TouchableOpacity onPress={clear} style={s.iconBtn}>
<TouchableOpacity
onPress={clear}
style={s.iconBtn}
accessible={true}
accessibilityRole="button"
accessibilityLabel={t('notepadClearTitle')}
hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}
>
<MaterialIcons name="delete-outline" size={22} color="#EF4444" />
</TouchableOpacity>
<TouchableOpacity
Expand Down
Loading