Skip to content

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

fix(editor): quiet the empty-paragraph placeholder

tianma-if8112d86bb04b
diff --git a/apps/web/src/styles/editor-typography.test.mjs b/apps/web/src/styles/editor-typography.test.mjs
index 144231d0..d725c618 100644
--- a/apps/web/src/styles/editor-typography.test.mjs
+++ b/apps/web/src/styles/editor-typography.test.mjs
@@ -53,7 +53,9 @@ describe("editor typography contract", () => {
);
expect(placeholderRules).toMatch(/font-size\s*:\s*inherit/);
+ expect(placeholderRules).toMatch(/font-weight\s*:\s*inherit/);
expect(placeholderRules).toMatch(/line-height\s*:\s*inherit/);
+ expect(placeholderRules).toMatch(/color\s*:\s*#a8b5c4/);
});
test("keeps bold and italic text visible across platform font fallbacks", () => {
diff --git a/apps/web/src/styles/globals.css b/apps/web/src/styles/globals.css
index fbf0a594..a55d1646 100644
--- a/apps/web/src/styles/globals.css
+++ b/apps/web/src/styles/globals.css
@@ -1824,15 +1824,20 @@ textarea {
}
.ProseMirror.edgeever-note-rich-editor p.is-empty::before {
- color: #94a3b8;
+ color: #a8b5c4;
content: attr(data-placeholder);
float: left;
font-size: inherit;
+ font-weight: inherit;
height: 0;
line-height: inherit;
pointer-events: none;
}
+:root.dark .ProseMirror.edgeever-note-rich-editor p.is-empty::before {
+ color: #64748b;
+}
+
/* Custom premium scrollbar style */
::-webkit-scrollbar {
width: 6px;
diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.ts
index b0878ee3..bc21897b 100644
--- a/packages/shared/src/i18n/en-US.ts
+++ b/packages/shared/src/i18n/en-US.ts
@@ -1649,8 +1649,8 @@ export const enUS = {
deleteDescription: "The attachment will be permanently removed from storage and this note. This cannot be undone.",
failed: "The attachment action failed. Try again.",
},
- placeholder: "Space for AI · / for commands · @ to link notes",
- placeholderCommands: "/ for commands · @ to link notes",
+ placeholder: "space for AI · / commands · @ notes",
+ placeholderCommands: "/ commands · @ notes",
noteBodyAria: "Note body",
markdownSourceAria: "Markdown source",
loading: "Loading",
diff --git a/packages/shared/src/i18n/ja.ts b/packages/shared/src/i18n/ja.ts
index 03bdbf43..0e59f084 100644
--- a/packages/shared/src/i18n/ja.ts
+++ b/packages/shared/src/i18n/ja.ts
@@ -1649,8 +1649,8 @@ export const ja = {
deleteDescription: "添付はストレージとこのノートから完全に削除されます。この操作は取り消せません。",
failed: "添付の操作に失敗しました。再試行してください。",
},
- placeholder: "Space で AI · / でコマンド · @ でノートをリンク",
- placeholderCommands: "/ でコマンド · @ でノートをリンク",
+ placeholder: "スペースで AI · / コマンド · @ ノート",
+ placeholderCommands: "/ コマンド · @ ノート",
noteBodyAria: "ノート本文",
markdownSourceAria: "Markdown ソース",
loading: "読み込み中",
diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.ts
index b7515353..51a8291d 100644
--- a/packages/shared/src/i18n/zh-CN.ts
+++ b/packages/shared/src/i18n/zh-CN.ts
@@ -1649,8 +1649,8 @@ export const zhCN = {
deleteDescription: "附件会从存储空间和当前笔记中永久删除,此操作无法撤销。",
failed: "附件操作失败,请重试。",
},
- placeholder: "Space 唤起 AI · / 浏览命令 · @ 引用笔记",
- placeholderCommands: "/ 浏览命令 · @ 引用笔记",
+ placeholder: "空格唤起 AI · / 命令 · @ 引用",
+ placeholderCommands: "/ 命令 · @ 引用",
noteBodyAria: "笔记正文",
markdownSourceAria: "Markdown 源码",
loading: "加载中",
diff --git a/tests/e2e/ai-custom-prompts.spec.ts b/tests/e2e/ai-custom-prompts.spec.ts
index 33e855a2..953850bd 100644
--- a/tests/e2e/ai-custom-prompts.spec.ts
+++ b/tests/e2e/ai-custom-prompts.spec.ts
@@ -439,7 +439,7 @@ test.describe("AI custom prompts", () => {
await page.keyboard.press("Enter");
const emptyParagraph = editor.locator("p").last();
await expect(emptyParagraph).toHaveClass(/is-empty/);
- await expect(emptyParagraph).toHaveAttribute("data-placeholder", "Space 唤起 AI · / 浏览命令 · @ 引用笔记");
+ await expect(emptyParagraph).toHaveAttribute("data-placeholder", "空格唤起 AI · / 命令 · @ 引用");
const renderedPlaceholder = await emptyParagraph.evaluate((element) => {
const style = getComputedStyle(element, "::before");
return {
@@ -448,7 +448,7 @@ test.describe("AI custom prompts", () => {
visibility: style.visibility,
};
});
- expect(renderedPlaceholder.content).toContain("Space 唤起 AI · / 浏览命令 · @ 引用笔记");
+ expect(renderedPlaceholder.content).toContain("空格唤起 AI · / 命令 · @ 引用");
expect(renderedPlaceholder.display).not.toBe("none");
expect(renderedPlaceholder.visibility).not.toBe("hidden");
@@ -486,7 +486,7 @@ test.describe("AI custom prompts", () => {
await focusParagraphEnd(editor);
await page.keyboard.press("Enter");
const emptyParagraph = editor.locator("p").last();
- await expect(emptyParagraph).toHaveAttribute("data-placeholder", "/ 浏览命令 · @ 引用笔记");
+ await expect(emptyParagraph).toHaveAttribute("data-placeholder", "/ 命令 · @ 引用");
await page.keyboard.press("Space");
await expect(page.getByRole("dialog", { name: "AI 笔记助手" })).toBeHidden();