Skip to content

feat(FlightMap): add mission item grouping and improve map usability - #14623

Open
rubenp02 wants to merge 5 commits into
mavlink:masterfrom
Ventor-Innovations:feature/mission-item-map-usability
Open

feat(FlightMap): add mission item grouping and improve map usability#14623
rubenp02 wants to merge 5 commits into
mavlink:masterfrom
Ventor-Innovations:feature/mission-item-map-usability

Conversation

@rubenp02

@rubenp02 rubenp02 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

A variety of bugfixes and a new mission item grouping feature to improve mission map usability.

fix(FlightMap): show current item above others

When multiple simple mission items shared the same position, later items could partially cover the current target, including its number. The current item is now drawn above other mission item indicators, ensuring the active navigation target can always be identified during flight.

feat(FlightMap): group overlapping mission items

Simple mission items can share coordinates or become close enough at the current map scale for their indicators to overlap. Only the topmost indicator could then be reliably identified or selected, particularly on touchscreens.

They are now combined into a single group indicator with direct access to every grouped item.

Key changes:

  • Groups items in screen space and updates the groups when the map scale or item positions change. Indicators remain separate while they can still be selected individually.
  • Shows the current item's normal marker label when the group contains it, or that of the lowest-sequence item otherwise. A new intermediate marker size and an ellipsis below the label distinguish groups from individual items.
  • Opens a non-modal horizontal selector when a group is selected in Plan or Fly view. The selector grows with its contents up to a viewport-relative limit while keeping every member directly accessible. Command-specific labels preserve their normal abbreviations and include sequence numbers to distinguish repeated items.
  • Keeps each simple mission item independently loaded. This preserves mission legs, loiter circles, dragging, and other associated map visuals. Complex items do not interact with the grouping system.

fix(FlightMap): keep items visible at all zooms

MapQuickItem's default auto-fade hides simple mission indicators at low zoom levels, removing mission context when several items occupy a small area.

Grouped indicators manage that density without losing access to any item. Automatic fading is therefore disabled, allowing simple mission markers to remain visible and selectable at every zoom level.

fix(PlanView): hide split handles on short legs

The split handle remained visible on legs whose midpoint was too close to either endpoint for an inserted item to remain separately selectable.

It now hides whenever the resulting item would join the same indicator group.

fix(FlightMap): hide arrows on short legs

Direction arrows could become larger on screen than their underlying mission legs, obscuring rather than clarifying the route.

They now hide whenever a leg's projected length is shorter than the 30-pixel width of the arrow canvas.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/Build changes
  • Other

Testing

  • Tested locally
  • Added/updated unit tests
  • Tested with simulator (SITL)
  • Tested with hardware

Platforms Tested

  • Linux
  • Windows
  • macOS
  • Android
  • iOS

Flight Stacks Tested

  • PX4
  • ArduPilot (The changes are stack-agnostic, but SITL testing was performed with ArduPilot.)

Screenshots

imagen imagen imagen imagen imagen

Checklist

  • I have read the Contribution Guidelines
  • I have read the Code of Conduct
  • My code follows the project's coding standards
  • I have added tests that prove my fix/feature works
  • New and existing unit tests pass locally

Related Issues

Closes #8728


By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).

@rubenp02
rubenp02 requested a review from HTRamsey as a code owner July 17, 2026 17:04
Copilot AI review requested due to automatic review settings July 17, 2026 17:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves mission map usability across PlanView and FlyView by introducing a screen-space grouping mechanism for overlapping simple mission item indicators, while also addressing several interaction/visibility issues (drag readiness, z-ordering, arrow visibility).

Changes:

  • Added MissionItemIndicatorGroup to cluster overlapping simple mission item indicators and provide an in-place selector for choosing among grouped items.
  • Updated mission item visuals to integrate with grouping and to ensure newly-created items are immediately draggable once their indicator finishes loading.
  • Disabled mission-item auto-fade and hid direction arrows / split handles when the corresponding leg is too short at the current zoom.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/PlanView/TransectStyleMapVisuals.qml Passes map control into MapLineArrow after it became an explicit dependency.
