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

In mail tab, quickMove reopens mail in new tab after moving - should go to next unread mail instead #132

Closed
fredstluka opened this issue Apr 5, 2021 · 36 comments
Assignees

Comments

@fredstluka
Copy link

fredstluka commented Apr 5, 2021

Shift-M works fine when I'm looking at a list of messages.

But sometimes, I hit Enter while looking at a list of messages, to see a single message in its own Thunderbird tab.

Then, when I hit Shift-M while looking at that message in a Thunderbird tab, it moves the message as expected. That causes the Thunderbird tab to show the next message. Perfect!

BUT, then a new Thunderbird tab is opened, showing the message I just moved. Not what I wanted. I wanted to just see the next message in the previously existing tab. No new tab is desired. I'm done with the old message. I read it and filed it away. Don't need to see it again.

Also, it's confusing because the net visible effect is to keep seeing the same message, not noticing that a new tab has been created to house it. So, it looks at first as though the Shift-M did NOT move the message.

--Fred

Edit: Corrected typo: "next visible effect" --> "net visible effect"
--Fred

@RealRaven2000
Copy link
Owner

This area (single tab viewing and navigation from there) isn't well tested, guess I have to do more of that. In my workflow I only open emails in single tabs if need to store them for later (so they remain on screen when I restart my Computer / next day). I did some improvements in the area when opening mails in their own window, but I think I need to do a lot more testing to make this useful. I would have Shift-M (moving a mail while looking at it in a tab) - expected to "stay there and do nothing" or "close the tab" - not necessarily do some automatic advancing to the next unread mail, but again I can see that it would be useful.

@fredstluka
Copy link
Author

fredstluka commented Apr 12, 2021 via email

@fredstluka
Copy link
Author

fredstluka commented Apr 12, 2021 via email

@fredstluka
Copy link
Author

fredstluka commented Apr 12, 2021 via email

@RealRaven2000
Copy link
Owner

RealRaven2000 commented Apr 12, 2021

Axel,
I would have Shift-M (moving a mail while looking at it in a tab) - expected to "stay there and do nothing" or "close the tab" - not necessarily do some automatic advancing to the next unread mail, but again I can see that it would be useful.
I'd expect it to do the same as if I deleted the message while viewing it in a tab. 

Not me. Because you are not in the context of a list when you open a single message window - you don't see a list. But having said that, you can add the Previous and Next buttons to the single message toolbar and navigate from there. Anyway for that reason i am treating this as a "new feature" request and not as gap of something that should always have been in QuickFolders. And I don't even consider it as the expected / default behavior even though I can understand that it would be very utilitarian for the way you use Thunderbird.

So from my POV this is a nice additional feature, that the large majority of users won't expect or use, and possibly a lot of work for me. Still a nice feature. The CEO of postbox (who strictly implements features based on the 80/20 approach - if it doesn't benefit 80% of the users it's not worth wasting money on it) would certainly not implement it because it doesn't make economical sense. If I implement it then I have to be convinced that nothing else on the wishlist is more important / helpful - I need to convert more users to licensees and put a lot of energy into this first, and naturally features that are intuitively easier to find and use will take precedence.

Still, I would prefer the new functionality too. And there should be the options "go to next message and go to next unread message" - in the later case, what would happen if no unread messages are left? It's a complicated feature when you start thinking about it.

In that case, Thunderbird automatically shows the next message in the folder, or the next message in the search list, or in the conversation, or whatever set of messages I was looking at when I hit Enter to open the message in its own tab. Should also respect the behavior of Thunderbird that is specified by: - Preferences   - General     - Close message window/tab on move or delete

Didn't find it at first, I believe you mean

  • Preferences
    • Reading & Display
      • Close message window/tab on move or delete

Edit: ok. What happens if you don't have it active without QuickFolders disabled? Does it do the correct / expected thing then??

@RealRaven2000
Copy link
Owner

