Skip to content

Commit 814fdfe

Browse files
authored
Merge pull request #438 from AppFlowy-IO/grid_bug_fix
chore: fix some ui bugs
2 parents 9073351 + ef008a7 commit 814fdfe

File tree

7 files changed

+36
-16
lines changed

7 files changed

+36
-16
lines changed

frontend/app_flowy/lib/workspace/presentation/plugins/grid/grid.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class GridPluginBuilder implements PluginBuilder {
2828

2929
class GridPluginConfig implements PluginConfig {
3030
@override
31-
bool get creatable => false;
31+
bool get creatable => true;
3232
}
3333

3434
class GridPlugin extends Plugin {

frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/selection_cell/extension.dart

+3-2
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,16 @@ class SelectOptionTextField extends StatelessWidget {
108108
}
109109

110110
return TextField(
111+
autofocus: true,
111112
controller: editController,
112113
focusNode: focusNode,
113114
onChanged: onChanged,
114115
onSubmitted: onSubmitted,
115116
maxLines: 1,
116117
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
117118
decoration: InputDecoration(
118-
border: OutlineInputBorder(
119-
borderSide: BorderSide(color: theme.shader3, width: 1.0),
119+
enabledBorder: OutlineInputBorder(
120+
borderSide: BorderSide(color: theme.main1, width: 1.0),
120121
borderRadius: Corners.s10Border,
121122
),
122123
isDense: true,

frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/selection_cell/selection_editor.dart

+13-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:app_flowy/workspace/application/grid/cell_bloc/selection_editor_
44
import 'package:app_flowy/workspace/application/grid/row/row_service.dart';
55
import 'package:app_flowy/workspace/presentation/plugins/grid/src/layout/sizes.dart';
66
import 'package:app_flowy/workspace/presentation/plugins/grid/src/widgets/header/type_option/edit_option_pannel.dart';
7+
import 'package:app_flowy/workspace/presentation/plugins/grid/src/widgets/header/type_option/widget.dart';
78
import 'package:flowy_infra/image.dart';
89
import 'package:flowy_infra/theme.dart';
910
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
@@ -53,7 +54,9 @@ class SelectOptionEditor extends StatelessWidget with FlowyOverlayDelegate {
5354
shrinkWrap: true,
5455
slivers: [
5556
SliverToBoxAdapter(child: _TextField()),
56-
const SliverToBoxAdapter(child: VSpace(10)),
57+
const SliverToBoxAdapter(child: VSpace(6)),
58+
const SliverToBoxAdapter(child: TypeOptionSeparator()),
59+
const SliverToBoxAdapter(child: VSpace(6)),
5760
const SliverToBoxAdapter(child: _Title()),
5861
const SliverToBoxAdapter(child: _OptionList()),
5962
],
@@ -104,7 +107,9 @@ class _OptionList extends StatelessWidget {
104107
Widget build(BuildContext context) {
105108
return BlocBuilder<SelectOptionEditorBloc, SelectOptionEditorState>(
106109
builder: (context, state) {
107-
final cells = state.options.map((option) => _SelectOptionCell(option)).toList();
110+
final cells = state.options.map((option) {
111+
return _SelectOptionCell(option, state.selectedOptions.contains(option));
112+
}).toList();
108113
final list = ListView.separated(
109114
shrinkWrap: true,
110115
controller: ScrollController(),
@@ -175,7 +180,8 @@ class _Title extends StatelessWidget {
175180

176181
class _SelectOptionCell extends StatelessWidget {
177182
final SelectOption option;
178-
const _SelectOptionCell(this.option, {Key? key}) : super(key: key);
183+
final bool isSelected;
184+
const _SelectOptionCell(this.option, this.isSelected, {Key? key}) : super(key: key);
179185

180186
@override
181187
Widget build(BuildContext context) {
@@ -194,6 +200,10 @@ class _SelectOptionCell extends StatelessWidget {
194200
const Spacer(),
195201
];
196202

203+
if (isSelected) {
204+
children.add(svgWidget("grid/checkmark"));
205+
}
206+
197207
if (onHover) {
198208
children.add(FlowyIconButton(
199209
width: 28,

frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/toolbar/grid_setting.dart

+10-3
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ class GridSettingList extends StatelessWidget {
3737
onAction: (action, settingContext) {
3838
switch (action) {
3939
case GridSettingAction.filter:
40-
// TODO: Handle this case.
4140
break;
4241
case GridSettingAction.sortBy:
43-
// TODO: Handle this case.
4442
break;
4543
case GridSettingAction.properties:
4644
GridPropertyList(gridId: settingContext.gridId, fields: settingContext.fields).show(context);
@@ -130,7 +128,7 @@ class _SettingItem extends StatelessWidget {
130128
height: GridSize.typeOptionItemHeight,
131129
child: FlowyButton(
132130
isSelected: isSelected,
133-
text: FlowyText.medium(action.title(), fontSize: 12),
131+
text: FlowyText.medium(action.title(), fontSize: 12, color: action.enable() ? null : theme.shader4),
134132
hoverColor: theme.hover,
135133
onTap: () {
136134
context.read<GridSettingBloc>().add(GridSettingEvent.performAction(action));
@@ -163,4 +161,13 @@ extension _GridSettingExtension on GridSettingAction {
163161
return LocaleKeys.grid_settings_Properties.tr();
164162
}
165163
}
164+
165+
bool enable() {
166+
switch (this) {
167+
case GridSettingAction.properties:
168+
return true;
169+
default:
170+
return false;
171+
}
172+
}
166173
}

frontend/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/flowy_overlay.dart

+2
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,9 @@ class FlowyOverlayState extends State<FlowyOverlay> {
322322
// // 'app content was created above the Navigator with the WidgetsApp builder parameter.',
323323
// // );
324324
// // ...
325+
325326
return MaterialApp(
327+
theme: Theme.of(context),
326328
debugShowCheckedModeBanner: false,
327329
home: Stack(
328330
children: children..addAll(overlays),

frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_input_field.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class _RoundedInputFieldState extends State<RoundedInputField> {
9898
contentPadding: widget.contentPadding,
9999
hintText: widget.hintText,
100100
hintStyle: TextStyle(color: widget.normalBorderColor),
101-
border: OutlineInputBorder(
101+
enabledBorder: OutlineInputBorder(
102102
borderSide: BorderSide(
103103
color: borderColor,
104104
width: 1.0,

frontend/app_flowy/pubspec.lock

+6-6
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ packages:
645645
name: js
646646
url: "https://pub.dartlang.org"
647647
source: hosted
648-
version: "0.6.4"
648+
version: "0.6.3"
649649
json_annotation:
650650
dependency: transitive
651651
description:
@@ -799,7 +799,7 @@ packages:
799799
name: path
800800
url: "https://pub.dartlang.org"
801801
source: hosted
802-
version: "1.8.1"
802+
version: "1.8.0"
803803
path_drawing:
804804
dependency: transitive
805805
description:
@@ -1133,21 +1133,21 @@ packages:
11331133
name: test
11341134
url: "https://pub.dartlang.org"
11351135
source: hosted
1136-
version: "1.20.1"
1136+
version: "1.19.5"
11371137
test_api:
11381138
dependency: transitive
11391139
description:
11401140
name: test_api
11411141
url: "https://pub.dartlang.org"
11421142
source: hosted
1143-
version: "0.4.9"
1143+
version: "0.4.8"
11441144
test_core:
11451145
dependency: transitive
11461146
description:
11471147
name: test_core
11481148
url: "https://pub.dartlang.org"
11491149
source: hosted
1150-
version: "0.4.11"
1150+
version: "0.4.9"
11511151
textfield_tags:
11521152
dependency: "direct main"
11531153
description:
@@ -1361,5 +1361,5 @@ packages:
13611361
source: hosted
13621362
version: "8.0.0"
13631363
sdks:
1364-
dart: ">=2.16.0-100.0.dev <3.0.0"
1364+
dart: ">=2.15.0-116.0.dev <3.0.0"
13651365
flutter: ">=2.5.0"

0 commit comments

Comments
 (0)