Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void main() {
await tester.tapButton(find.byType(AccountSignInOutButton));

tester.expectToSeeText(LocaleKeys.button_yes.tr());
await tester.tapButtonWithName(LocaleKeys.button_ok.tr());
await tester.tapButtonWithName(LocaleKeys.button_yes.tr());

// Go to the sign in page again
await tester.pumpAndSettle(const Duration(seconds: 5));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class _MobileBottomSheetEditLinkWidgetState
ViewPB? currentView;
bool showErrorText = false;
bool showRemoveLink = false;
String title = LocaleKeys.editor_editLink.tr();

AppFlowyThemeData get theme => AppFlowyTheme.of(context);

Expand All @@ -73,6 +74,7 @@ class _MobileBottomSheetEditLinkWidgetState
)..searchRecentViews();
if (linkInfo.link.isEmpty) {
isShowingSearchResult = true;
title = LocaleKeys.toolbar_addLink.tr();
} else {
showRemoveLink = true;
textFocusNode.requestFocus();
Expand Down Expand Up @@ -104,7 +106,7 @@ class _MobileBottomSheetEditLinkWidgetState
child: Column(
children: [
BottomSheetHeader(
title: LocaleKeys.editor_editLink.tr(),
title: title,
onClose: () => context.pop(),
confirmButton: FlowyTextButton(
LocaleKeys.button_done.tr(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/workspace/application/command_palette/command_palette_bloc.dart';
import 'package:appflowy/workspace/application/command_palette/search_result_ext.dart';
import 'package:appflowy/workspace/application/view/view_ext.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-search/result.pb.dart';
import 'package:appflowy_ui/appflowy_ui.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
Expand All @@ -20,12 +22,18 @@ class MobileSearchResultCell extends StatelessWidget {
final theme = AppFlowyTheme.of(context),
textColor = theme.textColorScheme.primary;
final commandPaletteState = context.read<CommandPaletteBloc>().state;
final displayName = item.displayName.isEmpty
? LocaleKeys.menuAppHeader_defaultNewPageName.tr()
: item.displayName;
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 12),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
buildIcon(theme),
SizedBox.square(
dimension: 24,
child: Center(child: buildIcon(theme)),
),
HSpace(12),
Flexible(
child: Column(
Expand All @@ -35,7 +43,7 @@ class MobileSearchResultCell extends StatelessWidget {
maxLines: 1,
overflow: TextOverflow.ellipsis,
text: buildHighLightSpan(
content: item.displayName,
content: displayName,
normal: theme.textStyle.heading4.standard(color: textColor),
highlight: theme.textStyle.heading4
.standard(color: textColor)
Expand All @@ -45,7 +53,7 @@ class MobileSearchResultCell extends StatelessWidget {
),
),
buildPath(commandPaletteState, theme),
buildSummary(theme),
...buildSummary(theme),
],
),
),
Expand Down Expand Up @@ -84,24 +92,25 @@ class MobileSearchResultCell extends StatelessWidget {
);
}

Widget buildSummary(AppFlowyThemeData theme) {
if (item.content.isEmpty) {
return const SizedBox.shrink();
}
return RichText(
maxLines: 3,
overflow: TextOverflow.ellipsis,
text: buildHighLightSpan(
content: item.content,
normal: theme.textStyle.heading4
.standard(color: theme.textColorScheme.secondary),
highlight: theme.textStyle.heading4
.standard(color: theme.textColorScheme.primary)
.copyWith(
backgroundColor: theme.fillColorScheme.themeSelect,
),
List<Widget> buildSummary(AppFlowyThemeData theme) {
if (item.content.isEmpty) return [];
return [
VSpace(theme.spacing.m),
RichText(
maxLines: 3,
overflow: TextOverflow.ellipsis,
text: buildHighLightSpan(
content: item.content,
normal: theme.textStyle.heading4
.standard(color: theme.textColorScheme.secondary),
highlight: theme.textStyle.heading4
.standard(color: theme.textColorScheme.primary)
.copyWith(
backgroundColor: theme.fillColorScheme.themeSelect,
),
),
),
);
];
}

TextSpan buildHighLightSpan({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class _MobileSearchTextfieldState extends State<MobileSearchTextfield> {
Widget build(BuildContext context) {
final theme = AppFlowyTheme.of(context);
return SizedBox(
height: 40,
height: 42,
child: ValueListenableBuilder(
valueListenable: controller,
builder: (context, _, __) {
Expand Down Expand Up @@ -84,12 +84,17 @@ class _MobileSearchTextfieldState extends State<MobileSearchTextfield> {
if (!hasFocus || !hasText) return SizedBox.shrink();
return GestureDetector(
onTap: () => focusNode.unfocus(),
child: Padding(
behavior: HitTestBehavior.opaque,
child: Container(
height: 42,
padding: EdgeInsets.only(left: 8),
child: Text(
LocaleKeys.button_cancel.tr(),
style: theme.textStyle.body
.standard(color: theme.textColorScheme.action),
child: Align(
alignment: Alignment.centerLeft,
child: Text(
LocaleKeys.button_cancel.tr(),
style: theme.textStyle.body
.standard(color: theme.textColorScheme.action),
),
),
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:math';

import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:appflowy_ui/appflowy_ui.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';

Expand Down Expand Up @@ -328,6 +329,7 @@ class _MobileSelectionMenuWidgetState extends State<MobileSelectionMenuWidget> {
}

Widget _buildNoResultsWidget(BuildContext context) {
final theme = AppFlowyTheme.of(context);
return DecoratedBox(
decoration: BoxDecoration(
color: Theme.of(context).cardColor,
Expand All @@ -350,7 +352,10 @@ class _MobileSelectionMenuWidgetState extends State<MobileSelectionMenuWidget> {
child: Center(
child: Text(
LocaleKeys.inlineActions_noResults.tr(),
style: TextStyle(fontSize: 18.0, color: Color(0x801F2225)),
style: TextStyle(
fontSize: 18.0,
color: theme.textColorScheme.primary,
),
textAlign: TextAlign.center,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:universal_platform/universal_platform.dart';

import 'link_embed_menu.dart';

Expand Down Expand Up @@ -156,7 +157,9 @@ class LinkEmbedBlockComponentState
child: ValueListenableBuilder<bool>(
valueListenable: showActionsNotifier,
builder: (context, showActions, child) {
if (!showActions) return SizedBox.shrink();
if (!showActions || UniversalPlatform.isMobile) {
return SizedBox.shrink();
}
return LinkEmbedMenu(
editorState: context.read<EditorState>(),
node: node,
Expand Down Expand Up @@ -189,11 +192,19 @@ class LinkEmbedBlockComponentState
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: ClipRRect(
borderRadius: const BorderRadius.vertical(top: Radius.circular(16)),
child: FlowyNetworkImage(
url: linkInfo.imageUrl ?? '',
width: MediaQuery.of(context).size.width,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: !UniversalPlatform.isMobile
? null
: () =>
afLaunchUrlString(url, addingHttpSchemeWhenFailed: true),
child: ClipRRect(
borderRadius:
const BorderRadius.vertical(top: Radius.circular(16)),
child: FlowyNetworkImage(
url: linkInfo.imageUrl ?? '',
width: MediaQuery.of(context).size.width,
),
),
),
),
Expand Down Expand Up @@ -258,46 +269,53 @@ class LinkEmbedBlockComponentState
child: CircularProgressIndicator.adaptive(),
),
)
: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SvgPicture.asset(
FlowySvgs.embed_error_xl.path,
),
VSpace(4),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: RichText(
maxLines: 1,
overflow: TextOverflow.ellipsis,
text: TextSpan(
children: [
TextSpan(
text: '$url ',
style: TextStyle(
color: textSceme.secondary,
fontSize: 14,
height: 20 / 14,
fontWeight: FontWeight.w700,
: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: !UniversalPlatform.isMobile
? null
: () =>
afLaunchUrlString(url, addingHttpSchemeWhenFailed: true),
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SvgPicture.asset(
FlowySvgs.embed_error_xl.path,
),
VSpace(4),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: RichText(
maxLines: 1,
overflow: TextOverflow.ellipsis,
text: TextSpan(
children: [
TextSpan(
text: '$url ',
style: TextStyle(
color: textSceme.secondary,
fontSize: 14,
height: 20 / 14,
fontWeight: FontWeight.w700,
),
),
),
TextSpan(
text: LocaleKeys
.document_plugins_linkPreview_linkPreviewMenu_unableToDisplay
.tr(),
style: TextStyle(
color: textSceme.secondary,
fontSize: 14,
height: 20 / 14,
fontWeight: FontWeight.w400,
TextSpan(
text: LocaleKeys
.document_plugins_linkPreview_linkPreviewMenu_unableToDisplay
.tr(),
style: TextStyle(
color: textSceme.secondary,
fontSize: 14,
height: 20 / 14,
fontWeight: FontWeight.w400,
),
),
),
],
],
),
),
),
),
],
],
),
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ class CustomLinkPreviewWidget extends StatelessWidget {
return MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () => afLaunchUrlString(url),
behavior: HitTestBehavior.opaque,
onTap: () => afLaunchUrlString(url, addingHttpSchemeWhenFailed: true),
child: child,
),
);
Expand All @@ -133,7 +134,8 @@ class CustomLinkPreviewWidget extends StatelessWidget {
editorState: context.read<EditorState>(),
extendActionWidgets: _buildExtendActionWidgets(context),
child: GestureDetector(
onTap: () => afLaunchUrlString(url),
behavior: HitTestBehavior.opaque,
onTap: () => afLaunchUrlString(url, addingHttpSchemeWhenFailed: true),
child: child,
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:appflowy/plugins/document/presentation/editor_plugins/link_previ
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:appflowy_editor_plugins/appflowy_editor_plugins.dart';
import 'package:flutter/material.dart';
import 'package:universal_platform/universal_platform.dart';

import 'custom_link_preview.dart';
import 'default_selectable_mixin.dart';
Expand Down Expand Up @@ -148,7 +149,7 @@ class CustomLinkPreviewBlockComponentState
child = Stack(
children: [
child,
if (showActions)
if (showActions && UniversalPlatform.isDesktopOrWeb)
Positioned(
top: 12,
right: 12,
Expand Down
Loading
Loading