Skip to content

feat: add indoor floor levels and localized description tags to AED details#36

Open
Amadeusz-P wants to merge 2 commits into
matisiekpl:mainfrom
Amadeusz-P:feat/level-and-description
Open

feat: add indoor floor levels and localized description tags to AED details#36
Amadeusz-P wants to merge 2 commits into
matisiekpl:mainfrom
Amadeusz-P:feat/level-and-description

Conversation

@Amadeusz-P

Copy link
Copy Markdown
Contributor

This Pull Request introduces support for indoor tagging properties (level and extended descriptions) parsed from OpenStreetMap data. These details are now properly surfaced across the application's data models, map markers, and user interface panels, making it significantly easier for users to locate AEDs hidden inside complex buildings, shopping malls, or multi-story public structures.
Key Changes & Features

  1. Data Model Upgrades (AED Model)

    Floor Level Support: Added an optional level property (String/int parsing) to map the standard OpenStreetMap level=* tag. This captures whether a device is on the ground floor (0), upstairs (1, 2), or in a basement (-1).

    Detailed Descriptions: Integrated description strings (description / description:pl / description:en fallback mapping) to store granular placement notes provided by mapping communities (e.g., "Next to the main reception desk" or "Inside the security guard booth").

  2. Data Sync & API Adjustments

    Updated the parsing logic responsible for converting raw OSM JSON/Overpass elements into the internal application state.

    Ensured null safety and fallback mechanisms so that older or incomplete external map entries without indoor data do not trigger rendering crashes.

  3. UI Enhancements (Details Panel & Cards)

    Level Badge/Label: Added a dedicated visual indicator in the AED detail bottom sheet displaying the floor number when available.

    Location Description Section: Created a text block that surfaces the exact description tag below the main title, ensuring that crucial visual identifiers are legible during emergencies.

Type of Change

[x] ✨ New feature (non-breaking change which adds functionality)

Testing & Quality Assurance

[x] Verified that data parsers gracefully handle missing level and description data rows without breaking the UI.

[x] Checked UI constraints to ensure long text descriptions wrap correctly on various mobile screen sizes.

[x] Ran static code analysis (flutter analyze) to guarantee zero performance regression or typing alerts.
Screenshot_2026-05-23-10-38-06-706_pl enteam aed_map Screenshot_2026-05-23-10-34-43-440_pl enteam aed_map (1)

@netlify

netlify Bot commented May 23, 2026

Copy link
Copy Markdown

👷 Deploy request for aedmap pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit d3bd5d3

Comment thread lib/repositories/points_repository.dart Outdated
.where((a) => a.key.startsWith('defibrillator:location'))
.toList();
descriptions.sort((a, b) => b.key.length - a.key.length);
var lang = Platform.localeName.split('_')[0];

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current state of implementation (single location description) is not ideal solution.
However, doing production-grade refactor I would strongly recommend to include all location descriptions in various languages inside datamodel (aed.dart).

Also I feel this change can potentially break existing functionality of mutating AED details unless correct handling would be implemented inside edit logic.

I would love to see all tags for all languages getting into toXml tags.

Comment thread lib/screens/map/bottom_panel.dart Outdated
builder: (context, v) {
String indoorText = v;
if (state.selected.level != null && state.selected.level!.isNotEmpty) {
indoorText += ' (${appLocalizations.level.toLowerCase()}: ${state.selected.level})';

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe introduce another row for level? App should be extremely readable, even on larger text scales set on phone OS.

Comment thread lib/screens/map/bottom_panel.dart Outdated
Text('${appLocalizations.insideBuilding}: ',
style: const TextStyle(fontSize: 16)),
Text(v,
Text(indoorText,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

Comment thread lib/screens/map/bottom_panel.dart Outdated
}),
if (state.selected.description != null && state.selected.description!.isNotEmpty) ...[
const SizedBox(height: 4),
_ExpandableNote(

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. This component should be extracted to separate file.
  2. App codebase convention is to not nose _ prefix for private components.


List<String> details = [];
if (locationDescription.isNotEmpty) details.add(locationDescription);
if (indoor != null && indoor == 'yes') details.add(appLocalizations.insideBuilding);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Great job!

Comment thread lib/repositories/points_repository.dart Outdated
}

Future<Defibrillator?> getNode(int id) async {
Future<Defibrillator?> getNode(int id, String lang) async {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method can be probably completely removed.

@Amadeusz-P Amadeusz-P force-pushed the feat/level-and-description branch from 3155726 to 1788955 Compare May 26, 2026 13:52
@Amadeusz-P Amadeusz-P force-pushed the feat/level-and-description branch from 1788955 to d3bd5d3 Compare May 26, 2026 13:56
@Amadeusz-P Amadeusz-P requested a review from matisiekpl May 26, 2026 14:01
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.

2 participants