forge
Explore
Log in

Don't you dare go Hollow

The repo home no longer lists branches in its side column

Browse files at this commit

bb771dc306444af4a86085dcf47f2cd89ed64f56Ahmet Kaan GümüşParent: 570e592
All checks have passed
Show checks
  • style
    • the repo home no longer lists branches in its side column
    • the branch switcher above the files lists them all, with the link to the branches page
Show full message
💄 style: the repo home no longer lists branches in its side column; the branch switcher above the files lists them all, with the link to the branches page
crates/forge-web/src/i18n/code.rsmodified+0 -4
@@ -24,7 +24,6 @@ pub enum K {
2424 SshRequiresKey,
2525 BranchesTitle,
2626 FilterRefs,
27- ViewAll,
2827 ViewAllBranches,
2928 ViewAllTags,
3029 EmptyRepoPush,
@@ -165,8 +164,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
165164 (BranchesTitle, Tr) => "Dallar",
166165 (FilterRefs, En) => "Filter branches and tags",
167166 (FilterRefs, Tr) => "Dal ve etiketleri süz",
168- (ViewAll, En) => "View all",
169- (ViewAll, Tr) => "Tümünü gör",
170167 (ViewAllBranches, En) => "View all branches",
171168 (ViewAllBranches, Tr) => "Tüm dalları gör",
172169 (ViewAllTags, En) => "View all tags",
@@ -557,7 +554,6 @@ mod tests {
557554 K::SshRequiresKey,
558555 K::BranchesTitle,
559556 K::FilterRefs,
560- K::ViewAll,
561557 K::ViewAllBranches,
562558 K::ViewAllTags,
563559 K::EmptyRepoPush,
crates/forge-web/src/pages/repo.rsmodified+3 -23
@@ -20,6 +20,7 @@ use topcoat::view::{View, component, view};
2020
2121 use crate::i18n::code::{self as g, K};
2222 use crate::i18n::{self, Lang};
23+use crate::pages::passkeys::s;
2324 use crate::pages::code_live::{follows_branch, home_live_url};
2425 use crate::pages::dashboard::badge_class;
2526 use crate::pages::finder::file_finder;
@@ -38,9 +39,6 @@ use crate::views::{now_unix, ref_selector, rel_time, relative_time, repo_href, r
3839 path_param!(owner);
3940 path_param!(repo);
4041
41-/// Branches listed in the aside, most recently updated first. The switcher lists the rest.
42-const RECENT_BRANCHES: usize = 5;
43-
4442 /// HTTPS clone URL: `{base_url}/{owner}/{repo}.git`.
4543 pub fn https_clone_url(config: &Config, owner: &str, name: &str) -> String {
4644 format!(
@@ -433,9 +431,6 @@ async fn repo_page(cx: &Cx) -> Result<impl View> {
433431
434432 let refs = load_refs(ctx.path.clone()).await?;
435433 let (branches, tags) = ref_links(&refs, &branch, &branch, repo);
436- let mut recent = branches.clone();
437- recent.sort_by_key(|link| std::cmp::Reverse(link.updated));
438- recent.truncate(RECENT_BRANCHES);
439434 let branch_names: Vec<String> = branches.iter().map(|link| link.name.clone()).collect();
440435 let head = default_commit(ctx.path.clone(), branch.clone()).await?;
441436
@@ -507,7 +502,7 @@ async fn repo_page(cx: &Cx) -> Result<impl View> {
507502 if let Some(rows) = tree {
508503 <div class="browse-bar" data-live-code=(follows.then_some("true")) data-live-gone=(g::t(lang, K::LivePathGone))>
509504 ref_selector(lang: lang, label: g::t(lang, K::BranchLabel), current: branch.clone(), branches: branches, tags: tags,
510- branches_href: branches_href.clone(), tags_href: tags_href)
505+ branches_href: branches_href, tags_href: tags_href)
511506 file_finder(lang: lang, owner: owner_name.clone(), repo: repo_name.clone(),
512507 ref_name: branch.clone())
513508 archive_links(owner: owner_name, repo: repo_name,
@@ -521,27 +516,12 @@ async fn repo_page(cx: &Cx) -> Result<impl View> {
521516 readme_card(name: readme.name, markdown: readme.markdown, body: readme.body)
522517 }
523518 </div>
524- <aside class="repo-meta" aria-label=(g::t(lang, K::BranchesTitle))>
519+ <aside class="repo-meta" aria-label=(s(lang, "About", "Hakkında"))>
525520 repo_side(lang: lang, visibility: visibility, default_branch: branch.clone(),
526521 facts: facts, runs: runs, ci_href: ci_href, release: latest)
527522 if !packages.is_empty() {
528523 repo_packages_card(links: packages, lang: lang)
529524 }
530- <section>
531- <h2>(g::t(lang, K::BranchesTitle))</h2>
532- <ul class="branch-list">
533- for link in recent.into_iter() {
534- <li>
535- if link.current {
536- <a class="current" aria-current="true" href=(link.href)>(link.name)</a>
537- } else {
538- <a href=(link.href)>(link.name)</a>
539- }
540- </li>
541- }
542- </ul>
543- <p class="small"><a href=(branches_href)>(g::t(lang, K::ViewAll))</a></p>
544- </section>
545525 </aside>
546526 </div>
547527 } else {
style/_repo.scssmodified+0 -15
@@ -267,21 +267,6 @@
267267 font-weight: 600;
268268 color: var(--muted);
269269 }
270-
271- .branch-list {
272- margin: 0;
273- padding: 0;
274- list-style: none;
275- display: grid;
276- gap: 6px;
277- font-size: 14px;
278-
279- code {
280- font-family: var(--mono);
281- font-size: 13.5px;
282- word-break: break-all;
283- }
284- }
285270 }
286271
287272 @media (min-width: 900px) {