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

[FEATURE] Option to choose between different / preferred designs for the HTML outcome? #97

Open
2 of 3 tasks
Marvolo1590 opened this issue Apr 28, 2024 · 21 comments
Open
2 of 3 tasks
Assignees
Labels
enhancement New feature or request html Issue related to the HTML output

Comments

@Marvolo1590
Copy link

Marvolo1590 commented Apr 28, 2024

Is your feature request related to a problem? Please describe.

My feature wish is not part of a "problem". I know that this script is relying on a Telegram-like design. However, it would probably upgrade this (already awesome) script by a lot, if there was an option to choose between different designs for the HTML outcome.

Describe the solution you'd like
Option to choose between different designs for the HTML files:

Like:

  • Telegram design
  • WhatsApp Web design
  • other (?)

The chat bubbles known from the original WhatsApp design (inluding the bubbles for quoted messages) would make the oucome a lot more readable, at least for me, as I'm struggling a bit with the Telegram design where all the messages appear just right beneath each other with little visual markers to differentiate between own and other messages. The original WhatsApp bubbles to the left and right hand side of the chat make it a lot clearer and more navigable.

So, an option to choose between preferred designs would serve both parties, those who prefer the Telegram design and those who prefer the original WhatsApp design.

Additional context
NONE

@KnugiHK KnugiHK added the enhancement New feature or request label Apr 28, 2024
@Marvolo1590
Copy link
Author

Marvolo1590 commented Jun 15, 2024

Update:

Maybe this will help to implement the WhatsApp design. These sites list WhatsApp design code for HTML, CSS and JS:

@KnugiHK
Copy link
Owner

KnugiHK commented Jun 18, 2024

Update:

Maybe this will help to implement the WhatsApp design. These sites list WhatsApp design code for HTML, CSS and JS:

* https://codepen.io/swaibu/pen/QxJjwN

* https://www.codewithfaraz.com/content/114/create-a-whatsapp-web-interface-clone-using-html-and-css

Thanks for finding the references. However, I need to review the copyright issues before adopting the code and style. For example, I will likely release the theme in a separate repository.

@code-consensus
Copy link

@KnugiHK check out WhatsApp Exporter on github -- there is implemented a WhatsApp-style theme using CSS that looks really great, almost exactly like on the phone. The project says GPL 3.0 in terms of license.

@KnugiHK
Copy link
Owner

KnugiHK commented Sep 7, 2024

@KnugiHK check out WhatsApp Exporter on github -- there is implemented a WhatsApp-style theme using CSS that looks really great, almost exactly like on the phone. The project says GPL 3.0 in terms of license.

Unfortunately, MIT is not compatible with GPL 3.0.

@KnugiHK
Copy link
Owner

KnugiHK commented Sep 7, 2024

But the good news is that the codepen implementation mentioned by @Marvolo1590 is MIT, according to https://blog.codepen.io/documentation/licensing/!

@KnugiHK KnugiHK added the html Issue related to the HTML output label Sep 9, 2024
@KnugiHK
Copy link
Owner

KnugiHK commented Sep 20, 2024

I created a theme similar to WhatsApp Web using Claude. Of course, it is an overview only and has yet been implemented to be used with the exporter. Anyway, comments are welcome!
image

@code-consensus
Copy link

I created a theme similar to WhatsApp Web using Claude. Of course, it is only an overview only and has yet been implemented to be used with the exporter. Anyway, comments are welcome!

This looks great!

@Marvolo1590
Copy link
Author

I created a theme similar to WhatsApp Web using Claude. Of course, it is only an overview only and has yet been implemented to be used with the exporter. Anyway, comments are welcome!

I created a theme similar to WhatsApp Web using Claude. Of course, it is only an overview only and has yet been implemented to be used with the exporter. Anyway, comments are welcome!

@KnugiHK Amazing. Lovely to know that my feature request is making progress. I believe many will like the option to choose between different layout.

I very much like the contacts' list on the left. This would be a major advantage to the current Telegram-based output where each chat ends up as an individual html file. Having a chat list like here would make it a lot more convenient. Maybe it would be possible to still have all the chats as individual html files and additionally a master-html file, joining them all together and using a chat list area like in the screenshot?

Anyway, keep it up!

