Closed Bug 954981 Opened 11 years ago Closed 6 years ago

Reopen recently closed tabs

Categories

(Instantbird Graveyard :: Conversation, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: clokep, Unassigned)

Details

Attachments

(1 file, 3 obsolete files)

*** Original post on bio 1549 at 2012-06-26 18:22:00 UTC ***

In Firefox Ctrl+Shift+T reopens a previously closed tabs...I find myself doing this frequently in Instantbird. :)
*** Original post on bio 1549 at 2012-10-17 09:19:59 UTC ***

That's frequently happening for me too. It should be fairly easy for conversations that were put on hold but for consistency it should also work with any other conversation of course.
*** Original post on bio 1549 at 2012-11-27 14:22:46 UTC ***

When reopening a tab we should also preserve the text that was in the input box (and if we want to do it really perfectly, maybe also the cursor position/current selection but it probably matters less). That also applies to conversations on hold by the way.
*** Original post on bio 1549 at 2013-06-11 17:10:35 UTC ***

This could be fairly easy, especially after bug 953867 (bio 426) lands! :)
Attached patch Patch (obsolete) — Splinter Review
This allows re-opening the last closed conversation with Cmd/Ctrl+Shift+T
Todo:
-Use better names than "undotabclose" etc
-Make this work after putting a conv on hold
-???
Assignee: nobody → nhnt11
Status: NEW → ASSIGNED
Attachment #8382603 - Flags: feedback?(florian)
Attached patch Patch v2 (obsolete) — Splinter Review
Now works for convs on hold as well, so requesting review.
This currently allows a user to undo closing a conversation already on hold. Not sure if this is the expected/desired behavior or not.
Attachment #8382603 - Attachment is obsolete: true
Attachment #8382603 - Flags: feedback?(florian)
Attachment #8382689 - Flags: review?(florian)
Attached patch Patch v3 (obsolete) — Splinter Review
Forgot to do a qref, sorry.
Attachment #8382689 - Attachment is obsolete: true
Attachment #8382689 - Flags: review?(florian)
Attachment #8382690 - Flags: review?(florian)
Attached patch Patch v4Splinter Review
This patch makes sure the menu item gets disabled when reopening isn't possible.
Attachment #8382690 - Attachment is obsolete: true
Attachment #8382690 - Flags: review?(florian)
Attachment #8382692 - Flags: review?(florian)
I've created an addon to test this out (https://addons.instantbird.org/en-US/instantbird/addon/364). Some thoughts after using it a couple days:
-Closing a conversation, opening it again via the awesometab or whatever, and then pressing Cmd+shift+T results in the just opened conversation being focused - i.e. nothing visibly happens.
-Closing a conversation with a contact using one protocol, and opening a conversation with the same contact but using a different protocol, then pressing cmd+shift+t results in the protocol being switch to the first one - which is weird.
-Closing a conversation and then switching the protocol on another conversation causes the first conversation to be "forgotten". We shouldn't be counting protocol switches as "closing" a conversation.
-This could easily be extended to remember more than just one conversation using by pushing/popping the conv name and account id to/from a simple array
(In reply to Nihanth Subramanya [:nhnt11] from comment #8)
> I've created an addon to test this out
> (https://addons.instantbird.org/en-US/instantbird/addon/364). Some thoughts
> after using it a couple days:
> -Closing a conversation, opening it again via the awesometab or whatever,
> and then pressing Cmd+shift+T results in the just opened conversation being
> focused - i.e. nothing visibly happens.
> -Closing a conversation with a contact using one protocol, and opening a
> conversation with the same contact but using a different protocol, then
> pressing cmd+shift+t results in the protocol being switch to the first one -
> which is weird.
> -Closing a conversation and then switching the protocol on another
> conversation causes the first conversation to be "forgotten". We shouldn't
> be counting protocol switches as "closing" a conversation.
> -This could easily be extended to remember more than just one conversation
> using by pushing/popping the conv name and account id to/from a simple array

Wouldn't it make sense to clear the memory of what tab(s) have been closed whenever a new tab is opened? It would resolve some of these issues.
Comment on attachment 8382692 [details] [diff] [review]
Patch v4

Review of attachment 8382692 [details] [diff] [review]:
-----------------------------------------------------------------

The approach in this patch seems fragile to me. I think you could have something much more reliable if you weren't trying to recreate conversations, but only to undo closing a tab. What I mean is when a user closes a tab, you could store somewhere the imIConversation instance that was associated with the tab... and just reopen a tab for that imIConversation if the user wants to undo.
This means that for private conversations, they would no longer be closed immediately (I think we could still close them after a few minutes, and drop the reference to the conversation object). MUCs are already put on hold instead of closed when we close a tab.

::: im/content/menus.xul
@@ +48,5 @@
>      <menu label="&file.menu;" id="fileMenu" accesskey="&file.accesskey;">
>        <menupopup id="fileMenuPopup" onpopupshowing="menus.updateFileMenuitems();">
>          <menuitem id="addBuddyMenuItem" label="&addContact;" command="cmd_addbuddy" key="addBuddykey" accesskey="&addContact.accesskey;"/>
>          <menuitem id="newTabMenuItem" label="&newtab;" command="cmd_newtab" key="newtabkey" accesskey="&newtab.accesskey;"/>
> +        <menuitem id="undoTabCloseMenuItem" label="&undotabclose;" command="cmd_undotabclose" key="undotabclosekey" accesskey="&undotabclose.accesskey;"/>

Is this really something we want in the File menu?

I would have expected the new menu item to go in the tab context menu. I think that's where the 'Undo Close Tab' item is for Firefox.

::: im/modules/imWindows.jsm
@@ +227,5 @@
> +    let account = Services.accounts.getAccountById(this.lastConvAccountId);
> +    if (account) {
> +      this.focusConversation(account.createConversation(this.lastConvName));
> +      if (this.lastConvWasChat)
> +        account.joinChat(account.getChatRoomDefaultFieldValues(this.lastConvName));

I would be surprised if this worked for XMPP MUCs.

And are you really calling account.createConversation first and then account.joinChat... for the same conversation?
Attachment #8382692 - Flags: review?(florian) → review-
Assignee: nhnt11 → nobody
Status: ASSIGNED → NEW
On the behalf of Florian:
Closing bugs related to the Instantbird UI as WONTFIX, as the development of the standalone chat client Instantbird has stopped. Instantbird users are encouraged to migrate to Thunderbird. The user interface of instant messaging in Thunderbird will feel familiar, as the Thunderbird IM support started as a fork of Instantbird.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
On the behalf of Florian:
Closing bugs related to the Instantbird UI as WONTFIX, as the development of the standalone chat client Instantbird has stopped. Instantbird users are encouraged to migrate to Thunderbird. The user interface of instant messaging in Thunderbird will feel familiar, as the Thunderbird IM support started as a fork of Instantbird.
On the behalf of Florian:
Closing bugs related to the Instantbird UI as WONTFIX, as the development of the standalone chat client Instantbird has stopped. Instantbird users are encouraged to migrate to Thunderbird. The user interface of instant messaging in Thunderbird will feel familiar, as the Thunderbird IM support started as a fork of Instantbird.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: