~mil/mobroute-tickets#46: 
Transito: Pick departure (or arrival?) time

Currently when I plan a route transito assumes that I'm leaving right away.

I often want to plan a trip for later, e.g.: leaving tomorrow at midday, or arriving today at 20:00hs.

To do this, I'd like to pick a departure (or arrival?) time along with my original and destination.

Status
RESOLVED FIXED
Submitter
~whynothugo
Assigned to
No-one
Submitted
9 months ago
Updated
a month ago
Labels
high-priority transito

~mil 9 months ago

Agreed - this would be quite nice to have & has been mentioned by other users as well.

Need to determine if there's something prebuilt in Gio that could be utilized for picking date/time in which case should be quite simple to add. Mobroute's library API already supports setting a specific departure time so things are already covered from that end.

Would accept a patch for this or will get to it myself eventually if not.

~whynothugo 6 months ago

Mobroute's library API already supports setting a specific departure time so things are already covered from that end.

Does it support specifying an arrival time instead as well? I only see the Time field in RouteParams.


Adding all the controls to the "Route" tab seems a bit much, so I've been considering adding a new tab, maybe titled "Schedule". This tab is as follows:

  • The first row has two widgets:
    • The left widget is a combo/pulldown with options "Depart" or "Arrive". I haven't found a Gio widget for a pulldown; is there no existing one? We can use radio buttons if there's no combo, but they're not the perfect choice.
    • The right widget is a text field to write the time (e.g.: 12:12). I'd set this to InputHint: key.HintNumeric, so that on-screen keyboards show a numeric keypad. Rendering the : in the right place should be quite simple based on the digits provided. If the time provided is the one for right now, the field renders Now instead.
  • The second row is a "Now" button, which simply resets to time and date to, unsurprisingly, "now".
  • The third row is three elements:
    • A left (<) button. Clicking or tapping on these buttons switches the selected date to the previous date.
    • A label that shows the selected date
    • A right (>) button Clicking or tapping on these buttons switches the selected date to the next date.

The date picker is a simple one, and good enough for the typical case of "I want to plan a trip tomorrow / next week". It will be very inconvenient if you want to review the bus schedule for 2015 or plan a trip next year. We can replace this with a proper calendar widget in future. I didn't find an existing other, otherwise I'd propose using that. If you do find one, I'll use that for the third row. instead.

We can also consider moving the widgets for MinTransferSeconds and MaxTransferSeconds to the bottom of this tab.

~mil 5 months ago

Thanks for the planning details ~whynothugo

Specifying arrival time is currently unsupported in MR - the CSA algorithm itself operates on the basis of departure time. I do think there maybe a way to eventually build in arrival time at algorithm or api level (e.g. via binary search or possibly there are other approaches in CSA followup papers); but for now I'd say let's just go with only departure time.

As for UI discussion: Mostly all sounds good to me. Three rows for departure time details works & text fields with key.HintNumeric is the proper way to approach time input to match with other current advanced configuration numerical elements. Third row as mentioned for date picker with date/next/prev day sounds like a good and pragmatic approach for first pass. For an actual calendar widget - I asked in the Gio slack sometime back and I was pointed to: https://github.com/mearaj/giowidgets which seems to mostly work; although is lacking a bit of polish & documentation.

As for an additional tab - I need to give that some thought as I'm a bit cautious about adding more pages/tabs as to not confuse the user (and in hopes to keep UX simple). Yes if it's all on the same page it might be a bit overwhelming; however I am going to pickup #55 which should open the door to an accordion or subtab pattern for both 'advanced params' and 'time' on routing page and then you could just click that to hide / show the time section. Will post on this ticket when there's an update on that

~mil 5 months ago

Datetime picker could be added within new toggable 'Params' sections on route page implemented in #55 and present on master branch.

~mil 2 months ago*

Time property on Mobroute's RouteParams defines departure time for the route: https://git.sr.ht/~mil/mobroute/tree/f91b77a5557aa15886d91b866a755fbf6d5cf20f/item/api/apirtroute/types.go#L28

Core routing call in Transito to RTRoute with RouteParams, Time set as time.Now(): https://git.sr.ht/~mil/transito/tree/97bdffbb80e3da7c558f32035d1d2cddbda8d768/item/src/uipages/pageroute/widgetRowActionButtons.go#L71

~mil 2 months ago

~whynothugo Calendar day picker as next/previous day buttons as originally proposed would be completely fine for initial implementation.

Eventually I may look into the calendar widget per (https://github.com/mearaj/giowidgets) but since its not off-the-shelf from gio, that aspect would require more work..

~mil REPORTED FIXED a month ago

Hugo Osvaldo Barrera referenced this ticket in commit 93ac718.

Register here or Log in to comment, or comment via email.