So I was looking at the implementation, turns out it was actually myself who reopened the tab after moving the email (behavior was by design) - see in quickfolders-quickMove.js function execute().

  if (messageDb && !isCopy) {
    // reusing the existing Tab didn't work so we close & re-open msg from the new location.
    // let tab = (QuickFolders.Util.Application=='Thunderbird') ? tabmail.selectedTab : tabmail.currentTabInfo;
    // currentTab.folderDisplay.selectMessage(msgHdr, true);
    setTimeout( 
      function() {
        let msgHdr = messageDb.getMsgHdrForMessageID(theMessage);
        util.logDebugOptional('quickMove', 'reopen mail in tab:' + msgHdr.mime2DecodedSubject );
        QuickFolders.Util.openMessageTabFromHeader(msgHdr);
      }, 1200);
  }

I made this optional now and turned it off by default. I also added "go to the next unread mail" as a configurable option (no UI yet) and turned that one on by default. Test Version for Thunderbird 78:

QuickFolders-wx-5.5pre10.zip

New configuration settings:

extensions.quickfolders.quickMove.reopenMsgTabAfterMove = false
extensions.quickfolders.quickMove.gotoNextUnreadAfterMove = true

So this should do the desired behavior of the OP: " I wanted to just see the next message in the previously existing tab."

@RealRaven2000 RealRaven2000 changed the title Shift-M opens a new tab after moving the message... In mail tab, quickMove reopens mail in new tab after moving - should go to next unread mail instead Apr 14, 2021
@RealRaven2000
Copy link
Owner

RealRaven2000 commented Apr 14, 2021

Added UI to advanced quickMove settings and translated into 17 languages (thanks, google translate):

image

QuickFolders-wx-5.5pre15.zip

@fredstluka please test when you get time? For the old (unwanted) behavior you would have to check boxes the opposite way than in the screenshot.

PS: Not going to create a dedicated UI for the Thunderbird 68 version because I have no "quickMove Advanced Settings" dialog there. If people want to change these advanced settings, they will have to right-click on the quickMove checkbox in the premium features box on the QF Pro tab.

@RealRaven2000 RealRaven2000 pinned this issue Apr 14, 2021
@fredstluka
Copy link
Author

fredstluka commented Apr 16, 2021 via email

@fredstluka
Copy link
Author

fredstluka commented Apr 16, 2021 via email

@RealRaven2000
Copy link
Owner

RealRaven2000 commented Apr 16, 2021

I installed QuickFolders-wx-5.5pre15.zip https://github.com/RealRaven2000/QuickFolders/files/6313285/QuickFolders-wx-5.5pre15.zip. Looks great!  Thanks!  Without changing either of the new checkboxes in the settings panel, it does exactly what I wanted.

Some minor quirks: a. It moves to the next message, not the next UNREAD message.     That's fine with me. 

not what I wanted. I have to fix that or change all my translations. But I think going to the unread message makes much more sense when you open an isolated special message out of a big list. What are the chances that you want to see exactly the next one?

