The notice actually leaves, and each tab fills its room
Browse files at this commit7fa61f46f5d163edb7d8686b60bb1406d1733cdeParent: 6d8b4a6- fix
- the notice actually leaves, and each tab fills its room
6 changed files +79 -8
- crates/izlek-core/src/mail.rs +5 -3
- crates/izlek-core/tests/store.rs +34 -0
- crates/izlek-web/src/detail.rs +5 -3
- crates/izlek-web/src/i18n.rs +3 -0
- crates/izlek-web/src/logs.rs +2 -2
- style/main.scss +30 -0
crates/izlek-core/src/mail.rsmodified+5 -3
| @@ -533,9 +533,11 @@ impl Engine { | |||
| 533 | ) -> crate::store::Result<Report> { | 533 | ) -> crate::store::Result<Report> { |
| 534 | let mut report = Report::default(); | 534 | let mut report = Report::default(); |
| 535 | for send in self.store.sends_owed(now, limit).await? { | 535 | for send in self.store.sends_owed(now, limit).await? { |
| 536 | - // An invite owes no rule and no event: it carries its own subject | 536 | + // An invite and an admin's notice both owe no rule and no event: |
| 537 | - // and body, composed once at mint time. | 537 | + // each carries its own subject and body, composed once at mint |
| 538 | - if send.kind == SendKind::Invite { | 538 | + // time. Without this arm a notice falls through to the rule path, |
| 539 | + // finds no rule_id, and is skipped every run — queued forever. | ||
| 540 | + if matches!(send.kind, SendKind::Invite | SendKind::Notice) { | ||
| 539 | let mail = Outgoing { | 541 | let mail = Outgoing { |
| 540 | to: send.recipient.clone(), | 542 | to: send.recipient.clone(), |
| 541 | subject: send.subject.clone().unwrap_or_default(), | 543 | subject: send.subject.clone().unwrap_or_default(), |
crates/izlek-core/tests/store.rsmodified+34 -0
| @@ -5215,3 +5215,37 @@ async fn a_queued_notice_is_pending_and_due_and_on_the_queue() { | |||
| 5215 | "not in mail_queue: {mail_queue:?}" | 5215 | "not in mail_queue: {mail_queue:?}" |
| 5216 | ); | 5216 | ); |
| 5217 | } | 5217 | } |
| 5218 | + | ||
| 5219 | +/// An admin's notice carries its own subject and body and owes no rule, the | ||
| 5220 | +/// same as an invite — the engine has to deliver it rather than skip past it | ||
| 5221 | +/// looking for a rule that was never there. | ||
| 5222 | +#[tokio::test] | ||
| 5223 | +async fn the_engine_delivers_a_notice_that_owes_no_rule() { | ||
| 5224 | + let (dir, store, _workspace, _admin) = shared().await; | ||
| 5225 | + let now = OffsetDateTime::now_utc(); | ||
| 5226 | + store | ||
| 5227 | + .queue_notice("grace@izlek.sh", "Heads up", "Body text", now) | ||
| 5228 | + .await | ||
| 5229 | + .unwrap(); | ||
| 5230 | + | ||
| 5231 | + let mailer = Remembering::taking_everything(); | ||
| 5232 | + let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); | ||
| 5233 | + let report = engine | ||
| 5234 | + .deliver_owed(now + Duration::minutes(1), 10) | ||
| 5235 | + .await | ||
| 5236 | + .unwrap(); | ||
| 5237 | + | ||
| 5238 | + assert_eq!(report.sent, 1, "{report:?}"); | ||
| 5239 | + let sent = mailer.sent(); | ||
| 5240 | + assert_eq!(sent.len(), 1, "{sent:?}"); | ||
| 5241 | + assert_eq!(sent[0].to, "grace@izlek.sh"); | ||
| 5242 | + assert_eq!(sent[0].subject, "Heads up"); | ||
| 5243 | + assert_eq!(sent[0].body, "Body text"); | ||
| 5244 | + | ||
| 5245 | + let owed = store | ||
| 5246 | + .sends_owed(now + Duration::hours(2), 10) | ||
| 5247 | + .await | ||
| 5248 | + .unwrap(); | ||
| 5249 | + assert!(owed.is_empty(), "a delivered notice is no longer owed: {owed:?}"); | ||
| 5250 | + std::fs::remove_dir_all(dir).ok(); | ||
| 5251 | +} | ||
crates/izlek-web/src/detail.rsmodified+5 -3
| @@ -1583,7 +1583,7 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool, tab: Tab) | |||
| 1583 | } | 1583 | } |
| 1584 | 1584 | ||
| 1585 | if tab == Tab::Comments { | 1585 | if tab == Tab::Comments { |
| 1586 | - <section class="detail-block"> | 1586 | + <section class="detail-block detail-block-fill"> |
| 1587 | <div class="detail-block-head"> | 1587 | <div class="detail-block-head"> |
| 1588 | <span class="detail-label">(t(lang, Key::Comments))</span> | 1588 | <span class="detail-label">(t(lang, Key::Comments))</span> |
| 1589 | <span class="detail-count">(detail.comments.len())</span> | 1589 | <span class="detail-count">(detail.comments.len())</span> |
| @@ -1597,7 +1597,7 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool, tab: Tab) | |||
| 1597 | } | 1597 | } |
| 1598 | 1598 | ||
| 1599 | if tab == Tab::Activity { | 1599 | if tab == Tab::Activity { |
| 1600 | - <section class="detail-block"> | 1600 | + <section class="detail-block detail-block-fill"> |
| 1601 | <span class="detail-label">(t(lang, Key::Activity))</span> | 1601 | <span class="detail-label">(t(lang, Key::Activity))</span> |
| 1602 | <div class="activity-list"> | 1602 | <div class="activity-list"> |
| 1603 | for entry in &detail.activity { | 1603 | for entry in &detail.activity { |
| @@ -1612,7 +1612,7 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool, tab: Tab) | |||
| 1612 | } | 1612 | } |
| 1613 | 1613 | ||
| 1614 | if tab == Tab::Mail { | 1614 | if tab == Tab::Mail { |
| 1615 | - <section class="detail-block"> | 1615 | + <section class="detail-block detail-block-fill"> |
| 1616 | <span class="detail-label">(t(lang, Key::Notifications))</span> | 1616 | <span class="detail-label">(t(lang, Key::Notifications))</span> |
| 1617 | <div class="activity-list"> | 1617 | <div class="activity-list"> |
| 1618 | for line in ¬ifications { | 1618 | for line in ¬ifications { |
| @@ -1656,6 +1656,7 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool, tab: Tab) | |||
| 1656 | </section> | 1656 | </section> |
| 1657 | } | 1657 | } |
| 1658 | 1658 | ||
| 1659 | + if tab == Tab::Task { | ||
| 1659 | (refused(cx, "delete_task", lang).await?) | 1660 | (refused(cx, "delete_task", lang).await?) |
| 1660 | 1661 | ||
| 1661 | <footer class="detail-foot"> | 1662 | <footer class="detail-foot"> |
| @@ -1691,6 +1692,7 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool, tab: Tab) | |||
| 1691 | <div class="spacer"></div> | 1692 | <div class="spacer"></div> |
| 1692 | <a class="quiet" href="/">(t(lang, Key::Close))</a> | 1693 | <a class="quiet" href="/">(t(lang, Key::Close))</a> |
| 1693 | </footer> | 1694 | </footer> |
| 1695 | + } | ||
| 1694 | </div> | 1696 | </div> |
| 1695 | 1697 | ||
| 1696 | if tab == Tab::Comments && may_comment { | 1698 | if tab == Tab::Comments && may_comment { |
crates/izlek-web/src/i18n.rsmodified+3 -0
| @@ -236,6 +236,7 @@ pub enum Key { | |||
| 236 | Logs, | 236 | Logs, |
| 237 | MailQueue, | 237 | MailQueue, |
| 238 | MailDecisions, | 238 | MailDecisions, |
| 239 | + WorkspaceActivity, | ||
| 239 | NothingOwed, | 240 | NothingOwed, |
| 240 | NoDecisionsYet, | 241 | NoDecisionsYet, |
| 241 | NothingYet, | 242 | NothingYet, |
| @@ -727,6 +728,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 727 | (MailQueue, Tr) => "Posta kuyruğu", | 728 | (MailQueue, Tr) => "Posta kuyruğu", |
| 728 | (MailDecisions, En) => "Mail decisions", | 729 | (MailDecisions, En) => "Mail decisions", |
| 729 | (MailDecisions, Tr) => "Posta kararları", | 730 | (MailDecisions, Tr) => "Posta kararları", |
| 731 | + (WorkspaceActivity, En) => "Workspace activity", | ||
| 732 | + (WorkspaceActivity, Tr) => "Çalışma alanı etkinliği", | ||
| 730 | (NothingOwed, En) => "Nothing owed.", | 733 | (NothingOwed, En) => "Nothing owed.", |
| 731 | (NothingOwed, Tr) => "Bekleyen yok.", | 734 | (NothingOwed, Tr) => "Bekleyen yok.", |
| 732 | (NoDecisionsYet, En) => "No decisions yet.", | 735 | (NoDecisionsYet, En) => "No decisions yet.", |
crates/izlek-web/src/logs.rsmodified+2 -2
| @@ -922,7 +922,7 @@ async fn logs_screen( | |||
| 922 | <nav class="settings-sections"> | 922 | <nav class="settings-sections"> |
| 923 | <a class=(rail_class(section, Section::Queue)) href="/logs?section=queue">(t(lang, Key::MailQueue))</a> | 923 | <a class=(rail_class(section, Section::Queue)) href="/logs?section=queue">(t(lang, Key::MailQueue))</a> |
| 924 | <a class=(rail_class(section, Section::Decisions)) href="/logs?section=decisions">(t(lang, Key::MailDecisions))</a> | 924 | <a class=(rail_class(section, Section::Decisions)) href="/logs?section=decisions">(t(lang, Key::MailDecisions))</a> |
| 925 | - <a class=(rail_class(section, Section::Activity)) href="/logs?section=activity">(t(lang, Key::Activity))</a> | 925 | + <a class=(rail_class(section, Section::Activity)) href="/logs?section=activity">(t(lang, Key::WorkspaceActivity))</a> |
| 926 | </nav> | 926 | </nav> |
| 927 | <main class="settings-stage stage-wide"> | 927 | <main class="settings-stage stage-wide"> |
| 928 | <div class="settings-head"> | 928 | <div class="settings-head"> |
| @@ -1044,7 +1044,7 @@ async fn logs_screen( | |||
| 1044 | if section == Section::Activity { | 1044 | if section == Section::Activity { |
| 1045 | <section class="panel"> | 1045 | <section class="panel"> |
| 1046 | <div class="panel-head"> | 1046 | <div class="panel-head"> |
| 1047 | - <h2 class="panel-title">(t(lang, Key::Activity))</h2> | 1047 | + <h2 class="panel-title">(t(lang, Key::WorkspaceActivity))</h2> |
| 1048 | </div> | 1048 | </div> |
| 1049 | <div class="panel-body"> | 1049 | <div class="panel-body"> |
| 1050 | <form class="filterbar log-filterbar" method="get" action="/logs"> | 1050 | <form class="filterbar log-filterbar" method="get" action="/logs"> |
style/main.scssmodified+30 -0
| @@ -1799,14 +1799,38 @@ img.avatar { | |||
| 1799 | .detail-prose { | 1799 | .detail-prose { |
| 1800 | display: block; | 1800 | display: block; |
| 1801 | margin: 0; | 1801 | margin: 0; |
| 1802 | + min-width: 0; | ||
| 1802 | font-size: 13px; | 1803 | font-size: 13px; |
| 1803 | line-height: 1.6; | 1804 | line-height: 1.6; |
| 1804 | color: var(--ink-soft); | 1805 | color: var(--ink-soft); |
| 1805 | white-space: pre-wrap; | 1806 | white-space: pre-wrap; |
| 1807 | + // A pasted URL or an unbroken run of characters has no space to wrap at; | ||
| 1808 | + // without this it runs off the panel instead of folding. | ||
| 1809 | + overflow-wrap: anywhere; | ||
| 1806 | } | 1810 | } |
| 1807 | 1811 | ||
| 1808 | .detail-prose-empty { color: var(--muted-soft); } | 1812 | .detail-prose-empty { color: var(--muted-soft); } |
| 1809 | 1813 | ||
| 1814 | +// One tab's region owns the whole body: the block stretches, and the list | ||
| 1815 | +// inside it pans rather than stopping short and leaving the panel empty | ||
| 1816 | +// below (the old 320px cap made sense only when every region shared one | ||
| 1817 | +// scrolling column). | ||
| 1818 | +.detail-body { display: flex; flex-direction: column; } | ||
| 1819 | + | ||
| 1820 | +.detail-block-fill { | ||
| 1821 | + flex: 1; | ||
| 1822 | + min-height: 0; | ||
| 1823 | + display: flex; | ||
| 1824 | + flex-direction: column; | ||
| 1825 | + | ||
| 1826 | + > .comment-list, | ||
| 1827 | + > .activity-list { | ||
| 1828 | + flex: 1; | ||
| 1829 | + min-height: 0; | ||
| 1830 | + max-height: none; | ||
| 1831 | + } | ||
| 1832 | +} | ||
| 1833 | + | ||
| 1810 | .detail-quiet { | 1834 | .detail-quiet { |
| 1811 | margin: 0; | 1835 | margin: 0; |
| 1812 | font-size: 13px; | 1836 | font-size: 13px; |
| @@ -2018,6 +2042,9 @@ img.avatar { | |||
| 2018 | gap: 14px; | 2042 | gap: 14px; |
| 2019 | max-height: 320px; | 2043 | max-height: 320px; |
| 2020 | overflow-y: auto; | 2044 | overflow-y: auto; |
| 2045 | + scrollbar-width: none; | ||
| 2046 | + | ||
| 2047 | + &::-webkit-scrollbar { display: none; } | ||
| 2021 | } | 2048 | } |
| 2022 | 2049 | ||
| 2023 | .comment { | 2050 | .comment { |
| @@ -2080,6 +2107,9 @@ img.avatar { | |||
| 2080 | gap: 10px; | 2107 | gap: 10px; |
| 2081 | max-height: 320px; | 2108 | max-height: 320px; |
| 2082 | overflow-y: auto; | 2109 | overflow-y: auto; |
| 2110 | + scrollbar-width: none; | ||
| 2111 | + | ||
| 2112 | + &::-webkit-scrollbar { display: none; } | ||
| 2083 | } | 2113 | } |
| 2084 | 2114 | ||
| 2085 | .activity-line { | 2115 | .activity-line { |