PS: oops, must have hit the wrong button and this thread closed itself. I hope it's now active and open again, if not, maybe you can set it back to how it was before.

@KnugiHK
Copy link
Owner

KnugiHK commented Sep 25, 2024

I created a theme similar to WhatsApp Web using Claude. Of course, it is only an overview only and has yet been implemented to be used with the exporter. Anyway, comments are welcome!

I created a theme similar to WhatsApp Web using Claude. Of course, it is only an overview only and has yet been implemented to be used with the exporter. Anyway, comments are welcome!

@KnugiHK Amazing. Lovely to know that my feature request is making progress. I believe many will like the option to choose between different layout.

I very much like the contacts' list on the left. This would be a major advantage to the current Telegram-based output where each chat ends up as an individual html file. Having a chat list like here would make it a lot more convenient. Maybe it would be possible to still have all the chats as individual html files and additionally a master-html file, joining them all together and using a chat list area like in the screenshot?

Anyway, keep it up!

PS: oops, must have hit the wrong button and this thread closed itself. I hope it's now active and open again, if not, maybe you can set it back to how it was before.

I planned to implement the template using an iframe, with an index.html file serving as the master file. However, I anticipate that the changes required could potentially disrupt the current template, so maintaining compatibility will also need to be carefully addressed.

@KnugiHK KnugiHK self-assigned this Sep 25, 2024
@suzarte
Copy link

suzarte commented Oct 10, 2024

Hello @KnugiHK, do you already have something we can test? I'm available to test it if it helps you.

@KnugiHK
Copy link
Owner

KnugiHK commented Oct 11, 2024

Hello @KnugiHK, do you already have something we can test? I'm available to test it if it helps you.

I haven’t started coding it yet, but I’ll definitely share it with you for testing when it’s ready. Stay tuned!

@KnugiHK
Copy link
Owner

KnugiHK commented Jan 1, 2025

Happy New Year, everyone! 🎉 We’re making great progress on the WhatsApp theme, and I wanted to give you all an exclusive preview. Feel free to share any feedback!

image

@Marvolo1590
Copy link
Author

Happy New Year, everyone! 🎉 We’re making great progress on the WhatsApp theme, and I wanted to give you all an exclusive preview. Feel free to share any feedback!

image

Happy New Year to you too!
The WhatsApp design looks very promising! For me, it's so much more convenient to read than the Telegram design where I have problems figuring out which message bubble belongs to whom..
I like the different colours (green & white) to indicate the different chat partners, also that they're far apart from each other to the left and right.

In the meantime, I have merged a lot of my WhatsApp chats together (for example, when people got a new phone number and hence had a whole new WA-chat) back to one and repaired some missing media files that were not displaying inside the chats anymore.
I have them all ready in a msgstore.db file for chat-export now. It's time to get them all off the phone and on the PC for archiving. So I can't wait to use this design...

However, one thing I've been noticing with the current script (Telegram design): the larger the chat files get, the longer it seems to take my browser to render all the chats within the HTML file, especially when all the media are included. Due to the chat merging I've described above, I have some chats that now date back to 2015 and have over 10.000 of different media. The export HTML file is 60 MB (60.000 KB) large. If I open that with my default browser (FireFox) it takes forever to scroll through all the chats and the media.
I have noticed that using different browsers might speed it up, but I haven't found one yet where everything runs fluently..

Would exporting it into a PDF file (with media files included) work better than HTML? Or are my files simply too large to work properly?

Anyway, as always, thanks a lot for your great effort. I've been advertising this project and script together with a step-by-step manual in one of my most frequent computer / android web boards, also telling them that a WhatsApp-based design might be available soon...

@KnugiHK
Copy link
Owner

KnugiHK commented Jan 1, 2025

However, one thing I've been noticing with the current script (Telegram design): the larger the chat files get, the longer it seems to take my browser to render all the chats within the HTML file, especially when all the media are included. Due to the chat merging I've described above, I have some chats that now date back to 2015 and have over 10.000 of different media. The export HTML file is 60 MB (60.000 KB) large. If I open that with my default browser (FireFox) it takes forever to scroll through all the chats and the media. I have noticed that using different browsers might speed it up, but I haven't found one yet where everything runs fluently..

