Disable deletion of nodes attached to ways/relations, add option for visibility of WIP extraction feature

This commit is contained in:
stopflock
2025-11-20 21:17:06 -06:00
parent c77ea96eaf
commit 492cf57520
3 changed files with 21 additions and 16 deletions

View File

@@ -65,6 +65,9 @@ const bool kEnableNavigationFeatures = kEnableDevelopmentModes; // Hide navigati
// Node editing features - set to false to temporarily disable editing
const bool kEnableNodeEdits = true; // Set to false to temporarily disable node editing
// Node extraction features - set to false to hide extract functionality for constrained nodes
const bool kEnableNodeExtraction = false; // Set to true to enable extract from way/relation feature (WIP)
/// Navigation availability: only dev builds, and only when online
bool enableNavigationFeatures({required bool offlineMode}) {
if (!kEnableDevelopmentModes) {

View File

@@ -219,20 +219,22 @@ class EditNodeSheet extends StatelessWidget {
padding: const EdgeInsets.fromLTRB(16, 0, 16, 12),
child: Column(
children: [
// Extract from way checkbox
CheckboxListTile(
title: Text(locService.t('editNode.extractFromWay')),
subtitle: Text(locService.t('editNode.extractFromWaySubtitle')),
value: session.extractFromWay,
onChanged: (value) {
appState.updateEditSession(extractFromWay: value);
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.zero,
),
const SizedBox(height: 8),
// Constraint info message (only show if extract is not checked)
if (!session.extractFromWay) ...[
// Extract from way checkbox (only show if enabled in dev config)
if (kEnableNodeExtraction) ...[
CheckboxListTile(
title: Text(locService.t('editNode.extractFromWay')),
subtitle: Text(locService.t('editNode.extractFromWaySubtitle')),
value: session.extractFromWay,
onChanged: (value) {
appState.updateEditSession(extractFromWay: value);
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.zero,
),
const SizedBox(height: 8),
],
// Constraint info message (only show if extract is not checked or not enabled)
if (!kEnableNodeExtraction || !session.extractFromWay) ...[
Row(
children: [
const Icon(Icons.info_outline, size: 20),

View File

@@ -209,12 +209,12 @@ class NodeTagSheet extends StatelessWidget {
),
const SizedBox(width: 8),
ElevatedButton.icon(
onPressed: _deleteNode,
onPressed: node.isConstrained ? null : _deleteNode,
icon: const Icon(Icons.delete, size: 18),
label: Text(locService.t('actions.delete')),
style: ElevatedButton.styleFrom(
minimumSize: const Size(0, 36),
foregroundColor: Colors.red,
foregroundColor: node.isConstrained ? null : Colors.red,
),
),
const SizedBox(width: 12),