Remove special "existing tags" profile case; existing tags profile now empty.

This commit is contained in:
stopflock
2026-02-06 09:56:08 -06:00
parent c50d43e00c
commit 8804fdadf4
5 changed files with 25 additions and 38 deletions

View File

@@ -104,7 +104,6 @@ cp lib/keys.dart.example lib/keys.dart
## Roadmap
### Needed Bugfixes
- Temp. "existing" profile should pick up FOV if available from each direction
- Imperial units
- Clear search box after selecting first nav point
- Make submission guide scarier
@@ -119,7 +118,7 @@ cp lib/keys.dart.example lib/keys.dart
- Add ability to downvote suspected locations which are old enough
- Turn by turn navigation or at least swipe nav sheet up to see a list
- Import/Export map providers
- Import default profiles from the website to capture changes without pushing an update?
- Update default profiles from the website on launch to capture changes
### Future Features & Wishlist
- Tap direction slider to enter integer directly
@@ -130,15 +129,14 @@ cp lib/keys.dart.example lib/keys.dart
- Offline navigation (pending vector map tiles)
### Maybes
- "Universal Links" for better handling of profile import when app not installed?
- Icons/glyphs for profiles
- "Universal Links" for better handling of profile import when app is not installed
- Yellow ring for devices missing specific tag details
- Android Auto / CarPlay
- "Cache accumulating" offline area?
- "Offline areas" as tile provider?
- "Cache accumulating" offline area? Most recent / most viewed?
- Grab the full latest database for each profile just like for suspected locations (instead of overpass)?
- Optional custom icons for profiles to aid identification
- Custom device providers and OSM/Overpass alternatives
- Offer options for extracting nodes which are attached to a way/relation:
- Custom data providers? (OSM/Overpass alternatives)
- Offer options for extracting nodes which are attached to a way/relation?
- Auto extract (how?)
- Leave it alone (wrong answer unless user chooses intentionally)
- Manual cleanup (cognitive load for users)

View File

@@ -270,6 +270,19 @@ class NodeProfile {
/// Used as the default "<Existing tags>" option when editing nodes
/// All existing tags will flow through as additionalExistingTags
static NodeProfile createExistingTagsProfile(OsmNode node) {
// Calculate FOV from existing direction ranges if applicable
double? calculatedFov;
// If node has direction/FOV pairs, check if they all have the same FOV
if (node.directionFovPairs.isNotEmpty) {
final firstFov = node.directionFovPairs.first.fovDegrees;
// If all directions have the same FOV, use it for the profile
if (node.directionFovPairs.every((df) => df.fovDegrees == firstFov)) {
calculatedFov = firstFov;
}
}
return NodeProfile(
id: 'temp-empty-${node.id}',
name: '<Existing tags>', // Will be localized in UI
@@ -278,6 +291,7 @@ class NodeProfile {
requiresDirection: true,
submittable: true,
editable: false,
fov: calculatedFov, // Use calculated FOV from existing direction ranges
);
}

View File

@@ -319,9 +319,9 @@ class SessionState extends ChangeNotifier {
dirty = true;
}
// Only update operator profile if explicitly provided or different from current
if (operatorProfile != null && operatorProfile != _editSession!.operatorProfile) {
_editSession!.operatorProfile = operatorProfile;
// Only update operator profile if explicitly provided (including null) and different from current
if (operatorProfile != _editSession!.operatorProfile) {
_editSession!.operatorProfile = operatorProfile; // This can be null
dirty = true;
}
if (target != null && target != _editSession!.target) {

View File

@@ -154,40 +154,28 @@ class _EditNodeSheetState extends State<EditNodeSheet> {
/// Check if the edit session has any actual changes compared to the original node
bool _hasActualChanges(EditNodeSession session) {
debugPrint('EditNodeSheet: Checking for actual changes...');
// Extract operation is always a change
if (session.extractFromWay) {
debugPrint('EditNodeSheet: Extract operation detected - changes found');
return true;
}
if (session.extractFromWay) return true;
// Check location change
const double tolerance = 0.0000001; // ~1cm precision
if ((session.target.latitude - session.originalNode.coord.latitude).abs() > tolerance ||
(session.target.longitude - session.originalNode.coord.longitude).abs() > tolerance) {
debugPrint('EditNodeSheet: Location change detected - changes found');
return true;
}
// Check direction changes
if (!_directionsEqual(session.directions, session.originalNode.directionDeg)) {
debugPrint('EditNodeSheet: Direction change detected - changes found');
return true;
}
// Check tag changes (including operator profile)
// Check tag changes (including operator profile and additional existing tags)
final originalTags = session.originalNode.tags;
final newTags = _getSessionCombinedTags(session);
debugPrint('EditNodeSheet: Original tags: $originalTags');
debugPrint('EditNodeSheet: New combined tags: $newTags');
if (!_tagsEqual(originalTags, newTags)) {
debugPrint('EditNodeSheet: Tag changes detected - changes found');
return true;
}
debugPrint('EditNodeSheet: No changes detected');
return false;
}
@@ -513,11 +501,6 @@ class _EditNodeSheetState extends State<EditNodeSheet> {
),
);
if (result != null) {
debugPrint('EditNodeSheet: Updating session from refine tags result');
debugPrint('EditNodeSheet: Profile: ${session.profile?.name}');
debugPrint('EditNodeSheet: AdditionalExistingTags: ${result.additionalExistingTags}');
debugPrint('EditNodeSheet: Current session additionalExistingTags: ${session.additionalExistingTags}');
appState.updateEditSession(
operatorProfile: result.operatorProfile,
refinedTags: result.refinedTags,

View File

@@ -101,7 +101,6 @@ class _RefineTagsSheetState extends State<RefineTagsSheet> {
// Use the additional existing tags calculated by SessionState when profile changed
if (widget.currentAdditionalExistingTags != null) {
_additionalExistingTags = widget.currentAdditionalExistingTags!.entries.toList();
debugPrint('RefineTagsSheet: Loaded ${_additionalExistingTags.length} additional existing tags from session');
return;
}
@@ -130,8 +129,6 @@ class _RefineTagsSheetState extends State<RefineTagsSheet> {
// Include this tag as an additional existing tag
_additionalExistingTags.add(MapEntry(key, value));
}
debugPrint('RefineTagsSheet: Fallback calculated ${_additionalExistingTags.length} additional existing tags');
}
/// Check if a tag should be skipped from additional existing tags
@@ -203,11 +200,6 @@ class _RefineTagsSheetState extends State<RefineTagsSheet> {
? Map<String, String>.fromEntries(_additionalExistingTags.where((e) => e.key.isNotEmpty))
: null;
debugPrint('RefineTagsSheet: Returning result');
debugPrint('RefineTagsSheet: additionalTags: $additionalTags');
debugPrint('RefineTagsSheet: _additionalExistingTags: $_additionalExistingTags');
debugPrint('RefineTagsSheet: _shouldShowAdditionalExistingTags: $_shouldShowAdditionalExistingTags');
Navigator.pop(context, RefineTagsResult(
operatorProfile: _selectedOperatorProfile,
refinedTags: _refinedTags,