From 566f23cb025dd759f77c0e1e8a2c6c87076ad33e Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Sun, 9 Aug 2026 21:30:28 +0100 Subject: [PATCH] Adjust train service table as displayed over departure boards --- .../components/ui/TrainServiceTable.svelte | 134 ++++++++++++++++-- .../station-board/ServiceDetailModal.svelte | 44 ++++-- src/lib/utils/time.ts | 3 +- 3 files changed, 158 insertions(+), 23 deletions(-) diff --git a/src/lib/components/ui/TrainServiceTable.svelte b/src/lib/components/ui/TrainServiceTable.svelte index 6d50473..4e3ac8f 100644 --- a/src/lib/components/ui/TrainServiceTable.svelte +++ b/src/lib/components/ui/TrainServiceTable.svelte @@ -101,7 +101,7 @@ Dep - Location + Location Plat Sch Act @@ -113,7 +113,7 @@ {#each trainDetail.locations as loc} - + {loc.t} @@ -121,17 +121,21 @@ {#if loc.r === 'PASS'} Pass - {formatUkTime(loc.wtp)} - {formatUkTime(loc.atp || loc.etp || '--')} + {formatUkTime(loc.wtp)} + {formatUkTime(loc.atp || loc.etp || '--')} {:else} - {formatUkTime(loc.pta || loc.wta)} - {formatUkTime(loc.ata || loc.eta || '--')} - {formatUkTime(loc.ptd || loc.wtd)} - {formatUkTime(loc.atd || loc.etd || '--')} + {formatUkTime(loc.pta || loc.wta)} + {formatUkTime(loc.ata || loc.eta || '--')} + {formatUkTime(loc.ptd || loc.wtd)} + {formatUkTime(loc.atd || loc.etd || '--')} {/if} {#if loc} {@const delay = calculateDelay(loc)} - {delay.val} + {@const arrType = estClass(loc.ata, loc.eta)} + {@const depType = estClass(loc.atd, loc.etd)} + {@const passType = estClass(loc.atp, loc.etp)} + {@const classType = depType || arrType || passType} + {delay.val} {/if} {#if loc.act && getRelevantActivities(loc.act).length > 0} @@ -150,3 +154,115 @@ + + \ No newline at end of file diff --git a/src/lib/components/ui/station-board/ServiceDetailModal.svelte b/src/lib/components/ui/station-board/ServiceDetailModal.svelte index abb0732..477bbe6 100644 --- a/src/lib/components/ui/station-board/ServiceDetailModal.svelte +++ b/src/lib/components/ui/station-board/ServiceDetailModal.svelte @@ -67,9 +67,20 @@ }} >