Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/gunnar-ui

crates/gunnar-ui-web/src/pages/activity.rs

//! **Events by context** (owner's final navigation, 2026-10-02): a
//! repository's on its Activity tab, the reader's own account's under You →
//! Activity, and the whole server's only under Administration → Overview.
//!
//! What a feed CARRIES is decided on the server (`sse::Filter`): below admin,
//! only repositories in the reader's own account, never another account's —
//! not even a public repository's — and `?repo=` narrows a feed to one
//! repository without ever widening it. These pages only draw what arrives.

use leptos::prelude::*;
use leptos_router::hooks::use_params_map;

use crate::ui::PageHeader;

/// You → Activity: the events of the reader's own account.
#[component]
pub fn AccountActivity() -> impl IntoView {
    let feed = crate::feed::use_feed();
    view! {
        <PageHeader title="Activity"/>
        <crate::pages::events::Stream feed=feed/>
    }
}

/// A repository's Activity tab: that repository's events, and only if the
/// server may tell the reader about them.
#[component]
pub fn RepoActivity() -> impl IntoView {
    let params = use_params_map();
    let (ns, name) = params.with_untracked(|p| (p.get("namespace").unwrap_or_default(), p.get("name").unwrap_or_default()));
    let feed = crate::feed::use_repo_feed(&ns, &name);
    let title = format!("{ns}/{name}");
    view! {
        <PageHeader title=title/>
        <crate::pages::repo::RepoTabs/>
        <crate::pages::events::Stream feed=feed/>
    }
}