3 Commits

Author SHA1 Message Date
fb54db0619 feat: replace native alerts with custom dialog modals
All checks were successful
Luggage List Build / build-web (push) Successful in 27s
Luggage List Build / build-android (push) Successful in 9m46s
Luggage List Build / release (push) Successful in 21s
2026-04-18 15:20:25 +02:00
a93fec97dc chore: limit CI triggers and move TODOs to Gitea issues
Some checks failed
Luggage List Build / build-android (push) Has been cancelled
Luggage List Build / release (push) Has been cancelled
Luggage List Build / build-web (push) Has been cancelled
2026-04-18 15:08:45 +02:00
86976d5c26 docs: rewrite latest requested UI polish tasks
Some checks failed
Luggage List Build / release (push) Has been cancelled
Luggage List Build / build-android (push) Has been cancelled
Luggage List Build / build-web (push) Has been cancelled
2026-04-18 15:05:46 +02:00
7 changed files with 216 additions and 120 deletions

View File

@@ -3,6 +3,10 @@ on:
push:
branches:
- main
paths:
- '**/*.js'
- '**/*.json'
- '.gitea/workflows/**'
jobs:
build-android:

View File

@@ -3,6 +3,10 @@ on:
push:
branches-ignore:
- main
paths:
- '**/*.js'
- '**/*.json'
- '.gitea/workflows/**'
jobs:
validate:

60
TODO.md
View File

@@ -1,52 +1,14 @@
# TODO - Luggage List
## Stage
Improving & Fixing Bugs (V3)
This file was intentionally nuked.
## V2 Changes Requested
- [x] Trip can be selected from everywhere (global trip picker)
- [x] Fixed trip switching behavior for web by removing aggressive auto-reselect
- [x] Removed trip image crop (gallery pick without editing)
- [x] Item updates now happen in a modal
- [x] Redesigned item cards
- [x] Moved top nav to bottom and made it mobile-friendly
- [x] Removed top title block
- [x] Reworked check-up flow to yes/no checklist
- [x] “No” now opens update modal for check-up-only changes
- [x] Added optional toggle to also sync fix into trip item list
- [x] Removed JSON export feature
- [x] Improved keyboard behavior with KeyboardAvoidingView + scroll-safe forms
- [x] Full UI redesign (dark-first minimalist with accent colors)
- [x] Set new icon from `https://cdn.reversed.dev/pictures/yesnt.png`
## Validation
- [x] `npm install`
- [x] `npx expo export --platform web`
## Progress Log
- [x] V1 prototype complete and shipped
- [x] CI adjusted (no `eas init` in workflows)
- [x] V2 redesign + behavior fixes implemented
- [x] Removed legacy template src folder
- [x] Rebuilt app into modular `src/` structure (tabs/components/modals/styles/utils)
- [x] Fixed status-bar overlap with top spacing
- [x] Replaced trip date text inputs with calendar modal picker
- [x] Improved keyboard focus scrolling to focused input (not scroll-to-end)
- [x] Reworked bottom nav to real icons + labels
- [x] Clarified history as selected-trip check-up history
- [x] Increased safe top inset to avoid status-bar overlap
- [x] Added check-up stats (correct/bad/pending) and persisted per snapshot
- [x] Extra UI polish pass (spacing, cards, hierarchy)
- [x] Centered and enlarged edit/check-up modals to fully overlay nav
- [x] Fixed modal keyboard glitching (stable centered keyboard-aware layout)
- [x] Added trip view editing in modal (name/location/date/image)
- [x] Added trip archive/unarchive flow with archived section
- [x] Added item filters + bulk pack/unpack actions
## Next Improvements (Requested)
- [x] Edit trip directly in the trip view modal (name/location/dates/image)
- [x] Add archive flow for trips (hide from active list without deleting history)
- [ ] Enhance check-up modal UX (progress bar + back/skip controls)
- [x] Add bulk item actions and filters (pack all/unpack all + status/category chips)
- [ ] Add image optimization controls before save (compress/crop)
- [ ] Add JSON export/import backup + restore flow
All pending tasks now live as Gitea issues:
- https://gitea.reversed.dev/space/luggage-list/issues/1
- https://gitea.reversed.dev/space/luggage-list/issues/2
- https://gitea.reversed.dev/space/luggage-list/issues/3
- https://gitea.reversed.dev/space/luggage-list/issues/4
- https://gitea.reversed.dev/space/luggage-list/issues/5
- https://gitea.reversed.dev/space/luggage-list/issues/6
- https://gitea.reversed.dev/space/luggage-list/issues/7
- https://gitea.reversed.dev/space/luggage-list/issues/8
- https://gitea.reversed.dev/space/luggage-list/issues/9

