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: the settings view of path configuration is not displayed completely (#1647)

Lucas.Xu340f27cf87ef
diff --git a/frontend/app_flowy/lib/workspace/application/settings/settings_location_cubit.dart b/frontend/app_flowy/lib/workspace/application/settings/settings_location_cubit.dart
index f46850cd01..08a21f22e0 100644
--- a/frontend/app_flowy/lib/workspace/application/settings/settings_location_cubit.dart
+++ b/frontend/app_flowy/lib/workspace/application/settings/settings_location_cubit.dart
@@ -12,10 +12,22 @@ const String kSettingsLocationDefaultLocation =
class SettingsLocation {
SettingsLocation({
- this.path,
- });
+ String? path,
+ }) : _path = path;
- String? path;
+ String? _path;
+
+ set path(String? path) {
+ _path = path;
+ }
+
+ String? get path {
+ if (Platform.isMacOS) {
+ // remove the prefix `/Volumes/Macintosh HD/Users/`
+ return _path?.replaceFirst('/Volumes/Macintosh HD/Users', '');
+ }
+ return _path;
+ }
SettingsLocation copyWith({String? path}) {
return SettingsLocation(
diff --git a/frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_file_customize_location_view.dart b/frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_file_customize_location_view.dart
index 99323f0f43..5df13b9ac5 100644
--- a/frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_file_customize_location_view.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_file_customize_location_view.dart
@@ -40,6 +40,7 @@ class SettingsFileLocationCustomzierState
title: FlowyText.regular(
LocaleKeys.settings_files_defaultLocation.tr(),
fontSize: 15.0,
+ overflow: TextOverflow.ellipsis,
),
subtitle: Tooltip(
message: LocaleKeys.settings_files_doubleTapToCopy.tr(),
@@ -52,6 +53,7 @@ class SettingsFileLocationCustomzierState
child: FlowyText.regular(
state.path ?? '',
fontSize: 10.0,
+ overflow: TextOverflow.ellipsis,
),
),
),