Skip to content

Commit 6664fc9

Browse files
committed
Merge branch 'main' into enable_ci_on_windows_linux_2
2 parents f308c30 + f8a17da commit 6664fc9

File tree

19 files changed

+419
-181
lines changed

19 files changed

+419
-181
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
# Release Notes
2+
## Version 0.8.8 - 01/04/2025
3+
### New Features
4+
- Added support for selecting AI models in AI writer
5+
- Revamped link menu in toolbar
6+
- Added support for using ":" to add emojis in documents
7+
- Passed the history of past AI prompts and responses to AI writer
8+
### Bug Fixes
9+
- Improved AI writer scrolling user experience
10+
- Fixed issue where checklist items would disappear during reordering
11+
- Fixed numbered lists generated by AI to maintain the same index as the input
12+
213
## Version 0.8.7 - 18/03/2025
314
### New Features
415
- Made local AI free and integrated with Ollama

frontend/appflowy_flutter/integration_test/desktop/document/document_toolbar_test.dart

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,45 @@ void main() {
184184
3,
185185
);
186186
});
187+
188+
testWidgets('toolbar will not rebuild after click item', (tester) async {
189+
const text = 'Test rebuilding';
190+
await prepareForToolbar(tester, text);
191+
Finder toolbar = find.byType(DesktopFloatingToolbar);
192+
Element toolbarElement = toolbar.evaluate().first;
193+
final elementHashcode = toolbarElement.hashCode;
194+
final boldButton = find.byFlowySvg(FlowySvgs.toolbar_bold_m),
195+
underlineButton = find.byFlowySvg(FlowySvgs.toolbar_underline_m),
196+
italicButton = find.byFlowySvg(FlowySvgs.toolbar_inline_italic_m);
197+
198+
/// tap format buttons
199+
await tester.tapButton(boldButton);
200+
await tester.tapButton(underlineButton);
201+
await tester.tapButton(italicButton);
202+
toolbar = find.byType(DesktopFloatingToolbar);
203+
toolbarElement = toolbar.evaluate().first;
204+
205+
/// check if the toolbar is not rebuilt
206+
expect(elementHashcode, toolbarElement.hashCode);
207+
final editorState = tester.editor.getCurrentEditorState();
208+
209+
/// check text formats
210+
expect(
211+
editorState
212+
.getDeltaAttributeValueInSelection(AppFlowyRichTextKeys.bold),
213+
true,
214+
);
215+
expect(
216+
editorState
217+
.getDeltaAttributeValueInSelection(AppFlowyRichTextKeys.italic),
218+
true,
219+
);
220+
expect(
221+
editorState
222+
.getDeltaAttributeValueInSelection(AppFlowyRichTextKeys.underline),
223+
true,
224+
);
225+
});
187226
});
188227

