Skip to content

Commit d665153

Browse files
authored
fix: 0.2.3 known issues (#2886)
* fix: option menu position * fix: rename helps highlight the text for the user * fix: export as markdown file name invalid * chore: align the emoji in callout * fix: leave more space in the editor * fix: 0.2.3 known issues * chore: add flutter pub get in flutter.toml
1 parent eee3211 commit d665153

File tree

10 files changed

+54
-21
lines changed

10 files changed

+54
-21
lines changed

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

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'package:appflowy/plugins/document/presentation/editor_plugins/database/r
55
import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.dart';
66
import 'package:appflowy/plugins/document/presentation/editor_style.dart';
77
import 'package:appflowy_editor/appflowy_editor.dart';
8+
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
89
import 'package:flutter/material.dart';
910
import 'package:flutter_bloc/flutter_bloc.dart';
1011

@@ -132,6 +133,7 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
132133
characterShortcutEvents: characterShortcutEvents,
133134
commandShortcutEvents: commandShortcutEvents,
134135
header: widget.header,
136+
footer: const VSpace(200),
135137
);
136138

137139
return Center(
@@ -161,7 +163,7 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
161163
];
162164

163165
final configuration = BlockComponentConfiguration(
164-
padding: (_) => const EdgeInsets.symmetric(vertical: 4.0),
166+
padding: (_) => const EdgeInsets.symmetric(vertical: 5.0),
165167
);
166168
final customBlockComponentBuilderMap = {
167169
PageBlockKeys.type: PageBlockComponentBuilder(),
@@ -211,7 +213,10 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
211213
CalloutBlockKeys.type: CalloutBlockComponentBuilder(
212214
configuration: configuration,
213215
),
214-
DividerBlockKeys.type: DividerBlockComponentBuilder(),
216+
DividerBlockKeys.type: DividerBlockComponentBuilder(
217+
configuration: configuration,
218+
height: 28.0,
219+
),
215220
MathEquationBlockKeys.type: MathEquationBlockComponentBuilder(
216221
configuration: configuration.copyWith(
217222
padding: (_) => const EdgeInsets.symmetric(vertical: 20),
@@ -277,15 +282,23 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
277282
];
278283

279284
builder.showActions = (_) => true;
280-
builder.actionBuilder = (context, state) => BlockActionList(
285+
builder.actionBuilder = (context, state) {
286+
final padding = context.node.type == HeadingBlockKeys.type
287+
? const EdgeInsets.only(top: 8.0)
288+
: const EdgeInsets.all(0);
289+
return Padding(
290+
padding: padding,
291+
child: BlockActionList(
281292
blockComponentContext: context,
282293
blockComponentState: state,
283294
editorState: widget.editorState,
284295
actions: actions,
285296
showSlashMenu: () => showSlashMenu(
286297
widget.editorState,
287298
),
288-
);
299+
),
300+
);
301+
};
289302
}
290303

291304
return builders;

frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_list.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ class BlockActionList extends StatelessWidget {
3131
editorState: editorState,
3232
showSlashMenu: showSlashMenu,
3333
),
34-
const SizedBox(width: 8.0),
34+
const SizedBox(width: 4.0),
3535
BlockOptionButton(
3636
blockComponentContext: blockComponentContext,
3737
blockComponentState: blockComponentState,
3838
actions: actions,
3939
editorState: editorState,
4040
),
41-
const SizedBox(width: 6.0),
41+
const SizedBox(width: 4.0),
4242
],
4343
);
4444
}

frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/callout/callout_block_component.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ class _CalloutBlockComponentWidgetState
150150
children: [
151151
// the emoji picker button for the note
152152
Padding(
153-
padding: const EdgeInsets.all(2.0),
153+
padding: const EdgeInsets.only(
154+
top: 6.0,
155+
left: 2.0,
156+
right: 2.0,
157+
),
154158
child: EmojiPickerButton(
155159
key: ValueKey(
156160
emoji.toString(),

frontend/appflowy_flutter/lib/plugins/document/presentation/share/share_button.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ class ShareActionListState extends State<ShareActionList> {
118118
case ShareAction.markdown:
119119
final exportPath = await getIt<FilePickerService>().saveFile(
120120
dialogTitle: '',
121-
fileName: '$name.md',
121+
// encode the file name in case it contains special characters
122+
fileName: '${Uri.encodeComponent(name)}.md',
122123
);
123124
if (exportPath != null) {
124125
docShareBloc.add(DocShareEvent.shareMarkdown(exportPath));

frontend/appflowy_flutter/lib/workspace/presentation/home/menu/app/header/header.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class MenuAppHeader extends StatelessWidget {
8787
case AppDisclosureAction.rename:
8888
NavigatorTextFieldDialog(
8989
title: LocaleKeys.menuAppHeader_renameDialog.tr(),
90+
autoSelectAllText: true,
9091
value: context.read<AppBloc>().state.view.name,
9192
confirm: (newValue) {
9293
context.read<AppBloc>().add(AppEvent.rename(newValue));

frontend/appflowy_flutter/lib/workspace/presentation/home/menu/app/section/item.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ class ViewSectionItem extends StatelessWidget {
9999
case ViewDisclosureAction.rename:
100100
NavigatorTextFieldDialog(
101101
title: LocaleKeys.disclosureAction_rename.tr(),
102+
autoSelectAllText: true,
102103
value: blocContext.read<ViewBloc>().state.view.name,
103104
confirm: (newValue) {
104105
blocContext

frontend/appflowy_flutter/lib/workspace/presentation/widgets/dialogs.dart

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,40 @@ export 'package:flowy_infra_ui/widget/dialog/styled_dialogs.dart';
1212
import 'package:appflowy/generated/locale_keys.g.dart';
1313

1414
class NavigatorTextFieldDialog extends StatefulWidget {
15-
final String value;
16-
final String title;
17-
final void Function()? cancel;
18-
final void Function(String) confirm;
19-
2015
const NavigatorTextFieldDialog({
16+
super.key,
2117
required this.title,
18+
this.autoSelectAllText = false,
2219
required this.value,
2320
required this.confirm,
2421
this.cancel,
25-
Key? key,
26-
}) : super(key: key);
22+
});
23+
24+
final String value;
25+
final String title;
26+
final void Function()? cancel;
27+
final void Function(String) confirm;
28+
final bool autoSelectAllText;
2729

2830
@override
29-
State<NavigatorTextFieldDialog> createState() => _CreateTextFieldDialog();
31+
State<NavigatorTextFieldDialog> createState() =>
32+
_NavigatorTextFieldDialogState();
3033
}
3134

32-
class _CreateTextFieldDialog extends State<NavigatorTextFieldDialog> {
35+
class _NavigatorTextFieldDialogState extends State<NavigatorTextFieldDialog> {
3336
String newValue = "";
37+
final controller = TextEditingController();
3438

3539
@override
3640
void initState() {
3741
newValue = widget.value;
42+
controller.text = newValue;
43+
if (widget.autoSelectAllText) {
44+
controller.selection = TextSelection(
45+
baseOffset: 0,
46+
extentOffset: newValue.length,
47+
);
48+
}
3849
super.initState();
3950
}
4051

@@ -52,7 +63,7 @@ class _CreateTextFieldDialog extends State<NavigatorTextFieldDialog> {
5263
FlowyFormTextInput(
5364
textAlign: TextAlign.center,
5465
hintText: LocaleKeys.dialogCreatePageNameHint.tr(),
55-
initialValue: widget.value,
66+
controller: controller,
5667
textStyle: Theme.of(context).textTheme.bodySmall?.copyWith(
5768
fontSize: FontSizes.s16,
5869
),

frontend/appflowy_flutter/pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ packages:
5353
dependency: "direct main"
5454
description:
5555
path: "."
56-
ref: "4f83b6f"
57-
resolved-ref: "4f83b6feb92963f104f3f1f77a473a06aa4870f5"
56+
ref: cd0f67a
57+
resolved-ref: cd0f67a48e40188114800fae9a0f59cafe15b0f2
5858
url: "https://github.com/AppFlowy-IO/appflowy-editor.git"
5959
source: git
6060
version: "1.0.4"

frontend/appflowy_flutter/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ dependencies:
4646
appflowy_editor:
4747
git:
4848
url: https://github.com/AppFlowy-IO/appflowy-editor.git
49-
ref: 4f83b6f
49+
ref: cd0f67a
5050
appflowy_popover:
5151
path: packages/appflowy_popover
5252

frontend/scripts/makefile/flutter.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ script = [
188188
"""
189189
cd appflowy_flutter
190190
flutter clean
191+
flutter pub get
191192
flutter packages pub get
192193
dart run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
193194
dart run build_runner build -d
@@ -200,6 +201,7 @@ script = [
200201
"""
201202
cd ./appflowy_flutter/
202203
exec cmd.exe /c flutter clean
204+
exec cmd.exe /c flutter pub get
203205
exec cmd.exe /c flutter packages pub get
204206
exec cmd.exe /c dart run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
205207
exec cmd.exe /c dart run build_runner build -d

0 commit comments

Comments
 (0)