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): use a light surface for tooltips

tianma-ifc4e1c1631ddb
diff --git a/apps/web/src/components/EditorTableMenu.tsx b/apps/web/src/components/EditorTableMenu.tsx
index 167de5e2..394646b0 100644
--- a/apps/web/src/components/EditorTableMenu.tsx
+++ b/apps/web/src/components/EditorTableMenu.tsx
@@ -58,7 +58,7 @@ export const EditorTableMenu = ({ editor, readOnly }: EditorTableMenuProps) => {
</button>
</DropdownMenuTrigger>
</TooltipTrigger>
- <TooltipContent>{t("editorToolbar.table")}</TooltipContent>
+ <TooltipContent side="bottom">{t("editorToolbar.table")}</TooltipContent>
</Tooltip>
<DropdownMenuContent align="start">
<DropdownMenuItem
diff --git a/apps/web/src/components/EditorToolbar.tsx b/apps/web/src/components/EditorToolbar.tsx
index 58423206..217639ed 100644
--- a/apps/web/src/components/EditorToolbar.tsx
+++ b/apps/web/src/components/EditorToolbar.tsx
@@ -91,7 +91,7 @@ const EditorToolbarButton = ({
{children}
</button>
</TooltipTrigger>
- <TooltipContent>{title}</TooltipContent>
+ <TooltipContent side="bottom">{title}</TooltipContent>
</Tooltip>
);
@@ -371,7 +371,7 @@ export const EditorToolbar = ({
<TooltipContent side="bottom" className="flex items-center gap-2">
<span>{markdownMode ? t("editorToolbar.richText") : t("editorToolbar.markdown")}</span>
{markdownModeShortcutLabel && (
- <kbd className="rounded border border-border/20 bg-card/10 px-1.5 py-0.5 font-mono text-xs leading-none">
+ <kbd className="rounded border border-current/25 bg-current/10 px-1.5 py-0.5 font-mono text-xs leading-none">
{markdownModeShortcutLabel}
</kbd>
)}
diff --git a/apps/web/src/components/editor/EditorPaneChrome.tsx b/apps/web/src/components/editor/EditorPaneChrome.tsx
index b7417bff..24750814 100644
--- a/apps/web/src/components/editor/EditorPaneChrome.tsx
+++ b/apps/web/src/components/editor/EditorPaneChrome.tsx
@@ -51,7 +51,7 @@ export const NoteLinkInteractionHint = ({
}) => createPortal(
<div
role="tooltip"
- className="pointer-events-none fixed z-[100] whitespace-nowrap rounded-md bg-[var(--tooltip-bg)] px-2.5 py-1.5 text-xs font-medium text-[var(--tooltip-fg)] shadow-md"
+ className="pointer-events-none fixed z-[100] whitespace-nowrap rounded-lg border border-[var(--tooltip-border)] bg-[var(--tooltip-bg)] px-2.5 py-1.5 text-xs font-medium leading-4 text-[var(--tooltip-fg)] shadow-[var(--tooltip-shadow)]"
style={{
left: position.left,
top: position.top,
diff --git a/apps/web/src/components/ui/tooltip.tsx b/apps/web/src/components/ui/tooltip.tsx
index 6487613b..d11cdcef 100644
--- a/apps/web/src/components/ui/tooltip.tsx
+++ b/apps/web/src/components/ui/tooltip.tsx
@@ -17,7 +17,7 @@ const TooltipContent = React.forwardRef<
ref={ref}
sideOffset={sideOffset}
className={cn(
- "z-50 overflow-hidden rounded-md bg-[var(--tooltip-bg)] px-2.5 py-1.5 text-xs text-[var(--tooltip-fg)] shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
+ "z-50 overflow-hidden rounded-lg border border-[var(--tooltip-border)] bg-[var(--tooltip-bg)] px-2.5 py-1.5 text-xs leading-4 text-[var(--tooltip-fg)] shadow-[var(--tooltip-shadow)] animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
className
)}
{...props}
diff --git a/apps/web/src/lib/dark-theme.test.mjs b/apps/web/src/lib/dark-theme.test.mjs
index 21387acb..471699ac 100644
--- a/apps/web/src/lib/dark-theme.test.mjs
+++ b/apps/web/src/lib/dark-theme.test.mjs
@@ -81,7 +81,7 @@ describe("dark theme contracts", () => {
const css = readFileSync(new URL("../styles/globals.css", import.meta.url), "utf8");
expect(css).toContain("html.dark[data-edgeever-environment=\"local\"] body::after");
- expect(css).toContain("--tooltip-bg: #252c28;");
+ expect(css).toContain("--tooltip-bg: #2c3330;");
expect(css).toContain("--scrollbar-thumb: rgb(137 150 142 / 0.38);");
expect(css).toContain("--search-match: rgb(22 160 110 / 0.32);");
expect(css).toContain(":root.dark .ProseMirror .edgeever-mermaid-preview");
diff --git a/apps/web/src/styles/globals.css b/apps/web/src/styles/globals.css
index dc611fe1..5607f464 100644
--- a/apps/web/src/styles/globals.css
+++ b/apps/web/src/styles/globals.css
@@ -299,8 +299,10 @@ html.dark[data-edgeever-environment="demo"] body::after {
--workspace-memo-divider: #e6eaee;
--workspace-selection: #dde3e9;
--workspace-hover: color-mix(in srgb, var(--workspace-sidebar) 40%, white);
- --tooltip-bg: #1a1f1c;
- --tooltip-fg: #f4f7f5;
+ --tooltip-bg: #ffffff;
+ --tooltip-fg: #6b726e;
+ --tooltip-border: #e1e5ea;
+ --tooltip-shadow: 0 1px 2px rgb(16 24 20 / 0.04), 0 8px 20px rgb(16 24 20 / 0.08);
--scrollbar-thumb: rgb(115 115 115 / 0.28);
--scrollbar-thumb-hover: rgb(115 115 115 / 0.42);
--search-match: rgb(254 240 138 / 0.8);
@@ -414,8 +416,10 @@ html.dark[data-edgeever-environment="demo"] body::after {
--workspace-memo-divider: #3b4540;
--workspace-selection: #1d3028;
--workspace-hover: color-mix(in srgb, var(--workspace-sidebar) 82%, white);
- --tooltip-bg: #252c28;
- --tooltip-fg: #e9efeb;
+ --tooltip-bg: #2c3330;
+ --tooltip-fg: #d7dfda;
+ --tooltip-border: #3e4944;
+ --tooltip-shadow: 0 1px 2px rgb(0 0 0 / 0.28), 0 8px 20px rgb(0 0 0 / 0.32);
--scrollbar-thumb: rgb(137 150 142 / 0.38);
--scrollbar-thumb-hover: rgb(137 150 142 / 0.55);
--search-match: rgb(22 160 110 / 0.32);