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

PE-5254: Hackathon - Hide feature #1530

Merged
merged 113 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
ff9d21f
feat(database): adds the isHidden column to file and folder revision …
matibat Dec 18, 2023
e1807f1
feat(hide bloc): implements the bloc PE-5254
matibat Dec 18, 2023
874619c
test(hide bloc): updates the affected unit tests PE-5254
matibat Dec 18, 2023
58421c1
feat(hide bloc): lets the drive explorer not to show hidden items PE-…
matibat Dec 18, 2023
6ca3fb2
chore(drive detail list): minot fix PE-5254
matibat Dec 18, 2023
fb5fa24
feat(hide bloc): now able to hide folders and files PE-5254
matibat Dec 19, 2023
4a634ea
feat(hide bloc): now able to show hidden files PE-5254
matibat Dec 19, 2023
9db3380
feat(hide bloc): makes it distinguish between hidden and non-hidden i…
matibat Dec 19, 2023
e489781
feat(hide bloc): properly consider hidden folders to be hidden PE-5254
matibat Dec 20, 2023
1d4a980
feat(drive detail): instantly updates the drive detail content when s…
matibat Dec 21, 2023
d8dcdf9
test(arfs version): corrects broken tests PE-5154
matibat Dec 21, 2023
9934496
feat(hide feature): enable for mobile view PE-5354
matibat Dec 22, 2023
85f637d
feat(hide feature): confirmation modal PE-5354
matibat Dec 22, 2023
b31069f
chore(hide feature): removes unused methods PE-5254
matibat Dec 22, 2023
135bbe9
chore(hackathon): cleanup PE-5254
matibat Jan 2, 2024
36aa83e
chore(hackathon): removes unused variables and imports PE-5254
matibat Jan 2, 2024
ae70172
feat(hide dialog): makes it behave the same way as rename/move PE-5254
matibat Jan 3, 2024
d4052c0
Merge remote-tracking branch 'origin/dev' into PE-5254
matibat Jan 3, 2024
e1ae261
chore(hide dialog): cleanup PE-5254
matibat Jan 3, 2024
17c9ab2
feat(hide feature): puts the reveal button as an option in the drive …
matibat Jan 3, 2024
74a81b0
feat(app shell): removes unnecessary spacing PE-5310
matibat Jan 3, 2024
27d941c
chore(app shell): removes unncessary const keyword PE-5310
matibat Jan 3, 2024
221cd32
feat(localization en): adds wordings PE-5310
matibat Jan 3, 2024
b3ece07
feat(drive detail page): clenup PE-5310
matibat Jan 3, 2024
849ec49
feat(drive detail data): re-enables multi-select when not showing hid…
matibat Jan 3, 2024
bff5945
Merge pull request #1535 from ardriveapp/PE-5310
matibat Jan 4, 2024
2e44a74
Merge pull request #1536 from ardriveapp/PE-5317
matibat Jan 4, 2024
be58b34
feat(drive details panel): adds a button to hide/unhide items; improv…
matibat Jan 5, 2024
c03dab8
test(entity version tag): updates failing tests PE-5309
matibat Jan 5, 2024
cfcab10
Merge remote-tracking branch 'origin/PE-5254' into PE-5309
matibat Jan 5, 2024
076b424
Merge remote-tracking branch 'origin/dev' into PE-5254
matibat Jan 5, 2024
fe03b09
Merge remote-tracking branch 'origin/PE-5254' into PE-5309
matibat Jan 5, 2024
340bca1
chore(hygiene): cleans up the code PE-5309
matibat Jan 5, 2024
2fe2208
feat(hide feature): sets up error handling PE-5309
matibat Jan 5, 2024
0e4f36c
feat(hide dialog): adds localizations PE-5309
matibat Jan 5, 2024
570879e
Merge pull request #1543 from ardriveapp/PE-5309
matibat Jan 5, 2024
a35214b
feat(localization en): hide and unhide PE-5254
matibat Jan 5, 2024
6873b92
chore(app top bar): reverts unnecessary changes PE-5254
matibat Jan 5, 2024
009aa85
feat(image preview): navigate only through visible images PE-5345
matibat Jan 6, 2024
b7b0a6f
feat(move form): makes the form list only visible folders where to mo…
matibat Jan 6, 2024
47cb85c
chore(isHidden parameter): makes it default to false; removes unneces…
matibat Jan 10, 2024
14a8725
chore(drive detail data list): adds comment PE-5254
matibat Jan 10, 2024
1af52e0
Merge remote-tracking branch 'origin/dev' into PE-5254
matibat Jan 10, 2024
b6dbe26
feat(logger): corrects wrong import PE-5254
matibat Jan 10, 2024
cd93ab9
feat(drive detail data list): reverts unnecessary change PE-5254
matibat Jan 10, 2024
b11ffc7
feat(drive detail data list): reverts unnecessary change PE-5254
matibat Jan 10, 2024
d631f7f
feat(database migration): migrate also the entries tables PE-5254
matibat Jan 10, 2024
982bb9f
feat(hide event): makes the equatable props include hideAction PE-5254
matibat Jan 10, 2024
5103eb5
feat(hide state): makes the abstract class declare the props PE-5254
matibat Jan 10, 2024
bc1442d
feat(hide/unhide icon for dropdown): makes it use the eye one PE-5254
matibat Jan 10, 2024
4dee8b7
feat(is hidden filter): factors out the code into its own reusable me…
matibat Jan 10, 2024
111fcfd
test(is hidden filter): implements unit tests PE-5254
matibat Jan 10, 2024
b524d77
feat(drive detail cubit): re-emit the state instead of opening the sa…
matibat Jan 10, 2024
5528a0b
chore(hide bloc): changes late for final variable declarations PE-5254
matibat Jan 10, 2024
95b87db
feat(drive detail cubit): reverts unnecessary change PE-5254
matibat Jan 11, 2024
59dc551
feat(folder with contents): reverts unnecessary change PE-5254
matibat Jan 11, 2024
3c8bea2
chore(hide bloc): DRY it out PE-5254
matibat Jan 11, 2024
d0ef9c5
feat(drive explorer item title): adds hide dropdown option PE-5254
matibat Jan 11, 2024
c22fca0
chore(promptToToggleHideState): generalizes the method PE-5254
matibat Jan 11, 2024
707c217
chore(drive dao): reverts unnecessary change PE-5254
matibat Jan 11, 2024
5b3ccb2
feat(hide bloc): corrects unused variable PE-5254
matibat Jan 11, 2024
11eb6be
feat(upload method selector)
thiagocarvalhodev Jan 16, 2024
e67179f
feat(payment selector)
thiagocarvalhodev Jan 16, 2024
fb175c0
feat(upload method)
thiagocarvalhodev Jan 17, 2024
b684d65
refactor(upload payment)
thiagocarvalhodev Jan 17, 2024
78c744f
Update upload_payment_method_bloc.dart
thiagocarvalhodev Jan 17, 2024
6f1dc8e
Merge pull request #1561 from ardriveapp/PE-5443-refactor-select-paym…
thiagocarvalhodev Jan 17, 2024
69607cd
optimize list
karlprieb Jan 17, 2024
57d6948
Merge pull request #1544 from ardriveapp/PE-5345
karlprieb Jan 17, 2024
3fb4853
Merge pull request #1545 from ardriveapp/PE-5346
karlprieb Jan 17, 2024
8a0e78f
change content type when renaming a file
thiagocarvalhodev Jan 17, 2024
b34c1c1
Update file_entity.dart
thiagocarvalhodev Jan 17, 2024
6434d90
Update hide_state.dart
thiagocarvalhodev Jan 17, 2024
d23f89e
refactor
thiagocarvalhodev Jan 18, 2024
69c698b
Update drive_explorer_item_tile.dart
thiagocarvalhodev Jan 18, 2024
74ea824
Update drive_explorer_item_tile.dart
thiagocarvalhodev Jan 18, 2024
78f1bf6
Merge branch 'dev' into PE-5254
karlprieb Jan 22, 2024
b3d740d
fix(hide): fix bug with non hidden items being concealed on load
atticusofsparta Jan 28, 2024
8ccb7a2
fix(manifest creation): do not include hidden files in manifests
atticusofsparta Jan 28, 2024
89006aa
Merge branch 'dev' into PE-5254
atticusofsparta Jan 29, 2024
25b2be7
chore(merge): update with dev branch changes
atticusofsparta Jan 29, 2024
d8ec111
fix(lint): fixed blocking lint issues
atticusofsparta Jan 29, 2024
9f60327
Merge branch 'PE-5254' into PE-5510-manifest-with-hidden-files
atticusofsparta Jan 29, 2024
a80ca2f
Merge branch 'PE-5254' into PE-5509-conceal-items-bug
atticusofsparta Jan 29, 2024
60f1270
fix(merge): fix moved providers block
atticusofsparta Jan 29, 2024
7bdfc15
Merge branch 'PE-5254' into PE-5509-conceal-items-bug
atticusofsparta Jan 29, 2024
f93bb4e
Merge branch 'PE-5254' into PE-5510-manifest-with-hidden-files
atticusofsparta Jan 29, 2024
2f5a535
fix(providers): fix provider configuration for hide bloc
atticusofsparta Jan 29, 2024
0ba310e
Merge branch 'PE-5254' into PE-5509-conceal-items-bug
atticusofsparta Jan 29, 2024
45512da
Merge branch 'PE-5254' into PE-5510-manifest-with-hidden-files
atticusofsparta Jan 29, 2024
2fd45d8
fix(hide): fixes issue with hiding non hidden files
atticusofsparta Jan 29, 2024
f4c02c1
Merge pull request #1582 from ardriveapp/PE-5528-concealed-files-fixes
atticusofsparta Jan 29, 2024
9542f14
Update fs_entry_move_bloc.dart
thiagocarvalhodev Jan 30, 2024
0d38f02
feat(hide)
thiagocarvalhodev Jan 30, 2024
5a11f83
Merge branch 'dev' into PE-5534-hidden-file-movement-possible
thiagocarvalhodev Jan 30, 2024
7aef415
Update hide_dialog.dart
thiagocarvalhodev Jan 30, 2024
a3a7c16
Update fs_entry_move_bloc_test.dart
thiagocarvalhodev Jan 30, 2024
43d799f
fix(mobile): update filter for hidden items on mobile
atticusofsparta Jan 30, 2024
02ecdc9
Update create_manifest_form.dart
thiagocarvalhodev Jan 30, 2024
be0ef96
Update create_manifest_form.dart
thiagocarvalhodev Jan 30, 2024
dfd4041
Update create_manifest_form.dart
thiagocarvalhodev Jan 30, 2024
12ae082
Update drive_detail_page.dart
thiagocarvalhodev Jan 30, 2024
d974240
Update drive_detail_page.dart
thiagocarvalhodev Jan 30, 2024
ba073ba
Merge pull request #1585 from ardriveapp/PE-5534-hidden-file-movement…
thiagocarvalhodev Jan 30, 2024
82be306
fix(hasFiles): update filter logic for hasFiles and hasFoders
atticusofsparta Jan 30, 2024
b4fd47c
fix(hasFiles): update filter logic for hasFiles and hasFolders
atticusofsparta Jan 30, 2024
3f47fb1
Merge branch 'PE-5510-manifest-with-hidden-files' into PE-5509-concea…
thiagocarvalhodev Jan 30, 2024
9587ad6
Merge branch 'PE-5509-conceal-items-bug' of github.com:ardriveapp/ard…
thiagocarvalhodev Jan 30, 2024
874da72
Merge pull request #1577 from ardriveapp/PE-5509-conceal-items-bug
thiagocarvalhodev Jan 30, 2024
d46ae42
Merge branch 'dev' into PE-5510-manifest-with-hidden-files
thiagocarvalhodev Jan 31, 2024
053fe81
Merge pull request #1578 from ardriveapp/PE-5510-manifest-with-hidden…
thiagocarvalhodev Jan 31, 2024
a9de18d
Update fs_entry_move_bloc.dart
thiagocarvalhodev Jan 31, 2024
ced0778
Merge pull request #1593 from ardriveapp/PE-5534
thiagocarvalhodev Jan 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions lib/blocs/create_manifest/create_manifest_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,19 @@ class CreateManifestCubit extends Cubit<CreateManifestState> {
Future<void> loadFolder(String folderId) async {
await _selectedFolderSubscription?.cancel();

_selectedFolderSubscription =
_driveDao.watchFolderContents(drive.id, folderId: folderId).listen(
(f) => emit(
CreateManifestFolderLoadSuccess(
viewingRootFolder: f.folder.parentFolderId == null,
viewingFolder: f,
),
),
);
_selectedFolderSubscription = _driveDao
.watchFolderContents(
drive.id,
folderId: folderId,
)
.listen(
(f) => emit(
CreateManifestFolderLoadSuccess(
viewingRootFolder: f.folder.parentFolderId == null,
viewingFolder: f,
),
),
);
}

/// User selected a new name due to name conflict, confirm that form is valid and check for conflicts again
Expand Down
46 changes: 33 additions & 13 deletions lib/blocs/drive_detail/drive_detail_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {

bool _refreshSelectedItem = false;

bool _showHiddenFiles = false;

DriveDetailCubit({
required this.driveId,
String? initialFolderId,
Expand Down Expand Up @@ -74,6 +76,11 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
}
}

void toggleHiddenFiles() {
_showHiddenFiles = !_showHiddenFiles;
refreshDriveDataTable();
}

void openFolder({
required String path,
DriveOrder contentOrderBy = DriveOrder.name,
Expand Down Expand Up @@ -147,8 +154,10 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
);

if (index >= 0) {
final item = folderContents.files[index];

_selectedItem = DriveDataTableItemMapper.toFileDataTableItem(
folderContents.files[index],
item,
_selectedItem!.index,
_selectedItem!.isOwner,
);
Expand All @@ -158,8 +167,10 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
(element) => element.id == _selectedItem!.id,
);
if (index >= 0) {
final item = folderContents.subfolders[index];

_selectedItem = DriveDataTableItemMapper.fromFolderEntry(
folderContents.subfolders[index],
item,
_selectedItem!.index,
_selectedItem!.isOwner,
);
Expand All @@ -172,8 +183,6 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
_selectedItem!.isOwner,
);
}

_refreshSelectedItem = false;
}

final currentFolderContents = parseEntitiesToDatatableItem(
Expand All @@ -194,6 +203,7 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
rowsPerPage: availableRowsPerPage.first,
availableRowsPerPage: availableRowsPerPage,
currentFolderContents: currentFolderContents,
isShowingHiddenFiles: _showHiddenFiles,
),
);
} else {
Expand All @@ -211,6 +221,7 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
driveIsEmpty: rootFolderNode.isEmpty(),
multiselect: false,
currentFolderContents: currentFolderContents,
isShowingHiddenFiles: _showHiddenFiles,
),
);
}
Expand Down Expand Up @@ -398,7 +409,10 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
_refreshSelectedItem = true;

if (state is DriveDetailLoadSuccess) {
emit((state as DriveDetailLoadSuccess).copyWith());
final state = this.state as DriveDetailLoadSuccess;
emit(state.copyWith(
isShowingHiddenFiles: _showHiddenFiles,
));
}
}

Expand Down Expand Up @@ -441,14 +455,20 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
}

final state = this.state as DriveDetailLoadSuccess;
final allImagesForFolder = state.currentFolderContents
.whereType<FileDataTableItem>()
.where(
(element) => supportedImageTypesInFilePreview.contains(
element.contentType,
),
)
.toList();

final isShowingHiddenFiles = state.isShowingHiddenFiles;

final List<FileDataTableItem> allImagesForFolder =
state.currentFolderContents.whereType<FileDataTableItem>().where(
(element) {
final supportedImageType = supportedImageTypesInFilePreview.contains(
element.contentType,
);

return supportedImageType &&
(isShowingHiddenFiles ? true : !element.isHidden);
},
).toList();

_allImagesOfCurrentFolder = allImagesForFolder;

Expand Down
11 changes: 10 additions & 1 deletion lib/blocs/drive_detail/drive_detail_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class DriveDetailLoadSuccess extends DriveDetailState {

final List<ArDriveDataTableItem> currentFolderContents;

final bool isShowingHiddenFiles;

DriveDetailLoadSuccess({
required this.currentDrive,
required this.hasWritePermissions,
Expand All @@ -49,8 +51,9 @@ class DriveDetailLoadSuccess extends DriveDetailState {
this.hasFoldersSelected = false,
this.selectedFilePreviewUrl,
required this.driveIsEmpty,
this.selectedItem,
required this.selectedItem,
required this.currentFolderContents,
required this.isShowingHiddenFiles,
});

DriveDetailLoadSuccess copyWith({
Expand All @@ -69,6 +72,7 @@ class DriveDetailLoadSuccess extends DriveDetailState {
bool? hasFoldersSelected,
ArDriveDataTableItem? selectedItem,
List<ArDriveDataTableItem>? currentFolderContents,
bool? isShowingHiddenFiles,
}) =>
DriveDetailLoadSuccess(
selectedItem: selectedItem ?? this.selectedItem,
Expand All @@ -89,12 +93,16 @@ class DriveDetailLoadSuccess extends DriveDetailState {
driveIsEmpty: driveIsEmpty ?? this.driveIsEmpty,
currentFolderContents:
currentFolderContents ?? this.currentFolderContents,
isShowingHiddenFiles: isShowingHiddenFiles ?? this.isShowingHiddenFiles,
);

@override
List<Object?> get props => [
currentDrive,
hasWritePermissions,
folderInView,
currentFolderContents,
isShowingHiddenFiles,
contentOrderBy,
contentOrderingMode,
showSelectedItemDetails,
Expand All @@ -105,6 +113,7 @@ class DriveDetailLoadSuccess extends DriveDetailState {
_equatableBust,
driveIsEmpty,
multiselect,
selectedItem,
];
SelectedItem? maybeSelectedItem() =>
selectedItems.isNotEmpty ? selectedItems.first : null;
Expand Down
6 changes: 4 additions & 2 deletions lib/blocs/fs_entry_move/fs_entry_move_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ class FsEntryMoveBloc extends Bloc<FsEntryMoveEvent, FsEntryMoveState> {
required String folderId,
required Emitter<FsEntryMoveState> emit,
}) async {
final folderStream =
_driveDao.watchFolderContents(driveId, folderId: folderId);
final folderStream = _driveDao.watchFolderContents(
driveId,
folderId: folderId,
);
await emit.forEach(
folderStream,
onData: (FolderWithContents folderWithContents) => FsEntryMoveLoadSuccess(
Expand Down
2 changes: 1 addition & 1 deletion lib/blocs/fs_entry_rename/fs_entry_rename_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class FsEntryRenameCubit extends Cubit<FsEntryRenameState> {

Future<void> submit({required String newName}) async {
try {
late bool hasEntityWithSameName;
final bool hasEntityWithSameName;

if (_isRenamingFolder) {
hasEntityWithSameName = await _folderWithSameNameExists(newName);
Expand Down
6 changes: 5 additions & 1 deletion lib/blocs/ghost_fixer/ghost_fixer_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ class GhostFixerCubit extends Cubit<GhostFixerState> {
await _selectedFolderSubscription?.cancel();

_selectedFolderSubscription = _driveDao
.watchFolderContents(ghostFolder.driveId, folderId: folderId)
.watchFolderContents(
ghostFolder.driveId,
folderId: folderId,
)
.listen(
(f) => emit(
GhostFixerFolderLoadSuccess(
Expand Down Expand Up @@ -129,6 +132,7 @@ class GhostFixerCubit extends Cubit<GhostFixerState> {
isGhost: false,
lastUpdated: ghostFolder.lastUpdated,
dateCreated: ghostFolder.dateCreated,
isHidden: ghostFolder.isHidden,
);

final folderEntity = folder.asEntity();
Expand Down
Loading
Loading