Compare commits
No commits in common. "e01dabe6ed8d6cb9cecc1aebdda7679f5b058558" and "d53db5b49a377c076ce5d97714c9439aadbd6b64" have entirely different histories.
e01dabe6ed
...
d53db5b49a
10
Cargo.lock
generated
10
Cargo.lock
generated
@ -3001,7 +3001,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox-notmuch"
|
name = "letterbox-notmuch"
|
||||||
version = "0.12.0"
|
version = "0.10.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itertools",
|
"itertools",
|
||||||
"log",
|
"log",
|
||||||
@ -3016,14 +3016,14 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox-procmail2notmuch"
|
name = "letterbox-procmail2notmuch"
|
||||||
version = "0.12.0"
|
version = "0.10.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox-server"
|
name = "letterbox-server"
|
||||||
version = "0.12.0"
|
version = "0.10.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ammonia",
|
"ammonia",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
@ -3065,7 +3065,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox-shared"
|
name = "letterbox-shared"
|
||||||
version = "0.12.0"
|
version = "0.10.13"
|
||||||
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.12.0"
|
version = "0.10.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"build-info",
|
"build-info",
|
||||||
"build-info-build",
|
"build-info-build",
|
||||||
|
|||||||
@ -8,7 +8,7 @@ authors = ["Bill Thiede <git@xinu.tv>"]
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "UNLICENSED"
|
license = "UNLICENSED"
|
||||||
publish = ["xinu"]
|
publish = ["xinu"]
|
||||||
version = "0.12.0"
|
version = "0.10.13"
|
||||||
repository = "https://git.z.xinu.tv/wathiede/letterbox"
|
repository = "https://git.z.xinu.tv/wathiede/letterbox"
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
|
|||||||
@ -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.12.0", path = "../notmuch", registry = "xinu" }
|
letterbox-notmuch = { version = "0.10.13", path = "../notmuch", registry = "xinu" }
|
||||||
letterbox-shared = { version = "0.12.0", path = "../shared", registry = "xinu" }
|
letterbox-shared = { version = "0.10.13", path = "../shared", registry = "xinu" }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
build-info-build = "0.0.40"
|
build-info-build = "0.0.40"
|
||||||
|
|||||||
@ -12,5 +12,5 @@ version.workspace = true
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
build-info = "0.0.40"
|
build-info = "0.0.40"
|
||||||
letterbox-notmuch = { version = "0.12.0", path = "../notmuch", registry = "xinu" }
|
letterbox-notmuch = { version = "0.10.13", path = "../notmuch", registry = "xinu" }
|
||||||
serde = { version = "1.0.147", features = ["derive"] }
|
serde = { version = "1.0.147", features = ["derive"] }
|
||||||
|
|||||||
@ -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.12.0", path = "../shared", registry = "xinu" }
|
letterbox-shared = { version = "0.10.13", path = "../shared", registry = "xinu" }
|
||||||
letterbox-notmuch = { version = "0.12.0", path = "../notmuch", registry = "xinu" }
|
letterbox-notmuch = { version = "0.10.13", 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"
|
||||||
|
|
||||||
|
|||||||
@ -616,6 +616,9 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
|
|||||||
orders.send_msg(Msg::CatchupRequest { query });
|
orders.send_msg(Msg::CatchupRequest { query });
|
||||||
}
|
}
|
||||||
Msg::CatchupKeepUnread => {
|
Msg::CatchupKeepUnread => {
|
||||||
|
if let Some(thread_id) = current_thread_id(&model.context) {
|
||||||
|
orders.send_msg(Msg::SetUnread(thread_id, true));
|
||||||
|
};
|
||||||
orders.send_msg(Msg::CatchupNext);
|
orders.send_msg(Msg::CatchupNext);
|
||||||
}
|
}
|
||||||
Msg::CatchupMarkAsRead => {
|
Msg::CatchupMarkAsRead => {
|
||||||
@ -630,15 +633,7 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
|
|||||||
orders.send_msg(Msg::GoToSearchResults);
|
orders.send_msg(Msg::GoToSearchResults);
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
let Some(thread_id) = current_thread_id(&model.context) else {
|
let Some(idx) = catchup.items.iter().position(|i| !i.seen) else {
|
||||||
return;
|
|
||||||
};
|
|
||||||
let Some(idx) = catchup
|
|
||||||
.items
|
|
||||||
.iter()
|
|
||||||
.inspect(|i| info!("i {i:?} thread_id {thread_id}"))
|
|
||||||
.position(|i| i.id == thread_id)
|
|
||||||
else {
|
|
||||||
// All items have been seen
|
// All items have been seen
|
||||||
orders.send_msg(Msg::CatchupExit);
|
orders.send_msg(Msg::CatchupExit);
|
||||||
orders.send_msg(Msg::GoToSearchResults);
|
orders.send_msg(Msg::GoToSearchResults);
|
||||||
@ -731,7 +726,6 @@ pub struct Catchup {
|
|||||||
pub items: Vec<CatchupItem>,
|
pub items: Vec<CatchupItem>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct CatchupItem {
|
pub struct CatchupItem {
|
||||||
pub id: String,
|
pub id: String,
|
||||||
pub seen: bool,
|
pub seen: bool,
|
||||||
@ -765,7 +759,6 @@ pub enum Msg {
|
|||||||
NextPage,
|
NextPage,
|
||||||
PreviousPage,
|
PreviousPage,
|
||||||
GoToSearchResults,
|
GoToSearchResults,
|
||||||
|
|
||||||
UpdateQuery(String),
|
UpdateQuery(String),
|
||||||
SearchQuery(String),
|
SearchQuery(String),
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@ use web_sys::{HtmlElement, HtmlInputElement};
|
|||||||
use crate::{
|
use crate::{
|
||||||
api::urls,
|
api::urls,
|
||||||
graphql::{front_page_query::*, show_thread_query::*},
|
graphql::{front_page_query::*, show_thread_query::*},
|
||||||
state::{CatchupItem, Context, Model, Msg, RefreshingState, Tag, Version},
|
state::{unread_query, CatchupItem, Context, Model, Msg, RefreshingState, Tag, Version},
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO(wathiede): create a QueryString enum that wraps single and multiple message ids and thread
|
// TODO(wathiede): create a QueryString enum that wraps single and multiple message ids and thread
|
||||||
@ -468,22 +468,29 @@ fn search_toolbar(
|
|||||||
if let Some(tri) = tri.get() {
|
if let Some(tri) = tri.get() {
|
||||||
tri.set_indeterminate(indeterminate);
|
tri.set_indeterminate(indeterminate);
|
||||||
}
|
}
|
||||||
let catchup = div![button![
|
nav![
|
||||||
|
C!["py-4", "flex", "w-full", "justify-between"],
|
||||||
|
div![
|
||||||
|
C!["gap-2", "flex", IF!(show_bulk_edit => "hidden")],
|
||||||
|
div![button![
|
||||||
tw_classes::button(),
|
tw_classes::button(),
|
||||||
attrs! {At::Title => "Catch up"},
|
attrs! {At::Title => "Mark as read"},
|
||||||
span![i![C!["far", "fa-eye"]]],
|
span![i![C!["far", "fa-eye"]]],
|
||||||
span![C!["pl-2", "hidden", "md:inline"], "Catch-up"],
|
span![C!["pl-2", "hidden", "md:inline"], "Catch-up"],
|
||||||
ev(Ev::Click, |_| Msg::CatchupStart)
|
ev(Ev::Click, |_| Msg::CatchupStart)
|
||||||
]];
|
]],
|
||||||
let tristate_input = div![
|
],
|
||||||
|
div![
|
||||||
|
C!["gap-2", "flex", IF!(!show_bulk_edit => "hidden")],
|
||||||
|
div![
|
||||||
C!["flex", "items-center", "mr-4"],
|
C!["flex", "items-center", "mr-4"],
|
||||||
input![
|
input![
|
||||||
&tri,
|
tri,
|
||||||
C![&tw_classes::CHECKBOX],
|
C![&tw_classes::CHECKBOX],
|
||||||
attrs! {
|
attrs! {
|
||||||
At::Type=>"checkbox",
|
At::Type=>"checkbox",
|
||||||
},
|
At::Checked=>all_selected,
|
||||||
IF!(all_selected=>attrs!{At::Checked=>true})
|
}
|
||||||
],
|
],
|
||||||
ev(Ev::Input, move |_| {
|
ev(Ev::Input, move |_| {
|
||||||
if all_selected {
|
if all_selected {
|
||||||
@ -492,18 +499,7 @@ fn search_toolbar(
|
|||||||
Msg::SelectionSetAll
|
Msg::SelectionSetAll
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
];
|
|
||||||
nav![
|
|
||||||
C!["py-4", "flex", "w-full", "justify-between"],
|
|
||||||
div![
|
|
||||||
C!["gap-2", "flex", IF!(show_bulk_edit => "hidden")],
|
|
||||||
&tristate_input,
|
|
||||||
&catchup
|
|
||||||
],
|
],
|
||||||
div![
|
|
||||||
C!["gap-2", "flex", IF!(!show_bulk_edit => "hidden")],
|
|
||||||
&tristate_input,
|
|
||||||
&catchup,
|
|
||||||
div![
|
div![
|
||||||
button![
|
button![
|
||||||
tw_classes::button(),
|
tw_classes::button(),
|
||||||
@ -1212,11 +1208,9 @@ fn view_header(
|
|||||||
let query = Url::decode_uri_component(query).unwrap_or("".to_string());
|
let query = Url::decode_uri_component(query).unwrap_or("".to_string());
|
||||||
|
|
||||||
nav![
|
nav![
|
||||||
C!["flex", "flex-col"],
|
C!["flex", "px-4", "pt-4", "overflow-hidden"],
|
||||||
div![
|
a![
|
||||||
C!["flex-auto", "flex"],
|
C![IF![is_error => "bg-red-500"], "rounded-r-none"],
|
||||||
button![
|
|
||||||
C![IF![is_error => "bg-red-500"], "rounded-none"],
|
|
||||||
tw_classes::button(),
|
tw_classes::button(),
|
||||||
span![i![C![
|
span![i![C![
|
||||||
"fa-solid",
|
"fa-solid",
|
||||||
@ -1225,42 +1219,24 @@ fn view_header(
|
|||||||
]]],
|
]]],
|
||||||
ev(Ev::Click, |_| Msg::RefreshStart),
|
ev(Ev::Click, |_| Msg::RefreshStart),
|
||||||
],
|
],
|
||||||
button![
|
a![
|
||||||
tw_classes::button(),
|
tw_classes::button(),
|
||||||
C!["grow", "rounded-none"],
|
C!["px-4", "rounded-none"],
|
||||||
|
attrs! {
|
||||||
|
At::Href => urls::search(unread_query(), 0)
|
||||||
|
},
|
||||||
|
"Unread",
|
||||||
|
],
|
||||||
|
a![
|
||||||
|
tw_classes::button(),
|
||||||
|
C!["px-4", "rounded-none"],
|
||||||
|
attrs! {
|
||||||
|
At::Href => urls::search("", 0)
|
||||||
|
},
|
||||||
"All",
|
"All",
|
||||||
ev(Ev::Click, |_| Msg::SearchQuery(String::new())),
|
|
||||||
],
|
],
|
||||||
button![
|
|
||||||
tw_classes::button(),
|
|
||||||
C!["grow", "rounded-none"],
|
|
||||||
span![i![C!["far", "fa-envelope"]]],
|
|
||||||
" Unread",
|
|
||||||
ev(Ev::Click, |_| Msg::SearchQuery("is:unread".to_string())),
|
|
||||||
],
|
|
||||||
button![
|
|
||||||
tw_classes::button(),
|
|
||||||
C!["grow", "rounded-none"],
|
|
||||||
span![i![C!["far", "fa-envelope"]]],
|
|
||||||
" News",
|
|
||||||
ev(Ev::Click, |_| Msg::SearchQuery(
|
|
||||||
"is:unread is:news".to_string()
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
button![
|
|
||||||
tw_classes::button(),
|
|
||||||
C!["grow", "rounded-none"],
|
|
||||||
span![i![C!["far", "fa-envelope"]]],
|
|
||||||
" Mail",
|
|
||||||
ev(Ev::Click, |_| Msg::SearchQuery(
|
|
||||||
"is:unread is:mail".to_string()
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
],
|
|
||||||
div![
|
|
||||||
C!["flex-auto", "flex"],
|
|
||||||
input![
|
input![
|
||||||
C!["grow", "text-black", "m-2", "p-1"],
|
C!["grow", "pl-2", "text-black", "rounded-r"],
|
||||||
attrs! {
|
attrs! {
|
||||||
At::Placeholder => "Search";
|
At::Placeholder => "Search";
|
||||||
At::AutoFocus => auto_focus_search.as_at_value();
|
At::AutoFocus => auto_focus_search.as_at_value();
|
||||||
@ -1275,7 +1251,6 @@ fn view_header(
|
|||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn view_tags(tags: &Option<Vec<Tag>>) -> Node<Msg> {
|
pub fn view_tags(tags: &Option<Vec<Tag>>) -> Node<Msg> {
|
||||||
@ -1580,13 +1555,13 @@ fn render_news_post_header(post: &ShowThreadQueryThreadOnNewsPost) -> Node<Msg>
|
|||||||
} else {
|
} else {
|
||||||
"fa-envelope-open"
|
"fa-envelope-open"
|
||||||
},
|
},
|
||||||
]],
|
]]
|
||||||
|
],
|
||||||
ev(Ev::Click, move |e| {
|
ev(Ev::Click, move |e| {
|
||||||
e.stop_propagation();
|
e.stop_propagation();
|
||||||
Msg::SetUnread(id, !is_unread)
|
Msg::SetUnread(id, !is_unread)
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
]
|
|
||||||
}
|
}
|
||||||
fn reading_progress(ratio: f64) -> Node<Msg> {
|
fn reading_progress(ratio: f64) -> Node<Msg> {
|
||||||
let percent = ratio * 100.;
|
let percent = ratio * 100.;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user