feat: Plausible-Event Photo Uploaded für Logbuch und Crew

Trackt Foto-Uploads in Reisetagen und Crew-Profilen mit context- und role-Properties.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-29 19:20:50 +02:00
co-authored by Cursor
parent e3aeae1966
commit a4c7fcfc6f
4 changed files with 8 additions and 2 deletions
+2
View File
@@ -455,6 +455,7 @@ export default function CrewForm({ logbookId, readOnly = false, preloadedData }:
try {
const resized = await resizeImageFile(file)
setSkipPhoto(resized)
trackPlausibleEvent(PlausibleEvents.PHOTO_UPLOADED, { context: 'crew', role: 'skipper' })
} catch (err: any) {
setSkipPhotoError(err.message || 'Failed to process image')
}
@@ -662,6 +663,7 @@ export default function CrewForm({ logbookId, readOnly = false, preloadedData }:
try {
const resized = await resizeImageFile(file)
setMemPhoto(resized)
trackPlausibleEvent(PlausibleEvents.PHOTO_UPLOADED, { context: 'crew', role: 'crew' })
} catch (err: any) {
setMemPhotoError(err.message || 'Failed to process image')
}
+3 -1
View File
@@ -5,6 +5,7 @@ import { getActiveMasterKey } from '../services/auth.js'
import { getLogbookKey } from '../services/logbookKeys.js'
import { encryptJson, decryptJson } from '../services/crypto.js'
import { syncLogbook } from '../services/sync.js'
import { PlausibleEvents, trackPlausibleEvent } from '../services/analytics.js'
import { useLiveQuery } from 'dexie-react-hooks'
import { useDialog } from './ModalDialog.tsx'
import { Camera, Trash2 } from 'lucide-react'
@@ -159,7 +160,8 @@ export default function PhotoCapture({ entryId, logbookId, readOnly = false, pre
setCaption('')
if (fileInputRef.current) fileInputRef.current.value = ''
trackPlausibleEvent(PlausibleEvents.PHOTO_UPLOADED, { context: 'logbook' })
syncLogbook(logbookId).catch((err) => console.warn('Background sync failed:', err))
} catch (err: any) {
console.error('Failed to process image:', err)