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]]
name = "letterbox-notmuch"
version = "0.9.7"
version = "0.9.8"
dependencies = [
"itertools 0.14.0",
"log",
@ -2980,14 +2980,14 @@ dependencies = [
[[package]]
name = "letterbox-procmail2notmuch"
version = "0.9.7"
version = "0.9.8"
dependencies = [
"anyhow",
]
[[package]]
name = "letterbox-server"
version = "0.9.7"
version = "0.9.8"
dependencies = [
"ammonia",
"anyhow",
@ -3030,7 +3030,7 @@ dependencies = [
[[package]]
name = "letterbox-shared"
version = "0.9.7"
version = "0.9.8"
dependencies = [
"build-info",
"letterbox-notmuch",
@ -3039,7 +3039,7 @@ dependencies = [
[[package]]
name = "letterbox-web"
version = "0.9.7"
version = "0.9.8"
dependencies = [
"build-info",
"build-info-build",

View File

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

View File

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

View File

@ -12,5 +12,5 @@ version.workspace = true
[dependencies]
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"] }

View File

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

View File

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