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-7043: Release ArDrive v2.57.0 #1908

Merged
merged 59 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
0698659
update share drive style
thiagocarvalhodev Oct 7, 2024
71ac336
hide drives + important fixes
thiagocarvalhodev Oct 10, 2024
3a902ac
fix tests
thiagocarvalhodev Oct 14, 2024
e868e51
Update side_bar.dart
thiagocarvalhodev Oct 15, 2024
66a507b
Update drive_share_dialog.dart
thiagocarvalhodev Oct 16, 2024
424b5c8
start work
thiagocarvalhodev Oct 17, 2024
a92d7a4
manifest preview and download
thiagocarvalhodev Oct 17, 2024
04ea46d
always show shared drives
thiagocarvalhodev Oct 21, 2024
4d44634
chore: remove commented code and prints
thiagocarvalhodev Oct 21, 2024
307d9c1
test(user prefs/hide)
thiagocarvalhodev Oct 22, 2024
630ca0c
fix(user prefs)
thiagocarvalhodev Oct 22, 2024
7dae599
fix hide icon and attach drives
thiagocarvalhodev Oct 22, 2024
fdcd613
Update hide_dialog.dart
thiagocarvalhodev Oct 22, 2024
d3f0cb6
Update drive_explorer_item_tile.dart
thiagocarvalhodev Oct 22, 2024
e5105a0
Update sync_repository.dart
thiagocarvalhodev Oct 22, 2024
9f8b2f0
remove feedback survey modal
thiagocarvalhodev Oct 22, 2024
87ebc4e
fix sync drives with hidden property
thiagocarvalhodev Oct 22, 2024
3b52208
clear all configs when logging out
thiagocarvalhodev Oct 22, 2024
abb5275
Update global_hide_bloc_test.dart
thiagocarvalhodev Oct 22, 2024
d84d6d9
Update user_preferences_repository_test.dart
thiagocarvalhodev Oct 22, 2024
48b6946
refactors(hide drive)
thiagocarvalhodev Oct 22, 2024
b0c7bf4
refactor(hide)
thiagocarvalhodev Oct 22, 2024
836bc7a
Update hide_bloc.dart
thiagocarvalhodev Oct 22, 2024
77ce82e
Update hide_bloc.dart
thiagocarvalhodev Oct 22, 2024
45a6f84
Update app_router_delegate.dart
thiagocarvalhodev Oct 22, 2024
55eb769
fix bugs
thiagocarvalhodev Oct 24, 2024
14373a0
fix: missing hide button
thiagocarvalhodev Oct 28, 2024
8acbf55
fix(attach drives): dont ask for attach a drive logging the user out
thiagocarvalhodev Oct 28, 2024
a498b93
Merge branch 'PE-6752-hide-drives' into PE-6966-assign-arns-name-new-…
thiagocarvalhodev Oct 28, 2024
9f47a53
Merge pull request #1904 from ardriveapp/PE-7037-missing-hide-show-hi…
thiagocarvalhodev Oct 28, 2024
0a482a6
Merge pull request #1892 from ardriveapp/PE-6752-hide-drives
thiagocarvalhodev Oct 28, 2024
26361f6
Update drive_detail_page.dart
thiagocarvalhodev Oct 28, 2024
ed8d519
feat(assign arns name)
thiagocarvalhodev Oct 29, 2024
55c101e
Update manifest_options.dart
thiagocarvalhodev Oct 29, 2024
a0d48a9
chore: fix lint issues
thiagocarvalhodev Oct 29, 2024
c48fc1d
Merge branch 'dev' into PE-6966-assign-arns-name-new-manifest
thiagocarvalhodev Oct 29, 2024
bede9f2
feat(assign name arns)
thiagocarvalhodev Oct 29, 2024
d4d4628
feat(assign arns name): fix spacing issues
thiagocarvalhodev Oct 29, 2024
4c8f3d1
Merge pull request #1905 from ardriveapp/PE-7037-missing-hide-show-hi…
thiagocarvalhodev Oct 29, 2024
393c452
Update manifest_options.dart
thiagocarvalhodev Oct 29, 2024
e6adf46
Merge branch 'PE-6966-assign-arns-name-new-manifest' of github.com:ar…
thiagocarvalhodev Oct 29, 2024
f02cace
Update manifest_options.dart
thiagocarvalhodev Oct 29, 2024
11524a2
Update upload_form.dart
thiagocarvalhodev Oct 29, 2024
7bdfdba
bump version and release notes
thiagocarvalhodev Oct 29, 2024
51b7c73
Update upload_cubit.dart
thiagocarvalhodev Oct 29, 2024
6bb07c7
Update upload_cubit.dart
thiagocarvalhodev Oct 29, 2024
cb8a2f6
Update upload_cubit.dart
thiagocarvalhodev Oct 29, 2024
1753757
Update drive_detail_page.dart
thiagocarvalhodev Oct 29, 2024
bd950d8
Update drive_detail_cubit.dart
thiagocarvalhodev Oct 29, 2024
65bac90
Update upload_form.dart
thiagocarvalhodev Oct 29, 2024
ce762d5
Update drive_detail_cubit.dart
thiagocarvalhodev Oct 29, 2024
a8d4fad
fixes
thiagocarvalhodev Oct 29, 2024
3f65f24
Update drive_detail_cubit.dart
thiagocarvalhodev Oct 29, 2024
0de5189
Update drive_detail_cubit.dart
thiagocarvalhodev Oct 29, 2024
9cbe520
fix
thiagocarvalhodev Oct 29, 2024
701f43e
Merge pull request #1903 from ardriveapp/PE-6966-assign-arns-name-new…
thiagocarvalhodev Oct 29, 2024
586eb72
Merge pull request #1906 from ardriveapp/PE-7043-release-ar-drive-v-2…
thiagocarvalhodev Oct 29, 2024
ab916fa
Merge pull request #1885 from ardriveapp/PE-6898-share-drive
thiagocarvalhodev Oct 29, 2024
0417c28
Merge pull request #1907 from ardriveapp/PE-6966-fix-target-folder
thiagocarvalhodev Oct 29, 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
8 changes: 8 additions & 0 deletions android/fastlane/metadata/android/en-US/changelogs/159.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- New feature: Added option to assign an ArNS name during manifest auto-updates in the upload flow.
- New feature: Introduced hide/unhide feature for drives in the sidebar for improved organization.
- Introduced global toggle to show or hide all hidden drives, folders, and files
- Enhanced sidebar persistence during navigation and syncing.
- Improved details panel to retain state when switching views.
- Implemented memory of the last opened drive for quicker access.
- Updated share drive modal with new styles, colors, and copy button with icon.
- Removed feedback survey modal after uploads for a smoother experience.
17 changes: 10 additions & 7 deletions lib/app_shell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ class AppShellState extends State<AppShell> {
}
}
},
builder: (context, syncState) => syncState is SyncInProgress
? Stack(
builder: (context, syncState) {
return Stack(children: [
scaffold,
if (syncState is SyncInProgress)
Stack(
children: [
AbsorbPointer(
child: scaffold,
),
SizedBox.expand(
child: Container(
color: Colors.black.withOpacity(0.5),
Expand Down Expand Up @@ -181,8 +181,9 @@ class AppShellState extends State<AppShell> {
),
),
],
)
: scaffold,
),
]);
},
),
);
return ScreenTypeLayout.builder(
Expand Down Expand Up @@ -367,6 +368,8 @@ class MobileAppBar extends StatelessWidget implements PreferredSizeWidget {
),
),
const Spacer(),
const GlobalHideToggleButton(),
const SizedBox(width: 8),
const SyncButton(),
const SizedBox(
width: 24,
Expand Down
4 changes: 2 additions & 2 deletions lib/authentication/ardrive_auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,12 @@ class ArDriveAuthImpl implements ArDriveAuth {
await _secureKeyValueStore.remove('biometricEnabled');
currentUser = null;
await _disconnectFromArConnect();
_userStreamController.add(null);
}

await _userRepository.deleteUser();
await _databaseHelpers.deleteAllTables();
await (await _metadataCache).clear();
(await _metadataCache).clear();
_userStreamController.add(null);
} catch (e, stacktrace) {
logger.e('Failed to logout user', e, stacktrace);
throw AuthenticationFailedException('Failed to logout user');
Expand Down
2 changes: 1 addition & 1 deletion lib/blocs/create_manifest/create_manifest_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ class CreateManifestCubit extends Cubit<CreateManifestState> {
return ARNSUndername(
name: '@',
domain: _selectedAntRecord!.domain,
record: ARNSRecord(
record: const ARNSRecord(
transactionId: 'to_assign',
ttlSeconds: 3600,
),
Expand Down
92 changes: 64 additions & 28 deletions lib/blocs/drive_detail/drive_detail_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import 'package:rxdart/rxdart.dart';
part 'drive_detail_state.dart';

class DriveDetailCubit extends Cubit<DriveDetailState> {
final String driveId;
String _driveId;
final ProfileCubit _profileCubit;
final DriveDao _driveDao;
final ConfigService _configService;
Expand All @@ -49,10 +49,8 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {

bool _refreshSelectedItem = false;

bool _showHiddenFiles = false;

DriveDetailCubit({
required this.driveId,
required String driveId,
String? initialFolderId,
required ProfileCubit profileCubit,
required DriveDao driveDao,
Expand All @@ -70,6 +68,7 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
_breadcrumbBuilder = breadcrumbBuilder,
_syncCubit = syncCubit,
_driveRepository = driveRepository,
_driveId = driveId,
super(DriveDetailLoadInProgress()) {
if (driveId.isEmpty) {
return;
Expand All @@ -95,26 +94,42 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
}
}

void toggleHiddenFiles() {
_showHiddenFiles = !_showHiddenFiles;
void showEmptyDriveDetail() async {
await _syncCubit.waitCurrentSync();

emit(DriveDetailLoadEmpty());
}

Future<void> changeDrive(String driveId) async {
final drive = await _driveDao.driveById(driveId: driveId).getSingleOrNull();

if (drive == null) {
await _syncCubit.waitCurrentSync();
emit(DriveDetailLoadNotFound());
return;
}

await _folderSubscription?.cancel();

refreshDriveDataTable();
_driveId = driveId;

openFolder(folderId: drive.rootFolderId);
}

void openFolder({
Future<void> openFolder({
String? folderId,
String? otherDriveId,
String? selectedItemId,
DriveOrder contentOrderBy = DriveOrder.name,
OrderingMode contentOrderingMode = OrderingMode.asc,
}) async {
/// always wait for the current sync to finish before opening a new folder
await _syncCubit.waitCurrentSync();

try {
_selectedItem = null;
_allImagesOfCurrentFolder = null;

String driveId = otherDriveId ?? this.driveId;
String driveId = otherDriveId ?? _driveId;

emit(DriveDetailLoadInProgress());

Expand All @@ -131,6 +146,14 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
),
_profileCubit.stream.startWith(ProfileCheckingAvailability()),
(drive, folderContents, _) async {
if (isClosed) {
return;
}

if (driveId != _driveId) {
return;
}

await _syncCubit.waitCurrentSync();

if (drive == null) {
Expand Down Expand Up @@ -195,6 +218,12 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
isOwner: isDriveOwner(_auth, drive.ownerAddress),
);

if (selectedItemId != null) {
_selectedItem = currentFolderContents.firstWhere(
(element) => element.id == selectedItemId,
);
}

final List<BreadCrumbRowInfo> pathSegments =
await _breadcrumbBuilder.buildForFolder(
folderId: folderContents.folder.id,
Expand All @@ -215,10 +244,10 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
rowsPerPage: availableRowsPerPage.first,
availableRowsPerPage: availableRowsPerPage,
currentFolderContents: currentFolderContents,
isShowingHiddenFiles: _showHiddenFiles,
pathSegments: pathSegments,
driveIsEmpty: folderContents.files.isEmpty &&
folderContents.subfolders.isEmpty,
showSelectedItemDetails: _selectedItem != null,
),
);
} else {
Expand All @@ -241,7 +270,7 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
multiselect: false,
currentFolderContents: currentFolderContents,
columnVisibility: columnsVisibility,
isShowingHiddenFiles: _showHiddenFiles,
showSelectedItemDetails: _selectedItem != null,
),
);
}
Expand All @@ -264,6 +293,8 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {

logger.e('An error occured mouting the drive explorer', e);
});

await _folderSubscription?.asFuture();
}

List<ArDriveDataTableItem> parseEntitiesToDatatableItem({
Expand Down Expand Up @@ -447,53 +478,58 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
final state = this.state as DriveDetailLoadSuccess;
emit(state.copyWith(
forceRebuildKey: UniqueKey(),
isShowingHiddenFiles: _showHiddenFiles,
));
}
}

bool canNavigateThroughImages() {
final numberOfImages = getAllImagesOfCurrentFolder().length;
bool canNavigateThroughImages(bool showHiddenImages) {
final numberOfImages = getAllImagesOfCurrentFolder(showHiddenImages).length;
return numberOfImages > 1;
}

Future<void> selectNextImage() => _selectImageRelativeToCurrent(1);
Future<void> selectPreviousImage() => _selectImageRelativeToCurrent(-1);
Future<void> selectNextImage(bool showHiddenImages) =>
_selectImageRelativeToCurrent(1, showHiddenImages);
Future<void> selectPreviousImage(bool showHiddenImages) =>
_selectImageRelativeToCurrent(-1, showHiddenImages);

Future<void> _selectImageRelativeToCurrent(int offset) async {
final currentIndex = getIndexForImage(_selectedItem as FileDataTableItem);
Future<void> _selectImageRelativeToCurrent(
int offset, bool showHiddenImages) async {
final currentIndex = getIndexForImage(
_selectedItem as FileDataTableItem,
showHiddenImages,
);
final nextIndex = currentIndex + offset;
final nextImage = getImageForIndex(nextIndex);
final nextImage = getImageForIndex(nextIndex, showHiddenImages);

await selectDataItem(nextImage);
}

FileDataTableItem getImageForIndex(int index) {
final allImagesOfCurrentFolder = getAllImagesOfCurrentFolder();
FileDataTableItem getImageForIndex(int index, bool showHiddenImages) {
final allImagesOfCurrentFolder =
getAllImagesOfCurrentFolder(showHiddenImages);
final cyclicIndex = index % allImagesOfCurrentFolder.length;
final image = allImagesOfCurrentFolder[cyclicIndex];

return image;
}

int getIndexForImage(FileDataTableItem image) {
final allImagesOfCurrentFolder = getAllImagesOfCurrentFolder();
int getIndexForImage(FileDataTableItem image, bool showHiddenImages) {
final allImagesOfCurrentFolder =
getAllImagesOfCurrentFolder(showHiddenImages);
final index = allImagesOfCurrentFolder.indexWhere(
(element) => element.id == image.id,
);

return index;
}

List<FileDataTableItem> getAllImagesOfCurrentFolder() {
List<FileDataTableItem> getAllImagesOfCurrentFolder(bool showHiddenImages) {
if (_allImagesOfCurrentFolder != null) {
return _allImagesOfCurrentFolder!;
}

final state = this.state as DriveDetailLoadSuccess;

final isShowingHiddenFiles = state.isShowingHiddenFiles;

final List<FileDataTableItem> allImagesForFolder =
state.currentFolderContents.whereType<FileDataTableItem>().where(
(element) {
Expand All @@ -502,7 +538,7 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
);

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

Expand Down
8 changes: 2 additions & 6 deletions lib/blocs/drive_detail/drive_detail_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ class DriveDetailLoadSuccess extends DriveDetailState {
final Map<int, bool> columnVisibility;
final Key? forceRebuildKey;

final bool isShowingHiddenFiles;

DriveDetailLoadSuccess({
required this.currentDrive,
required this.hasWritePermissions,
Expand All @@ -61,7 +59,6 @@ class DriveDetailLoadSuccess extends DriveDetailState {
required this.currentFolderContents,
required this.columnVisibility,
this.forceRebuildKey,
required this.isShowingHiddenFiles,
required this.pathSegments,
this.selectedPage,
});
Expand All @@ -83,7 +80,6 @@ class DriveDetailLoadSuccess extends DriveDetailState {
ArDriveDataTableItem? selectedItem,
List<ArDriveDataTableItem>? currentFolderContents,
Key? forceRebuildKey,
bool? isShowingHiddenFiles,
List<BreadCrumbRowInfo>? pathSegments,
int? selectedPage,
}) =>
Expand All @@ -109,7 +105,6 @@ class DriveDetailLoadSuccess extends DriveDetailState {
driveIsEmpty: driveIsEmpty ?? this.driveIsEmpty,
currentFolderContents:
currentFolderContents ?? this.currentFolderContents,
isShowingHiddenFiles: isShowingHiddenFiles ?? this.isShowingHiddenFiles,
pathSegments: pathSegments ?? this.pathSegments,
);

Expand All @@ -119,7 +114,6 @@ class DriveDetailLoadSuccess extends DriveDetailState {
hasWritePermissions,
folderInView,
currentFolderContents,
isShowingHiddenFiles,
contentOrderBy,
contentOrderingMode,
showSelectedItemDetails,
Expand All @@ -144,4 +138,6 @@ class DriveDetailLoadSuccess extends DriveDetailState {
/// the user's profile.
class DriveDetailLoadNotFound extends DriveDetailState {}

class DriveDetailLoadEmpty extends DriveDetailState {}

class DriveInitialLoading extends DriveDetailState {}
Loading
Loading