forge
Explore
Log in

Don't you dare go Hollow

The notice actually leaves, and each tab fills its room

Browse files at this commit

7fa61f46f5d163edb7d8686b60bb1406d1733cdeAhmet Kaan GümüşParent: 6d8b4a6
  • fix
    • the notice actually leaves, and each tab fills its room
Show full message
🐛 fix(web): the notice actually leaves, and each tab fills its room

deliver_owed only composed self-contained mail for an invite, so an
admin notice found no rule and was skipped every run — queued forever.
Tabs: the description wraps an unbroken run, the list tabs stretch to
the panel instead of stopping at 320px, their scrollbars stay hidden,
and the delete footer belongs to the Task tab alone.
crates/izlek-core/src/mail.rsmodified+5 -3
@@ -533,9 +533,11 @@ impl Engine {
533533 ) -> crate::store::Result<Report> {
534534 let mut report = Report::default();
535535 for send in self.store.sends_owed(now, limit).await? {
536- // An invite owes no rule and no event: it carries its own subject
537- // and body, composed once at mint time.
538- if send.kind == SendKind::Invite {
536+ // An invite and an admin's notice both owe no rule and no event:
537+ // each carries its own subject and body, composed once at mint
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) {
539541 let mail = Outgoing {
540542 to: send.recipient.clone(),
541543 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() {
52155215 "not in mail_queue: {mail_queue:?}"
52165216 );
52175217 }
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)
15831583 }
15841584
15851585 if tab == Tab::Comments {
1586- <section class="detail-block">
1586+ <section class="detail-block detail-block-fill">
15871587 <div class="detail-block-head">
15881588 <span class="detail-label">(t(lang, Key::Comments))</span>
15891589 <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)
15971597 }
15981598
15991599 if tab == Tab::Activity {
1600- <section class="detail-block">
1600+ <section class="detail-block detail-block-fill">
16011601 <span class="detail-label">(t(lang, Key::Activity))</span>
16021602 <div class="activity-list">
16031603 for entry in &detail.activity {
@@ -1612,7 +1612,7 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool, tab: Tab)
16121612 }
16131613
16141614 if tab == Tab::Mail {
1615- <section class="detail-block">
1615+ <section class="detail-block detail-block-fill">
16161616 <span class="detail-label">(t(lang, Key::Notifications))</span>
16171617 <div class="activity-list">
16181618 for line in &notifications {
@@ -1656,6 +1656,7 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool, tab: Tab)
16561656 </section>
16571657 }
16581658
1659+ if tab == Tab::Task {
16591660 (refused(cx, "delete_task", lang).await?)
16601661
16611662 <footer class="detail-foot">
@@ -1691,6 +1692,7 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool, tab: Tab)
16911692 <div class="spacer"></div>
16921693 <a class="quiet" href="/">(t(lang, Key::Close))</a>
16931694 </footer>
1695+ }
16941696 </div>
16951697
16961698 if tab == Tab::Comments && may_comment {
crates/izlek-web/src/i18n.rsmodified+3 -0
@@ -236,6 +236,7 @@ pub enum Key {
236236 Logs,
237237 MailQueue,
238238 MailDecisions,
239+ WorkspaceActivity,
239240 NothingOwed,
240241 NoDecisionsYet,
241242 NothingYet,
@@ -727,6 +728,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
727728 (MailQueue, Tr) => "Posta kuyruğu",
728729 (MailDecisions, En) => "Mail decisions",
729730 (MailDecisions, Tr) => "Posta kararları",
731+ (WorkspaceActivity, En) => "Workspace activity",
732+ (WorkspaceActivity, Tr) => "Çalışma alanı etkinliği",
730733 (NothingOwed, En) => "Nothing owed.",
731734 (NothingOwed, Tr) => "Bekleyen yok.",
732735 (NoDecisionsYet, En) => "No decisions yet.",
crates/izlek-web/src/logs.rsmodified+2 -2
@@ -922,7 +922,7 @@ async fn logs_screen(
922922 <nav class="settings-sections">
923923 <a class=(rail_class(section, Section::Queue)) href="/logs?section=queue">(t(lang, Key::MailQueue))</a>
924924 <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>
926926 </nav>
927927 <main class="settings-stage stage-wide">
928928 <div class="settings-head">
@@ -1044,7 +1044,7 @@ async fn logs_screen(
10441044 if section == Section::Activity {
10451045 <section class="panel">
10461046 <div class="panel-head">
1047- <h2 class="panel-title">(t(lang, Key::Activity))</h2>
1047+ <h2 class="panel-title">(t(lang, Key::WorkspaceActivity))</h2>
10481048 </div>
10491049 <div class="panel-body">
10501050 <form class="filterbar log-filterbar" method="get" action="/logs">
style/main.scssmodified+30 -0
@@ -1799,14 +1799,38 @@ img.avatar {
17991799 .detail-prose {
18001800 display: block;
18011801 margin: 0;
1802+ min-width: 0;
18021803 font-size: 13px;
18031804 line-height: 1.6;
18041805 color: var(--ink-soft);
18051806 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;
18061810 }
18071811
18081812 .detail-prose-empty { color: var(--muted-soft); }
18091813
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+
18101834 .detail-quiet {
18111835 margin: 0;
18121836 font-size: 13px;
@@ -2018,6 +2042,9 @@ img.avatar {
20182042 gap: 14px;
20192043 max-height: 320px;
20202044 overflow-y: auto;
2045+ scrollbar-width: none;
2046+
2047+ &::-webkit-scrollbar { display: none; }
20212048 }
20222049
20232050 .comment {
@@ -2080,6 +2107,9 @@ img.avatar {
20802107 gap: 10px;
20812108 max-height: 320px;
20822109 overflow-y: auto;
2110+ scrollbar-width: none;
2111+
2112+ &::-webkit-scrollbar { display: none; }
20832113 }
20842114
20852115 .activity-line {