diff --git a/client/src/App.css b/client/src/App.css index 14a4f21..6144852 100644 --- a/client/src/App.css +++ b/client/src/App.css @@ -3311,6 +3311,13 @@ html.theme-cupertino .events-scroll-container { font-size: 17px; } +.live-log-modal-hint { + margin: -8px 0 12px; + font-size: 13px; + color: var(--app-text-muted); + line-height: 1.4; +} + .live-log-sail-pills { margin-bottom: 16px; } diff --git a/client/src/components/LiveLogView.tsx b/client/src/components/LiveLogView.tsx index 7241fd7..8ab52a1 100644 --- a/client/src/components/LiveLogView.tsx +++ b/client/src/components/LiveLogView.tsx @@ -10,6 +10,7 @@ import { Droplets, FileText, Fuel, + Gauge, MapPin, MessageSquare, Radio, @@ -38,6 +39,8 @@ import { liveFuelRemark, livePrecipRemark, liveSailsRemark, + liveSogRemark, + liveStwRemark, liveTempRemark, liveWaterRemark } from '../utils/liveEventCodes.js' @@ -63,6 +66,8 @@ type LiveModal = | 'course' | 'fuel' | 'water' + | 'sog' + | 'stw' const AUTO_POSITION_INTERVAL_MS = 3 * 60 * 60 * 1000 const AUTO_POSITION_CHECK_MS = 60_000 @@ -235,6 +240,17 @@ export default function LiveLogView({ setModal(type) } + const openSogModal = async () => { + let prefill = '' + try { + const pos = await getCurrentPosition() + if (pos.speedKn != null) prefill = String(pos.speedKn) + } catch { + // Manual entry when GPS speed unavailable + } + openValueModal('sog', prefill) + } + const handleMotorToggle = () => { hapticPulse() void runQuickAction(async () => { @@ -405,6 +421,28 @@ export default function LiveLogView({ }, 'live_water') break } + case 'sog': { + const speedKn = parseFloat(primary.replace(',', '.')) + if (!Number.isFinite(speedKn) || speedKn < 0) return + setModal('none') + void runQuickAction(async () => { + await appendQuickEvent(logbookId, entryId, { + remarks: liveSogRemark(String(speedKn)) + }) + }, 'live_sog') + break + } + case 'stw': { + const speedKn = parseFloat(primary.replace(',', '.')) + if (!Number.isFinite(speedKn) || speedKn < 0) return + setModal('none') + void runQuickAction(async () => { + await appendQuickEvent(logbookId, entryId, { + remarks: liveStwRemark(String(speedKn)) + }) + }, 'live_stw') + break + } default: break } @@ -479,6 +517,14 @@ export default function LiveLogView({ {t('logs.live_course_btn')} + +