mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 00:35:51 +03:00
[GH-ISSUE #97] Add UI support for navigating to the latest received email #69
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#69
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @donnex on GitHub (Apr 23, 2023).
Original GitHub issue: https://github.com/axllent/mailpit/issues/97
A really nice addition to mailpit would be to add the ability to navigate to the latest received email.
I'm using mailpit for development and right now I have to navigate back in the browser and select the latest email, navigate back in history in order to navigate forward to the latest email (using the arrows in the top) or refresh the page manually in order to use the UI forward button.
I think it would be a great addition if one could navigate forward when a new mail is received. The forward button isn't enabled when a new mail shows up unless you navigate back and then forward.
My workflow right now is to send mail, change the content/template, send new mail, verify changes and repeat.
A bonus feature would be to toggle the ability to always navigate to the latest revived email automatically.
Thanks for a great project!
@axllent commented on GitHub (Apr 23, 2023):
The back/forward navigation has always been a bit "basic", given that those button values are calculated when the message opens based on the index of the message in the current overview list. The issue here is that you could be the first page of the inbox, but also could be any other page, or within search (in which case the new message may not even be included). With a small number of emails that can be regenerated, but when one is dealing with tens of thousands, any recalculation can be extremely expensive as that involves ajax requests, database queries, and re-rendering the UI.
In saying that, I think that the logic that can solve your issue here can be a fairly simple approach: If you are on the first page of a non-search view, and have the first message open (ie: the previous message button is disabled), when a new message is detected that value could enable & "populate" that "previous" button. This should work I think, but does it sound like a reasonable approach?
The alternative (or actually in addition to the previous option) is adding a toast when a new message comes in. Toasts are only displayed temporary (5 seconds), and it wouldn't necessarily be limited to your current page number or current search (if used) - basically just something that pops up (bottom of the browser) and says "new message arrived, click here to view" (and maybe some basic info depending what I could fit in without becoming obtrusive). I would have to time the toasts so that there would only ever be one toast at a time (anything newer within the time that the toast is showing would be ignored), else the browser would be completely flooded when Mailpit receives 100 messages per second.
As for your second bonus feature, I'll definitely keep it in mind, but I'm not a fan to be honest so I think it's unlikely.
Anyway, please confirm whether you think one, or both options would be helpful to you, and whether you see any downsides to both?
@donnex commented on GitHub (Apr 23, 2023):
For my use case I think both solutions sounds like good additions. I really can't think of any downsides but I'm only using mailpit for reviewing and verifying new mails and always the latest mail so I'm not that familiar with other use cases.
@axllent commented on GitHub (Apr 23, 2023):
I have just released v1.6.3 which contains this feature. Please feel free to re-open this if you have any issues.