OneBusAway / wayfinder

Modern web app frontend for OneBusAway built in JavaScript with SvelteKit
GNU Affero General Public License v3.0
4 stars 1 forks source link

region wide alerts #78

Closed aaronbrethorst closed 1 day ago

aaronbrethorst commented 2 days ago

This is very similar to the work that just landed in Android: https://github.com/OneBusAway/onebusaway-android/pull/1274

Feature description

On web app launch, we'll query ${OBACO_API_BASE_URL}/alerts.pb for new alerts. If a recent, high severity, region-wide alert is found, a modal will be displayed that shows the contents of the alert, and optionally includes a "More Info" button.

Acceptance criteria

(note: button color is incorrect — I was just too lazy to change it :P)

image

Example code

<script>
    import { Modal } from 'flowbite-svelte';
    let showModal = true;
</script>

<Modal title="All Transit Service Suspended" bind:open={showModal} autoclose>
  <p class="text-base leading-relaxed text-gray-500 dark:text-gray-400">
    King County Metro shut down all its buses. So did Pierce and Snohomish counties. Seattle-Tacoma International Airport briefly closed all three runways, an "unprecedented" situation. Paine Field closed. So did Highway 2 over Stevens
Pass. Garbage pickup was canceled. Museums, theaters, libraries, the zoo, the aquarium: all closed. Doctor appointments
moved online.
  </p>
  <svelte:fragment slot="footer">
    <div class="text-right flex-1">
        <Button color="alternative">Close</Button>
        <Button on:click={() => alert('Handle "success"')}>Learn More</Button>
    </div>
  </svelte:fragment>
</Modal>

(Hopefully) Helpful notes

Ahmedhossamdev commented 1 day ago

Hi @aaronbrethorst

I found also Js SDK for GTFS-realtime language bindings, they use also the ProtoBuf.js for buffer support.

https://gtfs.org/documentation/realtime/language-bindings/nodejs/