Skip to content

Commit ddb08bd

Browse files
committed
refactor(trips): remove obsolete journey strings
Prune unused live-trip, replanning, arrival, report, and toast translations. Standardize stop-score cells on shared typography and pass route-trip counts directly to interpolation.
1 parent a22e294 commit ddb08bd

6 files changed

Lines changed: 16 additions & 105 deletions

File tree

web/src/features/trips/components/ArrivalPanel.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ describe('ArrivalPanel', () => {
107107
renderPanel();
108108
expect(screen.getByText('ETA')).toBeInTheDocument();
109109
expect(screen.getByText(/\d{1,2}:\d{2}/)).toBeInTheDocument();
110-
expect(screen.getByText(/moving/)).toBeInTheDocument();
110+
expect(screen.getByText(/moving\s+·/)).toBeInTheDocument();
111111
expect(screen.getByText(/25 m\/s/)).toBeInTheDocument();
112112
expect(screen.getByText(/450000 m/)).toBeInTheDocument();
113113
expect(screen.getByText('Top up en route')).toBeInTheDocument();
@@ -132,7 +132,7 @@ describe('ArrivalPanel', () => {
132132
renderPanel();
133133
expect(screen.getByText(/parked/)).toBeInTheDocument();
134134
expect(screen.getByText('Arrive with buffer')).toBeInTheDocument();
135-
expect(screen.queryByText(/top up /)).not.toBeInTheDocument();
135+
expect(screen.queryByText(/top up 15700 Wh en route$/)).not.toBeInTheDocument();
136136
});
137137

138138
it('surfaces failures with a retry path', () => {

web/src/features/trips/components/ArrivalPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export function ArrivalPanel({ session }: { session: JourneySession }) {
101101
<Text as="p" variant="caption" className="tabular-nums">
102102
{t('journey.arrival.adjusted', 'adjusted {{ratio}}× from {{count}} trips', {
103103
ratio: fmtNumber(arrival.route_factor, 2),
104-
count: fmtNumber(arrival.route_trips, 0),
104+
count: arrival.route_trips,
105105
})}
106106
</Text>
107107
) : null}

web/src/features/trips/components/ReportPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export function ReportPanel({ session }: { session: JourneySession }) {
9191
{report.route_factor != null
9292
? t('journey.report.usuallyTimes', '{{ratio}}× over {{count}} trips', {
9393
ratio: fmtNumber(report.route_factor, 2),
94-
count: fmtNumber(report.route_trips, 0),
94+
count: report.route_trips,
9595
})
9696
: '—'}
9797
</Text>

web/src/features/trips/components/StopScoreTable.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,44 +44,48 @@ export function StopScoreTable({ stops, tableId }: { stops: ScoredStop[]; tableI
4444
style={{ width: `${Math.min(100, Math.max(0, row.score))}%` }}
4545
/>
4646
</div>
47-
<span className="tabular-nums text-xs">{fmtNumber(row.score, 0)}</span>
47+
<Text as="span" variant="caption" className="tabular-nums">
48+
{fmtNumber(row.score, 0)}
49+
</Text>
4850
</div>
4951
),
5052
},
5153
{
5254
key: 'wait',
5355
header: t('journey.scoring.col.wait', 'Wait'),
5456
render: (row) => (
55-
<span className="tabular-nums">
57+
<Text as="span" className="tabular-nums">
5658
{row.wait_s == null
5759
? '—'
5860
: t('journey.scoring.min', '{{min}} min', { min: fmtNumber(row.wait_s / 60, 0) })}
59-
</span>
61+
</Text>
6062
),
6163
},
6264
{
6365
key: 'price',
6466
header: t('journey.scoring.col.price', '$/kWh'),
6567
render: (row) => (
66-
<span className="tabular-nums">
68+
<Text as="span" className="tabular-nums">
6769
{row.per_kwh == null ? '—' : formatCurrency(row.per_kwh, 2)}
68-
</span>
70+
</Text>
6971
),
7072
},
7173
{
7274
key: 'health',
7375
header: t('journey.scoring.col.health', 'Health'),
7476
render: (row) => (
75-
<span className="tabular-nums">
77+
<Text as="span" className="tabular-nums">
7678
{row.health == null ? '—' : fmtNumber(row.health, 0)}
77-
</span>
79+
</Text>
7880
),
7981
},
8082
{
8183
key: 'corridor',
8284
header: t('journey.scoring.col.corridor', 'Off route'),
8385
render: (row) => (
84-
<span className="tabular-nums">{units.formatDistance(row.corridor_m)}</span>
86+
<Text as="span" className="tabular-nums">
87+
{units.formatDistance(row.corridor_m)}
88+
</Text>
8589
),
8690
},
8791
];

web/src/i18n/en/locale-detail-toast.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -518,15 +518,6 @@
518518
"clear": "Ready to roll",
519519
"attention": "{{count}} items need attention",
520520
"error": "Checklist failed"
521-
},
522-
"checkin": {
523-
"success": "Checked in",
524-
"error": "Check-in failed",
525-
"queued": "Offline — check-in queued"
526-
},
527-
"replan": {
528-
"success": "Replanned — {{winner}} wins",
529-
"error": "Replan failed"
530521
}
531522
}
532523
}