src/PlanView/TakeoffItemMapVisual.qml Hooks takeoff indicator into the new indicator grouping system and interactive gating.
src/PlanView/SimpleItemMapVisual.qml Passes indicator-group and visibility/interaction flags into MissionItemIndicator.
src/PlanView/PlanView.qml Instantiates the grouping component in PlanView and hides split UI for too-short legs at current zoom.
src/PlanView/MissionItemMapVisualBase.qml Fixes drag-area readiness by waiting for the async indicator to be loaded; routes clicks via indicator activation when available.
src/PlanView/MissionItemMapVisual.qml Plumbs indicatorGroup into simple-item visuals at load time.
src/PlanView/MissionItemIndexLabel.qml Adds “medium” sizing and optional sub/supplementary text to support group indicators and selector labels.
src/FlightMap/MapItems/PlanMapItems.qml Instantiates grouping in FlyView’s plan overlays and passes it into mission item visuals; updates arrows for new MapLineArrow API.
src/FlightMap/MapItems/MissionItemIndicatorGroup.qml New: performs screen-space grouping and shows a non-modal horizontal selector panel for grouped items.
src/FlightMap/MapItems/MissionItemIndicator.qml Integrates grouping (representative visibility, activation behavior, z-ordering, disabling auto-fade).
src/FlightMap/MapItems/MapLineArrow.qml Adds explicit mapControl dependency and hides arrows when legs are shorter than the arrow canvas at current zoom.
src/FlightMap/CMakeLists.txt Registers the new MissionItemIndicatorGroup.qml in the FlightMap QML module.

Comment thread src/FlightMap/MapItems/MissionItemIndicatorGroup.qml
Comment thread src/FlightMap/MapItems/MissionItemIndicator.qml Outdated
@rubenp02 rubenp02 changed the title Mission item grouping and map usability improvements feat(FlightMap): add mission item grouping and improve map usability Jul 17, 2026
@rubenp02
rubenp02 force-pushed the feature/mission-item-map-usability branch from 88998d2 to b9557c5 Compare July 17, 2026 17:27
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Build Results

Platform Status

Platform Status Details
Linux Passed View
Windows Passed View
MacOS Passed View
Android Passed View

All builds passed.

Pre-commit

Check Status Details
pre-commit Failed (non-blocking) View

Pre-commit hooks: 2 passed, 75 failed, 7 skipped.

Test Results

linux-coverage-integration: 51 passed, 0 skipped
linux-coverage-unit: 184 passed, 0 skipped
linux-sanitizers-integration: 30 passed, 0 skipped
linux-sanitizers-unit: 184 passed, 0 skipped
Total: 449 passed, 0 skipped

Code Coverage

Coverage: 70.6%

No baseline available for comparison

Artifact Sizes

Artifact Size
QGroundControl 253.10 MB
QGroundControl-aarch64 177.29 MB
QGroundControl-installer-AMD64 128.41 MB
QGroundControl-installer-AMD64-ARM64 70.80 MB
QGroundControl-installer-ARM64 99.55 MB
QGroundControl-linux 84.75 MB
QGroundControl-mac 84.75 MB
QGroundControl-x86_64 189.56 MB
No baseline available for comparison

Updated: 2026-09-01 13:27:43 UTC • Commit: d834e78 • Triggered by: Linux

@DonLakeFlyer
DonLakeFlyer requested a review from Copilot July 17, 2026 20:03
@DonLakeFlyer

Copy link
Copy Markdown
Contributor

Can you move the bugs which should go into 5.1 into their own pull?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Comment thread src/FlightMap/MapItems/MissionItemIndicator.qml
Comment thread src/FlightMap/MapItems/MissionItemIndicatorGroup.qml
Copilot AI review requested due to automatic review settings July 21, 2026 07:53
@rubenp02
rubenp02 force-pushed the feature/mission-item-map-usability branch from b9557c5 to 45833cb Compare July 21, 2026 07:53
@rubenp02

rubenp02 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Can you move the bugs which should go into 5.1 into their own pull?

Done @ #14670. I'll update this one to remove duplicate commits once that one goes in.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Comment thread src/FlightMap/MapItems/MissionItemIndicatorGroup.qml
@rubenp02
rubenp02 marked this pull request as draft August 15, 2026 01:35
@rubenp02
rubenp02 force-pushed the feature/mission-item-map-usability branch 2 times, most recently from 48d0f81 to ab880d4 Compare August 25, 2026 10:54
@rubenp02

Copy link
Copy Markdown
Contributor Author

@DonLakeFlyer Updated to drop the fix that already got merged and to address the issues you identified @ #14670.

@rubenp02
rubenp02 marked this pull request as ready for review August 25, 2026 17:13
@DonLakeFlyer

Copy link
Copy Markdown
Contributor

CI Failure Analysis

Both failing jobs (Test + Coverage linux_gcc_64 Debug and Custom Plugin Test Debug) fail for the same root cause. The failing tests (identical in both jobs):

  1. PlanViewUITest::_testPlanViewStates()
  2. AppCloseWarningUITest::_testNoUnsavedMissionWarningForDownloadedMission()

