Skip to content

Conversation

@DonLakeFlyer
Copy link
Contributor

  • When Mission Status is collapsed a new button is added to ToolStrip to expand
  • Hamburger icon in toolbar shows: Save as KML, Download

New toolbar:
Screenshot 2025-12-16 at 8 21 56 PM

Expand Mission Status:
Screenshot 2025-12-16 at 8 19 29 PM

Copilot AI review requested due to automatic review settings December 17, 2025 04:32
Copy link
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 redesigns the Plan View toolbar to improve usability by consolidating controls, adding visual icons, and introducing a hamburger menu for less-frequently-used actions. When the Mission Status panel is collapsed, a new expand button appears in the ToolStrip. The changes align with the goal of creating a cleaner, more intuitive toolbar interface while maintaining all existing functionality.

Key changes include:

  • Toolbar buttons now display icons (Open, Save, Upload, Clear) with consistent visual design
  • Less-frequent actions (Save as KML, Download) moved to a hamburger menu dropdown
  • Mission Status panel can be expanded via a new "Stats" button in the ToolStrip when collapsed
  • QGCButton component enhanced to better support icon-only and icon-with-text configurations

Reviewed changes

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

Show a summary per file
File Description
src/QmlControls/ToolStrip.qml Simplified QGCFlickable anchoring from explicit edges to anchors.fill for cleaner code
src/QmlControls/QGCButton.qml Refactored property ordering, adjusted icon sizing and vertical padding calculation to accommodate icons
src/QmlControls/PlanViewRightPanel.qml Removed unnecessary topMargin to simplify layout
src/QmlControls/PlanView.qml Added "Stats" expand button to ToolStrip, refactored Mission Status visibility logic with new hidden property and showMissionStatus function
src/QmlControls/PlanToolBarIndicators.qml Major restructure: removed Vehicle/Storage section labels, added icons to buttons, moved Save as KML and Download to hamburger dropdown menu
resources/UploadToVehicle.svg New SVG icon for Upload button featuring upward arrow in circle
resources/TrashCan.svg New SVG icon for Clear button
resources/SaveToDisk.svg New SVG icon for Save/Save As button
qgcresources.qrc Registered three new SVG resources

Comment on lines +37 to +38
property int _verticalPadding: Math.round(ScreenTools.defaultFontPixelHeight * heightFactor) - (iconSource === "" ? 0 : (_iconHeight - ScreenTools.defaultFontPixelHeight) / 2)
property real _iconHeight: text.height * 1.5
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The _verticalPadding calculation has a circular dependency issue. It depends on _iconHeight which depends on text.height, but text.height may not be initialized when _verticalPadding is first calculated. This could lead to incorrect padding values, especially on initial render. Consider using a fixed value or ScreenTools.defaultFontPixelHeight instead of text.height for the icon height calculation.

Copilot uses AI. Check for mistakes.
visible: !hidden && _editingLayer == _layerMission && QGroundControl.corePlugin.options.showMissionStatus

property bool _missionStatusVisible: _planViewSettings.showMissionItemStatus.rawValue
readonly property bool hidden: _planViewSettings.showMissionItemStatus.rawValue ? false : true
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The hidden property uses a double negation pattern (? false : true) which is unnecessarily complex. This can be simplified to: readonly property bool hidden: !_planViewSettings.showMissionItemStatus.rawValue. This makes the code more readable and maintainable.

Copilot uses AI. Check for mistakes.

function _toggleMissionStatsVisibility() {
function _toggleMissionStatusVisibility() {
_planViewSettings.showMissionItemStatus.rawValue = _planViewSettings.showMissionItemStatus.rawValue ? false : true
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The toggle function uses a ternary operator to toggle a boolean value, which is unnecessarily complex. This can be simplified to: _planViewSettings.showMissionItemStatus.rawValue = !_planViewSettings.showMissionItemStatus.rawValue. This makes the intent clearer and is more maintainable.

Copilot uses AI. Check for mistakes.
id: uploadButton
text: qsTr("Upload")
iconSource: "/res/UploadToVehicle.svg"
enabled: _utmspEnabled ? (!_syncInProgress && UTMSPStateStorage.enableMissionUploadButton) : (!_syncInProgress && _hasPlanItems)
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The enabled condition has redundant parentheses around each branch of the ternary operator. These can be simplified from (_utmspEnabled ? (!_syncInProgress && UTMSPStateStorage.enableMissionUploadButton) : (!_syncInProgress && _hasPlanItems)) to _utmspEnabled ? !_syncInProgress && UTMSPStateStorage.enableMissionUploadButton : !_syncInProgress && _hasPlanItems for better readability.

Copilot uses AI. Check for mistakes.
QGCButton {
Layout.fillWidth: true
text: qsTr("Download")
enabled: _utmspEnabled ? !_syncInProgress && UTMSPStateStorage.enableMissionDownloadButton : !_syncInProgress
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The enabled condition has unnecessary parentheses. Consider simplifying from _utmspEnabled ? !_syncInProgress && UTMSPStateStorage.enableMissionDownloadButton : !_syncInProgress to _utmspEnabled ? !_syncInProgress && UTMSPStateStorage.enableMissionDownloadButton : !_syncInProgress for consistency with other similar conditions.

Copilot uses AI. Check for mistakes.
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