From 6e7d044208ffaa1dab54e930a01715dde244ca41 Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Wed, 5 Jun 2024 17:32:30 +0800 Subject: [PATCH] chore: update chat icon (#5476) * chore: update chat icon * chore: update translation --- .../bottom_sheet/bottom_sheet_add_new_page.dart | 8 ++++---- .../bottom_sheet/bottom_sheet_view_page.dart | 11 ++++------- .../bottom_sheet/default_mobile_action_pane.dart | 15 ++++++++------- .../card_detail/mobile_card_detail_screen.dart | 4 ++-- .../database/field/mobile_quick_field_editor.dart | 2 +- .../view/database_view_quick_actions.dart | 6 +++--- .../presentation/page_item/mobile_view_item.dart | 9 ++++++--- .../application/favorite/favorite_service.dart | 3 ++- .../windows/runner/flutter_window.cpp | 2 +- .../resources/flowy_icons/16x/chat_ai_page.svg | 5 ++++- .../flowy_icons/16x/workspace_three_dots.svg | 12 ++++++------ frontend/resources/translations/en.json | 2 +- 12 files changed, 42 insertions(+), 37 deletions(-) diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_add_new_page.dart b/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_add_new_page.dart index bc8706f8b8..1a8ff64f2b 100644 --- a/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_add_new_page.dart +++ b/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_add_new_page.dart @@ -23,7 +23,7 @@ class AddNewPageWidgetBottomSheet extends StatelessWidget { text: LocaleKeys.document_menuName.tr(), height: 52.0, leftIcon: const FlowySvg( - FlowySvgs.document_s, + FlowySvgs.icon_document_s, size: Size.square(18), ), showTopBorder: false, @@ -33,7 +33,7 @@ class AddNewPageWidgetBottomSheet extends StatelessWidget { text: LocaleKeys.grid_menuName.tr(), height: 52.0, leftIcon: const FlowySvg( - FlowySvgs.grid_s, + FlowySvgs.icon_grid_s, size: Size.square(18), ), showTopBorder: false, @@ -43,7 +43,7 @@ class AddNewPageWidgetBottomSheet extends StatelessWidget { text: LocaleKeys.board_menuName.tr(), height: 52.0, leftIcon: const FlowySvg( - FlowySvgs.board_s, + FlowySvgs.icon_board_s, size: Size.square(18), ), showTopBorder: false, @@ -53,7 +53,7 @@ class AddNewPageWidgetBottomSheet extends StatelessWidget { text: LocaleKeys.calendar_menuName.tr(), height: 52.0, leftIcon: const FlowySvg( - FlowySvgs.calendar_s, + FlowySvgs.icon_calendar_s, size: Size.square(18), ), showTopBorder: false, diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_view_page.dart b/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_view_page.dart index de9d51311c..62d471a093 100644 --- a/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_view_page.dart +++ b/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_view_page.dart @@ -89,7 +89,7 @@ class MobileViewBottomSheetBody extends StatelessWidget { children: [ MobileQuickActionButton( text: LocaleKeys.button_rename.tr(), - icon: FlowySvgs.m_rename_s, + icon: FlowySvgs.view_item_rename_s, onTap: () => onAction( MobileViewBottomSheetBodyAction.rename, ), @@ -99,10 +99,7 @@ class MobileViewBottomSheetBody extends StatelessWidget { text: isFavorite ? LocaleKeys.button_removeFromFavorites.tr() : LocaleKeys.button_addToFavorites.tr(), - icon: isFavorite - ? FlowySvgs.m_favorite_selected_lg - : FlowySvgs.m_favorite_unselected_lg, - iconColor: isFavorite ? Colors.yellow : null, + icon: isFavorite ? FlowySvgs.unfavorite_s : FlowySvgs.favorite_s, onTap: () => onAction( isFavorite ? MobileViewBottomSheetBodyAction.removeFromFavorites @@ -112,7 +109,7 @@ class MobileViewBottomSheetBody extends StatelessWidget { _divider(), MobileQuickActionButton( text: LocaleKeys.button_duplicate.tr(), - icon: FlowySvgs.m_duplicate_s, + icon: FlowySvgs.duplicate_s, onTap: () => onAction( MobileViewBottomSheetBodyAction.duplicate, ), @@ -121,7 +118,7 @@ class MobileViewBottomSheetBody extends StatelessWidget { MobileQuickActionButton( text: LocaleKeys.button_delete.tr(), textColor: Theme.of(context).colorScheme.error, - icon: FlowySvgs.m_delete_s, + icon: FlowySvgs.trash_s, iconColor: Theme.of(context).colorScheme.error, onTap: () => onAction( MobileViewBottomSheetBodyAction.delete, diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/default_mobile_action_pane.dart b/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/default_mobile_action_pane.dart index 022d0c224c..ad489a5645 100644 --- a/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/default_mobile_action_pane.dart +++ b/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/default_mobile_action_pane.dart @@ -74,13 +74,14 @@ enum MobilePaneActionType { return AddNewPageWidgetBottomSheet( view: view, onAction: (layout) { - context.read().add( - ViewEvent.createView( - LocaleKeys.menuAppHeader_defaultNewPageName.tr(), - layout, - section: spaceType!.toViewSectionPB, - ), - ); + Navigator.of(sheetContext).pop(); + viewBloc.add( + ViewEvent.createView( + LocaleKeys.menuAppHeader_defaultNewPageName.tr(), + layout, + section: spaceType!.toViewSectionPB, + ), + ); }, ); }, diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/database/card/card_detail/mobile_card_detail_screen.dart b/frontend/appflowy_flutter/lib/mobile/presentation/database/card/card_detail/mobile_card_detail_screen.dart index 08f6c0b48b..c65f899c34 100644 --- a/frontend/appflowy_flutter/lib/mobile/presentation/database/card/card_detail/mobile_card_detail_screen.dart +++ b/frontend/appflowy_flutter/lib/mobile/presentation/database/card/card_detail/mobile_card_detail_screen.dart @@ -140,7 +140,7 @@ class _MobileRowDetailPageState extends State { MobileQuickActionButton( onTap: () => _performAction(viewId, _bloc.state.currentRowId, false), - icon: FlowySvgs.copy_s, + icon: FlowySvgs.duplicate_s, text: LocaleKeys.button_duplicate.tr(), ), const Divider(height: 8.5, thickness: 0.5), @@ -148,7 +148,7 @@ class _MobileRowDetailPageState extends State { onTap: () => _performAction(viewId, _bloc.state.currentRowId, true), text: LocaleKeys.button_delete.tr(), textColor: Theme.of(context).colorScheme.error, - icon: FlowySvgs.m_delete_m, + icon: FlowySvgs.trash_s, iconColor: Theme.of(context).colorScheme.error, ), const Divider(height: 8.5, thickness: 0.5), diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/database/field/mobile_quick_field_editor.dart b/frontend/appflowy_flutter/lib/mobile/presentation/database/field/mobile_quick_field_editor.dart index f3b76447f4..0b415b04a6 100644 --- a/frontend/appflowy_flutter/lib/mobile/presentation/database/field/mobile_quick_field_editor.dart +++ b/frontend/appflowy_flutter/lib/mobile/presentation/database/field/mobile_quick_field_editor.dart @@ -5,8 +5,8 @@ import 'package:appflowy/mobile/presentation/database/field/mobile_field_bottom_ import 'package:appflowy/mobile/presentation/widgets/widgets.dart'; import 'package:appflowy/plugins/database/application/field/field_controller.dart'; import 'package:appflowy/plugins/database/application/field/field_editor_bloc.dart'; -import 'package:appflowy/plugins/database/domain/field_backend_service.dart'; import 'package:appflowy/plugins/database/application/field/field_info.dart'; +import 'package:appflowy/plugins/database/domain/field_backend_service.dart'; import 'package:appflowy/plugins/database/widgets/setting/field_visibility_extension.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart'; import 'package:easy_localization/easy_localization.dart'; diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/database/view/database_view_quick_actions.dart b/frontend/appflowy_flutter/lib/mobile/presentation/database/view/database_view_quick_actions.dart index eff4dc5e0b..652c93496e 100644 --- a/frontend/appflowy_flutter/lib/mobile/presentation/database/view/database_view_quick_actions.dart +++ b/frontend/appflowy_flutter/lib/mobile/presentation/database/view/database_view_quick_actions.dart @@ -107,9 +107,9 @@ enum _Action { FlowySvgData get icon { return switch (this) { - edit => FlowySvgs.edit_s, - duplicate => FlowySvgs.copy_s, - delete => FlowySvgs.delete_s, + edit => FlowySvgs.view_item_rename_s, + duplicate => FlowySvgs.duplicate_s, + delete => FlowySvgs.trash_s, }; } diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/page_item/mobile_view_item.dart b/frontend/appflowy_flutter/lib/mobile/presentation/page_item/mobile_view_item.dart index 2d20581b98..737145d501 100644 --- a/frontend/appflowy_flutter/lib/mobile/presentation/page_item/mobile_view_item.dart +++ b/frontend/appflowy_flutter/lib/mobile/presentation/page_item/mobile_view_item.dart @@ -298,9 +298,12 @@ class _SingleMobileInnerViewItemState extends State { widget.view.icon.value, fontSize: 20.0, ) - : SizedBox.square( - dimension: 18.0, - child: widget.view.defaultIcon(), + : Opacity( + opacity: 0.7, + child: SizedBox.square( + dimension: 18.0, + child: widget.view.defaultIcon(), + ), ); return icon; } diff --git a/frontend/appflowy_flutter/lib/workspace/application/favorite/favorite_service.dart b/frontend/appflowy_flutter/lib/workspace/application/favorite/favorite_service.dart index 71bb8423df..e21db62ccb 100644 --- a/frontend/appflowy_flutter/lib/workspace/application/favorite/favorite_service.dart +++ b/frontend/appflowy_flutter/lib/workspace/application/favorite/favorite_service.dart @@ -34,7 +34,8 @@ class FavoriteService { bool isPinned, ) async { try { - final current = view.extra.isNotEmpty ? jsonDecode(view.extra) : {}; + final current = + view.extra.isNotEmpty ? jsonDecode(view.extra) : {}; final merged = mergeMaps( current, {ViewExtKeys.isPinnedKey: isPinned}, diff --git a/frontend/appflowy_flutter/windows/runner/flutter_window.cpp b/frontend/appflowy_flutter/windows/runner/flutter_window.cpp index b43b9095ea..8e9deabc69 100644 --- a/frontend/appflowy_flutter/windows/runner/flutter_window.cpp +++ b/frontend/appflowy_flutter/windows/runner/flutter_window.cpp @@ -17,7 +17,7 @@ bool FlutterWindow::OnCreate() { RECT frame = GetClientArea(); // The size here must match the window dimensions to avoid unnecessary surface - // creation / destruction in the startup path. +// creation / destruction in the startup path. flutter_controller_ = std::make_unique( frame.right - frame.left, frame.bottom - frame.top, project_); // Ensure that basic setup of the controller was successful. diff --git a/frontend/resources/flowy_icons/16x/chat_ai_page.svg b/frontend/resources/flowy_icons/16x/chat_ai_page.svg index e3585e4ec6..3033ab47a0 100644 --- a/frontend/resources/flowy_icons/16x/chat_ai_page.svg +++ b/frontend/resources/flowy_icons/16x/chat_ai_page.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/frontend/resources/flowy_icons/16x/workspace_three_dots.svg b/frontend/resources/flowy_icons/16x/workspace_three_dots.svg index 93aa13693a..54332fb08b 100644 --- a/frontend/resources/flowy_icons/16x/workspace_three_dots.svg +++ b/frontend/resources/flowy_icons/16x/workspace_three_dots.svg @@ -1,7 +1,7 @@ - - - - - - + + + + + + diff --git a/frontend/resources/translations/en.json b/frontend/resources/translations/en.json index 38057a15b0..8bd65ffc1f 100644 --- a/frontend/resources/translations/en.json +++ b/frontend/resources/translations/en.json @@ -148,7 +148,7 @@ "newCalendarText": "New calendar", "newBoardText": "New board", "chat": { - "newChat": "New chat", + "newChat": "AI Chat", "inputMessageHint": "Message AppFlowy AI", "unsupportedCloudPrompt": "This feature is only available when using AppFlowy Cloud", "relatedQuestion": "Related",