Skip to content

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

feat: show notebook note counts

tianma-if47581be00608
diff --git a/apps/web/src/components/NotebookTreeItem.tsx b/apps/web/src/components/NotebookTreeItem.tsx
index ed9d9a95..85ec306a 100644
--- a/apps/web/src/components/NotebookTreeItem.tsx
+++ b/apps/web/src/components/NotebookTreeItem.tsx
@@ -198,7 +198,9 @@ export const NotebookTreeItem = ({
data-notebook-tree-button
className="flex min-w-0 flex-1 items-center gap-2 text-left"
type="button"
- aria-label={selected ? t("notebookTree.current", { name: node.name }) : t("notebookTree.switchTo", { name: node.name })}
+ aria-label={selected
+ ? t("notebookTree.currentWithCount", { name: node.name, count: node.memoCount })
+ : t("notebookTree.switchToWithCount", { name: node.name, count: node.memoCount })}
aria-current={selected ? "page" : undefined}
aria-expanded={hasChildren ? open : undefined}
onClick={() => onSelect(node.id)}
@@ -244,6 +246,15 @@ export const NotebookTreeItem = ({
>
{node.name}
</span>
+ <span
+ className={cn(
+ "shrink-0 tabular-nums text-xs font-normal transition-colors duration-200",
+ "text-slate-400 group-hover:text-slate-500"
+ )}
+ aria-hidden="true"
+ >
+ {node.memoCount}
+ </span>
</button>
<button
className={cn(
diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.ts
index 8d63ae2a..7592bbe0 100644
--- a/packages/shared/src/i18n/en-US.ts
+++ b/packages/shared/src/i18n/en-US.ts
@@ -128,6 +128,8 @@ export const enUS = {
expand: "Expand {{name}}",
current: "Current: {{name}}",
switchTo: "Switch to {{name}}",
+ currentWithCount: "Current: {{name}}, {{count}} notes",
+ switchToWithCount: "Switch to {{name}}, {{count}} notes",
newChild: "New child notebook",
newChildAria: "Create child notebook under {{name}}",
rename: "Rename",
diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.ts
index aa7f12bf..bfa7a7b6 100644
--- a/packages/shared/src/i18n/zh-CN.ts
+++ b/packages/shared/src/i18n/zh-CN.ts
@@ -128,6 +128,8 @@ export const zhCN = {
expand: "展开 {{name}}",
current: "当前:{{name}}",
switchTo: "切换到 {{name}}",
+ currentWithCount: "当前:{{name}},{{count}} 条笔记",
+ switchToWithCount: "切换到 {{name}},{{count}} 条笔记",
newChild: "新建子笔记本",
newChildAria: "在 {{name}} 下新建子笔记本",
rename: "重命名",