Commit d6e6808
fix(apps): sync unit preference from backend /settings (web useUnits parity)
The web app reads the account's unit preferences from the backend /settings document and
renders mi/mph/°F/psi accordingly; the native app was hard-defaulting to metric, so every
distance/speed/temp read km/°C even when the account is imperial.
- Rename Shell/BackendThemeSync -> BackendSettingsSync and extend it to also map the
backend unit_of_length / unit_of_temp to the native metric/imperial preference and persist
it alongside theme + mode (one /settings read seeds all three).
- ShellWindow.ApplySettings now rebuilds the visible page on a units flip (pages resolve
their unit pref at construction, mirroring web useUnits at render); list pages that already
subscribe to settings.Changed keep self-applying.
- Pass the resolved unit pref to the dashboard widgets that accept one (vehicle hero, motor,
charge status, recent drives, analytics summary) so the Command Center renders in-account
units on first paint.
Gates: full sln build 0 err, dotnet format clean, placeholders 0, 31537 tests pass.
Verified via live screenshot: dashboard now shows mi / °F / Wh/mi matching http://localhost:3000.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 42c8156 commit d6e6808
4 files changed
Lines changed: 147 additions & 96 deletions
File tree
- apps/windows/TeslaSync.App
- Shell
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
1337 | 1338 | | |
1338 | 1339 | | |
1339 | 1340 | | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
1340 | 1345 | | |
1341 | 1346 | | |
1342 | | - | |
| 1347 | + | |
1343 | 1348 | | |
1344 | 1349 | | |
1345 | 1350 | | |
1346 | | - | |
1347 | | - | |
1348 | | - | |
1349 | | - | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
1350 | 1355 | | |
1351 | 1356 | | |
1352 | 1357 | | |
| |||
1386 | 1391 | | |
1387 | 1392 | | |
1388 | 1393 | | |
| 1394 | + | |
1389 | 1395 | | |
1390 | 1396 | | |
1391 | 1397 | | |
| |||
1886 | 1892 | | |
1887 | 1893 | | |
1888 | 1894 | | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
1889 | 1900 | | |
1890 | 1901 | | |
1891 | 1902 | | |
| |||
1903 | 1914 | | |
1904 | 1915 | | |
1905 | 1916 | | |
| 1917 | + | |
1906 | 1918 | | |
1907 | 1919 | | |
1908 | 1920 | | |
1909 | 1921 | | |
1910 | 1922 | | |
1911 | | - | |
| 1923 | + | |
1912 | 1924 | | |
1913 | 1925 | | |
1914 | 1926 | | |
| |||
0 commit comments