Exactly what I wanted, but not what I     thought you said it would do. b. The new settings checkbox "Display next unread mail after      moving current one" seems to have no effect.  It always      goes to the next message, not the next unread message.      That's also fine with me, but perhaps not what you wanted. c. After moving the message, quickMove seems to leave the     keyboard focus in the search text box.  The box vanishes,     but typing keystrokes still causes the menu to appear and     to change appropriately based on the chars you type, even     though you can't see them.  Also, Shift-M (to move the next     message which his now appeared in the tab) doesn't work.     Probably because it's also being directed to the text box.     Also, Cmd-Z (undo, to move the message back) doesn't work.     Probably because it's also being directed to the text box.     Clicking in the message box (to move focus away from the     text box) makes everything start working properly again. I did some pretty thorough testing, since I thought I saw odd behavior once or twice.  But it was all explained by the above, I think. Here are the tests I did, all of which came out perfect.  Thanks! I compared it with the native behavior of TB's Message menu items: - Move To - Move to "..." Again (Opt-Shift-M) I tried various scenarios involving a TB tab that shows a single message and compared the behavior of the native TB move vs QF quickMove. 1. When I'm looking at an unfiltered folder and open a single     message in a new tab, then move that message to a new     folder:     - TB shows the next message     - QF does the same.  Perfect! 2. When I'm looking at a FILTERED folder (I typed a string in the     "Filter these messages" text box above the list of messages,     of hit Cmd-Shift-K, to see only some of the messages in the     folder), and open a single message in a new tab, then move     that message to a new folder:     - TB shows the next filtered message     - QF does the same.  Perfect! 3. When I'm looking at a conversation view of messages from     multiple different folders, and open a single message in a new     tab, then move that message to a new folder:     - TB shows the next message in the conversation from whatever folder     - QF does the same.  Perfect! 4. When I'm looking a list of messages from multiple different     folders generated by "Show results as list" after doing a search,     and open a single message in a new tab, then move that     message to a new folder:     - TB shows the next message in the list from whatever folder     - QF does the same.  Perfect! 5.  Same as (1), but it's the last message in the folder     - TB shows the previous message, since there is no next message     - QF does the same.  Perfect! 6.  Same as (2), but it's the last filtered message in the folder     - TB shows the previous filtered message, not the message that        would be next if the filter were ignored     - QF does the same.  Perfect! 7.  Same as (3), but it's the last message in the conversation     - TB shows the previous message in the conversation, since        there is no next message     - QF does the same.  Perfect! 8.  Same as (4), but it's the last message in the search results list     - TB shows the previous message in the list, since there is no        next message     - QF does the same.  Perfect! 9.  Same as (1), but it's the only message in the folder     - TB closes the tab since there are no more messages     - QF does the same.  Perfect! 10.  Same as (2), but it's the only filtered message in the folder     - TB closes the tab since there are no more filtered messages     - QF does the same.  Perfect! 11.  Same as (3), but it's the only message in the conversation     - TB leaves the tab open, but empty since there are no more        message in the conversation.  Oddly inconsistent with (9)        and (10), but OK.  I won't bother reporting it as a bug to        Mozilla.     - QF does the same.  Perfect match with TB! 12.  Same as (4), but it's the only message in the search results list     - TB leaves the tab open, but empty since there are no more        message in the list.   Oddly inconsistent with (9) and (10), but        OK.  I won't bother reporting it as a bug to Mozilla.     - QF does the same.  Perfect match with TB!

I am having trouble editing the above on github - it's lost all formatting when I quoted it - I guess because it is super long. If I recall correctly you also noticed in that wall of text above somewhere that the search box still has focus, which is definitely not intended. I already have 4.21 submitted for review and retracted it after I read that, because it's very bad to have an invisible textbox reacting to text input!
So here is a fixed version that addresses both problems (for Tb78) - I am setting focus to the single message straight after moving. I also notice that the keyboard shorcut "N" (next email) simply closes the single message tab - behavior that seems to come straight down from Thunderbird, so I am not going to interfere there - I don't want to reinvent all the wheels on this app.

QuickFolders-wx-5.5pre68.zip

@RealRaven2000
Copy link
Owner

Axel, I just realized that GitHub does NOT keep me fully informed via email.  It sends email whenever a comment is posted or a ticket is closed, but NOT: - When a ticket title is changed - When a comment is edited - When even the original problem description is edited (I think) - When a ticket is pinned - Others? For example, I edited the original description of this ticket to correct a typo, and added a note at the bottom of the description saying the following.  I got no email from that.  Did you?

I don't know, I got so much mail from your tickets that I lost track. My guess is that edits are triggering new mail. I usually only do typo and maybe fix uploads if they get stuck. Not sure when github sends off the first mail but I guess when I press the green "Comment" button. When I get a notification via email I click the link below (well actually I I copy the link because Waterfox isn't great on github) and always read it on the github pages directly. I will see if you have made edits in the meantime.

