Skip to content

filtro por ubicación en cargas#205

Open
MARMdeveloper wants to merge 1 commit intomainfrom
feat/filter-charges-by-geofence
Open

filtro por ubicación en cargas#205
MARMdeveloper wants to merge 1 commit intomainfrom
feat/filter-charges-by-geofence

Conversation

@MARMdeveloper
Copy link
Collaborator

Summary

Implements location-based filtering in the Charges screen, as requested in #203.

Charges can now be filtered by location (address/geofence) using a dropdown placed
to the right of the AC/DC type filter chips. The filter supports multi-selection and
free-text search, and correctly updates the Summary card and bar charts alongside the
charge list.

Changes

ChargesViewModel.kt

  • Added availableLocations: List<String> and selectedLocations: Set<String> to ChargesUiState
  • Added setLocationFilter(location: String) — toggles a location in/out of the active selection
  • Added clearLocationFilter() — resets the location selection
  • applyFiltersAndUpdateState() now applies the location filter to the charge list, summary
    calculation and chart data so all three stay in sync

ChargesScreen.kt

  • Added LocationFilterDropdown composable — a FilterChip that opens a DropdownMenu with:
    • Free-text search field to narrow down the list
    • Per-item checkmark indicating current selection
    • Menu stays open after each selection to allow multi-select
    • Clear button on the chip when one or more locations are active
    • Chip label shows the location name (1 selected), count ("N ubicaciones"), or a generic
      label when nothing is selected
  • ChargesContent updated to accept selectedLocations, onLocationFilterToggled and
    onLocationFilterCleared parameters
  • ChargeTypeFilterChips updated to accept an optional modifier parameter so it can
    participate in the Row layout alongside the new dropdown

res/values/strings.xml

  • Added filter_location
  • Added search

closes #203

@MARMdeveloper MARMdeveloper linked an issue Mar 19, 2026 that may be closed by this pull request
@vide vide force-pushed the feat/filter-charges-by-geofence branch from 65fdb07 to 86e1023 Compare March 20, 2026 11:31
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.

Filtrar por geofence en el panel de cargas

1 participant