Repo tabs stay in place between pages: the repo head always keeps its sub line, so a page with no counts under its title no longer pulls the tabs up a line
Browse files at this commit5b521343020d6d25525c65759731730ca2f25159Parent: 1e4a66b- fix
- repo tabs stay in place between pages: the repo head always keeps its sub line, so a page with no counts under its title no longer pulls the tabs up a line
3 changed files +7 -2
- crates/forge-web/src/pages/repo.rs +1 -1
- crates/forge-web/src/views/parts.rs +2 -1
- style/_one.scss +4 -0
crates/forge-web/src/pages/repo.rsmodified+1 -1
| @@ -214,7 +214,7 @@ pub async fn repo_head( | |||
| 214 | } | 214 | } |
| 215 | (child) | 215 | (child) |
| 216 | </div> | 216 | </div> |
| 217 | - head_sub(parts: parts, pips: pips) | 217 | + head_sub(parts: parts, pips: pips, keep: true) |
| 218 | repo_tabs(owner: owner.clone(), repo: name.clone(), default_branch: default_branch.clone(), active: active.clone(), can_admin: can_admin, lang: lang, open_issues: Some(open_issues), open_pulls: Some(open_pulls), discussions: discussions, wiki: wiki, security: security) | 218 | repo_tabs(owner: owner.clone(), repo: name.clone(), default_branch: default_branch.clone(), active: active.clone(), can_admin: can_admin, lang: lang, open_issues: Some(open_issues), open_pulls: Some(open_pulls), discussions: discussions, wiki: wiki, security: security) |
| 219 | </section> | 219 | </section> |
| 220 | if archived { | 220 | if archived { |
crates/forge-web/src/views/parts.rsmodified+2 -1
| @@ -296,9 +296,10 @@ pub async fn head_sub( | |||
| 296 | cx: &Cx, | 296 | cx: &Cx, |
| 297 | parts: Vec<SubPart>, | 297 | parts: Vec<SubPart>, |
| 298 | #[default] pips: Vec<(String, String, &'static str)>, | 298 | #[default] pips: Vec<(String, String, &'static str)>, |
| 299 | + #[default] keep: bool, | ||
| 299 | ) -> Result<impl View> { | 300 | ) -> Result<impl View> { |
| 300 | let last = pips.len().saturating_sub(1); | 301 | let last = pips.len().saturating_sub(1); |
| 301 | - let show = !parts.is_empty() || !pips.is_empty(); | 302 | + let show = keep || !parts.is_empty() || !pips.is_empty(); |
| 302 | let has_pips = !pips.is_empty(); | 303 | let has_pips = !pips.is_empty(); |
| 303 | Ok(view! { | 304 | Ok(view! { |
| 304 | if show { | 305 | if show { |
style/_one.scssmodified+4 -0
| @@ -3139,6 +3139,10 @@ details:not([open])::details-content { | |||
| 3139 | min-height: 38px; | 3139 | min-height: 38px; |
| 3140 | } | 3140 | } |
| 3141 | 3141 | ||
| 3142 | +.repo-head .head-sub { | ||
| 3143 | + min-height: 1lh; | ||
| 3144 | +} | ||
| 3145 | + | ||
| 3142 | main:has(> nav.tabs) > .head:has(.head-sub), | 3146 | main:has(> nav.tabs) > .head:has(.head-sub), |
| 3143 | main:has(> nav.tabs[data-section="admin"]) > .head { | 3147 | main:has(> nav.tabs[data-section="admin"]) > .head { |
| 3144 | min-height: 64px; | 3148 | min-height: 64px; |