Edit: Corrected typo: "next visible effect" --> "net visible effect" --Fred
Also, you added these 2 additional bits of text to comments that you'd already added.  I got email for the original comments, but none for the edits.  So I could easily have never seen edits.  Did you get email from them? 1:
Edit: ok. What happens if you don't have it active without QuickFolders disabled? Does it do the correct / expected thing then??

that was badly worded - I think I meant what happens if you disable QuickFolders and then move an email while you have it open in a single message tab? (I guess you have to switch to a tab where the folder is visible for that).

@RealRaven2000
Copy link
Owner

Axel, I just realized that GitHub does NOT keep me fully informed via email.  It sends email whenever a comment is posted or a ticket is closed, but NOT: - When a ticket title is changed - When a comment is edited - When even the original problem description is edited (I think) - When a ticket is pinned - Others? For example, I edited the original description of this ticket to correct a typo, and added a note at the bottom of the description saying the following.  I got no email from that.  Did you?

I don't know, I got so much mail from your tickets that I lost track. My guess is that edits are triggering new mail. I usually only do typo and maybe fix uploads if they get stuck. Not sure when github sends off the first mail but I guess when I press the green "Comment" button. When I get a notification via email I click the link below (well actually I I copy the link because Waterfox isn't great on github) and always read it on the github pages directly. I will see if you have made edits in the meantime.

I meant to write "not triggering". And since I believe that I did not edit that in place this time because it changes the meaning and I know you only read the emails. So, have another email :)

@RealRaven2000
Copy link
Owner

Just testing more. with "go to next unread message" Thunderbird fails to do it if there are no unread messages left in the folder. Getting an uncaught exception in that case, and the single message tab just closes:

image

@fredstluka
Copy link
Author

fredstluka commented Apr 16, 2021 via email

@RealRaven2000
Copy link
Owner

I also notice that the keyboard shorcut "N" (next email) simply closes the single message tab - behavior that seems to come straight down from Thunderbird, so I am not going to interfere there - I don't want to reinvent all the wheels on this app.

No.  For me, it moves to the next unread in the list, as I described above.  You're using lowercase "n", not uppercase "N", right?

Just the "n" key. no Shift. it happens when there are no unread messages left in the current folder. In folder view, I am used to it jumping to the next unread mail in the next folder (without asking). BUt apparently this throws an exception when you are in single mail view and then just closes the tab.

@fredstluka
Copy link
Author

fredstluka commented Apr 16, 2021 via email

@RealRaven2000
Copy link
Owner

RealRaven2000 commented Apr 16, 2021

Here be New versions. had to change all translations and readmes and the way the setting extensions.quickfolders.quickMove.gotoNextUnreadAfterMove is stored to extensions.quickfolders.quickMove.gotoNextMsgAfterMove. no point in swimming against the stream when it's bound to fail anyway. But I fixed the focus issue that makes the (invisible) textbox of quickMove / quickJump gobble up all key strokes.

Tb68 version (bumped to 4.21.1 because I already uploaded 4.21):
QuickFolders-wx-4.21.1pre27.zip
Tb78 version: QuickFolders-wx-5.5pre71.zip

Edit: scratch that last bit - I am fried after debugging for 2 hours

@fredstluka
Copy link
Author

fredstluka commented Apr 16, 2021 via email

@fredstluka
Copy link
Author

fredstluka commented Apr 16, 2021 via email

@fredstluka
Copy link
Author

fredstluka commented Apr 16, 2021 via email

@fredstluka
Copy link
Author

fredstluka commented Apr 16, 2021 via email

@fredstluka
Copy link
Author

fredstluka commented Apr 17, 2021 via email

@fredstluka
Copy link
Author

fredstluka commented Apr 17, 2021 via email

@fredstluka
Copy link
Author

fredstluka commented Apr 17, 2021 via email

@fredstluka
Copy link
Author

