-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add download conversation #1388
Add download conversation #1388
Conversation
securedrop_client/gui/widgets.py
Outdated
@@ -3918,6 +3930,26 @@ def __init__(self, source: Source, controller: Controller) -> None: | |||
|
|||
self.addAction(DeleteConversationAction(self.source, self, self.controller)) | |||
self.addAction(DeleteSourceAction(self.source, self, self.controller)) | |||
self.addAction(DownloadSelectedConversation(self, state, self.controller)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slight pref for a rename to: DownloadConversationAction
, similar to DeleteConversationAction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went for DownloadConversation
(no ...Action
suffix) because eventually I'd see the actions defined in gui/conversation/actions.py
and used with a prefix:
from securedrop_client/gui/conversation import actions
# prefix --v v-- suffix would be redundant in the 'actions' module
self.AddAction(actions.DownloadConversation(self, state, self.controller))
d6bba42
to
eacd78e
Compare
(rebase with no changes) |
eacd78e
to
d0468af
Compare
For the sprint starting 1/5, we will aim to get this PR fully to "Ready for review", including front-end changes and the test plan. |
4a24b98
to
ff26391
Compare
(rebase) |
d0bcb6e
to
c35c68f
Compare
c17f37d
to
33b094a
Compare
Consolidated commits, added tests. The last four commits are still very draft-y. |
bfa9f9c
to
8f1da1d
Compare
Hello! Looks like a botched rebase, so I'll fix it up and finish the approval. |
👍 (I've got a local backup too, if needed.) |
@gonzalo-bulnes 💯 if you're able to work today, please feel free to fix this up and ping me when finished (sorry about the extra work) |
👌 @creviera! No worries! |
Except for user actions (QAction), the GUI widgets should not need more than read-only access to the application state. The user actions should become the interface for the GUI to modify the application state. On properties, see https://realpython.com/python-property
This action will eventually be moved out of widgets.py into an actions.py module, that's why its name doesn't contain the "*Action" suffix.
Add file_download_started signal to Controller
The action should be disabled when there are no files to download.
...from the persitance layer when the application is started. Eventually, the GUI could depend exclusively on state.State, and a method could be added to persist it to the database. That would remove the necessity to setup a database in order to use the GUI. When present, such a database would allow state to persist across restarts, which is exactly its role. In particular, the database would not be responsible for transporting information between different parts of the GUI. That repsonsibility would be that of state.State, which can have whatever internal structure is best suited to the task, without any constraint related to database data layout. This can be done progressively, by expanding the Database collection of methods as convenient.
If information about the conversation files is available, the action should be enabled on disabled accordingly.
Ensure that the menu sub-section titles are closer to the sub-section items than they are the last item is to the next sub-section title. Ensure that the action items are clickable from one edge of the menu to the other (like standard menu items). Increase the menu items size (area). See https://lawsofux.com/law-of-proximity and https://lawsofux.com/fittss-law 🍐 @ninavizz
06a3102
to
f5f11b4
Compare
Rebased @creviera - I had a few core dumps from For info, the conflicts were:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran through the test plan again, and this still looks good. I'm going to create a followup issue for something I'd rather be worked on outside of this PR (since the PR is already pretty large) and it's a minor issue around needing to disable the "Download All" option if all conversation items have been deleted.
Description
Closes #1354
Please refer to the issue for context.
Summary:
Ctrl+D
).This feature is a prerequisite to introducing the possibility of exporting a entire conversation at once.
🍐 @creviera
Implementation Decisions
state.State
.state.State
structure exclusively: both the controller and the database are abstracted away from the GUI. (Scope: only for this feature. We can propagate the pattern later if we like.)state.State
with the database. (Adatabase.Database
object was introduced for clarity of the API and ease of testing.)Reference diagram
Reference screenshots
This is what things should look like. (These were taken in a development environment, the original mockups are in #1354).Test Plan
Note: Thorough the test plan, please try to activate the "All Files" action menu by clicking on it, but also using the Ctlr+D shortcut.
Note on Qubes OS: Performing the testing in at least one Workstation is necessary, because some of the UI may behave differently on Qubes OS (e.g. the conversation menu will be framed by the label color of the
sd-app
qube.)It's a fairly long test plan, here we go!
Take a breath!
Next comes testing the sync.
Take a breath again : )
Remain some steps specific to using the keyboard shortcut.
Thanks for sticking through! Last but not least, please let me know of any scenarios you'd test that I didn't think of : ) ⭐
Bonus points for getting the client into an inconsistent state! 🌟
Checklist
If these changes modify code paths involving cryptography, the opening of files in VMs or network (via the RPC service) traffic, Qubes testing in the staging environment is required. For fine tuning of the graphical user interface, testing in any environment in Qubes is required. Please check as applicable:
These changes should not need testing in QubesIf these changes add or remove files other than client code, the AppArmor profile may need to be updated. Please check as applicable:
If these changes modify the database schema, you should include a database migration. Please check as applicable:
main
and confirmed that the migration applies cleanlymain
and would like the reviewer to do so