OpenRailAssociation / osrd

An open source web application for railway infrastructure design, capacity analysis, timetabling and simulation
https://osrd.fr
458 stars 43 forks source link

front: pathfinding: Status module proposal to concentrate all about pathfinding & UX guidelines #2699

Closed nicolaswurtz closed 1 year ago

nicolaswurtz commented 1 year ago

The idea is to have a module dedicated to pathfinding's status and more ! :warning: the module MUST BE AS SMALL AS POSSIBLE :warning: why not above map module ? It presents all existing pathfinding state & infos about the path founded.

Don't bother too much with UI details if you want, I will later put colors & glitter if necessary ;)

Pathfinding states :

1. Pathfinding is running

All modules implicated in pathfinding configuration must be disabled. My proposal is to use the same system as used in new modal CRUD Infra : a conditionnal <div /> in absolute position with a white background and half opacity with a loader above. It forbids changing pathfinding parameters and avoid to launch another pathfinding before the first is complete.

Pathfinding's module disabled should only display the message that a pathfinding is running and a cancel button that cancel the request.

2. Pathfinding has an error

The error message is displayed, with reasons if possible.

3. Pathfinding is done

No need to display a message, just display pathfinding ID (for debug purpose, will be removed on prod), and distance of the path in kilometers.

4. Pathfinding is impossible

This is not an error, only an information indicating why pathfinding can't be launched.

5. :tada: NEW :tada: Pathfinding should be launched

For now, pathfinding is launched automatically when rs/origin/destination are complete or changed This is the case too when a waypoint is added : this is a problem, because adding 5 waypoints creates 5 new pathfindings. We should stop launching a path when a waypoint is added/modified/removed, instead, the frontend knows that configuration has changed, and pathfinding module displays an enough visible alert that pathfinding has to be relaunched, with a dedicated button.

axrolld commented 1 year ago

4. Pathfinding is impossible

This is not an error, only an information indicating why pathfinding can't be launched.

Does that mean PF won't be launched automatically anymore ?

anisometropie commented 1 year ago

Replaces : https://github.com/DGEXSolutions/osrd/issues/2601

nicolaswurtz commented 1 year ago

Does that mean PF won't be launched automatically anymore ?

No & yes.

No: when changing rolling stock / origin / destination, if those 3 items are correct, PF will launch. Yes: when adding/changing/removing a waypoint/via, PF has to be triggered.

alexandredamiron commented 1 year ago

Even if we 'cancel' a POST request, it will still remain processed by the services. Does not sound restfull. The pathfinding service should be able upon reception of a POST to cancel ongoing requested based on criteria whch will ultimately depends on the complete design of the app; meanwhile, keep the representation of the Ongoing pathfinding, or even all the ongoing pathfinding in order to be transparent

alexandredamiron commented 1 year ago

After 5/01 meeting: