Skip to content

Commit 5bb5fbc

Browse files
feat: add live status indicator and flood bulletin link to dashboard
Introduced a new live status dot indicator for time-sensitive links in the dashboard, enhancing user awareness. Added a temporary button linking to the Rasuwa–Bhotekoshi flood bulletin, providing users with critical updates and emergency contacts. Updated CSS for the new indicator and localized the new strings in English and Nepali.
1 parent 7392b44 commit 5bb5fbc

5 files changed

Lines changed: 78 additions & 0 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,6 @@ apps/desktop/src-tauri/gen/
6666
# they are the design backlog.
6767
.impeccable/config.local.json
6868
.impeccable/hook.cache.json
69+
70+
71+
.sajilo-dev-*

apps/desktop/src/features/calendar/dashboard.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { MonthGrid } from "../../shared/components/month-grid";
66
import { SkeletonBlock } from "../../shared/components/skeleton";
77
import { StateBanner } from "../../shared/components/state-banner";
88
import { useSettings } from "../../shared/context/settings-context";
9+
import { openExternalLink } from "../../shared/lib/external-link";
910
import {
1011
api,
1112
type CalendarMonth,
@@ -67,6 +68,10 @@ const GREG_MONTHS = [
6768
"Dec",
6869
];
6970

71+
// Temporary public-safety link for the Rasuwa–Bhotekoshi flood response.
72+
// Remove this once the live bulletin is no longer needed on Today.
73+
const RASUWA_FLOOD_BULLETIN_URL = "https://nirajbhusal.github.io/rasuwa-flood-bulletin/";
74+
7075
function relativeText(
7176
daysAway: number,
7277
t: (key: "relative.today" | "relative.tomorrow" | "relative.in-days") => string,
@@ -173,6 +178,29 @@ export function Dashboard() {
173178
<div className="space-y-2.5">
174179
<DateHeader today={today} />
175180

181+
<button
182+
type="button"
183+
onClick={() => openExternalLink(RASUWA_FLOOD_BULLETIN_URL)}
184+
aria-label={t("dashboard.flood-aria-label")}
185+
className="surface-card flex w-full items-center gap-2 px-2.5 py-2 text-left transition-colors hover:bg-surface-hover active:scale-[0.99]"
186+
>
187+
<span className="live-status-dot ml-0.5 shrink-0" aria-hidden />
188+
<span className="min-w-0 flex-1">
189+
<span className="block truncate text-[12px] font-medium">
190+
{t("dashboard.flood-title")}
191+
</span>
192+
<span className="block truncate text-[10px] text-text-muted">
193+
{t("dashboard.flood-detail")}
194+
</span>
195+
</span>
196+
<span className="flex shrink-0 items-center gap-0.5 text-[11px] font-medium text-[color:var(--color-accent-mark)]">
197+
{t("dashboard.flood-action")}
198+
<span className="text-[8px] font-normal leading-none opacity-55" aria-hidden>
199+
200+
</span>
201+
</span>
202+
</button>
203+
176204
{modules.clocksEnabled && modules.clocks.length > 0 && (
177205
<ClockRow timeZones={modules.clocks} />
178206
)}

apps/desktop/src/i18n/en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
"bazar.wholesale-note": "Wholesale rates at Kalimati. Shop prices are usually higher.",
6060
"bazar.worth": "Worth",
6161
"dashboard.high": "H",
62+
"dashboard.flood-action": "Live bulletin",
63+
"dashboard.flood-aria-label": "Open Rasuwa–Bhotekoshi flood bulletin in browser",
64+
"dashboard.flood-detail": "Latest updates & emergency contacts",
65+
"dashboard.flood-title": "Rasuwa–Bhotekoshi flood",
6266
"dashboard.low": "L",
6367
"dashboard.nepse": "NEPSE index",
6468
"dashboard.nepse-no-change": "Unchanged today",

apps/desktop/src/i18n/ne.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
"bazar.wholesale-note": "कालीमाटीको थोक मूल्य। पसलको मूल्य प्रायः बढी हुन्छ।",
6060
"bazar.worth": "मूल्य",
6161
"dashboard.high": "अधिकतम",
62+
"dashboard.flood-action": "लाइभ बुलेटिन",
63+
"dashboard.flood-aria-label": "रसुवा–भोटेकोशी बाढी बुलेटिन ब्राउजरमा खोल्नुहोस्",
64+
"dashboard.flood-detail": "ताजा अपडेट र आपतकालीन सम्पर्क",
65+
"dashboard.flood-title": "रसुवा–भोटेकोशी बाढी",
6266
"dashboard.low": "न्यूनतम",
6367
"dashboard.nepse": "नेप्से सूचकाङ्क",
6468
"dashboard.nepse-no-change": "आज परिवर्तन छैन",

apps/desktop/src/index.css

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,45 @@ html {
222222
border-color 0.15s ease;
223223
}
224224

225+
/* A quiet broadcast indicator for time-sensitive links. The ring breathes
226+
instead of flashing so it reads as current without turning the whole row
227+
into an alarm. */
228+
.live-status-dot {
229+
position: relative;
230+
width: 6px;
231+
height: 6px;
232+
border-radius: 999px;
233+
background: var(--color-negative);
234+
}
235+
236+
.live-status-dot::after {
237+
content: "";
238+
position: absolute;
239+
inset: -3px;
240+
border: 1px solid var(--color-negative);
241+
border-radius: inherit;
242+
animation: live-status-breathe 2.2s ease-out infinite;
243+
}
244+
245+
@keyframes live-status-breathe {
246+
0% {
247+
opacity: 0.65;
248+
transform: scale(0.55);
249+
}
250+
75%,
251+
100% {
252+
opacity: 0;
253+
transform: scale(1.35);
254+
}
255+
}
256+
257+
@media (prefers-reduced-motion: reduce) {
258+
.live-status-dot::after {
259+
animation: none;
260+
opacity: 0.35;
261+
}
262+
}
263+
225264
/* macOS NSTextField-style inputs. */
226265
.control-field {
227266
background: var(--color-control-bg);

0 commit comments

Comments
 (0)