Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(web): remove the duplicate reading toolbar icon

tianma-ifa6386e60d9be
diff --git a/apps/web/src/components/EditorPane.tsx b/apps/web/src/components/EditorPane.tsx
index 0796c270..854e47da 100644
--- a/apps/web/src/components/EditorPane.tsx
+++ b/apps/web/src/components/EditorPane.tsx
@@ -2917,9 +2917,8 @@ const RichEditorPane = ({
if (handledReadingProtectionToggleTokenRef.current === readingProtectionToggleToken) return;
handledReadingProtectionToggleTokenRef.current = readingProtectionToggleToken;
if (editorShortcutBlocked || isMobileViewport || readOnly || !memoRef.current) return;
- if (isMarkdownMode) handleMarkdownModeChange();
toggleDesktopReadingProtection();
- }, [editorShortcutBlocked, handleMarkdownModeChange, isMarkdownMode, isMobileViewport, readOnly, readingProtectionToggleToken, toggleDesktopReadingProtection]);
+ }, [editorShortcutBlocked, isMobileViewport, readOnly, readingProtectionToggleToken, toggleDesktopReadingProtection]);
useEffect(() => {
if (handledEditorModeToggleTokenRef.current === editorModeToggleToken) {
@@ -2938,21 +2937,8 @@ const RichEditorPane = ({
handleMarkdownModeChange();
}, [desktopReadingProtection, editorModeToggleToken, editorShortcutBlocked, handleMarkdownModeChange, useMobilePlainTextEditor]);
- const editorView = !isMobileViewport && desktopReadingProtection
- ? "reading"
- : useMarkdownSourceEditor
- ? "markdown"
- : "rich";
- const selectEditorView = useCallback((view: "rich" | "markdown" | "reading") => {
- if (view === "reading") {
- if (isMarkdownMode) handleMarkdownModeChange();
- if (!desktopReadingProtection) {
- setDesktopReadingProtection(true);
- writeDesktopReadingProtectionPreference(true);
- }
- return;
- }
-
+ const editorView = useMarkdownSourceEditor ? "markdown" : "rich";
+ const selectEditorView = useCallback((view: "rich" | "markdown") => {
if (desktopReadingProtection) {
setDesktopReadingProtection(false);
writeDesktopReadingProtectionPreference(false);
diff --git a/apps/web/src/components/EditorToolbar.tsx b/apps/web/src/components/EditorToolbar.tsx
index 468fc1e1..58423206 100644
--- a/apps/web/src/components/EditorToolbar.tsx
+++ b/apps/web/src/components/EditorToolbar.tsx
@@ -21,7 +21,6 @@ import {
Sigma,
ChevronDown,
ChevronUp,
- BookOpen,
FileCode2,
Palette,
Type,
@@ -160,12 +159,11 @@ const toggleListAtSelection = (editor: Editor, listType: "bulletList" | "ordered
}
};
-export type EditorViewMode = "rich" | "markdown" | "reading";
+export type EditorViewMode = "rich" | "markdown";
const EDITOR_VIEW_MODES = [
{ value: "rich", labelKey: "editorToolbar.richText", icon: Type },
{ value: "markdown", labelKey: "editorToolbar.markdown", icon: FileCode2 },
- { value: "reading", labelKey: "editorToolbar.reading", icon: BookOpen },
] as const satisfies ReadonlyArray<{ value: EditorViewMode; labelKey: string; icon: typeof Type }>;
export const EditorToolbar = ({
@@ -188,7 +186,7 @@ export const EditorToolbar = ({
markdownMode?: boolean;
editorView?: EditorViewMode;
onEditorViewChange?: (view: EditorViewMode) => void;
- /** Trash and other hard locks. Reading mode must not disable the view switch. */
+ /** Trash and other hard locks. Reading protection must not disable the view switch. */
viewSwitchDisabled?: boolean;
onMarkdownModeChange?: () => void;
markdownModeShortcut?: ShortcutBinding;
diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.ts
index 6151cbf5..3f0c0cbf 100644
--- a/packages/shared/src/i18n/en-US.ts
+++ b/packages/shared/src/i18n/en-US.ts
@@ -2133,7 +2133,6 @@ export const enUS = {
deleteTable: "Delete table",
markdown: "Switch to Markdown source",
richText: "Switch to rich text",
- reading: "Reading",
viewMode: "Note view",
appearance: "Appearance and style",
blockStyle: "Paragraph style",
diff --git a/packages/shared/src/i18n/ja.ts b/packages/shared/src/i18n/ja.ts
index 406395af..4a8ad750 100644
--- a/packages/shared/src/i18n/ja.ts
+++ b/packages/shared/src/i18n/ja.ts
@@ -2133,7 +2133,6 @@ export const ja = {
deleteTable: "表を削除",
markdown: "Markdown ソースに切り替え",
richText: "リッチテキストに切り替え",
- reading: "閲覧",
viewMode: "ノートの表示",
appearance: "外観とスタイル",
blockStyle: "段落スタイル",
diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.ts
index a99025a2..37776ed6 100644
--- a/packages/shared/src/i18n/zh-CN.ts
+++ b/packages/shared/src/i18n/zh-CN.ts
@@ -2131,7 +2131,6 @@ export const zhCN = {
deleteTable: "删除表格",
markdown: "切换到 Markdown 源码",
richText: "切换到富文本编辑",
- reading: "阅读",
viewMode: "笔记视图",
appearance: "外观与样式",
blockStyle: "段落样式",