diff --git a/crates/izlek-web/src/board.rs b/crates/izlek-web/src/board.rs index 0d2267c..1a5ef4c 100644 --- a/crates/izlek-web/src/board.rs +++ b/crates/izlek-web/src/board.rs @@ -341,7 +341,7 @@ async fn render_card(
for person in assignees { (person) } if !has_assignees { - + }
@@ -388,6 +388,9 @@ async fn render_card( async fn card_menu_script(cx: &Cx) -> Result { use topcoat::view::Unescaped; const JS: &str = "\ + (function () { \ + if (window.__izlekCardMenu) { return; } \ + window.__izlekCardMenu = true; \ function closeCardMenus() { document.querySelectorAll('.card-menu-open').forEach(function (el) { el.classList.remove('card-menu-open'); }); } \ window.__izlekOpenCardMenu = function (e, id) { \ closeCardMenus(); \ @@ -429,7 +432,8 @@ async fn card_menu_script(cx: &Cx) -> Result { if (task && window.__izlekPost) { \ window.__izlekPost('/api/move_card', { task_id: task, from_column_id: from, to_column_id: column.id }); \ } \ - })"; + }); \ + })();"; view! { cx => } } @@ -441,10 +445,10 @@ pub(crate) async fn avatar(cx: &Cx, person: &Person, extra: &str) -> Result { .fold(0u32, |acc, b| acc.wrapping_mul(31).wrapping_add(b as u32)) % 5; let class = format!("avatar avatar-tone-{tone} {extra}"); - let title = person.display_name.clone(); + let name = person.display_name.clone(); view! { cx => - (initials) + (initials) } } diff --git a/crates/izlek-web/src/detail.rs b/crates/izlek-web/src/detail.rs index 16101c4..f28e628 100644 --- a/crates/izlek-web/src/detail.rs +++ b/crates/izlek-web/src/detail.rs @@ -538,8 +538,7 @@ async fn delete_file(cx: &Cx, Form(input): Form) -> Redirect { // `data-autosubmit` attribute (and the file input's own class), read by // `layout.rs`'s `soft_nav_script` through one delegated `change` // listener — a per-element handler would die when a soft submit swaps -// the page in — and the "Move"/"Attach" buttons stay for a browser -// without script. +// the page in. // - The modal scrim's click-to-close is `soft_nav_script`'s delegated // click listener (a click whose target is the scrim itself closes; a // 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 { let tone = person.id.bytes().fold(0u32, |acc, b| acc.wrapping_mul(31).wrapping_add(b as u32)) % 5; view! { cx => - + (initials) } @@ -690,6 +689,9 @@ async fn avatar(cx: &Cx, person: &Person, extra: &str) -> Result { async fn escape_closes(cx: &Cx) -> Result { use topcoat::view::Unescaped; const JS: &str = "\ + (function () { \ + if (window.__izlekEscModal) { return; } \ + window.__izlekEscModal = true; \ document.addEventListener('keydown', function (e) { \ if (e.key !== 'Escape') { return; } \ if (document.querySelector('.datepick-pop .edit-toggle:checked')) { return; } \ @@ -736,7 +738,8 @@ async fn escape_closes(cx: &Cx) -> Result { var edit = toggle.closest('.edit'); \ if (edit && !edit.contains(e.target)) { toggle.checked = false; } \ }); \ - }, true);"; + }, true); \ + })();"; view! { cx => } } @@ -883,6 +886,8 @@ async fn datepicker_script(cx: &Cx, lang: Lang) -> Result { let (months, weekdays) = datepicker_js_literals(lang); let js = format!( "(function() {{\ + if (window.__izlekDatepick) {{ return; }}\ + window.__izlekDatepick = true;\ var MONTHS = {months};\ var WEEKDAYS = {weekdays};\ 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, let remove_title = crate::i18n::take_off_this_task(lang, &person.display_name); view! { cx => - + (avatar(cx, person, "avatar-sm").await?) (person.display_name.clone()) if may_write { @@ -988,7 +993,7 @@ async fn assignee_picker(cx: &Cx, task_id: &str, people: &[Person], lang: Lang)
-
+
for person in people {
@@ -1217,7 +1222,6 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool) -> Result } (glyph::chevron(cx).await?) -
} else { @@ -1307,18 +1311,18 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool) -> Result for entry in &detail.comments { (comment_row(cx, entry, zone).await?) } - if may_comment { -
- - -
-
- -
-
- (refused(cx, "post_comment", lang).await?) - }
+ if may_comment { +
+ + +
+
+ +
+
+ (refused(cx, "post_comment", lang).await?) + }
diff --git a/crates/izlek-web/src/dropdown.rs b/crates/izlek-web/src/dropdown.rs index 0970a64..6046b88 100644 --- a/crates/izlek-web/src/dropdown.rs +++ b/crates/izlek-web/src/dropdown.rs @@ -26,6 +26,8 @@ use topcoat::view::{Unescaped, view}; pub async fn dropdown_script(cx: &Cx) -> Result { const JS: &str = "\ (function () {\ + if (window.__izlekDd) { return; }\ + window.__izlekDd = true;\ function opts(select) { return Array.prototype.slice.call(select.options); }\ function closeAll() {\ document.querySelectorAll('.dd-panel.dd-open').forEach(function (panel) {\ diff --git a/crates/izlek-web/src/i18n.rs b/crates/izlek-web/src/i18n.rs index a8491e9..881f105 100644 --- a/crates/izlek-web/src/i18n.rs +++ b/crates/izlek-web/src/i18n.rs @@ -36,6 +36,7 @@ pub enum Key { Title, Cancel, SomethingWentWrong, + BackToBoard, NothingAtThisAddress, NobodyAssignedAria, NobodyAssignedTitle, @@ -305,6 +306,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str { (Cancel, Tr) => "Vazgeç", (SomethingWentWrong, En) => "Something went wrong.", (SomethingWentWrong, Tr) => "Bir şeyler ters gitti.", + (BackToBoard, En) => "Back to the board", + (BackToBoard, Tr) => "Panoya dön", (NothingAtThisAddress, En) => "Nothing at this address.", (NothingAtThisAddress, Tr) => "Bu adreste bir şey yok.", (NobodyAssignedAria, En) => "nobody assigned", diff --git a/crates/izlek-web/src/layout.rs b/crates/izlek-web/src/layout.rs index 02302d3..afdb786 100644 --- a/crates/izlek-web/src/layout.rs +++ b/crates/izlek-web/src/layout.rs @@ -55,12 +55,13 @@ pub async fn user_menu(cx: &Cx, display_name: &str, email: &str, role: izlek_cor /// arrive with the swap because the redirect URL's query params rendered /// them server-side; `history.replaceState` keeps the address bar honest. /// -/// Swapped-in nodes carry no live ` } } @@ -201,6 +237,9 @@ pub async fn soft_nav_script(cx: &Cx) -> Result { /// wins over board's other popups). pub async fn escape_script(cx: &Cx) -> Result { const JS: &str = "\ + (function () { \ + if (window.__izlekEscTop) { return; } \ + window.__izlekEscTop = true; \ document.addEventListener('keydown', function (e) { \ if (e.key !== 'Escape') { return; } \ var menu = document.querySelector('.user-menu'); \ @@ -222,7 +261,8 @@ pub async fn escape_script(cx: &Cx) -> Result { document.addEventListener('mouseenter', function (e) { \ var menu = e.target.closest ? e.target.closest('.user-menu') : null; \ if (menu) { menu.classList.remove('user-menu-esc'); } \ - }, true);"; + }, true); \ + })();"; view! { cx => } } @@ -269,7 +309,7 @@ async fn root_layout(cx: &Cx, slot: Result) -> Result { "Izlek" diff --git a/crates/izlek-web/src/logs.rs b/crates/izlek-web/src/logs.rs index d7fb2b3..a2d4874 100644 --- a/crates/izlek-web/src/logs.rs +++ b/crates/izlek-web/src/logs.rs @@ -353,6 +353,7 @@ async fn current_logs(cx: &Cx) -> Result Result { + let lang = Lang::En; match snapshot(cx).await { Ok(Ok(snapshot)) => logs_screen(cx, snapshot).await, // 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 { cx =>

(refusal.message())

-

"Back to the board"

+

(t(lang, Key::BackToBoard))

}, Err(_) => view! { cx =>
-

"Something went wrong."

+

(t(lang, Key::SomethingWentWrong))

}, } @@ -415,7 +416,7 @@ async fn logs_screen(cx: &Cx, snapshot: LogsSnapshot) -> Result {

(t(lang, Key::MailQueue))

-
+
for line in queue { let is_failed_or_held = line.state_kind == "failed" || line.state_kind == "held"; let state_note = if is_failed_or_held { @@ -447,7 +448,7 @@ async fn logs_screen(cx: &Cx, snapshot: LogsSnapshot) -> Result {

(t(lang, Key::MailDecisions))

-
+
for group in decisions { let header = match group.happened { Some(happened) => format!("{} · {}", group.task, happened), @@ -482,7 +483,7 @@ async fn logs_screen(cx: &Cx, snapshot: LogsSnapshot) -> Result {

(t(lang, Key::Activity))

-
+
for line in activity {
diff --git a/crates/izlek-web/src/rules.rs b/crates/izlek-web/src/rules.rs index 7e8be5c..f8e3a3c 100644 --- a/crates/izlek-web/src/rules.rs +++ b/crates/izlek-web/src/rules.rs @@ -687,7 +687,7 @@ async fn rules_page(cx: &Cx) -> Result { return view! {

(refusal.message())

-

"Back to the board"

+

(t(Lang::En, Key::BackToBoard))

}; } @@ -700,7 +700,7 @@ async fn rules_page(cx: &Cx) -> Result { return view! {

(refusal.message_in(lang))

-

"Back to the board"

+

(t(lang, Key::BackToBoard))

}; } @@ -738,6 +738,7 @@ async fn rules_page(cx: &Cx) -> Result { if !snapshot.sender_connected {

(t(lang, Key::NoSenderConnectedPrefix)) + (" ") (t(lang, Key::NavSettings))

} diff --git a/crates/izlek-web/src/settings.rs b/crates/izlek-web/src/settings.rs index cbda593..6f11d9e 100644 --- a/crates/izlek-web/src/settings.rs +++ b/crates/izlek-web/src/settings.rs @@ -741,7 +741,7 @@ async fn settings_page(cx: &Cx) -> Result { cx =>

(refusal.message())

-

"Back to the board"

+

(t(Lang::En, Key::BackToBoard))

}; } diff --git a/style/main.scss b/style/main.scss index 9bec456..9c19d41 100644 --- a/style/main.scss +++ b/style/main.scss @@ -7,7 +7,7 @@ --border-strong: #e0ddd4; --ink: #1c1b18; --muted: #6f6b63; - --muted-soft: #8a8578; + --muted-soft: #726d61; --accent: #46557b; --accent-tint: #eef0f5; --accent-ink: #2f3c5c; @@ -19,9 +19,7 @@ --row-hover: #f3f1ea; --panel-sunken: #f2f0ea; --border-soft: #d5d1c7; - --border-faint: #f0eee7; --scrim: rgba(28, 27, 24, 0.46); - --on-strong: #fffefb; --danger: #a04a24; --danger-tint: #f9ece4; @@ -53,7 +51,7 @@ --violet-border: #ddc4ec; --violet-ink: #6a3f82; - --font-sans: 'Inter', system-ui, sans-serif; + --font-sans: system-ui, sans-serif; --font-mono: 'IBM Plex Mono', ui-monospace, monospace; --radius: 6px; @@ -81,7 +79,7 @@ --border-strong: #30363d; --ink: #e6edf3; --muted: #8b949e; - --muted-soft: #6e7681; + --muted-soft: #8b949e; --accent: #8b9dd9; --accent-tint: #1c2c4f; --accent-ink: #b7c4e8; @@ -93,11 +91,9 @@ --row-hover: #1c2129; --panel-sunken: #141920; --border-soft: #1d232b; - --border-faint: #191f26; --scrim: rgba(0, 0, 0, 0.75); - --on-strong: #f0f6fc; - --danger: #b35449; + --danger: #d97b6e; --danger-tint: #3a1a13; --danger-tint-soft: #2c221f; --danger-tint-alt: #1d1113; @@ -270,28 +266,6 @@ a { color: var(--muted-soft); } -.auth-input { - height: 40px; - padding: 0 12px; - background: var(--field-bg); - border: 1px solid var(--border-strong); - border-radius: var(--radius); - font-family: var(--font-sans); - font-size: 13px; - color: var(--ink); - - &:focus-visible { - outline: 2px solid var(--accent); - outline-offset: 1px; - background: var(--surface); - border-color: var(--accent); - } -} - -.auth-input-mono { - font-family: var(--font-mono); -} - // The address an invited member signs in as: shown, never edited. .auth-locked { display: flex; @@ -356,11 +330,6 @@ a { .spacer { flex-grow: 1; } -.board-name { - font-size: 13px; - font-weight: 600; -} - .user-menu { position: relative; } .user-menu-trigger { @@ -392,6 +361,7 @@ a { visibility: hidden; opacity: 0; pointer-events: none; + transition: opacity var(--dur-fast) var(--ease), visibility var(--dur-fast) var(--ease); } .user-menu:hover .user-menu-panel, @@ -442,7 +412,7 @@ a { text-decoration: none; text-align: left; cursor: pointer; - transition: background-color, color var(--dur-fast) var(--ease); + transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); &:hover { background: var(--row-hover); color: var(--ink); } } @@ -469,25 +439,6 @@ a { gap: 2px; } -.segment { - font-family: inherit; - font-size: 13px; - font-weight: 500; - color: var(--muted); - background: transparent; - border: none; - padding: 4px 12px; - border-radius: var(--radius-sm); - cursor: pointer; -} - -.segment-on { - font-weight: 600; - color: var(--ink); - background: var(--surface); - box-shadow: var(--shadow-1); -} - .chip { display: flex; align-items: center; @@ -499,13 +450,11 @@ a { &-overdue { background: var(--danger-tint); - border: 1px solid var(--danger-border-alt); color: var(--danger); } &-blocked { background: var(--warn-tint); - border: 1px solid var(--warn-border); color: var(--warn-ink); } @@ -516,10 +465,10 @@ a { text-transform: capitalize; } - &-role { background: var(--accent-tint); border: 1px solid var(--accent-border); color: var(--accent-ink); } + &-role { background: var(--surface-sunken); border: 1px solid var(--border-strong); color: var(--ink-soft); } &-admin { background: var(--panel-sunken); border: 1px solid var(--border-strong); color: var(--muted); } - &-connected { background: var(--positive-tint); border: 1px solid var(--positive-border); color: var(--positive-ink); } - &-off { background: var(--warn-tint); border: 1px solid var(--warn-border); color: var(--warn-ink); } + &-connected { background: var(--positive-tint); color: var(--positive-ink); } + &-off { background: var(--warn-tint); color: var(--warn-ink); } } .board-stage { @@ -690,6 +639,12 @@ a { .avatars { display: flex; align-items: center; + min-width: 0; + overflow: hidden; + + // The data-name tooltip pokes above the row; hovering drops the clip so it + // is not cut off by the overlap truncation. + &:has(.avatar:hover) { overflow: visible; } } .avatar { @@ -703,6 +658,7 @@ a { display: flex; align-items: center; justify-content: center; + position: relative; & + & { margin-left: -8px; } @@ -729,6 +685,26 @@ a { flex: none; } + // A bare avatar carries `data-name`; hovering raises a house tooltip in + // place of the native `title`. + &[data-name]:hover::after { + content: attr(data-name); + position: absolute; + bottom: calc(100% + 6px); + left: 50%; + transform: translateX(-50%); + background: var(--surface); + border: 1px solid var(--border); + border-radius: var(--radius-sm); + padding: 3px 8px; + font-size: 11px; + color: var(--ink-soft); + box-shadow: var(--shadow-2); + white-space: nowrap; + z-index: 30; + pointer-events: none; + } + &-tone-0 { background: var(--accent); } &-tone-1 { background: var(--avatar-tone-1); } &-tone-2 { background: var(--positive); } @@ -792,6 +768,8 @@ a { .modal { width: 780px; max-width: 100%; + max-height: calc(100vh - 96px); + overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); @@ -932,13 +910,6 @@ a { margin-top: 20px; } -.new-task-date { - border: none; - background: transparent; - font-family: inherit; - color: inherit; -} - .new-task-foot { display: flex; align-items: center; @@ -981,16 +952,20 @@ a { margin-top: 8px; } -.edit-save { +.edit-save, +.comment-post { height: 28px; padding: 0 12px; border: none; border-radius: var(--radius); - background: var(--ink); + background: var(--accent); color: var(--surface); font-family: inherit; font-size: 12px; cursor: pointer; + transition: background var(--dur-fast) var(--ease); + + &:hover { background: var(--accent-strong); } &:disabled { opacity: 0.5; cursor: default; } } @@ -999,6 +974,9 @@ a { font-size: 12px; color: var(--muted); cursor: pointer; + transition: color var(--dur-fast) var(--ease); + + &:hover { color: var(--ink); } } // A popover is the same machinery, floated. @@ -1045,7 +1023,7 @@ a { border-radius: var(--radius-sm); background: transparent; font-family: inherit; - font-size: 12px; + font-size: 13px; color: var(--ink); text-align: left; text-decoration: none; @@ -1189,7 +1167,7 @@ a { .detail-label { font-family: var(--font-mono); font-size: 10px; - letter-spacing: 0.06em; + letter-spacing: 0.08em; color: var(--muted-soft); } @@ -1202,7 +1180,8 @@ a { // Every value in the field row wears the same box, so a ` wearing the field-input box still shows the browser's own // arrow unless told otherwise. This draws the same chevron the rest of the // app uses, so a dropdown looks like a field, not an OS control. Shared @@ -2127,11 +2073,20 @@ select.field-input, -webkit-appearance: none; cursor: pointer; padding-right: 32px; - 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"); + 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"); background-repeat: no-repeat; background-position: right 12px center; } +// Dark theme's lighter muted ink, baked into a second copy of the chevron: +// a data-URI can't read custom properties. +[data-theme="dark"] { + select.field-input, + .field-input.dd-trigger { + 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"); + } +} + // The browser's native option list ignores theme tokens by default — dark // mode showed the OS's white/blue list until these are set explicitly. // Belt-and-braces for any select `dropdown.rs` hasn't converted. @@ -2149,6 +2104,11 @@ option:hover { background: var(--panel-sunken); } +input[type="checkbox"], +input[type="radio"] { + accent-color: var(--accent); +} + // -- house dropdown (dropdown.rs) -------------------------------------------- // // `dropdown.rs` hides the native `