Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

fix: add time to view meta info (#4769)

Mathias Mogensen0cffe42d8095
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/more_view_actions/more_view_actions.dart b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/more_view_actions/more_view_actions.dart
index e5aa04497a..1ae2ff35c3 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/more_view_actions/more_view_actions.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/more_view_actions/more_view_actions.dart
@@ -8,7 +8,6 @@ import 'package:appflowy/workspace/presentation/widgets/more_view_actions/widget
import 'package:appflowy/workspace/presentation/widgets/more_view_actions/widgets/font_size_action.dart';
import 'package:appflowy/workspace/presentation/widgets/more_view_actions/widgets/view_meta_info.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
-import 'package:appflowy_backend/protobuf/flowy-user/date_time.pbenum.dart';
import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
@@ -35,13 +34,11 @@ class MoreViewActions extends StatefulWidget {
class _MoreViewActionsState extends State<MoreViewActions> {
late final List<Widget> viewActions;
- late final UserDateFormatPB dateFormat;
final popoverMutex = PopoverMutex();
@override
void initState() {
super.initState();
- dateFormat = context.read<AppearanceSettingsCubit>().state.dateFormat;
viewActions = ViewActionType.values
.map(
(type) => ViewAction(
@@ -61,11 +58,15 @@ class _MoreViewActionsState extends State<MoreViewActions> {
@override
Widget build(BuildContext context) {
+ final appearanceSettings = context.watch<AppearanceSettingsCubit>().state;
+ final dateFormat = appearanceSettings.dateFormat;
+ final timeFormat = appearanceSettings.timeFormat;
+
return BlocBuilder<ViewInfoBloc, ViewInfoState>(
builder: (context, state) {
return AppFlowyPopover(
mutex: popoverMutex,
- constraints: BoxConstraints.loose(const Size(200, 400)),
+ constraints: BoxConstraints.loose(const Size(210, 400)),
offset: const Offset(0, 30),
popupBuilder: (_) {
final actions = [
@@ -79,6 +80,7 @@ class _MoreViewActionsState extends State<MoreViewActions> {
const Divider(height: 4),
ViewMetaInfo(
dateFormat: dateFormat,
+ timeFormat: timeFormat,
documentCounters: state.documentCounters,
createdAt: state.createdAt,
),
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/more_view_actions/widgets/view_meta_info.dart b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/more_view_actions/widgets/view_meta_info.dart
index f05842897f..f290286097 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/more_view_actions/widgets/view_meta_info.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/more_view_actions/widgets/view_meta_info.dart
@@ -12,11 +12,13 @@ class ViewMetaInfo extends StatelessWidget {
const ViewMetaInfo({
super.key,
required this.dateFormat,
+ required this.timeFormat,
this.documentCounters,
this.createdAt,
});
final UserDateFormatPB dateFormat;
+ final UserTimeFormatPB timeFormat;
final Counters? documentCounters;
final DateTime? createdAt;
@@ -47,8 +49,9 @@ class ViewMetaInfo extends StatelessWidget {
if (documentCounters != null) const VSpace(2),
FlowyText.regular(
LocaleKeys.moreAction_createdAt.tr(
- args: [dateFormat.formatDate(createdAt!, false)],
+ args: [dateFormat.formatDate(createdAt!, true, timeFormat)],
),
+ maxLines: 2,
color: Theme.of(context).hintColor,
),
],