Yes, the size issue is inevitable. You can use the --size option to split the chat into multiple HTML files, which should help speed up rendering in browsers. In addition, I've been working on ways to reduce the HTML file size, such as using the tag, optimizing redundant sections, and other methods. If anyone has additional suggestions for further reducing the size, please feel free to share!

Would exporting it into a PDF file (with media files included) work better than HTML? Or are my files simply too large to work properly?

It's a great idea to implement. However, I'd consider it more of a feature request, so it would be best to track it as a separate issue.

KnugiHK added a commit that referenced this issue Jan 2, 2025
@KnugiHK
Copy link
Owner

KnugiHK commented Jan 2, 2025

The theme is now ready for testing. To try it out, switch to the dev branch and use the --experimental-new-theme option.

@Marvolo1590
Copy link
Author

The theme is now ready for testing. To try it out, switch to the dev branch and use the --experimental-new-theme option.

So I downloaded the dev branch folder, opened it in CMD and tried to run it on an msgstore.db file as always by using this command:

wtsexporter -a --experimental-new-theme

But it throws an error message:

usage: wtsexporter [-h] [-a] [-i] [-e EXPORTED] [-w WA] [-m MEDIA] [-b BACKUP] [-o OUTPUT] [-j [JSON]]
[--avoid-encoding-json] [--pretty-print-json [PRETTY_PRINT_JSON]] [-d DB] [-k KEY] [-t TEMPLATE]
[-s] [-c] [--offline OFFLINE] [--size [SIZE]] [--no-html] [--check-update] [--assume-first-as-me]
[--no-avatar] [--import] [--business] [--wab WAB] [--time-offset {-12 to 14}] [--date DATE]
[--date-format FORMAT] [--include [phone number ...]] [--exclude [phone number ...]]
[--dont-filter-empty] [--per-chat] [--create-separated-media]
[--decrypt-chunk-size DECRYPT_CHUNK_SIZE] [--enrich-from-vcards ENRICH_FROM_VCARDS]
[--default-country-code DEFAULT_CONTRY_CODE] [--txt [TEXT_FORMAT]]
wtsexporter: error: unrecognized arguments: --experimental-new-theme

@KnugiHK
Copy link
Owner

KnugiHK commented Jan 2, 2025

You will need to reinstall the exporter on the dev branch:

pip install -U git+https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git@dev

@Marvolo1590
Copy link
Author

Marvolo1590 commented Jan 2, 2025

The theme is now ready for testing. To try it out, switch to the dev branch and use the --experimental-new-theme option.

It looks awesome, I'm in love with it already. Just some minor things I've noticed:

The quotes seem to be working properly only for pure text messages. As soon as the quoted message is not a text message but, say, a picture or voice message, it says "replying to ... this message". If you click on that hyperlink it will still take you the quoted message, though. So the hyperlink works. I've included a screenshot showing a comparison to the actual layout inside WhatsApp. In the actual app, the quote just says that it was from "me" and then specifies what kind of media file it is, e.g., a picture, voice message, etc and it also includes a small squared preview of the picture/video. If it's a voice message, the quote contains the length of the message and who sent it.

But I guess the preview of pictures would not be essential or crucial to implement, especially if this means a lot of work.

WA_1F

Screenshot_20250102-173548_WhatsApp

Another thing I've noticed is that the layout inside the browser is quite narrow. It's similiar to a phone screen in height and width. Perhaps, if it's possible, it wouldn't be a bad idea to use the full width of a PC browser window for the HTML design?

WA_2

