From 7ea1f580c846b399f975b50dba587f7a2a6c64c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Tue, 19 May 2026 14:59:49 +0200 Subject: [PATCH] Fix inbox show all and align group filters --- crates/radicle-types/src/outbound/sqlite.rs | 5 ++++- src/lib/router/definitions.ts | 2 +- src/views/Inbox.svelte | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/radicle-types/src/outbound/sqlite.rs b/crates/radicle-types/src/outbound/sqlite.rs index 080afb9ae..a1d1cd03d 100644 --- a/crates/radicle-types/src/outbound/sqlite.rs +++ b/crates/radicle-types/src/outbound/sqlite.rs @@ -157,7 +157,7 @@ impl InboxStorage for Sqlite { Some(repos) if !repos.is_empty() => { let placeholders: Vec = (1..=repos.len()).map(|i| format!("?{}", i)).collect(); - format!("WHERE repo IN ({})", placeholders.join(",")) + format!("AND repo IN ({})", placeholders.join(",")) } _ => String::from(""), }; @@ -175,6 +175,9 @@ impl InboxStorage for Sqlite { ) as value, MAX(timestamp) AS latest_timestamp FROM 'repository-notifications' + WHERE new NOT NULL + AND (ref LIKE '%cobs/xyz.radicle.patch%' + OR ref LIKE '%cobs/xyz.radicle.issue%') {} GROUP BY repo, ref_without_namespace ORDER BY latest_timestamp DESC", diff --git a/src/lib/router/definitions.ts b/src/lib/router/definitions.ts index 9f9ba74db..fbd18839f 100644 --- a/src/lib/router/definitions.ts +++ b/src/lib/router/definitions.ts @@ -88,7 +88,7 @@ export async function loadInbox(): Promise { const [sidebarData, notificationsByRepo] = await Promise.all([ loadSidebarData(), invoke("list_notifications", { - params: { take: 100 }, + params: { take: 20 }, }), ]); return { diff --git a/src/views/Inbox.svelte b/src/views/Inbox.svelte index 924d38aeb..313ac8a16 100644 --- a/src/views/Inbox.svelte +++ b/src/views/Inbox.svelte @@ -69,13 +69,13 @@ async function loadNotifications() { notificationsByRepo = await invoke( "list_notifications", - { params: { take: 100 } }, + { params: { take: 20 } }, ); } async function showAll(rid: string) { const all = await invoke("list_notifications", { - params: { repos: [rid] }, + params: { repos: [rid], all: true }, }); notificationsByRepo = [ ...notificationsByRepo.filter(r => r.rid !== rid),