feat: improve departure information hierarchy with clearer time display

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 19:57:53 +01:00
parent 98441bc906
commit 92166cea6e
2 changed files with 14 additions and 36 deletions

View File

@@ -359,33 +359,25 @@ class DeparturesManager {
timesContainer.className = 'times-container';
const firstDeparture = direction.departures[0];
const secondDeparture = direction.departures[1];
if (firstDeparture) {
const displayTime = firstDeparture.display;
const departureTime = this.getDepartureTime(firstDeparture);
const timeDisplay = DeparturesManager.formatDateTime(departureTime);
const { countdownText, countdownClass } = this.getCountdownInfo(firstDeparture);
const timeDisplayElement = document.createElement('div');
timeDisplayElement.className = 'time-display';
// Primary countdown - big and prominent
const countdownSpan = document.createElement('span');
countdownSpan.className = `countdown-large ${countdownClass}`;
countdownSpan.textContent = countdownText;
timeDisplayElement.appendChild(countdownSpan);
// Show next 2-3 absolute times as small text
const nextTimesSpan = document.createElement('span');
nextTimesSpan.className = 'next-departures';
const upcomingTimes = direction.departures.slice(0, 3)
timesContainer.appendChild(countdownSpan);
// Next departures - separate line, excludes current departure
const upcomingTimes = direction.departures.slice(1, 4)
.map(d => DeparturesManager.formatDateTime(this.getDepartureTime(d)));
nextTimesSpan.textContent = upcomingTimes.join(' ');
timeDisplayElement.appendChild(nextTimesSpan);
timesContainer.appendChild(timeDisplayElement);
if (upcomingTimes.length > 0) {
const nextTimesDiv = document.createElement('div');
nextTimesDiv.className = 'next-departures';
nextTimesDiv.textContent = 'Sedan: ' + upcomingTimes.join(' ');
timesContainer.appendChild(nextTimesDiv);
}
}
directionRow.appendChild(timesContainer);