feat(roadtrip): let one stop say how full it fills

The fill level was one figure for the whole trip, and a trip does not have one.
A motorway rapid charger is worth about 80 % because the last fifth costs as
long again; the charger at the hotel is worth all of it because the car stands
there all night. Between those two the difference is a whole leg, and a single
setting has to be wrong about one of them.

So the badge on a refuelling stop is now the way in: it shows what that stop
will actually fill to, its own figure or the traveller's, and opens a panel of
the six answers people actually give. Under them it says what the choice buys in
kilometres, because 80 % is an abstraction and "about 290 km from here" is the
thing being decided. Picking the figure a stop already has hands it back to the
setting, the same gesture the kind picker uses to un-pick a kind.

The value lives in places.fill_percent, beside stop_type, because it is a
property of the stop rather than of the person. Null means "follow the setting",
which is every stop that predates the column and every stop nobody has an
opinion about, so nothing changes for a trip that never touches it.

Two pieces of shared machinery came out of it rather than being copied. The
popover chrome — measure before showing, flip when the window is short, close on
an outside click, Escape or a scroll — is one component now, used by the kind
picker and this one. So is the assembly of the range from seven settings, which
the routes hook and the rail both need and which would have drifted the first
time a field was added.
This commit is contained in:
Maurice
2026-09-09 23:05:35 +02:00
committed by Maurice
parent aaf6559d5d
commit 96ab748f34
46 changed files with 783 additions and 144 deletions
+5
View File
@@ -143,6 +143,11 @@ const roadtrip: TranslationStrings = {
'roadtrip.leg.driveText': '{distance}/{time}',
'roadtrip.day.stopCount': '{count} 箇所',
'roadtrip.stop.stayShort': '滞在',
'roadtrip.stop.fillTitle': '補給する量',
'roadtrip.stop.fillGives': 'ここから約 {distance}',
'roadtrip.stop.fillNoRange': '航続距離を入れると、これで何 km 走れるか出ます。',
'roadtrip.stop.fillDefault': '自分の既定値を使う',
'roadtrip.stop.fillSet': 'この停車地でどこまで補給するか決める',
'roadtrip.leg.pending': 'ルートなし',
'roadtrip.stop.addTitle': '立ち寄り先として追加',
'roadtrip.stop.kind': '立ち寄りの種類',