From ff05544a910cb6ee2c1a3e2efac9f3f06bba6c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sat, 29 Aug 2026 06:37:56 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(web):=20tasks=20pick=20from=20?= =?UTF-8?q?a=20list,=20rows=20name=20their=20key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/izlek-core/src/store/mod.rs | 6 +++ crates/izlek-core/src/store/turso_store.rs | 19 +++++++- crates/izlek-web/src/i18n.rs | 3 -- crates/izlek-web/src/logs.rs | 18 +++++++- crates/izlek-web/tests/http.rs | 54 +++++++++++++++++++++- style/main.scss | 9 ++++ 6 files changed, 102 insertions(+), 7 deletions(-) diff --git a/crates/izlek-core/src/store/mod.rs b/crates/izlek-core/src/store/mod.rs index 4eda171..ce50956 100644 --- a/crates/izlek-core/src/store/mod.rs +++ b/crates/izlek-core/src/store/mod.rs @@ -415,6 +415,8 @@ pub struct ActivityLine { /// Absent when the line is an account or admin event, which has no task. pub task_id: Option, pub title: Option, + /// The task's own key (e.g. `PROJ-12`), absent alongside `task_id`. + pub task_key: Option, /// Absent when the system did it rather than a person. pub actor_name: Option, pub kind: ActivityKind, @@ -1038,6 +1040,10 @@ pub trait Store: BoardReads + DetailReads + 'static { /// How many activity rows match `filter`, unpaged. async fn count_activity(&self, filter: &ActivityFilter) -> Result; + /// Every live task's key and title, key-ordered — the activity feed's + /// task filter. + async fn task_directory(&self) -> Result>; + /// How many rows matching `filter` sit strictly ahead of `cursor` in /// `dir`'s reading order; `None` (the newest/oldest page) is `0`. async fn count_activity_preceding( diff --git a/crates/izlek-core/src/store/turso_store.rs b/crates/izlek-core/src/store/turso_store.rs index f1ca0bd..a58f1d1 100644 --- a/crates/izlek-core/src/store/turso_store.rs +++ b/crates/izlek-core/src/store/turso_store.rs @@ -2901,7 +2901,7 @@ impl Store for TursoStore { filter: &ActivityFilter, ) -> Result> { const SELECT: &str = "SELECT a.id, a.task_id, t.title, u.display_name, a.kind, a.detail, \ - a.created_at FROM activity a \ + a.created_at, t.task_key FROM activity a \ LEFT JOIN task t ON t.id = a.task_id \ LEFT JOIN user u ON u.id = a.actor_id"; let conn = self.conn.lock().await; @@ -2973,6 +2973,7 @@ impl Store for TursoStore { kind: ActivityKind::parse(&text(&row, 4)?), detail: text(&row, 5)?, at: parse_stamp(&text(&row, 6)?)?, + task_key: opt_text(&row, 7)?, }); } if reverse { @@ -3020,6 +3021,22 @@ impl Store for TursoStore { row.as_ref().map(count_of).unwrap_or(Ok(0)) } + async fn task_directory(&self) -> Result> { + let conn = self.conn.lock().await; + let mut rows = conn + .query( + "SELECT task_key, title FROM task WHERE deleted_at IS NULL ORDER BY task_key", + (), + ) + .await + .map_err(backend)?; + let mut out = Vec::new(); + while let Some(row) = rows.next().await.map_err(backend)? { + out.push((text(&row, 0)?, text(&row, 1)?)); + } + Ok(out) + } + // -- who gets mailed --------------------------------------------------- async fn recipients_for_task(&self, task_id: &str) -> Result> { diff --git a/crates/izlek-web/src/i18n.rs b/crates/izlek-web/src/i18n.rs index a9c94e2..ee265fb 100644 --- a/crates/izlek-web/src/i18n.rs +++ b/crates/izlek-web/src/i18n.rs @@ -290,7 +290,6 @@ pub enum Key { MonthNovember, MonthDecember, All, - Task, LogSystem, Newest, Oldest, @@ -823,8 +822,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { (MonthDecember, Tr) => "Aralık", (All, En) => "All", (All, Tr) => "Tümü", - (Task, En) => "Task", - (Task, Tr) => "Görev", (LogSystem, En) => "System", (LogSystem, Tr) => "Sistem", (Newest, En) => "Newest", diff --git a/crates/izlek-web/src/logs.rs b/crates/izlek-web/src/logs.rs index 67df8ec..6741a81 100644 --- a/crates/izlek-web/src/logs.rs +++ b/crates/izlek-web/src/logs.rs @@ -69,6 +69,7 @@ struct ActivityRow { actor: String, sentence: String, title: Option, + task_key: Option, } /// The screen in one answer. @@ -604,6 +605,7 @@ async fn snapshot( .unwrap_or_else(|| t(lang, Key::TheSystem).to_string()), sentence: activity_sentence(&line.kind, &line.detail, lang), title: line.title, + task_key: line.task_key, }) .collect(); @@ -795,6 +797,11 @@ async fn logs_screen( } else { Vec::new() }; + let tasks: Vec<(String, String)> = if section == Section::Activity { + accounts(cx).store().clone().task_directory().await? + } else { + Vec::new() + }; view! { cx => @@ -946,7 +953,12 @@ async fn logs_screen( } - +