Improve notification deep-linking and add Arabic meeting reminders

Enhance notification handling to preserve deep-link parameters, add relatedId and relatedType to notifications for better association, and implement Arabic pluralization for meeting reminders.
This commit is contained in:
Riyadh
2026-06-01 14:48:26 +00:00
parent 3c1b3107e3
commit 348db18bcd
9 changed files with 264 additions and 13 deletions
+6 -1
View File
@@ -18,7 +18,12 @@ function scopedUrl(relative) {
// Strip a leading slash from `relative` so URL() treats it as a
// path under scope rather than origin-relative.
const cleaned = String(relative || "").replace(/^\/+/, "");
return new URL(cleaned, self.registration.scope).pathname;
const resolved = new URL(cleaned, self.registration.scope);
// Preserve the query string and hash so notification deep-links
// (e.g. "/meetings?meeting=12" or "/notes?thread=7") survive the click
// handler — taking only .pathname would drop them and land the user on
// the generic page instead of the specific item.
return resolved.pathname + resolved.search + resolved.hash;
}
self.addEventListener("install", () => {