Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed copy and paste functionality not working when viewing an expanded email thread. #473

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 68 additions & 46 deletions components/email/src/Email.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,8 @@
}

&.condensed {
display: block;
width: 100%;
div.snippet {
text-overflow: ellipsis;
overflow: hidden;
Expand Down Expand Up @@ -1296,6 +1298,18 @@
div.message-head:hover {
cursor: n-resize;
}
div.message-to:hover {
cursor: auto;
}
div.message-from:hover {
cursor: auto;
}
div.message-date:hover {
cursor: auto;
}
div.message-body {
cursor: auto;
}
}
}
&.last-message {
Expand Down Expand Up @@ -1812,12 +1826,13 @@
? "expanded"
: "condensed"
}`}
bind:this={messageRefs[msgIndex]}
on:click|stopPropagation={(e) =>
handleEmailClick(e, msgIndex)}
on:keypress={(e) => handleEmailKeypress(e, msgIndex)}>
bind:this={messageRefs[msgIndex]}>
{#if message.expanded || msgIndex === activeThread.messages.length - 1}
<div class="message-head">
<div
class="message-head"
on:click|stopPropagation={(e) =>
handleEmailClick(e, msgIndex)}
on:keypress={(e) => handleEmailKeypress(e, msgIndex)}>
<div class="message-from-to">
<div class="avatar-info">
{#if _this.show_contact_avatar}
Expand All @@ -1827,7 +1842,7 @@
contact={contacts[message?.from[0].email]} />
</div>
{/if}
<div class="message-from">
<div class="message-from" on:click|stopPropagation>
<span class="name">
{userEmail && message?.from[0].email === userEmail
? "me"
Expand All @@ -1843,7 +1858,7 @@
content={message?.from[0].email} />
</div>
</div>
<div class="message-to">
<div class="message-to" on:click|stopPropagation>
{#if message?.to}
{#await getAllRecipients( { to: message.to, cc: message.cc, bcc: message.bcc }, ) then allRecipients}
{#each allRecipients.slice(0, PARTICIPANTS_TO_TRUNCATE) as recipient, i}
Expand Down Expand Up @@ -1891,7 +1906,7 @@
</div>
<div class="">
{#if _this.show_received_timestamp}
<div class="message-date">
<div class="message-date" on:click|stopPropagation>
<span>
{formatExpandedDate(
new Date(message.date * 1000),
Expand Down Expand Up @@ -1944,7 +1959,7 @@
{message}
body={message.body}
on:downloadClicked={handleDownloadFromMessage} />
<!-- If a thread is being passed manually and there is no body,
<!-- If a thread is being passed manually and there is no body,
we will keep loading, so the below is our fallback -->
{:else if !!_this.thread && !_this.thread_id && click_action != "mailbox"}
{message.body ?? message.snippet}
Expand All @@ -1970,44 +1985,51 @@
{/if}
</div>
{:else}
<div class="message-head">
<div class="avatar-info">
{#if _this.show_contact_avatar}
<div class="default-avatar">
<nylas-contact-image
{contact_query}
contact={contacts[message?.from[0].email]} />
<div
class="condensed-container"
on:click|stopPropagation={(e) =>
handleEmailClick(e, msgIndex)}
on:keypress={(e) => handleEmailKeypress(e, msgIndex)}>
<div class="message-head">
<div class="avatar-info">
{#if _this.show_contact_avatar}
<div class="default-avatar">
<nylas-contact-image
{contact_query}
contact={contacts[message?.from[0].email]} />
</div>
{/if}
<div class="message-from">
<span class="name"
>{userEmail &&
message?.from[0].email === userEmail
? "me"
: message?.from[0].name ||
message?.from[0].email}</span>
<!-- tooltip component -->
<nylas-tooltip
on:toggleTooltip={setTooltip}
id={message?.id.slice(0, 3)}
current_tooltip_id={currentTooltipId}
icon={DropdownSymbol}
content={message?.from[0].email} />
</div>
{/if}
<div class="message-from">
<span class="name"
>{userEmail && message?.from[0].email === userEmail
? "me"
: message?.from[0].name ||
message?.from[0].email}</span>
<!-- tooltip component -->
<nylas-tooltip
on:toggleTooltip={setTooltip}
id={message?.id.slice(0, 3)}
current_tooltip_id={currentTooltipId}
icon={DropdownSymbol}
content={message?.from[0].email} />
</div>
<section>
{#if _this.show_received_timestamp}
<div class="message-date">
<span>
{formatExpandedDate(
new Date(message.date * 1000),
)}
</span>
</div>
{/if}
</section>
</div>
<div class="snippet">
{message.snippet}
</div>
<section>
{#if _this.show_received_timestamp}
<div class="message-date">
<span>
{formatExpandedDate(
new Date(message.date * 1000),
)}
</span>
</div>
{/if}
</section>
</div>
<div class="snippet">
{message.snippet}
</div>
{/if}
</div>
Expand Down Expand Up @@ -2176,8 +2198,8 @@
MAX_MOBILE_PARTICIPANTS}
</span>
{/if}
<!-- If it is desktop, we only show upto 2 participants (latest from message), hence -2.
Note that this might not be exactly correct if the name of the first participant is too long
<!-- If it is desktop, we only show upto 2 participants (latest from message), hence -2.
Note that this might not be exactly correct if the name of the first participant is too long
and occupies entire width -->
{#if activeThread.participants.length > 2}
<span class="show-on-desktop">
Expand Down
Loading