189228
group('document toolbar: link', () {
@@ -228,6 +267,7 @@ void main() {
228267
expect(toolbar, findsNothing);
229268

230269
/// show toolbar again
270+
await tester.editor.tapLineOfEditorAt(0);
231271
await selectText(tester, text);
232272
await tester.tapButton(linkButton);
233273

frontend/appflowy_flutter/integration_test/shared/document_test_operations.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,11 @@ class EditorOperations {
307307
Future<void> openTurnIntoMenu(Path path) async {
308308
await hoverAndClickOptionMenuButton(path);
309309
await tester.tapButton(
310-
find.findTextInFlowyText(
311-
LocaleKeys.document_plugins_optionAction_turnInto.tr(),
312-
),
310+
find
311+
.findTextInFlowyText(
312+
LocaleKeys.document_plugins_optionAction_turnInto.tr(),
313+
)
314+
.first,
313315
);
314316
await tester.pumpUntilFound(find.byType(TurnIntoOptionMenu));
315317
}

frontend/appflowy_flutter/lib/mobile/presentation/home/setting/settings_popup_menu.dart

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ enum _MobileSettingsPopupMenuItem {
1616
members,
1717
trash,
1818
help,
19+
helpAndDocumentation,
1920
}
2021

2122
class HomePageSettingsPopupMenu extends StatelessWidget {
@@ -62,10 +63,16 @@ class HomePageSettingsPopupMenu extends StatelessWidget {
6263
text: LocaleKeys.settings_popupMenuItem_trash.tr(),
6364
),
6465
const PopupMenuDivider(height: 0.5),
66+
_buildItem(
67+
value: _MobileSettingsPopupMenuItem.helpAndDocumentation,
68+
svg: FlowySvgs.help_and_documentation_s,
69+
text: LocaleKeys.settings_popupMenuItem_helpAndDocumentation.tr(),
70+
),
71+
const PopupMenuDivider(height: 0.5),
6572
_buildItem(
6673
value: _MobileSettingsPopupMenuItem.help,
6774
svg: FlowySvgs.message_support_s,
68-
text: LocaleKeys.settings_popupMenuItem_helpAndSupport.tr(),
75+
text: LocaleKeys.settings_popupMenuItem_getSupport.tr(),
6976
),
7077
],
7178
onSelected: (_MobileSettingsPopupMenuItem value) {
@@ -82,6 +89,9 @@ class HomePageSettingsPopupMenu extends StatelessWidget {
8289
case _MobileSettingsPopupMenuItem.help:
8390
_openHelpPage(context);
8491
break;
92+
case _MobileSettingsPopupMenuItem.helpAndDocumentation:
93+
_openHelpAndDocumentationPage(context);
94+
break;
8595
}
8696
},
8797
child: const Padding(
@@ -123,6 +133,10 @@ class HomePageSettingsPopupMenu extends StatelessWidget {
123133
void _openSettingsPage(BuildContext context) {
124134
context.push(MobileHomeSettingPage.routeName);
125135
}
136+
137+
void _openHelpAndDocumentationPage(BuildContext context) {
138+
afLaunchUrlString('https://appflowy.com/guide');
139+
}
126140
}
127141

128142
class _PopupButton extends StatelessWidget {

frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage>
459459
child: DesktopFloatingToolbar(
460460
editorState: editorState,
461461
onDismiss: onDismiss,
462-
enableAnimation: false,
462+
enableAnimation: !isMetricsChanged,
463463
child: child,
464464
),
465465
),

frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/desktop_toolbar/link/link_hover_menu.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class _LinkHoverTriggerState extends State<LinkHoverTrigger> {
221221
if (isPage) {
222222
final viewId = href.split('/').lastOrNull ?? '';
223223
if (viewId.isEmpty) {
224-
await afLaunchUrlString(href);
224+
await afLaunchUrlString(href, addingHttpSchemeWhenFailed: true);
225225
} else {
226226
final (view, isInTrash, isDeleted) =
227227
await ViewBackendService.getMentionPageStatus(viewId);
@@ -230,7 +230,7 @@ class _LinkHoverTriggerState extends State<LinkHoverTrigger> {
230230
}
231231
}
232232
} else {
233-
await afLaunchUrlString(href);
233+
await afLaunchUrlString(href, addingHttpSchemeWhenFailed: true);
234234
}
235235
}
236236

@@ -486,8 +486,7 @@ class LinkHoverTriggers {
486486

487487
void call(HoverTriggerKey key) {
488488
final callbacks = _map[key] ?? {};
489-
for (final callback in callbacks) {
490-
callback.call();
491-
}
489+
if (callbacks.isEmpty) return;
490+
callbacks.first.call();
492491
}
493492
}

frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/desktop_toolbar/link/link_styles.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class LinkStyle {
99
static const textPrimary = Color(0xFF1F2329);
1010

1111
static Color borderColor(BuildContext context) =>
12-
Theme.of(context).isLightMode ? Color(0xFFE8ECF3) : Color(0xffbdbdbd);
12+
Theme.of(context).isLightMode ? Color(0xFFE8ECF3) : Color(0x64BDBDBD);
1313

1414
static InputDecoration buildLinkTextFieldInputDecoration(
1515
String hintText,
@@ -18,9 +18,7 @@ class LinkStyle {
1818
}) {
1919
final border = OutlineInputBorder(
2020
borderRadius: BorderRadius.all(Radius.circular(8.0)),
21-
borderSide: BorderSide(
22-
color: borderColor(context),
23-
),
21+
borderSide: BorderSide(color: borderColor(context)),
2422
);
2523
final enableBorder = border.copyWith(
2624
borderSide: BorderSide(

frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/toolbar_item/text_suggestions_toolbar_item.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,14 @@ class _SuggestionsActionListState extends State<SuggestionsActionList> {
8484
void initState() {
8585
super.initState();
8686
refreshSuggestions();
87+
editorState.selectionNotifier.addListener(refreshSuggestions);
8788
}
8889

8990
@override
9091
void dispose() {
91-
super.dispose();
92+
editorState.selectionNotifier.removeListener(refreshSuggestions);
9293
popoverController.close();
94+
super.dispose();
9395
}
9496

9597
@override
@@ -290,6 +292,7 @@ class _SuggestionsActionListState extends State<SuggestionsActionList> {
290292
}
291293
currentSuggestionItem =
292294
suggestions.where((item) => item.type == suggestionType).first;
295+
if (mounted) setState(() {});
293296
}
294297
}
295298

0 commit comments

Comments
 (0)