Clarify Departures covers bus/tram/subway too, add clear found/not-found feedback

The API (HAFAS via db-vendo-client) covers all public transport in one
system, not just trains -- verified with a mocked bus-stop response
(Bus 14/Bus 9/Bus 66 mixed with a regional train, all rendering correctly,
no code changes needed since nothing in check()/render() ever filtered by
mode). Fixed the "Train departures" wording in code comments and settings
UI, which was misleadingly train-specific.

Also added an explicit "Found: <station>" confirmation toast on a
successful station lookup, distinct from the generic "Saved." toast --
previously the only feedback was a passive "Currently: X" hint, easy to
miss and not obviously tied to the save you just did.
This commit is contained in:
Honey committed 2026-07-22 21:45:18 +02:00
1 parent 8c9b3e1bfa
commit a9ed1b6fb4
3 files changed
+13 -4

No files matched your search

+1 -1
View File
@@ -123,7 +123,7 @@ def create_app(config, screens: dict, scheduler) -> Flask:
"results": results,
"update_minutes": update_minutes,
})
return redirect(url_for("settings_departures", saved=1))
return redirect(url_for("settings_departures", found=found["name"]))
else:
config.update_screen_settings("departures", {"results": results, "update_minutes": update_minutes})
return redirect(url_for("settings_departures", saved=1))
+5 -1
View File
@@ -5,6 +5,9 @@
{% if error %}
<div class="toast error">{{ error }}</div>
{% endif %}
{% if request.args.get('found') %}
<div class="toast">Found: {{ request.args.get('found') }}</div>
{% endif %}
<p class="hint" style="margin: -0.5rem 0 1.25rem;">
Uses the free, unofficial db-vendo-client API (v6.db.transport.rest) --
@@ -17,8 +20,9 @@
<div class="card">
<div class="section-label">Station</div>
<div class="field">
<label for="station">Station name</label>
<label for="station">Station or stop name</label>
<input type="text" id="station" name="station" placeholder="e.g. Berlin Hauptbahnhof">
<p class="hint">Works for bus/tram/subway stops too, not just train stations -- search by name the same way either way.</p>
{% if settings.station_label %}
<p class="hint">Currently: {{ settings.station_label }}</p>
{% endif %}