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 +169 -190
- 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 +71 -70
- 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 | 56 | pub finished: Vec<ActorRun>, |
| 57 | 57 | /// Refs whose newest run by this user failed within the last 7 days. |
| 58 | 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 | 63 | /// One CI run of the user, with its job progress. |
| @@ -221,33 +223,43 @@ impl Store { | ||
| 221 | 223 | ) |
| 222 | 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 | 228 | let mut params = vec![Value::Text(actor_id.to_string())]; |
| 226 | 229 | params.extend(readable_params(actor_id)); |
| 227 | 230 | params.push(Value::Text(stamp_ago(FAILING_WINDOW))); |
| 228 | 231 | let failing = fetch_all( |
| 229 | 232 | &conn, |
| 230 | 233 | &format!( |
| 231 | - "SELECT COUNT(*) FROM ( \ | |
| 232 | - SELECT ci_runs.state, ci_runs.created_at, ROW_NUMBER() OVER ( \ | |
| 234 | + "SELECT COUNT(*) OVER (), owner, name, number FROM ( \ | |
| 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 | 237 | PARTITION BY ci_runs.repo_id, ci_runs.git_ref ORDER BY ci_runs.number DESC) AS rn \ |
| 234 | 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 | 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 | 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 | 252 | .await?; |
| 242 | - let failing = match failing.first() { | |
| 243 | - Some(n) => count_from(*n)?, | |
| 244 | - None => 0, | |
| 253 | + let (failing, newest_failing) = match failing.into_iter().next() { | |
| 254 | + Some((n, run)) => (count_from(n)?, Some(run)), | |
| 255 | + None => (0, None), | |
| 245 | 256 | }; |
| 246 | 257 | |
| 247 | 258 | Ok(ActorRuns { |
| 248 | 259 | running, |
| 249 | 260 | finished, |
| 250 | 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 | 172 | YourProfile, |
| 173 | 173 | EditProfile, |
| 174 | 174 | // Profile corner, live strip and path bar search. |
| 175 | - WaitingOnYou, | |
| 176 | 175 | AllNotifications, |
| 177 | 176 | Passed, |
| 178 | 177 | Failed, |
| @@ -328,7 +327,6 @@ const ALL: &[K] = &[ | ||
| 328 | 327 | K::RefLabel, |
| 329 | 328 | K::YourProfile, |
| 330 | 329 | K::EditProfile, |
| 331 | - K::WaitingOnYou, | |
| 332 | 330 | K::AllNotifications, |
| 333 | 331 | K::Passed, |
| 334 | 332 | K::Failed, |
| @@ -655,8 +653,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 655 | 653 | (YourProfile, Tr) => "Profilin", |
| 656 | 654 | (EditProfile, En) => "Edit profile", |
| 657 | 655 | (EditProfile, Tr) => "Profili düzenle", |
| 658 | - (WaitingOnYou, En) => "Waiting on you", | |
| 659 | - (WaitingOnYou, Tr) => "Seni bekleyenler", | |
| 660 | 656 | (AllNotifications, En) => "All notifications", |
| 661 | 657 | (AllNotifications, Tr) => "Tüm bildirimler", |
| 662 | 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 | 90 | "reviews": kinds.reviews, |
| 91 | 91 | "mentions": kinds.mentions, |
| 92 | 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 | 97 | "running": running, |
| 94 | 98 | "finished": finished, |
| 95 | 99 | "waiting": waiting, |
crates/forge-web/src/views/mod.rsmodified+71 -70
| @@ -297,25 +297,17 @@ fn no_runs() -> ActorRuns { | ||
| 297 | 297 | running: Vec::new(), |
| 298 | 298 | finished: Vec::new(), |
| 299 | 299 | failing: 0, |
| 300 | + newest_failing: None, | |
| 300 | 301 | } |
| 301 | 302 | } |
| 302 | 303 | |
| 303 | -/// One item of the profile corner's waiting list. | |
| 304 | -#[derive(Clone)] | |
| 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. | |
| 304 | +/// What the profile corner shows: the viewer, their inbox counts with where each leads, and whether | |
| 305 | +/// any of their runs is going (the ring glows). | |
| 316 | 306 | #[derive(Clone)] |
| 317 | 307 | struct ProfileCorner { |
| 318 | 308 | username: String, |
| 309 | + /// The display name when set, else the username. | |
| 310 | + name: String, | |
| 319 | 311 | avatar: String, |
| 320 | 312 | csrf: String, |
| 321 | 313 | back: String, |
| @@ -325,7 +317,10 @@ struct ProfileCorner { | ||
| 325 | 317 | mentions: u64, |
| 326 | 318 | failing: u64, |
| 327 | 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 | 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 | 336 | .then(|| (corner.mentions.to_string(), mi::mentions_count(lang, corner.mentions))); |
| 342 | 337 | let failing_chip = (corner.failing > 0) |
| 343 | 338 | .then(|| (corner.failing.to_string(), mi::failing_runs_count(lang, corner.failing))); |
| 344 | - let waiting_label = mi::t(lang, MK::WaitingOnYou); | |
| 345 | - let all_label = mi::t(lang, MK::AllNotifications); | |
| 339 | + let bell_label = mi::t(lang, MK::AllNotifications); | |
| 346 | 340 | let theme_label = mi::t(lang, MK::ThemeLabel); |
| 347 | 341 | let match_label = mi::t(lang, MK::MatchSystem); |
| 348 | 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 | 344 | let auto_pressed = if corner.theme == "auto" { "true" } else { "false" }; |
| 351 | 345 | let light_pressed = if corner.theme == "light" { "true" } else { "false" }; |
| 352 | 346 | let dark_pressed = if corner.theme == "dark" { "true" } else { "false" }; |
| 353 | - let has_waiting = !corner.waiting.is_empty(); | |
| 354 | 347 | // The chips' titles as nav.js rebuilds them: the server's phrase with `{n}` for the count. The |
| 355 | 348 | // singular and plural forms are separate, as English puts "request" and "requests" apart. |
| 356 | 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 | 361 | <details class="corner" data-unread-stream=""> |
| 369 | 362 | <summary class="corner-btn" aria-label=(corner.username.as_str())> |
| 370 | 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 | 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 | 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 | 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 | 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 | 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 | 377 | </summary> |
| 384 | - <div class="corner-menu" data-cap=(waiting_label)> | |
| 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"> | |
| 378 | + <div class="corner-menu"> | |
| 395 | 379 | <div class="corner-theme"><span>(theme_label)</span> |
| 396 | 380 | <form method="post" action="/-/theme" class="corner-theme-set" data-no-tick="true"> |
| 397 | 381 | <input type="hidden" name="csrf" value=(corner.csrf.as_str())> |
| @@ -611,26 +595,37 @@ pub async fn shell( | ||
| 611 | 595 | // The profile corner, the signed-in sidebar's account menu. The sidebar and the phone menu |
| 612 | 596 | // each get their own copy. |
| 613 | 597 | let hot = !runs.running.is_empty(); |
| 614 | - let waiting_rows: Vec<WaitingRow> = waiting | |
| 615 | - .iter() | |
| 616 | - .map(|item| WaitingRow { | |
| 617 | - href: repo_href( | |
| 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 | - }) | |
| 631 | - .collect(); | |
| 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 | |
| 602 | + .iter() | |
| 603 | + .find(|item| { | |
| 604 | + matches!(item.reason, forge_core::notifications::Reason::ReviewRequested) == review | |
| 605 | + }) | |
| 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 | 620 | let corner = viewer.map(|(user, session)| ProfileCorner { |
| 633 | 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 | 629 | avatar: avatar_url(&user.username, user.avatar_hash.as_deref()), |
| 635 | 630 | csrf: session.csrf_token.clone(), |
| 636 | 631 | back: back.clone().unwrap_or_else(|| "/".to_owned()), |
| @@ -640,7 +635,9 @@ pub async fn shell( | ||
| 640 | 635 | mentions: inbox.mentions, |
| 641 | 636 | failing: runs.failing, |
| 642 | 637 | hot, |
| 643 | - waiting: waiting_rows, | |
| 638 | + review_href, | |
| 639 | + mention_href, | |
| 640 | + failing_href, | |
| 644 | 641 | }); |
| 645 | 642 | let corner_panel = corner.clone(); |
| 646 | 643 | let corner_aside = corner; |
| @@ -788,26 +785,28 @@ pub async fn shell( | ||
| 788 | 785 | } |
| 789 | 786 | </aside> |
| 790 | 787 | } |
| 791 | - <main tabindex="-1"> | |
| 792 | - (child) | |
| 793 | - </main> | |
| 788 | + <div class="shell-body"> | |
| 789 | + <main tabindex="-1"> | |
| 790 | + (child) | |
| 791 | + </main> | |
| 792 | + <footer class="site-footer"> | |
| 793 | + <span>"forge"</span> | |
| 794 | + if anonymous { | |
| 795 | + <form method="post" action="/-/theme" class="theme-picker"> | |
| 796 | + <label> | |
| 797 | + <span>(mi::t(lang, MK::ThemeLabel))</span> | |
| 798 | + <select name="theme"> | |
| 799 | + <option value="auto">(mi::t(lang, MK::MatchSystem))</option> | |
| 800 | + <option value="light">(mi::t(lang, MK::Light))</option> | |
| 801 | + <option value="dark">(mi::t(lang, MK::Dark))</option> | |
| 802 | + </select> | |
| 803 | + </label> | |
| 804 | + <button type="submit" class="link-button">(mi::t(lang, MK::ApplyTheme))</button> | |
| 805 | + </form> | |
| 806 | + } | |
| 807 | + </footer> | |
| 808 | + </div> | |
| 794 | 809 | </div> |
| 795 | - <footer class="site-footer"> | |
| 796 | - <span>"forge"</span> | |
| 797 | - if anonymous { | |
| 798 | - <form method="post" action="/-/theme" class="theme-picker"> | |
| 799 | - <label> | |
| 800 | - <span>(mi::t(lang, MK::ThemeLabel))</span> | |
| 801 | - <select name="theme"> | |
| 802 | - <option value="auto">(mi::t(lang, MK::MatchSystem))</option> | |
| 803 | - <option value="light">(mi::t(lang, MK::Light))</option> | |
| 804 | - <option value="dark">(mi::t(lang, MK::Dark))</option> | |
| 805 | - </select> | |
| 806 | - </label> | |
| 807 | - <button type="submit" class="link-button">(mi::t(lang, MK::ApplyTheme))</button> | |
| 808 | - </form> | |
| 809 | - } | |
| 810 | - </footer> | |
| 811 | 810 | </body> |
| 812 | 811 | </html> |
| 813 | 812 | } |
| @@ -1764,6 +1763,7 @@ mod tests { | ||
| 1764 | 1763 | running: vec![run(RunState::Running, 3)], |
| 1765 | 1764 | finished: vec![run(RunState::Failure, 2), run(RunState::Cancelled, 1)], |
| 1766 | 1765 | failing: 0, |
| 1766 | + newest_failing: None, | |
| 1767 | 1767 | }; |
| 1768 | 1768 | let strip = live_strip(Lang::En, &many); |
| 1769 | 1769 | assert_eq!(strip.runs.len(), 3); |
| @@ -1773,6 +1773,7 @@ mod tests { | ||
| 1773 | 1773 | running: Vec::new(), |
| 1774 | 1774 | finished: vec![run(RunState::Cancelled, 1)], |
| 1775 | 1775 | failing: 0, |
| 1776 | + newest_failing: None, | |
| 1776 | 1777 | }; |
| 1777 | 1778 | let one = live_strip(Lang::En, &alone); |
| 1778 | 1779 | assert_eq!(one.runs.len(), 1); |
style/_shell.scssmodified+54 -89
| @@ -657,8 +657,8 @@ | ||
| 657 | 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 | |
| 661 | -// of the viewer's is queued or running (.hot), glowing softly. | |
| 660 | +// The avatar on its own when nothing runs; while a run of the viewer's is queued or running (.hot) | |
| 661 | +// an accent ring appears around it, glowing softly. | |
| 662 | 662 | .heat-ring { |
| 663 | 663 | display: grid; |
| 664 | 664 | flex: none; |
| @@ -666,7 +666,6 @@ | ||
| 666 | 666 | width: 34px; |
| 667 | 667 | height: 34px; |
| 668 | 668 | border-radius: 50%; |
| 669 | - background: var(--border); | |
| 670 | 669 | |
| 671 | 670 | &.hot { |
| 672 | 671 | background: conic-gradient(var(--heat-2), var(--heat-3), var(--heat-4), var(--heat-2)); |
| @@ -675,11 +674,16 @@ | ||
| 675 | 674 | |
| 676 | 675 | .avatar { |
| 677 | 676 | box-sizing: border-box; |
| 678 | - width: 28px; | |
| 679 | - height: 28px; | |
| 680 | - border: 2px solid var(--bg); | |
| 677 | + width: 32px; | |
| 678 | + height: 32px; | |
| 681 | 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 | 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 | 750 | .chip-review { |
| 716 | 751 | color: var(--important); |
| 717 | 752 | background: color-mix(in srgb, var(--important) 12%, var(--surface)); |
| @@ -746,77 +781,6 @@ | ||
| 746 | 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 | 784 | // `button.corner-link` too (Log out): the extra element in the selector outweighs `button.link-button`. |
| 821 | 785 | .corner-link, |
| 822 | 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 | 808 | .corner-theme { |
| 852 | 809 | display: flex; |
| 853 | 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 | 870 | box-sizing: border-box; |
| 906 | 871 | width: 100%; |
| 907 | 872 | min-width: 0; |
| 908 | 873 | max-width: 1280px; |
| 909 | 874 | margin: 0 auto; |
| 910 | - padding: 24px 16px 48px; | |
| 875 | + padding: 24px 16px 24px; | |
| 911 | 876 | } |
| 912 | 877 | |
| 913 | 878 | .site-footer { |
| @@ -970,8 +935,8 @@ button.corner-link.link-button { | ||
| 970 | 935 | } |
| 971 | 936 | |
| 972 | 937 | @media (min-width: 700px) { |
| 973 | - .shell > main { | |
| 974 | - padding: 28px 28px 48px; | |
| 938 | + .shell-body > main { | |
| 939 | + padding: 28px 28px 24px; | |
| 975 | 940 | } |
| 976 | 941 | |
| 977 | 942 | .site-footer { |
style/main.scssmodified+20 -19
| @@ -85,13 +85,14 @@ | ||
| 85 | 85 | --note: #2B6CB0; |
| 86 | 86 | --tip: #1D7A62; |
| 87 | 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. | |
| 89 | - --heat-0: #ECE7E1; | |
| 90 | - --heat-1: #F6C9A8; | |
| 91 | - --heat-2: #EE9A60; | |
| 92 | - --heat-3: #D4652A; | |
| 93 | - --heat-4: #9C3A10; | |
| 94 | - --heat-glow: rgba(220, 100, 30, .35); | |
| 88 | + // Heat: the live strip and the profile ring (0 is the empty track, 4 the hottest), shades of the | |
| 89 | + // accent so they follow the chosen colour. Chips never use the accent. | |
| 90 | + --heat-0: color-mix(in srgb, var(--accent) 10%, var(--surface)); | |
| 91 | + --heat-1: color-mix(in srgb, var(--accent) 35%, var(--surface)); | |
| 92 | + --heat-2: color-mix(in srgb, var(--accent) 65%, var(--surface)); | |
| 93 | + --heat-3: var(--accent); | |
| 94 | + --heat-4: color-mix(in srgb, var(--accent) 65%, #000); | |
| 95 | + --heat-glow: color-mix(in srgb, var(--accent) 35%, transparent); | |
| 95 | 96 | --info: #2B6CB0; |
| 96 | 97 | --warning: #9A6200; |
| 97 | 98 | --shadow: 0 10px 28px rgba(30, 36, 32, .10); |
| @@ -131,12 +132,12 @@ | ||
| 131 | 132 | --note: #8AB4F0; |
| 132 | 133 | --tip: #7CCBAE; |
| 133 | 134 | --important: #C4A7FF; |
| 134 | - --heat-0: #24211E; | |
| 135 | - --heat-1: #5A2614; | |
| 136 | - --heat-2: #9A3A16; | |
| 137 | - --heat-3: #D9662A; | |
| 138 | - --heat-4: #FFB066; | |
| 139 | - --heat-glow: rgba(255, 150, 70, .55); | |
| 135 | + --heat-0: color-mix(in srgb, var(--accent) 10%, var(--surface)); | |
| 136 | + --heat-1: color-mix(in srgb, var(--accent) 30%, var(--surface)); | |
| 137 | + --heat-2: color-mix(in srgb, var(--accent) 60%, var(--surface)); | |
| 138 | + --heat-3: var(--accent); | |
| 139 | + --heat-4: color-mix(in srgb, var(--accent) 65%, #fff); | |
| 140 | + --heat-glow: color-mix(in srgb, var(--accent) 55%, transparent); | |
| 140 | 141 | --info: #8AB4F0; |
| 141 | 142 | --warning: #E6B765; |
| 142 | 143 | --shadow: 0 10px 28px rgba(0, 0, 0, .45); |
| @@ -167,12 +168,12 @@ | ||
| 167 | 168 | --note: #8AB4F0; |
| 168 | 169 | --tip: #7CCBAE; |
| 169 | 170 | --important: #C4A7FF; |
| 170 | - --heat-0: #24211E; | |
| 171 | - --heat-1: #5A2614; | |
| 172 | - --heat-2: #9A3A16; | |
| 173 | - --heat-3: #D9662A; | |
| 174 | - --heat-4: #FFB066; | |
| 175 | - --heat-glow: rgba(255, 150, 70, .55); | |
| 171 | + --heat-0: color-mix(in srgb, var(--accent) 10%, var(--surface)); | |
| 172 | + --heat-1: color-mix(in srgb, var(--accent) 30%, var(--surface)); | |
| 173 | + --heat-2: color-mix(in srgb, var(--accent) 60%, var(--surface)); | |
| 174 | + --heat-3: var(--accent); | |
| 175 | + --heat-4: color-mix(in srgb, var(--accent) 65%, #fff); | |
| 176 | + --heat-glow: color-mix(in srgb, var(--accent) 55%, transparent); | |
| 176 | 177 | --info: #8AB4F0; |
| 177 | 178 | --warning: #E6B765; |
| 178 | 179 | --shadow: 0 10px 28px rgba(0, 0, 0, .45); |