Compare commits

...

26 Commits

Author SHA1 Message Date
9e7522951c Merge pull request 'chore(deps): update rust crate clap to v4.5.52' (#195) from renovate/all-minor-patch into master
All checks were successful
Continuous integration / Check (push) Successful in 1m8s
Continuous integration / Test Suite (push) Successful in 1m58s
Continuous integration / Trunk (push) Successful in 1m0s
Continuous integration / Rustfmt (push) Successful in 59s
Continuous integration / build (push) Successful in 1m39s
Continuous integration / Disallow unused dependencies (push) Successful in 2m38s
2025-11-17 09:31:40 -08:00
b43a025d1a chore(deps): update rust crate clap to v4.5.52
All checks were successful
Continuous integration / Check (push) Successful in 1m16s
Continuous integration / Test Suite (push) Successful in 1m44s
Continuous integration / Trunk (push) Successful in 1m15s
Continuous integration / Rustfmt (push) Successful in 38s
Continuous integration / build (push) Successful in 1m32s
Continuous integration / Disallow unused dependencies (push) Successful in 2m37s
2025-11-17 17:16:44 +00:00
2aa82f09c6 Merge pull request 'chore(deps): lock file maintenance' (#194) from renovate/lock-file-maintenance into master
All checks were successful
Continuous integration / Check (push) Successful in 1m12s
Continuous integration / Test Suite (push) Successful in 1m28s
Continuous integration / Trunk (push) Successful in 7m47s
Continuous integration / Rustfmt (push) Successful in 52s
Continuous integration / build (push) Successful in 1m49s
Continuous integration / Disallow unused dependencies (push) Successful in 2m24s
2025-11-16 16:47:15 -08:00
27f800356c chore(deps): lock file maintenance
All checks were successful
Continuous integration / Check (push) Successful in 1m30s
Continuous integration / Test Suite (push) Successful in 3m22s
Continuous integration / Trunk (push) Successful in 1m47s
Continuous integration / Rustfmt (push) Successful in 55s
Continuous integration / build (push) Successful in 3m28s
Continuous integration / Disallow unused dependencies (push) Successful in 2m15s
2025-11-17 00:02:49 +00:00
20ddf25605 Merge pull request 'chore(deps): update rust crate html2text to v0.16.4' (#193) from renovate/all-minor-patch into master
All checks were successful
Continuous integration / Check (push) Successful in 1m7s
Continuous integration / Test Suite (push) Successful in 1m37s
Continuous integration / Trunk (push) Successful in 1m3s
Continuous integration / Rustfmt (push) Successful in 40s
Continuous integration / build (push) Successful in 1m36s
Continuous integration / Disallow unused dependencies (push) Successful in 2m16s
2025-11-16 07:46:40 -08:00
c79ffee6e4 chore(deps): update rust crate html2text to v0.16.4
All checks were successful
Continuous integration / Check (push) Successful in 1m2s
Continuous integration / Test Suite (push) Successful in 1m23s
Continuous integration / Trunk (push) Successful in 59s
Continuous integration / Rustfmt (push) Successful in 41s
Continuous integration / build (push) Successful in 1m38s
Continuous integration / Disallow unused dependencies (push) Successful in 2m15s
2025-11-16 15:31:42 +00:00
1972e9ec20 Merge pull request 'chore(deps): update rust crate html2text to v0.16.3' (#192) from renovate/all-minor-patch into master
All checks were successful
Continuous integration / Check (push) Successful in 1m8s
Continuous integration / Test Suite (push) Successful in 1m32s
Continuous integration / Trunk (push) Successful in 1m5s
Continuous integration / Rustfmt (push) Successful in 51s
Continuous integration / build (push) Successful in 1m46s
Continuous integration / Disallow unused dependencies (push) Successful in 2m51s
2025-11-16 04:31:53 -08:00
2a238b0b02 chore(deps): update rust crate html2text to v0.16.3
All checks were successful
Continuous integration / Check (push) Successful in 1m15s
Continuous integration / Test Suite (push) Successful in 1m49s
Continuous integration / Trunk (push) Successful in 8m43s
Continuous integration / Rustfmt (push) Successful in 49s
Continuous integration / build (push) Successful in 1m53s
Continuous integration / Disallow unused dependencies (push) Successful in 2m49s
2025-11-16 12:01:57 +00:00
639b6c9f0a Merge pull request 'chore(deps): update rust crate quick-xml to v0.38.4' (#190) from renovate/all-minor-patch into master
All checks were successful
Continuous integration / Check (push) Successful in 1m11s
Continuous integration / Test Suite (push) Successful in 1m28s
Continuous integration / Trunk (push) Successful in 1m10s
Continuous integration / Rustfmt (push) Successful in 48s
Continuous integration / build (push) Successful in 1m44s
Continuous integration / Disallow unused dependencies (push) Successful in 2m16s
2025-11-14 14:46:37 -08:00
2d6bf544da chore(deps): update rust crate quick-xml to v0.38.4
All checks were successful
Continuous integration / Check (push) Successful in 52s
Continuous integration / Test Suite (push) Successful in 1m16s
Continuous integration / Trunk (push) Successful in 58s
Continuous integration / Rustfmt (push) Successful in 48s
Continuous integration / build (push) Successful in 1m45s
Continuous integration / Disallow unused dependencies (push) Successful in 2m30s
2025-11-14 22:16:56 +00:00
a56b6d72f6 Merge pull request 'chore(deps): update rust crate axum to v0.8.7' (#191) from renovate/axum-monorepo into master
All checks were successful
Continuous integration / Check (push) Successful in 1m2s
Continuous integration / Test Suite (push) Successful in 1m58s
Continuous integration / Trunk (push) Successful in 1m9s
Continuous integration / Rustfmt (push) Successful in 52s
Continuous integration / build (push) Successful in 1m28s
Continuous integration / Disallow unused dependencies (push) Successful in 2m36s
2025-11-14 14:16:38 -08:00
c03de14b79 chore(deps): update rust crate axum to v0.8.7
All checks were successful
Continuous integration / Check (push) Successful in 1m4s
Continuous integration / Test Suite (push) Successful in 1m59s
Continuous integration / Trunk (push) Successful in 8m4s
Continuous integration / Rustfmt (push) Successful in 43s
Continuous integration / build (push) Successful in 1m47s
Continuous integration / Disallow unused dependencies (push) Successful in 2m43s
2025-11-14 21:46:44 +00:00
44fc422aa3 Merge pull request 'chore(deps): lock file maintenance' (#189) from renovate/lock-file-maintenance into master
All checks were successful
Continuous integration / Check (push) Successful in 1m18s
Continuous integration / Test Suite (push) Successful in 1m57s
Continuous integration / Trunk (push) Successful in 1m1s
Continuous integration / Rustfmt (push) Successful in 40s
Continuous integration / build (push) Successful in 2m25s
Continuous integration / Disallow unused dependencies (push) Successful in 2m55s
2025-11-09 19:47:33 -08:00
58880c17aa chore(deps): lock file maintenance
All checks were successful
Continuous integration / Check (push) Successful in 1m48s
Continuous integration / Test Suite (push) Successful in 3m41s
Continuous integration / Trunk (push) Successful in 1m27s
Continuous integration / Rustfmt (push) Successful in 46s
Continuous integration / build (push) Successful in 4m18s
Continuous integration / Disallow unused dependencies (push) Successful in 2m18s
2025-11-10 03:02:35 +00:00
2be3b9ed07 Merge pull request 'chore(deps): lock file maintenance' (#188) from renovate/lock-file-maintenance into master
All checks were successful
Continuous integration / Check (push) Successful in 1m8s
Continuous integration / Test Suite (push) Successful in 1m46s
Continuous integration / Trunk (push) Successful in 7m51s
Continuous integration / Rustfmt (push) Successful in 42s
Continuous integration / build (push) Successful in 2m11s
Continuous integration / Disallow unused dependencies (push) Successful in 2m12s
2025-11-09 16:47:25 -08:00
9dfaa11cc6 chore(deps): lock file maintenance
All checks were successful
Continuous integration / Check (push) Successful in 2m2s
Continuous integration / Test Suite (push) Successful in 4m18s
Continuous integration / Trunk (push) Successful in 1m52s
Continuous integration / Rustfmt (push) Successful in 42s
Continuous integration / build (push) Successful in 4m21s
Continuous integration / Disallow unused dependencies (push) Successful in 2m32s
2025-11-10 00:02:49 +00:00
49492f9f21 Merge pull request 'chore(deps): update rust crate html2text to v0.16.2' (#187) from renovate/all-minor-patch into master
All checks were successful
Continuous integration / Check (push) Successful in 1m18s
Continuous integration / Test Suite (push) Successful in 2m12s
Continuous integration / Trunk (push) Successful in 1m3s
Continuous integration / Rustfmt (push) Successful in 37s
Continuous integration / build (push) Successful in 2m25s
Continuous integration / Disallow unused dependencies (push) Successful in 2m13s
2025-11-08 23:31:37 -08:00
84e120df95 chore(deps): update rust crate html2text to v0.16.2
All checks were successful
Continuous integration / Check (push) Successful in 1m7s
Continuous integration / Test Suite (push) Successful in 1m35s
Continuous integration / Trunk (push) Successful in 7m48s
Continuous integration / Rustfmt (push) Successful in 40s
Continuous integration / build (push) Successful in 2m13s
Continuous integration / Disallow unused dependencies (push) Successful in 2m36s
2025-11-09 07:01:43 +00:00
b21f0bc398 Merge pull request 'chore(deps): update rust crate html2text to v0.16.1' (#186) from renovate/all-minor-patch into master
All checks were successful
Continuous integration / Check (push) Successful in 1m2s
Continuous integration / Test Suite (push) Successful in 1m28s
Continuous integration / Trunk (push) Successful in 58s
Continuous integration / Rustfmt (push) Successful in 41s
Continuous integration / build (push) Successful in 1m35s
Continuous integration / Disallow unused dependencies (push) Successful in 2m14s
2025-11-08 03:02:16 -08:00
d8463c3178 chore(deps): update rust crate html2text to v0.16.1
All checks were successful
Continuous integration / Check (push) Successful in 1m7s
Continuous integration / Test Suite (push) Successful in 1m38s
Continuous integration / Trunk (push) Successful in 7m33s
Continuous integration / Rustfmt (push) Successful in 41s
Continuous integration / build (push) Successful in 1m35s
Continuous integration / Disallow unused dependencies (push) Successful in 2m21s
2025-11-08 10:46:41 +00:00
e1681edda3 chore: Release
All checks were successful
Continuous integration / Check (push) Successful in 1m1s
Continuous integration / Test Suite (push) Successful in 1m32s
Continuous integration / Trunk (push) Successful in 1m0s
Continuous integration / Rustfmt (push) Successful in 39s
Continuous integration / build (push) Successful in 1m41s
Continuous integration / Disallow unused dependencies (push) Successful in 2m12s
2025-11-05 21:12:09 -08:00
25ee8522ad cargo sqlx prepare 2025-11-05 21:12:08 -08:00
df356e8711 server: add label_unprocessed method, and implement wake 2025-11-05 21:11:26 -08:00
2e43700cd7 chore: Release
All checks were successful
Continuous integration / Check (push) Successful in 1m0s
Continuous integration / Test Suite (push) Successful in 1m31s
Continuous integration / Trunk (push) Successful in 1m24s
Continuous integration / Rustfmt (push) Successful in 42s
Continuous integration / build (push) Successful in 1m37s
Continuous integration / Disallow unused dependencies (push) Successful in 2m25s
2025-11-05 15:47:21 -08:00
b3769d99bf web: fix styling for second layer tags 2025-11-05 15:46:37 -08:00
2aa85a03f8 web: make +6 month button work from post date 2025-11-05 15:01:56 -08:00
9 changed files with 419 additions and 306 deletions

599
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -0,0 +1,14 @@
{
"db_name": "PostgreSQL",
"query": "DELETE FROM snooze WHERE id = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Int4"
]
},
"nullable": []
},
"hash": "77f79f981a9736d18ffd4b87d3aec34d6a048162154a3aba833370c58a860795"
}

View File

@@ -0,0 +1,26 @@
{
"db_name": "PostgreSQL",
"query": "\nSELECT id, message_id\nFROM snooze\nWHERE wake < NOW();\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int4"
},
{
"ordinal": 1,
"name": "message_id",
"type_info": "Text"
}
],
"parameters": {
"Left": []
},
"nullable": [
false,
false
]
},
"hash": "c8383663124a5cc5912b54553f18f7064d33087ebfdf3c0c1c43cbe6d3577084"
}

View File

@@ -32,8 +32,8 @@ futures = "0.3.31"
headers = "0.4.0"
html-escape = "0.2.13"
ical = "0.11"
letterbox-notmuch = { path = "../notmuch", version = "0.17.47", registry = "xinu" }
letterbox-shared = { path = "../shared", version = "0.17.47", registry = "xinu" }
letterbox-notmuch = { path = "../notmuch", version = "0.17.49", registry = "xinu" }
letterbox-shared = { path = "../shared", version = "0.17.49", registry = "xinu" }
linkify = "0.10.0"
lol_html = "2.3.0"
mailparse = "0.16.1"

View File

@@ -676,6 +676,18 @@ impl MutationRoot {
Ok(true)
}
#[instrument(skip_all, fields(rid=request_id()))]
async fn label_unprocessed<'ctx>(
&self,
ctx: &Context<'ctx>,
limit: Option<usize>,
) -> Result<bool, Error> {
let nm = ctx.data_unchecked::<Notmuch>();
let pool = ctx.data_unchecked::<PgPool>();
label_unprocessed(&nm, &pool, false, limit, "tag:unprocessed").await?;
Ok(true)
}
#[instrument(skip_all, fields(rid=request_id()))]
async fn refresh<'ctx>(&self, ctx: &Context<'ctx>) -> Result<bool, Error> {
let nm = ctx.data_unchecked::<Notmuch>();
@@ -687,6 +699,9 @@ impl MutationRoot {
// Process email labels
label_unprocessed(&nm, &pool, false, Some(1000), "tag:unprocessed").await?;
// Look for snoozed messages and mark unread
wakeup(&nm, &pool).await?;
#[cfg(feature = "tantivy")]
{
let tantivy = ctx.data_unchecked::<TantivyConnection>();
@@ -707,6 +722,33 @@ impl SubscriptionRoot {
pub type GraphqlSchema = Schema<QueryRoot, MutationRoot, SubscriptionRoot>;
#[instrument(name = "wakeup", skip_all)]
pub async fn wakeup(nm: &Notmuch, pool: &PgPool) -> Result<(), Error> {
for row in sqlx::query!(
r#"
SELECT id, message_id
FROM snooze
WHERE wake < NOW();
"#
)
.fetch_all(pool)
.await?
{
let query: Query = row.message_id.parse()?;
info!("need to wake {query}");
let unread = true;
newsreader::set_read_status(pool, &query, unread).await?;
#[cfg(feature = "tantivy")]
tantivy.reindex_thread(pool, &query).await?;
nm::set_read_status(nm, &query, unread).await?;
sqlx::query!("DELETE FROM snooze WHERE id = $1", row.id)
.execute(pool)
.await?;
}
Ok(())
}
#[instrument(skip_all, fields(query=query))]
pub async fn compute_catchup_ids(
nm: &Notmuch,

View File

@@ -12,7 +12,7 @@ version.workspace = true
[dependencies]
build-info = "0.0.42"
letterbox-notmuch = { path = "../notmuch", version = "0.17.47", registry = "xinu" }
letterbox-notmuch = { path = "../notmuch", version = "0.17.49", registry = "xinu" }
regex = "1.11.1"
serde = { version = "1.0.219", features = ["derive"] }
sqlx = "0.8.5"

View File

@@ -33,7 +33,7 @@ wasm-bindgen = "=0.2.100"
uuid = { version = "1.16.0", features = [
"js",
] } # direct dep to set js feature, prevents Rng issues
letterbox-shared = { path = "../shared/", version = "0.17.47", registry = "xinu" }
letterbox-shared = { path = "../shared/", version = "0.17.49", registry = "xinu" }
seed_hooks = { version = "0.4.1", registry = "xinu" }
strum_macros = "0.27.1"
gloo-console = "0.3.0"

View File

@@ -739,7 +739,7 @@ fn render_open_header(msg: &ShowThreadQueryThreadOnEmailThreadMessages) -> Node<
" ",
from_detail.as_ref().map(|text| copy_text_widget(&text))
],
snooze_buttons(&id),
snooze_buttons(msg.timestamp, &id),
],
IF!(!msg.to.is_empty() =>div![
C!["text-xs"],
@@ -1375,7 +1375,7 @@ pub fn view_tags(tags: &Option<Vec<Tag>>) -> Node<Msg> {
},
],
a![
C!["grow", "truncate"],
C![indent_cls, "grow", "truncate"],
attrs! {
At::Href => href
},
@@ -1603,7 +1603,7 @@ fn render_news_post_header(post: &ShowThreadQueryThreadOnNewsPost) -> Node<Msg>
div![
C!["flex"],
div![C!["font-semibold", "text-sm", "flex-1"], from],
snooze_buttons(&id),
snooze_buttons(Some(post.timestamp), &id),
],
div![
C!["flex", "gap-2", "pt-2", "text-sm"],
@@ -1700,7 +1700,7 @@ fn click_to_top() -> Node<Msg> {
]
}
fn snooze_buttons(id: &str) -> Node<Msg> {
fn snooze_buttons(timestamp: Option<i64>, id: &str) -> Node<Msg> {
div![
span![C!["px-2"], ""],
button![
@@ -1727,17 +1727,19 @@ fn snooze_buttons(id: &str) -> Node<Msg> {
}
})
],
button![
tw_classes::button(),
C!["rounded-l-none"],
"6m",
ev(Ev::Click, {
let id = id.to_string();
move |e| {
e.stop_propagation();
Msg::Snooze(id, Utc::now() + chrono::Days::new(180))
}
})
],
timestamp.map(
|ts| chrono::DateTime::from_timestamp(ts, 0).map(|ts| button![
tw_classes::button(),
C!["rounded-l-none"],
"+6m",
ev(Ev::Click, {
let id = id.to_string();
move |e| {
e.stop_propagation();
Msg::Snooze(id, ts + chrono::Days::new(180))
}
})
])
),
]
}