Compare commits

...

2 Commits

Author SHA1 Message Date
a96693004c chore: Release
All checks were successful
Continuous integration / Test Suite (push) Successful in 42s
Continuous integration / Check (push) Successful in 2m9s
Continuous integration / Trunk (push) Successful in 38s
Continuous integration / build (push) Successful in 50s
Continuous integration / Rustfmt (push) Successful in 1m7s
Continuous integration / Disallow unused dependencies (push) Successful in 56s
2025-02-25 20:43:47 -08:00
ed9fe11fbf web: trimmed views for catchup mode 2025-02-25 20:43:27 -08:00
6 changed files with 31 additions and 25 deletions

10
Cargo.lock generated
View File

@ -2965,7 +2965,7 @@ dependencies = [
[[package]] [[package]]
name = "letterbox-notmuch" name = "letterbox-notmuch"
version = "0.9.7" version = "0.9.8"
dependencies = [ dependencies = [
"itertools 0.14.0", "itertools 0.14.0",
"log", "log",
@ -2980,14 +2980,14 @@ dependencies = [
[[package]] [[package]]
name = "letterbox-procmail2notmuch" name = "letterbox-procmail2notmuch"
version = "0.9.7" version = "0.9.8"
dependencies = [ dependencies = [
"anyhow", "anyhow",
] ]
[[package]] [[package]]
name = "letterbox-server" name = "letterbox-server"
version = "0.9.7" version = "0.9.8"
dependencies = [ dependencies = [
"ammonia", "ammonia",
"anyhow", "anyhow",
@ -3030,7 +3030,7 @@ dependencies = [
[[package]] [[package]]
name = "letterbox-shared" name = "letterbox-shared"
version = "0.9.7" version = "0.9.8"
dependencies = [ dependencies = [
"build-info", "build-info",
"letterbox-notmuch", "letterbox-notmuch",
@ -3039,7 +3039,7 @@ dependencies = [
[[package]] [[package]]
name = "letterbox-web" name = "letterbox-web"
version = "0.9.7" version = "0.9.8"
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.9.7" version = "0.9.8"
repository = "https://git.z.xinu.tv/wathiede/letterbox" repository = "https://git.z.xinu.tv/wathiede/letterbox"
[profile.dev] [profile.dev]

View File

@ -48,8 +48,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.9.7", path = "../notmuch", registry = "xinu" } letterbox-notmuch = { version = "0.9.8", path = "../notmuch", registry = "xinu" }
letterbox-shared = { version = "0.9.7", path = "../shared", registry = "xinu" } letterbox-shared = { version = "0.9.8", path = "../shared", registry = "xinu" }
[build-dependencies] [build-dependencies]
build-info-build = "0.0.39" build-info-build = "0.0.39"

View File

@ -12,5 +12,5 @@ version.workspace = true
[dependencies] [dependencies]
build-info = "0.0.39" build-info = "0.0.39"
letterbox-notmuch = { version = "0.9.7", path = "../notmuch", registry = "xinu" } letterbox-notmuch = { version = "0.9.8", 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.9.7", path = "../shared", registry = "xinu" } letterbox-shared = { version = "0.9.8", path = "../shared", registry = "xinu" }
letterbox-notmuch = { version = "0.9.7", path = "../notmuch", registry = "xinu" } letterbox-notmuch = { version = "0.9.8", 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

@ -93,13 +93,13 @@ pub fn view(model: &Model) -> Node<Msg> {
} => { } => {
if let Some(catchup) = &model.catchup { if let Some(catchup) = &model.catchup {
catchup_view( catchup_view(
thread(thread_data, open_messages, &model.content_el), thread(thread_data, open_messages, &model.content_el, true),
&catchup.items, &catchup.items,
model.read_completion_ratio, model.read_completion_ratio,
) )
} else { } else {
normal_view( normal_view(
thread(thread_data, open_messages, &model.content_el), thread(thread_data, open_messages, &model.content_el, false),
&model.versions, &model.versions,
&model.query, &model.query,
&model.refreshing_state, &model.refreshing_state,
@ -114,13 +114,13 @@ pub fn view(model: &Model) -> Node<Msg> {
} => { } => {
if let Some(catchup) = &model.catchup { if let Some(catchup) = &model.catchup {
catchup_view( catchup_view(
news_post(post, &model.content_el), news_post(post, &model.content_el, true),
&catchup.items, &catchup.items,
model.read_completion_ratio, model.read_completion_ratio,
) )
} else { } else {
normal_view( normal_view(
news_post(post, &model.content_el), news_post(post, &model.content_el, false),
&model.versions, &model.versions,
&model.query, &model.query,
&model.refreshing_state, &model.refreshing_state,
@ -199,9 +199,10 @@ fn catchup_view(
"border-b", "border-b",
"border-gray-500", "border-gray-500",
"bg-black", "bg-black",
"opacity-50",
], ],
div![ div![
C!["absolute", "right-4", "text-gray-500"], C!["absolute", "top-0", "right-4", "text-gray-500", "p-4"],
span![i![C!["fas", "fa-x"]]], span![i![C!["fas", "fa-x"]]],
ev(Ev::Click, move |_| Msg::CatchupExit) ev(Ev::Click, move |_| Msg::CatchupExit)
], ],
@ -210,7 +211,7 @@ fn catchup_view(
format!("{} left ", items.iter().filter(|i| !i.seen).count(),) format!("{} left ", items.iter().filter(|i| !i.seen).count(),)
] ]
], ],
div![C!["mt-12", "mb-4"], content], div![C!["mt-12", "mb-20"], content],
div![ div![
C![ C![
"fixed", "fixed",
@ -224,6 +225,7 @@ fn catchup_view(
"border-t", "border-t",
"border-gray-500", "border-gray-500",
"bg-black", "bg-black",
"opacity-50",
], ],
button![ button![
tw_classes::button(), tw_classes::button(),
@ -1054,6 +1056,7 @@ fn thread(
thread: &ShowThreadQueryThreadOnEmailThread, thread: &ShowThreadQueryThreadOnEmailThread,
open_messages: &HashSet<String>, open_messages: &HashSet<String>,
content_el: &ElRef<HtmlElement>, content_el: &ElRef<HtmlElement>,
catchup_mode: bool,
) -> Node<Msg> { ) -> Node<Msg> {
// TODO(wathiede): show per-message subject if it changes significantly from top-level subject // TODO(wathiede): show per-message subject if it changes significantly from top-level subject
let subject = if thread.subject.is_empty() { let subject = if thread.subject.is_empty() {
@ -1086,7 +1089,7 @@ fn thread(
C!["p-4", "lg:p-0"], C!["p-4", "lg:p-0"],
h3![C!["text-xl"], subject], h3![C!["text-xl"], subject],
span![removable_tags_chiclet(&thread.thread_id, &tags)], span![removable_tags_chiclet(&thread.thread_id, &tags)],
div![ IF!(!catchup_mode => div![
C!["pt-4", "gap-2", "flex", "justify-around"], C!["pt-4", "gap-2", "flex", "justify-around"],
div![ div![
button![ button![
@ -1124,13 +1127,13 @@ fn thread(
Msg::GoToSearchResults Msg::GoToSearchResults
])), ])),
]] ]]
], ]),
], ],
div![ div![
C!["lg:mt-4", "mail-thread"], C!["lg:mt-4", "mail-thread"],
el_ref(content_el), el_ref(content_el),
messages, messages,
click_to_top() IF!(!catchup_mode => click_to_top())
], ],
/* TODO(wathiede): plumb in orignal id /* TODO(wathiede): plumb in orignal id
a![ a![
@ -1351,7 +1354,11 @@ pub fn view_tags(tags: &Option<Vec<Tag>>) -> Node<Msg> {
} }
// TODO: add cathup_mode:bool and hide elements when true // TODO: add cathup_mode:bool and hide elements when true
fn news_post(post: &ShowThreadQueryThreadOnNewsPost, content_el: &ElRef<HtmlElement>) -> Node<Msg> { fn news_post(
post: &ShowThreadQueryThreadOnNewsPost,
content_el: &ElRef<HtmlElement>,
catchup_mode: bool,
) -> Node<Msg> {
let subject = &post.title; let subject = &post.title;
set_title(subject); set_title(subject);
let read_thread_id = post.thread_id.clone(); let read_thread_id = post.thread_id.clone();
@ -1382,7 +1389,7 @@ fn news_post(post: &ShowThreadQueryThreadOnNewsPost, content_el: &ElRef<HtmlElem
C!["p-4", "lg:p-0"], C!["p-4", "lg:p-0"],
h3![C!["text-xl"], subject], h3![C!["text-xl"], subject],
span![tag(format!("News/{}", post.slug))], span![tag(format!("News/{}", post.slug))],
div![ IF!(!catchup_mode => div![
C!["pt-4", "gap-2", "flex", "justify-around"], C!["pt-4", "gap-2", "flex", "justify-around"],
div![ div![
button![ button![
@ -1410,7 +1417,7 @@ fn news_post(post: &ShowThreadQueryThreadOnNewsPost, content_el: &ElRef<HtmlElem
], ],
// Placeholder for symmetry with email view that has Spam button // Placeholder for symmetry with email view that has Spam button
div![], div![],
], ]),
], ],
div![ div![
C!["lg:mt-4"], C!["lg:mt-4"],
@ -1430,12 +1437,11 @@ fn news_post(post: &ShowThreadQueryThreadOnNewsPost, content_el: &ElRef<HtmlElem
raw![&post.body] raw![&post.body]
] ]
], ],
click_to_top(), IF!(!catchup_mode => click_to_top()),
] ]
} }
fn render_news_post_header(post: &ShowThreadQueryThreadOnNewsPost) -> Node<Msg> { fn render_news_post_header(post: &ShowThreadQueryThreadOnNewsPost) -> Node<Msg> {
let from = &post.site; let from = &post.site;
// TODO: move avatar/favicon stuff to the server side and and come up with a solution for emails
let id = post.thread_id.clone(); let id = post.thread_id.clone();
let is_unread = !post.is_read; let is_unread = !post.is_read;
let url = &post.url; let url = &post.url;