fix: table render error (#6074)

* fix: table render error

* fix: sidebar doesn't refresh if the pages are same

* chore: optimize empty placeholder align

* fix: debounce open workspace toast

* fix: editor color decoration error
This commit is contained in:
Lucas.Xu 2024-08-27 09:23:25 +08:00 committed by GitHub
parent 93bf1f79f6
commit e5ad0f6d1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 30 additions and 12 deletions

View File

@ -177,8 +177,14 @@ class _HomePageState extends State<_HomePage> {
getIt<CachedRecentService>().reset(); getIt<CachedRecentService>().reset();
mCurrentWorkspace.value = state.currentWorkspace; mCurrentWorkspace.value = state.currentWorkspace;
Debounce.debounce(
'workspace_action_result',
const Duration(milliseconds: 150),
() {
_showResultDialog(context, state); _showResultDialog(context, state);
}, },
);
},
builder: (context, state) { builder: (context, state) {
if (state.currentWorkspace == null) { if (state.currentWorkspace == null) {
return const SizedBox.shrink(); return const SizedBox.shrink();

View File

@ -36,6 +36,7 @@ class EmptySpacePlaceholder extends StatelessWidget {
lineHeight: 1.3, lineHeight: 1.3,
color: Theme.of(context).hintColor, color: Theme.of(context).hintColor,
), ),
const VSpace(kBottomNavigationBarHeight + 36.0),
], ],
), ),
); );

View File

@ -499,11 +499,12 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
} }
void _customizeBlockComponentBackgroundColorDecorator() { void _customizeBlockComponentBackgroundColorDecorator() {
if (!context.mounted) { blockComponentBackgroundColorDecorator = (Node node, String colorString) {
return; if (context.mounted) {
return buildEditorCustomizedColor(context, node, colorString);
} }
blockComponentBackgroundColorDecorator = (Node node, String colorString) => return null;
buildEditorCustomizedColor(context, node, colorString); };
} }
void _initEditorL10n() => AppFlowyEditorL10n.current = EditorI18n(); void _initEditorL10n() => AppFlowyEditorL10n.current = EditorI18n();

View File

@ -559,7 +559,10 @@ class SpaceBloc extends Bloc<SpaceEvent, SpaceState> {
return true; return true;
} }
final viewId = fixedUuid(user.id.toInt(), UuidType.publicSpace); final viewId = fixedUuid(
user.id.toInt() + (_workspaceId?.hashCode ?? 0),
UuidType.publicSpace,
);
final publicSpace = await _createSpace( final publicSpace = await _createSpace(
name: 'Shared', name: 'Shared',
icon: builtInSpaceIcons.first, icon: builtInSpaceIcons.first,

View File

@ -3,6 +3,7 @@ import 'package:appflowy/startup/startup.dart';
import 'package:appflowy/workspace/application/favorite/favorite_bloc.dart'; import 'package:appflowy/workspace/application/favorite/favorite_bloc.dart';
import 'package:appflowy/workspace/application/sidebar/space/space_bloc.dart'; import 'package:appflowy/workspace/application/sidebar/space/space_bloc.dart';
import 'package:appflowy/workspace/application/tabs/tabs_bloc.dart'; import 'package:appflowy/workspace/application/tabs/tabs_bloc.dart';
import 'package:appflowy/workspace/application/user/user_workspace_bloc.dart';
import 'package:appflowy/workspace/presentation/home/hotkeys.dart'; import 'package:appflowy/workspace/presentation/home/hotkeys.dart';
import 'package:appflowy/workspace/presentation/home/menu/menu_shared_state.dart'; import 'package:appflowy/workspace/presentation/home/menu/menu_shared_state.dart';
import 'package:appflowy/workspace/presentation/home/menu/sidebar/favorites/favorite_folder.dart'; import 'package:appflowy/workspace/presentation/home/menu/sidebar/favorites/favorite_folder.dart';
@ -31,7 +32,6 @@ class SidebarSpace extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// const sectionPadding = 16.0;
return ValueListenableBuilder( return ValueListenableBuilder(
valueListenable: getIt<MenuSharedState>().notifier, valueListenable: getIt<MenuSharedState>().notifier,
builder: (context, value, child) { builder: (context, value, child) {
@ -89,6 +89,8 @@ class _SpaceState extends State<_Space> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final currentWorkspace =
context.watch<UserWorkspaceBloc>().state.currentWorkspace;
return BlocBuilder<SpaceBloc, SpaceState>( return BlocBuilder<SpaceBloc, SpaceState>(
builder: (context, state) { builder: (context, state) {
if (state.spaces.isEmpty) { if (state.spaces.isEmpty) {
@ -115,7 +117,12 @@ class _SpaceState extends State<_Space> {
onEnter: (_) => isHovered.value = true, onEnter: (_) => isHovered.value = true,
onExit: (_) => isHovered.value = false, onExit: (_) => isHovered.value = false,
child: SpacePages( child: SpacePages(
key: ValueKey(currentSpace.id), key: ValueKey(
Object.hashAll([
currentWorkspace?.workspaceId ?? '',
currentSpace.id,
]),
),
isExpandedNotifier: isExpandedNotifier, isExpandedNotifier: isExpandedNotifier,
space: currentSpace, space: currentSpace,
isHovered: isHovered, isHovered: isHovered,

View File

@ -53,8 +53,8 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." path: "."
ref: "8e17d14" ref: a64a516
resolved-ref: "8e17d1447eea0b57ff92e31dbe88796ce759fb37" resolved-ref: a64a5165e79bd2424e594b793843a7158e7d4fb4
url: "https://github.com/AppFlowy-IO/appflowy-editor.git" url: "https://github.com/AppFlowy-IO/appflowy-editor.git"
source: git source: git
version: "3.2.0" version: "3.2.0"

View File

@ -190,7 +190,7 @@ dependency_overrides:
appflowy_editor: appflowy_editor:
git: git:
url: https://github.com/AppFlowy-IO/appflowy-editor.git url: https://github.com/AppFlowy-IO/appflowy-editor.git
ref: "8e17d14" ref: "a64a516"
appflowy_editor_plugins: appflowy_editor_plugins:
git: git: