Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(email): blank line above injected signature, reply toolbar overlap, sticky dismiss (#4444)

Evan Hutnik5d3c3803ef57
diff --git a/js/app/packages/block-email/component/BaseInput.tsx b/js/app/packages/block-email/component/BaseInput.tsx
index 44db521f8c..347001921f 100644
--- a/js/app/packages/block-email/component/BaseInput.tsx
+++ b/js/app/packages/block-email/component/BaseInput.tsx
@@ -853,10 +853,13 @@ export function BaseInput(props: {
// After a send, the bottom input stays mounted and its replyingTo flips to
// the just-sent message once the thread refetches. Cancel the inhibited
// post-send save and re-enable saves so a fresh edit under the new form
- // context can be persisted.
+ // context can be persisted. The memo gates on the db_id *value*: replyingTo
+ // is recreated on every thread/draft refetch (e.g. after a debounced draft
+ // save), and resetting on those would resurrect a dismissed signature.
+ const replyingToDbId = createMemo(() => props.replyingTo()?.db_id);
createEffect(
on(
- () => props.replyingTo()?.db_id,
+ replyingToDbId,
() => {
if (draftSaveTimer) window.clearTimeout(draftSaveTimer);
pendingSend = false;
@@ -1804,7 +1807,10 @@ export function BaseInput(props: {
/>
)}
</Show>
- <div class="flex flex-row w-full h-9 justify-between items-end px-2 pb-2 pt-0.5 space-x-2">
+ {/* No fixed height: the send button (size-7.5) is taller than the icon
+ buttons, and a fixed h-9 minus the vertical padding left it 4px short
+ — with items-end it bled upward over the signature bar above. */}
+ <div class="flex flex-row w-full justify-between items-end px-2 pb-2 pt-1.5 space-x-2">
<div class="flex flex-row items-center gap-1">
<div class="relative flex">
<Button
diff --git a/rust/cloud-storage/email/src/domain/service/signature.rs b/rust/cloud-storage/email/src/domain/service/signature.rs
index 44fe562351..744c6e8775 100644
--- a/rust/cloud-storage/email/src/domain/service/signature.rs
+++ b/rust/cloud-storage/email/src/domain/service/signature.rs
@@ -33,7 +33,11 @@ pub(crate) fn has_signature(body_html: &str) -> bool {
/// matches (e.g. a bare fragment with no `<body>`), it is appended to the end so
/// the signature is never silently dropped.
pub(crate) fn inject_signature(body_html: &str, signature_html: &str) -> String {
- let wrapped = format!(r#"<div class="{SIGNATURE_CLASS}">{signature_html}</div>"#);
+ // The leading <div><br></div> is a blank line separating the signature from
+ // the message body (the text/plain part gets "\n\n" for the same reason).
+ // It sits inside the marker div so strip_signature removes it too.
+ let wrapped =
+ format!(r#"<div class="{SIGNATURE_CLASS}"><div><br></div>{signature_html}</div>"#);
let has_quote = Selector::parse(".macro_quote")
.ok()
diff --git a/rust/cloud-storage/email/src/domain/service/signature/test.rs b/rust/cloud-storage/email/src/domain/service/signature/test.rs
index 7a763c5786..ea937fd122 100644
--- a/rust/cloud-storage/email/src/domain/service/signature/test.rs
+++ b/rust/cloud-storage/email/src/domain/service/signature/test.rs
@@ -8,6 +8,15 @@ fn appends_to_body_after_message_when_no_quote() {
assert!(out.find("Hi there").unwrap() < out.find("macro-email-signature").unwrap());
}
+#[test]
+fn separates_signature_from_message_with_blank_line() {
+ let out = inject_signature("<body><p>Hi there</p></body>", "<p>Regards</p>");
+ assert!(
+ out.contains(r#"<div class="macro-email-signature"><div><br></div><p>Regards</p></div>"#),
+ "got: {out}"
+ );
+}
+
#[test]
fn inserts_above_quote_for_replies_and_forwards() {
let body = r#"<body><p>My reply</p><div class="macro_quote"><p>Quoted</p></div></body>"#;