Skip to content

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

refactor(web): clarify note type picker

tianma-ifcf4a998f9c0c
diff --git a/apps/web/src/components/NotebookPane.test.mjs b/apps/web/src/components/NotebookPane.test.mjs
index 8a7c83ac..b25efe22 100644
--- a/apps/web/src/components/NotebookPane.test.mjs
+++ b/apps/web/src/components/NotebookPane.test.mjs
@@ -10,6 +10,18 @@ test("keeps proactive AI out of primary navigation", () => {
expect(primaryNav).not.toContain("onClick={onOpenCompanion}");
});
+test("keeps the desktop create-note control compact with one neutral outline", () => {
+ expect(source).toContain('rounded-2xl border border-slate-200/90');
+ expect(source).toContain('className="group flex h-12');
+ expect(source).toContain('className="group relative flex h-12 w-[6.25rem]');
+ expect(source).toContain('before:inset-y-2.5');
+ expect(source).toContain('data-[state=open]:bg-emerald-50');
+ expect(source).toContain('t("diagram.moreTypes")');
+ expect(source).toContain('group-data-[state=open]:rotate-180');
+ expect(source).not.toContain('focus-visible:ring-inset focus-visible:ring-emerald-500');
+ expect(source).not.toContain('title={t("notebookPane.newMemo")}');
+});
+
describe("NotebookPane client downloads", () => {
test("keeps macOS and Windows downloads visible in the desktop runtime", () => {
expect(source).toContain('t("pwa.sidebarMac") || "macOS"');
diff --git a/apps/web/src/components/NotebookPane.tsx b/apps/web/src/components/NotebookPane.tsx
index cc51557b..28b6036f 100644
--- a/apps/web/src/components/NotebookPane.tsx
+++ b/apps/web/src/components/NotebookPane.tsx
@@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next";
import * as m from "motion/react-m";
import {
ChevronLeft,
+ ChevronDown,
Plus,
LayoutList,
LayoutTemplate,
@@ -555,31 +556,29 @@ export const NotebookPane = ({
)}
<div className="hidden shrink-0 px-3 pb-4 pt-4 lg:block">
- <div className="flex overflow-hidden rounded-full border border-slate-200/90 bg-white shadow-[0_8px_22px_rgba(15,23,42,0.06)] transition-all duration-200 hover:border-emerald-200/80 hover:shadow-[0_8px_24px_rgba(22,160,110,0.12)]">
+ <div className="flex overflow-hidden rounded-2xl border border-slate-200/90 bg-white shadow-[0_5px_16px_rgba(15,23,42,0.06)] transition-shadow duration-200 hover:shadow-[0_7px_20px_rgba(15,23,42,0.09)]">
<button
- className="group flex h-14 min-w-0 flex-1 items-center gap-3 px-3 text-left transition-all duration-200 hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-50"
+ className="group flex h-12 min-w-0 flex-1 items-center gap-3 px-3 text-left transition-colors duration-150 hover:bg-slate-50 focus-visible:bg-slate-50 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50"
type="button"
- title={t("notebookPane.newMemo")}
aria-label={t("notebookPane.newMemo")}
onClick={() => onCreateMemo()}
disabled={!canCreateMemo || isCreatingMemo}
>
- <span className="flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-emerald-600 text-white shadow-[0_8px_18px_rgb(var(--brand-green-rgb)/0.28)] transition-transform duration-200 group-hover:scale-105">
- <Plus className="h-6 w-6" />
+ <span className="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-emerald-600 text-white shadow-[0_5px_12px_rgb(var(--brand-green-rgb)/0.22)] transition-transform duration-150 group-hover:scale-[1.03] group-focus-visible:ring-2 group-focus-visible:ring-emerald-500/70 group-focus-visible:ring-offset-2">
+ <Plus className="h-5 w-5" />
</span>
<span className="min-w-0 truncate text-sm font-semibold text-slate-950">{t("notebookPane.newMemo")}</span>
</button>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<button
- className="flex h-14 w-14 shrink-0 items-center justify-center border-l border-slate-200 text-slate-600 transition-colors hover:bg-emerald-50 hover:text-emerald-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-emerald-500 disabled:cursor-not-allowed disabled:opacity-50"
+ className="group relative flex h-12 w-[6.25rem] shrink-0 items-center justify-center gap-1 px-2 text-xs font-medium text-slate-600 transition-colors before:absolute before:inset-y-2.5 before:left-0 before:w-px before:bg-slate-200 hover:bg-emerald-50/70 hover:text-emerald-700 focus-visible:bg-emerald-50/70 focus-visible:text-emerald-700 focus-visible:outline-none data-[state=open]:bg-emerald-50 data-[state=open]:text-emerald-700 disabled:cursor-not-allowed disabled:opacity-50"
type="button"
aria-label={t("diagram.createType")}
disabled={!canCreateMemo || isCreatingMemo}
>
- <span className="grid grid-cols-2 gap-0.5" aria-hidden="true">
- {[0, 1, 2, 3].map((item) => <span key={item} className="h-1.5 w-1.5 rounded-[2px] border border-current" />)}
- </span>
+ <span className="truncate">{t("diagram.moreTypes")}</span>
+ <ChevronDown className="h-3.5 w-3.5 shrink-0 transition-transform duration-150 group-data-[state=open]:rotate-180" aria-hidden="true" />
</button>
</DropdownMenuTrigger>
<DropdownMenuContent align="start" sideOffset={8} className="w-52">
diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.ts
index b5b1cf2f..afa68868 100644
--- a/packages/shared/src/i18n/en-US.ts
+++ b/packages/shared/src/i18n/en-US.ts
@@ -244,6 +244,7 @@ export const enUS = {
mindMap: "Mind map",
flowchart: "Flowchart",
createType: "Choose note type",
+ moreTypes: "More types",
back: "Back to note list",
title: "Diagram title",
canvas: "{{type}} canvas",
diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.ts
index 39fa5f13..a73367a1 100644
--- a/packages/shared/src/i18n/zh-CN.ts
+++ b/packages/shared/src/i18n/zh-CN.ts
@@ -244,6 +244,7 @@ export const zhCN = {
mindMap: "思维导图",
flowchart: "流程图",
createType: "选择笔记类型",
+ moreTypes: "更多类型",
back: "返回笔记列表",
title: "图表标题",
canvas: "{{type}}画布",