Skip to content

Feat/imperial metric user selector#183

Open
MARMdeveloper wants to merge 7 commits intomainfrom
feat/imperial-metric-user-selector
Open

Feat/imperial metric user selector#183
MARMdeveloper wants to merge 7 commits intomainfrom
feat/imperial-metric-user-selector

Conversation

@MARMdeveloper
Copy link
Collaborator

Summary

Closes #181

Adds a unit system selector in Settings that allows users to override the units configured on their vehicle. The new control offers three options: Auto (uses the vehicle's configured units), Metric (forces km/km/h), and Imperial (forces mi/mph), persisted across sessions via DataStore.

Previously, unit display depended entirely on the vehicle's configuration and was inconsistently applied across screens. This change ensures the user's preference is respected uniformly throughout the app.

Changes

Settings

  • Added SingleChoiceSegmentedButtonRow with Auto / Metric / Imperial options to the Display section
  • Added unitsOverride field to SettingsUiState and AppSettings
  • Added unitsOverrideKey, unitsOverride Flow and saveUnitsOverride() to SettingsDataStore
  • Added updateUnitsOverride() to SettingsViewModel

Unit resolution

  • DrivesViewModel, DriveDetailViewModel, DashboardViewModel, StatsViewModel, MileageViewModel, CountriesVisitedViewModel and RegionsVisitedViewModel now read unitsOverride from SettingsDataStore and apply it on top of the vehicle's reported units

Screens updated to respect user preference

  • DrivesScreen — drive list, summary card and charts
  • DriveDetailScreen — all detail stats
  • DashboardScreen — via UnitFormatter, no changes needed beyond ViewModel fix
  • StatsScreen — quick stats, records and range record dialog
  • MileageScreen — all levels (year, month, day, drive row) including chart tooltips
  • CountriesVisitedScreen — distance chips per country
  • RegionsVisitedScreen — country summary card, region cards and map marker snippets

@MARMdeveloper
Copy link
Collaborator Author

Note:
This PR includes the changes from fix #180

@MARMdeveloper MARMdeveloper force-pushed the feat/imperial-metric-user-selector branch from cfbbf37 to 27be4a2 Compare March 6, 2026 19:57
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.

Add a user selector for Imperial/Metric units in settings

1 participant