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: lock page issues (#7380)

Lucase028e45e932f
diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/base/mobile_view_page.dart b/frontend/appflowy_flutter/lib/mobile/presentation/base/mobile_view_page.dart
index a02f3879cd..3c9afd15eb 100644
--- a/frontend/appflowy_flutter/lib/mobile/presentation/base/mobile_view_page.dart
+++ b/frontend/appflowy_flutter/lib/mobile/presentation/base/mobile_view_page.dart
@@ -368,15 +368,45 @@ class _MobileViewPageState extends State<MobileViewPage> {
},
builder: (context, state) {
if (state.isLocked) {
- return FlowySvg(
- FlowySvgs.lock_page_s,
- color: const Color(0xFFD95A0B),
+ return GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ context.read<ViewLockStatusBloc>().add(
+ const ViewLockStatusEvent.unlock(),
+ );
+ },
+ child: Padding(
+ padding: const EdgeInsets.only(
+ top: 4.0,
+ right: 8,
+ bottom: 4.0,
+ ),
+ child: FlowySvg(
+ FlowySvgs.lock_page_s,
+ color: const Color(0xFFD95A0B),
+ ),
+ ),
);
} else if (!state.isLocked && state.lockCounter > 0) {
- return FlowySvg(
- FlowySvgs.unlock_page_s,
- color: Color(0xFF8F959E),
- blendMode: null,
+ return GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ context.read<ViewLockStatusBloc>().add(
+ const ViewLockStatusEvent.lock(),
+ );
+ },
+ child: Padding(
+ padding: const EdgeInsets.only(
+ top: 4.0,
+ right: 8,
+ bottom: 4.0,
+ ),
+ child: FlowySvg(
+ FlowySvgs.unlock_page_s,
+ color: Color(0xFF8F959E),
+ blendMode: null,
+ ),
+ ),
);
}
return const SizedBox.shrink();
diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_view_page.dart b/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_view_page.dart
index e2aa34a648..991cf82b5d 100644
--- a/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_view_page.dart
+++ b/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_view_page.dart
@@ -182,6 +182,7 @@ class MobileViewBottomSheetBody extends StatelessWidget {
),
_divider(),
..._buildPublishActions(context),
+ _divider(),
MobileQuickActionButton(
text: LocaleKeys.button_delete.tr(),
textColor: Theme.of(context).colorScheme.error,
@@ -275,7 +276,7 @@ class _LockPageRightIconBuilder extends StatelessWidget {
onAction(
MobileViewBottomSheetBodyAction.lockPage,
arguments: {
- MobileViewBottomSheetBodyActionArguments.isLockedKey: !value,
+ MobileViewBottomSheetBodyActionArguments.isLockedKey: value,
},
);
},
diff --git a/frontend/appflowy_flutter/lib/plugins/document/document_page.dart b/frontend/appflowy_flutter/lib/plugins/document/document_page.dart
index 8d01e1ae12..bc25bf970d 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/document_page.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/document_page.dart
@@ -165,6 +165,7 @@ class _DocumentPageState extends State<DocumentPage>
context: context,
width: width,
padding: EditorStyleCustomizer.documentPadding,
+ editorState: editorState,
),
header: buildCoverAndIcon(context, state),
initialSelection: initialSelection,
@@ -183,6 +184,7 @@ class _DocumentPageState extends State<DocumentPage>
context: context,
width: width,
padding: EditorStyleCustomizer.documentPadding,
+ editorState: editorState,
),
header: buildCoverAndIcon(context, state),
initialSelection: initialSelection,
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart
index 8d911ebfb5..0bac8aae19 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart
@@ -203,24 +203,33 @@ void _customBlockOptionActions(
} else {
top += 2.0;
}
- return Padding(
- padding: EdgeInsets.only(top: top),
- child: BlockActionList(
- blockComponentContext: context,
- blockComponentState: state,
- editorState: editorState,
- blockComponentBuilder: builders,
- actions: actions,
- showSlashMenu: slashMenuItemsBuilder != null
- ? () => customAppFlowySlashCommand(
- itemsBuilder: slashMenuItemsBuilder,
- shouldInsertSlash: false,
- deleteKeywordsByDefault: true,
- style: styleCustomizer.selectionMenuStyleBuilder(),
- supportSlashMenuNodeTypes: supportSlashMenuNodeTypes,
- ).handler.call(editorState)
- : () {},
- ),
+ return ValueListenableBuilder(
+ valueListenable: editorState.editableNotifier,
+ builder: (_, editable, child) {
+ return Opacity(
+ opacity: editable ? 1.0 : 0.0,
+ child: Padding(
+ padding: EdgeInsets.only(top: top),
+ child: BlockActionList(
+ blockComponentContext: context,
+ blockComponentState: state,
+ editorState: editorState,
+ blockComponentBuilder: builders,
+ actions: actions,
+ showSlashMenu: slashMenuItemsBuilder != null
+ ? () => customAppFlowySlashCommand(
+ itemsBuilder: slashMenuItemsBuilder,
+ shouldInsertSlash: false,
+ deleteKeywordsByDefault: true,
+ style: styleCustomizer.selectionMenuStyleBuilder(),
+ supportSlashMenuNodeTypes:
+ supportSlashMenuNodeTypes,
+ ).handler.call(editorState)
+ : () {},
+ ),
+ ),
+ );
+ },
);
};
}
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/database/database_view_block_component.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/database/database_view_block_component.dart
index cd150ff1c1..bc0dcc17e3 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/database/database_view_block_component.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/database/database_view_block_component.dart
@@ -95,6 +95,12 @@ class _DatabaseBlockComponentWidgetState
);
}
+ if (!editorState.editable) {
+ child = IgnorePointer(
+ child: child,
+ );
+ }
+
return child;
}
}
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_style.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_style.dart
index 130f9a9ca1..716296e51f 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_style.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_style.dart
@@ -32,11 +32,13 @@ class EditorStyleCustomizer {
required this.context,
required this.padding,
this.width,
+ this.editorState,
});
final BuildContext context;
final EdgeInsets padding;
final double? width;
+ final EditorState? editorState;
static const double maxDocumentWidth = 480 * 4;
static const double minDocumentWidth = 480;
@@ -76,11 +78,15 @@ class EditorStyleCustomizer {
fontFamily = appearanceFont;
}
+ final cursorColor = (editorState?.editable ?? true)
+ ? (appearance.cursorColor ??
+ DefaultAppearanceSettings.getDefaultCursorColor(context))
+ : Colors.transparent;
+
return EditorStyle.desktop(
padding: padding,
maxWidth: width,
- cursorColor: appearance.cursorColor ??
- DefaultAppearanceSettings.getDefaultCursorColor(context),
+ cursorColor: cursorColor,
selectionColor: appearance.selectionColor ??
DefaultAppearanceSettings.getDefaultSelectionColor(context),
defaultTextDirection: appearance.defaultTextDirection,
diff --git a/frontend/appflowy_flutter/lib/shared/version_checker/version_checker.dart b/frontend/appflowy_flutter/lib/shared/version_checker/version_checker.dart
index b9fecb2b94..7887d75774 100644
--- a/frontend/appflowy_flutter/lib/shared/version_checker/version_checker.dart
+++ b/frontend/appflowy_flutter/lib/shared/version_checker/version_checker.dart
@@ -23,6 +23,8 @@ class VersionChecker {
if (UniversalPlatform.isWindows || UniversalPlatform.isMacOS) {
autoUpdater.setFeedURL(url);
+ // disable the auto update check
+ autoUpdater.setScheduledCheckInterval(0);
}
}
diff --git a/frontend/resources/translations/en.json b/frontend/resources/translations/en.json
index b99e7a6c3f..feacbc7e03 100644
--- a/frontend/resources/translations/en.json
+++ b/frontend/resources/translations/en.json
@@ -556,7 +556,7 @@
}
},
"accountPage": {
- "menuLabel": "My account",
+ "menuLabel": "Account & App",
"title": "My account",
"general": {
"title": "Account name & profile image",
@@ -2008,8 +2008,8 @@
"searchForAnImage": "Search for an image",
"pleaseInputYourOpenAIKey": "please input your AI key in Settings page",
"saveImageToGallery": "Save image",
- "failedToAddImageToGallery": "Failed to add image to gallery",
- "successToAddImageToGallery": "Image added to gallery successfully",
+ "failedToAddImageToGallery": "Failed to save image",
+ "successToAddImageToGallery": "Saved image to Photos",
"unableToLoadImage": "Unable to load image",
"maximumImageSize": "Maximum supported upload image size is 10MB",
"uploadImageErrorImageSizeTooBig": "Image size must be less than 10MB",
@@ -3097,13 +3097,13 @@
"autoUpdate": {
"criticalUpdateTitle": "Update required to continue",
"criticalUpdateDescription": "We've made improvements to enhance your experience! Please update from {currentVersion} to {newVersion} to keep using the app.",
- "criticalUpdateButton": "Update now",
+ "criticalUpdateButton": "Update",
"bannerUpdateTitle": "New Version Available!",
- "bannerUpdateDescription": "Get the latest features and bug fixes. Click \"Update\" to install now",
+ "bannerUpdateDescription": "Get the latest features and fixes. Click \"Update\" to install now",
"bannerUpdateButton": "Update",
"settingsUpdateTitle": "New Version ({newVersion}) Available!",
"settingsUpdateDescription": "Current version: {currentVersion} (Official build) → {newVersion}",
- "settingsUpdateButton": "Update now",
+ "settingsUpdateButton": "Update",
"settingsUpdateWhatsNew": "What's new"
},
"lockPage": {