forge
Explore
Log in

Don't you dare go Hollow

The sidebar lists recent repositories without a view-all link

Browse files at this commit

af25eab5da253a737bc62ee97936748fdea73b59Ahmet Kaan GümüşParent: f8bdb15
  • ux
    • the sidebar lists recent repositories without a view-all link
Show full message
🚸 ux: the sidebar lists recent repositories without a view-all link
crates/forge-web/src/i18n/orgs.rsmodified+4 -4
@@ -127,8 +127,8 @@ pub enum K {
127127 LogIn,
128128 SetUpForge,
129129 YourRepositories,
130+ RecentRepositories,
130131 NoReposYet,
131- ViewAllRepositories,
132132 }
133133
134134 pub fn t(lang: Lang, key: K) -> &'static str {
@@ -381,10 +381,10 @@ pub fn t(lang: Lang, key: K) -> &'static str {
381381 (SetUpForge, Tr) => "forge'u kur",
382382 (YourRepositories, En) => "Your repositories",
383383 (YourRepositories, Tr) => "Depolarınız",
384+ (RecentRepositories, En) => "Recent repositories",
385+ (RecentRepositories, Tr) => "Son depolar",
384386 (NoReposYet, En) => "You have no repositories yet.",
385387 (NoReposYet, Tr) => "Henüz deponuz yok.",
386- (ViewAllRepositories, En) => "View all repositories",
387- (ViewAllRepositories, Tr) => "Tüm depoları gör",
388388 }
389389 }
390390
@@ -613,8 +613,8 @@ mod tests {
613613 K::LogIn,
614614 K::SetUpForge,
615615 K::YourRepositories,
616+ K::RecentRepositories,
616617 K::NoReposYet,
617- K::ViewAllRepositories,
618618 ];
619619
620620 #[test]
crates/forge-web/src/views/mod.rsmodified+4 -12
@@ -135,7 +135,7 @@ pub async fn shell(
135135 let full_title = format!("{title} \u{b7} forge");
136136 // The bell count and the viewer's freshest repos for the sidebar, with the total: two queries,
137137 // signed-in only.
138- let (unread, (listed, repo_total)) = match viewer {
138+ let (unread, (listed, _)) = match viewer {
139139 Some((user, _)) => match try_app_context::<AppState>(__cx) {
140140 Some(state) => (
141141 state.store.unread_count(&user.id).await?,
@@ -193,8 +193,6 @@ pub async fn shell(
193193 let theme_csrf = viewer.map(|(_, session)| session.csrf_token.clone());
194194 let back = uri(__cx).path_and_query().map(|p| p.as_str().to_owned());
195195 let lang = i18n::lang(__cx, viewer.map(|(user, _)| user));
196- let side_more = (repo_total > SIDE_REPOS)
197- .then(|| format!("{} ({repo_total})", o::t(lang, OK::ViewAllRepositories)));
198196 let banner = crate::pages::banner::current(__cx);
199197 let banner_back = back.clone().unwrap_or_else(|| "/".to_owned());
200198 let dismiss_label = crate::i18n::accounts::t(lang, crate::i18n::accounts::A::Dismiss);
@@ -287,8 +285,6 @@ pub async fn shell(
287285 let notif_label = t(lang, Key::Notifications);
288286 let menu_label = t(lang, Key::SiteMenu);
289287 let side_repos_menu = side_repos.clone();
290- let side_more_menu = side_more.clone();
291- let side_more_aside = side_more;
292288 let unread_menu = unread_badge.clone();
293289 let unread_aside = unread_badge.clone();
294290 Ok(view! {
@@ -325,7 +321,7 @@ pub async fn shell(
325321 if let Some(section) = section_menu {
326322 section_nav(title: section.title.as_str(), back: section.back, items: section.items, current: section.current, live: section.live)
327323 } else {
328- side_nav(lang: lang, current: current, profile_repos_href: profile_repos_href.as_str(), unread: unread_menu, more: side_more_menu, repos: side_repos_menu)
324+ side_nav(lang: lang, current: current, profile_repos_href: profile_repos_href.as_str(), unread: unread_menu, repos: side_repos_menu)
329325 }
330326 </div>
331327 </details>
@@ -412,7 +408,7 @@ pub async fn shell(
412408 if let Some(section) = section {
413409 section_nav(title: section.title.as_str(), back: section.back, items: section.items, current: section.current, live: section.live)
414410 } else {
415- side_nav(lang: lang, current: current, profile_repos_href: profile_repos_href.as_str(), unread: unread_aside, more: side_more_aside, repos: side_repos)
411+ side_nav(lang: lang, current: current, profile_repos_href: profile_repos_href.as_str(), unread: unread_aside, repos: side_repos)
416412 }
417413 </aside>
418414 }
@@ -450,7 +446,6 @@ async fn side_nav(
450446 current: &str,
451447 profile_repos_href: &str,
452448 unread: Option<String>,
453- more: Option<String>,
454449 repos: Vec<SideRepo>,
455450 ) -> Result<impl View> {
456451 let dashboard = current == "dashboard";
@@ -496,7 +491,7 @@ async fn side_nav(
496491 </a>
497492 </nav>
498493 <div class="side-group" data-live="/-/side/events">
499- <h2 class="side-h">(o::t(lang, OK::YourRepositories))</h2>
494+ <h2 class="side-h">(o::t(lang, OK::RecentRepositories))</h2>
500495 if empty {
501496 <p class="side-empty">(o::t(lang, OK::NoReposYet))</p>
502497 } else {
@@ -504,9 +499,6 @@ async fn side_nav(
504499 for repo in repos.into_iter() {
505500 <a href=(repo.href.as_str())>(repo.name.as_str())</a>
506501 }
507- if let Some(label) = more {
508- <a href=(profile_repos_href)>(label.as_str())</a>
509- }
510502 </nav>
511503 }
512504 </div>