View File

@@ -1,11 +1,12 @@
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { Alert, KeyboardAvoidingView, Platform, SafeAreaView, ScrollView, StatusBar as RNStatusBar, Text, View } from 'react-native';
import { KeyboardAvoidingView, Platform, SafeAreaView, ScrollView, StatusBar as RNStatusBar, Text, View } from 'react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
import * as ImagePicker from 'expo-image-picker';
import { StatusBar } from 'expo-status-bar';
import BottomTab from './components/BottomTab';
import TripPicker from './components/TripPicker';
import DatePickerModal from './components/DatePickerModal';
import AppDialogModal from './components/AppDialogModal';
import ItemModal from './modals/ItemModal';
import CheckupFlowModal from './modals/CheckupFlowModal';
import TripsTab from './tabs/TripsTab';
@@ -80,6 +81,7 @@ export default function AppRoot() {
const [checkupNoForm, setCheckupNoForm] = useState(emptyCheckupNoForm());
const [selectedCheckupId, setSelectedCheckupId] = useState(null);
const [dialogState, setDialogState] = useState({ visible: false, title: '', message: '', buttons: [] });
const topInset = Platform.OS === 'android' ? (RNStatusBar.currentHeight || 0) + 10 : 0;
@@ -116,6 +118,38 @@ export default function AppRoot() {
return checkupSession[checkupFlowIndex] || null;
}, [checkupFlowVisible, checkupFlowIndex, checkupSession]);
function closeDialog() {
setDialogState((prev) => ({ ...prev, visible: false }));
}
function showAlert(title, message) {
setDialogState({
visible: true,
title,
message,
buttons: [{ text: 'OK', tone: 'primary', onPress: closeDialog }],
});
}
function showConfirm({ title, message, confirmText = 'Confirm', onConfirm, tone = 'danger' }) {
setDialogState({
visible: true,
title,
message,
buttons: [
{ text: 'Cancel', tone: 'neutral', onPress: closeDialog },
{
text: confirmText,
tone,
onPress: () => {
closeDialog();
if (typeof onConfirm === 'function') onConfirm();
},
},
],
});
}
useEffect(() => {
(async () => {
try {
@@ -125,7 +159,7 @@ export default function AppRoot() {
setData({ ...emptyData, ...parsed });
}
} catch {
Alert.alert('Error', 'Could not load local data.');
showAlert('Error', 'Could not load local data.');
} finally {
setLoaded(true);
}
@@ -135,7 +169,7 @@ export default function AppRoot() {
useEffect(() => {
if (!loaded) return;
AsyncStorage.setItem(STORAGE_KEY, JSON.stringify(data)).catch(() => {
Alert.alert('Error', 'Could not save local data.');
showAlert('Error', 'Could not save local data.');
});
}, [data, loaded]);
@@ -180,7 +214,7 @@ export default function AppRoot() {
async function pickImage(onPicked) {
const perm = await ImagePicker.requestMediaLibraryPermissionsAsync();
if (!perm.granted) {
Alert.alert('Permission needed', 'Allow gallery access to select images.');
showAlert('Permission needed', 'Allow gallery access to select images.');
return;
}
@@ -198,7 +232,7 @@ export default function AppRoot() {
async function takeImage(onPicked) {
const perm = await ImagePicker.requestCameraPermissionsAsync();
if (!perm.granted) {
Alert.alert('Permission needed', 'Allow camera access to take photos.');
showAlert('Permission needed', 'Allow camera access to take photos.');
return;
}
@@ -214,7 +248,7 @@ export default function AppRoot() {
function createTrip() {
if (!tripForm.name.trim()) {
Alert.alert('Missing name', 'Trip name is required.');
showAlert('Missing name', 'Trip name is required.');
return false;
}
@@ -222,12 +256,12 @@ export default function AppRoot() {
const end = parseYMD(tripForm.endDate);
if (!start || !end) {
Alert.alert('Invalid dates', 'Please select valid trip dates.');
showAlert('Invalid dates', 'Please select valid trip dates.');
return false;
}
if (start > end) {
Alert.alert('Invalid dates', 'Start date cannot be after end date.');
showAlert('Invalid dates', 'Start date cannot be after end date.');
return false;
}
@@ -283,7 +317,7 @@ export default function AppRoot() {
function saveTripEdits(tripId, patch) {
if (!patch.name.trim()) {
Alert.alert('Missing name', 'Trip name is required.');
showAlert('Missing name', 'Trip name is required.');
return false;
}
@@ -291,12 +325,12 @@ export default function AppRoot() {
const end = parseYMD(patch.endDate);
if (!start || !end) {
Alert.alert('Invalid dates', 'Please select valid trip dates.');
showAlert('Invalid dates', 'Please select valid trip dates.');
return false;
}
if (start > end) {
Alert.alert('Invalid dates', 'Start date cannot be after end date.');
showAlert('Invalid dates', 'Start date cannot be after end date.');
return false;
}
@@ -338,12 +372,12 @@ export default function AppRoot() {
}
function deleteTrip(tripId) {
Alert.alert('Delete trip?', 'Trip items and check-up history will also be deleted.', [
{ text: 'Cancel', style: 'cancel' },
{
text: 'Delete',
style: 'destructive',
onPress: () => {
showConfirm({
title: 'Delete trip?',
message: 'Trip items and check-up history will also be deleted.',
confirmText: 'Delete',
tone: 'danger',
onConfirm: () => {
setData((prev) => {
const trips = prev.trips.filter((trip) => trip.id !== tripId);
const itemsByTrip = { ...prev.itemsByTrip };
@@ -360,8 +394,7 @@ export default function AppRoot() {
};
});
},
},
]);
});
}
function openAddItemModal() {
@@ -385,12 +418,12 @@ export default function AppRoot() {
function saveItemFromModal() {
if (!selectedTripId) {
Alert.alert('No trip selected', 'Please select or create a trip first.');
showAlert('No trip selected', 'Please select or create a trip first.');
return;
}
if (!itemForm.name.trim()) {
Alert.alert('Missing name', 'Item name is required.');
showAlert('Missing name', 'Item name is required.');
return;
}
@@ -491,6 +524,13 @@ export default function AppRoot() {
function deleteCheckup(checkupId) {
if (!selectedTripId) return;
showConfirm({
title: 'Delete check-up?',
message: 'This snapshot will be removed from history.',
confirmText: 'Delete',
tone: 'danger',
onConfirm: () => {
setData((prev) => {
const existing = prev.checkupsByTrip[selectedTripId] || [];
return {
@@ -502,6 +542,8 @@ export default function AppRoot() {
};
});
setSelectedCheckupId((prev) => (prev === checkupId ? null : prev));
},
});
}
function createFreshCheckupSession() {
@@ -514,11 +556,11 @@ export default function AppRoot() {
function startCheckupFlow() {
if (!selectedTripId) {
Alert.alert('No trip selected', 'Please select a trip first.');
showAlert('No trip selected', 'Please select a trip first.');
return;
}
if (!selectedTripItems.length) {
Alert.alert('No items', 'Add items before starting a check-up.');
showAlert('No items', 'Add items before starting a check-up.');
return;
}
@@ -615,18 +657,18 @@ export default function AppRoot() {
function saveCheckupSnapshot(sessionToSave) {
if (!selectedTripId) {
Alert.alert('No trip selected', 'Please select a trip first.');
showAlert('No trip selected', 'Please select a trip first.');
return false;
}
if (!sessionToSave.length) {
Alert.alert('No items', 'Add items before creating a check-up.');
showAlert('No items', 'Add items before creating a check-up.');
return false;
}
const pending = sessionToSave.filter((entry) => !entry.confirmed).length;
if (pending > 0) {
Alert.alert('Incomplete', `Please confirm all items first (${pending} remaining).`);
showAlert('Incomplete', `Please confirm all items first (${pending} remaining).`);
return false;
}
@@ -669,7 +711,7 @@ export default function AppRoot() {
const ok = saveCheckupSnapshot(checkupSession);
if (!ok) return;
Alert.alert('Saved', 'Check-up snapshot saved.');
showAlert('Saved', 'Check-up snapshot saved.');
closeCheckupFlow();
createFreshCheckupSession();
}
@@ -809,6 +851,14 @@ export default function AppRoot() {
onSaveNo={saveCurrentCheckupNo}
onFinish={finishCheckupFlow}
/>
<AppDialogModal
visible={dialogState.visible}
title={dialogState.title}
message={dialogState.message}
buttons={dialogState.buttons}
onClose={closeDialog}
/>
</SafeAreaView>
);
}

View File

@@ -0,0 +1,40 @@
import React from 'react';
import { Modal, Pressable, Text, View } from 'react-native';
import { styles } from '../styles';
export default function AppDialogModal({ visible, title, message, buttons = [], onClose }) {
if (!visible) return null;
const safeButtons = buttons.length ? buttons : [{ text: 'OK' }];
return (
<Modal visible={visible} transparent animationType="fade" onRequestClose={onClose}>
<View style={styles.dialogBackdrop}>
<View style={styles.dialogCard}>
<Text style={styles.dialogTitle}>{title || 'Notice'}</Text>
{!!message ? <Text style={styles.dialogMessage}>{message}</Text> : null}
<View style={styles.dialogButtonsRow}>
{safeButtons.map((button, idx) => {
const tone = button.tone || (button.style === 'destructive' ? 'danger' : button.style === 'cancel' ? 'neutral' : 'primary');
return (
<Pressable
key={`${button.text}-${idx}`}
style={[
styles.dialogBtn,
tone === 'primary' ? styles.dialogBtnPrimary : null,
tone === 'danger' ? styles.dialogBtnDanger : null,
tone === 'neutral' ? styles.dialogBtnNeutral : null,
]}
onPress={button.onPress}
>
<Text style={styles.dialogBtnText}>{button.text || 'OK'}</Text>
</Pressable>
);
})}
</View>
</View>
</View>
</Modal>
);
}

View File

@@ -484,6 +484,59 @@ export const styles = StyleSheet.create({
backgroundColor: 'rgba(2,6,23,0.72)',
paddingHorizontal: 12,
},
dialogBackdrop: {
flex: 1,
backgroundColor: 'rgba(2,6,23,0.72)',
alignItems: 'center',
justifyContent: 'center',
paddingHorizontal: 18,
},
dialogCard: {
width: '100%',
backgroundColor: '#0f172a',
borderRadius: 16,
borderWidth: 1,
borderColor: '#1e293b',
padding: 14,
gap: 12,
},
dialogTitle: {
color: '#f8fafc',
fontWeight: '700',
fontSize: 17,
},
dialogMessage: {
color: '#cbd5e1',
lineHeight: 20,
},
dialogButtonsRow: {
flexDirection: 'row',
gap: 8,
justifyContent: 'flex-end',
flexWrap: 'wrap',
},
dialogBtn: {
borderRadius: 10,
paddingVertical: 9,
paddingHorizontal: 14,
borderWidth: 1,
},
dialogBtnPrimary: {
backgroundColor: '#2563eb',
borderColor: '#2563eb',
},
dialogBtnDanger: {
backgroundColor: '#7f1d1d',
borderColor: '#991b1b',
},
dialogBtnNeutral: {
backgroundColor: '#1e293b',
borderColor: '#334155',
},
dialogBtnText: {
color: '#f8fafc',
fontWeight: '700',
},
modalKeyboardWrap: {
flex: 1,
width: '100%',

View File

@@ -1,25 +1,8 @@
import React from 'react';
import { Alert, Pressable, Text, View } from 'react-native';
import { Pressable, Text, View } from 'react-native';
import { styles } from '../styles';
export default function HistoryTab({
selectedTrip,
selectedTripCheckups,
selectedCheckupId,
setSelectedCheckupId,
onDeleteCheckup,
}) {
function askDelete(checkup) {
Alert.alert('Delete check-up?', 'This snapshot will be removed from history.', [
{ text: 'Cancel', style: 'cancel' },
{
text: 'Delete',
style: 'destructive',
onPress: () => onDeleteCheckup(checkup.id),
},
]);
}
export default function HistoryTab({ selectedTrip, selectedTripCheckups, selectedCheckupId, setSelectedCheckupId, onDeleteCheckup }) {
return (
<View style={styles.section}>
<Text style={styles.sectionTitle}>History</Text>
@@ -32,7 +15,7 @@ export default function HistoryTab({
<View key={checkup.id} style={styles.cardSoft}>
<Pressable
onPress={() => setSelectedCheckupId((prev) => (prev === checkup.id ? null : checkup.id))}
onLongPress={() => askDelete(checkup)}
onLongPress={() => onDeleteCheckup(checkup.id)}
delayLongPress={280}
>
<Text style={styles.cardTitle}>{new Date(checkup.createdAt).toLocaleString()}</Text>