web/src/i18n/en/locale-trips.json

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -113,90 +113,6 @@
113113
"action": "Fix now",
114114
"unknown": "Unknown"
115115
}
116-
},
117-
"live": {
118-
"title": "Live trip",
119-
"checkIn": "Check in",
120-
"loading": "Loading live trip…",
121-
"empty": "No fixes yet. Check in to drop the first trail point.",
122-
"progress": "Progress",
123-
"remaining": "remaining",
124-
"range": "Range",
125-
"have": "have",
126-
"need": "need",
127-
"nextStop": "Next stop",
128-
"wait": "{{time}} wait",
129-
"noNextStop": "No scored stop yet",
130-
"lastFix": "Last fix {{time}}",
131-
"noFix": "No fix yet",
132-
"fixes": "{{count}} fixes",
133-
"evidence": "Why",
134-
"verdict": {
135-
"ok": "On energy",
136-
"attention": "Tight",
137-
"action": "Charge soon",
138-
"unknown": "Unknown"
139-
},
140-
"queued": "{{count}} queued"
141-
},
142-
"replan": {
143-
"title": "Replan",
144-
"rescore": "Rescore from here",
145-
"loading": "Measuring deviation…",
146-
"empty": "No deviation reading yet.",
147-
"scoring": "Rescoring stops…",
148-
"offBy": "{{distance}} off corridor",
149-
"verdict": {
150-
"on_track": "On track",
151-
"drifted": "Drifting",
152-
"off_route": "Off route",
153-
"unknown": "Unknown"
154-
}
155-
},
156-
"arrival": {
157-
"title": "Arrival",
158-
"loading": "Preparing arrival…",
159-
"empty": "No arrival reading yet.",
160-
"eta": "ETA",
161-
"moving": "moving",
162-
"parked": "parked",
163-
"shortfall": "top up ≈ {{energy}} en route",
164-
"verdict": {
165-
"ok": "Arrive with buffer",
166-
"attention": "Arrive tight",
167-
"action": "Top up en route",
168-
"unknown": "Unknown"
169-
},
170-
"adjusted": "adjusted {{ratio}}× from {{count}} trips"
171-
},
172-
"report": {
173-
"title": "Trip report",
174-
"loading": "Loading trip report…",
175-
"empty": "No report yet.",
176-
"distance": "Distance",
177-
"duration": "Trip time",
178-
"detour": "Detour",
179-
"times": "{{ratio}}×",
180-
"fixes": "Fixes",
181-
"replans": "Replans",
182-
"replanCount": "{{replans}} of {{plans}} plans",
183-
"checklist": "Ready at check",
184-
"readyCount": "{{ready}} of {{total}}",
185-
"usually": "Usually",
186-
"usuallyTimes": "{{ratio}}× over {{count}} trips"
187-
},
188-
"nudge": {
189-
"title": "Leave now?",
190-
"loading": "Reading departure window…",
191-
"empty": "No nudge yet.",
192-
"slot": "calm {{time}}",
193-
"blocker": "Blocker",
194-
"verdict": {
195-
"leave_now": "Leave now",
196-
"wait": "Wait",
197-
"delay": "Delay",
198-
"unknown": "Unknown"
199-
}
200116
}
201117
},
202118
"trips": {

0 commit comments

Comments
 (0)