Skip to content

Fix white map sketching bugs#4578

Open
xkello wants to merge 3 commits into
masterfrom
bugfix/white-map-sketch
Open

Fix white map sketching bugs#4578
xkello wants to merge 3 commits into
masterfrom
bugfix/white-map-sketch

Conversation

@xkello

@xkello xkello commented Jul 2, 2026

Copy link
Copy Markdown

Description

This PR fixes several issues in map sketches related to color selection and eraser state:

  1. When opening map sketches and drawing with the preselected white color, the saved sketch would turn black instead of white.
  2. The selection highlight for the white color was displayed as black.
  3. When the eraser was selected, the previously selected color still appeared selected in the UI. This made it look like clicking the eraser again would deselect it and return to the previously selected color.
613566402-ed4f7c50-72a8-41ff-853e-bb0283c29ce1.mp4

Changes

  • Added explicit handling of the active sketch color.
  • The active color is now initialized from the first available sketch color when map settings are set.
  • The color picker now emits a color change request instead of changing internal state directly.
  • The sketch drawer now updates the sketching controller with the selected color and disables the eraser when a color is selected.
  • null is now used as fallback when the sketching controller or active color is not available.
  • Removed a few redundant QML blocks, including anchors that had no effect.

Final look

Screen_Recording_20260702-095514.mp4

@xkello xkello requested review from Copilot and tomasMizera and removed request for Copilot July 2, 2026 08:14
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 📬 Mergin Maps 70031 dmg Expires: 30/09/2026 #7003
linux Build 📬 Mergin Maps 70291 x86_64 Expires: 30/09/2026 #7029
win64 Build 📬 Mergin Maps 62011 win64 Expires: 30/09/2026 #6201
Android Build 📬 Mergin Maps 831351 APK [arm64-v8a] Expires: 30/09/2026 #8313
📬 Mergin Maps 831351 APK [arm64-v8a] Google Play Store #8313
Android Build 📬 Mergin Maps 831311 APK [armeabi-v7a] Expires: 30/09/2026 #8313
📬 Mergin Maps 831311 APK [armeabi-v7a] Google Play Store #8313
iOS Build 📬 Build number: 26.07.925511 #9255

@tomasMizera tomasMizera left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fix formatting and it is ready to merge :)

@tomasMizera tomasMizera added this to the 2026.3.0 milestone Jul 2, 2026
Comment thread app/qml/map/MMMapSketchesDrawer.qml Outdated
Comment on lines +83 to +84
colors: root.sketchingController?.availableColors() ?? null
activeColor: root.sketchingController?.activeColor ?? null

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

btw using ?? here doesn't make sense

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sketching controller can be undefined and often is at startup, but maybe that ?? null part could be skipped

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Seems to be working even without the ?? null parts. Removing it

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yep I was just pointing to the ?? null part, if we don't give it some specific default value on null/undefined it doesn't really makes sense to use the operator to "double guarantee" the value will be null

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 28578186222

Warning

No base build found for commit ec8fdc7 on master.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 59.026%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 15639
Covered Lines: 9231
Line Coverage: 59.03%
Coverage Strength: 97.82 hits per line

💛 - Coveralls

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 📬 Mergin Maps 70051 dmg Expires: 30/09/2026 #7005
linux Build 📬 Mergin Maps 70311 x86_64 Expires: 30/09/2026 #7031
win64 Build 📬 Mergin Maps 62031 win64 Expires: 30/09/2026 #6203
Android Build 📬 Mergin Maps 831511 APK [armeabi-v7a] Expires: 30/09/2026 #8315
📬 Mergin Maps 831511 APK [armeabi-v7a] Google Play Store #8315
Android Build 📬 Mergin Maps 831551 APK [arm64-v8a] Expires: 30/09/2026 #8315
📬 Mergin Maps 831551 APK [arm64-v8a] Google Play Store #8315
iOS Build 📬 Build number: 26.07.925711 #9257

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.

3 participants