Cards open softly, scripts survive the swap, controls join one family
Browse files at this commit14f757daf8b6215d8bf52de8b0c55bdb40120a95Parent: 39ad0ed- feat
- cards open softly, scripts survive the swap, controls join one family
9 changed files +219 -175
- crates/izlek-web/src/board.rs +8 -4
- crates/izlek-web/src/detail.rs +22 -18
- crates/izlek-web/src/dropdown.rs +2 -0
- crates/izlek-web/src/i18n.rs +3 -0
- crates/izlek-web/src/layout.rs +51 -11
- crates/izlek-web/src/logs.rs +6 -5
- crates/izlek-web/src/rules.rs +3 -2
- crates/izlek-web/src/settings.rs +1 -1
- style/main.scss +123 -134
crates/izlek-web/src/board.rsmodified+8 -4
| @@ -341,7 +341,7 @@ async fn render_card( | |||
| 341 | <div class="avatars"> | 341 | <div class="avatars"> |
| 342 | for person in assignees { (person) } | 342 | for person in assignees { (person) } |
| 343 | if !has_assignees { | 343 | if !has_assignees { |
| 344 | - <span class="avatar avatar-none" role="img" aria-label=(t(lang, Key::NobodyAssignedAria)) title=(t(lang, Key::NobodyAssignedTitle))></span> | 344 | + <span class="avatar avatar-none" role="img" aria-label=(t(lang, Key::NobodyAssignedAria)) data-name=(t(lang, Key::NobodyAssignedTitle))></span> |
| 345 | } | 345 | } |
| 346 | </div> | 346 | </div> |
| 347 | </div> | 347 | </div> |
| @@ -388,6 +388,9 @@ async fn render_card( | |||
| 388 | async fn card_menu_script(cx: &Cx) -> Result { | 388 | async fn card_menu_script(cx: &Cx) -> Result { |
| 389 | use topcoat::view::Unescaped; | 389 | use topcoat::view::Unescaped; |
| 390 | const JS: &str = "\ | 390 | const JS: &str = "\ |
| 391 | + (function () { \ | ||
| 392 | + if (window.__izlekCardMenu) { return; } \ | ||
| 393 | + window.__izlekCardMenu = true; \ | ||
| 391 | function closeCardMenus() { document.querySelectorAll('.card-menu-open').forEach(function (el) { el.classList.remove('card-menu-open'); }); } \ | 394 | function closeCardMenus() { document.querySelectorAll('.card-menu-open').forEach(function (el) { el.classList.remove('card-menu-open'); }); } \ |
| 392 | window.__izlekOpenCardMenu = function (e, id) { \ | 395 | window.__izlekOpenCardMenu = function (e, id) { \ |
| 393 | closeCardMenus(); \ | 396 | closeCardMenus(); \ |
| @@ -429,7 +432,8 @@ async fn card_menu_script(cx: &Cx) -> Result { | |||
| 429 | if (task && window.__izlekPost) { \ | 432 | if (task && window.__izlekPost) { \ |
| 430 | window.__izlekPost('/api/move_card', { task_id: task, from_column_id: from, to_column_id: column.id }); \ | 433 | window.__izlekPost('/api/move_card', { task_id: task, from_column_id: from, to_column_id: column.id }); \ |
| 431 | } \ | 434 | } \ |
| 432 | - })"; | 435 | + }); \ |
| 436 | + })();"; | ||
| 433 | view! { cx => <script>(Unescaped::new_unchecked(JS))</script> } | 437 | view! { cx => <script>(Unescaped::new_unchecked(JS))</script> } |
| 434 | } | 438 | } |
| 435 | 439 | ||
| @@ -441,10 +445,10 @@ pub(crate) async fn avatar(cx: &Cx, person: &Person, extra: &str) -> Result { | |||
| 441 | .fold(0u32, |acc, b| acc.wrapping_mul(31).wrapping_add(b as u32)) | 445 | .fold(0u32, |acc, b| acc.wrapping_mul(31).wrapping_add(b as u32)) |
| 442 | % 5; | 446 | % 5; |
| 443 | let class = format!("avatar avatar-tone-{tone} {extra}"); | 447 | let class = format!("avatar avatar-tone-{tone} {extra}"); |
| 444 | - let title = person.display_name.clone(); | 448 | + let name = person.display_name.clone(); |
| 445 | view! { | 449 | view! { |
| 446 | cx => | 450 | cx => |
| 447 | - <span class=(class) title=(title)>(initials)</span> | 451 | + <span class=(class) data-name=(name)>(initials)</span> |
| 448 | } | 452 | } |
| 449 | } | 453 | } |
| 450 | 454 | ||
crates/izlek-web/src/detail.rsmodified+22 -18
| @@ -538,8 +538,7 @@ async fn delete_file(cx: &Cx, Form(input): Form<FileIdForm>) -> Redirect { | |||
| 538 | // `data-autosubmit` attribute (and the file input's own class), read by | 538 | // `data-autosubmit` attribute (and the file input's own class), read by |
| 539 | // `layout.rs`'s `soft_nav_script` through one delegated `change` | 539 | // `layout.rs`'s `soft_nav_script` through one delegated `change` |
| 540 | // listener — a per-element handler would die when a soft submit swaps | 540 | // listener — a per-element handler would die when a soft submit swaps |
| 541 | -// the page in — and the "Move"/"Attach" buttons stay for a browser | 541 | +// the page in. |
| 542 | -// without script. | ||
| 543 | // - The modal scrim's click-to-close is `soft_nav_script`'s delegated | 542 | // - The modal scrim's click-to-close is `soft_nav_script`'s delegated |
| 544 | // click listener (a click whose target is the scrim itself closes; a | 543 | // click listener (a click whose target is the scrim itself closes; a |
| 545 | // click inside `.modal` never has the scrim as target, so no | 544 | // click inside `.modal` never has the scrim as target, so no |
| @@ -668,7 +667,7 @@ async fn avatar(cx: &Cx, person: &Person, extra: &str) -> Result { | |||
| 668 | let tone = person.id.bytes().fold(0u32, |acc, b| acc.wrapping_mul(31).wrapping_add(b as u32)) % 5; | 667 | let tone = person.id.bytes().fold(0u32, |acc, b| acc.wrapping_mul(31).wrapping_add(b as u32)) % 5; |
| 669 | view! { | 668 | view! { |
| 670 | cx => | 669 | cx => |
| 671 | - <span class=(class!("avatar", format!("avatar-tone-{tone}"), extra)) title=(person.display_name.clone())> | 670 | + <span class=(class!("avatar", format!("avatar-tone-{tone}"), extra))> |
| 672 | (initials) | 671 | (initials) |
| 673 | </span> | 672 | </span> |
| 674 | } | 673 | } |
| @@ -690,6 +689,9 @@ async fn avatar(cx: &Cx, person: &Person, extra: &str) -> Result { | |||
| 690 | async fn escape_closes(cx: &Cx) -> Result { | 689 | async fn escape_closes(cx: &Cx) -> Result { |
| 691 | use topcoat::view::Unescaped; | 690 | use topcoat::view::Unescaped; |
| 692 | const JS: &str = "\ | 691 | const JS: &str = "\ |
| 692 | + (function () { \ | ||
| 693 | + if (window.__izlekEscModal) { return; } \ | ||
| 694 | + window.__izlekEscModal = true; \ | ||
| 693 | document.addEventListener('keydown', function (e) { \ | 695 | document.addEventListener('keydown', function (e) { \ |
| 694 | if (e.key !== 'Escape') { return; } \ | 696 | if (e.key !== 'Escape') { return; } \ |
| 695 | if (document.querySelector('.datepick-pop .edit-toggle:checked')) { return; } \ | 697 | if (document.querySelector('.datepick-pop .edit-toggle:checked')) { return; } \ |
| @@ -736,7 +738,8 @@ async fn escape_closes(cx: &Cx) -> Result { | |||
| 736 | var edit = toggle.closest('.edit'); \ | 738 | var edit = toggle.closest('.edit'); \ |
| 737 | if (edit && !edit.contains(e.target)) { toggle.checked = false; } \ | 739 | if (edit && !edit.contains(e.target)) { toggle.checked = false; } \ |
| 738 | }); \ | 740 | }); \ |
| 739 | - }, true);"; | 741 | + }, true); \ |
| 742 | + })();"; | ||
| 740 | view! { cx => <script>(Unescaped::new_unchecked(JS))</script> } | 743 | view! { cx => <script>(Unescaped::new_unchecked(JS))</script> } |
| 741 | } | 744 | } |
| 742 | 745 | ||
| @@ -883,6 +886,8 @@ async fn datepicker_script(cx: &Cx, lang: Lang) -> Result { | |||
| 883 | let (months, weekdays) = datepicker_js_literals(lang); | 886 | let (months, weekdays) = datepicker_js_literals(lang); |
| 884 | let js = format!( | 887 | let js = format!( |
| 885 | "(function() {{\ | 888 | "(function() {{\ |
| 889 | + if (window.__izlekDatepick) {{ return; }}\ | ||
| 890 | + window.__izlekDatepick = true;\ | ||
| 886 | var MONTHS = {months};\ | 891 | var MONTHS = {months};\ |
| 887 | var WEEKDAYS = {weekdays};\ | 892 | var WEEKDAYS = {weekdays};\ |
| 888 | function pad(n) {{ return String(n).padStart(2, '0'); }}\ | 893 | function pad(n) {{ return String(n).padStart(2, '0'); }}\ |
| @@ -962,7 +967,7 @@ async fn assignee_chip(cx: &Cx, task_id: &str, person: &Person, may_write: bool, | |||
| 962 | let remove_title = crate::i18n::take_off_this_task(lang, &person.display_name); | 967 | let remove_title = crate::i18n::take_off_this_task(lang, &person.display_name); |
| 963 | view! { | 968 | view! { |
| 964 | cx => | 969 | cx => |
| 965 | - <span class="assignee-chip" title=(person.display_name.clone())> | 970 | + <span class="assignee-chip"> |
| 966 | (avatar(cx, person, "avatar-sm").await?) | 971 | (avatar(cx, person, "avatar-sm").await?) |
| 967 | <span class="assignee-name">(person.display_name.clone())</span> | 972 | <span class="assignee-name">(person.display_name.clone())</span> |
| 968 | if may_write { | 973 | if may_write { |
| @@ -988,7 +993,7 @@ async fn assignee_picker(cx: &Cx, task_id: &str, people: &[Person], lang: Lang) | |||
| 988 | <input class="edit-toggle" type="checkbox" id=(toggle.clone()) aria-label=(put_aria)> | 993 | <input class="edit-toggle" type="checkbox" id=(toggle.clone()) aria-label=(put_aria)> |
| 989 | <label class="assignee-add edit-view edit-hit" for=(toggle.clone())>(glyph::plus(cx).await?)</label> | 994 | <label class="assignee-add edit-view edit-hit" for=(toggle.clone())>(glyph::plus(cx).await?)</label> |
| 990 | <div class="edit-form pop-panel"> | 995 | <div class="edit-form pop-panel"> |
| 991 | - <div class="pop-list"> | 996 | + <div class="pop-list pop-list-scroll"> |
| 992 | for person in people { | 997 | for person in people { |
| 993 | <form class="pop-row-form" method="post" action="/api/assign"> | 998 | <form class="pop-row-form" method="post" action="/api/assign"> |
| 994 | <input type="hidden" name="task_id" value=(task_id.to_string())> | 999 | <input type="hidden" name="task_id" value=(task_id.to_string())> |
| @@ -1217,7 +1222,6 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool) -> Result | |||
| 1217 | } | 1222 | } |
| 1218 | </select> | 1223 | </select> |
| 1219 | (glyph::chevron(cx).await?) | 1224 | (glyph::chevron(cx).await?) |
| 1220 | - <button class="status-go" type="submit">(t(lang, Key::Move))</button> | ||
| 1221 | </form> | 1225 | </form> |
| 1222 | } else { | 1226 | } else { |
| 1223 | <span class="field-box"> | 1227 | <span class="field-box"> |
| @@ -1307,18 +1311,18 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool) -> Result | |||
| 1307 | for entry in &detail.comments { | 1311 | for entry in &detail.comments { |
| 1308 | (comment_row(cx, entry, zone).await?) | 1312 | (comment_row(cx, entry, zone).await?) |
| 1309 | } | 1313 | } |
| 1310 | - if may_comment { | ||
| 1311 | - <form class="comment-composer" method="post" action="/api/post_comment"> | ||
| 1312 | - <input type="hidden" name="task_id" value=(detail.id.clone())> | ||
| 1313 | - <textarea class="detail-textarea comment-input" name="body" rows="3" placeholder=(t(lang, Key::WriteAComment)) required=""></textarea> | ||
| 1314 | - <div class="comment-row"> | ||
| 1315 | - <div class="spacer"></div> | ||
| 1316 | - <button class="comment-post" type="submit">(t(lang, Key::Comment))</button> | ||
| 1317 | - </div> | ||
| 1318 | - </form> | ||
| 1319 | - (refused(cx, "post_comment", lang).await?) | ||
| 1320 | - } | ||
| 1321 | </div> | 1314 | </div> |
| 1315 | + if may_comment { | ||
| 1316 | + <form class="comment-composer" method="post" action="/api/post_comment"> | ||
| 1317 | + <input type="hidden" name="task_id" value=(detail.id.clone())> | ||
| 1318 | + <textarea class="detail-textarea comment-input" name="body" rows="3" placeholder=(t(lang, Key::WriteAComment)) required=""></textarea> | ||
| 1319 | + <div class="comment-row"> | ||
| 1320 | + <div class="spacer"></div> | ||
| 1321 | + <button class="comment-post" type="submit">(t(lang, Key::Comment))</button> | ||
| 1322 | + </div> | ||
| 1323 | + </form> | ||
| 1324 | + (refused(cx, "post_comment", lang).await?) | ||
| 1325 | + } | ||
| 1322 | </section> | 1326 | </section> |
| 1323 | 1327 | ||
| 1324 | <section class="detail-block"> | 1328 | <section class="detail-block"> |
crates/izlek-web/src/dropdown.rsmodified+2 -0
| @@ -26,6 +26,8 @@ use topcoat::view::{Unescaped, view}; | |||
| 26 | pub async fn dropdown_script(cx: &Cx) -> Result { | 26 | pub async fn dropdown_script(cx: &Cx) -> Result { |
| 27 | const JS: &str = "\ | 27 | const JS: &str = "\ |
| 28 | (function () {\ | 28 | (function () {\ |
| 29 | + if (window.__izlekDd) { return; }\ | ||
| 30 | + window.__izlekDd = true;\ | ||
| 29 | function opts(select) { return Array.prototype.slice.call(select.options); }\ | 31 | function opts(select) { return Array.prototype.slice.call(select.options); }\ |
| 30 | function closeAll() {\ | 32 | function closeAll() {\ |
| 31 | document.querySelectorAll('.dd-panel.dd-open').forEach(function (panel) {\ | 33 | document.querySelectorAll('.dd-panel.dd-open').forEach(function (panel) {\ |
crates/izlek-web/src/i18n.rsmodified+3 -0
| @@ -36,6 +36,7 @@ pub enum Key { | |||
| 36 | Title, | 36 | Title, |
| 37 | Cancel, | 37 | Cancel, |
| 38 | SomethingWentWrong, | 38 | SomethingWentWrong, |
| 39 | + BackToBoard, | ||
| 39 | NothingAtThisAddress, | 40 | NothingAtThisAddress, |
| 40 | NobodyAssignedAria, | 41 | NobodyAssignedAria, |
| 41 | NobodyAssignedTitle, | 42 | NobodyAssignedTitle, |
| @@ -305,6 +306,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 305 | (Cancel, Tr) => "Vazgeç", | 306 | (Cancel, Tr) => "Vazgeç", |
| 306 | (SomethingWentWrong, En) => "Something went wrong.", | 307 | (SomethingWentWrong, En) => "Something went wrong.", |
| 307 | (SomethingWentWrong, Tr) => "Bir şeyler ters gitti.", | 308 | (SomethingWentWrong, Tr) => "Bir şeyler ters gitti.", |
| 309 | + (BackToBoard, En) => "Back to the board", | ||
| 310 | + (BackToBoard, Tr) => "Panoya dön", | ||
| 308 | (NothingAtThisAddress, En) => "Nothing at this address.", | 311 | (NothingAtThisAddress, En) => "Nothing at this address.", |
| 309 | (NothingAtThisAddress, Tr) => "Bu adreste bir şey yok.", | 312 | (NothingAtThisAddress, Tr) => "Bu adreste bir şey yok.", |
| 310 | (NobodyAssignedAria, En) => "nobody assigned", | 313 | (NobodyAssignedAria, En) => "nobody assigned", |
crates/izlek-web/src/layout.rsmodified+51 -11
| @@ -55,12 +55,13 @@ pub async fn user_menu(cx: &Cx, display_name: &str, email: &str, role: izlek_cor | |||
| 55 | /// arrive with the swap because the redirect URL's query params rendered | 55 | /// arrive with the swap because the redirect URL's query params rendered |
| 56 | /// them server-side; `history.replaceState` keeps the address bar honest. | 56 | /// them server-side; `history.replaceState` keeps the address bar honest. |
| 57 | /// | 57 | /// |
| 58 | -/// Swapped-in nodes carry no live `<script>` (parser-inserted only) and no | 58 | +/// Swapped-in `<script>` nodes are inert (parser-inserted only), so |
| 59 | -/// topcoat hydration — the runtime walks the document once at load and | 59 | +/// `swap()` re-creates each one as a fresh element, which runs it; every |
| 60 | -/// exposes no re-hydrate entry — so every behavior on this app is a | 60 | +/// emitted script carries a one-shot `window.__izlek*` guard, so that |
| 61 | -/// document-level delegated listener that survives the swap, and the | 61 | +/// re-execution never stacks duplicate document-level listeners. There |
| 62 | -/// `izlek:wire` event re-runs the idempotent per-element enhancers | 62 | +/// is no topcoat re-hydrate entry, so per-element behavior is re-run by |
| 63 | -/// (`dropdown.rs`, the audio player) over the new nodes. | 63 | +/// the `izlek:wire` event (`dropdown.rs`, the audio player) over the new |
| 64 | +/// nodes. | ||
| 64 | /// | 65 | /// |
| 65 | /// Forms that must really navigate (sign-in/out, claim, redeem: the session | 66 | /// Forms that must really navigate (sign-in/out, claim, redeem: the session |
| 66 | /// cookie and the whole page identity change) opt out with `data-hard`. | 67 | /// cookie and the whole page identity change) opt out with `data-hard`. |
| @@ -72,23 +73,44 @@ pub async fn user_menu(cx: &Cx, display_name: &str, email: &str, role: izlek_cor | |||
| 72 | /// class the member-role select first showed: any click inside a | 73 | /// class the member-role select first showed: any click inside a |
| 73 | /// `.field-box`/`.status-form`/`.member-role` that misses the `.dd-trigger` | 74 | /// `.field-box`/`.status-form`/`.member-role` that misses the `.dd-trigger` |
| 74 | /// (label, chevron glyph, box padding) is forwarded to the trigger. | 75 | /// (label, chevron glyph, box padding) is forwarded to the trigger. |
| 76 | +/// | ||
| 77 | +/// Ordinary same-origin links get the same treatment: a delegated capture | ||
| 78 | +/// click listener — registered after the close/scrim one, and skipped when | ||
| 79 | +/// that one already `preventDefault`ed — fetches the href and swaps it in, | ||
| 80 | +/// then `history.pushState`s, so board cards and file chips no longer | ||
| 81 | +/// reload the page. Raw `/files/` byte routes, `download`/`target`/ | ||
| 82 | +/// `data-hard` links and modified clicks (ctrl/meta/shift/alt, non-left | ||
| 83 | +/// button) stay browser-native. `popstate` replays the same fetch without | ||
| 84 | +/// pushing. Fresh-URL navigations pass `swap`'s third argument to scroll | ||
| 85 | +/// to top; in-place swaps (form posts, back) keep the scroll position. | ||
| 86 | +/// `wire()` also pins every `.comment-list` to its bottom, on initial | ||
| 87 | +/// load (DOMContentLoaded) included. | ||
| 75 | pub async fn soft_nav_script(cx: &Cx) -> Result { | 88 | pub async fn soft_nav_script(cx: &Cx) -> Result { |
| 76 | const JS: &str = "\ | 89 | const JS: &str = "\ |
| 77 | (function () { \ | 90 | (function () { \ |
| 78 | if (window.__izlekSoft) { return; } \ | 91 | if (window.__izlekSoft) { return; } \ |
| 79 | window.__izlekSoft = true; \ | 92 | window.__izlekSoft = true; \ |
| 80 | - function wire() { document.dispatchEvent(new Event('izlek:wire')); } \ | 93 | + function wire() { \ |
| 81 | - function swap(html, url) { \ | 94 | + document.querySelectorAll('.comment-list').forEach(function (list) { list.scrollTop = list.scrollHeight; }); \ |
| 95 | + document.dispatchEvent(new Event('izlek:wire')); \ | ||
| 96 | + } \ | ||
| 97 | + function swap(html, url, fresh) { \ | ||
| 82 | var doc = new DOMParser().parseFromString(html, 'text/html'); \ | 98 | var doc = new DOMParser().parseFromString(html, 'text/html'); \ |
| 83 | var x = window.scrollX, y = window.scrollY; \ | 99 | var x = window.scrollX, y = window.scrollY; \ |
| 84 | document.body.replaceChildren(); \ | 100 | document.body.replaceChildren(); \ |
| 85 | while (doc.body.firstChild) { document.body.appendChild(doc.body.firstChild); } \ | 101 | while (doc.body.firstChild) { document.body.appendChild(doc.body.firstChild); } \ |
| 102 | + document.body.querySelectorAll('script').forEach(function (old) { \ | ||
| 103 | + var live = document.createElement('script'); \ | ||
| 104 | + if (old.hasAttribute('src')) { live.setAttribute('src', old.getAttribute('src')); } \ | ||
| 105 | + live.textContent = old.textContent; \ | ||
| 106 | + old.replaceWith(live); \ | ||
| 107 | + }); \ | ||
| 86 | var root = doc.documentElement; \ | 108 | var root = doc.documentElement; \ |
| 87 | if (root.getAttribute('lang')) { document.documentElement.setAttribute('lang', root.getAttribute('lang')); } \ | 109 | if (root.getAttribute('lang')) { document.documentElement.setAttribute('lang', root.getAttribute('lang')); } \ |
| 88 | if (root.hasAttribute('data-theme')) { document.documentElement.setAttribute('data-theme', root.getAttribute('data-theme')); } \ | 110 | if (root.hasAttribute('data-theme')) { document.documentElement.setAttribute('data-theme', root.getAttribute('data-theme')); } \ |
| 89 | else { document.documentElement.removeAttribute('data-theme'); } \ | 111 | else { document.documentElement.removeAttribute('data-theme'); } \ |
| 90 | if (url) { history.replaceState(null, '', url); } \ | 112 | if (url) { history.replaceState(null, '', url); } \ |
| 91 | - window.scrollTo(x, y); \ | 113 | + window.scrollTo(fresh ? 0 : x, fresh ? 0 : y); \ |
| 92 | wire(); \ | 114 | wire(); \ |
| 93 | } \ | 115 | } \ |
| 94 | function sweepPanels() { \ | 116 | function sweepPanels() { \ |
| @@ -177,6 +199,19 @@ pub async fn soft_nav_script(cx: &Cx) -> Result { | |||
| 177 | else { window.__izlekCloseModal(); } \ | 199 | else { window.__izlekCloseModal(); } \ |
| 178 | } \ | 200 | } \ |
| 179 | }, true); \ | 201 | }, true); \ |
| 202 | + window.addEventListener('popstate', function () { window.__izlekGo(window.location.href); }); \ | ||
| 203 | + document.addEventListener('click', function (e) { \ | ||
| 204 | + if (e.defaultPrevented || e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) { return; } \ | ||
| 205 | + var link = e.target.closest ? e.target.closest('a') : null; \ | ||
| 206 | + if (!link || link.hasAttribute('download') || link.hasAttribute('target') || link.hasAttribute('data-hard')) { return; } \ | ||
| 207 | + var href = link.getAttribute('href'); \ | ||
| 208 | + if (!href || href.charAt(0) !== '/' || href.indexOf('/files/') === 0) { return; } \ | ||
| 209 | + e.preventDefault(); \ | ||
| 210 | + fetch(href).then( \ | ||
| 211 | + function (r) { return r.text().then(function (t) { swap(t, null, true); history.pushState(null, '', r.url); }); }, \ | ||
| 212 | + function () { window.location.href = href; } \ | ||
| 213 | + ); \ | ||
| 214 | + }, true); \ | ||
| 180 | document.addEventListener('click', function (e) { \ | 215 | document.addEventListener('click', function (e) { \ |
| 181 | if (e.target.closest && e.target.closest('.dd-trigger, .dd-panel, button, a, input, select, textarea')) { return; } \ | 216 | if (e.target.closest && e.target.closest('.dd-trigger, .dd-panel, button, a, input, select, textarea')) { return; } \ |
| 182 | var box = e.target.closest ? e.target.closest('.field-box, .status-form, .member-role') : null; \ | 217 | var box = e.target.closest ? e.target.closest('.field-box, .status-form, .member-role') : null; \ |
| @@ -184,6 +219,7 @@ pub async fn soft_nav_script(cx: &Cx) -> Result { | |||
| 184 | var trigger = box.querySelector('.dd-trigger'); \ | 219 | var trigger = box.querySelector('.dd-trigger'); \ |
| 185 | if (trigger) { e.stopImmediatePropagation(); trigger.click(); } \ | 220 | if (trigger) { e.stopImmediatePropagation(); trigger.click(); } \ |
| 186 | }); \ | 221 | }); \ |
| 222 | + if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', wire); } else { wire(); } \ | ||
| 187 | })();"; | 223 | })();"; |
| 188 | view! { cx => <script>(Unescaped::new_unchecked(JS))</script> } | 224 | view! { cx => <script>(Unescaped::new_unchecked(JS))</script> } |
| 189 | } | 225 | } |
| @@ -201,6 +237,9 @@ pub async fn soft_nav_script(cx: &Cx) -> Result { | |||
| 201 | /// wins over board's other popups). | 237 | /// wins over board's other popups). |
| 202 | pub async fn escape_script(cx: &Cx) -> Result { | 238 | pub async fn escape_script(cx: &Cx) -> Result { |
| 203 | const JS: &str = "\ | 239 | const JS: &str = "\ |
| 240 | + (function () { \ | ||
| 241 | + if (window.__izlekEscTop) { return; } \ | ||
| 242 | + window.__izlekEscTop = true; \ | ||
| 204 | document.addEventListener('keydown', function (e) { \ | 243 | document.addEventListener('keydown', function (e) { \ |
| 205 | if (e.key !== 'Escape') { return; } \ | 244 | if (e.key !== 'Escape') { return; } \ |
| 206 | var menu = document.querySelector('.user-menu'); \ | 245 | var menu = document.querySelector('.user-menu'); \ |
| @@ -222,7 +261,8 @@ pub async fn escape_script(cx: &Cx) -> Result { | |||
| 222 | document.addEventListener('mouseenter', function (e) { \ | 261 | document.addEventListener('mouseenter', function (e) { \ |
| 223 | var menu = e.target.closest ? e.target.closest('.user-menu') : null; \ | 262 | var menu = e.target.closest ? e.target.closest('.user-menu') : null; \ |
| 224 | if (menu) { menu.classList.remove('user-menu-esc'); } \ | 263 | if (menu) { menu.classList.remove('user-menu-esc'); } \ |
| 225 | - }, true);"; | 264 | + }, true); \ |
| 265 | + })();"; | ||
| 226 | view! { cx => <script>(Unescaped::new_unchecked(JS))</script> } | 266 | view! { cx => <script>(Unescaped::new_unchecked(JS))</script> } |
| 227 | } | 267 | } |
| 228 | 268 | ||
| @@ -269,7 +309,7 @@ async fn root_layout(cx: &Cx, slot: Result) -> Result { | |||
| 269 | <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin=""> | 309 | <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin=""> |
| 270 | <link | 310 | <link |
| 271 | rel="stylesheet" | 311 | rel="stylesheet" |
| 272 | - href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap" | 312 | + href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&display=swap" |
| 273 | > | 313 | > |
| 274 | <title>"Izlek"</title> | 314 | <title>"Izlek"</title> |
| 275 | <link rel="stylesheet" href=(STYLE)> | 315 | <link rel="stylesheet" href=(STYLE)> |
crates/izlek-web/src/logs.rsmodified+6 -5
| @@ -353,6 +353,7 @@ async fn current_logs(cx: &Cx) -> Result<Json<std::result::Result<LogsSnapshot, | |||
| 353 | 353 | ||
| 354 | #[page("/logs")] | 354 | #[page("/logs")] |
| 355 | async fn logs_page(cx: &Cx) -> Result { | 355 | async fn logs_page(cx: &Cx) -> Result { |
| 356 | + let lang = Lang::En; | ||
| 356 | match snapshot(cx).await { | 357 | match snapshot(cx).await { |
| 357 | Ok(Ok(snapshot)) => logs_screen(cx, snapshot).await, | 358 | Ok(Ok(snapshot)) => logs_screen(cx, snapshot).await, |
| 358 | // No `Me` here to read a language off of when the refusal itself is | 359 | // No `Me` here to read a language off of when the refusal itself is |
| @@ -361,13 +362,13 @@ async fn logs_page(cx: &Cx) -> Result { | |||
| 361 | cx => | 362 | cx => |
| 362 | <main class="scaffold-note"> | 363 | <main class="scaffold-note"> |
| 363 | <p>(refusal.message())</p> | 364 | <p>(refusal.message())</p> |
| 364 | - <p><a href="/">"Back to the board"</a></p> | 365 | + <p><a href="/">(t(lang, Key::BackToBoard))</a></p> |
| 365 | </main> | 366 | </main> |
| 366 | }, | 367 | }, |
| 367 | Err(_) => view! { | 368 | Err(_) => view! { |
| 368 | cx => | 369 | cx => |
| 369 | <main class="scaffold-note"> | 370 | <main class="scaffold-note"> |
| 370 | - <p>"Something went wrong."</p> | 371 | + <p>(t(lang, Key::SomethingWentWrong))</p> |
| 371 | </main> | 372 | </main> |
| 372 | }, | 373 | }, |
| 373 | } | 374 | } |
| @@ -415,7 +416,7 @@ async fn logs_screen(cx: &Cx, snapshot: LogsSnapshot) -> Result { | |||
| 415 | <h2 class="panel-title">(t(lang, Key::MailQueue))</h2> | 416 | <h2 class="panel-title">(t(lang, Key::MailQueue))</h2> |
| 416 | </div> | 417 | </div> |
| 417 | <div class="panel-body"> | 418 | <div class="panel-body"> |
| 418 | - <div class="rule-list"> | 419 | + <div class="rule-list rule-list-scroll"> |
| 419 | for line in queue { | 420 | for line in queue { |
| 420 | let is_failed_or_held = line.state_kind == "failed" || line.state_kind == "held"; | 421 | let is_failed_or_held = line.state_kind == "failed" || line.state_kind == "held"; |
| 421 | let state_note = if is_failed_or_held { | 422 | let state_note = if is_failed_or_held { |
| @@ -447,7 +448,7 @@ async fn logs_screen(cx: &Cx, snapshot: LogsSnapshot) -> Result { | |||
| 447 | <h2 class="panel-title">(t(lang, Key::MailDecisions))</h2> | 448 | <h2 class="panel-title">(t(lang, Key::MailDecisions))</h2> |
| 448 | </div> | 449 | </div> |
| 449 | <div class="panel-body"> | 450 | <div class="panel-body"> |
| 450 | - <div class="rule-list"> | 451 | + <div class="rule-list rule-list-scroll"> |
| 451 | for group in decisions { | 452 | for group in decisions { |
| 452 | let header = match group.happened { | 453 | let header = match group.happened { |
| 453 | Some(happened) => format!("{} · {}", group.task, happened), | 454 | Some(happened) => format!("{} · {}", group.task, happened), |
| @@ -482,7 +483,7 @@ async fn logs_screen(cx: &Cx, snapshot: LogsSnapshot) -> Result { | |||
| 482 | <h2 class="panel-title">(t(lang, Key::Activity))</h2> | 483 | <h2 class="panel-title">(t(lang, Key::Activity))</h2> |
| 483 | </div> | 484 | </div> |
| 484 | <div class="panel-body"> | 485 | <div class="panel-body"> |
| 485 | - <div class="rule-list"> | 486 | + <div class="rule-list rule-list-scroll"> |
| 486 | for line in activity { | 487 | for line in activity { |
| 487 | <div class="rule-row"> | 488 | <div class="rule-row"> |
| 488 | <div class="rule-sentence"> | 489 | <div class="rule-sentence"> |
crates/izlek-web/src/rules.rsmodified+3 -2
| @@ -687,7 +687,7 @@ async fn rules_page(cx: &Cx) -> Result { | |||
| 687 | return view! { | 687 | return view! { |
| 688 | <main class="scaffold-note"> | 688 | <main class="scaffold-note"> |
| 689 | <p>(refusal.message())</p> | 689 | <p>(refusal.message())</p> |
| 690 | - <p><a href="/">"Back to the board"</a></p> | 690 | + <p><a href="/">(t(Lang::En, Key::BackToBoard))</a></p> |
| 691 | </main> | 691 | </main> |
| 692 | }; | 692 | }; |
| 693 | } | 693 | } |
| @@ -700,7 +700,7 @@ async fn rules_page(cx: &Cx) -> Result { | |||
| 700 | return view! { | 700 | return view! { |
| 701 | <main class="scaffold-note"> | 701 | <main class="scaffold-note"> |
| 702 | <p>(refusal.message_in(lang))</p> | 702 | <p>(refusal.message_in(lang))</p> |
| 703 | - <p><a href="/">"Back to the board"</a></p> | 703 | + <p><a href="/">(t(lang, Key::BackToBoard))</a></p> |
| 704 | </main> | 704 | </main> |
| 705 | }; | 705 | }; |
| 706 | } | 706 | } |
| @@ -738,6 +738,7 @@ async fn rules_page(cx: &Cx) -> Result { | |||
| 738 | if !snapshot.sender_connected { | 738 | if !snapshot.sender_connected { |
| 739 | <p class="rules-quiet"> | 739 | <p class="rules-quiet"> |
| 740 | (t(lang, Key::NoSenderConnectedPrefix)) | 740 | (t(lang, Key::NoSenderConnectedPrefix)) |
| 741 | + (" ") | ||
| 741 | <a href="/settings">(t(lang, Key::NavSettings))</a> | 742 | <a href="/settings">(t(lang, Key::NavSettings))</a> |
| 742 | </p> | 743 | </p> |
| 743 | } | 744 | } |
crates/izlek-web/src/settings.rsmodified+1 -1
| @@ -741,7 +741,7 @@ async fn settings_page(cx: &Cx) -> Result { | |||
| 741 | cx => | 741 | cx => |
| 742 | <main class="scaffold-note"> | 742 | <main class="scaffold-note"> |
| 743 | <p>(refusal.message())</p> | 743 | <p>(refusal.message())</p> |
| 744 | - <p><a href="/">"Back to the board"</a></p> | 744 | + <p><a href="/">(t(Lang::En, Key::BackToBoard))</a></p> |
| 745 | </main> | 745 | </main> |
| 746 | }; | 746 | }; |
| 747 | } | 747 | } |
style/main.scssmodified+123 -134
| @@ -7,7 +7,7 @@ | |||
| 7 | --border-strong: #e0ddd4; | 7 | --border-strong: #e0ddd4; |
| 8 | --ink: #1c1b18; | 8 | --ink: #1c1b18; |
| 9 | --muted: #6f6b63; | 9 | --muted: #6f6b63; |
| 10 | - --muted-soft: #8a8578; | 10 | + --muted-soft: #726d61; |
| 11 | --accent: #46557b; | 11 | --accent: #46557b; |
| 12 | --accent-tint: #eef0f5; | 12 | --accent-tint: #eef0f5; |
| 13 | --accent-ink: #2f3c5c; | 13 | --accent-ink: #2f3c5c; |
| @@ -19,9 +19,7 @@ | |||
| 19 | --row-hover: #f3f1ea; | 19 | --row-hover: #f3f1ea; |
| 20 | --panel-sunken: #f2f0ea; | 20 | --panel-sunken: #f2f0ea; |
| 21 | --border-soft: #d5d1c7; | 21 | --border-soft: #d5d1c7; |
| 22 | - --border-faint: #f0eee7; | ||
| 23 | --scrim: rgba(28, 27, 24, 0.46); | 22 | --scrim: rgba(28, 27, 24, 0.46); |
| 24 | - --on-strong: #fffefb; | ||
| 25 | 23 | ||
| 26 | --danger: #a04a24; | 24 | --danger: #a04a24; |
| 27 | --danger-tint: #f9ece4; | 25 | --danger-tint: #f9ece4; |
| @@ -53,7 +51,7 @@ | |||
| 53 | --violet-border: #ddc4ec; | 51 | --violet-border: #ddc4ec; |
| 54 | --violet-ink: #6a3f82; | 52 | --violet-ink: #6a3f82; |
| 55 | 53 | ||
| 56 | - --font-sans: 'Inter', system-ui, sans-serif; | 54 | + --font-sans: system-ui, sans-serif; |
| 57 | --font-mono: 'IBM Plex Mono', ui-monospace, monospace; | 55 | --font-mono: 'IBM Plex Mono', ui-monospace, monospace; |
| 58 | 56 | ||
| 59 | --radius: 6px; | 57 | --radius: 6px; |
| @@ -81,7 +79,7 @@ | |||
| 81 | --border-strong: #30363d; | 79 | --border-strong: #30363d; |
| 82 | --ink: #e6edf3; | 80 | --ink: #e6edf3; |
| 83 | --muted: #8b949e; | 81 | --muted: #8b949e; |
| 84 | - --muted-soft: #6e7681; | 82 | + --muted-soft: #8b949e; |
| 85 | --accent: #8b9dd9; | 83 | --accent: #8b9dd9; |
| 86 | --accent-tint: #1c2c4f; | 84 | --accent-tint: #1c2c4f; |
| 87 | --accent-ink: #b7c4e8; | 85 | --accent-ink: #b7c4e8; |
| @@ -93,11 +91,9 @@ | |||
| 93 | --row-hover: #1c2129; | 91 | --row-hover: #1c2129; |
| 94 | --panel-sunken: #141920; | 92 | --panel-sunken: #141920; |
| 95 | --border-soft: #1d232b; | 93 | --border-soft: #1d232b; |
| 96 | - --border-faint: #191f26; | ||
| 97 | --scrim: rgba(0, 0, 0, 0.75); | 94 | --scrim: rgba(0, 0, 0, 0.75); |
| 98 | - --on-strong: #f0f6fc; | ||
| 99 | 95 | ||
| 100 | - --danger: #b35449; | 96 | + --danger: #d97b6e; |
| 101 | --danger-tint: #3a1a13; | 97 | --danger-tint: #3a1a13; |
| 102 | --danger-tint-soft: #2c221f; | 98 | --danger-tint-soft: #2c221f; |
| 103 | --danger-tint-alt: #1d1113; | 99 | --danger-tint-alt: #1d1113; |
| @@ -270,28 +266,6 @@ a { | |||
| 270 | color: var(--muted-soft); | 266 | color: var(--muted-soft); |
| 271 | } | 267 | } |
| 272 | 268 | ||
| 273 | -.auth-input { | ||
| 274 | - height: 40px; | ||
| 275 | - padding: 0 12px; | ||
| 276 | - background: var(--field-bg); | ||
| 277 | - border: 1px solid var(--border-strong); | ||
| 278 | - border-radius: var(--radius); | ||
| 279 | - font-family: var(--font-sans); | ||
| 280 | - font-size: 13px; | ||
| 281 | - color: var(--ink); | ||
| 282 | - | ||
| 283 | - &:focus-visible { | ||
| 284 | - outline: 2px solid var(--accent); | ||
| 285 | - outline-offset: 1px; | ||
| 286 | - background: var(--surface); | ||
| 287 | - border-color: var(--accent); | ||
| 288 | - } | ||
| 289 | -} | ||
| 290 | - | ||
| 291 | -.auth-input-mono { | ||
| 292 | - font-family: var(--font-mono); | ||
| 293 | -} | ||
| 294 | - | ||
| 295 | // The address an invited member signs in as: shown, never edited. | 269 | // The address an invited member signs in as: shown, never edited. |
| 296 | .auth-locked { | 270 | .auth-locked { |
| 297 | display: flex; | 271 | display: flex; |
| @@ -356,11 +330,6 @@ a { | |||
| 356 | 330 | ||
| 357 | .spacer { flex-grow: 1; } | 331 | .spacer { flex-grow: 1; } |
| 358 | 332 | ||
| 359 | -.board-name { | ||
| 360 | - font-size: 13px; | ||
| 361 | - font-weight: 600; | ||
| 362 | -} | ||
| 363 | - | ||
| 364 | .user-menu { position: relative; } | 333 | .user-menu { position: relative; } |
| 365 | 334 | ||
| 366 | .user-menu-trigger { | 335 | .user-menu-trigger { |
| @@ -392,6 +361,7 @@ a { | |||
| 392 | visibility: hidden; | 361 | visibility: hidden; |
| 393 | opacity: 0; | 362 | opacity: 0; |
| 394 | pointer-events: none; | 363 | pointer-events: none; |
| 364 | + transition: opacity var(--dur-fast) var(--ease), visibility var(--dur-fast) var(--ease); | ||
| 395 | } | 365 | } |
| 396 | 366 | ||
| 397 | .user-menu:hover .user-menu-panel, | 367 | .user-menu:hover .user-menu-panel, |
| @@ -442,7 +412,7 @@ a { | |||
| 442 | text-decoration: none; | 412 | text-decoration: none; |
| 443 | text-align: left; | 413 | text-align: left; |
| 444 | cursor: pointer; | 414 | cursor: pointer; |
| 445 | - transition: background-color, color var(--dur-fast) var(--ease); | 415 | + transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); |
| 446 | 416 | ||
| 447 | &:hover { background: var(--row-hover); color: var(--ink); } | 417 | &:hover { background: var(--row-hover); color: var(--ink); } |
| 448 | } | 418 | } |
| @@ -469,25 +439,6 @@ a { | |||
| 469 | gap: 2px; | 439 | gap: 2px; |
| 470 | } | 440 | } |
| 471 | 441 | ||
| 472 | -.segment { | ||
| 473 | - font-family: inherit; | ||
| 474 | - font-size: 13px; | ||
| 475 | - font-weight: 500; | ||
| 476 | - color: var(--muted); | ||
| 477 | - background: transparent; | ||
| 478 | - border: none; | ||
| 479 | - padding: 4px 12px; | ||
| 480 | - border-radius: var(--radius-sm); | ||
| 481 | - cursor: pointer; | ||
| 482 | -} | ||
| 483 | - | ||
| 484 | -.segment-on { | ||
| 485 | - font-weight: 600; | ||
| 486 | - color: var(--ink); | ||
| 487 | - background: var(--surface); | ||
| 488 | - box-shadow: var(--shadow-1); | ||
| 489 | -} | ||
| 490 | - | ||
| 491 | .chip { | 442 | .chip { |
| 492 | display: flex; | 443 | display: flex; |
| 493 | align-items: center; | 444 | align-items: center; |
| @@ -499,13 +450,11 @@ a { | |||
| 499 | 450 | ||
| 500 | &-overdue { | 451 | &-overdue { |
| 501 | background: var(--danger-tint); | 452 | background: var(--danger-tint); |
| 502 | - border: 1px solid var(--danger-border-alt); | ||
| 503 | color: var(--danger); | 453 | color: var(--danger); |
| 504 | } | 454 | } |
| 505 | 455 | ||
| 506 | &-blocked { | 456 | &-blocked { |
| 507 | background: var(--warn-tint); | 457 | background: var(--warn-tint); |
| 508 | - border: 1px solid var(--warn-border); | ||
| 509 | color: var(--warn-ink); | 458 | color: var(--warn-ink); |
| 510 | } | 459 | } |
| 511 | 460 | ||
| @@ -516,10 +465,10 @@ a { | |||
| 516 | text-transform: capitalize; | 465 | text-transform: capitalize; |
| 517 | } | 466 | } |
| 518 | 467 | ||
| 519 | - &-role { background: var(--accent-tint); border: 1px solid var(--accent-border); color: var(--accent-ink); } | 468 | + &-role { background: var(--surface-sunken); border: 1px solid var(--border-strong); color: var(--ink-soft); } |
| 520 | &-admin { background: var(--panel-sunken); border: 1px solid var(--border-strong); color: var(--muted); } | 469 | &-admin { background: var(--panel-sunken); border: 1px solid var(--border-strong); color: var(--muted); } |
| 521 | - &-connected { background: var(--positive-tint); border: 1px solid var(--positive-border); color: var(--positive-ink); } | 470 | + &-connected { background: var(--positive-tint); color: var(--positive-ink); } |
| 522 | - &-off { background: var(--warn-tint); border: 1px solid var(--warn-border); color: var(--warn-ink); } | 471 | + &-off { background: var(--warn-tint); color: var(--warn-ink); } |
| 523 | } | 472 | } |
| 524 | 473 | ||
| 525 | .board-stage { | 474 | .board-stage { |
| @@ -690,6 +639,12 @@ a { | |||
| 690 | .avatars { | 639 | .avatars { |
| 691 | display: flex; | 640 | display: flex; |
| 692 | align-items: center; | 641 | align-items: center; |
| 642 | + min-width: 0; | ||
| 643 | + overflow: hidden; | ||
| 644 | + | ||
| 645 | + // The data-name tooltip pokes above the row; hovering drops the clip so it | ||
| 646 | + // is not cut off by the overlap truncation. | ||
| 647 | + &:has(.avatar:hover) { overflow: visible; } | ||
| 693 | } | 648 | } |
| 694 | 649 | ||
| 695 | .avatar { | 650 | .avatar { |
| @@ -703,6 +658,7 @@ a { | |||
| 703 | display: flex; | 658 | display: flex; |
| 704 | align-items: center; | 659 | align-items: center; |
| 705 | justify-content: center; | 660 | justify-content: center; |
| 661 | + position: relative; | ||
| 706 | 662 | ||
| 707 | & + & { margin-left: -8px; } | 663 | & + & { margin-left: -8px; } |
| 708 | 664 | ||
| @@ -729,6 +685,26 @@ a { | |||
| 729 | flex: none; | 685 | flex: none; |
| 730 | } | 686 | } |
| 731 | 687 | ||
| 688 | + // A bare avatar carries `data-name`; hovering raises a house tooltip in | ||
| 689 | + // place of the native `title`. | ||
| 690 | + &[data-name]:hover::after { | ||
| 691 | + content: attr(data-name); | ||
| 692 | + position: absolute; | ||
| 693 | + bottom: calc(100% + 6px); | ||
| 694 | + left: 50%; | ||
| 695 | + transform: translateX(-50%); | ||
| 696 | + background: var(--surface); | ||
| 697 | + border: 1px solid var(--border); | ||
| 698 | + border-radius: var(--radius-sm); | ||
| 699 | + padding: 3px 8px; | ||
| 700 | + font-size: 11px; | ||
| 701 | + color: var(--ink-soft); | ||
| 702 | + box-shadow: var(--shadow-2); | ||
| 703 | + white-space: nowrap; | ||
| 704 | + z-index: 30; | ||
| 705 | + pointer-events: none; | ||
| 706 | + } | ||
| 707 | + | ||
| 732 | &-tone-0 { background: var(--accent); } | 708 | &-tone-0 { background: var(--accent); } |
| 733 | &-tone-1 { background: var(--avatar-tone-1); } | 709 | &-tone-1 { background: var(--avatar-tone-1); } |
| 734 | &-tone-2 { background: var(--positive); } | 710 | &-tone-2 { background: var(--positive); } |
| @@ -792,6 +768,8 @@ a { | |||
| 792 | .modal { | 768 | .modal { |
| 793 | width: 780px; | 769 | width: 780px; |
| 794 | max-width: 100%; | 770 | max-width: 100%; |
| 771 | + max-height: calc(100vh - 96px); | ||
| 772 | + overflow-y: auto; | ||
| 795 | background: var(--surface); | 773 | background: var(--surface); |
| 796 | border: 1px solid var(--border); | 774 | border: 1px solid var(--border); |
| 797 | border-radius: var(--radius-lg); | 775 | border-radius: var(--radius-lg); |
| @@ -932,13 +910,6 @@ a { | |||
| 932 | margin-top: 20px; | 910 | margin-top: 20px; |
| 933 | } | 911 | } |
| 934 | 912 | ||
| 935 | -.new-task-date { | ||
| 936 | - border: none; | ||
| 937 | - background: transparent; | ||
| 938 | - font-family: inherit; | ||
| 939 | - color: inherit; | ||
| 940 | -} | ||
| 941 | - | ||
| 942 | .new-task-foot { | 913 | .new-task-foot { |
| 943 | display: flex; | 914 | display: flex; |
| 944 | align-items: center; | 915 | align-items: center; |
| @@ -981,16 +952,20 @@ a { | |||
| 981 | margin-top: 8px; | 952 | margin-top: 8px; |
| 982 | } | 953 | } |
| 983 | 954 | ||
| 984 | -.edit-save { | 955 | +.edit-save, |
| 956 | +.comment-post { | ||
| 985 | height: 28px; | 957 | height: 28px; |
| 986 | padding: 0 12px; | 958 | padding: 0 12px; |
| 987 | border: none; | 959 | border: none; |
| 988 | border-radius: var(--radius); | 960 | border-radius: var(--radius); |
| 989 | - background: var(--ink); | 961 | + background: var(--accent); |
| 990 | color: var(--surface); | 962 | color: var(--surface); |
| 991 | font-family: inherit; | 963 | font-family: inherit; |
| 992 | font-size: 12px; | 964 | font-size: 12px; |
| 993 | cursor: pointer; | 965 | cursor: pointer; |
| 966 | + transition: background var(--dur-fast) var(--ease); | ||
| 967 | + | ||
| 968 | + &:hover { background: var(--accent-strong); } | ||
| 994 | 969 | ||
| 995 | &:disabled { opacity: 0.5; cursor: default; } | 970 | &:disabled { opacity: 0.5; cursor: default; } |
| 996 | } | 971 | } |
| @@ -999,6 +974,9 @@ a { | |||
| 999 | font-size: 12px; | 974 | font-size: 12px; |
| 1000 | color: var(--muted); | 975 | color: var(--muted); |
| 1001 | cursor: pointer; | 976 | cursor: pointer; |
| 977 | + transition: color var(--dur-fast) var(--ease); | ||
| 978 | + | ||
| 979 | + &:hover { color: var(--ink); } | ||
| 1002 | } | 980 | } |
| 1003 | 981 | ||
| 1004 | // A popover is the same machinery, floated. | 982 | // A popover is the same machinery, floated. |
| @@ -1045,7 +1023,7 @@ a { | |||
| 1045 | border-radius: var(--radius-sm); | 1023 | border-radius: var(--radius-sm); |
| 1046 | background: transparent; | 1024 | background: transparent; |
| 1047 | font-family: inherit; | 1025 | font-family: inherit; |
| 1048 | - font-size: 12px; | 1026 | + font-size: 13px; |
| 1049 | color: var(--ink); | 1027 | color: var(--ink); |
| 1050 | text-align: left; | 1028 | text-align: left; |
| 1051 | text-decoration: none; | 1029 | text-decoration: none; |
| @@ -1189,7 +1167,7 @@ a { | |||
| 1189 | .detail-label { | 1167 | .detail-label { |
| 1190 | font-family: var(--font-mono); | 1168 | font-family: var(--font-mono); |
| 1191 | font-size: 10px; | 1169 | font-size: 10px; |
| 1192 | - letter-spacing: 0.06em; | 1170 | + letter-spacing: 0.08em; |
| 1193 | color: var(--muted-soft); | 1171 | color: var(--muted-soft); |
| 1194 | } | 1172 | } |
| 1195 | 1173 | ||
| @@ -1202,7 +1180,8 @@ a { | |||
| 1202 | 1180 | ||
| 1203 | // Every value in the field row wears the same box, so a `<select>`, a label | 1181 | // Every value in the field row wears the same box, so a `<select>`, a label |
| 1204 | // and a plain span all line up at 36px. | 1182 | // and a plain span all line up at 36px. |
| 1205 | -.field-box { | 1183 | +.field-box, |
| 1184 | +.status-form { | ||
| 1206 | display: flex; | 1185 | display: flex; |
| 1207 | align-items: center; | 1186 | align-items: center; |
| 1208 | gap: 8px; | 1187 | gap: 8px; |
| @@ -1216,6 +1195,12 @@ a { | |||
| 1216 | cursor: pointer; | 1195 | cursor: pointer; |
| 1217 | } | 1196 | } |
| 1218 | 1197 | ||
| 1198 | +.field-box { | ||
| 1199 | + font-size: 13px; | ||
| 1200 | + color: var(--ink); | ||
| 1201 | + cursor: pointer; | ||
| 1202 | +} | ||
| 1203 | + | ||
| 1219 | .field-text { | 1204 | .field-text { |
| 1220 | flex: 1; | 1205 | flex: 1; |
| 1221 | min-width: 0; | 1206 | min-width: 0; |
| @@ -1240,17 +1225,6 @@ a { | |||
| 1240 | color: var(--muted-soft); | 1225 | color: var(--muted-soft); |
| 1241 | } | 1226 | } |
| 1242 | 1227 | ||
| 1243 | -.status-form { | ||
| 1244 | - display: flex; | ||
| 1245 | - align-items: center; | ||
| 1246 | - gap: 8px; | ||
| 1247 | - height: 36px; | ||
| 1248 | - padding: 0 10px; | ||
| 1249 | - background: var(--field-bg); | ||
| 1250 | - border: 1px solid var(--border-strong); | ||
| 1251 | - border-radius: var(--radius); | ||
| 1252 | -} | ||
| 1253 | - | ||
| 1254 | .status-dot { | 1228 | .status-dot { |
| 1255 | flex: none; | 1229 | flex: none; |
| 1256 | width: 8px; | 1230 | width: 8px; |
| @@ -1279,18 +1253,6 @@ a { | |||
| 1279 | } | 1253 | } |
| 1280 | } | 1254 | } |
| 1281 | 1255 | ||
| 1282 | -.status-go { | ||
| 1283 | - height: 24px; | ||
| 1284 | - padding: 0 8px; | ||
| 1285 | - border: 1px solid var(--border-strong); | ||
| 1286 | - border-radius: var(--radius-sm); | ||
| 1287 | - background: var(--surface); | ||
| 1288 | - font-family: inherit; | ||
| 1289 | - font-size: 11px; | ||
| 1290 | - color: var(--muted); | ||
| 1291 | - cursor: pointer; | ||
| 1292 | -} | ||
| 1293 | - | ||
| 1294 | .detail-overdue { | 1256 | .detail-overdue { |
| 1295 | border-color: var(--danger-border); | 1257 | border-color: var(--danger-border); |
| 1296 | color: var(--danger); | 1258 | color: var(--danger); |
| @@ -1388,12 +1350,12 @@ a { | |||
| 1388 | border: none; | 1350 | border: none; |
| 1389 | background: transparent; | 1351 | background: transparent; |
| 1390 | font-family: inherit; | 1352 | font-family: inherit; |
| 1391 | - font-size: 11px; | 1353 | + font-size: 12px; |
| 1392 | - color: var(--accent); | 1354 | + color: var(--muted); |
| 1393 | cursor: pointer; | 1355 | cursor: pointer; |
| 1394 | transition: color var(--dur-fast) var(--ease); | 1356 | transition: color var(--dur-fast) var(--ease); |
| 1395 | 1357 | ||
| 1396 | - &:hover { color: var(--accent-ink); } | 1358 | + &:hover { color: var(--ink); } |
| 1397 | } | 1359 | } |
| 1398 | 1360 | ||
| 1399 | // -- assignees -------------------------------------------------------------- | 1361 | // -- assignees -------------------------------------------------------------- |
| @@ -1473,7 +1435,7 @@ a { | |||
| 1473 | border-radius: 50%; | 1435 | border-radius: 50%; |
| 1474 | color: var(--muted-soft); | 1436 | color: var(--muted-soft); |
| 1475 | cursor: pointer; | 1437 | cursor: pointer; |
| 1476 | - transition: color, border-color var(--dur-fast) var(--ease); | 1438 | + transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); |
| 1477 | 1439 | ||
| 1478 | &:hover { color: var(--ink); border-color: var(--muted-soft); } | 1440 | &:hover { color: var(--ink); border-color: var(--muted-soft); } |
| 1479 | } | 1441 | } |
| @@ -1534,7 +1496,8 @@ a { | |||
| 1534 | 1496 | ||
| 1535 | // -- dependencies ----------------------------------------------------------- | 1497 | // -- dependencies ----------------------------------------------------------- |
| 1536 | 1498 | ||
| 1537 | -.dep-chip { | 1499 | +.dep-chip, |
| 1500 | +.file-chip { | ||
| 1538 | display: inline-flex; | 1501 | display: inline-flex; |
| 1539 | align-items: center; | 1502 | align-items: center; |
| 1540 | gap: 4px; | 1503 | gap: 4px; |
| @@ -1545,6 +1508,9 @@ a { | |||
| 1545 | background: var(--surface); | 1508 | background: var(--surface); |
| 1546 | font-size: 12px; | 1509 | font-size: 12px; |
| 1547 | color: var(--muted); | 1510 | color: var(--muted); |
| 1511 | +} | ||
| 1512 | + | ||
| 1513 | +.dep-chip { | ||
| 1548 | cursor: pointer; | 1514 | cursor: pointer; |
| 1549 | transition: color var(--dur-fast) var(--ease); | 1515 | transition: color var(--dur-fast) var(--ease); |
| 1550 | 1516 | ||
| @@ -1638,19 +1604,6 @@ a { | |||
| 1638 | gap: 8px; | 1604 | gap: 8px; |
| 1639 | } | 1605 | } |
| 1640 | 1606 | ||
| 1641 | -.file-chip { | ||
| 1642 | - display: inline-flex; | ||
| 1643 | - align-items: center; | ||
| 1644 | - gap: 4px; | ||
| 1645 | - height: 24px; | ||
| 1646 | - padding: 0 8px; | ||
| 1647 | - border: 1px solid var(--border-strong); | ||
| 1648 | - border-radius: var(--radius-sm); | ||
| 1649 | - background: var(--surface); | ||
| 1650 | - font-size: 12px; | ||
| 1651 | - color: var(--muted); | ||
| 1652 | -} | ||
| 1653 | - | ||
| 1654 | .file-chip-name { | 1607 | .file-chip-name { |
| 1655 | color: inherit; | 1608 | color: inherit; |
| 1656 | text-decoration: none; | 1609 | text-decoration: none; |
| @@ -1729,6 +1682,8 @@ a { | |||
| 1729 | display: flex; | 1682 | display: flex; |
| 1730 | flex-direction: column; | 1683 | flex-direction: column; |
| 1731 | gap: 14px; | 1684 | gap: 14px; |
| 1685 | + max-height: 320px; | ||
| 1686 | + overflow-y: auto; | ||
| 1732 | } | 1687 | } |
| 1733 | 1688 | ||
| 1734 | .comment { | 1689 | .comment { |
| @@ -1772,7 +1727,7 @@ a { | |||
| 1772 | display: flex; | 1727 | display: flex; |
| 1773 | flex-direction: column; | 1728 | flex-direction: column; |
| 1774 | gap: 8px; | 1729 | gap: 8px; |
| 1775 | - margin-top: 2px; | 1730 | + margin-top: 14px; |
| 1776 | } | 1731 | } |
| 1777 | 1732 | ||
| 1778 | .comment-input { font-size: 13px; } | 1733 | .comment-input { font-size: 13px; } |
| @@ -1783,20 +1738,6 @@ a { | |||
| 1783 | gap: 8px; | 1738 | gap: 8px; |
| 1784 | } | 1739 | } |
| 1785 | 1740 | ||
| 1786 | -.comment-post { | ||
| 1787 | - height: 30px; | ||
| 1788 | - padding: 0 14px; | ||
| 1789 | - border: none; | ||
| 1790 | - border-radius: var(--radius); | ||
| 1791 | - background: var(--ink); | ||
| 1792 | - color: var(--surface); | ||
| 1793 | - font-family: inherit; | ||
| 1794 | - font-size: 12px; | ||
| 1795 | - cursor: pointer; | ||
| 1796 | - | ||
| 1797 | - &:disabled { opacity: 0.5; cursor: default; } | ||
| 1798 | -} | ||
| 1799 | - | ||
| 1800 | // -- activity --------------------------------------------------------------- | 1741 | // -- activity --------------------------------------------------------------- |
| 1801 | 1742 | ||
| 1802 | .activity-list { | 1743 | .activity-list { |
| @@ -1960,7 +1901,7 @@ a { | |||
| 1960 | font-weight: 500; | 1901 | font-weight: 500; |
| 1961 | color: var(--ink-soft); | 1902 | color: var(--ink-soft); |
| 1962 | text-decoration: none; | 1903 | text-decoration: none; |
| 1963 | - transition: background-color, color var(--dur-fast) var(--ease); | 1904 | + transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); |
| 1964 | 1905 | ||
| 1965 | &:hover { background: var(--surface-sunken); color: var(--ink); } | 1906 | &:hover { background: var(--surface-sunken); color: var(--ink); } |
| 1966 | 1907 | ||
| @@ -2093,6 +2034,7 @@ a { | |||
| 2093 | color: var(--muted-soft); | 2034 | color: var(--muted-soft); |
| 2094 | } | 2035 | } |
| 2095 | 2036 | ||
| 2037 | +.auth-input, | ||
| 2096 | .field-input { | 2038 | .field-input { |
| 2097 | height: 40px; | 2039 | height: 40px; |
| 2098 | padding: 0 12px; | 2040 | padding: 0 12px; |
| @@ -2116,6 +2058,10 @@ a { | |||
| 2116 | } | 2058 | } |
| 2117 | } | 2059 | } |
| 2118 | 2060 | ||
| 2061 | +.auth-input-mono { | ||
| 2062 | + font-family: var(--font-mono); | ||
| 2063 | +} | ||
| 2064 | + | ||
| 2119 | // A <select> wearing the field-input box still shows the browser's own | 2065 | // A <select> wearing the field-input box still shows the browser's own |
| 2120 | // arrow unless told otherwise. This draws the same chevron the rest of the | 2066 | // arrow unless told otherwise. This draws the same chevron the rest of the |
| 2121 | // app uses, so a dropdown looks like a field, not an OS control. Shared | 2067 | // app uses, so a dropdown looks like a field, not an OS control. Shared |
| @@ -2127,11 +2073,20 @@ select.field-input, | |||
| 2127 | -webkit-appearance: none; | 2073 | -webkit-appearance: none; |
| 2128 | cursor: pointer; | 2074 | cursor: pointer; |
| 2129 | padding-right: 32px; | 2075 | padding-right: 32px; |
| 2130 | - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none' stroke='%238a8578' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); | 2076 | + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none' stroke='%23726d61' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); |
| 2131 | background-repeat: no-repeat; | 2077 | background-repeat: no-repeat; |
| 2132 | background-position: right 12px center; | 2078 | background-position: right 12px center; |
| 2133 | } | 2079 | } |
| 2134 | 2080 | ||
| 2081 | +// Dark theme's lighter muted ink, baked into a second copy of the chevron: | ||
| 2082 | +// a data-URI can't read custom properties. | ||
| 2083 | +[data-theme="dark"] { | ||
| 2084 | + select.field-input, | ||
| 2085 | + .field-input.dd-trigger { | ||
| 2086 | + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none' stroke='%238b949e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); | ||
| 2087 | + } | ||
| 2088 | +} | ||
| 2089 | + | ||
| 2135 | // The browser's native option list ignores theme tokens by default — dark | 2090 | // The browser's native option list ignores theme tokens by default — dark |
| 2136 | // mode showed the OS's white/blue list until these are set explicitly. | 2091 | // mode showed the OS's white/blue list until these are set explicitly. |
| 2137 | // Belt-and-braces for any select `dropdown.rs` hasn't converted. | 2092 | // Belt-and-braces for any select `dropdown.rs` hasn't converted. |
| @@ -2149,6 +2104,11 @@ option:hover { | |||
| 2149 | background: var(--panel-sunken); | 2104 | background: var(--panel-sunken); |
| 2150 | } | 2105 | } |
| 2151 | 2106 | ||
| 2107 | +input[type="checkbox"], | ||
| 2108 | +input[type="radio"] { | ||
| 2109 | + accent-color: var(--accent); | ||
| 2110 | +} | ||
| 2111 | + | ||
| 2152 | // -- house dropdown (dropdown.rs) -------------------------------------------- | 2112 | // -- house dropdown (dropdown.rs) -------------------------------------------- |
| 2153 | // | 2113 | // |
| 2154 | // `dropdown.rs` hides the native `<select>` and portals a trigger + panel | 2114 | // `dropdown.rs` hides the native `<select>` and portals a trigger + panel |
| @@ -2247,11 +2207,34 @@ option:hover { | |||
| 2247 | font-weight: 600; | 2207 | font-weight: 600; |
| 2248 | text-decoration: none; | 2208 | text-decoration: none; |
| 2249 | cursor: pointer; | 2209 | cursor: pointer; |
| 2250 | - transition: background-color, border-color, color var(--dur-fast) var(--ease); | 2210 | + transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); |
| 2251 | 2211 | ||
| 2252 | &:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--surface); } | 2212 | &:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--surface); } |
| 2253 | } | 2213 | } |
| 2254 | 2214 | ||
| 2215 | +// Buttons wear the same keyboard-focus ring as fields. Ring only: the field | ||
| 2216 | +// recipe's background/border-color swap would invert the solid buttons — | ||
| 2217 | +// their own label is var(--surface) — into invisibility. | ||
| 2218 | +.primary:focus-visible, | ||
| 2219 | +.quiet:focus-visible, | ||
| 2220 | +.quiet-danger:focus-visible, | ||
| 2221 | +.auth-submit:focus-visible, | ||
| 2222 | +.edit-save:focus-visible, | ||
| 2223 | +.comment-post:focus-visible, | ||
| 2224 | +.detail-delete:focus-visible, | ||
| 2225 | +.datepick-nav:focus-visible, | ||
| 2226 | +.datepick-day:focus-visible, | ||
| 2227 | +.datepick-action:focus-visible, | ||
| 2228 | +.audio-play:focus-visible, | ||
| 2229 | +.rule-switch:focus-visible, | ||
| 2230 | +.assignee-add:focus-visible, | ||
| 2231 | +.pop-row:focus-visible, | ||
| 2232 | +.dd-option:focus-visible, | ||
| 2233 | +.user-menu-item:focus-visible { | ||
| 2234 | + outline: 2px solid var(--accent); | ||
| 2235 | + outline-offset: 1px; | ||
| 2236 | +} | ||
| 2237 | + | ||
| 2255 | // -- the member list -------------------------------------------------------- | 2238 | // -- the member list -------------------------------------------------------- |
| 2256 | 2239 | ||
| 2257 | .member-table { | 2240 | .member-table { |
| @@ -2330,12 +2313,12 @@ option:hover { | |||
| 2330 | border-radius: var(--radius); | 2313 | border-radius: var(--radius); |
| 2331 | font-family: var(--font-sans); | 2314 | font-family: var(--font-sans); |
| 2332 | font-size: 12px; | 2315 | font-size: 12px; |
| 2333 | - color: var(--accent); | 2316 | + color: var(--ink-soft); |
| 2334 | text-decoration: none; | 2317 | text-decoration: none; |
| 2335 | cursor: pointer; | 2318 | cursor: pointer; |
| 2336 | - transition: border-color, color var(--dur-fast) var(--ease); | 2319 | + transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); |
| 2337 | 2320 | ||
| 2338 | - &:hover { border-color: var(--accent); color: var(--accent-ink); } | 2321 | + &:hover { border-color: var(--accent); color: var(--accent); } |
| 2339 | } | 2322 | } |
| 2340 | 2323 | ||
| 2341 | // Danger modifier for a `.quiet` button — the "Delete" action in a rule row. | 2324 | // Danger modifier for a `.quiet` button — the "Delete" action in a rule row. |
| @@ -2415,6 +2398,12 @@ option:hover { | |||
| 2415 | gap: 10px; | 2398 | gap: 10px; |
| 2416 | } | 2399 | } |
| 2417 | 2400 | ||
| 2401 | +// The logs pages reuse the rules list but bound its height. | ||
| 2402 | +.rule-list-scroll { | ||
| 2403 | + max-height: 360px; | ||
| 2404 | + overflow-y: auto; | ||
| 2405 | +} | ||
| 2406 | + | ||
| 2418 | .rule-row { | 2407 | .rule-row { |
| 2419 | display: flex; | 2408 | display: flex; |
| 2420 | align-items: center; | 2409 | align-items: center; |