-
Notifications
You must be signed in to change notification settings - Fork 19
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
PE-6752: hide drives #1892
PE-6752: hide drives #1892
Conversation
Visit the preview URL for this PR (updated for commit 9f47a53): https://ardrive-web--pr1892-pe-6752-hide-drives-16psnjy3.web.app (expires Mon, 04 Nov 2024 17:58:05 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: a224ebaee2f0939e7665e7630e7d3d6cd7d0f8b0 |
- implement unit tests for the global_hide_bloc and user_prefs repository.
- fix infinite updates reacting to changes on user prefs repo
fix tests
lib/blocs/hide/hide_bloc.dart
Outdated
} else if (entryIsFolder) { | ||
newFolderEntry = currentEntry.copyWith( | ||
isHidden: isHidden, | ||
lastUpdated: DateTime.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.
recommend declaring the timestamp as a const and then using it
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.
lib/blocs/hide/hide_bloc.dart
Outdated
final hideAction = entryIsFile | ||
? (isHidden ? HideAction.hideFile : HideAction.unhideFile) | ||
: (isHidden ? HideAction.hideFolder : HideAction.unhideFolder); | ||
: entryIsDrive | ||
? (isHidden ? HideAction.hideDrive : HideAction.unhideDrive) | ||
: (isHidden ? HideAction.hideFolder : HideAction.unhideFolder); |
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.
recommend declaring hide action up top and leveraging the if-if-else case above to set it
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.
lib/components/app_top_bar.dart
Outdated
tooltip: hideState is ShowingHiddenItems | ||
? 'Hide hidden items' | ||
: 'Show hidden items', | ||
icon: hideState is ShowingHiddenItems | ||
? ArDriveIcons.eyeOpen( | ||
color: colorTokens.textMid, | ||
) | ||
: ArDriveIcons.eyeClosed( | ||
color: colorTokens.textMid, | ||
), |
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.
seems like you could combine these ternaries
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.
content: ArDriveDropdownItemTile( | ||
name: item.isHidden | ||
? appLocalizationsOf(context).unhide | ||
: appLocalizationsOf(context).hide, | ||
icon: item.isHidden | ||
? ArDriveIcons.eyeOpen(size: defaultIconSize) | ||
: ArDriveIcons.eyeClosed(size: defaultIconSize), | ||
), | ||
), |
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.
seems possible to combine ternaries here
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.
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 meant more like:
content: ArDriveDropdownItemTile(
item.isHidden ? {
name: appLocalizationsOf(context).unhide,
icon: ArDriveIcons.eyeOpen(size: defaultIconSize)
} : {
name: appLocalizationsOf(context).hide,
icon: ArDriveIcons.eyeClose(size: defaultIconSize)
}
)
- refactor timestamp and action variables - remove the option to toggle hide state on the drive explorer (we don't use it anymore) - refactor where uses the drive detail state to know if we're showing hidden images
- refactor setHideStatus method
…dden-items-icon-on-android PE-7037: missing hide show hidden items icon on android
9f47a53
--- Releases ---
Android release: https://appdistribution.firebase.google.com/testerapps/1:305132849030:android:6cf0cd5ec064fad3ffce07/releases/4jrrs20qbdlv8