Skip to content

Commit

Permalink
chore: update CHANGELOG.md (#7209)
Browse files Browse the repository at this point in the history
* Revert "fix: disable deleting mutilple nodes in table"

This reverts commit 0507c39.

* chore: bump version 0.8.1

* chore: remove unused tests
  • Loading branch information
LucasXu0 authored Jan 14, 2025
1 parent b2f3f90 commit 05c1924
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 434 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
# Release Notes
## Version 0.8.1 - 14/01/2025
### New Features:
- AI Chat Layout Options: Customize how AI responses appear with new layouts—List, Table, Image with Text, and Media Only
- DALL-E Integration: Generate stunning AI images from text prompts, now available in AI Chat
- Improved Desktop Search: Find what you need faster using keywords or by asking questions in natural language
- Self-Hosting: Configure web server URLs directly in Settings to enable features like Publish, Copy Link to Share, Custom URLs, and more
- Sidebar Enhancement: Drag to reorder your favorited pages in the Sidebar
- Mobile Table Resizing: Adjust column widths in Simple Tables by long pressing the column borders on mobile
### Bug Fixes
- Resolved an icon rendering issue in callout blocks, tab bars, and search results
- Enhanced image reliability: Retry functionality ensures images load successfully if the first attempt fails

## Version 0.8.0 - 06/01/2025
### Bug Fixes
- Fixed error displaying in the page style menu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@ import 'package:appflowy/plugins/document/presentation/editor_plugins/image/cust
import 'package:appflowy/plugins/document/presentation/editor_plugins/image/image_placeholder.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/image/resizeable_image.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/image/upload_image_menu/upload_image_menu.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/image/upload_image_menu/widgets/embed_image_url_widget.dart';
import 'package:appflowy/startup/startup.dart';
import 'package:appflowy_editor/appflowy_editor.dart'
hide UploadImageMenu, ResizableImage;
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';
import 'package:run_with_network_images/run_with_network_images.dart';

import '../../shared/mock/mock_file_picker.dart';
import '../../shared/util.dart';
Expand All @@ -29,58 +26,6 @@ void main() {
TestWidgetsFlutterBinding.ensureInitialized();

group('image block in document', () {
Future<void> testEmbedImage(WidgetTester tester, String url) async {
await tester.initializeAppFlowy();
await tester.tapAnonymousSignInButton();

// create a new document
await tester.createNewPageWithNameUnderParent(
name: LocaleKeys.document_plugins_image_addAnImageDesktop.tr(),
);

// tap the first line of the document
await tester.editor.tapLineOfEditorAt(0);
await tester.editor.showSlashMenu();
await tester.editor.tapSlashMenuItemWithName(
LocaleKeys.document_slashMenu_name_image.tr(),
);
expect(find.byType(CustomImageBlockComponent), findsOneWidget);
expect(find.byType(ImagePlaceholder), findsOneWidget);
expect(
find.descendant(
of: find.byType(ImagePlaceholder),
matching: find.byType(AppFlowyPopover),
),
findsOneWidget,
);
expect(find.byType(UploadImageMenu), findsOneWidget);

await tester.tapButtonWithName(
LocaleKeys.document_imageBlock_embedLink_label.tr(),
);
await tester.enterText(
find.descendant(
of: find.byType(EmbedImageUrlWidget),
matching: find.byType(TextField),
),
url,
);
await tester.tapButton(
find.descendant(
of: find.byType(EmbedImageUrlWidget),
matching: find.text(
LocaleKeys.document_imageBlock_embedLink_label.tr(),
findRichText: true,
),
),
);
await tester.pumpAndSettle();
expect(find.byType(ResizableImage), findsOneWidget);
final node = tester.editor.getCurrentEditorState().getNodeAtPath([0])!;
expect(node.type, ImageBlockKeys.type);
expect(node.attributes[ImageBlockKeys.url], url);
}

testWidgets('insert an image from local file', (tester) async {
await tester.initializeAppFlowy();
await tester.tapAnonymousSignInButton();
Expand Down Expand Up @@ -131,43 +76,6 @@ void main() {
file.deleteSync();
});

testWidgets('insert a gif image from network', (tester) async {
await testEmbedImage(
tester,
'https://www.easygifanimator.net/images/samples/sparkles.gif',
);
});

testWidgets('insert an image from unsplash', (tester) async {
await runWithNetworkImages(() async {
await tester.initializeAppFlowy();
await tester.tapAnonymousSignInButton();

// create a new document
await tester.createNewPageWithNameUnderParent(
name: LocaleKeys.document_plugins_image_addAnImageDesktop.tr(),
);

// tap the first line of the document
await tester.editor.tapLineOfEditorAt(0);
await tester.editor.showSlashMenu();
await tester.editor.tapSlashMenuItemWithName(
LocaleKeys.document_slashMenu_name_image.tr(),
);
expect(find.byType(CustomImageBlockComponent), findsOneWidget);
expect(find.byType(ImagePlaceholder), findsOneWidget);
expect(
find.descendant(
of: find.byType(ImagePlaceholder),
matching: find.byType(AppFlowyPopover),
),
findsOneWidget,
);
expect(find.byType(UploadImageMenu), findsOneWidget);
expect(find.text('Unsplash'), findsOneWidget);
});
});

testWidgets('insert two images from local file at once', (tester) async {
await tester.initializeAppFlowy();
await tester.tapAnonymousSignInButton();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void main() {
as ShortcutSettingTile;
expect(
second.command.command,
'backspace, shift+backspace',
'',
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ class CustomImageBlockComponentState extends State<CustomImageBlockComponent>
child: ValueListenableBuilder<bool>(
valueListenable: showActionsNotifier,
builder: (_, value, child) {
final url = node.attributes[CustomImageBlockKeys.url];
return Stack(
children: [
editorState.editable
Expand All @@ -266,7 +265,7 @@ class CustomImageBlockComponentState extends State<CustomImageBlockComponent>
child: child!,
)
: child!,
if (value && url.isNotEmpty == true)
if (value)
widget.menuBuilder!(widget.node, this, imageStateNotifier),
],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ class _ImageMenuState extends State<ImageMenu> {

@override
Widget build(BuildContext context) {
final isPlaceholder = url == null || url!.isEmpty;
final theme = Theme.of(context);
return ValueListenableBuilder<ResizableImageState>(
valueListenable: widget.imageStateNotifier,
builder: (_, state, child) {
if (state == ResizableImageState.loading) {
if (state == ResizableImageState.loading && !isPlaceholder) {
return const SizedBox.shrink();
}

Expand All @@ -66,21 +67,25 @@ class _ImageMenuState extends State<ImageMenu> {
child: Row(
children: [
const HSpace(4),
MenuBlockButton(
tooltip: LocaleKeys.document_imageBlock_openFullScreen.tr(),
iconData: FlowySvgs.full_view_s,
onTap: openFullScreen,
),
const HSpace(4),
MenuBlockButton(
tooltip: LocaleKeys.editor_copy.tr(),
iconData: FlowySvgs.copy_s,
onTap: copyImageLink,
),
const HSpace(4),
if (!isPlaceholder) ...[
MenuBlockButton(
tooltip: LocaleKeys.document_imageBlock_openFullScreen.tr(),
iconData: FlowySvgs.full_view_s,
onTap: openFullScreen,
),
const HSpace(4),
MenuBlockButton(
tooltip: LocaleKeys.editor_copy.tr(),
iconData: FlowySvgs.copy_s,
onTap: copyImageLink,
),
const HSpace(4),
],
if (widget.state.editorState.editable) ...[
_ImageAlignButton(node: widget.node, state: widget.state),
const _Divider(),
if (!isPlaceholder) ...[
_ImageAlignButton(node: widget.node, state: widget.state),
const _Divider(),
],
MenuBlockButton(
tooltip: LocaleKeys.button_delete.tr(),
iconData: FlowySvgs.trash_s,
Expand Down
Loading

0 comments on commit 05c1924

Please sign in to comment.