-
Notifications
You must be signed in to change notification settings - Fork 42
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
no longer delete all source widgets each update #893
no longer delete all source widgets each update #893
Conversation
438da27
to
cb4d8dc
Compare
rebased to keep this still ready for review |
i gathered some perf data and it looks like n=100 sourcesbefore
after
n=400 sourcesbefore
after
|
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.
this looks great, a few thoughts inline
if self.currentRow() > -1: | ||
has_source_selected = self.item(self.currentRow()).isSelected() | ||
current_source = self.get_current_source() | ||
current_source_id = current_source and current_source.id |
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.
confirming: since we no longer need to redraw the whole view, we don't need this logic to preserve the current source selection
self.source_widgets[source.uuid] = new_source | ||
|
||
list_item = QListWidgetItem() | ||
self.insertItem(0, list_item) |
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.
ensuring that new sources are placed at the top of the list ✅
just need to update tests and rebase but i addressed @redshiftzero's PR comment https://github.com/freedomofpress/securedrop-client/pull/893/files#r390031326 about this introducing an |
3ed5c88
to
12d5905
Compare
d3c5d0a
to
571b6a0
Compare
571b6a0
to
cd7a585
Compare
okay this is ready now |
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.
my comments are addressed, thanks
Description
Fixes #905
Fixes #352
We currently delete all source widgets and recreated them every time a user logs in, a user deletes a source, and whenever the client syncs with the server.
This PR makes it so only add source widgets when there are new sources and delete source widgets when the source has been deleted.
Performance testing on a large source list will need to be done over the next day or so. Also we should check if this helps with the flicker issue.
Test Plan
Make sure there are no regressions. This is a refactor so the source list should behave the same.
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: