Repository navigation
Conversation
atahan150
marked this pull request as ready for review
October 31, 2026 20:06
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
When downloads are organized by chat, a page script reports the title of the conversation the user last pressed in through the existing web channel bridge. Presses in the chat list or drawers report no chat; floating layers such as the media viewer and menus keep the previous value. The view keeps the title for the download manager, drops the Save As suggestion only when a different chat is opened, and forgets the title on page loads, conversation close, renderer crashes and teardown. The setting applies live to every open account through its change signal. Tests: - python -m unittest tests.test_chat_folder_tracker tests.test_download_settings tests.test_resizable_chat_list tests.test_quick_access_integration - python -m unittest discover -s tests (no new failures besides the documentation structure check) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Chat titles made only of Unicode whitespace (no-break or ideographic spaces) or dots produced a "download" folder. They now yield no chat folder, so the file goes to the download directory. Tests: python -m unittest tests.test_download_settings Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_ensure_target_directory now only creates a missing chat folder and leaves any existing directory alone. _begin_download catches only RuntimeError and ValueError again, so failures other than the chat folder fallback behave as before the feature. Tests: python -m unittest tests.test_download_settings Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In dialog mode DownloadDialog shows and opens download.downloadDirectory(), which now points at the chat folder. Create it before building the dialog; if it cannot be prepared, log and discard the unstarted download instead of letting the error escape the Qt slot. Tests: python -m unittest tests.test_download_settings Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous containment test used "../x", which is sanitized before the containment check runs. A chat folder that is a symlink to a directory outside the download directory now exercises the check and the fallback to the configured directory. Also drop a stray blank line (E303). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A chat opened with the keyboard changes the header without a pointer press, so a later click on a menu or the media viewer kept the previous title and the download went to the wrong folder. On a floating layer the tracker now re-reads the open chat title once and reports no chat when it no longer matches. A title attribute holding only whitespace now falls back to the header text. Tests: python -m unittest tests.test_chat_folder_tracker Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Check close_conversation, the skipped tracker reset while shutting down or with the setting off, the render crash and loadStarted in separate tests, so a failure names the behaviour that broke. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Describe dialog mode creating the folder before DownloadDialog opens and Ask every time creating it before the picker only without a remembered Save As folder. Document the tracker re-reading the header on floating layers, move its paragraph after the New chat paragraph it was splitting, list the new tests and split the CHANGELOG sentence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Files downloaded from the right drawer (contact or group info and its media tab) belong to the open chat, so the tracker now reports the chat title there instead of falling back to the download directory. The left drawer, chat list and all-chats media gallery still report no chat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The right drawer links to the all-chats media gallery, a floating dialog outside the main screen. Clicks there kept the open chat title, so files from any chat were saved into that chat's folder. Presses inside the gallery now report no chat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The chat folder switch description still said files from contact info go to the download directory. Update it for the right drawer and the all-chats media gallery, and refresh the tr, pt_BR and zh_CN translations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pport Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
atahan150
force-pushed
the
feat/downloads-chat-folders
branch
from
November 16, 2026 06:37
111b0a9 to
e319df4
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
All downloads land in one folder (by default
~/Downloads/WhatsApp). People who download a lot of media cannot tell which chat a file came from without opening WhatsApp again.What this adds
A new switch under Settings > Downloads: "Save to a folder named after the chat". It is off by default, so nothing changes for existing users.
When it is on, a file is saved into a subfolder of the download directory named after the chat it came from, e.g.
~/Downloads/WhatsApp/Family/. The folder is created when the first file is saved.system/download_pathis never changed._, the existingsanitize_file_nameis reused, and a title with nothing visible left falls back to the download directory. The folder is always checked to stay inside the download directory, including through symlinks.How it works
A small page script,
chat_folder_tracker.js, is only installed while the setting is on. It watches pointer presses and tells ZapZap the open chat title through the existing themeQWebChannel(no second channel is created). The last press decides:#mainor the right drawer → the open chat title;The title is cleared on page load, renderer crash, closing the conversation and teardown. Turning the setting on or off reaches every open account through a new
download_settings_events.organize_by_chat_changedsignal, following thepdf_click_behavior_changedpattern.Tests
tests/test_chat_folder_tracker.pyand new cases intests/test_download_settings.py: the click rule, emoji titles (img alt), late or missing bridge, reset/destroy, a single listener after reinstall, folder creation before the dialog, fallback whenmakedirsfails, symlinks leaving the base folder, Unicode blank titles, and the settings switch.com.rtosta.zapzap7.5.1 runtime), as inAGENTS.md: 813 tests. The only failures are the same 8 that fail onmainat 082e06c for me: 4 dictionary UI errors, the accounts context menu, the macOS PyInstaller packaging check and 2 zh_CN catalog tests.test_update_checkerhover failed once in a full run and passed 3/3 alone; it looks flaky and is unrelated.check_unused_code.py --packages-only,test_documentation_structure.py,compileallandgit diff --checkpass.Not tested
Notes
docs/architecture.mdanddocs/testing.md, and the changelog entry is under7.5.2 - In development.tools/translation_manager.py.🤖 Generated with Claude Code