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.

fix(desktop): resize sidebar menu regression (#6897)

Richard Shiue0cf3ade332e6
diff --git a/frontend/appflowy_flutter/lib/workspace/application/home/home_setting_bloc.dart b/frontend/appflowy_flutter/lib/workspace/application/home/home_setting_bloc.dart
index 05418f3315..657f2592d7 100644
--- a/frontend/appflowy_flutter/lib/workspace/application/home/home_setting_bloc.dart
+++ b/frontend/appflowy_flutter/lib/workspace/application/home/home_setting_bloc.dart
@@ -86,7 +86,7 @@ class HomeSettingBloc extends Bloc<HomeSettingEvent, HomeSettingState> {
},
editPanelResized: (_EditPanelResized e) {
final newPosition =
- (e.offset + state.resizeStart).clamp(-50, 200).toDouble();
+ (state.resizeStart + e.offset).clamp(0, 200).toDouble();
if (state.resizeOffset != newPosition) {
emit(state.copyWith(resizeOffset: newPosition));
}
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/home_layout.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/home_layout.dart
index fb108b702e..98139f1db7 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/home/home_layout.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/home_layout.dart
@@ -14,10 +14,11 @@ class HomeLayout {
HomeLayout(BuildContext context) {
final homeSetting = context.read<HomeSettingBloc>().state;
showEditPanel = homeSetting.panelContext != null;
- menuWidth = Sizes.sideBarWidth;
- menuWidth += homeSetting.resizeOffset;
- menuWidth = max(menuWidth, HomeSizes.minimumSidebarWidth);
+ menuWidth = max(
+ HomeSizes.minimumSidebarWidth + homeSetting.resizeOffset,
+ HomeSizes.minimumSidebarWidth,
+ );
final screenWidthPx = context.widthPx;
context
diff --git a/frontend/appflowy_flutter/packages/flowy_infra/lib/size.dart b/frontend/appflowy_flutter/packages/flowy_infra/lib/size.dart
index b9c6d565f8..f58dad95b5 100644
--- a/frontend/appflowy_flutter/packages/flowy_infra/lib/size.dart
+++ b/frontend/appflowy_flutter/packages/flowy_infra/lib/size.dart
@@ -57,8 +57,6 @@ class Sizes {
static double get hit => 40 * hitScale;
static double get iconMed => 20;
-
- static double get sideBarWidth => 250 * hitScale;
}
class Corners {