Phone App: connected service, charging cost, a tab picker and data export

Both READMEs claimed web parity with data export/import as the only
omission. That was three gaps out of date: the car screen had no
connected-service tab, no per-car charging-cost tab, and no way to say what
a car's page shows - all three of which the web has had since the car view
became a property of the car rather than of the browser.

The tab bar was the thing blocking the rest. It was a fixed list of eight
Tab(text: "Information") literals, so it could neither grow a tab nor read
an arrangement, and it sat outside the translation system that the rest of
the app has used since b6bb6b1. It now builds from the car's own tabOrder
and hiddenTabs, and labels come from car.tabs.* like the web's.

Rather than retype four subtrees of strings in three languages, the shared
ones - car.*, settings.advanced, forms.charging, forms.import and the
common keys the phone was missing - are copied out of the Web App's own
language files, with the phone's existing wording winning every collision.
Polish and Danish therefore arrive complete and cannot drift between the
two apps. Only five strings are genuinely phone-only: the reorder hint, the
saved-file message, the open action and two validation lines.

The connected-service tab mirrors ProviderPanel: headline readings, the
offer to take a provider odometer that is ahead of the stored one, the
vehicle record, and one collapsible card per capability, rendered from the
server's flattened key/value pairs so a provider adding a field surfaces it
without touching this app. Two deliberate differences. The raw-payload
disclosure is dropped - Toyota's eight sections are megabytes of JSON on a
phone screen, and the flattened fields carry the same content. And the
readings cannot be dragged here, though a stored metricOrder is still
honoured, so an arrangement made on the web carries over.

The view picker takes the same line on gestures. The web rearranges by
dragging the tab bar itself and the Information rows themselves; on a touch
screen that gesture belongs to the tab bar, so both arrangements are made
in the picker with a handle instead, and hiddenTabs, hiddenFields, tabOrder
and fieldOrder all save in one PUT. The key catalogues live in
car_view_sheet.dart and mirror hideableCarTabs / arrangeableCarTabs /
hideableCarFields in cars.go, because the server rejects anything else.
arrangeKeys applies a partial stored order the way the API documents it: an
unknown key is dropped and an unnamed one follows the arranged ones, which
is what puts a tab added in a later release at the end of somebody's page
rather than the middle of it.

Charging cost is the electric twin of Fuel and is built as one - the same
stats panel, tile and form shape, measured between full charges. It is the
per-car cost log, not the Charging section in the bottom bar, which remains
the charger network and OCPP control.

Export and import needed a phone answer to two browser affordances. The
export is written to the app's documents directory under the filename the
server's Content-Disposition names, and offered to whatever opens JSON via
open_filex - the same route attachments already take. The import goes
through the system file picker, validates the file locally, and confirms
with the number of cars the file actually holds, because the server always
creates new records and never merges.

The one field worth calling out on the client: _carPayload still leaves the
provider link and the view arrangement out, matching carPayload in
records.go, so saving the car form cannot silently unlink a car or undo an
arrangement.

Known gap, deliberately not closed here: the older sheets in
record_form_sheets.dart and most of car_detail_screen.dart still carry
hardcoded English. Everything added here and every tab label goes through
t(), but translating the rest of the car screen is its own change and would
have buried this one.

Verified by flutter analyze (clean), flutter test - 13 pass, 6 of them new,
covering arrangeKeys against partial, unknown and duplicate keys, the
charging models keeping uncomputed figures null rather than a plausible
zero, the new Car fields, and ProviderSnapshot parsing an unreachable
provider as an answer rather than a failure - and flutter build apk
--debug, which succeeds. The Kotlin Gradle plugin warnings in that build
are pre-existing.

