Skip to content

Mission item editor changes#13703

Merged
DonLakeFlyer merged 1 commit intomasterfrom
MorePlan
Dec 6, 2025
Merged

Mission item editor changes#13703
DonLakeFlyer merged 1 commit intomasterfrom
MorePlan

Conversation

@DonLakeFlyer
Copy link
Copy Markdown
Collaborator

  • More UI reorg
  • Next/Prev buttons
  • Delete/Hamburger at bottom

Screenshot 2025-12-05 at 3 50 55 PM

Copilot AI review requested due to automatic review settings December 5, 2025 23:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 reorganizes the mission item editor UI by moving controls to improve the user experience. The main changes include adding Previous/Next navigation buttons at the top of the mission item editor panel, relocating the Delete and Hamburger menu buttons to the bottom alongside the command description, and adjusting visual styling (transparency and opacity) for better panel visibility.

Key Changes

  • Added navigation controls (Previous/Next buttons) for browsing mission items sequentially
  • Relocated Delete and Hamburger menu buttons from top to bottom of the editor panel
  • Updated panel backgrounds to use transparent color and increased right panel opacity from 0.2 to 0.85

Reviewed changes

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

Show a summary per file
File Description
src/QmlControls/SimpleItemEditor.qml Changed background to transparent and removed top margin from height calculation
src/QmlControls/PlanView.qml Added Previous/Next navigation buttons above MissionItemEditor and increased right panel opacity
src/QmlControls/MissionSettingsEditor.qml Changed background color from windowShadeDark to transparent
src/QmlControls/MissionItemEditor.qml Restructured layout moving Delete/Hamburger buttons to bottom row with command description
src/MissionManager/MissionSettingsItem.h Updated command description from "Mission Start" to "Initial Mission Settings"
src/MissionManager/MissionController.h Added documentation for the force parameter in setCurrentPlanViewSeqNum

Comment on lines +723 to +738
QGCColoredImage {
Layout.fillHeight: true
Layout.preferredWidth: height
source: "/InstrumentValueIcons/backward.svg"
color: qgcPal.buttonText

MouseArea {
anchors.fill: parent
onClicked: {
if (_missionController.currentPlanViewVIIndex > 1) {
let prevItem = _missionController.visualItems.get(_missionController.currentPlanViewVIIndex - 1)
_missionController.setCurrentPlanViewSeqNum(prevItem.sequenceNumber, false)
}
}
}
}
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

Missing accessibility support: The "Previous" navigation button lacks accessible text. Add Accessible.name property to describe the button's purpose for screen readers, e.g., Accessible.name: qsTr("Previous mission item").

Copilot uses AI. Check for mistakes.
Comment on lines +746 to +761
QGCColoredImage {
Layout.fillHeight: true
Layout.preferredWidth: height
source: "/InstrumentValueIcons/forward.svg"
color: qgcPal.buttonText

MouseArea {
anchors.fill: parent
onClicked: {
if (_missionController.currentPlanViewVIIndex < _missionController.visualItems.count - 1) {
let nextItem = _missionController.visualItems.get(_missionController.currentPlanViewVIIndex + 1)
_missionController.setCurrentPlanViewSeqNum(nextItem.sequenceNumber, false)
}
}
}
}
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

Missing accessibility support: The "Next" navigation button lacks accessible text. Add Accessible.name property to describe the button's purpose for screen readers, e.g., Accessible.name: qsTr("Next mission item").

Copilot uses AI. Check for mistakes.
Comment on lines +113 to 130
QGCColoredImage {
id: deleteButton
Layout.preferredWidth: visible ? _hamburgerSize : 0
Layout.preferredHeight: _hamburgerSize
Layout.fillHeight: true
source: "/res/TrashDelete.svg"
sourceSize.height: _hamburgerSize
fillMode: Image.PreserveAspectFit
mipmap: true
smooth: true
color: qgcPal.text
visible: missionItem.sequenceNumber !== 0

QGCMouseArea {
fillItem: parent
onClicked: remove()
}
}
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

Missing accessibility support: The delete button lacks accessible text. Add Accessible.name and Accessible.description properties to describe the button's purpose for screen readers, e.g., Accessible.name: qsTr("Delete") and Accessible.description: qsTr("Delete mission item").

Copilot uses AI. Check for mistakes.
Comment on lines +141 to 163
QGCColoredImage {
id: hamburger
Layout.alignment: Qt.AlignRight
Layout.preferredWidth: visible ? _hamburgerSize : 0
Layout.preferredHeight: _hamburgerSize
sourceSize.height: _hamburgerSize
source: "qrc:/qmlimages/Hamburger.svg"
color: qgcPal.text
visible: missionItem.sequenceNumber !== 0

QGCMouseArea {
fillItem: hamburger

onClicked: (position) => {
currentItemScope.focus = true
position = Qt.point(position.x, position.y)
// For some strange reason using mainWindow in mapToItem doesn't work, so we use globals.parent instead which also gets us mainWindow
position = mapToItem(globals.parent, position)
var dropPanel = hamburgerMenuDropPanelComponent.createObject(mainWindow, { clickRect: Qt.rect(position.x, position.y, 0, 0) })
dropPanel.open()
}
}
}
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

Missing accessibility support: The hamburger menu button lacks accessible text. Add Accessible.name and Accessible.description properties to describe the button's purpose for screen readers, e.g., Accessible.name: qsTr("Menu") and Accessible.description: qsTr("Open mission item menu").

