feat: add trip deletion and adjust CI/CD workflows for luggage-list
Some checks failed
Luggage List Build / release (push) Has been cancelled
Luggage List Build / build-android (push) Has started running
Luggage List Build / build-web (push) Has been cancelled

This commit is contained in:
2026-04-18 11:54:03 +02:00
parent 7de77d2878
commit 3de75b2f4d
5 changed files with 62 additions and 24 deletions

View File

@@ -1,4 +1,4 @@
name: Build App name: Luggage List Build
on: on:
push: push:
branches: branches:
@@ -49,13 +49,13 @@ jobs:
--profile=preview --profile=preview
- name: 📝 Rename build to APK - name: 📝 Rename build to APK
run: mv app-build app-release.apk run: mv app-build luggage-list-release.apk
- name: 📤 Upload build artifact - name: 📤 Upload build artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: android-preview-build name: luggage-list-android-preview-build
path: app-release.apk path: luggage-list-release.apk
if-no-files-found: error if-no-files-found: error
build-web: build-web:
@@ -88,13 +88,13 @@ jobs:
run: npx expo export --platform web run: npx expo export --platform web
- name: 📦 Zip dist - name: 📦 Zip dist
run: cd dist && zip -r ../dist.zip . run: cd dist && zip -r ../luggage-list-dist.zip .
- name: 📤 Upload build artifact - name: 📤 Upload build artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: web-build name: luggage-list-web-build
path: dist.zip path: luggage-list-dist.zip
if-no-files-found: error if-no-files-found: error
release: release:
@@ -107,16 +107,16 @@ jobs:
- name: 📥 Download Android artifact - name: 📥 Download Android artifact
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: android-preview-build name: luggage-list-android-preview-build
- name: 📥 Download Web artifact - name: 📥 Download Web artifact
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: web-build name: luggage-list-web-build
- name: 🏷 Create tag - name: 🏷 Create tag
run: | run: |
TAG="build-$(git rev-parse --short HEAD)" TAG="luggage-list-build-$(git rev-parse --short HEAD)"
git tag "$TAG" git tag "$TAG"
git push origin "$TAG" git push origin "$TAG"
echo "RELEASE_TAG=$TAG" >> $GITHUB_ENV echo "RELEASE_TAG=$TAG" >> $GITHUB_ENV
@@ -127,8 +127,8 @@ jobs:
tag_name: ${{ env.RELEASE_TAG }} tag_name: ${{ env.RELEASE_TAG }}
name: ${{ env.RELEASE_TAG }} name: ${{ env.RELEASE_TAG }}
files: | files: |
app-release.apk luggage-list-release.apk
dist.zip luggage-list-dist.zip
generate_release_notes: true generate_release_notes: true
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,4 +1,4 @@
name: Dev Branch Check name: Luggage List Dev Branch Check
on: on:
push: push:
branches-ignore: branches-ignore:
@@ -24,5 +24,5 @@ jobs:
- name: 📦 Install dependencies - name: 📦 Install dependencies
run: pnpm install run: pnpm install
- name: 🧪 Check for linting/type errors - name: 🧪 Web export smoke check
run: npx expo export --platform web run: npx expo export --platform web

View File

@@ -1,4 +1,4 @@
name: Manual APK Build name: Luggage List Manual APK Build
on: on:
workflow_dispatch: workflow_dispatch:
@@ -47,11 +47,11 @@ jobs:
--profile=preview --profile=preview
- name: 📝 Rename build to APK - name: 📝 Rename build to APK
run: mv app-build time-until-manual.apk run: mv app-build luggage-list-manual.apk
- name: 📤 Upload build artifact - name: 📤 Upload build artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: manual-apk-build name: luggage-list-manual-apk-build
path: time-until-manual.apk path: luggage-list-manual.apk
if-no-files-found: error if-no-files-found: error

38
App.js
View File

@@ -292,6 +292,33 @@ export default function App() {
setData((prev) => ({ ...prev, defaultTemplateTripId: tripId })); setData((prev) => ({ ...prev, defaultTemplateTripId: tripId }));
} }
function deleteTrip(tripId) {
Alert.alert('Delete trip?', 'This removes the trip, its items, and its check-up history.', [
{ text: 'Cancel', style: 'cancel' },
{
text: 'Delete',
style: 'destructive',
onPress: () => {
setData((prev) => {
const nextTrips = prev.trips.filter((trip) => trip.id !== tripId);
const nextItemsByTrip = { ...prev.itemsByTrip };
const nextCheckupsByTrip = { ...prev.checkupsByTrip };
delete nextItemsByTrip[tripId];
delete nextCheckupsByTrip[tripId];
return {
...prev,
trips: nextTrips,
itemsByTrip: nextItemsByTrip,
checkupsByTrip: nextCheckupsByTrip,
defaultTemplateTripId: prev.defaultTemplateTripId === tripId ? null : prev.defaultTemplateTripId,
};
});
},
},
]);
}
function saveItem() { function saveItem() {
if (!selectedTripId) { if (!selectedTripId) {
Alert.alert('No trip', 'Create or select a trip first.'); Alert.alert('No trip', 'Create or select a trip first.');
@@ -629,9 +656,14 @@ export default function App() {
{data.defaultTemplateTripId === trip.id ? ' • Template' : ''} {data.defaultTemplateTripId === trip.id ? ' • Template' : ''}
</Text> </Text>
</Pressable> </Pressable>
<Pressable style={styles.smallActionBtn} onPress={() => setTripAsTemplate(trip.id)}> <View style={styles.itemActionsColumn}>
<Text style={styles.smallActionBtnText}>Template</Text> <Pressable style={styles.smallActionBtn} onPress={() => setTripAsTemplate(trip.id)}>
</Pressable> <Text style={styles.smallActionBtnText}>Template</Text>
</Pressable>
<Pressable style={styles.smallActionBtn} onPress={() => deleteTrip(trip.id)}>
<Text style={styles.smallActionBtnText}>Delete</Text>
</Pressable>
</View>
</View> </View>
))} ))}
</Card> </Card>

10
TODO.md
View File

@@ -19,6 +19,12 @@
- [x] Default luggage list template (copy into new trip) - [x] Default luggage list template (copy into new trip)
## Remaining ## Remaining
- [ ] Adjust CI/CD workflow naming and artifact naming for this project - [x] Adjust CI/CD workflow naming and artifact naming for this project
- [ ] Validate app builds (web export smoke check) - [x] Validate app builds (web export smoke check)
- [ ] Polish README and commit final notes - [ ] Polish README and commit final notes
## Progress Log
- [x] Initial MVP scaffold and all requested core features implemented
- [x] Added trip deletion flow and confirmation
- [x] Updated Gitea workflows/artifacts naming for Luggage List
- [x] Ran local web export smoke checks successfully