fredstluka commented Apr 17, 2021 via email

@fredstluka
Copy link
Author

fredstluka commented Apr 17, 2021 via email

@fredstluka
Copy link
Author

fredstluka commented Apr 17, 2021 via email

@fredstluka
Copy link
Author

fredstluka commented Apr 17, 2021 via email

@RealRaven2000
Copy link
Owner

Looks good, but 2 minor nits:

thanks for testing!

  • The option "Display next mail after moving current one"    seems to not work properly.  Whether it's checked or not,    QF always moves to the next mail.  Never to the next    unread email, and never just closes the tab.  What is    expected to happen when this checkbox is off?

I would expect Thunderbird to close the single message tab - that's the standard behavior when I do nothing and move a viewed mail, and that happened when I didn't force it to re-open the tab (the original behavior) - so the code branch doing that is now dependent on that setting.

https://github.com/RealRaven2000/QuickFolders/blob/ESR78/chrome/content/quickfolders-util.js#L854

if (quickMove.Settings.isGoNext==true) {... goDoCommand('cmd_nextMsg')};

that part of the code also contains the setfocus to the single message pane. Unfortunately I also have to do some work when the tab is closed which I didn't think of.

https://github.com/RealRaven2000/QuickFolders/blob/ESR78/chrome/content/quickfolders-quickMove.js#L85

if (QuickFolders.quickMove.isReopen) { ... QuickFolders.Util.openMessageTabFromHeader(msgHdr); ... }

  • When "Display next mail after moving current one" is    checked, the keyboard focus problem is fixed.  But when    it's NOT checked, the focus still stays in the invisible text    box Done for the night.  More tomorrow...

I will definitely need to fix that one... I will try to take the focus code out of the condition. Although it would be nicer to have the focus in the message list element if Thunderbird decides to close the tab - problem here is that the move necessarily happens after the go next command. Need to test this some more. In the meantime I have released 4.21.1 for the Thunderbird 68 users because I am starting a 40% off promo this weekend that lasts until May 1st.

Might have to push another maintenance update (4.21.2) over the weekend if I make more changes. Gotta kick this out the door before uploading a version for Tb78 users, but man do I need to earn money right now...

PS: tried to make this comment by replying to the mail but it didn't arrive. So I am making it here again, which is actually easier now that I am familiar with markdown. I just have to always delete all your signature and the whole quoted stuff at the bottom when I do this which is slightly inconvenient. Pity that your plain text mails aren't translated to markdown, stuff like - at the start of the line makes nice bullet points.

So if this comment appears duplicated on your side my apologies

@RealRaven2000
Copy link
Owner

Here is a fix for the "Reopen" I think I made a mistake in the line for the isReopen, it should be:

if (QuickFolders.quickMove.Settings.isReopen) ...

QuickFolders-wx-5.5pre73.zip

According to my tests, when the other one (go next) is disabled THunderbird inexplicably goes to the message after the next. no idea why. I have seen it close the tab before, so not sure yet why that's going on. It's hard to tell as moving the message is done asynchronously by Tb, so I can't just react directly from my code in this case - I might have to set up an event listener and micro manage whatever Thunderbird does in this case ... which is a recipe for disaster because it forces me to guess so many internal things that may change further down the line. And Shift-M is literally the only case I can control, there are many more ways the message can be moved as you pointed out.

@RealRaven2000
Copy link
Owner

Implemented in in 5.5 / 4.21.2 published today

@RealRaven2000 RealRaven2000 unpinned this issue Apr 18, 2021
@fredstluka
Copy link
Author

fredstluka commented Apr 26, 2021 via email

@fredstluka
Copy link
Author

fredstluka commented Apr 26, 2021 via email

@fredstluka
Copy link
Author

fredstluka commented Apr 26, 2021 via email

@fredstluka
Copy link
Author

fredstluka commented Apr 26, 2021 via email

@fredstluka
Copy link
Author

fredstluka commented Apr 26, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants