morethanwords / tweb

Telegram Web K, GPL v3
https://web.telegram.org/k/
GNU General Public License v3.0
1.86k stars 595 forks source link

[Feature Request] Enhance Return Function for Navigation to Last Viewed Chat #354

Open honglin-signo opened 1 month ago

honglin-signo commented 1 month ago

Summary: I would like to enhance the return function in the Telegram web app to allow users to navigate back to the last viewed chat when clicking the return button on the top navigation bar.

Current Behavior: After reviewing the source code, it seems that the original design only supports the return function in specific cases (e.g., navigating back to Saved Chats, Search, or Media Playing).

Questions: Could you please clarify the original design logic behind the return functionality and why it was limited to these cases (Saved Chats, Search, Media)?

Is there any design rationale that might have excluded returning to the last viewed chat?

Enhancement Proposal: I’m considering implementing a feature where the return button on the top navigation returns the user to the last viewed chat. I’ve identified two potential ways to achieve this:

Using an API call to fetch the last viewed chat id. Caching the previous chat state locally. However, both approaches may not provide the best performance. Would you be able to suggest a more efficient way to get previous chat id?

Any guidance or insights would be much appreciated. Thanks!