Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix(memo): make pinned memos easier to identify (#6369)

Johnnyc2b839957457
diff --git a/web/src/components/MemoView/MemoView.tsx b/web/src/components/MemoView/MemoView.tsx
index 1443c7e28..0707461e6 100644
--- a/web/src/components/MemoView/MemoView.tsx
+++ b/web/src/components/MemoView/MemoView.tsx
@@ -24,6 +24,7 @@ import { State } from "@/types/proto/api/v1/common_pb";
import { lazyWithReload } from "@/utils/lazy";
import { canManageMemo } from "@/utils/user";
import { MemoBody, MemoCommentListView, MemoHeader } from "./components";
+import MemoPinnedMark from "./components/MemoPinnedMark";
import { MEMO_CARD_BASE_CLASSES } from "./constants";
import { useImagePreview } from "./hooks";
import { computeCommentAmount, MemoViewContext } from "./MemoViewContext";
@@ -184,17 +185,12 @@ const MemoView = forwardRef<MemoViewHandle, MemoViewProps>((props, ref) => {
const article = (
<article
- className={cn(MEMO_CARD_BASE_CLASSES, showCommentPreview ? "mb-0 rounded-b-none" : "mb-2", className)}
+ className={cn(MEMO_CARD_BASE_CLASSES, "group/memo", showCommentPreview ? "mb-0 rounded-b-none" : "mb-2", className)}
ref={cardRef}
tabIndex={readonly ? -1 : 0}
>
- <MemoHeader
- timeDisplay={timeDisplay}
- showCreator={showCreator}
- showVisibility={showVisibility}
- showPinned={showPinned}
- showSpace={showSpace}
- />
+ {showPinned && memoData.pinned && <MemoPinnedMark />}
+ <MemoHeader timeDisplay={timeDisplay} showCreator={showCreator} showVisibility={showVisibility} showSpace={showSpace} />
<MemoBody compact={compact} />
diff --git a/web/src/components/MemoView/components/MemoHeader.tsx b/web/src/components/MemoView/components/MemoHeader.tsx
index 073dc498e..d86e5ad75 100644
--- a/web/src/components/MemoView/components/MemoHeader.tsx
+++ b/web/src/components/MemoView/components/MemoHeader.tsx
@@ -1,10 +1,9 @@
-import { BookmarkIcon } from "lucide-react";
import { useCallback } from "react";
import { Link } from "react-router-dom";
import RelativeTime from "@/components/RelativeTime";
import { Button, buttonVariants } from "@/components/ui/button";
import { FOCUS_VISIBLE_OUTLINE_CLASSES } from "@/components/ui/focus";
-import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
+import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { useNewMemo } from "@/contexts/NewMemoContext";
import useNavigateTo from "@/hooks/useNavigateTo";
import i18n from "@/i18n";
@@ -18,7 +17,6 @@ import { ReactionSelector } from "../../MemoReactionListView";
import UserAvatar from "../../UserAvatar";
import VisibilityIcon from "../../VisibilityIcon";
import { MEMO_TIME_CONTROL_CLASSES } from "../constants";
-import { useMemoActions } from "../hooks";
import { useMemoViewContext, useMemoViewDerived } from "../MemoViewContext";
import { createMemoNavigationState } from "../navigation";
import type { MemoHeaderProps } from "../types";
@@ -27,7 +25,7 @@ import MemoSpaceBadge from "./MemoSpaceBadge";
/** The card's trailing actions are the kit's quiet 24px squares, whether or not they are kit buttons. */
const MEMO_HEADER_ACTION_CLASSES = cn(buttonVariants({ variant: "quiet", size: "icon-sm" }));
-const MemoHeader: React.FC<MemoHeaderProps> = ({ timeDisplay = "relative", showCreator, showVisibility, showPinned, showSpace }) => {
+const MemoHeader: React.FC<MemoHeaderProps> = ({ timeDisplay = "relative", showCreator, showVisibility, showSpace }) => {
const t = useTranslate();
const { memo, creator, currentUser, parentPage, isArchived, readonly, openEditor } = useMemoViewContext();
@@ -40,8 +38,6 @@ const MemoHeader: React.FC<MemoHeaderProps> = ({ timeDisplay = "relative", showC
navigateTo(`/${memo.name}`, { state: createMemoNavigationState(parentPage) });
}, [memo.name, parentPage, navigateTo]);
- const { unpinMemo } = useMemoActions(memo);
-
const timeValue = isArchived ? (
memoDisplayTime?.toLocaleString(i18n.language)
) : timeDisplay === "time" ? (
@@ -100,24 +96,6 @@ const MemoHeader: React.FC<MemoHeaderProps> = ({ timeDisplay = "relative", showC
</Tooltip>
)}
- {showPinned && memo.pinned && (
- <TooltipProvider>
- <Tooltip>
- {/* The pinned mark keeps its primary ink; that custom look lives on the raw trigger, not a kit button. */}
- <TooltipTrigger
- aria-label={t("common.unpin")}
- className={cn(MEMO_HEADER_ACTION_CLASSES, "text-primary hover:text-primary")}
- onClick={unpinMemo}
- >
- <BookmarkIcon className="size-4" strokeWidth={1.8} />
- </TooltipTrigger>
- <TooltipContent>
- <p>{t("common.unpin")}</p>
- </TooltipContent>
- </Tooltip>
- </TooltipProvider>
- )}
-
<MemoActionMenu memo={memo} parentPage={parentPage} readonly={readonly} onEdit={openEditor} />
</div>
</div>
diff --git a/web/src/components/MemoView/components/MemoPinnedMark.tsx b/web/src/components/MemoView/components/MemoPinnedMark.tsx
new file mode 100644
index 000000000..fad11e161
--- /dev/null
+++ b/web/src/components/MemoView/components/MemoPinnedMark.tsx
@@ -0,0 +1,21 @@
+import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
+import { useTranslate } from "@/utils/i18n";
+
+const MemoPinnedMark = () => {
+ const t = useTranslate();
+
+ return (
+ <Tooltip>
+ <TooltipTrigger
+ delay={400}
+ render={<span role="img" aria-label={t("memo.pinned")} />}
+ className="absolute -right-px -top-px size-5 cursor-default rounded-tr-lg bg-warning [clip-path:polygon(0_0,100%_0,100%_100%)] transition-[width,height] duration-160 ease-out pointer-fine:group-hover/memo:size-6 motion-reduce:transition-none"
+ />
+ <TooltipContent side="left" sideOffset={6}>
+ {t("memo.pinned")}
+ </TooltipContent>
+ </Tooltip>
+ );
+};
+
+export default MemoPinnedMark;
diff --git a/web/src/components/MemoView/hooks/index.ts b/web/src/components/MemoView/hooks/index.ts
index f830d86ff..05ab9323e 100644
--- a/web/src/components/MemoView/hooks/index.ts
+++ b/web/src/components/MemoView/hooks/index.ts
@@ -1,3 +1,2 @@
export { useImagePreview } from "./useImagePreview";
-export { useMemoActions } from "./useMemoActions";
export { useMemoHandlers } from "./useMemoHandlers";
diff --git a/web/src/components/MemoView/hooks/useMemoActions.ts b/web/src/components/MemoView/hooks/useMemoActions.ts
deleted file mode 100644
index 3fee74d93..000000000
--- a/web/src/components/MemoView/hooks/useMemoActions.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { useUpdateMemo } from "@/hooks/useMemoQueries";
-import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
-
-export const useMemoActions = (memo: Memo) => {
- const { mutateAsync: updateMemo } = useUpdateMemo();
-
- const unpinMemo = async () => {
- if (!memo.pinned) return;
- await updateMemo({ update: { name: memo.name, pinned: false }, updateMask: ["pinned"] });
- };
-
- return { unpinMemo };
-};
diff --git a/web/src/components/MemoView/types.ts b/web/src/components/MemoView/types.ts
index 487b992f4..93a174c62 100644
--- a/web/src/components/MemoView/types.ts
+++ b/web/src/components/MemoView/types.ts
@@ -25,7 +25,6 @@ export interface MemoHeaderProps {
timeDisplay?: MemoTimeDisplay;
showCreator?: boolean;
showVisibility?: boolean;
- showPinned?: boolean;
showSpace?: boolean;
}
diff --git a/web/src/locales/ar.json b/web/src/locales/ar.json
index ae605348c..e2971fe08 100644
--- a/web/src/locales/ar.json
+++ b/web/src/locales/ar.json
@@ -217,6 +217,7 @@
"space-invitation-open": "مساحة متاحة"
},
"memo": {
+ "pinned": "مثبّت",
"click-to-show-sensitive-content": "انقر لإظهار المحتوى الحساس",
"comment": {
"self": "التعليقات",
diff --git a/web/src/locales/az.json b/web/src/locales/az.json
index ee6073bbf..21b38f84a 100644
--- a/web/src/locales/az.json
+++ b/web/src/locales/az.json
@@ -318,6 +318,7 @@
"disconnected": "Canlı yeniləmələr əlçatan deyil"
},
"memo": {
+ "pinned": "Sabitlənib",
"parent-loading": "İlkin memo yüklənir…",
"parent-load-error": "İlkin memonu yükləmək mümkün olmadı.",
"parent-unavailable": "İlkin memo əlçatan deyil",
diff --git a/web/src/locales/bg.json b/web/src/locales/bg.json
index 0deac9629..cca3c6d52 100644
--- a/web/src/locales/bg.json
+++ b/web/src/locales/bg.json
@@ -260,6 +260,7 @@
"disconnected": "Не са налични актуализации на живо"
},
"memo": {
+ "pinned": "Закачено",
"click-to-show-sensitive-content": "Кликнете, за да покажете чувствително съдържание",
"comment": {
"self": "Коментари",
diff --git a/web/src/locales/ca.json b/web/src/locales/ca.json
index 34479b256..76ba9220e 100644
--- a/web/src/locales/ca.json
+++ b/web/src/locales/ca.json
@@ -222,6 +222,7 @@
"disconnected": "Actualitzacions en directe no disponibles"
},
"memo": {
+ "pinned": "Fixat",
"click-to-show-sensitive-content": "Fes clic per mostrar contingut sensible",
"comment": {
"self": "Comentaris",
diff --git a/web/src/locales/cs.json b/web/src/locales/cs.json
index 515e25874..d217601ed 100644
--- a/web/src/locales/cs.json
+++ b/web/src/locales/cs.json
@@ -222,6 +222,7 @@
"disconnected": "Živé aktualizace nejsou k dispozici"
},
"memo": {
+ "pinned": "Připnuto",
"click-to-show-sensitive-content": "Klikněte pro zobrazení citlivého obsahu",
"comment": {
"self": "Komentáře",
diff --git a/web/src/locales/da.json b/web/src/locales/da.json
index 92647cb18..1f87857a4 100644
--- a/web/src/locales/da.json
+++ b/web/src/locales/da.json
@@ -260,6 +260,7 @@
"disconnected": "Liveopdateringer er ikke tilgængelige"
},
"memo": {
+ "pinned": "Fastgjort",
"click-to-show-sensitive-content": "Klik for at vise følsomt indhold",
"comment": {
"self": "Kommentarer",
diff --git a/web/src/locales/de.json b/web/src/locales/de.json
index b508d576c..077998df5 100644
--- a/web/src/locales/de.json
+++ b/web/src/locales/de.json
@@ -222,6 +222,7 @@
"disconnected": "Live-Updates nicht verfügbar"
},
"memo": {
+ "pinned": "Angeheftet",
"click-to-show-sensitive-content": "Klicken, um sensible Inhalte anzuzeigen",
"comment": {
"self": "Kommentare",
diff --git a/web/src/locales/el.json b/web/src/locales/el.json
index cf7b97142..612d43055 100644
--- a/web/src/locales/el.json
+++ b/web/src/locales/el.json
@@ -260,6 +260,7 @@
"disconnected": "Οι ζωντανές ενημερώσεις δεν είναι διαθέσιμες"
},
"memo": {
+ "pinned": "Καρφιτσωμένο",
"click-to-show-sensitive-content": "Κάντε κλικ για εμφάνιση ευαίσθητου περιεχομένου",
"comment": {
"self": "Σχόλια",
diff --git a/web/src/locales/en-GB.json b/web/src/locales/en-GB.json
index e88cee72d..86b965fcd 100644
--- a/web/src/locales/en-GB.json
+++ b/web/src/locales/en-GB.json
@@ -222,6 +222,7 @@
"disconnected": "Live updates unavailable"
},
"memo": {
+ "pinned": "Pinned",
"click-to-show-sensitive-content": "Click to show sensitive content",
"comment": {
"self": "Comments",
diff --git a/web/src/locales/en.json b/web/src/locales/en.json
index 6086045bc..ebbc5233e 100644
--- a/web/src/locales/en.json
+++ b/web/src/locales/en.json
@@ -318,6 +318,7 @@
"disconnected": "Live updates unavailable"
},
"memo": {
+ "pinned": "Pinned",
"parent-loading": "Loading original memo…",
"parent-load-error": "Couldn’t load the original memo.",
"parent-unavailable": "Original memo unavailable",
diff --git a/web/src/locales/es.json b/web/src/locales/es.json
index 32807db2a..a82b33067 100644
--- a/web/src/locales/es.json
+++ b/web/src/locales/es.json
@@ -222,6 +222,7 @@
"disconnected": "Actualizaciones en vivo no disponibles"
},
"memo": {
+ "pinned": "Fijado",
"click-to-show-sensitive-content": "Haz clic para mostrar contenido sensible",
"comment": {
"self": "Comentarios",
diff --git a/web/src/locales/et.json b/web/src/locales/et.json
index de3eae78a..e200a9d83 100644
--- a/web/src/locales/et.json
+++ b/web/src/locales/et.json
@@ -260,6 +260,7 @@
"disconnected": "Reaalajas värskendused pole saadaval"
},
"memo": {
+ "pinned": "Kinnitatud",
"click-to-show-sensitive-content": "Tundliku sisu kuvamiseks klõpsake",
"comment": {
"self": "Kommentaarid",
diff --git a/web/src/locales/fa.json b/web/src/locales/fa.json
index 2c487de8c..f6d880cd6 100644
--- a/web/src/locales/fa.json
+++ b/web/src/locales/fa.json
@@ -217,6 +217,7 @@
"space-invitation-open": "فضای باز"
},
"memo": {
+ "pinned": "سنجاق‌شده",
"click-to-show-sensitive-content": "برای نمایش محتوای حساس کلیک کنید",
"comment": {
"self": "نظرات",
diff --git a/web/src/locales/fi.json b/web/src/locales/fi.json
index 8a91235c2..5263c6763 100644
--- a/web/src/locales/fi.json
+++ b/web/src/locales/fi.json
@@ -260,6 +260,7 @@
"disconnected": "Live-päivitykset eivät ole saatavilla"
},
"memo": {
+ "pinned": "Kiinnitetty",
"click-to-show-sensitive-content": "Napsauta näyttääksesi arkaluontoisen sisällön",
"comment": {
"self": "Kommentit",
diff --git a/web/src/locales/fr.json b/web/src/locales/fr.json
index 08c7305d9..c5ec1a3ba 100644
--- a/web/src/locales/fr.json
+++ b/web/src/locales/fr.json
@@ -222,6 +222,7 @@
"disconnected": "Mises à jour en direct indisponibles"
},
"memo": {
+ "pinned": "Épinglé",
"click-to-show-sensitive-content": "Cliquez pour afficher le contenu sensible",
"comment": {
"self": "Commentaires",
diff --git a/web/src/locales/gl.json b/web/src/locales/gl.json
index bb4968017..fcb029072 100644
--- a/web/src/locales/gl.json
+++ b/web/src/locales/gl.json
@@ -222,6 +222,7 @@
"disconnected": "As actualizacións en directo non están dispoñibles"
},
"memo": {
+ "pinned": "Fixado",
"click-to-show-sensitive-content": "Preme para mostrar contido NSFW",
"comment": {
"self": "Comentarios",
diff --git a/web/src/locales/he.json b/web/src/locales/he.json
index 576554787..ed0c5a6fd 100644
--- a/web/src/locales/he.json
+++ b/web/src/locales/he.json
@@ -293,6 +293,7 @@
"disconnected": "עדכונים חיים אינם זמינים"
},
"memo": {
+ "pinned": "נעוץ",
"click-to-show-sensitive-content": "לחצו כדי להציג תוכן רגיש",
"comment": {
"self": "תגובות",
diff --git a/web/src/locales/hi.json b/web/src/locales/hi.json
index 2d6a951c3..67937c727 100644
--- a/web/src/locales/hi.json
+++ b/web/src/locales/hi.json
@@ -217,6 +217,7 @@
"space-invitation-open": "स्पेस खोलें"
},
"memo": {
+ "pinned": "पिन किया गया",
"click-to-show-sensitive-content": "संवेदनशील सामग्री दिखाने के लिए क्लिक करें",
"comment": {
"self": "टिप्पणियाँ",
diff --git a/web/src/locales/hr.json b/web/src/locales/hr.json
index 7d36c76e1..74c95209f 100644
--- a/web/src/locales/hr.json
+++ b/web/src/locales/hr.json
@@ -222,6 +222,7 @@
"disconnected": "Ažuriranja uživo nisu dostupna"
},
"memo": {
+ "pinned": "Prikvačeno",
"click-to-show-sensitive-content": "Klikni za prikaz osjetljivog sadržaja",
"comment": {
"self": "Komentari",
diff --git a/web/src/locales/hu.json b/web/src/locales/hu.json
index f62ac3102..34c377fc0 100644
--- a/web/src/locales/hu.json
+++ b/web/src/locales/hu.json
@@ -222,6 +222,7 @@
"disconnected": "Élő frissítések nem érhetők el"
},
"memo": {
+ "pinned": "Rögzítve",
"click-to-show-sensitive-content": "Kattints a kényes tartalom megjelenítéséhez",
"comment": {
"self": "Hozzászólások",
diff --git a/web/src/locales/id.json b/web/src/locales/id.json
index 2f04e1f9e..536195224 100644
--- a/web/src/locales/id.json
+++ b/web/src/locales/id.json
@@ -217,6 +217,7 @@
"space-invitation-open": "Ruang terbuka"
},
"memo": {
+ "pinned": "Disematkan",
"click-to-show-sensitive-content": "Klik untuk menampilkan konten NSFW",
"comment": {
"self": "Komentar",
diff --git a/web/src/locales/it.json b/web/src/locales/it.json
index 24cde662b..f3ae211cd 100644
--- a/web/src/locales/it.json
+++ b/web/src/locales/it.json
@@ -222,6 +222,7 @@
"disconnected": "Aggiornamenti in tempo reale non disponibili"
},
"memo": {
+ "pinned": "Fissato",
"click-to-show-sensitive-content": "Clicca per mostrare contenuti sensibili",
"comment": {
"self": "Commenti",
diff --git a/web/src/locales/ja.json b/web/src/locales/ja.json
index 609e18800..80a288055 100644
--- a/web/src/locales/ja.json
+++ b/web/src/locales/ja.json
@@ -222,6 +222,7 @@
"disconnected": "ライブアップデートは利用できません"
},
"memo": {
+ "pinned": "ピン留め済み",
"click-to-show-sensitive-content": "クリックしてセンシティブな内容を表示",
"comment": {
"self": "コメント",
diff --git a/web/src/locales/ka-GE.json b/web/src/locales/ka-GE.json
index d9e3f3fcb..d70a5ab64 100644
--- a/web/src/locales/ka-GE.json
+++ b/web/src/locales/ka-GE.json
@@ -222,6 +222,7 @@
"disconnected": "პირდაპირი განახლებები მიუწვდომელია"
},
"memo": {
+ "pinned": "მიმაგრებულია",
"click-to-show-sensitive-content": "დააწკაპუნეთ NSFW კონტენტის საჩვენებლად",
"comment": {
"self": "კომენტარები",
diff --git a/web/src/locales/ko.json b/web/src/locales/ko.json
index 120a9d6fa..96b45e50f 100644
--- a/web/src/locales/ko.json
+++ b/web/src/locales/ko.json
@@ -217,6 +217,7 @@
"space-invitation-open": "빈 공간"
},
"memo": {
+ "pinned": "고정됨",
"click-to-show-sensitive-content": "숨겨진 콘텐츠 보기",
"comment": {
"self": "댓글",
diff --git a/web/src/locales/lt.json b/web/src/locales/lt.json
index 262a28d45..4dd3a0206 100644
--- a/web/src/locales/lt.json
+++ b/web/src/locales/lt.json
@@ -260,6 +260,7 @@
"disconnected": "Tiesioginiai naujinimai nepasiekiami"
},
"memo": {
+ "pinned": "Prisegta",
"click-to-show-sensitive-content": "Spustelėkite, kad būtų rodomas jautrus turinys",
"comment": {
"self": "Komentarai",
diff --git a/web/src/locales/lv.json b/web/src/locales/lv.json
index e1ea84b50..4e263291e 100644
--- a/web/src/locales/lv.json
+++ b/web/src/locales/lv.json
@@ -260,6 +260,7 @@
"disconnected": "Tiešraides atjauninājumi nav pieejami"
},
"memo": {
+ "pinned": "Piesprausts",
"click-to-show-sensitive-content": "Noklikšķiniet, lai parādītu sensitīvu saturu",
"comment": {
"self": "komentāri",
diff --git a/web/src/locales/mr.json b/web/src/locales/mr.json
index 5eeb9f75b..9b04115c2 100644
--- a/web/src/locales/mr.json
+++ b/web/src/locales/mr.json
@@ -217,6 +217,7 @@
"space-invitation-open": "स्पेस उघडा"
},
"memo": {
+ "pinned": "पिन केलेले",
"click-to-show-sensitive-content": "संवेदनशील सामग्री दाखवण्यासाठी क्लिक करा",
"comment": {
"self": "टिप्पण्या",
diff --git a/web/src/locales/nb.json b/web/src/locales/nb.json
index 205a8fdb6..13b3f90cc 100644
--- a/web/src/locales/nb.json
+++ b/web/src/locales/nb.json
@@ -222,6 +222,7 @@
"disconnected": "Liveoppdateringer er ikke tilgjengelige"
},
"memo": {
+ "pinned": "Festet",
"click-to-show-sensitive-content": "Klikk for å vise NSFW-innhold",
"comment": {
"self": "Kommentarer",
diff --git a/web/src/locales/nl.json b/web/src/locales/nl.json
index 9c065f0c8..5171fbd80 100644
--- a/web/src/locales/nl.json
+++ b/web/src/locales/nl.json
@@ -222,6 +222,7 @@
"disconnected": "Live-updates niet beschikbaar"
},
"memo": {
+ "pinned": "Vastgezet",
"click-to-show-sensitive-content": "Klik om NSFW-inhoud te tonen",
"comment": {
"self": "Opmerkingen",
diff --git a/web/src/locales/pl.json b/web/src/locales/pl.json
index 4494b6eb3..b7ba5066e 100644
--- a/web/src/locales/pl.json
+++ b/web/src/locales/pl.json
@@ -222,6 +222,7 @@
"disconnected": "Aktualizacje na żywo niedostępne"
},
"memo": {
+ "pinned": "Przypięto",
"click-to-show-sensitive-content": "Kliknij, aby pokazać treści NSFW",
"comment": {
"self": "Komentarze",
diff --git a/web/src/locales/pt-BR.json b/web/src/locales/pt-BR.json
index 0b9aa9c24..7e5c60c18 100644
--- a/web/src/locales/pt-BR.json
+++ b/web/src/locales/pt-BR.json
@@ -217,6 +217,7 @@
"space-invitation-open": "Espaço aberto"
},
"memo": {
+ "pinned": "Fixado",
"click-to-show-sensitive-content": "Mostrar conteúdo impróprio",
"comment": {
"self": "Comentários",
diff --git a/web/src/locales/pt-PT.json b/web/src/locales/pt-PT.json
index a072df795..24d6ea1b5 100644
--- a/web/src/locales/pt-PT.json
+++ b/web/src/locales/pt-PT.json
@@ -222,6 +222,7 @@
"disconnected": "Atualizações ao vivo indisponíveis"
},
"memo": {
+ "pinned": "Afixado",
"click-to-show-sensitive-content": "Clique para mostrar conteúdo NSFW",
"comment": {
"self": "Comentários",
diff --git a/web/src/locales/ro.json b/web/src/locales/ro.json
index a19990d46..9415537f1 100644
--- a/web/src/locales/ro.json
+++ b/web/src/locales/ro.json
@@ -260,6 +260,7 @@
"disconnected": "Actualizări live indisponibile"
},
"memo": {
+ "pinned": "Fixat",
"click-to-show-sensitive-content": "Faceți clic pentru a afișa conținut sensibil",
"comment": {
"self": "Comentarii",
diff --git a/web/src/locales/ru.json b/web/src/locales/ru.json
index e21bce837..8de75e481 100644
--- a/web/src/locales/ru.json
+++ b/web/src/locales/ru.json
@@ -222,6 +222,7 @@
"disconnected": "Оперативные обновления недоступны."
},
"memo": {
+ "pinned": "Закреплено",
"click-to-show-sensitive-content": "Нажмите, чтобы посмотреть",
"comment": {
"self": "Комментарии",
diff --git a/web/src/locales/sk.json b/web/src/locales/sk.json
index 966d1f7a3..90330c37b 100644
--- a/web/src/locales/sk.json
+++ b/web/src/locales/sk.json
@@ -260,6 +260,7 @@
"disconnected": "Aktuálne aktualizácie nie sú k dispozícii"
},
"memo": {
+ "pinned": "Pripnuté",
"click-to-show-sensitive-content": "Kliknutím zobrazíte citlivý obsah",
"comment": {
"self": "Komentáre",
diff --git a/web/src/locales/sl.json b/web/src/locales/sl.json
index 3d7e31aad..b6b17755e 100644
--- a/web/src/locales/sl.json
+++ b/web/src/locales/sl.json
@@ -222,6 +222,7 @@
"disconnected": "Posodobitve v živo niso na voljo"
},
"memo": {
+ "pinned": "Pripeto",
"click-to-show-sensitive-content": "Kliknite za prikaz NSFW vsebine",
"comment": {
"self": "Komentarji",
diff --git a/web/src/locales/sr.json b/web/src/locales/sr.json
index 2555be3c0..af9e7cfce 100644
--- a/web/src/locales/sr.json
+++ b/web/src/locales/sr.json
@@ -260,6 +260,7 @@
"disconnected": "Ажурирања уживо нису доступна"
},
"memo": {
+ "pinned": "Закачено",
"click-to-show-sensitive-content": "Кликните да бисте приказали осетљив садржај",
"comment": {
"self": "Коментари",
diff --git a/web/src/locales/sv.json b/web/src/locales/sv.json
index 6b68209e8..fb0877803 100644
--- a/web/src/locales/sv.json
+++ b/web/src/locales/sv.json
@@ -222,6 +222,7 @@
"disconnected": "Liveuppdateringar är inte tillgängliga"
},
"memo": {
+ "pinned": "Fäst",
"click-to-show-sensitive-content": "Klicka för att visa känsligt innehåll (NSFW)",
"comment": {
"self": "Kommentarer",
diff --git a/web/src/locales/th.json b/web/src/locales/th.json
index 608c280a4..e0489d071 100644
--- a/web/src/locales/th.json
+++ b/web/src/locales/th.json
@@ -217,6 +217,7 @@
"space-invitation-open": "เปิดพื้นที่"
},
"memo": {
+ "pinned": "ปักหมุดแล้ว",
"click-to-show-sensitive-content": "คลิกเพื่อแสดงเนื้อหาไม่เหมาะสม (NSFW)",
"comment": {
"self": "ความคิดเห็น",
diff --git a/web/src/locales/tr.json b/web/src/locales/tr.json
index 24488b503..582bb53ec 100644
--- a/web/src/locales/tr.json
+++ b/web/src/locales/tr.json
@@ -247,6 +247,7 @@
"disconnected": "Canlı güncellemeler kullanılamıyor"
},
"memo": {
+ "pinned": "Sabitlendi",
"parent-loading": "Özgün not yükleniyor…",
"parent-load-error": "Özgün not yüklenemedi.",
"parent-unavailable": "Özgün not kullanılamıyor",
diff --git a/web/src/locales/uk.json b/web/src/locales/uk.json
index 33f01a540..5ca1944be 100644
--- a/web/src/locales/uk.json
+++ b/web/src/locales/uk.json
@@ -222,6 +222,7 @@
"disconnected": "Оновлення в реальному часі недоступні"
},
"memo": {
+ "pinned": "Закріплено",
"click-to-show-sensitive-content": "Натисніть, щоб показати NSFW-контент",
"comment": {
"self": "Коментарі",
diff --git a/web/src/locales/vi.json b/web/src/locales/vi.json
index eb992b0fe..c4b9ff6fe 100644
--- a/web/src/locales/vi.json
+++ b/web/src/locales/vi.json
@@ -217,6 +217,7 @@
"space-invitation-open": "Không gian trống"
},
"memo": {
+ "pinned": "Đã ghim",
"click-to-show-sensitive-content": "Nhấp để hiện nội dung nhạy cảm",
"comment": {
"self": "Bình luận",
diff --git a/web/src/locales/zh-Hans.json b/web/src/locales/zh-Hans.json
index 2a60892f3..87601e75e 100644
--- a/web/src/locales/zh-Hans.json
+++ b/web/src/locales/zh-Hans.json
@@ -247,6 +247,7 @@
"space-invitation-open": "打开空间"
},
"memo": {
+ "pinned": "已置顶",
"back-to": "返回{{source}}",
"click-to-show-sensitive-content": "点击显示敏感内容",
"comment": {
diff --git a/web/src/locales/zh-Hant.json b/web/src/locales/zh-Hant.json
index 0e5d267a4..d2177c785 100644
--- a/web/src/locales/zh-Hant.json
+++ b/web/src/locales/zh-Hant.json
@@ -300,6 +300,7 @@
"disconnected": "即時更新無法使用"
},
"memo": {
+ "pinned": "已置頂",
"click-to-show-sensitive-content": "點擊顯示敏感內容",
"comment": {
"self": "評論",
diff --git a/web/tests/memo-header-navigation.test.tsx b/web/tests/memo-header-navigation.test.tsx
index 3f37985ae..30939c6ca 100644
--- a/web/tests/memo-header-navigation.test.tsx
+++ b/web/tests/memo-header-navigation.test.tsx
@@ -51,10 +51,6 @@ vi.mock("@/i18n", () => ({
default: { language: "en" },
}));
-vi.mock("@/components/MemoView/hooks", () => ({
- useMemoActions: () => ({ unpinMemo: vi.fn() }),
-}));
-
vi.mock("@/components/MemoView/MemoViewContext", () => ({
useMemoViewContext: () => ({
memo: { name: "memos/123", visibility: 1, pinned: false, space: "spaces/product" },
diff --git a/web/tests/memo-pinned-mark.test.tsx b/web/tests/memo-pinned-mark.test.tsx
new file mode 100644
index 000000000..878db18d2
--- /dev/null
+++ b/web/tests/memo-pinned-mark.test.tsx
@@ -0,0 +1,19 @@
+import { fireEvent, render, screen } from "@testing-library/react";
+import { describe, expect, it, vi } from "vitest";
+import MemoPinnedMark from "@/components/MemoView/components/MemoPinnedMark";
+
+vi.mock("@/utils/i18n", () => ({
+ useTranslate: () => (key: string) => key,
+}));
+
+describe("Memo pinned mark", () => {
+ it("exposes the pinned state without adding an unpin button", () => {
+ render(<MemoPinnedMark />);
+ const mark = screen.getByRole("img", { name: "memo.pinned" });
+ expect(mark.tagName).toBe("SPAN");
+ expect(screen.queryByRole("button")).not.toBeInTheDocument();
+ fireEvent.click(mark);
+ expect(mark).toBeInTheDocument();
+ expect(mark).not.toHaveAttribute("tabindex", "0");
+ });
+});