no longer lose operator profile selection when making other changes to a node

This commit is contained in:
stopflock
2026-02-10 18:28:07 -06:00
parent 2e0dcb1b2b
commit 19b3ca236e
6 changed files with 20 additions and 6 deletions

View File

@@ -1,4 +1,9 @@
{ {
"2.7.1": {
"content": [
"• Fixed operator profile selection being lost when moving node position, adjusting direction, or changing profiles"
]
},
"2.6.4": { "2.6.4": {
"content": [ "content": [
"• Added imperial units support (miles, feet) in addition to metric units (km, meters)", "• Added imperial units support (miles, feet) in addition to metric units (km, meters)",

View File

@@ -447,6 +447,7 @@ class AppState extends ChangeNotifier {
Map<String, String>? refinedTags, Map<String, String>? refinedTags,
Map<String, String>? additionalExistingTags, Map<String, String>? additionalExistingTags,
String? changesetComment, String? changesetComment,
bool updateOperatorProfile = false,
}) { }) {
_sessionState.updateSession( _sessionState.updateSession(
directionDeg: directionDeg, directionDeg: directionDeg,
@@ -456,6 +457,7 @@ class AppState extends ChangeNotifier {
refinedTags: refinedTags, refinedTags: refinedTags,
additionalExistingTags: additionalExistingTags, additionalExistingTags: additionalExistingTags,
changesetComment: changesetComment, changesetComment: changesetComment,
updateOperatorProfile: updateOperatorProfile,
); );
// Check tutorial completion if position changed // Check tutorial completion if position changed
@@ -473,6 +475,7 @@ class AppState extends ChangeNotifier {
Map<String, String>? refinedTags, Map<String, String>? refinedTags,
Map<String, String>? additionalExistingTags, Map<String, String>? additionalExistingTags,
String? changesetComment, String? changesetComment,
bool updateOperatorProfile = false,
}) { }) {
_sessionState.updateEditSession( _sessionState.updateEditSession(
directionDeg: directionDeg, directionDeg: directionDeg,
@@ -483,6 +486,7 @@ class AppState extends ChangeNotifier {
refinedTags: refinedTags, refinedTags: refinedTags,
additionalExistingTags: additionalExistingTags, additionalExistingTags: additionalExistingTags,
changesetComment: changesetComment, changesetComment: changesetComment,
updateOperatorProfile: updateOperatorProfile,
); );
// Check tutorial completion if position changed // Check tutorial completion if position changed

View File

@@ -72,7 +72,7 @@ const Duration kOverpassQueryTimeout = Duration(seconds: 45); // Timeout for Ove
const String kSuspectedLocationsCsvUrl = 'https://alprwatch.org/suspected-locations/deflock-latest.csv'; const String kSuspectedLocationsCsvUrl = 'https://alprwatch.org/suspected-locations/deflock-latest.csv';
// Development/testing features - set to false for production builds // Development/testing features - set to false for production builds
const bool kEnableDevelopmentModes = false; // Set to false to hide sandbox/simulate modes and force production mode const bool kEnableDevelopmentModes = true; // Set to false to hide sandbox/simulate modes and force production mode
// Navigation features - set to false to hide navigation UI elements while in development // Navigation features - set to false to hide navigation UI elements while in development
const bool kEnableNavigationFeatures = true; // Hide navigation until fully implemented const bool kEnableNavigationFeatures = true; // Hide navigation until fully implemented

View File

@@ -215,6 +215,7 @@ class SessionState extends ChangeNotifier {
Map<String, String>? refinedTags, Map<String, String>? refinedTags,
Map<String, String>? additionalExistingTags, Map<String, String>? additionalExistingTags,
String? changesetComment, String? changesetComment,
bool updateOperatorProfile = false,
}) { }) {
if (_session == null) return; if (_session == null) return;
@@ -232,7 +233,8 @@ class SessionState extends ChangeNotifier {
); );
dirty = true; dirty = true;
} }
if (operatorProfile != _session!.operatorProfile) { // Only update operator profile when explicitly requested
if (updateOperatorProfile && operatorProfile != _session!.operatorProfile) {
_session!.operatorProfile = operatorProfile; _session!.operatorProfile = operatorProfile;
dirty = true; dirty = true;
} }
@@ -264,6 +266,7 @@ class SessionState extends ChangeNotifier {
Map<String, String>? refinedTags, Map<String, String>? refinedTags,
Map<String, String>? additionalExistingTags, Map<String, String>? additionalExistingTags,
String? changesetComment, String? changesetComment,
bool updateOperatorProfile = false,
}) { }) {
if (_editSession == null) return; if (_editSession == null) return;
@@ -282,9 +285,9 @@ class SessionState extends ChangeNotifier {
// Handle direction requirements when profile changes // Handle direction requirements when profile changes
_handleDirectionRequirementsOnProfileChange(oldProfile, profile); _handleDirectionRequirementsOnProfileChange(oldProfile, profile);
// When profile changes but operator profile not explicitly provided, // When profile changes and operator profile not being explicitly updated,
// restore the detected operator profile (if any) // restore the detected operator profile (if any)
if (operatorProfile == null && _detectedOperatorProfile != null) { if (!updateOperatorProfile && _detectedOperatorProfile != null) {
_editSession!.operatorProfile = _detectedOperatorProfile; _editSession!.operatorProfile = _detectedOperatorProfile;
} }
@@ -309,8 +312,8 @@ class SessionState extends ChangeNotifier {
dirty = true; dirty = true;
} }
// Only update operator profile if explicitly provided (including null) and different from current // Only update operator profile when explicitly requested
if (operatorProfile != _editSession!.operatorProfile) { if (updateOperatorProfile && operatorProfile != _editSession!.operatorProfile) {
_editSession!.operatorProfile = operatorProfile; // This can be null _editSession!.operatorProfile = operatorProfile; // This can be null
dirty = true; dirty = true;
} }

View File

@@ -448,6 +448,7 @@ class _AddNodeSheetState extends State<AddNodeSheet> {
operatorProfile: result.operatorProfile, operatorProfile: result.operatorProfile,
refinedTags: result.refinedTags, refinedTags: result.refinedTags,
changesetComment: result.changesetComment, changesetComment: result.changesetComment,
updateOperatorProfile: true,
); );
} }
} }

View File

@@ -503,6 +503,7 @@ class _EditNodeSheetState extends State<EditNodeSheet> {
refinedTags: result.refinedTags, refinedTags: result.refinedTags,
additionalExistingTags: result.additionalExistingTags, additionalExistingTags: result.additionalExistingTags,
changesetComment: result.changesetComment, changesetComment: result.changesetComment,
updateOperatorProfile: true,
); );
} }
} }