Skip to content

Commit

Permalink
Use invisible address as displayed sender when sender name is empty
Browse files Browse the repository at this point in the history
Because the sender's name is used as a fold mail button. An empty sender
name results in an element with a height of zero, making it it
impossible to click to fold mails.

VoiceOver also does not focus the fold mail button when the sender name
is empty.

Close #8266
Close #8309

Co-authored-by: paw <[email protected]>
Co-authored-by: ivk <[email protected]>
  • Loading branch information
3 people committed Jan 17, 2025
1 parent c12c3b1 commit 90d8fbd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/mail-app/mail/view/MailViewerHeader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ export class MailViewerHeader implements Component<MailViewerHeaderAttrs> {
private renderSubjectActionsLine(attrs: MailViewerHeaderAttrs) {
const { viewModel } = attrs
const classes = this.makeSubjectActionsLineClasses()
const senderName = viewModel.getDisplayedSender()?.name?.trim() ?? ""
const displayAddressForSender = senderName === ""

return m(classes, [
m(
Expand Down Expand Up @@ -230,7 +232,10 @@ export class MailViewerHeader implements Component<MailViewerHeaderAttrs> {
)
: null,
this.tutaoBadge(viewModel),
m("span.text-break" + (viewModel.isUnread() ? ".font-weight-600" : ""), viewModel.getDisplayedSender()?.name ?? ""),
m(
"span.text-break" + (viewModel.isUnread() ? ".font-weight-600" : "") + (displayAddressForSender ? ".invisible" : ""),
displayAddressForSender ? viewModel.getDisplayedSender()?.address : senderName,
),
],
),
m(
Expand Down

0 comments on commit 90d8fbd

Please sign in to comment.