joelekstrom / fastmate

A native Fastmail-wrapper for Mac.
MIT License
193 stars 12 forks source link

Any way to open two emails at once? (new window) #71

Open blodt opened 2 years ago

blodt commented 2 years ago

Is there any chance to have the ability to open two emails at once?

Or perhaps have the main window but open another email in a new window?

Trying to figure out how to have two emails open and side by side for comparison/reading one while working on another.

Thx!

joelekstrom commented 2 years ago

Hi! Unfortunately not possible currently. @mdbraber has made some progress on this (see #14). Also requested previously in #20 and #22.

I'm currently doing (slowly) a rewrite to a more reactive architecture, and I believe multi-window support will be more straightforward when that is done, so I will definitely give it a try then!

mdbraber commented 2 years ago

This could be an interesting next feature. Not to sure how to approach it though with regards to the rewrite. Would it be best to wait for parts to finish? Or suggest some features in the current Obj-C code?

joelekstrom commented 2 years ago

@mdbraber Feel free to do it in the way that's most inspiring to you. If you have some objc-compatible stuff that's fine by me. More important to have nice features than waiting for a rewrite IMO

mdbraber commented 2 years ago

Okay, suggest I'll port some my Obj-C code from my "old" branch to a new PR. Here's the things I think should be interesting:

Any other suggestions?

joelekstrom commented 2 years ago

I had a thought about supporting standard macOS tabs too, opening new windows in tabs. There are some complications with this regarding unread counts etc (that affects opening a second full window too btw)

mdbraber commented 2 years ago

I've started a branch on my fork to add a separate compose window: https://github.com/mdbraber/fastmate/tree/add_compose_window

It's not too hard to add a separate window, but there are some challenges. My main one is how to handle the undo function. The Fastmail UI offers a link after sending that you can click to undo the sending. I haven't yet looked into it in detail, but I suspect this cancels a JS timer which delays the sending. When closing a compose window after hitting 'Send' we obviously have no access to this timer.

Some ideas:

  1. Keep the window open until the timer ends
  2. Hide the window (make it invisible) and add a button or keyboard shortcut to the main window to cancel the send
  3. .... ?

I think I'd start with implementing 1 and then 2 - making it a user configurable option in the end what they would prefer. Any suggestions or ideas @joelekstrom @blodt?

joelekstrom commented 2 years ago

Yeah that sounds good to me to start with!

mdbraber commented 2 years ago

@joelekstrom @blodt check out the branch for the first implementation, let me know any thoughts https://github.com/mdbraber/fastmate/tree/add_compose_window

mdbraber commented 2 years ago

Working on this I found a need to connect e.g. with Fastmail UI elements (e.g. when clicking the Discard button, the window should close). I've found a way to do this documented here: https://github.com/joelekstrom/fastmate/discussions/89