Compare commits

..

3 Commits

Author SHA1 Message Date
9f63205ff3 chore: Release
All checks were successful
Continuous integration / Check (push) Successful in 37s
Continuous integration / Test Suite (push) Successful in 40s
Continuous integration / Trunk (push) Successful in 37s
Continuous integration / Rustfmt (push) Successful in 31s
Continuous integration / build (push) Successful in 47s
Continuous integration / Disallow unused dependencies (push) Successful in 57s
2025-04-10 12:35:10 -07:00
5a0378948d web: apply title wrapping on search results page 2025-04-10 12:32:46 -07:00
2b4c45be74 web: conditionally wrap title when large words found 2025-04-10 12:16:53 -07:00
6 changed files with 35 additions and 14 deletions

10
Cargo.lock generated
View File

@ -3001,7 +3001,7 @@ dependencies = [
[[package]] [[package]]
name = "letterbox-notmuch" name = "letterbox-notmuch"
version = "0.10.11" version = "0.10.12"
dependencies = [ dependencies = [
"itertools", "itertools",
"log", "log",
@ -3016,14 +3016,14 @@ dependencies = [
[[package]] [[package]]
name = "letterbox-procmail2notmuch" name = "letterbox-procmail2notmuch"
version = "0.10.11" version = "0.10.12"
dependencies = [ dependencies = [
"anyhow", "anyhow",
] ]
[[package]] [[package]]
name = "letterbox-server" name = "letterbox-server"
version = "0.10.11" version = "0.10.12"
dependencies = [ dependencies = [
"ammonia", "ammonia",
"anyhow", "anyhow",
@ -3065,7 +3065,7 @@ dependencies = [
[[package]] [[package]]
name = "letterbox-shared" name = "letterbox-shared"
version = "0.10.11" version = "0.10.12"
dependencies = [ dependencies = [
"build-info", "build-info",
"letterbox-notmuch", "letterbox-notmuch",
@ -3074,7 +3074,7 @@ dependencies = [
[[package]] [[package]]
name = "letterbox-web" name = "letterbox-web"
version = "0.10.11" version = "0.10.12"
dependencies = [ dependencies = [
"build-info", "build-info",
"build-info-build", "build-info-build",

View File

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

View File

@ -47,8 +47,8 @@ urlencoding = "2.1.3"
#xtracing = { path = "../../xtracing" } #xtracing = { path = "../../xtracing" }
#xtracing = { git = "http://git-private.h.xinu.tv/wathiede/xtracing.git" } #xtracing = { git = "http://git-private.h.xinu.tv/wathiede/xtracing.git" }
xtracing = { version = "0.3.0", registry = "xinu" } xtracing = { version = "0.3.0", registry = "xinu" }
letterbox-notmuch = { version = "0.10.11", path = "../notmuch", registry = "xinu" } letterbox-notmuch = { version = "0.10.12", path = "../notmuch", registry = "xinu" }
letterbox-shared = { version = "0.10.11", path = "../shared", registry = "xinu" } letterbox-shared = { version = "0.10.12", path = "../shared", registry = "xinu" }
[build-dependencies] [build-dependencies]
build-info-build = "0.0.40" build-info-build = "0.0.40"

View File

@ -12,5 +12,5 @@ version.workspace = true
[dependencies] [dependencies]
build-info = "0.0.40" build-info = "0.0.40"
letterbox-notmuch = { version = "0.10.11", path = "../notmuch", registry = "xinu" } letterbox-notmuch = { version = "0.10.12", path = "../notmuch", registry = "xinu" }
serde = { version = "1.0.147", features = ["derive"] } serde = { version = "1.0.147", features = ["derive"] }

View File

@ -33,8 +33,8 @@ wasm-bindgen = "=0.2.100"
uuid = { version = "1.13.1", features = [ uuid = { version = "1.13.1", features = [
"js", "js",
] } # direct dep to set js feature, prevents Rng issues ] } # direct dep to set js feature, prevents Rng issues
letterbox-shared = { version = "0.10.11", path = "../shared", registry = "xinu" } letterbox-shared = { version = "0.10.12", path = "../shared", registry = "xinu" }
letterbox-notmuch = { version = "0.10.11", path = "../notmuch", registry = "xinu" } letterbox-notmuch = { version = "0.10.12", path = "../notmuch", registry = "xinu" }
seed_hooks = { version = "0.4.0", registry = "xinu" } seed_hooks = { version = "0.4.0", registry = "xinu" }
strum_macros = "0.27.1" strum_macros = "0.27.1"

View File

@ -273,6 +273,13 @@ fn search_results(
tags.remove(idx); tags.remove(idx);
}; };
let is_unread = unread_idx.is_some(); let is_unread = unread_idx.is_some();
let mut title_break = None;
const TITLE_LENGTH_WRAP_LIMIT: usize = 40;
for w in r.subject.split_whitespace() {
if w.len() > TITLE_LENGTH_WRAP_LIMIT {
title_break = Some(C!["break-all", "text-pretty"]);
}
}
div![ div![
C![ C![
"flex", "flex",
@ -315,7 +322,7 @@ fn search_results(
attrs! { attrs! {
At::Href => urls::thread(&tid) At::Href => urls::thread(&tid)
}, },
div![&r.subject], div![title_break, &r.subject],
span![C!["text-xs"], pretty_authors(&r.authors)], span![C!["text-xs"], pretty_authors(&r.authors)],
div![ div![
C!["flex", "flex-wrap", "justify-between"], C!["flex", "flex-wrap", "justify-between"],
@ -1097,11 +1104,18 @@ fn thread(
let unread_thread_id = thread.thread_id.clone(); let unread_thread_id = thread.thread_id.clone();
let spam_add_thread_id = thread.thread_id.clone(); let spam_add_thread_id = thread.thread_id.clone();
let spam_unread_thread_id = thread.thread_id.clone(); let spam_unread_thread_id = thread.thread_id.clone();
let mut title_break = None;
const TITLE_LENGTH_WRAP_LIMIT: usize = 40;
for w in subject.split_whitespace() {
if w.len() > TITLE_LENGTH_WRAP_LIMIT {
title_break = Some(C!["break-all", "text-pretty"]);
}
}
div![ div![
C!["lg:p-4", "max-w-4xl"], C!["lg:p-4", "max-w-4xl"],
div![ div![
C!["p-4", "lg:p-0"], C!["p-4", "lg:p-0"],
h3![C!["text-xl", "break-all", "text-pretty"], subject], h3![C!["text-xl"], title_break, subject],
span![removable_tags_chiclet(&thread.thread_id, &tags)], span![removable_tags_chiclet(&thread.thread_id, &tags)],
IF!(!catchup_mode => div![ IF!(!catchup_mode => div![
C!["pt-4", "gap-2", "flex", "justify-around"], C!["pt-4", "gap-2", "flex", "justify-around"],
@ -1397,11 +1411,18 @@ fn news_post(
] ]
} }
let mut title_break = None;
const TITLE_LENGTH_WRAP_LIMIT: usize = 40;
for w in subject.split_whitespace() {
if w.len() > TITLE_LENGTH_WRAP_LIMIT {
title_break = Some(C!["break-all", "text-pretty"]);
}
}
div![ div![
C!["lg:p-4", "max-w-4xl"], C!["lg:p-4", "max-w-4xl"],
div![ div![
C!["p-4", "lg:p-0"], C!["p-4", "lg:p-0"],
h3![C!["text-xl", "break-all", "text-pretty"], subject], h3![C!["text-xl"], title_break, subject],
span![tag(format!("News/{}", post.slug))], span![tag(format!("News/{}", post.slug))],
IF!(!catchup_mode => div![ IF!(!catchup_mode => div![
C!["pt-4", "gap-2", "flex", "justify-around"], C!["pt-4", "gap-2", "flex", "justify-around"],