Skip to content

Add mission and vehicle path history odometer#2676

Open
ArturoManzoli wants to merge 7 commits into
bluerobotics:masterfrom
ArturoManzoli:add-mission-odometer
Open

Add mission and vehicle path history odometer#2676
ArturoManzoli wants to merge 7 commits into
bluerobotics:masterfrom
ArturoManzoli:add-mission-odometer

Conversation

@ArturoManzoli

Copy link
Copy Markdown
Contributor
  • Mission and vehicle path history odometers;
  • Can be accessed by the Mission control Panel widget (1), clicking or hovering the WP number on the Mini Mission Control Panel mini widget (2) or hovering/clicking the vehicle history line on the map.
  • Mission history can be reset on the
image image image

Close #2675

@github-actions

Copy link
Copy Markdown

Automated PR Review (Claude)

0. Summary

Verdict: MINOR SUGGESTIONS

Minor items to consider: 1.1, 1.2, 1.3, 4.1, 6.1

This PR adds an odometer feature that tracks total vehicle traveled distance and per-mission traveled distance. The distances are displayed in three places: the Mission Control Panel widget, the Mini Mission Control Panel mini-widget (via a hover/click popup on the WP number), and a Leaflet tooltip on the vehicle history polyline in the Map widget. A new formatDistance utility handles unit conversion (meters/km and feet/mi). The store accumulates distance incrementally using Haversine/turf calculations and resyncs after simplification.


1. Correctness & Implementation Bugs

1.1 majorTooltip content not reactive on initial bind.
In Map.vue, attachHistoryTooltip calls polyline.bindTooltip(historyTooltipContent.value, ...) — this passes the current string value at bind time. The watch(historyTooltipContent, ...) later updates the tooltip via setContent. However, if the polyline is created in onMounted (line ~873 in the diff), the historyTooltipContent computed is evaluated before any position data flows. The watch will update it later, so this is functionally okay except that the tooltip will briefly display stale "0" values. This is minor but worth noting. More importantly, if vehicleHistoryPolyline.value is destroyed and recreated (the watcher sets it to undefined and re-creates it when the history goes from empty to populated), the new polyline gets attachHistoryTooltip called, but the watch(historyTooltipContent, ...) still references vehicleHistoryPolyline.value, so this should still work. Acceptable.

1.2 majorisMissionRunning includes GUIDED mode, causing odometer to accumulate during non-mission GUIDED maneuvers.
isMissionRunning is defined as mainVehicleStore.mode === 'AUTO' || mainVehicleStore.mode === 'GUIDED'. If the vehicle is in GUIDED mode for a GoTo command (not part of a mission), the mission odometer will still accumulate distance. The condition isMissionAccumulating = isMissionRunning.value && (mainVehicleStore.currentMissionSeq ?? 0) >= 1 partially mitigates this (seq >= 1), but currentMissionSeq may still be a nonzero stale value from a prior mission when the vehicle switches to GUIDED for a GoTo. This could cause false accumulation. Consider restricting mission accumulation to mode === 'AUTO' only, or adding additional state checks.

1.3 minortotalTraveledDistanceMeters reseeded on every store instantiation.
Line totalTraveledDistanceMeters.value = polylineLengthMeters(vehiclePositionHistory.value) runs at store creation time, unconditionally overwriting the persisted value with the length of the persisted position history. After simplification, the polyline is shorter than the actual path traveled (RDP removes intermediate points), so the reseeded total will be less than the actual accumulated distance. This means after a page reload, the total distance will "jump down" because the simplified polyline underestimates the true path length. The incremental accumulation (+= segmentLengthMeters(...)) is the accurate approach; reseeding from the simplified polyline on startup undermines that accuracy. Consider persisting the total as-is and trusting it across reloads, or documenting this as intentional behavior.


2. AGENTS.md Adherence

2.1 minorJSDoc: resetMissionDistance in mission.ts has no JSDoc.
Per AGENTS.md rule 4 ("Keeps JSDocs updated"), all function declarations should have JSDoc. The new resetMissionDistance function (and implicitly segmentLengthMeters/polylineLengthMeters which do have JSDoc — good) lacks a JSDoc comment in the store.

