Implement journey ranking and improve UI presentation

Add `rankJourneys` utility to score connections based on arrival fit,
directness, and duration. Update `JourneyList` to display the best option
first with a "Top" badge and allow expanding to see more. Fix HAFAS
parser to include train direction in journey details. Limit API result
count to 5 and add TypeScript declaration for PNG assets.
This commit is contained in:
2026-05-14 17:05:56 +02:00
parent 0501d66fdc
commit 04e793cbb8
10 changed files with 168 additions and 18 deletions
+1 -1
View File
@@ -181,7 +181,7 @@ export async function POST(request: NextRequest) {
// Cap TripSearch results at 10
if (svcReq.meth === "TripSearch" && svcReq.req && typeof svcReq.req.numF !== "undefined") {
svcReq.req.numF = Math.min(Number(svcReq.req.numF), 10);
svcReq.req.numF = Math.min(Number(svcReq.req.numF), 5);
}
const controller = new AbortController();