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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to close a mail without logging out #456

Closed
TheDcoder opened this issue Nov 5, 2021 · 20 comments
Closed

Add option to close a mail without logging out #456

TheDcoder opened this issue Nov 5, 2021 · 20 comments

Comments

@TheDcoder
Copy link

Hi, It would be nice to have a "close tab" button or option which would unload the mail. It can be done by logging out but this defeats the purpose of a persistent session 馃槄

@vladimiry
Copy link
Owner

The requested feature is enabled since v4.9.0/Nov-2020. See the animated demo here #316 (comment).

@TheDcoder
Copy link
Author

@vladimiry My bad, I should've phrased my request correctly.

While the feature you mentioned does technically do what I want, this is not what I had in mind. Disabling an account will close the mail and the tab as well.

But what I want to do is just close the mail, i.e make it return to the original state where it waits for me to click on it before loading it. I have the "Login on account selection" option selected.

So would it be possible to "logout" without actually logging out from the ProtonMail session? (The tab would still be there, but unselected).

@TheDcoder TheDcoder changed the title Add option to close a tab/mail without logging out Add option to close a mail without logging out Nov 5, 2021
@vladimiry
Copy link
Owner

vladimiry commented Nov 5, 2021

I have the "Login on account selection" option selected.

This feature is put into the advanced block, so for advanced users, which I think is not a majority of the users.

The requested feature respectively would also be the feature for advanced users. Yes, this is possible to do. I imagine there would be an additional opt-in button added into the account's handle button, next to the local store toggle. It should be an opt-in feature/button as it's certainly not for everyone and if it gets enabled by default for everyone then it would likely be annoying for average user to see useless buttons on the screen.

No estimation here. The workaround exists, see #456 (comment).

So would it be possible to "logout" without actually logging out from the ProtonMail session? (The tab would still be there, but unselected).

To be precise, this would not be the logout action, but more like unloading the page with a @ProtonMail web client (more exactly dropping the page-relative container/webview).

@TheDcoder
Copy link
Author

I wasn't aware that it was in the advanced block, thought it would be pretty common among those who have multiple emails 馃槃

To be precise, this would not be the logout action, but more like unloading the page

Yes, exactly! That is why I tried to described it as "closing the tab" even though it's very misleading to think of it that way. Unload sounds much better.

Thanks for considering the request, maybe it can be implemented via a context menu that would open when the user right-clicks on the tab? Sounds like a feature that an advanced user would use 馃槈

@vladimiry
Copy link
Owner

I imagine there would be an additional opt-in button added into the account's handle button, next to the local store toggle.

The alternative option is assigning the action to the pressed Ctrl + mouse click combination (or something similar). This would require less effort for implementation as no significant UI tweaking gets involved (no need to add buttons, deal with CSS/styling to please the 3 views mode: tabs, left column, narrow left column, etc).

@vladimiry
Copy link
Owner

vladimiry commented Nov 5, 2021

Yes, exactly! That is why I tried to described it as "closing the tab" even though it's very misleading to think of it that way. Unload sounds much better.

Btw, the alternative option to freeze the account activity is to completely disable the network connection for this account, so like "go offline" mode. I mean instead of unloading the page. The page would still be loaded in this case and so no related memory releasing happens. I see this option as easier in implementation but I guess there might be potential negative implications if the account gets into the offline mode for long period (should not really be and I believe can be handled if any).

Thanks for considering the request, maybe it can be implemented via a context menu that would open when the user right-clicks on the tab?

Sounds good as in this case we could extend the menu with new items/actions in the future if needed.

@TheDcoder
Copy link
Author

Btw, the alternative option to freeze the account activity is to completely disable the network connection for this account, so like "go offline" mode.

That sounds useful, but it's a different feature IMO. I was specifically looking to unload and release the memory resources.

Sounds good as in this case we could extend the menu

Glad to hear that, that was part of my rationale too.

@vladimiry
Copy link
Owner

vladimiry commented Nov 9, 2021

I seem to come up with a not very time-consuming implementation option - doing it via toggling the "on the fly" account's disabling state (like #316 (comment) but without saving the disabling state). So the feature is likely to come in the next release.

vladimiry added a commit that referenced this issue Nov 9, 2021
* Done in a hacky way for now: via the "WebAccount.disabled" prop toggling.
@vladimiry
Copy link
Owner

Here is how it's going to look/work:
custom actions context menu

@TheDcoder
Copy link
Author

@vladimiry That looks great!

By the way, what's the "plug" icon inside the tab?

@vladimiry
Copy link
Owner

By the way, what's the "plug" icon inside the tab?

The button for toggling between the @ProtonMail / live and the local store view mode. The blinking in the green icon indicates that the background mails syncing is in progress (downloading mails to local store, etc).

vladimiry added a commit that referenced this issue Nov 10, 2021
* Done in a hacky way for now: via the "WebAccount.disabled" prop toggling.
@vladimiry
Copy link
Owner

Available in v4.13.0 release.

@TheDcoder
Copy link
Author

Thanks for adding this feature.

There is a minor bug I have noticed with the implementation though, when the custom actions are disabled, you get a "Copy email address" option inside a context menu, but with it enable this is overridden by the newer context menu, thus rendering the original menu inaccessible.

This "copy email" function could be merged into this new menu. I don't use this feature but had to report it after I noticed it during testing.

@vladimiry
Copy link
Owner

vladimiry commented Nov 11, 2021

@TheDcoder I've noticed that too of course but left it that way for now. Not really a bug. The link copying feature was a generic one enabled by a global "context-menu" handler and now the menu replaces the global "context-menu". So yes if the mail link copy feature is in demand then the menu needs to be extended.

@TheDcoder
Copy link
Author

I found a bug with the context menu, new accounts which are added in the current session don't get assigned the new menu, I see the generic global context menu for it:
image

@vladimiry
Copy link
Owner

I found a bug with the context menu, new accounts which are added in the current session don't get assigned the new menu, I see the generic global context menu for it:

Not reproducible. Make sure you have enabled the Enable the "custom actions" context menu on the account handle button #456 toggle for this account. Currently, this is an opt-in per-account feature, so needs to be enabled for each account individually.

@TheDcoder
Copy link
Author

Oops... I forgot that it is an opt-in feature. Why not make it the default though? I don't think we need the "Copy Email Address" feature now as ProtonMail natively supports it via the account details in the upper right corner. Or we could just merge it with the new custom actions menu and remove this configurability option entirely 馃槃

@vladimiry
Copy link
Owner

vladimiry commented Apr 13, 2022

Why not make it the default though?

This is a goal but I normally prefer to test the stuff in action first. So one day it's going to become a default behavior. Before making it default, I think I will add the "edit" action to the menu, so it doesn't look weird with just a single action.

@TheDcoder
Copy link
Author

That sounds good to me! I use the "unload" feature regularly and I've never had any issues with it.

@vladimiry
Copy link
Owner

vladimiry commented Apr 13, 2022

So one day it's going to become a default behavior. Before making it default, I think I will add the "edit" action to the menu, so it doesn't look weird with just a single action.

This has been implemented in the "wip" branch (menu enabled to all accounts + "edit" action).

context-menu

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