2.2 nitComment policy: the comment // Reseed the total odometer from the persisted history explains "what" not "why".
Per AGENTS.md: "No new comments unless explaining 'why', never 'what'". A "why" comment would explain the rationale (e.g., why reseeding is necessary despite persisting the value).

2.3 nitLocal-storage keys correctly use cockpit- prefix. The new keys cockpit-odometer-total-distance-meters and cockpit-odometer-mission-distance-meters follow the naming convention. No finding.


3. Security

3.1 No obfuscated or intentionally unreadable code found.

3.2 No suspicious base64/hex/encoded blobs or binary-like strings.

3.3 No hidden Unicode, zero-width characters, or homoglyph attacks detected.

3.4 No unexpected network calls or exfiltration patterns. All computation is local.

3.5 No changes to build scripts, CI workflows, Dockerfiles, or Electron main-process code.

3.6 No new secrets, eval, Function(), v-html on untrusted input, or weakened CORS/CSP. The HTML template string in historyTooltipContent uses only computed numeric values from the store (no user-supplied strings), passed to Leaflet's setContent which uses innerHTML internally. Since the values are formatted numbers, this is safe.

3.7 No new dependencies added. The PR reuses @turf/turf which is already in package.json.

3.8 No other suspicious patterns detected.

No findings.


4. Performance

4.1 minorpolylineLengthMeters called on potentially large arrays after simplification and on startup.
After simplification (didSimplify branch in the position watcher), polylineLengthMeters(vehiclePositionHistory.value) iterates the entire position history (which can be up to 500k points). turf.lineString + turf.length will create a GeoJSON object and compute the full polyline length. This happens inside a watch that fires on every position update (up to 5Hz). While simplification is infrequent, when it does fire, this is an O(n) computation on potentially hundreds of thousands of points on the main thread. Also, the startup reseed does the same. Consider caching or using the incremental approach consistently.


5. UI / UX

5.1 nitHardcoded color #ffb85b used in multiple places.
The amber/orange color #ffb85b is used in MiniMissionControlPanel, MissionControlPanel, and the Map tooltip CSS. Consider extracting this to a CSS variable or theme token for consistency and maintainability. However, this follows existing patterns in the codebase (e.g., waypoint tooltip colors are also hardcoded), so this is purely a nit.

5.2 nitposition fixed left-4 class on v-icon in MissionControlPanel.vue (diff line ~259).
The class position fixed left-4 looks like it should be fixed left-4 or just absolute left-4. Tailwind's fixed utility sets position: fixed, and combining it with position (not a standard Tailwind class) may not do what's intended. Verify this positions the icon correctly within the flex container.

No major UI issues.


6. Code Quality & Style

6.1 minorDuplicated formattedTotalDistance / formattedMissionDistance computed properties.
The exact same computed properties are defined in three places: MiniMissionControlPanel.vue, MissionControlPanel.vue, and Map.vue (as historyTooltipContent). Consider exposing pre-formatted strings from the mission store or creating a shared composable to avoid repetition.

6.2 nitwidgetSize precision change in MissionControlPanel.vue.
The widgetSize was changed from high-precision floats (0.14638572402097255, 0.09641222207770606) to rounded values (0.146, 0.108). The width change is essentially a rounding but the height changed from ~0.096 to 0.108 (a ~12% increase) to accommodate the new odometer row. This is fine functionally, but the rounding of the width from 0.14638... to 0.146 is an unrelated change that may slightly affect existing layouts.

6.3 nitlastMissionOdometerLat / lastMissionOdometerLng could be a single variable.
Using two separate let variables for the last mission odometer position could be simplified to a single let lastMissionOdometerPoint: WaypointCoordinates | null = null, which would be more consistent with the WaypointCoordinates type used elsewhere.


7. Tests

No new tests were added for the formatDistance utility, segmentLengthMeters, polylineLengthMeters, or the odometer accumulation logic. These are pure functions / deterministic store logic that would benefit from unit test coverage.

7.1 minor — Missing unit tests for formatDistance (unit conversion thresholds, edge cases like 0 meters, negative values) and the new map utility functions.


8. Documentation

8.1 nit — The PR description body appears to have a truncated sentence: "Mission history can be reset on the" — this should be completed for future reference.

No README update needed since this feature works identically in both Lite and Standalone modes.


9. Nitpicks / Optional

9.1 nit — In formatDistance, consider handling the edge case where meters is negative or NaN gracefully (return "0 m" or "—").

