Skip to content

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

refactor(settings): refine interface and reading preference copy and layout

tianma-iffc2eab3c3507
diff --git a/apps/ios/EdgeEver/Features/Workspace/NotesListView.swift b/apps/ios/EdgeEver/Features/Workspace/NotesListView.swift
index 7a451d8a..4c6b4105 100644
--- a/apps/ios/EdgeEver/Features/Workspace/NotesListView.swift
+++ b/apps/ios/EdgeEver/Features/Workspace/NotesListView.swift
@@ -422,7 +422,7 @@ struct NotesListView: View {
let hiddenCount = hiddenDescendantMemoCount
if hiddenCount > 0 {
return env.preferences.t(
- "子笔记本中还有 \(hiddenCount) 条笔记。可以打开子笔记本查看,或在设置中开启“显示子笔记本中的笔记”。",
+ "子笔记本中还有 \(hiddenCount) 条笔记。可以打开子笔记本查看,或在设置中开启“父笔记本中显示子笔记本笔记”。",
en: "Its sub-notebooks still contain \(hiddenCount) notes. Open a sub-notebook to see them, or turn on \"Show notes from sub-notebooks\" in Settings.",
ja: "サブノートブックにはまだ \(hiddenCount) 件のノートがあります。サブノートブックを開くか、設定で「サブノートブックのノートを表示」をオンにしてください。"
)
diff --git a/apps/ios/EdgeEver/Features/Workspace/SettingsView.swift b/apps/ios/EdgeEver/Features/Workspace/SettingsView.swift
index 477d5802..a0db7c04 100644
--- a/apps/ios/EdgeEver/Features/Workspace/SettingsView.swift
+++ b/apps/ios/EdgeEver/Features/Workspace/SettingsView.swift
@@ -340,12 +340,7 @@ struct SettingsView: View {
}
preferenceBlock(
- title: env.preferences.t("显示子笔记本中的笔记", en: "Show notes from sub-notebooks", ja: "サブノートブックのノートを表示"),
- description: env.preferences.t(
- "开启后,打开父笔记本会同时列出所有子笔记本中的笔记;关闭后只列出直接放在该笔记本中的笔记。",
- en: "When on, opening a parent notebook also lists notes from all of its sub-notebooks. When off, only notes stored directly in that notebook are listed.",
- ja: "オンにすると、親ノートブックを開いたときにすべてのサブノートブックのノートも一覧表示します。オフにすると、そのノートブックに直接保存されたノートのみを表示します。"
- ),
+ title: env.preferences.t("父笔记本中显示子笔记本笔记", en: "Show notes from sub-notebooks", ja: "サブノートブックのノートを表示"),
showTopBorder: true
) {
Toggle("", isOn: Bindable(env.preferences).showDescendantNotes)
@@ -893,7 +888,7 @@ struct SettingsView: View {
private func preferenceBlock<Content: View>(
title: String,
- description: String,
+ description: String? = nil,
showTopBorder: Bool = false,
@ViewBuilder content: () -> Content
) -> some View {
@@ -902,10 +897,12 @@ struct SettingsView: View {
Text(title)
.font(.system(size: 14, weight: .bold))
.foregroundStyle(AppTheme.title)
- Text(description)
- .font(.system(size: 12))
- .foregroundStyle(AppTheme.secondary)
- .fixedSize(horizontal: false, vertical: true)
+ if let description {
+ Text(description)
+ .font(.system(size: 12))
+ .foregroundStyle(AppTheme.secondary)
+ .fixedSize(horizontal: false, vertical: true)
+ }
}
content()
}
diff --git a/apps/mobile/src/lib/mobile-locale.test.mjs b/apps/mobile/src/lib/mobile-locale.test.mjs
index f8deea9e..79d532b1 100644
--- a/apps/mobile/src/lib/mobile-locale.test.mjs
+++ b/apps/mobile/src/lib/mobile-locale.test.mjs
@@ -19,19 +19,19 @@ describe("mobile locale translation", () => {
});
test("uses shared translations for the descendant preference", () => {
- expect(translateMobileText("显示子笔记本中的笔记", "en-US")).toBe("Show notes from sub-notebooks");
- expect(translateMobileText("显示子笔记本中的笔记", "ja")).toBe("サブノートブックのノートを表示");
+ expect(translateMobileText("父笔记本中显示子笔记本笔记", "en-US")).toBe("Show notes from sub-notebooks");
+ expect(translateMobileText("父笔记本中显示子笔记本笔记", "ja")).toBe("サブノートブックのノートを表示");
expect(translateMobileText("是否在父笔记本中显示子笔记本中的笔记", "en-US")).toBe("Show notes from sub-notebooks in parent notebooks");
});
test("translates the hidden sub-notebook notes hint", () => {
- const hint = "子笔记本中还有 5 条笔记。可以打开子笔记本查看,或在设置中开启“显示子笔记本中的笔记”。";
+ const hint = "子笔记本中还有 5 条笔记。可以打开子笔记本查看,或在设置中开启“父笔记本中显示子笔记本笔记”。";
expect(translateMobileText(hint, "en-US"))
.toBe("Its sub-notebooks still contain 5 notes. Open a sub-notebook to see them, or turn on \"Show notes from sub-notebooks\" in Settings.");
expect(translateMobileText(hint, "ja"))
.toBe("サブノートブックにはまだ 5 件のノートがあります。サブノートブックを開くか、設定で「サブノートブックのノートを表示」をオンにしてください。");
expect(translateMobileText("本级暂无笔记", "en-US")).toBe("No notes directly in this notebook");
- expect(translateMobileText("无法保存“显示子笔记本中的笔记”设置,请稍后重试", "en-US"))
+ expect(translateMobileText("无法保存“父笔记本中显示子笔记本笔记”设置,请稍后重试", "en-US"))
.toBe("Could not save the \"Show notes from sub-notebooks\" setting. Please try again.");
});
diff --git a/apps/mobile/src/lib/mobile-locale.tsx b/apps/mobile/src/lib/mobile-locale.tsx
index 0632f78a..47f4ef76 100644
--- a/apps/mobile/src/lib/mobile-locale.tsx
+++ b/apps/mobile/src/lib/mobile-locale.tsx
@@ -20,8 +20,8 @@ type TranslationPair = { source: string; target: string; pattern?: RegExp; place
const mobileOnlyTranslations = new Map<string, string>([
["本级暂无笔记", "No notes directly in this notebook"],
- ["无法保存“显示子笔记本中的笔记”设置,请稍后重试", "Could not save the \"Show notes from sub-notebooks\" setting. Please try again."],
- ["子笔记本中还有 {{count}} 条笔记。可以打开子笔记本查看,或在设置中开启“显示子笔记本中的笔记”。", "Its sub-notebooks still contain {{count}} notes. Open a sub-notebook to see them, or turn on \"Show notes from sub-notebooks\" in Settings."],
+ ["无法保存“父笔记本中显示子笔记本笔记”设置,请稍后重试", "Could not save the \"Show notes from sub-notebooks\" setting. Please try again."],
+ ["子笔记本中还有 {{count}} 条笔记。可以打开子笔记本查看,或在设置中开启“父笔记本中显示子笔记本笔记”。", "Its sub-notebooks still contain {{count}} notes. Open a sub-notebook to see them, or turn on \"Show notes from sub-notebooks\" in Settings."],
["返回", "Back"],
["关闭对话框", "Close dialog"],
["切换到深色模式", "Switch to dark mode"],
@@ -209,8 +209,8 @@ const mobileOnlyTranslations = new Map<string, string>([
const mobileOnlyJapanese = new Map<string, string>([
["本级暂无笔记", "このノートブック直下にノートはありません"],
- ["无法保存“显示子笔记本中的笔记”设置,请稍后重试", "「サブノートブックのノートを表示」の設定を保存できませんでした。しばらくしてから再試行してください。"],
- ["子笔记本中还有 {{count}} 条笔记。可以打开子笔记本查看,或在设置中开启“显示子笔记本中的笔记”。", "サブノートブックにはまだ {{count}} 件のノートがあります。サブノートブックを開くか、設定で「サブノートブックのノートを表示」をオンにしてください。"],
+ ["无法保存“父笔记本中显示子笔记本笔记”设置,请稍后重试", "「サブノートブックのノートを表示」の設定を保存できませんでした。しばらくしてから再試行してください。"],
+ ["子笔记本中还有 {{count}} 条笔记。可以打开子笔记本查看,或在设置中开启“父笔记本中显示子笔记本笔记”。", "サブノートブックにはまだ {{count}} 件のノートがあります。サブノートブックを開くか、設定で「サブノートブックのノートを表示」をオンにしてください。"],
["返回", "戻る"],
["关闭对话框", "ダイアログを閉じる"],
["切换到深色模式", "ダークモードに切り替え"],
diff --git a/apps/mobile/src/screens/WorkspaceNotesView.tsx b/apps/mobile/src/screens/WorkspaceNotesView.tsx
index 866781d4..e97684d9 100644
--- a/apps/mobile/src/screens/WorkspaceNotesView.tsx
+++ b/apps/mobile/src/screens/WorkspaceNotesView.tsx
@@ -205,7 +205,7 @@ export const NotesView = ({
: []),
]
: undefined}
- emptyDescription={hiddenDescendantMemoCount > 0 ? `子笔记本中还有 ${hiddenDescendantMemoCount} 条笔记。可以打开子笔记本查看,或在设置中开启“显示子笔记本中的笔记”。` : searchActive ? "换个关键词再试" : filterActive ? "试试切换筛选条件,或调整搜索关键词。" : memoView === "trash" ? "删除的笔记会显示在这里。" : "先创建一条笔记,之后可以在这里快速预览、搜索和批量整理。"}
+ emptyDescription={hiddenDescendantMemoCount > 0 ? `子笔记本中还有 ${hiddenDescendantMemoCount} 条笔记。可以打开子笔记本查看,或在设置中开启“父笔记本中显示子笔记本笔记”。` : searchActive ? "换个关键词再试" : filterActive ? "试试切换筛选条件,或调整搜索关键词。" : memoView === "trash" ? "删除的笔记会显示在这里。" : "先创建一条笔记,之后可以在这里快速预览、搜索和批量整理。"}
emptyTitle={hiddenDescendantMemoCount > 0 ? "本级暂无笔记" : searchActive ? "没有找到匹配笔记" : filterActive ? "没有符合筛选的笔记" : memoView === "trash" ? "回收站为空" : "暂无笔记"}
error={error}
initialSyncProgress={initialSyncProgress}
diff --git a/apps/mobile/src/screens/WorkspaceSettingsView.tsx b/apps/mobile/src/screens/WorkspaceSettingsView.tsx
index 9d983212..8bb1ff11 100644
--- a/apps/mobile/src/screens/WorkspaceSettingsView.tsx
+++ b/apps/mobile/src/screens/WorkspaceSettingsView.tsx
@@ -229,9 +229,8 @@ export const SettingsView = ({
<View style={styles.settingsContentRow}>
<View style={styles.preferenceStack}>
<View style={styles.preferenceText}>
- <Text style={styles.settingsRowTitle}>显示子笔记本中的笔记</Text>
- <Text style={styles.settingsRowDescription}>开启后,打开父笔记本会同时列出所有子笔记本中的笔记;关闭后只列出直接放在该笔记本中的笔记。</Text>
- {showDescendantNotesSaveFailed ? <Text accessibilityRole="alert" style={styles.errorText}>无法保存“显示子笔记本中的笔记”设置,请稍后重试</Text> : null}
+ <Text style={styles.settingsRowTitle}>父笔记本中显示子笔记本笔记</Text>
+ {showDescendantNotesSaveFailed ? <Text accessibilityRole="alert" style={styles.errorText}>无法保存“父笔记本中显示子笔记本笔记”设置,请稍后重试</Text> : null}
</View>
<View style={styles.settingsSwitchStart}>
<Switch accessibilityLabel={translate("是否在父笔记本中显示子笔记本中的笔记")} onValueChange={onShowDescendantNotesChange} value={showDescendantNotes} />
diff --git a/apps/web/src/components/settings/PreferenceCard.test.mjs b/apps/web/src/components/settings/PreferenceCard.test.mjs
index 06b72b72..6396294d 100644
--- a/apps/web/src/components/settings/PreferenceCard.test.mjs
+++ b/apps/web/src/components/settings/PreferenceCard.test.mjs
@@ -42,7 +42,7 @@ describe("editor content width preference", () => {
const editorPane = readFileSync(new URL("../EditorPane.tsx", import.meta.url), "utf8");
expect(preferenceCard).toContain('t("settings.editorContentWidthTitle")');
- expect(preferenceCard).toContain('t("settings.editorContentWidthDescription")');
+ expect(preferenceCard).not.toContain('t("settings.editorContentWidthDescription")');
expect(preferenceCard).toContain("onEditorContentWidthChange(value as EditorContentWidth)");
expect(preferenceCard).toContain('hidden min-h-16 flex-col');
expect(preferenceCard).toContain("lg:flex");
@@ -73,7 +73,7 @@ describe("reading typography settings", () => {
expect(preferenceCard).not.toContain('t("settings.editorBodyFontSizeDescription")');
expect(preferenceCard).toContain('t("settings.editorBodyLineHeightTitle")');
expect(preferenceCard).not.toContain('t("settings.editorBodyLineHeightDescription")');
- expect(preferenceCard).toContain('t("settings.editorContentWidthDescription")');
+ expect(preferenceCard).not.toContain('t("settings.editorContentWidthDescription")');
expect(preferenceCard).toContain('t("settings.editorBodyPaletteTitle")');
expect(preferenceCard).toContain("NoteProsePaletteSwatch");
expect(preferenceCard).toContain("NOTE_PROSE_PALETTES[paletteId].accent");
diff --git a/apps/web/src/components/settings/PreferenceCard.tsx b/apps/web/src/components/settings/PreferenceCard.tsx
index 7268814f..353cc6d0 100644
--- a/apps/web/src/components/settings/PreferenceCard.tsx
+++ b/apps/web/src/components/settings/PreferenceCard.tsx
@@ -368,11 +368,24 @@ export const PreferenceCard = ({
</div>
<div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">
- <div className="flex min-w-0 items-start gap-3">
+ <div className="flex min-w-0 items-center gap-3">
+ <AppWindow className="h-4 w-4 shrink-0 text-slate-500" />
+ <div className="min-w-0">
+ <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.uiFontTitle")}</div>
+ </div>
+ </div>
+ <FontChoiceFields
+ label={t("settings.uiFontTitle")}
+ preference={uiFont}
+ onChange={updateUiFont}
+ />
+ </div>
+
+ <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">
+ <div className="flex min-w-0 items-center gap-3">
<ListTree className={SETTINGS_ITEM_ICON_CLASSNAME} />
<div className="min-w-0">
<div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.showDescendantNotesTitle")}</div>
- <div className={SETTINGS_ITEM_DESCRIPTION_CLASSNAME}>{t("settings.showDescendantNotesDescription")}</div>
</div>
</div>
<div className="flex w-full shrink-0 justify-start sm:w-44 sm:justify-end">
@@ -383,20 +396,6 @@ export const PreferenceCard = ({
/>
</div>
</div>
-
- <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">
- <div className="flex min-w-0 items-center gap-3">
- <AppWindow className="h-4 w-4 shrink-0 text-slate-500" />
- <div className="min-w-0">
- <div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.uiFontTitle")}</div>
- </div>
- </div>
- <FontChoiceFields
- label={t("settings.uiFontTitle")}
- preference={uiFont}
- onChange={updateUiFont}
- />
- </div>
</PreferenceSection>
<PreferenceSection title={t("settings.groups.reading")}>
@@ -405,7 +404,6 @@ export const PreferenceCard = ({
<AlignHorizontalJustifyCenter className="h-4 w-4 shrink-0 text-slate-500" />
<div className="min-w-0">
<div className={SETTINGS_ITEM_TITLE_CLASSNAME}>{t("settings.editorContentWidthTitle")}</div>
- <p className="text-xs leading-5 text-slate-500">{t("settings.editorContentWidthDescription")}</p>
</div>
</div>
<div className="w-full shrink-0 sm:w-80">
diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.ts
index d74b0cb4..1a9ce68a 100644
--- a/packages/shared/src/i18n/en-US.ts
+++ b/packages/shared/src/i18n/en-US.ts
@@ -759,7 +759,6 @@ export const enUS = {
imageCompressionTitle: "Compress note images",
imageCompressionAria: "Compress note images",
showDescendantNotesTitle: "Show notes from sub-notebooks",
- showDescendantNotesDescription: "When on, opening a parent notebook also lists notes from all of its sub-notebooks. When off, only notes stored directly in that notebook are listed.",
showDescendantNotesAria: "Show notes from sub-notebooks in parent notebooks",
aiSelectionMenuTitle: "Show AI assistant when text is selected",
aiSelectionMenuAria: "Show the AI assistant action when text is selected",
diff --git a/packages/shared/src/i18n/ja.ts b/packages/shared/src/i18n/ja.ts
index c0f1368b..d5a65835 100644
--- a/packages/shared/src/i18n/ja.ts
+++ b/packages/shared/src/i18n/ja.ts
@@ -759,7 +759,6 @@ export const ja = {
imageCompressionTitle: "ノート内の画像を圧縮",
imageCompressionAria: "ノート内の画像を圧縮する",
showDescendantNotesTitle: "サブノートブックのノートを表示",
- showDescendantNotesDescription: "オンにすると、親ノートブックを開いたときにすべてのサブノートブックのノートも一覧表示します。オフにすると、そのノートブックに直接保存されたノートのみを表示します。",
showDescendantNotesAria: "親ノートブックにサブノートブックのノートを表示する",
aiSelectionMenuTitle: "文字選択時に AI アシスタントを表示",
aiSelectionMenuAria: "文字選択時に AI アシスタント操作を表示する",
diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.ts
index 2e954be4..fd11d3fc 100644
--- a/packages/shared/src/i18n/zh-CN.ts
+++ b/packages/shared/src/i18n/zh-CN.ts
@@ -758,8 +758,7 @@ export const zhCN = {
systemLanguage: "跟随系统",
imageCompressionTitle: "压缩笔记内图片",
imageCompressionAria: "是否压缩笔记内图片",
- showDescendantNotesTitle: "显示子笔记本中的笔记",
- showDescendantNotesDescription: "开启后,打开父笔记本会同时列出所有子笔记本中的笔记;关闭后只列出直接放在该笔记本中的笔记。",
+ showDescendantNotesTitle: "父笔记本中显示子笔记本笔记",
showDescendantNotesAria: "是否在父笔记本中显示子笔记本中的笔记",
aiSelectionMenuTitle: "选中文字时显示 AI 助手",
aiSelectionMenuAria: "选中文字时是否显示 AI 助手入口",