forge
Explore
Log in

Don't you dare go Hollow

Search code moves from the README's tools row to the Files head beside the branch, since it searches the whole repository, so the README row fits a phone on one line

Browse files at this commit

9e31559d587da9e2548b7a6c23d5f5eef1ea8193Ahmet Kaan GümüşParent: 27b4555
All checks have passed
Show checks
  • style
    • Search code moves from the README's tools row to the Files head beside the branch, since it searches the whole repository, so the README row fits a phone on one line
Show full message
💄 style: Search code moves from the README's tools row to the Files head beside the branch, since it searches the whole repository, so the README row fits a phone on one line
crates/forge-web/src/pages/repo.rsmodified+1 -0
@@ -510,6 +510,7 @@ async fn repo_page(cx: &Cx) -> Result<impl View> {
510510 <h2>(s(lang, "Files", "Dosyalar"))</h2>
511511 ref_selector(lang: lang, label: g::t(lang, K::BranchLabel), current: branch.clone(), branches: branches, tags: tags,
512512 branches_href: branches_href, tags_href: tags_href)
513+ <a class="act code-search-act" href=(format!("/{owner_name}/{repo_name}/search"))>(g::t(lang, K::SearchCodePlaceholder))</a>
513514 file_finder(lang: lang, owner: owner_name.clone(), repo: repo_name.clone(),
514515 ref_name: branch.clone())
515516 </div>
crates/forge-web/src/pages/tree.rsmodified+2 -2
@@ -389,7 +389,6 @@ pub async fn readme_sheet(
389389 readme: Option<Readme>,
390390 none: &str,
391391 ) -> Result<impl View> {
392- let search = repo_href(&owner, &repo, "search", "");
393392 let readme_name = readme.as_ref().map(|readme| readme.name.clone());
394393 let links = readme.as_ref().map(|readme| {
395394 let path = if dir.is_empty() {
@@ -415,7 +414,6 @@ pub async fn readme_sheet(
415414 <a class="act" href=(history)>(s(lang, "History", "Geçmiş"))</a>
416415 <a class="act" href=(raw)>(s(lang, "Raw", "Ham"))</a>
417416 }
418- <a class="act" href=(search)>(g::t(lang, K::SearchCodePlaceholder))</a>
419417 </div>
420418 if let Some(readme) = readme {
421419 readme_card(name: readme.name, markdown: readme.markdown, body: readme.body)
@@ -504,6 +502,7 @@ async fn tree_page(cx: &Cx) -> Result<impl View> {
504502 let dock_owner = finder_owner.clone();
505503 let dock_repo = finder_repo.clone();
506504 let finder_ref = ref_name.clone();
505+ let code_search_href = repo_href(&repo.owner_name, &repo.name, "search", "");
507506 let readme_file = readme.as_ref().map(|readme| readme.name.clone());
508507 let mut header = ctx.head(state, "code").await?;
509508 // The header and the browse bar share the branch's stream: the client follows the first
@@ -520,6 +519,7 @@ async fn tree_page(cx: &Cx) -> Result<impl View> {
520519 <h2>(s(lang, "Files", "Dosyalar"))</h2>
521520 ref_selector(lang: lang, label: mi::t(lang, MK::RefLabel), current: ref_name.clone(), branches: branches, tags: tags,
522521 branches_href: branches_href, tags_href: tags_href)
522+ <a class="act code-search-act" href=(code_search_href)>(g::t(lang, K::SearchCodePlaceholder))</a>
523523 file_finder(lang: lang, owner: finder_owner, repo: finder_repo, ref_name: finder_ref)
524524 </div>
525525 tree_table(rows: rows, lang: lang, current: readme_file)
style/_one.scssmodified+4 -0
@@ -1214,6 +1214,10 @@ main > .tabs {
12141214 margin: 0 0 0 12px;
12151215 }
12161216
1217+ > .code-search-act {
1218+ margin-left: auto;
1219+ }
1220+
12171221 > .finder-open {
12181222 flex: 1 0 100%;
12191223 justify-content: space-between;