9.2 nit — The attachHistoryTooltip guard if (polyline.getTooltip()) return prevents re-binding, but the function is only called when the polyline is freshly created, so the guard is redundant. Not harmful, just unnecessary.

9.3 nitconst updatedHistory = vehiclePositionHistory.value in the shift fallback path is just an alias — consider using vehiclePositionHistory.value directly for clarity, or explain why the alias exists.


Generated by Claude. This is advisory; a human reviewer must still approve.

@ArturoManzoli ArturoManzoli force-pushed the add-mission-odometer branch 2 times, most recently from dc8b887 to 856c557 Compare May 11, 2026 14:07
@ArturoManzoli

Copy link
Copy Markdown
Contributor Author

1. Correctness & Implementation Bugs

1.1 majorTooltip content not reactive on initial bind. In Map.vue, attachHistoryTooltip calls polyline.bindTooltip(historyTooltipContent.value, ...) — this passes the current string value at bind time. The watch(historyTooltipContent, ...) later updates the tooltip via setContent. However, if the polyline is created in onMounted (line ~873 in the diff), the historyTooltipContent computed is evaluated before any position data flows. The watch will update it later, so this is functionally okay except that the tooltip will briefly display stale "0" values. This is minor but worth noting. More importantly, if vehicleHistoryPolyline.value is destroyed and recreated (the watcher sets it to undefined and re-creates it when the history goes from empty to populated), the new polyline gets attachHistoryTooltip called, but the watch(historyTooltipContent, ...) still references vehicleHistoryPolyline.value, so this should still work. Acceptable.

1.2 majorisMissionRunning includes GUIDED mode, causing odometer to accumulate during non-mission GUIDED maneuvers. isMissionRunning is defined as mainVehicleStore.mode === 'AUTO' || mainVehicleStore.mode === 'GUIDED'. If the vehicle is in GUIDED mode for a GoTo command (not part of a mission), the mission odometer will still accumulate distance. The condition isMissionAccumulating = isMissionRunning.value && (mainVehicleStore.currentMissionSeq ?? 0) >= 1 partially mitigates this (seq >= 1), but currentMissionSeq may still be a nonzero stale value from a prior mission when the vehicle switches to GUIDED for a GoTo. This could cause false accumulation. Consider restricting mission accumulation to mode === 'AUTO' only, or adding additional state checks.

Fixed both majors

