The profile corner shows the display name (the username when unset), drops the ring around the avatar (an accent ring shows only while a run goes) and moves notifications to a bell at its right end instead of the menu's waiting list
Browse files at this commitf8f6e8da94ae0b2da0badc112af4d59db274dd2cParent: 2525121- style
- the profile corner shows the display name (the username when unset), drops the ring around the avatar (an accent ring shows only while a run goes) and moves notifications to a bell at its right end instead of the menu's waiting list
- its review, mention and failing chips link to the newest thing they count (the newest failed run comes with the activity JSON as failing_href)
- the heat colours of running CI are shades of the chosen accent instead of fixed orange
- the footer sits under the page in its column, so a short page no longer scrolls by the footer's height
6 changed files +149 -170
- crates/forge-core/src/store/shell_activity.rs +20 -8
- crates/forge-web/src/i18n/misc.rs +0 -4
- crates/forge-web/src/pages/activity.rs +4 -0
- crates/forge-web/src/views/mod.rs +51 -50
- style/_shell.scss +54 -89
- style/main.scss +20 -19
crates/forge-core/src/store/shell_activity.rsmodified+20 -8
| @@ -56,6 +56,8 @@ pub struct ActorRuns { | |||
| 56 | pub finished: Vec<ActorRun>, | 56 | pub finished: Vec<ActorRun>, |
| 57 | /// Refs whose newest run by this user failed within the last 7 days. | 57 | /// Refs whose newest run by this user failed within the last 7 days. |
| 58 | pub failing: u64, | 58 | pub failing: u64, |
| 59 | + /// The newest of those failed runs as (owner, repo, run number), for a link straight to it. | ||
| 60 | + pub newest_failing: Option<(String, String, i64)>, | ||
| 59 | } | 61 | } |
| 60 | 62 | ||
| 61 | /// One CI run of the user, with its job progress. | 63 | /// One CI run of the user, with its job progress. |
| @@ -221,33 +223,43 @@ impl Store { | |||
| 221 | ) | 223 | ) |
| 222 | .await?; | 224 | .await?; |
| 223 | 225 | ||
| 224 | - // Newest run per (repo, ref) among this actor's runs, then count the ones that failed. | 226 | + // Newest run per (repo, ref) among this actor's runs; the ones that failed are counted, and the |
| 227 | + // newest of them is kept for its link. | ||
| 225 | let mut params = vec![Value::Text(actor_id.to_string())]; | 228 | let mut params = vec![Value::Text(actor_id.to_string())]; |
| 226 | params.extend(readable_params(actor_id)); | 229 | params.extend(readable_params(actor_id)); |
| 227 | params.push(Value::Text(stamp_ago(FAILING_WINDOW))); | 230 | params.push(Value::Text(stamp_ago(FAILING_WINDOW))); |
| 228 | let failing = fetch_all( | 231 | let failing = fetch_all( |
| 229 | &conn, | 232 | &conn, |
| 230 | &format!( | 233 | &format!( |
| 231 | - "SELECT COUNT(*) FROM ( \ | 234 | + "SELECT COUNT(*) OVER (), owner, name, number FROM ( \ |
| 232 | - SELECT ci_runs.state, ci_runs.created_at, ROW_NUMBER() OVER ( \ | 235 | + SELECT ci_runs.state, ci_runs.created_at, ci_runs.number, o.username AS owner, \ |
| 236 | + r.name AS name, ROW_NUMBER() OVER ( \ | ||
| 233 | PARTITION BY ci_runs.repo_id, ci_runs.git_ref ORDER BY ci_runs.number DESC) AS rn \ | 237 | PARTITION BY ci_runs.repo_id, ci_runs.git_ref ORDER BY ci_runs.number DESC) AS rn \ |
| 234 | FROM ci_runs JOIN repos r ON r.id = ci_runs.repo_id \ | 238 | FROM ci_runs JOIN repos r ON r.id = ci_runs.repo_id \ |
| 239 | + JOIN users o ON o.id = r.owner_id \ | ||
| 235 | WHERE ci_runs.actor_id = ? AND {readable} \ | 240 | WHERE ci_runs.actor_id = ? AND {readable} \ |
| 236 | - ) WHERE rn = 1 AND state IN ('failure', 'error') AND created_at >= ?" | 241 | + ) WHERE rn = 1 AND state IN ('failure', 'error') AND created_at >= ? \ |
| 242 | + ORDER BY created_at DESC LIMIT 1" | ||
| 237 | ), | 243 | ), |
| 238 | params, | 244 | params, |
| 239 | - |row| col_int(row, 0), | 245 | + |row| { |
| 246 | + Ok(( | ||
| 247 | + col_int(row, 0)?, | ||
| 248 | + (col_text(row, 1)?, col_text(row, 2)?, col_int(row, 3)?), | ||
| 249 | + )) | ||
| 250 | + }, | ||
| 240 | ) | 251 | ) |
| 241 | .await?; | 252 | .await?; |
| 242 | - let failing = match failing.first() { | 253 | + let (failing, newest_failing) = match failing.into_iter().next() { |
| 243 | - Some(n) => count_from(*n)?, | 254 | + Some((n, run)) => (count_from(n)?, Some(run)), |
| 244 | - None => 0, | 255 | + None => (0, None), |
| 245 | }; | 256 | }; |
| 246 | 257 | ||
| 247 | Ok(ActorRuns { | 258 | Ok(ActorRuns { |
| 248 | running, | 259 | running, |
| 249 | finished, | 260 | finished, |
| 250 | failing, | 261 | failing, |
| 262 | + newest_failing, | ||
| 251 | }) | 263 | }) |
| 252 | } | 264 | } |
| 253 | } | 265 | } |
crates/forge-web/src/i18n/misc.rsmodified+0 -4
| @@ -172,7 +172,6 @@ pub enum K { | |||
| 172 | YourProfile, | 172 | YourProfile, |
| 173 | EditProfile, | 173 | EditProfile, |
| 174 | // Profile corner, live strip and path bar search. | 174 | // Profile corner, live strip and path bar search. |
| 175 | - WaitingOnYou, | ||
| 176 | AllNotifications, | 175 | AllNotifications, |
| 177 | Passed, | 176 | Passed, |
| 178 | Failed, | 177 | Failed, |
| @@ -328,7 +327,6 @@ const ALL: &[K] = &[ | |||
| 328 | K::RefLabel, | 327 | K::RefLabel, |
| 329 | K::YourProfile, | 328 | K::YourProfile, |
| 330 | K::EditProfile, | 329 | K::EditProfile, |
| 331 | - K::WaitingOnYou, | ||
| 332 | K::AllNotifications, | 330 | K::AllNotifications, |
| 333 | K::Passed, | 331 | K::Passed, |
| 334 | K::Failed, | 332 | K::Failed, |
| @@ -655,8 +653,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 655 | (YourProfile, Tr) => "Profilin", | 653 | (YourProfile, Tr) => "Profilin", |
| 656 | (EditProfile, En) => "Edit profile", | 654 | (EditProfile, En) => "Edit profile", |
| 657 | (EditProfile, Tr) => "Profili düzenle", | 655 | (EditProfile, Tr) => "Profili düzenle", |
| 658 | - (WaitingOnYou, En) => "Waiting on you", | ||
| 659 | - (WaitingOnYou, Tr) => "Seni bekleyenler", | ||
| 660 | (AllNotifications, En) => "All notifications", | 656 | (AllNotifications, En) => "All notifications", |
| 661 | (AllNotifications, Tr) => "Tüm bildirimler", | 657 | (AllNotifications, Tr) => "Tüm bildirimler", |
| 662 | (Passed, En) => "passed", | 658 | (Passed, En) => "passed", |
crates/forge-web/src/pages/activity.rsmodified+4 -0
| @@ -90,6 +90,10 @@ pub(crate) async fn activity_json(state: &AppState, user: &User) -> Result<Value | |||
| 90 | "reviews": kinds.reviews, | 90 | "reviews": kinds.reviews, |
| 91 | "mentions": kinds.mentions, | 91 | "mentions": kinds.mentions, |
| 92 | "failing": runs.failing, | 92 | "failing": runs.failing, |
| 93 | + "failing_href": runs | ||
| 94 | + .newest_failing | ||
| 95 | + .as_ref() | ||
| 96 | + .map(|(owner, repo, number)| run_href(&format!("{owner}/{repo}"), *number)), | ||
| 93 | "running": running, | 97 | "running": running, |
| 94 | "finished": finished, | 98 | "finished": finished, |
| 95 | "waiting": waiting, | 99 | "waiting": waiting, |
crates/forge-web/src/views/mod.rsmodified+51 -50
| @@ -297,25 +297,17 @@ fn no_runs() -> ActorRuns { | |||
| 297 | running: Vec::new(), | 297 | running: Vec::new(), |
| 298 | finished: Vec::new(), | 298 | finished: Vec::new(), |
| 299 | failing: 0, | 299 | failing: 0, |
| 300 | + newest_failing: None, | ||
| 300 | } | 301 | } |
| 301 | } | 302 | } |
| 302 | 303 | ||
| 303 | -/// One item of the profile corner's waiting list. | 304 | +/// What the profile corner shows: the viewer, their inbox counts with where each leads, and whether |
| 304 | -#[derive(Clone)] | 305 | +/// any of their runs is going (the ring glows). |
| 305 | -struct WaitingRow { | ||
| 306 | - href: String, | ||
| 307 | - title: String, | ||
| 308 | - /// `owner/repo#number`. | ||
| 309 | - repo: String, | ||
| 310 | - /// `corner-dot review` or `corner-dot mention`. | ||
| 311 | - dot_class: &'static str, | ||
| 312 | -} | ||
| 313 | - | ||
| 314 | -/// What the profile corner shows: the viewer, their inbox counts, whether any of their runs is | ||
| 315 | -/// going (the ring glows) and the items waiting on them. | ||
| 316 | #[derive(Clone)] | 306 | #[derive(Clone)] |
| 317 | struct ProfileCorner { | 307 | struct ProfileCorner { |
| 318 | username: String, | 308 | username: String, |
| 309 | + /// The display name when set, else the username. | ||
| 310 | + name: String, | ||
| 319 | avatar: String, | 311 | avatar: String, |
| 320 | csrf: String, | 312 | csrf: String, |
| 321 | back: String, | 313 | back: String, |
| @@ -325,7 +317,10 @@ struct ProfileCorner { | |||
| 325 | mentions: u64, | 317 | mentions: u64, |
| 326 | failing: u64, | 318 | failing: u64, |
| 327 | hot: bool, | 319 | hot: bool, |
| 328 | - waiting: Vec<WaitingRow>, | 320 | + /// The newest waiting review request, mention and failed run, each chip's link. |
| 321 | + review_href: String, | ||
| 322 | + mention_href: String, | ||
| 323 | + failing_href: String, | ||
| 329 | } | 324 | } |
| 330 | 325 | ||
| 331 | /// The account corner at the foot of the signed-in sidebar and in the phone menu. It opens upward: | 326 | /// The account corner at the foot of the signed-in sidebar and in the phone menu. It opens upward: |
| @@ -341,8 +336,7 @@ async fn profile_corner(lang: Lang, corner: ProfileCorner) -> Result<impl View> | |||
| 341 | .then(|| (corner.mentions.to_string(), mi::mentions_count(lang, corner.mentions))); | 336 | .then(|| (corner.mentions.to_string(), mi::mentions_count(lang, corner.mentions))); |
| 342 | let failing_chip = (corner.failing > 0) | 337 | let failing_chip = (corner.failing > 0) |
| 343 | .then(|| (corner.failing.to_string(), mi::failing_runs_count(lang, corner.failing))); | 338 | .then(|| (corner.failing.to_string(), mi::failing_runs_count(lang, corner.failing))); |
| 344 | - let waiting_label = mi::t(lang, MK::WaitingOnYou); | 339 | + let bell_label = mi::t(lang, MK::AllNotifications); |
| 345 | - let all_label = mi::t(lang, MK::AllNotifications); | ||
| 346 | let theme_label = mi::t(lang, MK::ThemeLabel); | 340 | let theme_label = mi::t(lang, MK::ThemeLabel); |
| 347 | let match_label = mi::t(lang, MK::MatchSystem); | 341 | let match_label = mi::t(lang, MK::MatchSystem); |
| 348 | let light_label = mi::t(lang, MK::Light); | 342 | let light_label = mi::t(lang, MK::Light); |
| @@ -350,7 +344,6 @@ async fn profile_corner(lang: Lang, corner: ProfileCorner) -> Result<impl View> | |||
| 350 | let auto_pressed = if corner.theme == "auto" { "true" } else { "false" }; | 344 | let auto_pressed = if corner.theme == "auto" { "true" } else { "false" }; |
| 351 | let light_pressed = if corner.theme == "light" { "true" } else { "false" }; | 345 | let light_pressed = if corner.theme == "light" { "true" } else { "false" }; |
| 352 | let dark_pressed = if corner.theme == "dark" { "true" } else { "false" }; | 346 | let dark_pressed = if corner.theme == "dark" { "true" } else { "false" }; |
| 353 | - let has_waiting = !corner.waiting.is_empty(); | ||
| 354 | // The chips' titles as nav.js rebuilds them: the server's phrase with `{n}` for the count. The | 347 | // The chips' titles as nav.js rebuilds them: the server's phrase with `{n}` for the count. The |
| 355 | // singular and plural forms are separate, as English puts "request" and "requests" apart. | 348 | // singular and plural forms are separate, as English puts "request" and "requests" apart. |
| 356 | let review_template = count_template(&mi::review_requests_count(lang, 2), 2); | 349 | let review_template = count_template(&mi::review_requests_count(lang, 2), 2); |
| @@ -368,30 +361,21 @@ async fn profile_corner(lang: Lang, corner: ProfileCorner) -> Result<impl View> | |||
| 368 | <details class="corner" data-unread-stream=""> | 361 | <details class="corner" data-unread-stream=""> |
| 369 | <summary class="corner-btn" aria-label=(corner.username.as_str())> | 362 | <summary class="corner-btn" aria-label=(corner.username.as_str())> |
| 370 | <span class=(ring_class)><img class="avatar avatar-sm" src=(corner.avatar.as_str()) alt="" width="28" height="28"></span> | 363 | <span class=(ring_class)><img class="avatar avatar-sm" src=(corner.avatar.as_str()) alt="" width="28" height="28"></span> |
| 371 | - <span class="corner-name">(corner.username.as_str())</span> | 364 | + <span class="corner-name" title=(corner.username.as_str())>(corner.name.as_str())</span> |
| 372 | <span class="corner-chips" data-review=(review_template.as_str()) data-review-one=(review_one.as_str()) data-mention=(mention_template.as_str()) data-mention-one=(mention_one.as_str()) data-failing=(failing_template.as_str()) data-failing-one=(failing_one.as_str())> | 365 | <span class="corner-chips" data-review=(review_template.as_str()) data-review-one=(review_one.as_str()) data-mention=(mention_template.as_str()) data-mention-one=(mention_one.as_str()) data-failing=(failing_template.as_str()) data-failing-one=(failing_one.as_str())> |
| 373 | if let Some((count, title)) = review_chip { | 366 | if let Some((count, title)) = review_chip { |
| 374 | - <span class="chip chip-review" title=(title.as_str())><svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/></svg>(count.as_str())</span> | 367 | + <a class="chip chip-review" href=(corner.review_href.as_str()) title=(title.as_str())><svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/></svg>(count.as_str())</a> |
| 375 | } | 368 | } |
| 376 | if let Some((count, title)) = mention_chip { | 369 | if let Some((count, title)) = mention_chip { |
| 377 | - <span class="chip chip-mention" title=(title.as_str())><svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94"/></svg>(count.as_str())</span> | 370 | + <a class="chip chip-mention" href=(corner.mention_href.as_str()) title=(title.as_str())><svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94"/></svg>(count.as_str())</a> |
| 378 | } | 371 | } |
| 379 | if let Some((count, title)) = failing_chip { | 372 | if let Some((count, title)) = failing_chip { |
| 380 | - <span class="chip chip-failing" title=(title.as_str())><svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><path d="M6 6l12 12M18 6 6 18"/></svg>(count.as_str())</span> | 373 | + <a class="chip chip-failing" href=(corner.failing_href.as_str()) title=(title.as_str())><svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><path d="M6 6l12 12M18 6 6 18"/></svg>(count.as_str())</a> |
| 381 | } | 374 | } |
| 382 | </span> | 375 | </span> |
| 376 | + <a class="corner-bell" href="/notifications" title=(bell_label) aria-label=(bell_label)><svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/></svg></a> | ||
| 383 | </summary> | 377 | </summary> |
| 384 | - <div class="corner-menu" data-cap=(waiting_label)> | 378 | + <div class="corner-menu"> |
| 385 | - if has_waiting { | ||
| 386 | - <p class="corner-cap">(waiting_label)</p> | ||
| 387 | - <ul class="corner-waiting"> | ||
| 388 | - for item in corner.waiting.iter() { | ||
| 389 | - <li><a href=(item.href.as_str())><span class=(item.dot_class)></span><span class="corner-item"><span>(item.title.as_str())</span><small>(item.repo.as_str())</small></span></a></li> | ||
| 390 | - } | ||
| 391 | - </ul> | ||
| 392 | - } | ||
| 393 | - <a class="corner-link" href="/notifications">(all_label)</a> | ||
| 394 | - <hr class="corner-rule"> | ||
| 395 | <div class="corner-theme"><span>(theme_label)</span> | 379 | <div class="corner-theme"><span>(theme_label)</span> |
| 396 | <form method="post" action="/-/theme" class="corner-theme-set" data-no-tick="true"> | 380 | <form method="post" action="/-/theme" class="corner-theme-set" data-no-tick="true"> |
| 397 | <input type="hidden" name="csrf" value=(corner.csrf.as_str())> | 381 | <input type="hidden" name="csrf" value=(corner.csrf.as_str())> |
| @@ -611,26 +595,37 @@ pub async fn shell( | |||
| 611 | // The profile corner, the signed-in sidebar's account menu. The sidebar and the phone menu | 595 | // The profile corner, the signed-in sidebar's account menu. The sidebar and the phone menu |
| 612 | // each get their own copy. | 596 | // each get their own copy. |
| 613 | let hot = !runs.running.is_empty(); | 597 | let hot = !runs.running.is_empty(); |
| 614 | - let waiting_rows: Vec<WaitingRow> = waiting | 598 | + // Each chip leads to the newest thing it counts; a review or mention past the five newest |
| 599 | + // waiting items falls back to the inbox. | ||
| 600 | + let newest_waiting = |review: bool| { | ||
| 601 | + waiting | ||
| 615 | .iter() | 602 | .iter() |
| 616 | - .map(|item| WaitingRow { | 603 | + .find(|item| { |
| 617 | - href: repo_href( | 604 | + matches!(item.reason, forge_core::notifications::Reason::ReviewRequested) == review |
| 618 | - &item.owner, | ||
| 619 | - &item.repo, | ||
| 620 | - if item.is_pull { "pulls" } else { "issues" }, | ||
| 621 | - &item.number.to_string(), | ||
| 622 | - ), | ||
| 623 | - title: item.title.clone(), | ||
| 624 | - repo: format!("{}/{}#{}", item.owner, item.repo, item.number), | ||
| 625 | - dot_class: if matches!(item.reason, forge_core::notifications::Reason::ReviewRequested) { | ||
| 626 | - "corner-dot review" | ||
| 627 | - } else { | ||
| 628 | - "corner-dot mention" | ||
| 629 | - }, | ||
| 630 | }) | 605 | }) |
| 631 | - .collect(); | 606 | + .map_or_else( |
| 607 | + || "/notifications".to_owned(), | ||
| 608 | + |item| { | ||
| 609 | + let section = if item.is_pull { "pulls" } else { "issues" }; | ||
| 610 | + repo_href(&item.owner, &item.repo, section, &item.number.to_string()) | ||
| 611 | + }, | ||
| 612 | + ) | ||
| 613 | + }; | ||
| 614 | + let review_href = newest_waiting(true); | ||
| 615 | + let mention_href = newest_waiting(false); | ||
| 616 | + let failing_href = runs.newest_failing.as_ref().map_or_else( | ||
| 617 | + || "/notifications".to_owned(), | ||
| 618 | + |(owner, repo, number)| repo_href(owner, repo, "ci", &format!("runs/{number}")), | ||
| 619 | + ); | ||
| 632 | let corner = viewer.map(|(user, session)| ProfileCorner { | 620 | let corner = viewer.map(|(user, session)| ProfileCorner { |
| 633 | username: user.username.clone(), | 621 | username: user.username.clone(), |
| 622 | + name: user | ||
| 623 | + .display_name | ||
| 624 | + .as_deref() | ||
| 625 | + .map(str::trim) | ||
| 626 | + .filter(|n| !n.is_empty()) | ||
| 627 | + .unwrap_or(&user.username) | ||
| 628 | + .to_owned(), | ||
| 634 | avatar: avatar_url(&user.username, user.avatar_hash.as_deref()), | 629 | avatar: avatar_url(&user.username, user.avatar_hash.as_deref()), |
| 635 | csrf: session.csrf_token.clone(), | 630 | csrf: session.csrf_token.clone(), |
| 636 | back: back.clone().unwrap_or_else(|| "/".to_owned()), | 631 | back: back.clone().unwrap_or_else(|| "/".to_owned()), |
| @@ -640,7 +635,9 @@ pub async fn shell( | |||
| 640 | mentions: inbox.mentions, | 635 | mentions: inbox.mentions, |
| 641 | failing: runs.failing, | 636 | failing: runs.failing, |
| 642 | hot, | 637 | hot, |
| 643 | - waiting: waiting_rows, | 638 | + review_href, |
| 639 | + mention_href, | ||
| 640 | + failing_href, | ||
| 644 | }); | 641 | }); |
| 645 | let corner_panel = corner.clone(); | 642 | let corner_panel = corner.clone(); |
| 646 | let corner_aside = corner; | 643 | let corner_aside = corner; |
| @@ -788,10 +785,10 @@ pub async fn shell( | |||
| 788 | } | 785 | } |
| 789 | </aside> | 786 | </aside> |
| 790 | } | 787 | } |
| 788 | + <div class="shell-body"> | ||
| 791 | <main tabindex="-1"> | 789 | <main tabindex="-1"> |
| 792 | (child) | 790 | (child) |
| 793 | </main> | 791 | </main> |
| 794 | - </div> | ||
| 795 | <footer class="site-footer"> | 792 | <footer class="site-footer"> |
| 796 | <span>"forge"</span> | 793 | <span>"forge"</span> |
| 797 | if anonymous { | 794 | if anonymous { |
| @@ -808,6 +805,8 @@ pub async fn shell( | |||
| 808 | </form> | 805 | </form> |
| 809 | } | 806 | } |
| 810 | </footer> | 807 | </footer> |
| 808 | + </div> | ||
| 809 | + </div> | ||
| 811 | </body> | 810 | </body> |
| 812 | </html> | 811 | </html> |
| 813 | } | 812 | } |
| @@ -1764,6 +1763,7 @@ mod tests { | |||
| 1764 | running: vec![run(RunState::Running, 3)], | 1763 | running: vec![run(RunState::Running, 3)], |
| 1765 | finished: vec![run(RunState::Failure, 2), run(RunState::Cancelled, 1)], | 1764 | finished: vec![run(RunState::Failure, 2), run(RunState::Cancelled, 1)], |
| 1766 | failing: 0, | 1765 | failing: 0, |
| 1766 | + newest_failing: None, | ||
| 1767 | }; | 1767 | }; |
| 1768 | let strip = live_strip(Lang::En, &many); | 1768 | let strip = live_strip(Lang::En, &many); |
| 1769 | assert_eq!(strip.runs.len(), 3); | 1769 | assert_eq!(strip.runs.len(), 3); |
| @@ -1773,6 +1773,7 @@ mod tests { | |||
| 1773 | running: Vec::new(), | 1773 | running: Vec::new(), |
| 1774 | finished: vec![run(RunState::Cancelled, 1)], | 1774 | finished: vec![run(RunState::Cancelled, 1)], |
| 1775 | failing: 0, | 1775 | failing: 0, |
| 1776 | + newest_failing: None, | ||
| 1776 | }; | 1777 | }; |
| 1777 | let one = live_strip(Lang::En, &alone); | 1778 | let one = live_strip(Lang::En, &alone); |
| 1778 | assert_eq!(one.runs.len(), 1); | 1779 | assert_eq!(one.runs.len(), 1); |
style/_shell.scssmodified+54 -89
| @@ -657,8 +657,8 @@ | |||
| 657 | white-space: nowrap; | 657 | white-space: nowrap; |
| 658 | } | 658 | } |
| 659 | 659 | ||
| 660 | -// The avatar inside a ring: a plain border ring when nothing runs, a full ember ring while a run | 660 | +// The avatar on its own when nothing runs; while a run of the viewer's is queued or running (.hot) |
| 661 | -// of the viewer's is queued or running (.hot), glowing softly. | 661 | +// an accent ring appears around it, glowing softly. |
| 662 | .heat-ring { | 662 | .heat-ring { |
| 663 | display: grid; | 663 | display: grid; |
| 664 | flex: none; | 664 | flex: none; |
| @@ -666,7 +666,6 @@ | |||
| 666 | width: 34px; | 666 | width: 34px; |
| 667 | height: 34px; | 667 | height: 34px; |
| 668 | border-radius: 50%; | 668 | border-radius: 50%; |
| 669 | - background: var(--border); | ||
| 670 | 669 | ||
| 671 | &.hot { | 670 | &.hot { |
| 672 | background: conic-gradient(var(--heat-2), var(--heat-3), var(--heat-4), var(--heat-2)); | 671 | background: conic-gradient(var(--heat-2), var(--heat-3), var(--heat-4), var(--heat-2)); |
| @@ -675,11 +674,16 @@ | |||
| 675 | 674 | ||
| 676 | .avatar { | 675 | .avatar { |
| 677 | box-sizing: border-box; | 676 | box-sizing: border-box; |
| 678 | - width: 28px; | 677 | + width: 32px; |
| 679 | - height: 28px; | 678 | + height: 32px; |
| 680 | - border: 2px solid var(--bg); | ||
| 681 | border-radius: 50%; | 679 | border-radius: 50%; |
| 682 | } | 680 | } |
| 681 | + | ||
| 682 | + &.hot .avatar { | ||
| 683 | + width: 30px; | ||
| 684 | + height: 30px; | ||
| 685 | + border: 2px solid var(--bg); | ||
| 686 | + } | ||
| 683 | } | 687 | } |
| 684 | 688 | ||
| 685 | .corner-chips { | 689 | .corner-chips { |
| @@ -712,6 +716,37 @@ | |||
| 712 | } | 716 | } |
| 713 | } | 717 | } |
| 714 | 718 | ||
| 719 | +// A chip is a link to the newest thing it counts. | ||
| 720 | +a.chip { | ||
| 721 | + text-decoration: none; | ||
| 722 | + | ||
| 723 | + &:hover { | ||
| 724 | + text-decoration: none; | ||
| 725 | + filter: brightness(1.15); | ||
| 726 | + } | ||
| 727 | +} | ||
| 728 | + | ||
| 729 | +// The bell at the corner's right end: the inbox. | ||
| 730 | +.corner-bell { | ||
| 731 | + display: grid; | ||
| 732 | + flex: none; | ||
| 733 | + place-items: center; | ||
| 734 | + width: 28px; | ||
| 735 | + height: 28px; | ||
| 736 | + border-radius: var(--radius-md); | ||
| 737 | + color: var(--muted); | ||
| 738 | + | ||
| 739 | + &:hover { | ||
| 740 | + background: color-mix(in srgb, var(--text) 8%, transparent); | ||
| 741 | + color: var(--text); | ||
| 742 | + } | ||
| 743 | + | ||
| 744 | + .ico { | ||
| 745 | + width: 18px; | ||
| 746 | + height: 18px; | ||
| 747 | + } | ||
| 748 | +} | ||
| 749 | + | ||
| 715 | .chip-review { | 750 | .chip-review { |
| 716 | color: var(--important); | 751 | color: var(--important); |
| 717 | background: color-mix(in srgb, var(--important) 12%, var(--surface)); | 752 | background: color-mix(in srgb, var(--important) 12%, var(--surface)); |
| @@ -746,77 +781,6 @@ | |||
| 746 | box-shadow: var(--shadow); | 781 | box-shadow: var(--shadow); |
| 747 | } | 782 | } |
| 748 | 783 | ||
| 749 | -.corner-cap { | ||
| 750 | - margin: 0; | ||
| 751 | - padding: 6px 10px 2px; | ||
| 752 | - font-size: 11.5px; | ||
| 753 | - font-weight: 600; | ||
| 754 | - color: var(--muted); | ||
| 755 | -} | ||
| 756 | - | ||
| 757 | -.corner-waiting { | ||
| 758 | - display: grid; | ||
| 759 | - gap: 2px; | ||
| 760 | - margin: 0; | ||
| 761 | - padding: 0; | ||
| 762 | - list-style: none; | ||
| 763 | - | ||
| 764 | - a { | ||
| 765 | - display: flex; | ||
| 766 | - align-items: flex-start; | ||
| 767 | - gap: 8px; | ||
| 768 | - padding: 6px 10px; | ||
| 769 | - border-radius: var(--radius-md); | ||
| 770 | - color: var(--text); | ||
| 771 | - text-decoration: none; | ||
| 772 | - | ||
| 773 | - &:hover { | ||
| 774 | - background: var(--surface-2); | ||
| 775 | - text-decoration: none; | ||
| 776 | - } | ||
| 777 | - } | ||
| 778 | -} | ||
| 779 | - | ||
| 780 | -.corner-dot { | ||
| 781 | - flex: none; | ||
| 782 | - width: 7px; | ||
| 783 | - height: 7px; | ||
| 784 | - margin-top: 6px; | ||
| 785 | - border-radius: 50%; | ||
| 786 | - background: var(--muted); | ||
| 787 | - | ||
| 788 | - &.review { | ||
| 789 | - background: var(--important); | ||
| 790 | - } | ||
| 791 | - | ||
| 792 | - &.mention { | ||
| 793 | - background: var(--info); | ||
| 794 | - } | ||
| 795 | -} | ||
| 796 | - | ||
| 797 | -.corner-item { | ||
| 798 | - display: flex; | ||
| 799 | - flex-direction: column; | ||
| 800 | - min-width: 0; | ||
| 801 | - | ||
| 802 | - span { | ||
| 803 | - overflow: hidden; | ||
| 804 | - font-size: 13.5px; | ||
| 805 | - line-height: 1.3; | ||
| 806 | - text-overflow: ellipsis; | ||
| 807 | - white-space: nowrap; | ||
| 808 | - } | ||
| 809 | - | ||
| 810 | - small { | ||
| 811 | - overflow: hidden; | ||
| 812 | - font-family: var(--mono); | ||
| 813 | - font-size: 11.5px; | ||
| 814 | - color: var(--muted); | ||
| 815 | - text-overflow: ellipsis; | ||
| 816 | - white-space: nowrap; | ||
| 817 | - } | ||
| 818 | -} | ||
| 819 | - | ||
| 820 | // `button.corner-link` too (Log out): the extra element in the selector outweighs `button.link-button`. | 784 | // `button.corner-link` too (Log out): the extra element in the selector outweighs `button.link-button`. |
| 821 | .corner-link, | 785 | .corner-link, |
| 822 | button.corner-link.link-button { | 786 | button.corner-link.link-button { |
| @@ -841,13 +805,6 @@ button.corner-link.link-button { | |||
| 841 | } | 805 | } |
| 842 | } | 806 | } |
| 843 | 807 | ||
| 844 | -.corner-rule { | ||
| 845 | - width: auto; | ||
| 846 | - margin: 4px 6px; | ||
| 847 | - border: 0; | ||
| 848 | - border-top: 1px solid var(--border); | ||
| 849 | -} | ||
| 850 | - | ||
| 851 | .corner-theme { | 808 | .corner-theme { |
| 852 | display: flex; | 809 | display: flex; |
| 853 | align-items: center; | 810 | align-items: center; |
| @@ -899,15 +856,23 @@ button.corner-link.link-button { | |||
| 899 | } | 856 | } |
| 900 | } | 857 | } |
| 901 | 858 | ||
| 902 | -// Page column and footer | 859 | +// Page column and footer. The footer sits under the page in the same column, so a short page and |
| 860 | +// its footer fit in the viewport the shell fills (no scroll for a footer's height). | ||
| 861 | + | ||
| 862 | +.shell-body { | ||
| 863 | + display: flex; | ||
| 864 | + flex-direction: column; | ||
| 865 | + min-width: 0; | ||
| 866 | +} | ||
| 903 | 867 | ||
| 904 | -.shell > main { | 868 | +.shell-body > main { |
| 869 | + flex: 1 0 auto; | ||
| 905 | box-sizing: border-box; | 870 | box-sizing: border-box; |
| 906 | width: 100%; | 871 | width: 100%; |
| 907 | min-width: 0; | 872 | min-width: 0; |
| 908 | max-width: 1280px; | 873 | max-width: 1280px; |
| 909 | margin: 0 auto; | 874 | margin: 0 auto; |
| 910 | - padding: 24px 16px 48px; | 875 | + padding: 24px 16px 24px; |
| 911 | } | 876 | } |
| 912 | 877 | ||
| 913 | .site-footer { | 878 | .site-footer { |
| @@ -970,8 +935,8 @@ button.corner-link.link-button { | |||
| 970 | } | 935 | } |
| 971 | 936 | ||
| 972 | @media (min-width: 700px) { | 937 | @media (min-width: 700px) { |
| 973 | - .shell > main { | 938 | + .shell-body > main { |
| 974 | - padding: 28px 28px 48px; | 939 | + padding: 28px 28px 24px; |
| 975 | } | 940 | } |
| 976 | 941 | ||
| 977 | .site-footer { | 942 | .site-footer { |
style/main.scssmodified+20 -19
| @@ -85,13 +85,14 @@ | |||
| 85 | --note: #2B6CB0; | 85 | --note: #2B6CB0; |
| 86 | --tip: #1D7A62; | 86 | --tip: #1D7A62; |
| 87 | --important: #6A4BB0; | 87 | --important: #6A4BB0; |
| 88 | - // Heat: the live strip and the profile ring (0 is the empty track, 4 the hottest). Chips never use the accent. | 88 | + // Heat: the live strip and the profile ring (0 is the empty track, 4 the hottest), shades of the |
| 89 | - --heat-0: #ECE7E1; | 89 | + // accent so they follow the chosen colour. Chips never use the accent. |
| 90 | - --heat-1: #F6C9A8; | 90 | + --heat-0: color-mix(in srgb, var(--accent) 10%, var(--surface)); |
| 91 | - --heat-2: #EE9A60; | 91 | + --heat-1: color-mix(in srgb, var(--accent) 35%, var(--surface)); |
| 92 | - --heat-3: #D4652A; | 92 | + --heat-2: color-mix(in srgb, var(--accent) 65%, var(--surface)); |
| 93 | - --heat-4: #9C3A10; | 93 | + --heat-3: var(--accent); |
| 94 | - --heat-glow: rgba(220, 100, 30, .35); | 94 | + --heat-4: color-mix(in srgb, var(--accent) 65%, #000); |
| 95 | + --heat-glow: color-mix(in srgb, var(--accent) 35%, transparent); | ||
| 95 | --info: #2B6CB0; | 96 | --info: #2B6CB0; |
| 96 | --warning: #9A6200; | 97 | --warning: #9A6200; |
| 97 | --shadow: 0 10px 28px rgba(30, 36, 32, .10); | 98 | --shadow: 0 10px 28px rgba(30, 36, 32, .10); |
| @@ -131,12 +132,12 @@ | |||
| 131 | --note: #8AB4F0; | 132 | --note: #8AB4F0; |
| 132 | --tip: #7CCBAE; | 133 | --tip: #7CCBAE; |
| 133 | --important: #C4A7FF; | 134 | --important: #C4A7FF; |
| 134 | - --heat-0: #24211E; | 135 | + --heat-0: color-mix(in srgb, var(--accent) 10%, var(--surface)); |
| 135 | - --heat-1: #5A2614; | 136 | + --heat-1: color-mix(in srgb, var(--accent) 30%, var(--surface)); |
| 136 | - --heat-2: #9A3A16; | 137 | + --heat-2: color-mix(in srgb, var(--accent) 60%, var(--surface)); |
| 137 | - --heat-3: #D9662A; | 138 | + --heat-3: var(--accent); |
| 138 | - --heat-4: #FFB066; | 139 | + --heat-4: color-mix(in srgb, var(--accent) 65%, #fff); |
| 139 | - --heat-glow: rgba(255, 150, 70, .55); | 140 | + --heat-glow: color-mix(in srgb, var(--accent) 55%, transparent); |
| 140 | --info: #8AB4F0; | 141 | --info: #8AB4F0; |
| 141 | --warning: #E6B765; | 142 | --warning: #E6B765; |
| 142 | --shadow: 0 10px 28px rgba(0, 0, 0, .45); | 143 | --shadow: 0 10px 28px rgba(0, 0, 0, .45); |
| @@ -167,12 +168,12 @@ | |||
| 167 | --note: #8AB4F0; | 168 | --note: #8AB4F0; |
| 168 | --tip: #7CCBAE; | 169 | --tip: #7CCBAE; |
| 169 | --important: #C4A7FF; | 170 | --important: #C4A7FF; |
| 170 | - --heat-0: #24211E; | 171 | + --heat-0: color-mix(in srgb, var(--accent) 10%, var(--surface)); |
| 171 | - --heat-1: #5A2614; | 172 | + --heat-1: color-mix(in srgb, var(--accent) 30%, var(--surface)); |
| 172 | - --heat-2: #9A3A16; | 173 | + --heat-2: color-mix(in srgb, var(--accent) 60%, var(--surface)); |
| 173 | - --heat-3: #D9662A; | 174 | + --heat-3: var(--accent); |
| 174 | - --heat-4: #FFB066; | 175 | + --heat-4: color-mix(in srgb, var(--accent) 65%, #fff); |
| 175 | - --heat-glow: rgba(255, 150, 70, .55); | 176 | + --heat-glow: color-mix(in srgb, var(--accent) 55%, transparent); |
| 176 | --info: #8AB4F0; | 177 | --info: #8AB4F0; |
| 177 | --warning: #E6B765; | 178 | --warning: #E6B765; |
| 178 | --shadow: 0 10px 28px rgba(0, 0, 0, .45); | 179 | --shadow: 0 10px 28px rgba(0, 0, 0, .45); |