diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/space/shared_widget.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/space/shared_widget.dart index a657bc8fde..1ae08c0abd 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/space/shared_widget.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/space/shared_widget.dart @@ -317,6 +317,7 @@ class CurrentSpace extends StatelessWidget { @override Widget build(BuildContext context) { return Row( + mainAxisSize: MainAxisSize.min, children: [ SpaceIcon( dimension: 20, diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/space/sidebar_space_header.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/space/sidebar_space_header.dart index f4f4c694e5..b614f11260 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/space/sidebar_space_header.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/space/sidebar_space_header.dart @@ -53,30 +53,6 @@ class _SidebarSpaceHeaderState extends State { Widget build(BuildContext context) { return ValueListenableBuilder( valueListenable: isHovered, - child: SizedBox( - height: HomeSizes.workspaceSectionHeight, - child: MouseRegion( - onEnter: (_) => isHovered.value = true, - onExit: (_) => isHovered.value = false, - child: Stack( - alignment: Alignment.center, - children: [ - Positioned( - left: 3, - top: 3, - bottom: 3, - child: SpacePopup( - child: _buildChild(), - ), - ), - Positioned( - right: 4, - child: _buildRightIcon(), - ), - ], - ), - ), - ), builder: (context, isHovered, child) { final style = HoverStyle( hoverColor: isHovered @@ -89,13 +65,44 @@ class _SidebarSpaceHeaderState extends State { .add(SpaceEvent.expand(widget.space, !widget.isExpanded)), child: FlowyHoverContainer( style: style, - child: child!, + child: _buildSpaceName(), ), ); }, ); } + Widget _buildSpaceName() { + return SizedBox( + height: HomeSizes.workspaceSectionHeight, + child: MouseRegion( + onEnter: (_) => isHovered.value = true, + onExit: (_) => isHovered.value = false, + child: Stack( + alignment: Alignment.center, + children: [ + ValueListenableBuilder( + valueListenable: onEditing, + builder: (context, onEditing, child) => Positioned( + left: 3, + top: 3, + bottom: 3, + right: isHovered.value || onEditing ? 66 : 0, + child: SpacePopup( + child: _buildChild(), + ), + ), + ), + Positioned( + right: 4, + child: _buildRightIcon(), + ), + ], + ), + ), + ); + } + Widget _buildChild() { final color = Theme.of(context).isLightMode ? Colors.white : Colors.black; final textSpan = TextSpan( diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/space/sidebar_space_menu.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/space/sidebar_space_menu.dart index 82027a1bdd..6db5f54d81 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/space/sidebar_space_menu.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/space/sidebar_space_menu.dart @@ -63,7 +63,12 @@ class _SidebarSpaceMenuItem extends StatelessWidget { return FlowyButton( text: Row( children: [ - FlowyText.regular(space.name), + Flexible( + child: FlowyText.regular( + space.name, + overflow: TextOverflow.ellipsis, + ), + ), const HSpace(6.0), if (space.spacePermission == SpacePermission.private) FlowyTooltip( diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/view/view_item.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/view/view_item.dart index ac2f7158e6..860a9e3e81 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/view/view_item.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/view/view_item.dart @@ -491,7 +491,7 @@ class _SingleInnerViewItemState extends State { ? Expanded( child: Row( children: [ - name, + Flexible(child: name), ...widget.extendBuilder!(widget.view), ], ),