Skip to content

Add check so unlink button won't show on a new feature - #4685

Open
xkello wants to merge 3 commits into
masterfrom
bugfix/remove-unlink-button-on-unsaved-feature
Open

Add check so unlink button won't show on a new feature#4685
xkello wants to merge 3 commits into
masterfrom
bugfix/remove-unlink-button-on-unsaved-feature

Conversation

@xkello

@xkello xkello commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Description

The "Unlink photo" option in the photo delete drawer was showing even when the feature hadn't been saved yet. Since an unsaved feature has no persisted attachment relation to unlink from, the option didn't make sense there.

Fixes: #4542

What changed

Exposed a new isNewFeature property on AttributeController (reusing the existing featureLayerPairChanged signal so it stays reactive). MMFormPhotoEditor passes this down as featureState to MMRemovePhotoDialog, which now hides the "Unlink photo" button when featureState === "add".

Behaviour

On a new, unsaved feature, the delete photo drawer now only shows "Delete photo". On an existing, saved feature, both "Delete photo" and "Unlink photo" still show as before.

Desktop:

image image


Android:

Screenshot_20260828-123943 Screenshot_20260828-124002

@xkello
xkello requested a review from Withalion August 28, 2026 10:47
@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 34199761084

Coverage decreased (-0.07%) to 59.55%

Details

  • Coverage decreased (-0.07%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 11 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

11 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
mm/core/merginapi.cpp 10 74.79%
mm/app/layerfeaturesmodel.cpp 1 81.77%

Coverage Stats

Coverage Status
Relevant Lines: 15723
Covered Lines: 9363
Line Coverage: 59.55%
Coverage Strength: 94.2 hits per line

💛 - Coveralls

@github-actions

Copy link
Copy Markdown

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 📬 Mergin Maps 72431 dmg Expires: 26/11/2026 #7243
linux Build 📬 Mergin Maps 72691 x86_64 Expires: 26/11/2026 #7269
win64 Build 📬 Mergin Maps 64451 win64 Expires: 26/11/2026 #6445
Android Build 📬 Mergin Maps 855351 APK [arm64-v8a] Expires: 26/11/2026 #8553
📬 Mergin Maps 855351 APK [arm64-v8a] Google Play Store #8553
Android Build 📬 Mergin Maps 855311 APK [armeabi-v7a] Expires: 26/11/2026 #8553
📬 Mergin Maps 855311 APK [armeabi-v7a] Google Play Store #8553
iOS Build 📬 Build number: 26.08.949511 #9495

Comment thread app/qml/dialogs/MMRemovePhotoDialog.qml Outdated

@Withalion Withalion 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.

And also the comment from Stefanos

Comment thread app/qml/dialogs/MMRemovePhotoDialog.qml Outdated
Comment thread app/qml/dialogs/MMRemovePhotoDialog.qml Outdated
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 📬 Mergin Maps 72611 dmg Expires: 03/12/2026 #7261
linux Build Build failed or not found. #7287
win64 Build 📬 Mergin Maps 64631 win64 Expires: 03/12/2026 #6463
Android Build 📬 Mergin Maps 857111 APK [armeabi-v7a] Expires: 03/12/2026 #8571
📬 Mergin Maps 857111 APK [armeabi-v7a] Google Play Store #8571
Android Build 📬 Mergin Maps 857151 APK [arm64-v8a] Expires: 03/12/2026 #8571
📬 Mergin Maps 857151 APK [arm64-v8a] Google Play Store #8571
iOS Build Build failed or not found. #9513

@xkello
xkello requested a review from Withalion September 7, 2026 06:52

@Withalion Withalion 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.

Please rebase on current master, so iOS build will pass

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 📬 Mergin Maps 72651 dmg Expires: 07/12/2026 #7265
linux Build 📬 Mergin Maps 72912 x86_64 Expires: 07/12/2026 #7291
win64 Build 📬 Mergin Maps 64671 win64 Expires: 07/12/2026 #6467
Android Build 📬 Mergin Maps 857551 APK [arm64-v8a] Expires: 07/12/2026 #8575
📬 Mergin Maps 857551 APK [arm64-v8a] Google Play Store #8575
Android Build 📬 Mergin Maps 857511 APK [armeabi-v7a] Expires: 07/12/2026 #8575
📬 Mergin Maps 857511 APK [armeabi-v7a] Google Play Store #8575
iOS Build 📬 Build number: 26.09.951711 #9517

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.

Unlinked photo stays unrenamed

3 participants