Skip to content

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

Open
xkello wants to merge 1 commit 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 1 commit 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

Copy link
Copy Markdown

Coverage Report for CI Build 33163588332

Coverage remained the same at 59.594%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 15723
Covered Lines: 9370
Line Coverage: 59.59%
Coverage Strength: 94.19 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


imageSource: __style.negativeMMSymbolImage
title: qsTr( "Delete photo?" )
description: qsTr( "Would you like to delete or unlink the photo? Deleting removes the photo from your project entirely, while unlinking keeps the photo in your project but removes it from this specific feature." )

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.

I think this message should also be conditionally changed to "Would you like to delete the photo?" to avoid confusion

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

2 participants