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> {
510 <h2>(s(lang, "Files", "Dosyalar"))</h2>510 <h2>(s(lang, "Files", "Dosyalar"))</h2>
511 ref_selector(lang: lang, label: g::t(lang, K::BranchLabel), current: branch.clone(), branches: branches, tags: tags,511 ref_selector(lang: lang, label: g::t(lang, K::BranchLabel), current: branch.clone(), branches: branches, tags: tags,
512 branches_href: branches_href, tags_href: tags_href)512 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>
513 file_finder(lang: lang, owner: owner_name.clone(), repo: repo_name.clone(),514 file_finder(lang: lang, owner: owner_name.clone(), repo: repo_name.clone(),
514 ref_name: branch.clone())515 ref_name: branch.clone())
515 </div>516 </div>
crates/forge-web/src/pages/tree.rsmodified+2 -2
@@ -389,7 +389,6 @@ pub async fn readme_sheet(
389 readme: Option<Readme>,389 readme: Option<Readme>,
390 none: &str,390 none: &str,
391 ) -> Result<impl View> {391 ) -> Result<impl View> {
392- let search = repo_href(&owner, &repo, "search", "");
393 let readme_name = readme.as_ref().map(|readme| readme.name.clone());392 let readme_name = readme.as_ref().map(|readme| readme.name.clone());
394 let links = readme.as_ref().map(|readme| {393 let links = readme.as_ref().map(|readme| {
395 let path = if dir.is_empty() {394 let path = if dir.is_empty() {
@@ -415,7 +414,6 @@ pub async fn readme_sheet(
415 <a class="act" href=(history)>(s(lang, "History", "Geçmiş"))</a>414 <a class="act" href=(history)>(s(lang, "History", "Geçmiş"))</a>
416 <a class="act" href=(raw)>(s(lang, "Raw", "Ham"))</a>415 <a class="act" href=(raw)>(s(lang, "Raw", "Ham"))</a>
417 }416 }
418- <a class="act" href=(search)>(g::t(lang, K::SearchCodePlaceholder))</a>
419 </div>417 </div>
420 if let Some(readme) = readme {418 if let Some(readme) = readme {
421 readme_card(name: readme.name, markdown: readme.markdown, body: readme.body)419 readme_card(name: readme.name, markdown: readme.markdown, body: readme.body)
@@ -504,6 +502,7 @@ async fn tree_page(cx: &Cx) -> Result<impl View> {
504 let dock_owner = finder_owner.clone();502 let dock_owner = finder_owner.clone();
505 let dock_repo = finder_repo.clone();503 let dock_repo = finder_repo.clone();
506 let finder_ref = ref_name.clone();504 let finder_ref = ref_name.clone();
505+ let code_search_href = repo_href(&repo.owner_name, &repo.name, "search", "");
507 let readme_file = readme.as_ref().map(|readme| readme.name.clone());506 let readme_file = readme.as_ref().map(|readme| readme.name.clone());
508 let mut header = ctx.head(state, "code").await?;507 let mut header = ctx.head(state, "code").await?;
509 // The header and the browse bar share the branch's stream: the client follows the first508 // 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> {
520 <h2>(s(lang, "Files", "Dosyalar"))</h2>519 <h2>(s(lang, "Files", "Dosyalar"))</h2>
521 ref_selector(lang: lang, label: mi::t(lang, MK::RefLabel), current: ref_name.clone(), branches: branches, tags: tags,520 ref_selector(lang: lang, label: mi::t(lang, MK::RefLabel), current: ref_name.clone(), branches: branches, tags: tags,
522 branches_href: branches_href, tags_href: tags_href)521 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>
523 file_finder(lang: lang, owner: finder_owner, repo: finder_repo, ref_name: finder_ref)523 file_finder(lang: lang, owner: finder_owner, repo: finder_repo, ref_name: finder_ref)
524 </div>524 </div>
525 tree_table(rows: rows, lang: lang, current: readme_file)525 tree_table(rows: rows, lang: lang, current: readme_file)
style/_one.scssmodified+4 -0
@@ -1214,6 +1214,10 @@ main > .tabs {
1214 margin: 0 0 0 12px;1214 margin: 0 0 0 12px;
1215 }1215 }
1216 1216
1217+ > .code-search-act {
1218+ margin-left: auto;
1219+ }
1220+
1217 > .finder-open {1221 > .finder-open {
1218 flex: 1 0 100%;1222 flex: 1 0 100%;
1219 justify-content: space-between;1223 justify-content: space-between;