Compare commits

...

6 Commits

Author SHA1 Message Date
0cf3e3ce05 chore: Release
Some checks failed
Continuous integration / Check (push) Successful in 1m15s
Continuous integration / Trunk (push) Successful in 1m25s
Continuous integration / Test Suite (push) Successful in 2m54s
Continuous integration / Rustfmt (push) Failing after 1m7s
Continuous integration / build (push) Successful in 3m12s
Continuous integration / Disallow unused dependencies (push) Successful in 3m16s
2026-02-01 15:27:54 -08:00
d10a34e32e web: allow currently unused RemoveTag for symmetry 2026-02-01 15:27:25 -08:00
f311e517a9 chore: Release 2026-02-01 15:26:22 -08:00
aacee2f537 chore: Release 2026-02-01 15:25:23 -08:00
e2bec7760b web: don't return to search page when marking spam in catchup 2026-02-01 15:24:35 -08:00
a4ef7e48a6 web: add mark as spam button to catchup mode 2026-02-01 15:10:58 -08:00
4 changed files with 68 additions and 14 deletions

18
Cargo.lock generated
View File

@@ -3179,7 +3179,7 @@ dependencies = [
[[package]]
name = "letterbox-notmuch"
version = "0.17.62"
version = "0.17.65"
dependencies = [
"itertools",
"log",
@@ -3194,7 +3194,7 @@ dependencies = [
[[package]]
name = "letterbox-procmail2notmuch"
version = "0.17.62"
version = "0.17.65"
dependencies = [
"anyhow",
"clap",
@@ -3207,7 +3207,7 @@ dependencies = [
[[package]]
name = "letterbox-server"
version = "0.17.62"
version = "0.17.65"
dependencies = [
"ammonia",
"anyhow",
@@ -3230,8 +3230,8 @@ dependencies = [
"html-escape",
"html2text",
"ical",
"letterbox-notmuch 0.17.62",
"letterbox-shared 0.17.62",
"letterbox-notmuch 0.17.65",
"letterbox-shared 0.17.65",
"linkify",
"lol_html",
"mailparse",
@@ -3272,10 +3272,10 @@ dependencies = [
[[package]]
name = "letterbox-shared"
version = "0.17.62"
version = "0.17.65"
dependencies = [
"build-info",
"letterbox-notmuch 0.17.62",
"letterbox-notmuch 0.17.65",
"regex",
"serde",
"sqlx",
@@ -3285,7 +3285,7 @@ dependencies = [
[[package]]
name = "letterbox-web"
version = "0.17.62"
version = "0.17.65"
dependencies = [
"build-info",
"build-info-build",
@@ -3297,7 +3297,7 @@ dependencies = [
"graphql_client",
"human_format",
"itertools",
"letterbox-shared 0.17.62",
"letterbox-shared 0.17.65",
"log",
"seed",
"seed_hooks",

View File

@@ -8,7 +8,7 @@ authors = ["Bill Thiede <git@xinu.tv>"]
edition = "2021"
license = "UNLICENSED"
publish = ["xinu"]
version = "0.17.62"
version = "0.17.65"
repository = "https://git.z.xinu.tv/wathiede/letterbox"
[profile.dev]

View File

@@ -224,6 +224,24 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
});
}
Msg::AddTag(query, tag) => {
orders.skip().perform_cmd(async move {
let res: Result<
graphql_client::Response<graphql::add_tag_mutation::ResponseData>,
gloo_net::Error,
> = send_graphql(graphql::AddTagMutation::build_query(
graphql::add_tag_mutation::Variables {
query: query.clone(),
tag: tag.clone(),
},
))
.await;
if let Err(e) = res {
error!("Failed to add tag {tag} to {query}: {e}");
}
Msg::Refresh
});
}
Msg::AddTagAndGoToSearch(query, tag) => {
orders.skip().perform_cmd(async move {
let res: Result<
graphql_client::Response<graphql::add_tag_mutation::ResponseData>,
@@ -256,7 +274,24 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
if let Err(e) = res {
error!("Failed to remove tag {tag} to {query}: {e}");
}
// TODO: reconsider this behavior
Msg::Refresh
});
}
Msg::RemoveTagAndGoToSearch(query, tag) => {
orders.skip().perform_cmd(async move {
let res: Result<
graphql_client::Response<graphql::remove_tag_mutation::ResponseData>,
gloo_net::Error,
> = send_graphql(graphql::RemoveTagMutation::build_query(
graphql::remove_tag_mutation::Variables {
query: query.clone(),
tag: tag.clone(),
},
))
.await;
if let Err(e) = res {
error!("Failed to remove tag {tag} to {query}: {e}");
}
Msg::GoToSearchResults
});
}
@@ -505,7 +540,7 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
.join(" ");
orders
.skip()
.perform_cmd(async move { Msg::AddTag(threads, tag) });
.perform_cmd(async move { Msg::AddTagAndGoToSearch(threads, tag) });
}
}
Msg::SelectionRemoveTag(tag) => {
@@ -520,7 +555,7 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
.join(" ");
orders
.skip()
.perform_cmd(async move { Msg::RemoveTag(threads, tag) });
.perform_cmd(async move { Msg::RemoveTagAndGoToSearch(threads, tag) });
}
}
Msg::SelectionMarkAsRead => {
@@ -692,6 +727,13 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
};
orders.send_msg(Msg::CatchupNext);
}
Msg::CatchupMarkAsSpam => {
if let Some(thread_id) = current_thread_id(&model.context) {
orders.send_msg(Msg::AddTag(thread_id.clone(), "Spam".to_string()));
orders.send_msg(Msg::SetUnread(thread_id, false));
};
orders.send_msg(Msg::CatchupNext);
}
Msg::CatchupNext => {
orders.send_msg(Msg::ScrollToTop);
let Some(catchup) = &mut model.catchup else {
@@ -852,7 +894,10 @@ pub enum Msg {
SetUnread(String, bool),
AddTag(String, String),
AddTagAndGoToSearch(String, String),
#[allow(dead_code)]
RemoveTag(String, String),
RemoveTagAndGoToSearch(String, String),
Snooze(String, DateTime<Utc>),
FrontPageRequest {
@@ -902,6 +947,7 @@ pub enum Msg {
CatchupStart,
CatchupKeepUnread,
CatchupMarkAsRead,
CatchupMarkAsSpam,
CatchupNext,
CatchupExit,

View File

@@ -268,6 +268,14 @@ fn catchup_view(
Msg::GoToSearchResults
]))
],
button![
tw_classes::button(),
C!["text-red-500"],
attrs! {At::Title => "Mark as spam"},
span![i![C!["far", "fa-hand"]]],
span![C!["pl-2"], "Spam"],
ev(Ev::Click, |_| Msg::CatchupMarkAsSpam)
],
button![
tw_classes::button_with_color("bg-green-800", "hover:bg-green-700"),
span![i![C!["far", "fa-envelope-open"]]],
@@ -450,7 +458,7 @@ fn removable_tags_chiclet<'a>(thread_id: &'a str, tags: &'a [String]) -> Node<Ms
a![
C![&tw_classes::TAG_X],
span![i![C!["fa-solid", "fa-xmark"]]],
ev(Ev::Click, move |_| Msg::RemoveTag(thread_id, rm_tag))
ev(Ev::Click, move |_| Msg::RemoveTagAndGoToSearch(thread_id, rm_tag))
]
]
})