From 665c921652550f8fd4a02bd5323d2d5e2c362050 Mon Sep 17 00:00:00 2001 From: VeryUsual <72707293+VeryUsual@users.noreply.github.com> Date: Sun, 5 Apr 2026 00:27:15 +0000 Subject: [PATCH 1/3] add functionality to disable quest types right in uh --- .../quests/AbstractOsmQuestForm.kt | 19 +++++++++++++++++++ app/src/androidMain/res/values-en/strings.xml | 5 +++++ app/src/androidMain/res/values/strings.xml | 5 +++++ .../composeResources/values-en/strings.xml | 5 +++++ .../composeResources/values/strings.xml | 5 +++++ 5 files changed, 39 insertions(+) diff --git a/app/src/androidMain/kotlin/de/westnordost/streetcomplete/quests/AbstractOsmQuestForm.kt b/app/src/androidMain/kotlin/de/westnordost/streetcomplete/quests/AbstractOsmQuestForm.kt index ee15067575..bef2488d15 100644 --- a/app/src/androidMain/kotlin/de/westnordost/streetcomplete/quests/AbstractOsmQuestForm.kt +++ b/app/src/androidMain/kotlin/de/westnordost/streetcomplete/quests/AbstractOsmQuestForm.kt @@ -39,6 +39,7 @@ import de.westnordost.streetcomplete.data.osmnotes.edits.NoteEditsController import de.westnordost.streetcomplete.data.quest.QuestKey import de.westnordost.streetcomplete.data.visiblequests.HideQuestController import de.westnordost.streetcomplete.data.visiblequests.QuestsHiddenController +import de.westnordost.streetcomplete.data.visiblequests.VisibleEditTypeController import de.westnordost.streetcomplete.osm.applyReplacePlaceTo import de.westnordost.streetcomplete.osm.isPlace import de.westnordost.streetcomplete.osm.isPlaceOrDisusedPlace @@ -71,6 +72,7 @@ abstract class AbstractOsmQuestForm : AbstractQuestForm(), IsShowingQuestDeta private val elementEditsController: ElementEditsController by inject() private val noteEditsController: NoteEditsController by inject() private val hiddenQuestsController: QuestsHiddenController by inject() + private val visibleEditTypeController: VisibleEditTypeController by inject() private val featureDictionaryLazy: Lazy by inject(named("FeatureDictionaryLazy")) private val mapDataWithEditsSource: MapDataWithEditsSource by inject() private val surveyChecker: SurveyChecker by inject() @@ -177,6 +179,10 @@ abstract class AbstractOsmQuestForm : AbstractQuestForm(), IsShowingQuestDeta answers.add(AnswerItem(R.string.move_node) { onClickMoveNodeAnswer() }) } + if (questType.visibilityEditable) { + answers.add(AnswerItem(R.string.quest_generic_answer_disable_this_quest_type) { onClickDisableQuestType() }) + } + answers.addAll(otherAnswers) return answers } @@ -247,6 +253,19 @@ abstract class AbstractOsmQuestForm : AbstractQuestForm(), IsShowingQuestDeta } } + private fun onClickDisableQuestType() { + context?.let { AlertDialog.Builder(it) + .setTitle(R.string.quest_disable_quest_type_title) + .setMessage(R.string.quest_disable_quest_type_message) + .setNegativeButton(android.R.string.cancel, null) + .setPositiveButton(R.string.quest_disable_quest_type_yes) { _, _ -> + visibleEditTypeController.setVisibility(questType, false) + hideQuest() + } + .show() + } + } + protected fun applyAnswer(answer: T) { viewLifecycleScope.launch { solve(UpdateElementTagsAction(element, createQuestChanges(answer))) diff --git a/app/src/androidMain/res/values-en/strings.xml b/app/src/androidMain/res/values-en/strings.xml index ae6c346405..f4bf53670e 100644 --- a/app/src/androidMain/res/values-en/strings.xml +++ b/app/src/androidMain/res/values-en/strings.xml @@ -163,6 +163,7 @@ The info you enter is directly added to OpenStreetMap in your name, without the Can’t say… It does not exist… + Disable this quest type… Are you sure that it does not exist, not even at a slightly different location? If you’re not sure, leave a note instead. It does not exist Leave note @@ -265,6 +266,10 @@ Additionally, some overlays allow you to add new data at the position of a displ StreetMeasure didn’t return a measurement. You could use a tape measure instead, but that might be a little awkward, after all. + Disable this quest type? + This quest type will be disabled for the current preset. You can re-enable it in the settings. + Disable + You have %1$d unread messages in your inbox diff --git a/app/src/androidMain/res/values/strings.xml b/app/src/androidMain/res/values/strings.xml index ae6c346405..f4bf53670e 100644 --- a/app/src/androidMain/res/values/strings.xml +++ b/app/src/androidMain/res/values/strings.xml @@ -163,6 +163,7 @@ The info you enter is directly added to OpenStreetMap in your name, without the Can’t say… It does not exist… + Disable this quest type… Are you sure that it does not exist, not even at a slightly different location? If you’re not sure, leave a note instead. It does not exist Leave note @@ -265,6 +266,10 @@ Additionally, some overlays allow you to add new data at the position of a displ StreetMeasure didn’t return a measurement. You could use a tape measure instead, but that might be a little awkward, after all. + Disable this quest type? + This quest type will be disabled for the current preset. You can re-enable it in the settings. + Disable + You have %1$d unread messages in your inbox diff --git a/app/src/commonMain/composeResources/values-en/strings.xml b/app/src/commonMain/composeResources/values-en/strings.xml index ae6c346405..f4bf53670e 100644 --- a/app/src/commonMain/composeResources/values-en/strings.xml +++ b/app/src/commonMain/composeResources/values-en/strings.xml @@ -163,6 +163,7 @@ The info you enter is directly added to OpenStreetMap in your name, without the Can’t say… It does not exist… + Disable this quest type… Are you sure that it does not exist, not even at a slightly different location? If you’re not sure, leave a note instead. It does not exist Leave note @@ -265,6 +266,10 @@ Additionally, some overlays allow you to add new data at the position of a displ StreetMeasure didn’t return a measurement. You could use a tape measure instead, but that might be a little awkward, after all. + Disable this quest type? + This quest type will be disabled for the current preset. You can re-enable it in the settings. + Disable + You have %1$d unread messages in your inbox diff --git a/app/src/commonMain/composeResources/values/strings.xml b/app/src/commonMain/composeResources/values/strings.xml index ae6c346405..f4bf53670e 100644 --- a/app/src/commonMain/composeResources/values/strings.xml +++ b/app/src/commonMain/composeResources/values/strings.xml @@ -163,6 +163,7 @@ The info you enter is directly added to OpenStreetMap in your name, without the Can’t say… It does not exist… + Disable this quest type… Are you sure that it does not exist, not even at a slightly different location? If you’re not sure, leave a note instead. It does not exist Leave note @@ -265,6 +266,10 @@ Additionally, some overlays allow you to add new data at the position of a displ StreetMeasure didn’t return a measurement. You could use a tape measure instead, but that might be a little awkward, after all. + Disable this quest type? + This quest type will be disabled for the current preset. You can re-enable it in the settings. + Disable + You have %1$d unread messages in your inbox From d24bbb96d18332dc60e48c60865f672d72c2307c Mon Sep 17 00:00:00 2001 From: VeryUsual <72707293+VeryUsual@users.noreply.github.com> Date: Wed, 8 Apr 2026 20:19:50 +0000 Subject: [PATCH 2/3] moved disable this quest from uh to can't say --- .../streetcomplete/quests/AbstractOsmQuestForm.kt | 9 +++------ app/src/androidMain/res/values-en/strings.xml | 5 +++-- app/src/androidMain/res/values/strings.xml | 5 +++-- .../commonMain/composeResources/values-en/strings.xml | 5 +++-- app/src/commonMain/composeResources/values/strings.xml | 5 +++-- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/app/src/androidMain/kotlin/de/westnordost/streetcomplete/quests/AbstractOsmQuestForm.kt b/app/src/androidMain/kotlin/de/westnordost/streetcomplete/quests/AbstractOsmQuestForm.kt index bef2488d15..b053a75acf 100644 --- a/app/src/androidMain/kotlin/de/westnordost/streetcomplete/quests/AbstractOsmQuestForm.kt +++ b/app/src/androidMain/kotlin/de/westnordost/streetcomplete/quests/AbstractOsmQuestForm.kt @@ -179,10 +179,6 @@ abstract class AbstractOsmQuestForm : AbstractQuestForm(), IsShowingQuestDeta answers.add(AnswerItem(R.string.move_node) { onClickMoveNodeAnswer() }) } - if (questType.visibilityEditable) { - answers.add(AnswerItem(R.string.quest_generic_answer_disable_this_quest_type) { onClickDisableQuestType() }) - } - answers.addAll(otherAnswers) return answers } @@ -225,8 +221,9 @@ abstract class AbstractOsmQuestForm : AbstractQuestForm(), IsShowingQuestDeta context?.let { AlertDialog.Builder(it) .setTitle(R.string.quest_leave_new_note_title) .setMessage(R.string.quest_leave_new_note_description) - .setNegativeButton(R.string.quest_leave_new_note_no) { _, _ -> hideQuest() } - .setPositiveButton(R.string.quest_leave_new_note_yes) { _, _ -> composeNote() } + .setNegativeButton(R.string.quest_cant_say_hide_quest) { _, _ -> hideQuest() } + .setPositiveButton(R.string.leave_note) { _, _ -> composeNote() } + .setNeutralButton(R.string.quest_generic_answer_disable_this_quest_type) { _, _ -> onClickDisableQuestType() } .show() } } diff --git a/app/src/androidMain/res/values-en/strings.xml b/app/src/androidMain/res/values-en/strings.xml index f4bf53670e..ab94a635f7 100644 --- a/app/src/androidMain/res/values-en/strings.xml +++ b/app/src/androidMain/res/values-en/strings.xml @@ -163,7 +163,8 @@ The info you enter is directly added to OpenStreetMap in your name, without the Can’t say… It does not exist… - Disable this quest type… + Disable + Hide this quest Are you sure that it does not exist, not even at a slightly different location? If you’re not sure, leave a note instead. It does not exist Leave note @@ -267,7 +268,7 @@ Additionally, some overlays allow you to add new data at the position of a displ You could use a tape measure instead, but that might be a little awkward, after all. Disable this quest type? - This quest type will be disabled for the current preset. You can re-enable it in the settings. + This will disable this quest type for the current preset. You won't see quests of this type anymore, but you can re-enable it in the settings. Disable diff --git a/app/src/androidMain/res/values/strings.xml b/app/src/androidMain/res/values/strings.xml index f4bf53670e..ab94a635f7 100644 --- a/app/src/androidMain/res/values/strings.xml +++ b/app/src/androidMain/res/values/strings.xml @@ -163,7 +163,8 @@ The info you enter is directly added to OpenStreetMap in your name, without the Can’t say… It does not exist… - Disable this quest type… + Disable + Hide this quest Are you sure that it does not exist, not even at a slightly different location? If you’re not sure, leave a note instead. It does not exist Leave note @@ -267,7 +268,7 @@ Additionally, some overlays allow you to add new data at the position of a displ You could use a tape measure instead, but that might be a little awkward, after all. Disable this quest type? - This quest type will be disabled for the current preset. You can re-enable it in the settings. + This will disable this quest type for the current preset. You won't see quests of this type anymore, but you can re-enable it in the settings. Disable diff --git a/app/src/commonMain/composeResources/values-en/strings.xml b/app/src/commonMain/composeResources/values-en/strings.xml index f4bf53670e..ab94a635f7 100644 --- a/app/src/commonMain/composeResources/values-en/strings.xml +++ b/app/src/commonMain/composeResources/values-en/strings.xml @@ -163,7 +163,8 @@ The info you enter is directly added to OpenStreetMap in your name, without the Can’t say… It does not exist… - Disable this quest type… + Disable + Hide this quest Are you sure that it does not exist, not even at a slightly different location? If you’re not sure, leave a note instead. It does not exist Leave note @@ -267,7 +268,7 @@ Additionally, some overlays allow you to add new data at the position of a displ You could use a tape measure instead, but that might be a little awkward, after all. Disable this quest type? - This quest type will be disabled for the current preset. You can re-enable it in the settings. + This will disable this quest type for the current preset. You won't see quests of this type anymore, but you can re-enable it in the settings. Disable diff --git a/app/src/commonMain/composeResources/values/strings.xml b/app/src/commonMain/composeResources/values/strings.xml index f4bf53670e..ab94a635f7 100644 --- a/app/src/commonMain/composeResources/values/strings.xml +++ b/app/src/commonMain/composeResources/values/strings.xml @@ -163,7 +163,8 @@ The info you enter is directly added to OpenStreetMap in your name, without the Can’t say… It does not exist… - Disable this quest type… + Disable + Hide this quest Are you sure that it does not exist, not even at a slightly different location? If you’re not sure, leave a note instead. It does not exist Leave note @@ -267,7 +268,7 @@ Additionally, some overlays allow you to add new data at the position of a displ You could use a tape measure instead, but that might be a little awkward, after all. Disable this quest type? - This quest type will be disabled for the current preset. You can re-enable it in the settings. + This will disable this quest type for the current preset. You won't see quests of this type anymore, but you can re-enable it in the settings. Disable From 1592766a9a70feb03d6c97a8e321eb7fa9823b54 Mon Sep 17 00:00:00 2001 From: VeryUsual <72707293+VeryUsual@users.noreply.github.com> Date: Thu, 16 Apr 2026 12:36:39 +0000 Subject: [PATCH 3/3] add option to disable quest types in note dialog --- .../quests/AbstractOsmQuestForm.kt | 19 ++++++++++++------- app/src/androidMain/res/values/strings.xml | 1 + .../composeResources/values-en/strings.xml | 1 + .../composeResources/values/strings.xml | 1 + 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/src/androidMain/kotlin/de/westnordost/streetcomplete/quests/AbstractOsmQuestForm.kt b/app/src/androidMain/kotlin/de/westnordost/streetcomplete/quests/AbstractOsmQuestForm.kt index b053a75acf..657fadefab 100644 --- a/app/src/androidMain/kotlin/de/westnordost/streetcomplete/quests/AbstractOsmQuestForm.kt +++ b/app/src/androidMain/kotlin/de/westnordost/streetcomplete/quests/AbstractOsmQuestForm.kt @@ -218,13 +218,18 @@ abstract class AbstractOsmQuestForm : AbstractQuestForm(), IsShowingQuestDeta } protected fun onClickCantSay() { - context?.let { AlertDialog.Builder(it) - .setTitle(R.string.quest_leave_new_note_title) - .setMessage(R.string.quest_leave_new_note_description) - .setNegativeButton(R.string.quest_cant_say_hide_quest) { _, _ -> hideQuest() } - .setPositiveButton(R.string.leave_note) { _, _ -> composeNote() } - .setNeutralButton(R.string.quest_generic_answer_disable_this_quest_type) { _, _ -> onClickDisableQuestType() } - .show() + context?.let { ctx -> + AlertDialog.Builder(ctx) + .setTitle(R.string.quest_leave_new_note_title) + .setMessage( + ctx.getString(R.string.quest_leave_new_note_description) + + "\n\n" + + ctx.getString(R.string.quest_leave_new_note_disable_info) + ) + .setNegativeButton(R.string.quest_cant_say_hide_quest) { _, _ -> hideQuest() } + .setPositiveButton(R.string.leave_note) { _, _ -> composeNote() } + .setNeutralButton(R.string.quest_generic_answer_disable_this_quest_type) { _, _ -> onClickDisableQuestType() } + .show() } } diff --git a/app/src/androidMain/res/values/strings.xml b/app/src/androidMain/res/values/strings.xml index ab94a635f7..e3b654e145 100644 --- a/app/src/androidMain/res/values/strings.xml +++ b/app/src/androidMain/res/values/strings.xml @@ -151,6 +151,7 @@ The info you enter is directly added to OpenStreetMap in your name, without the Leave a note instead? You can leave a public note for other mappers to resolve at this location, or hide this quest for yourself only + Alternatively, you can disable all quests of this type. This can be changed again in the settings. Leave note Hide In this case, you need to leave a note in which you explain the situation. diff --git a/app/src/commonMain/composeResources/values-en/strings.xml b/app/src/commonMain/composeResources/values-en/strings.xml index ab94a635f7..e3b654e145 100644 --- a/app/src/commonMain/composeResources/values-en/strings.xml +++ b/app/src/commonMain/composeResources/values-en/strings.xml @@ -151,6 +151,7 @@ The info you enter is directly added to OpenStreetMap in your name, without the Leave a note instead? You can leave a public note for other mappers to resolve at this location, or hide this quest for yourself only + Alternatively, you can disable all quests of this type. This can be changed again in the settings. Leave note Hide In this case, you need to leave a note in which you explain the situation. diff --git a/app/src/commonMain/composeResources/values/strings.xml b/app/src/commonMain/composeResources/values/strings.xml index ab94a635f7..e3b654e145 100644 --- a/app/src/commonMain/composeResources/values/strings.xml +++ b/app/src/commonMain/composeResources/values/strings.xml @@ -151,6 +151,7 @@ The info you enter is directly added to OpenStreetMap in your name, without the Leave a note instead? You can leave a public note for other mappers to resolve at this location, or hide this quest for yourself only + Alternatively, you can disable all quests of this type. This can be changed again in the settings. Leave note Hide In this case, you need to leave a note in which you explain the situation.