Not verified: nothing was run against a live API Server or on a device, so
the new screens have not been driven end to end - only compiled, analyzed
and unit-tested.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
tajniak81
2026-08-21 21:33:58 +02:00
co-authored by Claude Opus 5
parent 215c027ada
commit e249c2f4d8
14 changed files with 3510 additions and 203 deletions
+352 -2
View File
@@ -8,7 +8,17 @@
"retry": "Ponów",
"required": "Wymagane",
"confirm": "Potwierdź",
"empty": "—"
"empty": "—",
"saveChanges": "Zapisz zmiany",
"loading": "Ładowanie…",
"edit": "Edytuj",
"open": "Otwórz",
"delete": "Usuń",
"done": "Gotowe",
"undo": "Cofnij",
"download": "Pobierz",
"yes": "Tak",
"no": "Nie"
},
"nav": {
"garage": "Garaż",
@@ -220,6 +230,24 @@
"finalizeTitle": "Usunąć konto?",
"finalizeBody": "To trwale usunie Twoje konto. Tej operacji nie można cofnąć.",
"delete": "Usuń"
},
"advanced": {
"title": "Zaawansowane",
"exportTitle": "Eksportuj swoje dane",
"exportBody": "Pobierz swój profil oraz wszystkie samochody, wpisy serwisowe i części w formacie JSON.",
"preparing": "Przygotowywanie…",
"exportAction": "Eksportuj dane",
"importTitle": "Importuj swoje dane",
"importBody": "Dodaj samochody z wcześniej wyeksportowanego pliku JSON. Tworzy to nowe wpisy — nic nie jest scalane ani nadpisywane.",
"importing": "Importowanie…",
"importAction": "Importuj dane",
"notJson": "Ten plik nie jest poprawnym plikiem JSON.",
"notExport": "Ten plik nie wygląda na eksport z DriverVault (brak listy \"cars\").",
"confirmImport": "Zaimportować samochody z tego pliku ({count})? Zostaną dodane nowe wpisy — istniejące samochody nie zostaną scalone ani nadpisane.",
"imported": "Zaimportowano: samochody ({cars}), wpisy serwisowe ({services}), części ({parts}).",
"exported": "Zapisano {file}",
"open": "Otwórz",
"openFailed": "Nie udało się otworzyć pliku."
}
},
"status": {
@@ -248,5 +276,327 @@
"warrantyExpiredAgo": "Gwarancja wygasła {days} dni temu",
"warrantyEndsIn": "Gwarancja kończy się za {days} dni",
"underWarranty": "Na gwarancji · {days} dni"
},
"car": {
"allCars": "← Wszystkie samochody",
"share": "Udostępnij",
"shared": "Udostępniony",
"sharedReadOnly": "Udostępniony · tylko do odczytu",
"tabs": {
"connected": "Połączona usługa",
"info": "Informacje",
"services": "Historia serwisowa",
"technical": "Historia przeglądów",
"maintenance": "Naprawy",
"fuel": "Koszty paliwa",
"charging": "Koszty ładowania",
"documents": "Dokumenty",
"parts": "Katalog części",
"reminders": "Przypomnienia",
"dragHint": "Przeciągnij kartę, aby zmienić kolejność kart tego samochodu."
},
"viewPicker": {
"open": "Co pokazuje strona tego samochodu",
"title": "Co pokazuje ten samochód",
"subtitle": "Wybierz sekcje i szczegóły widoczne na stronie tego samochodu. Dotyczy wszystkich, którym go udostępniono.",
"tabsHeading": "Zakładki",
"fieldsHeading": "Pola informacji",
"alwaysOn": "Zakładka {tab} jest zawsze dostępna.",
"fieldsOrderHint": "Przeciągnij pola na zakładce Informacje, aby zmienić ich kolejność.",
"reorderHint": "Przeciągnij wiersz za uchwyt, aby zmienić kolejność.",
"tabsReorder": "Zakładki",
"fieldsReorder": "Pola informacyjne"
},
"provider": {
"subtitle": "Dane na żywo z Twojego konta {label}.",
"refresh": "Odśwież",
"refreshing": "Odświeżanie…",
"updated": "Zaktualizowano {time}",
"vehicle": "Pojazd",
"readings": "Aktualne odczyty",
"dragHint": "Przeciągnij odczyt, aby zmienić ich kolejność.",
"noData": "{label} nie zwróciło żadnych danych dla tego samochodu.",
"raw": "Surowa odpowiedź",
"allFields": "Wszystkie zgłoszone pola",
"truncated": "Wypisano tylko pierwsze {n} pól — pozostałe znajdziesz w surowej odpowiedzi poniżej.",
"sectionEmpty": "Brak danych.",
"sectionFailed": "Nie udało się pobrać",
"own": "Używane jest wyłącznie Twoje własne konto, więc dane logowania nigdy nie są udostępniane wraz z samochodem.",
"odometerSuggest": "{label} podaje {km}, czyli więcej niż zapisany przebieg tego samochodu.",
"updateOdometer": "Zaktualizuj przebieg",
"updatingOdometer": "Aktualizowanie…",
"unlink": "Odłącz",
"unlinkConfirm": "Odłączyć ten samochód od {label}? Żadne zapisane dane nie zostaną usunięte.",
"connectTitle": "Połącz ten samochód z usługą",
"connectHint": "Wybierz pojazd ze swojego konta, który odpowiada temu samochodowi. Jego dane pojawią się tutaj.",
"connectSubmit": "Połącz pojazd",
"connecting": "Łączenie…",
"noProviders": "Nie połączono żadnego konta producenta. Dodaj je w Ustawieniach Integracje.",
"settingsLink": "Otwórz Ustawienia",
"sections": {
"telemetry": "Przebieg i zasięg",
"electric": "Akumulator i ładowanie",
"status": "Drzwi, szyby i światła",
"health": "Stan pojazdu",
"location": "Ostatnia znana lokalizacja",
"serviceHistory": "Historia serwisowa u dealera",
"notifications": "Powiadomienia"
},
"metrics": {
"odometer": "Przebieg",
"fuelLevel": "Poziom paliwa",
"fuelRange": "Zasięg",
"batteryLevel": "Akumulator",
"evRange": "Zasięg elektryczny (bez klimatyzacji)",
"evRangeWithAc": "Zasięg elektryczny (z klimatyzacją)",
"chargingStatus": "Ładowanie",
"location": "Pozycja"
}
},
"info": {
"allHidden": "Wszystkie pola są wyłączone dla tego samochodu.",
"dragHint": "Przeciągnij pole, aby zmienić układ informacji o tym samochodzie.",
"oilSpec": "Specyfikacja oleju silnikowego",
"transmissionOil": "Olej przekładniowy",
"differentialOil": "Olej mostu napędowego",
"brakeFluid": "Płyn hamulcowy",
"coolant": "Płyn chłodniczy",
"odometer": "Przebieg",
"serviceInterval": "Interwał serwisowy",
"nextDue": "Następny termin",
"registrationPlate": "Numer rejestracyjny",
"registrationCountry": "Kraj rejestracji",
"vin": "VIN",
"fuelType": "Rodzaj paliwa",
"buildDate": "Data produkcji",
"firstRegistration": "Pierwsza rejestracja",
"technicalCheckInterval": "Interwał przeglądów technicznych"
},
"services": {
"title": "Historia serwisowa",
"add": "Dodaj serwis",
"empty": "Brak wpisów serwisowych.",
"colDate": "Data",
"colKm": "Km",
"colNextDate": "Następna data",
"colNextKm": "Następny przebieg",
"colOil": "Olej i filtr oleju",
"colEngineFilter": "Filtr powietrza silnika",
"colCabinFilter": "Filtr kabinowy",
"colNotes": "Notatki",
"colFile": "Plik",
"confirmDelete": "Usunąć ten wpis serwisowy?"
},
"technical": {
"title": "Historia przeglądów technicznych",
"subtitle": "Obowiązkowe badania techniczne. Powtarzają się wyłącznie w oparciu o czas, niezależnie od przebiegu.",
"add": "Dodaj przegląd",
"empty": "Brak przeglądów technicznych.",
"colDate": "Data",
"colResult": "Wynik",
"colNextCheck": "Następny przegląd",
"colStatus": "Status",
"colStation": "Stacja",
"colCost": "Koszt",
"colNotes": "Notatki",
"colFile": "Plik",
"passed": "Pozytywny",
"failed": "Negatywny",
"confirmDelete": "Usunąć ten przegląd techniczny?"
},
"maintenance": {
"title": "Naprawy",
"subtitle": "Wizyty w warsztacie i naprawy. Rutynowa obsługa znajduje się w Historii serwisowej.",
"add": "Zapisz wizytę",
"empty": "Brak zapisanych wizyt w warsztacie.",
"colDate": "Data",
"colKm": "Km",
"colType": "Rodzaj",
"colWork": "Wykonane prace",
"colWorkshop": "Warsztat",
"colStatus": "Status",
"colCost": "Koszt",
"colFile": "Plik",
"underWarranty": "Na gwarancji · pozostało {days} dni",
"confirmDelete": "Usunąć tę wizytę w warsztacie?"
},
"fuel": {
"title": "Koszty paliwa",
"subtitle": "Zużycie liczone jest między pełnymi bakami.",
"add": "Zapisz tankowanie",
"empty": "Brak zapisanych tankowań.",
"average": "Średnie",
"best": "Najlepsze",
"worst": "Najgorsze",
"costPerKm": "Koszt na km",
"refills": "Tankowania",
"totalLiters": "Łącznie litrów",
"totalSpent": "Łącznie wydano",
"trackedDistance": "Zmierzony dystans",
"avgPrice": "Śr. cena {price}/l",
"needTwoTanks": "Zapisz co najmniej dwa pełne baki, aby zobaczyć zużycie.",
"colDate": "Data",
"colKm": "Km",
"colLiters": "Litry",
"colCost": "Koszt",
"colPerLiter": "Za litr",
"colDistance": "Dystans",
"colConsumption": "Zużycie",
"colStation": "Stacja",
"colFile": "Plik",
"partial": "częściowe",
"gap": "luka",
"confirmDelete": "Usunąć to tankowanie?"
},
"charging": {
"title": "Koszty ładowania",
"subtitle": "Zużycie liczone jest między pełnymi ładowaniami.",
"add": "Zapisz ładowanie",
"empty": "Brak zapisanych ładowań.",
"average": "Średnio",
"best": "Najlepsze",
"worst": "Najgorsze",
"costPerKm": "Koszt na km",
"sessions": "Ładowania",
"totalKwh": "Łączna energia",
"totalSpent": "Łącznie wydano",
"trackedDistance": "Zmierzony dystans",
"avgPrice": "Śr. cena {price}/kWh",
"needTwoCharges": "Zapisz co najmniej dwa pełne ładowania, aby zobaczyć zużycie.",
"colDate": "Data",
"colKm": "Km",
"colKwh": "kWh",
"colCost": "Koszt",
"colPerKwh": "Za kWh",
"colDistance": "Dystans",
"colConsumption": "Zużycie",
"colLocation": "Ładowarka",
"colFile": "Plik",
"partial": "częściowe",
"gap": "przerwa",
"confirmDelete": "Usunąć to ładowanie?"
},
"documents": {
"title": "Dokumenty",
"subtitle": "Ubezpieczenie, zaświadczenia i inne dokumenty z terminami odnowienia.",
"add": "Dodaj dokument",
"empty": "Brak dokumentów.",
"colType": "Rodzaj",
"colTitle": "Nazwa",
"colProvider": "Wystawca",
"colIssued": "Wystawiono",
"colRenewal": "Odnowienie",
"colStatus": "Status",
"colFile": "Plik",
"confirmDelete": "Usunąć ten dokument?"
},
"reminders": {
"title": "Przypomnienia",
"subtitle": "Przypomnienia o odnowieniach i serwisach dodawane są automatycznie na podstawie dokumentów i historii serwisowej.",
"add": "Dodaj przypomnienie",
"empty": "Nie ma jeszcze o czym przypominać.",
"automatic": "Automatyczne",
"repeats": "Powtarza się",
"at": "przy {km}",
"doneRollForward": "Gotowe · przenieś dalej",
"markDone": "Oznacz jako gotowe",
"reopen": "Otwórz ponownie",
"confirmDelete": "Usunąć to przypomnienie?"
},
"parts": {
"title": "Katalog części",
"add": "Dodaj część",
"empty": "Brak części.",
"colPart": "Część",
"colPartNumber": "Numer części",
"colNotes": "Notatki",
"colFile": "Plik",
"confirmDelete": "Usunąć tę część?"
},
"delete": {
"title": "Usunąć ten samochód?",
"body": "To trwale usunie {name} i wszystko, co zostało w nim zapisane — {services}, {maintenance}, {fuel}, {charging}, {documents} i {parts}. Tej operacji nie można cofnąć.",
"services": {
"one": "{n} wpis serwisowy",
"few": "{n} wpisy serwisowe",
"many": "{n} wpisów serwisowych",
"other": "{n} wpisu serwisowego"
},
"maintenance": {
"one": "{n} wizyta w warsztacie",
"few": "{n} wizyty w warsztacie",
"many": "{n} wizyt w warsztacie",
"other": "{n} wizyty w warsztacie"
},
"fuel": {
"one": "{n} tankowanie",
"few": "{n} tankowania",
"many": "{n} tankowań",
"other": "{n} tankowania"
},
"charging": {
"one": "{n} ładowanie",
"other": "{n} ładowań"
},
"documents": {
"one": "{n} dokument",
"few": "{n} dokumenty",
"many": "{n} dokumentów",
"other": "{n} dokumentu"
},
"parts": {
"one": "{n} część",
"few": "{n} części",
"many": "{n} części",
"other": "{n} części"
},
"typeToConfirm": "Wpisz {name}, aby potwierdzić",
"deleting": "Usuwanie…",
"confirm": "Usuń trwale"
}
},
"forms": {
"charging": {
"addTitle": "Zapisz ładowanie",
"editTitle": "Edytuj ładowanie",
"date": "Data",
"odometer": "Przebieg (km)",
"kwh": "Energia (kWh)",
"cost": "Koszt",
"pricePerKwh": "To {price} za kWh.",
"battery": "Akumulator",
"fullCharge": "Naładowany do pełna",
"missedSession": "Wcześniejsze ładowanie nie zostało zapisane",
"batteryHint": "Zużycie liczone jest między pełnymi ładowaniami. Ładowania częściowe wliczają się do kosztów i doliczają do kolejnego pełnego.",
"location": "Ładowarka",
"locationPlaceholder": "Dom",
"notes": "Notatki",
"attachmentLegend": "Paragon",
"submit": "Zapisz ładowanie",
"odometerRequired": "Przebieg jest wymagany.",
"kwhRequired": "Energia (kWh) jest wymagana."
},
"import": {
"title": "Importuj samochód",
"subtitle": "Utwórz samochód na podstawie pojazdu z Twojego konta u producenta. Wszystko, co da się odczytać, zostanie wypełnione automatycznie.",
"service": "Usługa",
"loadingVehicles": "Wczytywanie Twoich pojazdów…",
"noVehicles": "Brak pojazdów na tym koncie.",
"notConnected": "Nie połączono",
"noProviders": "Nie połączono żadnego konta producenta. Dodaj je w Ustawieniach Integracje.",
"alreadyInGarage": "Już w Twoim garażu",
"selectVehicle": "Pojazd",
"dataTitle": "Co zaimportować",
"dataHint": "Odznacz to, co wolisz wpisać samodzielnie.",
"includeIdentity": "Marka, model, rok, rejestracja i VIN",
"includeFuelType": "Rodzaj paliwa",
"includeDates": "Data produkcji i pierwszej rejestracji",
"includeOdometer": "Aktualny przebieg",
"name": "Nazwa samochodu",
"submit": "Importuj samochód",
"importing": "Importowanie…",
"warningOdometer": "Usługa nie podała przebiegu — wpisz go samodzielnie w samochodzie.",
"moreData": "Pozostałe dane z tej usługi pozostają dostępne w karcie {label} samochodu."
}
}
}
}