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): mark a shared note with a pale gray share button

tianma-if50bda545a26f
diff --git a/apps/web/src/components/EditorPane.tsx b/apps/web/src/components/EditorPane.tsx
index 2c6053cd..7b036576 100644
--- a/apps/web/src/components/EditorPane.tsx
+++ b/apps/web/src/components/EditorPane.tsx
@@ -3772,10 +3772,16 @@ const RichEditorPane = ({
{!readOnly && (!mobileEditingActive || isMemoShared) && (
<IconTooltip label={t(isLocalMemoId(memo.id) ? "sharing.afterSync" : isMemoShared ? "sharing.manage" : "sharing.action")}>
<Button
- className={cn("h-8 w-8", isMemoShared ? "text-slate-700" : "text-slate-500")}
+ className={cn(
+ "h-8 w-8",
+ isMemoShared
+ ? "bg-[#d4d4d4] text-[#2a2a2a] hover:bg-[#e4e4e4] hover:text-[#2a2a2a]"
+ : "text-slate-500",
+ )}
size="icon"
variant="ghost"
type="button"
+ aria-pressed={isMemoShared}
aria-label={t(isLocalMemoId(memo.id) ? "sharing.afterSync" : isMemoShared ? "sharing.manage" : "sharing.action")}
disabled={isLocalMemoId(memo.id)}
onClick={() => setShareOpen(true)}
diff --git a/tests/note-sharing-menu.test.ts b/tests/note-sharing-menu.test.ts
index cbc447d0..f315e978 100644
--- a/tests/note-sharing-menu.test.ts
+++ b/tests/note-sharing-menu.test.ts
@@ -18,7 +18,8 @@ describe("note sharing menu", () => {
expect(editorSource).toContain("canShareMemo: Boolean(memo && !readOnly)");
expect(editorSource).toContain("{!readOnly && (\n <DropdownMenuItem");
expect(editorSource).toContain('{!readOnly && (!mobileEditingActive || isMemoShared) && (');
- expect(editorSource).toContain('className={cn("h-8 w-8", isMemoShared ? "text-slate-700" : "text-slate-500")}');
+ expect(editorSource).toContain('isMemoShared\n ? "bg-[#d4d4d4] text-[#2a2a2a] hover:bg-[#e4e4e4] hover:text-[#2a2a2a]"');
+ expect(editorSource).toContain("aria-pressed={isMemoShared}");
expect(editorSource).toContain('aria-label={t(isLocalMemoId(memo.id) ? "sharing.afterSync" : isMemoShared ? "sharing.manage" : "sharing.action")}');
});