Realtime-Port-Authority icon indicating copy to clipboard operation
Realtime-Port-Authority copied to clipboard

Add a Force Refresh Button for Buses/Predictions

Open epicstar opened this issue 8 years ago • 7 comments

A user has requested this via email with the following reason:

Can you add a force refresh button? Sometimes it's hard to tell how up-to-date the app is. I've missed many busses because of the perceivable delay between map placement and bus location.

This may not actually be a 100% useful feature since we're already getting updated info every 10 seconds,

However, it could be something that users would positively approve and actually want since it will give them a (false) hope that they have the power to update the buses on the map.

I'm thinking we can incorporate this in 9.0.0. Any thoughts are welcome.

epicstar avatar Dec 27 '16 23:12 epicstar

@epicstar a false sense of hope is all we users could ever ask for.

fnc314 avatar Dec 27 '16 23:12 fnc314

My main concern would be that that this could be used to DDOS us via the API call limit. We would need to include some code to prevent the user from mashing on the button.

Also, note that this is actually already an accidental "feature" in that if you pull out the navigation drawer and toggle another bus we end up updating all the buses.

mikeantonacci avatar Jan 04 '17 01:01 mikeantonacci

@mikeantonacci what about making the refresh button not do anything if it's already been refreshed in the last 10 seconds ^^

fennifith avatar Jan 04 '17 01:01 fennifith

Is it possible to disable the button in the UI during the resolving of the API Promise call? Only enable it after new data has been successfully retrieved (and the timeout limit is passed)

All the best,

Franco Nicola Colaizzi Mathematics | Android | Software & Web Development | Education Portfolio http://fnc314.github.com | Resume http://fnc314.github.io/FrancoNColaizzi_Resume.pdf | LinkedIn http://www.linkedin.com/in/fnc314 | GitHub https://github.com/fnc314 | Tumblr http://fnc314.tumblr.com/

On Tue, Jan 3, 2017 at 8:18 PM, James Fenn [email protected] wrote:

@mikeantonacci https://github.com/mikeantonacci what about making the refresh button not do anything if it's already been refreshed in the last 10 seconds ^^

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rectangle-dbmi/Realtime-Port-Authority/issues/315#issuecomment-270271873, or mute the thread https://github.com/notifications/unsubscribe-auth/AFvgILv7fl93p9oZe5MeWVHrfIEX_x6vks5rOvNZgaJpZM4LWkJY .

fnc314 avatar Jan 04 '17 01:01 fnc314

Right, the implementation should be very simple. We could probably even just wire it into the existing routeSelectionPublishSubject inside getSelectedRoutesObservable via a merge or similar and rely on the existing debounce in the map fragment to prevent the DDOS.

I think hardest part is deciding where to put the button, everything else is pretty much trivial.

mikeantonacci avatar Jan 04 '17 01:01 mikeantonacci

3 dot overflow menu 😁

All the best,

Franco Nicola Colaizzi Mathematics | Android | Software & Web Development | Education Portfolio http://fnc314.github.com | Resume http://fnc314.github.io/FrancoNColaizzi_Resume.pdf | LinkedIn http://www.linkedin.com/in/fnc314 | GitHub https://github.com/fnc314 | Tumblr http://fnc314.tumblr.com/

On Tue, Jan 3, 2017 at 8:27 PM, mikeantonacci [email protected] wrote:

Right, we can definitely do it (and it's kind of how the drawer works already, it's probably not even that much new code.

The implementation should be pretty simple. We could probably even just wire it into the existing routeSelectionPublishSubject inside getSelectedRoutesObservable via a merge or similar and rely on the existing debounce in the map fragment to prevent the DDOS.

I think hardest part is deciding where to put the button, everything else is pretty trivial.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rectangle-dbmi/Realtime-Port-Authority/issues/315#issuecomment-270273154, or mute the thread https://github.com/notifications/unsubscribe-auth/AFvgIFYngGweXtwEN1kQg6jkUf2E20uoks5rOvWQgaJpZM4LWkJY .

fnc314 avatar Jan 04 '17 01:01 fnc314

If/when we make the button, I believe we should do the following things:

  • move the "Clear Transit" button away from the main UI and make "Clear Transit" button only appear when the bus drawer is open
  • have the refresh button on the toolbar with this icon: https://material.io/icons/#ic_refresh
  • have the refresh button have: ** some sort of disabled timer (20 second disabled window?) ** use the existing debounce mechanism we have (which @mikeantonacci already said)

Like @mikeantonacci said, the implementation for the button to be added is easy and it's also hidden when you click to select/unselect buses on the list. After 8.0.0 is released, I'll talk to @mikeantonacci about what to do and then we can implement this feature, unless you're willing to do a pull request for it, @fnc314 . :)

epicstar avatar Jan 04 '17 23:01 epicstar