Copilot uses AI. Check for mistakes.
Comment on lines +730 to +736
anchors.fill: parent
onClicked: {
if (_missionController.currentPlanViewVIIndex > 1) {
let prevItem = _missionController.visualItems.get(_missionController.currentPlanViewVIIndex - 1)
_missionController.setCurrentPlanViewSeqNum(prevItem.sequenceNumber, false)
}
}
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

Missing keyboard navigation support: The Previous button should support keyboard interaction. Consider replacing MouseArea with Button or ToolButton, or add Keys.onReturnPressed and activeFocusOnTab: true to enable keyboard accessibility.

Suggested change
anchors.fill: parent
onClicked: {
if (_missionController.currentPlanViewVIIndex > 1) {
let prevItem = _missionController.visualItems.get(_missionController.currentPlanViewVIIndex - 1)
_missionController.setCurrentPlanViewSeqNum(prevItem.sequenceNumber, false)
}
}
anchors.fill: parent
activeFocusOnTab: true
onClicked: {
if (_missionController.currentPlanViewVIIndex > 1) {
let prevItem = _missionController.visualItems.get(_missionController.currentPlanViewVIIndex - 1)
_missionController.setCurrentPlanViewSeqNum(prevItem.sequenceNumber, false)
}
}
Keys.onReturnPressed: {
if (_missionController.currentPlanViewVIIndex > 1) {
let prevItem = _missionController.visualItems.get(_missionController.currentPlanViewVIIndex - 1)
_missionController.setCurrentPlanViewSeqNum(prevItem.sequenceNumber, false)
}
}
Keys.onSpacePressed: {
if (_missionController.currentPlanViewVIIndex > 1) {
let prevItem = _missionController.visualItems.get(_missionController.currentPlanViewVIIndex - 1)
_missionController.setCurrentPlanViewSeqNum(prevItem.sequenceNumber, false)
}
}

Copilot uses AI. Check for mistakes.
anchors.rightMargin: _toolsMargin
width: _utmspEnabled ? _rightPanelWidth + ScreenTools.defaultFontPixelWidth * 21.667 : _rightPanelWidth
color: qgcPal.window
opacity: 0.85
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

[nitpick] Significant opacity increase from 0.2 to 0.85 could impact map visibility. The right panel background is now much more opaque (85% vs 20%), which may obscure more of the underlying map. Consider whether this opacity level provides sufficient contrast for the panel contents while maintaining adequate map visibility, especially for users who need to see map details behind the panel.

Suggested change
opacity: 0.85
opacity: 0.2

Copilot uses AI. Check for mistakes.
QGCLabel {
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
text: _missionController.currentPlanViewItem.commandName
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

Potential null pointer access: _missionController.currentPlanViewItem is not checked for null before accessing .commandName. This could cause a runtime error if currentPlanViewItem is null when this component is displayed.

Suggested change
text: _missionController.currentPlanViewItem.commandName
text: _missionController.currentPlanViewItem ? _missionController.currentPlanViewItem.commandName : ""

Copilot uses AI. Check for mistakes.
Comment on lines +723 to +738
QGCColoredImage {
Layout.fillHeight: true
Layout.preferredWidth: height
source: "/InstrumentValueIcons/backward.svg"
color: qgcPal.buttonText

MouseArea {
anchors.fill: parent
onClicked: {
if (_missionController.currentPlanViewVIIndex > 1) {
let prevItem = _missionController.visualItems.get(_missionController.currentPlanViewVIIndex - 1)
_missionController.setCurrentPlanViewSeqNum(prevItem.sequenceNumber, false)
}
}
}
}
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

Missing visual feedback: The Previous navigation button should have visual indication when it's at the boundary (e.g., reduced opacity or disabled state) to inform users when they can't navigate further backward. Consider adding enabled: _missionController.currentPlanViewVIIndex > 1 and adjust the color or opacity based on the enabled state.

Copilot uses AI. Check for mistakes.
Comment on lines +746 to +761
QGCColoredImage {
Layout.fillHeight: true
Layout.preferredWidth: height
source: "/InstrumentValueIcons/forward.svg"
color: qgcPal.buttonText

MouseArea {
anchors.fill: parent
onClicked: {
if (_missionController.currentPlanViewVIIndex < _missionController.visualItems.count - 1) {
let nextItem = _missionController.visualItems.get(_missionController.currentPlanViewVIIndex + 1)
_missionController.setCurrentPlanViewSeqNum(nextItem.sequenceNumber, false)
}
}
}
}
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

Missing visual feedback: The Next navigation button should have visual indication when it's at the boundary (e.g., reduced opacity or disabled state) to inform users when they can't navigate further forward. Consider adding enabled: _missionController.currentPlanViewVIIndex < _missionController.visualItems.count - 1 and adjust the color or opacity based on the enabled state.

Copilot uses AI. Check for mistakes.

signal clicked
signal remove
signal selectNextNotReadyItem
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

Removed signal still in use: The clicked signal declaration was removed, but the signal is still being emitted elsewhere in the file (line 58: _root.clicked()). This will cause a runtime error when the MouseArea's onClicked handler is triggered. Either restore the signal clicked declaration or ensure the emission at line 58 is also removed.

Suggested change
signal selectNextNotReadyItem
signal selectNextNotReadyItem
signal clicked

Copilot uses AI. Check for mistakes.
@DonLakeFlyer DonLakeFlyer reopened this Dec 6, 2025
@DonLakeFlyer DonLakeFlyer merged commit 971f363 into master Dec 6, 2025
20 of 24 checks passed
@DonLakeFlyer DonLakeFlyer deleted the MorePlan branch December 6, 2025 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants