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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user