All actual test assertions pass (e.g. AppCloseWarningUITest: 19 passed). The tests fail only on strict-mode unexpected-log-message checking, triggered by this runtime QML warning:

qrc:/qml/QGroundControl/FlightMap/MapItems/MissionItemIndicator.qml:21:5: Unable to assign [undefined] to bool

Root cause

Line 21 of the new MissionItemIndicator.qml is:

readonly property bool _isGrouped: _group && _group.items.length > 1

Chain of undefined:

  1. groupForItem() in MissionItemIndicatorGroup.qml does:
    return item ? _groupsBySequenceNumber[item.sequenceNumber] : null
    When the item's sequence number isn't in the dictionary (groups not rebuilt yet, or the item isn't in any group), the JS object lookup returns undefined — not null.
  2. So _group (a var property) becomes undefined.
  3. _isGrouped: _group && ... short-circuits to undefined, which QML refuses to assign to a bool property → warning → strict-mode test failure.

The same latent hazard exists on line 19 (_usesAbbreviation: missionItem && ... yields undefined when missionItem is unset); it just isn't hit by these tests.

Suggested fix

Coerce the bindings to real booleans, e.g.:

readonly property bool _usesAbbreviation: missionItem ? missionItem.abbreviation.charAt(0) > 'A' && missionItem.abbreviation.charAt(0) < 'z' : false
readonly property bool _isGrouped: _group ? _group.items.length > 1 : false

(A ternary always produces a boolean, unlike && which propagates undefined.)

The skipped deploy check is just a downstream effect of the test failures, not a real failure.

When multiple simple mission items shared the same position, later items
could partially cover the current target, including its number. The
current item is now drawn above other mission item indicators, ensuring
the active navigation target can always be identified during flight.
Direction arrows could become larger on screen than their underlying
mission legs, obscuring rather than clarifying the route.

They now hide whenever a leg's projected length is shorter than the
30-pixel width of the arrow canvas.
@rubenp02
rubenp02 force-pushed the feature/mission-item-map-usability branch from ab880d4 to 7791646 Compare September 1, 2026 11:22
@rubenp02

rubenp02 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@DonLakeFlyer fixed

Simple mission items can share coordinates or become close enough at the
current map scale for their indicators to overlap. Only the topmost
indicator could then be reliably identified or selected, particularly on
touchscreens.

They are now combined into a single group indicator with direct access
to every grouped item.

Key changes:
- Groups items in screen space and updates the groups when the map scale
  or item positions change. Indicators remain separate while they can
  still be selected individually.
- Shows the current item's normal marker label when the group contains
  it, or that of the lowest-sequence item otherwise. A new intermediate
  marker size and an ellipsis below the label distinguish groups from
  individual items.
- Opens a non-modal horizontal selector when a group is selected in Plan
  or Fly view. The selector grows with its contents up to a
  viewport-relative limit while keeping every member directly
  accessible. Command-specific labels preserve their normal
  abbreviations and include sequence numbers to distinguish repeated
  items.
- Keeps each simple mission item independently loaded. This preserves
  mission legs, loiter circles, dragging, and other associated map
  visuals. Complex items do not interact with the grouping system.
MapQuickItem's default auto-fade hides simple mission indicators at low
zoom levels, removing mission context when several items occupy a small
area.

Grouped indicators manage that density without losing access to any
item. Automatic fading is therefore disabled, allowing simple mission
markers to remain visible and selectable at every zoom level.
The split handle remained visible on legs whose midpoint was too close
to either endpoint for an inserted item to remain separately selectable.

It now hides whenever the resulting item would join the same indicator
group.
@rubenp02
rubenp02 force-pushed the feature/mission-item-map-usability branch from 7791646 to d834e78 Compare September 1, 2026 12:07
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 34.51%. Comparing base (f29efd3) to head (d834e78).
⚠️ Report is 350 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14623      +/-   ##
==========================================
+ Coverage   25.47%   34.51%   +9.04%     
==========================================
  Files         769      945     +176     
  Lines       65912    85586   +19674     
  Branches    30495    39446    +8951     
==========================================
+ Hits        16788    29539   +12751     
+ Misses      37285    36419     -866     
- Partials    11839    19628    +7789     
Flag Coverage Δ
unittests 34.51% <ø> (+9.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 659 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a94564...d834e78. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Waypoint clustering when waypoints are close to eachother, or on top of eachother

3 participants