The last thing (but that's only really a minor aspect) I've noticed is that the emoticons have a different design than the original ones used by WhatsApp-app. I don't know if it is possible to use the same ones as the app does or if there are copyright issues perhaps?

Other than that, it's looking great already! Keep it up! And thanks a lot!

@KnugiHK
Copy link
Owner

KnugiHK commented Jan 14, 2025

@Marvolo1590 Thanks for your comments!

The quotes seem to be working properly only for pure text messages. As soon as the quoted message is not a text message but, say, a picture or voice message, it says "replying to ... this message". If you click on that hyperlink it will still take you the quoted message, though. So the hyperlink works. I've included a screenshot showing a comparison to the actual layout inside WhatsApp. In the actual app, the quote just says that it was from "me" and then specifies what kind of media file it is, e.g., a picture, voice message, etc and it also includes a small squared preview of the picture/video. If it's a voice message, the quote contains the length of the message and who sent it.

This would require changes to the exporter code, not just the template (or at least, it would necessitate additional JavaScript). While I agree that having the ability to preview pictures or videos would be useful, I think it's best treated as a separate feature request due to the effort involved. This is tracked in #128.

Another thing I've noticed is that the layout inside the browser is quite narrow. It's similiar to a phone screen in height and width. Perhaps, if it's possible, it wouldn't be a bad idea to use the full width of a PC browser window for the HTML design?

I can adjust it to fit the browser, but wouldn't that result in the messages being too spaced out, as you mentioned? In the original Telegram-like design, I also felt they were too far apart, which is why I reduced the width to its current size.

The last thing (but that's only really a minor aspect) I've noticed is that the emoticons have a different design than the original ones used by WhatsApp-app. I don't know if it is possible to use the same ones as the app does or if there are copyright issues perhaps?

Technically, the code has no connection to WhatsApp, as we’re using a completely different framework to build the page. However, trying to make it resemble the original could still lead to legal issues, so I believe it’s best not to reference WhatsApp too much since it's proprietary.

@Marvolo1590
Copy link
Author

Another thing I've noticed is that the layout inside the browser is quite narrow. It's similiar to a phone screen in height and width. Perhaps, if it's possible, it wouldn't be a bad idea to use the full width of a PC browser window for the HTML design?

I can adjust it to fit the browser, but wouldn't that result in the messages being too spaced out, as you mentioned? In the original Telegram-like design, I also felt they were too far apart, which is why I reduced the width to its current size.

You're probably right, I guess. Could you maybe share a screenshot of how it looks if the messages fit the browser so we can compare to the current layout?

Other than that (and that's also just a minor thing): would there be an easy way for people to change the overall-language of the exporter? So that the headline is not "Chat history with xxx" but individual in everyone's preferred language? If there was an easy way or option that lets me rewrite that headline by myself, that would already do. No need to implement 50+ pre-translated languages lol.

Another thing that would probably be useful for both designs (Telegram & WhatsApp) would be to implement a search function, just as the original app does. Where you can enter words or phrases and it then comes up with the respective chat where the word was written in. But since this would be a "global search" accross all chats, this would probably require to bundle all chats together into one chatlist window. Alternatively, the search function could be implemented into every single exported chat. But only, if this is not too much effort. Maybe CTRL+F inside the browser would still do the trick.

And the last question: how exactly can I split a chat according to time? Let's say, I wanted to export a chat on a yearly basis, so from January 1st to December 31st. And each year will then become a separate export-HTML? Probably that way, my chats won't end up getting too big and hard to process by my browser as is already the case with very long chats.

Thanks for your work!

@KnugiHK
Copy link
Owner

KnugiHK commented Jan 20, 2025

You're probably right, I guess. Could you maybe share a screenshot of how it looks if the messages fit the browser so we can compare to the current layout?

I’ll get to that later.

Other than that (and that's also just a minor thing): would there be an easy way for people to change the overall-language of the exporter? So that the headline is not "Chat history with xxx" but individual in everyone's preferred language? If there was an easy way or option that lets me rewrite that headline by myself, that would already do. No need to implement 50+ pre-translated languages lol.

Yup. It can be implemented I believe.

Another thing that would probably be useful for both designs (Telegram & WhatsApp) would be to implement a search function, just as the original app does. Where you can enter words or phrases and it then comes up with the respective chat where the word was written in. But since this would be a "global search" accross all chats, this would probably require to bundle all chats together into one chatlist window. Alternatively, the search function could be implemented into every single exported chat. But only, if this is not too much effort. Maybe CTRL+F inside the browser would still do the trick.

As for the search function, that's a great idea! In fact, if you take a look at the source code, you'll see that the search function is already being prepared.

And the last question: how exactly can I split a chat according to time? Let's say, I wanted to export a chat on a yearly basis, so from January 1st to December 31st. And each year will then become a separate export-HTML? Probably that way, my chats won't end up getting too big and hard to process by my browser as is already the case with very long chats.

Although the split feature doesn’t directly support time-based split, you can use the date filter to achieve that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request html Issue related to the HTML output
Projects
None yet
Development

No branches or pull requests

4 participants