diff --git a/web/src/actors/activity.rs b/web/src/actors/activity.rs deleted file mode 100644 index 39bee152..00000000 --- a/web/src/actors/activity.rs +++ /dev/null @@ -1,25 +0,0 @@ -use leptos::*; -use leptos_router::*; -use crate::prelude::*; - -#[component] -pub fn ActorActivity() -> impl IntoView { - let feeds = use_context::().expect("missing feeds context"); - let params = use_params::(); - let id = Signal::derive(move || { - let id = params.get_untracked().ok().and_then(|x| x.id).unwrap_or_default(); - let tl_url = format!("{}/outbox/page", Uri::api(U::Actor, &id, false)); - if !feeds.user.next.get_untracked().starts_with(&tl_url) { - feeds.user.reset(Some(tl_url)); - } - id - }); - view! { - - "🖂"" posts" - " | " - activity" ""@" - - - } -} diff --git a/web/src/actors/mod.rs b/web/src/actors/mod.rs index bac53b3b..9b947c05 100644 --- a/web/src/actors/mod.rs +++ b/web/src/actors/mod.rs @@ -1,7 +1,6 @@ pub mod follow; pub mod posts; pub mod header; -pub mod activity; use leptos_router::Params; // TODO can i remove this? #[derive(Clone, leptos::Params, PartialEq)] diff --git a/web/src/actors/posts.rs b/web/src/actors/posts.rs index f84bb644..e35941e2 100644 --- a/web/src/actors/posts.rs +++ b/web/src/actors/posts.rs @@ -6,19 +6,17 @@ use crate::prelude::*; pub fn ActorPosts() -> impl IntoView { let feeds = use_context::().expect("missing feeds context"); let params = use_params::(); - let id = Signal::derive(move || { + Signal::derive(move || { let id = params.get_untracked().ok().and_then(|x| x.id).unwrap_or_default(); - let tl_url = format!("{}/streams/page", Uri::api(U::Actor, &id, false)); + let tl_url = format!("{}/outbox/page", Uri::api(U::Actor, &id, false)); if !feeds.user.next.get_untracked().starts_with(&tl_url) { feeds.user.reset(Some(tl_url)); } id - }); + }).track(); view! { "🖂"" "posts - " | " - "activity ""@" } diff --git a/web/src/app.rs b/web/src/app.rs index 58d7363f..77b0d37b 100644 --- a/web/src/app.rs +++ b/web/src/app.rs @@ -7,12 +7,9 @@ use leptos_use::{signal_debounced, storage::use_local_storage, use_cookie, use_e #[derive(Clone, Copy)] pub struct Feeds { - // object feeds pub home: Timeline, pub global: Timeline, - // notification feeds - pub private: Timeline, - pub public: Timeline, + pub notifications: Timeline, // exploration feeds pub user: Timeline, pub server: Timeline, @@ -22,10 +19,9 @@ pub struct Feeds { impl Feeds { pub fn new(username: &str) -> Self { Feeds { - home: Timeline::new(format!("{URL_BASE}/actors/{username}/feed/page")), - global: Timeline::new(format!("{URL_BASE}/feed/page")), - private: Timeline::new(format!("{URL_BASE}/actors/{username}/inbox/page")), - public: Timeline::new(format!("{URL_BASE}/inbox/page")), + home: Timeline::new(format!("{URL_BASE}/actors/{username}/inbox/page")), + notifications: Timeline::new(format!("{URL_BASE}/actors/{username}/notifications/page")), + global: Timeline::new(format!("{URL_BASE}/inbox/page")), user: Timeline::new(format!("{URL_BASE}/actors/{username}/outbox/page")), server: Timeline::new(format!("{URL_BASE}/outbox/page")), context: Timeline::new(format!("{URL_BASE}/outbox/page")), // TODO ehhh @@ -34,9 +30,8 @@ impl Feeds { pub fn reset(&self) { self.home.reset(None); + self.notifications.reset(None); self.global.reset(None); - self.private.reset(None); - self.public.reset(None); self.user.reset(None); self.server.reset(None); self.context.reset(None); @@ -122,9 +117,9 @@ pub fn App() -> impl IntoView { } /> } /> - } /> + } /> } /> - } /> + } /> } /> @@ -134,7 +129,6 @@ pub fn App() -> impl IntoView { } /> } /> - @@ -165,12 +159,12 @@ fn Scrollable() -> impl IntoView { let path = location.pathname.get(); if path.contains("/web/home") { Some(feeds.home) - } else if path.contains("/web/server") { + } else if path.contains("/web/global") { Some(feeds.global) - } else if path.starts_with("/web/local") { + } else if path.contains("/web/local") { Some(feeds.server) - } else if path.starts_with("/web/inbox") { - Some(feeds.private) + } else if path.starts_with("/web/notifications") { + Some(feeds.notifications) } else if path.starts_with("/web/actors") { Some(feeds.user) } else if path.starts_with("/web/objects") { diff --git a/web/src/components/activity.rs b/web/src/components/activity.rs index 47d43162..9cb3cbb6 100644 --- a/web/src/components/activity.rs +++ b/web/src/components/activity.rs @@ -19,20 +19,22 @@ pub fn ActivityLine(activity: crate::Object) -> impl IntoView { _ => Uri::web(U::Object, &object_id), }; view! { -
- - - - - - - {kind.as_ref().to_string()} - - {activity_url} - - - -
+ + + + + +
+ + + + + {kind.as_ref().to_string()} + + {activity_url} + + +
} } diff --git a/web/src/components/login.rs b/web/src/components/login.rs index 48353c6c..d3e271b4 100644 --- a/web/src/components/login.rs +++ b/web/src/components/login.rs @@ -18,7 +18,7 @@ pub fn LoginBox( token_tx.set(None); feeds.reset(); feeds.global.spawn_more(auth); - feeds.public.spawn_more(auth); + feeds.server.spawn_more(auth); } />
@@ -44,14 +44,14 @@ pub fn LoginBox( userid_tx.set(Some(auth_response.user)); token_tx.set(Some(auth_response.token)); // reset home feed and point it to our user's inbox - feeds.home.reset(Some(format!("{URL_BASE}/actors/{username}/feed/page"))); + feeds.home.reset(Some(format!("{URL_BASE}/actors/{username}/inbox/page"))); feeds.home.spawn_more(auth); - feeds.private.reset(Some(format!("{URL_BASE}/actors/{username}/inbox/page"))); - feeds.private.spawn_more(auth); + feeds.notifications.reset(Some(format!("{URL_BASE}/actors/{username}/notifications/page"))); + feeds.notifications.spawn_more(auth); // reset server feed: there may be more content now that we're authed - feeds.global.reset(Some(format!("{URL_BASE}/feed/page"))); + feeds.global.reset(Some(format!("{URL_BASE}/inbox/page"))); feeds.global.spawn_more(auth); - feeds.server.reset(Some(format!("{URL_BASE}/inbox/page"))); + feeds.server.reset(Some(format!("{URL_BASE}/outbox/page"))); feeds.server.spawn_more(auth); }); } > diff --git a/web/src/components/navigation.rs b/web/src/components/navigation.rs index 10f6d8c2..b2832f59 100644 --- a/web/src/components/navigation.rs +++ b/web/src/components/navigation.rs @@ -38,9 +38,9 @@ pub fn Navigator() -> impl IntoView { - + - + diff --git a/web/src/prelude.rs b/web/src/prelude.rs index 520ce957..71288ba3 100644 --- a/web/src/prelude.rs +++ b/web/src/prelude.rs @@ -9,7 +9,6 @@ pub use crate::{ header::ActorHeader, follow::FollowList, posts::ActorPosts, - activity::ActorActivity, }, timeline::{ Timeline,