@ES-Alexander ES-Alexander added the docs-needed Change needs to be documented label May 18, 2026
Comment thread src/libs/units.ts Outdated
Comment on lines +27 to +35
export const formatDistance = (meters: number, unit: DistanceDisplayUnit): string => {
if (unit === DistanceDisplayUnit.Feet) {
const feet = meters * 3.28084
if (feet >= 5280) return `${(feet / 5280).toFixed(2)} mi`
return `${feet.toFixed(0)} ${unitAbbreviation[DistanceDisplayUnit.Feet]}`
}
if (meters >= 1000) return `${(meters / 1000).toFixed(2)} km`
return `${meters.toFixed(1)} ${unitAbbreviation[DistanceDisplayUnit.Meters]}`
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit module from mathjs provides this conversion already.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

ArturoManzoli and others added 2 commits July 1, 2026 10:31
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@ArturoManzoli ArturoManzoli force-pushed the add-mission-odometer branch from 856c557 to 1a6e53b Compare July 1, 2026 13:53
@ArturoManzoli

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Automated PR Re-review 1 (Claude)

Since PREV_SHA is empty, the incremental diff is unavailable. This re-review is based on the full pr.diff against master.

Previous findings status

# Finding Severity Status
1.1 Tooltip content not reactive on initial bind major ✅ Addressed — bindTooltip now receives a function () => historyTooltipContent.value, so Leaflet re-evaluates on every open.
1.2 isMissionRunning includes GUIDED mode major ✅ Addressed — mission accumulation is now restricted to mode === 'AUTO' only.
1.3 totalTraveledDistanceMeters reseeded on every store instantiation minor ✅ Addressed — reseed is now conditional (=== 0 && length > 1) with a clear "why" comment.
2.1 Missing JSDoc on resetMissionDistance minor ✅ Addressed — JSDoc with @returns added.
2.2 Comment explains "what" not "why" nit ✅ Addressed — rewritten to explain why the conditional seed is needed.
4.1 polylineLengthMeters called on potentially large arrays minor :large_yellow_circle: Partially addressed — startup reseed is now conditional, but simplifyNextChunk still calls polylineLengthMeters twice (before/after) on each chunk. Chunks are bounded to 1/3 of maxPositionHistorySize, so the cost is capped, but it still runs on every simplification pass inside the position watcher. Acceptable given the bounded chunk size.
5.1 Hardcoded color #ffb85b in multiple places nit ❌ Not addressed
5.2 position fixed left-4 Tailwind class nit ❌ Not addressed — position is not a standard Tailwind utility; likely the intent is just fixed left-4 or absolute left-4.
6.1 Duplicated formattedTotalDistance/formattedMissionDistance computed properties minor ❌ Not addressed — identical computeds still defined in all three files.
6.2 widgetSize precision change nit ⚪ No longer applicable — the values are also updated in defaults.ts, so this is an intentional resize.
6.3 Separate lastMissionOdometerLat/lastMissionOdometerLng vars nit ❌ Not addressed
7.1 Missing unit tests for formatDistance and map utilities minor ❌ Not addressed
8.1 Truncated PR description nit ❌ Not addressed
9.1 formatDistance edge case for negative/NaN nit ❌ Not addressed
9.2 Redundant getTooltip() guard in attachHistoryTooltip nit ❌ Not addressed
9.3 updatedHistory alias nit ❌ Not addressed

Discussion since last review

  • @ArturoManzoli (comment): "Fixed both majors" — confirmed, both 1.1 and 1.2 are addressed in the current diff.
  • @rafaellehmkuhl (inline on src/libs/units.ts): "The unit module from mathjs provides this conversion already." — formatDistance now imports unit from mathjs and delegates conversion through it instead of hand-rolling constants. This is consistent with AGENTS.md rule 1 (use existing dependencies).
  • @ArturoManzoli (reply): "Fixed" — confirmed, mathjs unit conversion is now used.

New findings

0. Summary

Verdict: MINOR SUGGESTIONS

Minor items to consider: 5.3, 5.4

This PR adds odometer tracking for total vehicle distance and per-mission distance. Distances are displayed in the Mission Control Panel widget, the Mini Mission Control Panel mini-widget (hover/click popup on WP number), and a Leaflet tooltip on the vehicle history polyline in the Map widget. A formatDistance utility using mathjs handles unit conversion. The store accumulates distance incrementally and adjusts for RDP simplification. The two previous major findings (tooltip reactivity and GUIDED-mode false accumulation) have been addressed.


1. Correctness & Implementation Bugs — ✅

2. AGENTS.md Adherence — ✅

3. Security — ✅

4. Performance — ✅

5. UI / UX

5.3 minorMissing logUserAction calls on new user interactions.
Per AGENTS.md ("Any new feature with user interaction must log every interaction … Use the global logUserAction(message) helper"):

  • MiniMissionControlPanel.vue: clicking the reset-mission-distance icon (@click.stop="missionStore.resetMissionDistance()") is a discrete user action with no logUserAction call.
  • MissionControlPanel.vue: the new "Reset mission distance" menu item (@click="missionStore.resetMissionDistance()") is a discrete user action with no logUserAction call.
  • Map.vue: onHistoryTooltipResetClick calls missionStore.resetMissionDistance() without logging the action.

All three should log via logUserAction('Reset mission distance') (or similar) at the call site or inside resetMissionDistance itself (the latter covers all three at once).

5.4 nitposition fixed left-4 on v-icon (MissionControlPanel.vue:~line 339).
Carried from previous 5.2 — position is not a Tailwind class. If the intent is CSS position: fixed, that is likely incorrect inside a flex row (the icon would be fixed relative to the viewport). This is probably meant to be an offset within the flex container; consider absolute left-4 with a relative parent, or just use ml-* margin.


6. Code Quality & Style

6.4 minorDuplicated computed properties across three files (carried from 6.1).
formattedTotalDistance and formattedMissionDistance are identically defined in MiniMissionControlPanel.vue, MissionControlPanel.vue, and (as historyTooltipContent ingredients) Map.vue. Per AGENTS.md ("If the same logic would live in two or more places, extract it once and reuse it"), consider either:

  • Exposing formattedTotalDistance(unit) / formattedMissionDistance(unit) as getters from the mission store, or
  • Creating a small composable that returns both.

7. Commit Hygiene — ✅

8. Tests — ✅

9. Documentation — ✅

10. Nitpicks / Optional — ✅

Generated by Claude. This is advisory; a human reviewer must still approve.

@ArturoManzoli ArturoManzoli force-pushed the add-mission-odometer branch from 1a6e53b to f2fb244 Compare July 1, 2026 15:17
@ArturoManzoli

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Automated PR Re-review 2 (Claude)

Comparing 1a6e53b20f9e87027fb0aa7cdc4a323ad618e0ecf2fb2442478af10ae4f9ce443799d529960f3ec1

Previous findings status

# Finding Severity Status
4.1 polylineLengthMeters called on potentially large arrays minor ✅ Addressed — bounded chunk sizes make the cost acceptable; no change needed.
5.1 Hardcoded color #ffb85b in multiple places nit ❌ Not addressed
5.2 position fixed left-4 Tailwind class nit ❌ Not addressed
5.3 Missing logUserAction calls on reset-mission-distance interactions minor ✅ Addressed — logUserAction now called inside resetMissionDistance() in the store, covering all three call sites.
5.4 position fixed left-4 on v-icon (MissionControlPanel.vue) nit ❌ Not addressed (same as 5.2)
6.1 Duplicated formattedTotalDistance/formattedMissionDistance computed properties minor ✅ Addressed — extracted into useTraveledDistances composable.
6.3 Separate lastMissionOdometerLat/lastMissionOdometerLng vars nit ❌ Not addressed
6.4 Duplicated computed properties across three files minor ✅ Addressed — all three files now use useTraveledDistances().
7.1 Missing unit tests for formatDistance and map utilities minor ❌ Not addressed
8.1 Truncated PR description nit ❌ Not addressed
9.1 formatDistance edge case for negative/NaN nit ❌ Not addressed
9.2 Redundant getTooltip() guard in attachHistoryTooltip nit ❌ Not addressed
9.3 updatedHistory alias nit ❌ Not addressed

New findings

0. Summary

Verdict: MINOR SUGGESTIONS

Minor items to consider: 1.4, 5.5

This PR adds odometer tracking for total vehicle distance and per-mission distance, displayed across the Mission Control Panel widget, Mini Mission Control Panel popup, and the map's history-line tooltip. Since the last review, the duplicated formatting logic was extracted into a useTraveledDistances composable, and logUserAction was added inside the resetMissionDistance store method. The two biggest improvements are solid. Two new findings surface from the incremental changes.


1. Correctness & Implementation Bugs

1.4 minorlogUserAction fires on automatic mission-odometer reset, not just user-initiated resets.
src/stores/mission.ts — the watch on mainVehicleStore.currentMissionSeq calls resetMissionDistance() when newSeq === 1 && oldSeq !== 1. Since resetMissionDistance now unconditionally calls logUserAction('Reset the mission traveled-distance odometer'), every automatic mission restart will log a spurious [UserAction] entry that the user did not initiate. Per AGENTS.md, logUserAction is for discrete user actions only.

Consider either: (a) moving the logUserAction call out of resetMissionDistance and into the three UI click handlers instead, or (b) adding a { silent?: boolean } parameter so the auto-reset watch can suppress the log.


2. AGENTS.md Adherence — ✅

3. Security — ✅

4. Performance — ✅

5. UI / UX

5.5 nitposition fixed left-4 on v-icon in MissionControlPanel.vue (carried forward from 5.2/5.4).
class="position fixed left-4 opacity-80 text-[#ffb85b]"position is not a Tailwind class. If the intent is position: fixed, the icon would be positioned relative to the viewport, which is almost certainly wrong inside a flex row. Likely meant to be a margin or absolute positioning with a relative parent. Minor visual issue.


6. Code Quality & Style — ✅

7. Commit Hygiene — ✅

8. Tests — ✅

9. Documentation — ✅

10. Nitpicks / Optional — ✅

Generated by Claude. This is advisory; a human reviewer must still approve.

ArturoManzoli and others added 5 commits July 1, 2026 12:50
Co-authored-by: Cursor <cursoragent@cursor.com>
Extracts the mission-store + interface-store wiring that formats the
total and mission traveled distances so widgets, mini-widgets and map
overlays can share a single formatting funnel instead of duplicating
the pair of computeds at each call site.
Co-authored-by: Cursor <cursoragent@cursor.com>
…ver on current wp

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@ArturoManzoli ArturoManzoli force-pushed the add-mission-odometer branch from f2fb244 to e3746ce Compare July 1, 2026 15:54
@ArturoManzoli

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Automated PR Re-review 3 (Claude)

Comparing f2fb2442478af10ae4f9ce443799d529960f3ec1e3746ce4c60028ff8e3bfabfdb5c086ad610b5df

Previous findings status

# Finding Severity Status
1.4 logUserAction fires on automatic mission-odometer reset minor ✅ Addressed — resetMissionDistance now takes a { silent?: boolean } option and the auto-reset watcher passes { silent: true }.
5.1 Hardcoded color #ffb85b in multiple places nit ❌ Not addressed
5.2 position fixed left-4 Tailwind class nit ❌ Not addressed
5.4 position fixed left-4 on v-icon (MissionControlPanel.vue) nit ❌ Not addressed (same as 5.2)
5.5 position fixed left-4 on v-icon (carried forward) nit ❌ Not addressed
6.3 Separate lastMissionOdometerLat/lastMissionOdometerLng vars nit ❌ Not addressed
7.1 Missing unit tests for formatDistance and map utilities minor ❌ Not addressed
8.1 Truncated PR description nit ❌ Not addressed
9.1 formatDistance edge case for negative/NaN nit ❌ Not addressed
9.2 Redundant getTooltip() guard in attachHistoryTooltip nit ❌ Not addressed
9.3 updatedHistory alias nit ❌ Not addressed

New findings

0. Summary

Verdict: MINOR SUGGESTIONS

Minor items to consider: 1.5, 6.5

This PR adds odometer tracking for total vehicle distance and per-mission distance, displayed across the Mission Control Panel widget, Mini Mission Control Panel popup, and the map's history-line tooltip. Since the last review, the logUserAction concern (1.4) was cleanly addressed with a { silent } option. Commit history has been cleaned up and is now well-structured. Two small new observations below; the remaining open items from previous reviews are all nits.


1. Correctness & Implementation Bugs

1.5 minorclearVehicleHistory resets totalTraveledDistanceMeters to 0, but does not reset missionTraveledDistanceMeters or the mission-odometer lat/lng state.
src/stores/mission.tsclearVehicleHistory() sets totalTraveledDistanceMeters.value = 0 but leaves missionTraveledDistanceMeters untouched and does not null out lastMissionOdometerLat/lastMissionOdometerLng. After clearing the history, the mission odometer would still show the old accumulated distance and would jump on the next position update (since the "last" lat/lng still references a now-deleted position). Consider calling resetMissionDistance({ silent: true }) inside clearVehicleHistory.


2. AGENTS.md Adherence — ✅

3. Security — ✅

4. Performance — ✅

5. UI / UX — ✅

6. Code Quality & Style

6.5 minorMap.vue exceeds the ~2 000-line guideline threshold.
src/components/widgets/Map.vue is now 2 283 lines (base was already close; this PR adds ~138 more). Per review-guidelines §6 "File size", consider extracting the new history-tooltip logic (the computed, attachHistoryTooltip, the document-level click delegation, and the associated CSS) into a composable or child component to keep Map.vue from growing further.


7. Commit Hygiene — ✅

8. Tests — ✅

9. Documentation — ✅

10. Nitpicks / Optional — ✅

Generated by Claude. This is advisory; a human reviewer must still approve.

@rafaellehmkuhl rafaellehmkuhl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a strange problem when testing this: while the mission odometer seemed to look fine, the total one jumped several times. It initiated already on something like 1.1km, then it reset to 0 when I started a mission, and then it when back to 1.1km when I restarted Cockpit.

I suspect it's not the root cause, but there's one catch with how it is implemented right now: the odometer is never actually going to be written to the vehicle, unless the position stops being updated. That happens because the useBlueOsStorage composable has a debouncer of 3 seconds, while the position updates several times a second.

I've opened #2818 to fix that problem in the sync for this kind of setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-needed Change needs to be documented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

frontend: Show Total traveled and mission distance

3 participants