Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

feat: add more bottom padding in workspace menu (#6469)

Lucas8ceff03f3e30
diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/show_mobile_bottom_sheet.dart b/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/show_mobile_bottom_sheet.dart
index 9af49e98c8..6be2e0662f 100644
--- a/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/show_mobile_bottom_sheet.dart
+++ b/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/show_mobile_bottom_sheet.dart
@@ -48,12 +48,14 @@ Future<T?> showMobileBottomSheet<T>(
double? elevation,
bool showDoneButton = false,
bool enableDraggableScrollable = false,
+ bool enableScrollable = false,
// this field is only used if showDragHandle is true
Widget Function(BuildContext, ScrollController)? scrollableWidgetBuilder,
// only used when enableDraggableScrollable is true
double minChildSize = 0.5,
double maxChildSize = 0.8,
double initialChildSize = 0.51,
+ double bottomSheetPadding = 0,
}) async {
assert(
showHeader ||
@@ -151,6 +153,19 @@ Future<T?> showMobileBottomSheet<T>(
);
},
);
+ } else if (enableScrollable) {
+ return Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ ...children,
+ Flexible(
+ child: SingleChildScrollView(
+ child: child,
+ ),
+ ),
+ VSpace(bottomSheetPadding),
+ ],
+ );
}
// ----- content area -----
diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_home_page_header.dart b/frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_home_page_header.dart
index 4069acf623..39476cf707 100644
--- a/frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_home_page_header.dart
+++ b/frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_home_page_header.dart
@@ -165,6 +165,8 @@ class _MobileWorkspace extends StatelessWidget {
showDragHandle: true,
showCloseButton: true,
useRootNavigator: true,
+ enableScrollable: true,
+ bottomSheetPadding: context.bottomSheetPadding(),
title: LocaleKeys.workspace_menuTitle.tr(),
backgroundColor: Theme.of(context).colorScheme.surface,
builder: (sheetContext) {
diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/home/workspaces/workspace_menu_bottom_sheet.dart b/frontend/appflowy_flutter/lib/mobile/presentation/home/workspaces/workspace_menu_bottom_sheet.dart
index 7ce32ccf3d..59cbd867b5 100644
--- a/frontend/appflowy_flutter/lib/mobile/presentation/home/workspaces/workspace_menu_bottom_sheet.dart
+++ b/frontend/appflowy_flutter/lib/mobile/presentation/home/workspaces/workspace_menu_bottom_sheet.dart
@@ -320,7 +320,6 @@ class _WorkspaceMenuItemTrailing extends StatelessWidget {
child: const FlowySvg(
FlowySvgs.workspace_three_dots_s,
size: iconSize,
- blendMode: null,
),
),
const HSpace(8.0),
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_menu.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_menu.dart
index 96b59cdb06..4f2c36cf88 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_menu.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_menu.dart
@@ -60,15 +60,25 @@ class WorkspacesMenu extends StatelessWidget {
child: Divider(height: 1.0),
),
// workspace list
- for (final workspace in workspaces) ...[
- WorkspaceMenuItem(
- key: ValueKey(workspace.workspaceId),
- workspace: workspace,
- userProfile: userProfile,
- isSelected: workspace.workspaceId == currentWorkspace.workspaceId,
+ Flexible(
+ child: SingleChildScrollView(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ for (final workspace in workspaces) ...[
+ WorkspaceMenuItem(
+ key: ValueKey(workspace.workspaceId),
+ workspace: workspace,
+ userProfile: userProfile,
+ isSelected:
+ workspace.workspaceId == currentWorkspace.workspaceId,
+ ),
+ const VSpace(6.0),
+ ],
+ ],
+ ),
),
- const VSpace(6.0),
- ],
+ ),
// add new workspace
const _CreateWorkspaceButton(),
const VSpace(6.0),
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/sidebar_workspace.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/sidebar_workspace.dart
index 57bc05ec03..d40a2f210a 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/sidebar_workspace.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/sidebar_workspace.dart
@@ -264,7 +264,12 @@ class _SideBarSwitchWorkspaceButtonChild extends StatelessWidget {
return MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
- onTap: () => popoverController.show(),
+ onTap: () {
+ context.read<UserWorkspaceBloc>().add(
+ const UserWorkspaceEvent.fetchWorkspaces(),
+ );
+ popoverController.show();
+ },
behavior: HitTestBehavior.opaque,
child: SizedBox(
height: 30,
diff --git a/frontend/appflowy_flutter/packages/appflowy_popover/lib/src/popover.dart b/frontend/appflowy_flutter/packages/appflowy_popover/lib/src/popover.dart
index 1c8bee41be..1aad60f3e5 100644
--- a/frontend/appflowy_flutter/packages/appflowy_popover/lib/src/popover.dart
+++ b/frontend/appflowy_flutter/packages/appflowy_popover/lib/src/popover.dart
@@ -1,8 +1,7 @@
+import 'package:appflowy_popover/src/layout.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-import 'package:appflowy_popover/src/layout.dart';
-
import 'mask.dart';
import 'mutex.dart';