The repo home no longer lists branches in its side column
Browse files at this commitbb771dc306444af4a86085dcf47f2cd89ed64f56Parent: 570e592- 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
3 changed files +3 -42
- crates/forge-web/src/i18n/code.rs +0 -4
- crates/forge-web/src/pages/repo.rs +3 -23
- style/_repo.scss +0 -15
crates/forge-web/src/i18n/code.rsmodified+0 -4
| @@ -24,7 +24,6 @@ pub enum K { | |||
| 24 | SshRequiresKey, | 24 | SshRequiresKey, |
| 25 | BranchesTitle, | 25 | BranchesTitle, |
| 26 | FilterRefs, | 26 | FilterRefs, |
| 27 | - ViewAll, | ||
| 28 | ViewAllBranches, | 27 | ViewAllBranches, |
| 29 | ViewAllTags, | 28 | ViewAllTags, |
| 30 | EmptyRepoPush, | 29 | EmptyRepoPush, |
| @@ -165,8 +164,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 165 | (BranchesTitle, Tr) => "Dallar", | 164 | (BranchesTitle, Tr) => "Dallar", |
| 166 | (FilterRefs, En) => "Filter branches and tags", | 165 | (FilterRefs, En) => "Filter branches and tags", |
| 167 | (FilterRefs, Tr) => "Dal ve etiketleri süz", | 166 | (FilterRefs, Tr) => "Dal ve etiketleri süz", |
| 168 | - (ViewAll, En) => "View all", | ||
| 169 | - (ViewAll, Tr) => "Tümünü gör", | ||
| 170 | (ViewAllBranches, En) => "View all branches", | 167 | (ViewAllBranches, En) => "View all branches", |
| 171 | (ViewAllBranches, Tr) => "Tüm dalları gör", | 168 | (ViewAllBranches, Tr) => "Tüm dalları gör", |
| 172 | (ViewAllTags, En) => "View all tags", | 169 | (ViewAllTags, En) => "View all tags", |
| @@ -557,7 +554,6 @@ mod tests { | |||
| 557 | K::SshRequiresKey, | 554 | K::SshRequiresKey, |
| 558 | K::BranchesTitle, | 555 | K::BranchesTitle, |
| 559 | K::FilterRefs, | 556 | K::FilterRefs, |
| 560 | - K::ViewAll, | ||
| 561 | K::ViewAllBranches, | 557 | K::ViewAllBranches, |
| 562 | K::ViewAllTags, | 558 | K::ViewAllTags, |
| 563 | K::EmptyRepoPush, | 559 | K::EmptyRepoPush, |
crates/forge-web/src/pages/repo.rsmodified+3 -23
| @@ -20,6 +20,7 @@ use topcoat::view::{View, component, view}; | |||
| 20 | 20 | ||
| 21 | use crate::i18n::code::{self as g, K}; | 21 | use crate::i18n::code::{self as g, K}; |
| 22 | use crate::i18n::{self, Lang}; | 22 | use crate::i18n::{self, Lang}; |
| 23 | +use crate::pages::passkeys::s; | ||
| 23 | use crate::pages::code_live::{follows_branch, home_live_url}; | 24 | use crate::pages::code_live::{follows_branch, home_live_url}; |
| 24 | use crate::pages::dashboard::badge_class; | 25 | use crate::pages::dashboard::badge_class; |
| 25 | use crate::pages::finder::file_finder; | 26 | use crate::pages::finder::file_finder; |
| @@ -38,9 +39,6 @@ use crate::views::{now_unix, ref_selector, rel_time, relative_time, repo_href, r | |||
| 38 | path_param!(owner); | 39 | path_param!(owner); |
| 39 | path_param!(repo); | 40 | path_param!(repo); |
| 40 | 41 | ||
| 41 | -/// Branches listed in the aside, most recently updated first. The switcher lists the rest. | ||
| 42 | -const RECENT_BRANCHES: usize = 5; | ||
| 43 | - | ||
| 44 | /// HTTPS clone URL: `{base_url}/{owner}/{repo}.git`. | 42 | /// HTTPS clone URL: `{base_url}/{owner}/{repo}.git`. |
| 45 | pub fn https_clone_url(config: &Config, owner: &str, name: &str) -> String { | 43 | pub fn https_clone_url(config: &Config, owner: &str, name: &str) -> String { |
| 46 | format!( | 44 | format!( |
| @@ -433,9 +431,6 @@ async fn repo_page(cx: &Cx) -> Result<impl View> { | |||
| 433 | 431 | ||
| 434 | let refs = load_refs(ctx.path.clone()).await?; | 432 | let refs = load_refs(ctx.path.clone()).await?; |
| 435 | let (branches, tags) = ref_links(&refs, &branch, &branch, repo); | 433 | 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); | ||
| 439 | let branch_names: Vec<String> = branches.iter().map(|link| link.name.clone()).collect(); | 434 | let branch_names: Vec<String> = branches.iter().map(|link| link.name.clone()).collect(); |
| 440 | let head = default_commit(ctx.path.clone(), branch.clone()).await?; | 435 | let head = default_commit(ctx.path.clone(), branch.clone()).await?; |
| 441 | 436 | ||
| @@ -507,7 +502,7 @@ async fn repo_page(cx: &Cx) -> Result<impl View> { | |||
| 507 | if let Some(rows) = tree { | 502 | if let Some(rows) = tree { |
| 508 | <div class="browse-bar" data-live-code=(follows.then_some("true")) data-live-gone=(g::t(lang, K::LivePathGone))> | 503 | <div class="browse-bar" data-live-code=(follows.then_some("true")) data-live-gone=(g::t(lang, K::LivePathGone))> |
| 509 | ref_selector(lang: lang, label: g::t(lang, K::BranchLabel), current: branch.clone(), branches: branches, tags: tags, | 504 | 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) |
| 511 | file_finder(lang: lang, owner: owner_name.clone(), repo: repo_name.clone(), | 506 | file_finder(lang: lang, owner: owner_name.clone(), repo: repo_name.clone(), |
| 512 | ref_name: branch.clone()) | 507 | ref_name: branch.clone()) |
| 513 | archive_links(owner: owner_name, repo: repo_name, | 508 | archive_links(owner: owner_name, repo: repo_name, |
| @@ -521,27 +516,12 @@ async fn repo_page(cx: &Cx) -> Result<impl View> { | |||
| 521 | readme_card(name: readme.name, markdown: readme.markdown, body: readme.body) | 516 | readme_card(name: readme.name, markdown: readme.markdown, body: readme.body) |
| 522 | } | 517 | } |
| 523 | </div> | 518 | </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"))> |
| 525 | repo_side(lang: lang, visibility: visibility, default_branch: branch.clone(), | 520 | repo_side(lang: lang, visibility: visibility, default_branch: branch.clone(), |
| 526 | facts: facts, runs: runs, ci_href: ci_href, release: latest) | 521 | facts: facts, runs: runs, ci_href: ci_href, release: latest) |
| 527 | if !packages.is_empty() { | 522 | if !packages.is_empty() { |
| 528 | repo_packages_card(links: packages, lang: lang) | 523 | repo_packages_card(links: packages, lang: lang) |
| 529 | } | 524 | } |
| 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> | ||
| 545 | </aside> | 525 | </aside> |
| 546 | </div> | 526 | </div> |
| 547 | } else { | 527 | } else { |
style/_repo.scssmodified+0 -15
| @@ -267,21 +267,6 @@ | |||
| 267 | font-weight: 600; | 267 | font-weight: 600; |
| 268 | color: var(--muted); | 268 | color: var(--muted); |
| 269 | } | 269 | } |
| 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 | - } | ||
| 285 | } | 270 | } |
| 286 | 271 | ||
| 287 | @media (min-width: 900px) { | 272 | @media (min-width: 900px) { |