chore: make individual memos easier to open

Timestamp: the card timestamp was a button that navigated in script, so
it
had no URL preview and could not be opened in a new tab. It is now a
real
link that keeps the origin page and underlines on hover. On the memo's
own
page it renders as plain text, since the link would point at itself.

Action menu: ordered by how often each action is used, showing only what
applies:

- Owner: Open, Edit, Pin | Archive, one task action, Copy > (link,
  content),
  then More > (Move, Delete) when the memo can move, otherwise Delete.
- Archived: Restore | Delete.
- Comment: Edit | task action, Copy | Delete.
- Viewer: Open, Copy.

Open is a real link (new DropdownMenuLinkItem kit wrapper), hidden on
the
memo's own page. Check all / Uncheck all collapse into one item chosen
by
whether tasks are still open. Move only appears when there is a Space to
move to or leave, and a comment's copied link lands on the comment
inside
its parent memo.

Detail sidebar: remove the back-to-origin row. It duplicated browser
back
and the navigation above it, pushed a new history entry instead of going
back, sat inside the mobile drawer, and labelled most origins as Home.
Returning to the origin after archive or delete is unchanged.

Refs #6359
This commit is contained in:
boojack
2026-09-26 13:05:58 +08:00
parent 26be2a9663
commit c5e7d65c12
57 changed files with 412 additions and 339 deletions
@@ -240,7 +240,6 @@ const MemoDetailSidebarContent = () => {
parentStatus={memoDetail.parentStatus}
onParentRetry={memoDetail.onParentRetry}
parentPage={memoDetail.from}
hasExplicitOrigin={memoDetail.hasExplicitOrigin}
commentCount={memoDetail.commentCount}
forceReadonly={memoDetail.readonly}
onEdit={runAndClose(memoDetail.onEdit)}
@@ -1,6 +1,7 @@
import {
ArchiveIcon,
ArchiveRestoreIcon,
ArrowUpRightIcon,
BookmarkMinusIcon,
BookmarkPlusIcon,
CheckCheckIcon,
@@ -9,19 +10,20 @@ import {
FileTextIcon,
FolderInputIcon,
LinkIcon,
ListChecksIcon,
ListRestartIcon,
MoreHorizontalIcon,
MoreVerticalIcon,
TrashIcon,
} from "lucide-react";
import { useState } from "react";
import { Link } from "react-router-dom";
import ConfirmDialog from "@/components/ConfirmDialog";
import { Button } from "@/components/ui/button";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLinkItem,
DropdownMenuSeparator,
DropdownMenuSub,
DropdownMenuSubContent,
@@ -30,12 +32,19 @@ import {
} from "@/components/ui/dropdown-menu";
import { State } from "@/types/proto/api/v1/common_pb";
import { useTranslate } from "@/utils/i18n";
import { createMemoNavigationState } from "../MemoView/navigation";
import { useMemoActionHandlers } from "./hooks";
import MemoMoveDialog from "./MemoMoveDialog";
import type { MemoActionMenuProps } from "./types";
/**
* The memo's action menu, in order of how often each action is reached for:
* open, edit and pin first; then archive, tasks and the Copy submenu; Delete last.
* Delete joins Move under More only when Move applies. An archived memo offers
* only Restore and Delete, and a viewer only Open and Copy.
*/
const MemoActionMenu = (props: MemoActionMenuProps) => {
const { memo, readonly } = props;
const { memo, parentPage, readonly } = props;
const t = useTranslate();
// Dialog state
@@ -45,12 +54,13 @@ const MemoActionMenu = (props: MemoActionMenuProps) => {
// Derived state
const isComment = Boolean(memo.parent);
const isArchived = memo.state === State.ARCHIVED;
const canMutateTasks = !readonly && !isArchived && Boolean(memo.property?.hasTaskList);
const hasTaskList = Boolean(memo.property?.hasTaskList);
const hasOpenTasks = Boolean(memo.property?.hasIncompleteTasks);
// Action handlers
const {
canMove,
isInMemoDetailPage,
handleTogglePinMemoBtnClick,
handleEditMemoClick,
handleToggleMemoStatusClick,
@@ -62,112 +72,141 @@ const MemoActionMenu = (props: MemoActionMenuProps) => {
confirmDeleteMemo,
} = useMemoActionHandlers({
memo,
parentPage: props.parentPage,
parentPage,
onEdit: props.onEdit,
setDeleteDialogOpen,
});
// A comment opens in the context of its parent memo, never on its own.
const openItem = !isComment && !isInMemoDetailPage && (
<DropdownMenuLinkItem
closeOnClick
render={
<Link to={`/${memo.name}`} state={parentPage !== undefined ? createMemoNavigationState(parentPage) : undefined} viewTransition />
}
>
<ArrowUpRightIcon />
{t("common.open")}
</DropdownMenuLinkItem>
);
const copySubmenu = (
<DropdownMenuSub>
<DropdownMenuSubTrigger>
<CopyIcon />
{t("common.copy")}
</DropdownMenuSubTrigger>
<DropdownMenuSubContent>
<DropdownMenuItem onClick={handleCopyLink}>
<LinkIcon />
{t("memo.copy-link")}
</DropdownMenuItem>
<DropdownMenuItem onClick={handleCopyContent}>
<FileTextIcon />
{t("memo.copy-content")}
</DropdownMenuItem>
</DropdownMenuSubContent>
</DropdownMenuSub>
);
const deleteItem = (
<DropdownMenuItem variant="destructive" onClick={handleDeleteMemoClick}>
<TrashIcon />
{t("common.delete")}
</DropdownMenuItem>
);
const renderItems = () => {
if (readonly) {
return (
<>
{openItem}
{copySubmenu}
</>
);
}
if (isArchived) {
return (
<>
<DropdownMenuItem onClick={handleToggleMemoStatusClick}>
<ArchiveRestoreIcon />
{t("common.restore")}
</DropdownMenuItem>
<DropdownMenuSeparator />
{deleteItem}
</>
);
}
return (
<>
{openItem}
<DropdownMenuItem onClick={handleEditMemoClick}>
<Edit3Icon />
{t("common.edit")}
</DropdownMenuItem>
{!isComment && (
<DropdownMenuItem onClick={handleTogglePinMemoBtnClick}>
{memo.pinned ? <BookmarkMinusIcon /> : <BookmarkPlusIcon />}
{memo.pinned ? t("common.unpin") : t("common.pin")}
</DropdownMenuItem>
)}
<DropdownMenuSeparator />
{!isComment && (
<DropdownMenuItem onClick={handleToggleMemoStatusClick}>
<ArchiveIcon />
{t("common.archive")}
</DropdownMenuItem>
)}
{/* One task action at a time: finish the open tasks, or reset a finished list. */}
{hasTaskList &&
(hasOpenTasks ? (
<DropdownMenuItem onClick={handleCheckAllTaskListItemsClick}>
<CheckCheckIcon />
{t("memo.task-actions.check-all")}
</DropdownMenuItem>
) : (
<DropdownMenuItem onClick={handleUncheckAllTaskListItemsClick}>
<ListRestartIcon />
{t("memo.task-actions.uncheck-all")}
</DropdownMenuItem>
))}
{copySubmenu}
{canMove ? (
<DropdownMenuSub>
<DropdownMenuSubTrigger>
<MoreHorizontalIcon />
{t("common.more")}
</DropdownMenuSubTrigger>
<DropdownMenuSubContent>
<DropdownMenuItem onClick={() => setMoveDialogOpen(true)}>
<FolderInputIcon />
{t("memo.move.title")}
</DropdownMenuItem>
<DropdownMenuSeparator />
{deleteItem}
</DropdownMenuSubContent>
</DropdownMenuSub>
) : (
<>
<DropdownMenuSeparator />
{deleteItem}
</>
)}
</>
);
};
return (
<DropdownMenu>
<DropdownMenuTrigger render={<Button variant="quiet" size="icon-sm" aria-label={t("common.more")} />}>
<MoreVerticalIcon className="size-4" strokeWidth={1.8} />
</DropdownMenuTrigger>
<DropdownMenuContent align="end" sideOffset={2} size="sm">
{/* Edit actions (non-readonly, non-archived) */}
{!readonly && !isArchived && (
<>
{!isComment && (
<DropdownMenuItem onClick={handleTogglePinMemoBtnClick}>
{memo.pinned ? <BookmarkMinusIcon /> : <BookmarkPlusIcon />}
{memo.pinned ? t("common.unpin") : t("common.pin")}
</DropdownMenuItem>
)}
<DropdownMenuItem onClick={handleEditMemoClick}>
<Edit3Icon />
{t("common.edit")}
</DropdownMenuItem>
</>
)}
{/* Copy submenu (non-archived) */}
{!isArchived && (
<DropdownMenuSub>
<DropdownMenuSubTrigger>
<CopyIcon />
{t("common.copy")}
</DropdownMenuSubTrigger>
<DropdownMenuSubContent>
<DropdownMenuItem onClick={handleCopyLink}>
<LinkIcon />
{t("memo.copy-link")}
</DropdownMenuItem>
<DropdownMenuItem onClick={handleCopyContent}>
<FileTextIcon />
{t("memo.copy-content")}
</DropdownMenuItem>
</DropdownMenuSubContent>
</DropdownMenuSub>
)}
{/* Task submenu (writable task memos) */}
{canMutateTasks && (
<DropdownMenuSub>
<DropdownMenuSubTrigger>
<ListChecksIcon />
{t("memo.task-actions.title")}
</DropdownMenuSubTrigger>
<DropdownMenuSubContent>
<DropdownMenuItem disabled={!hasOpenTasks} onClick={handleCheckAllTaskListItemsClick}>
<CheckCheckIcon />
{t("memo.task-actions.check-all")}
</DropdownMenuItem>
<DropdownMenuItem onClick={handleUncheckAllTaskListItemsClick}>
<ListRestartIcon />
{t("memo.task-actions.uncheck-all")}
</DropdownMenuItem>
</DropdownMenuSubContent>
</DropdownMenuSub>
)}
{!readonly && !isComment && (
<DropdownMenuItem onClick={handleToggleMemoStatusClick}>
{isArchived ? <ArchiveRestoreIcon /> : <ArchiveIcon />}
{isArchived ? t("common.restore") : t("common.archive")}
</DropdownMenuItem>
)}
{isComment && !readonly && (
<>
{!isArchived && <DropdownMenuSeparator />}
<DropdownMenuItem onClick={handleDeleteMemoClick}>
<TrashIcon />
{t("common.delete")}
</DropdownMenuItem>
</>
)}
{!isComment && (canMove || !readonly) && (
<DropdownMenuSub>
<DropdownMenuSubTrigger>
<MoreHorizontalIcon />
{t("common.more")}
</DropdownMenuSubTrigger>
<DropdownMenuSubContent>
{canMove && (
<DropdownMenuItem onClick={() => setMoveDialogOpen(true)}>
<FolderInputIcon />
{t("memo.move.title")}
</DropdownMenuItem>
)}
{!readonly && (
<DropdownMenuItem onClick={handleDeleteMemoClick}>
<TrashIcon />
{t("common.delete")}
</DropdownMenuItem>
)}
</DropdownMenuSubContent>
</DropdownMenuSub>
)}
{renderItems()}
</DropdownMenuContent>
{moveDialogOpen && <MemoMoveDialog memo={memo} onOpenChange={setMoveDialogOpen} />}
+12 -3
View File
@@ -4,11 +4,13 @@ import { useCallback } from "react";
import toast from "react-hot-toast";
import { useLocation } from "react-router-dom";
import { useInstance } from "@/contexts/InstanceContext";
import { useSpaceContext } from "@/contexts/SpaceContext";
import useCurrentUser from "@/hooks/useCurrentUser";
import { memoKeys, useDeleteMemo, useUpdateMemo } from "@/hooks/useMemoQueries";
import useNavigateTo from "@/hooks/useNavigateTo";
import { userKeys } from "@/hooks/useUserQueries";
import { handleError } from "@/lib/error";
import { extractMemoIdFromName } from "@/lib/resource-names";
import { ROUTES } from "@/router/routes";
import { State } from "@/types/proto/api/v1/common_pb";
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
@@ -28,7 +30,11 @@ export const useMemoActionHandlers = ({ memo, parentPage, onEdit, setDeleteDialo
const t = useTranslate();
const location = useLocation();
const currentUser = useCurrentUser();
const canMove = canManageMemo(memo, currentUser) && !location.pathname.startsWith(ROUTES.SHARED_MEMO);
const { spaces } = useSpaceContext();
// Move needs somewhere to go: another Space to join, or out of the current one.
const hasMoveDestination = spaces.length > 0 || Boolean(memo.space);
const canMove =
!memo.parent && canManageMemo(memo, currentUser) && !location.pathname.startsWith(ROUTES.SHARED_MEMO) && hasMoveDestination;
const navigateTo = useNavigateTo();
const queryClient = useQueryClient();
const { profile } = useInstance();
@@ -117,9 +123,11 @@ export const useMemoActionHandlers = ({ memo, parentPage, onEdit, setDeleteDialo
if (host === "") {
host = window.location.origin;
}
copy(`${host}/${memo.name}`);
// A comment's link lands on the comment inside its parent memo, as the comment previews do.
const path = memo.parent ? `${memo.parent}#${extractMemoIdFromName(memo.name)}` : memo.name;
copy(`${host}/${path}`);
toast.success(t("message.succeed-copy-link"));
}, [memo.name, t, profile.instanceUrl]);
}, [memo.name, memo.parent, t, profile.instanceUrl]);
const handleCopyContent = useCallback(() => {
copy(memo.content);
@@ -158,6 +166,7 @@ export const useMemoActionHandlers = ({ memo, parentPage, onEdit, setDeleteDialo
return {
canMove,
isInMemoDetailPage,
handleTogglePinMemoBtnClick,
handleEditMemoClick,
handleToggleMemoStatusClick,
@@ -1,6 +1,5 @@
import copy from "copy-to-clipboard";
import {
ArrowLeftIcon,
ChevronDownIcon,
CornerUpLeftIcon,
Edit3Icon,
@@ -13,7 +12,6 @@ import {
import { useMemo, useState } from "react";
import toast from "react-hot-toast";
import { Link, useLocation } from "react-router-dom";
import { getSidebarRouteKind } from "@/components/AppSidebar/routes";
import SidebarRow, { SIDEBAR_ROW_CLASSES, SIDEBAR_ROW_COUNT_RAIL_CLASSES, SidebarRowIconSlot } from "@/components/AppSidebar/SidebarRow";
import SidebarSection, { SIDEBAR_SECTION_STACK_CLASSES } from "@/components/AppSidebar/SidebarSection";
import { extractHeadings } from "@/components/MemoContent/pipeline";
@@ -40,7 +38,6 @@ interface Props {
parentStatus?: MemoParentStatus;
onParentRetry?: () => void;
parentPage?: string;
hasExplicitOrigin?: boolean;
commentCount?: number;
className?: string;
onEdit?: () => void;
@@ -92,7 +89,6 @@ const MemoDetailSidebar = ({
parentStatus,
onParentRetry,
parentPage,
hasExplicitOrigin = false,
commentCount,
className,
onEdit,
@@ -139,28 +135,6 @@ const MemoDetailSidebar = ({
return normalizeSnippet(relatedMemo.snippet || resolvedMemos[relatedMemo.name]?.snippet || relatedMemo.name);
};
const originLabel = useMemo(() => {
const originPath = parentPage?.split(/[?#]/, 1)[0] || "/";
switch (getSidebarRouteKind(originPath)) {
case "map":
return t("common.map");
case "explore":
return t("common.explore");
case "archived":
return t("common.archived");
case "attachments":
return t("common.attachments");
case "views":
return t("common.views");
case "inbox":
return t("common.inbox");
case "settings":
return t("common.settings");
default:
return t("common.home");
}
}, [parentPage, t]);
const parentSnippet = parentMemo ? normalizeSnippet(parentMemo.snippet || parentMemo.content || parentMemo.name) : "";
const showComments = !forceReadonly && commentCount !== undefined && commentCount > 0;
const showOnThisMemo = headings.length > 1 || showComments;
@@ -175,23 +149,6 @@ const MemoDetailSidebar = ({
return (
<div className={cn("relative w-full select-none", SIDEBAR_SECTION_STACK_CLASSES, className)}>
{!forceReadonly && parentPage && (
<SidebarSection
ariaLabel={hasExplicitOrigin ? t("memo.back-to", { source: originLabel }) : t("memo.go-to", { source: originLabel })}
>
<Link
className={cn(SIDEBAR_ROW_CLASSES, "text-muted-foreground hover:bg-sidebar-accent/65 hover:text-foreground")}
to={parentPage}
viewTransition
>
<SidebarRowIconSlot icon={ArrowLeftIcon} />
<span className="min-w-0 flex-1 truncate text-start">
{hasExplicitOrigin ? t("memo.back-to", { source: originLabel }) : t("memo.go-to", { source: originLabel })}
</span>
</Link>
</SidebarSection>
)}
{showOnThisMemo && (
<SidebarSection label={t("memo.on-this-memo")}>
{headings.length > 1 && <MemoOutline headings={headings} memoName={memo.name} />}
@@ -1,11 +1,9 @@
import { useCallback } from "react";
import { Link } from "react-router-dom";
import { Link, useLocation } 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, TooltipTrigger } from "@/components/ui/tooltip";
import { useNewMemo } from "@/contexts/NewMemoContext";
import useNavigateTo from "@/hooks/useNavigateTo";
import i18n from "@/i18n";
import { cn } from "@/lib/utils";
import { getCreatorHomePath } from "@/router/routes";
@@ -19,7 +17,7 @@ import UserAvatar from "../../UserAvatar";
import VisibilityIcon from "../../VisibilityIcon";
import { MEMO_TIME_CONTROL_CLASSES } from "../constants";
import { useMemoViewContext, useMemoViewDerived } from "../MemoViewContext";
import { createMemoNavigationState } from "../navigation";
import { createMemoNavigationState, isMemoDetailPath } from "../navigation";
import type { MemoHeaderProps } from "../types";
import MemoSpaceBadge from "./MemoSpaceBadge";
@@ -30,15 +28,11 @@ const MemoHeader: React.FC<MemoHeaderProps> = ({ timeDisplay = "relative", showC
const t = useTranslate();
const { memo, creator, currentUser, parentPage, isArchived, readonly, openEditor } = useMemoViewContext();
const location = useLocation();
const { createTime, updateTime, displayTime: memoDisplayTime, isDisplayingUpdatedTime, relativeTimeFormat } = useMemoViewDerived();
const { newMemoName } = useNewMemo();
const visibilityOption = getVisibilityOption(memo.visibility);
const navigateTo = useNavigateTo();
const handleGotoMemoDetailPage = useCallback(() => {
navigateTo(`/${memo.name}`, { state: createMemoNavigationState(parentPage) });
}, [memo.name, parentPage, navigateTo]);
const timeValue = isArchived ? (
memoDisplayTime?.toLocaleString(i18n.language)
) : timeDisplay === "time" ? (
@@ -70,7 +64,13 @@ const MemoHeader: React.FC<MemoHeaderProps> = ({ timeDisplay = "relative", showC
{/* The time stays visible while the creator and Space badge can shrink and truncate. */}
<div data-slot="memo-header-meta" className="flex min-w-0 items-center gap-1.5 overflow-hidden">
{showCreator && creator && <CreatorDisplay creator={creator} />}
<TimeDisplay displayTime={displayTime} timeTooltip={timeTooltip} onGotoDetail={handleGotoMemoDetailPage} />
<TimeDisplay
displayTime={displayTime}
timeTooltip={timeTooltip}
memoName={memo.name}
parentPage={parentPage}
isCurrentPage={isMemoDetailPath(location.pathname, memo.name)}
/>
{spaceMetadata}
</div>
{memo.name === newMemoName && (
@@ -147,14 +147,27 @@ const TimeTooltip = ({ children, content }: { children: React.ReactElement; cont
interface TimeDisplayProps {
displayTime: React.ReactNode;
timeTooltip: TimeTooltipContent;
onGotoDetail: () => void;
memoName: string;
parentPage: string;
/** On the memo's own page the permalink would lead nowhere, so the time is plain text. */
isCurrentPage: boolean;
}
const TimeDisplay: React.FC<TimeDisplayProps> = ({ displayTime, timeTooltip, onGotoDetail }) => (
/** The timestamp is the memo's permalink: a real link, so it previews its URL and opens in a new tab. */
const TimeDisplay: React.FC<TimeDisplayProps> = ({ displayTime, timeTooltip, memoName, parentPage, isCurrentPage }) => (
<TimeTooltip content={timeTooltip}>
<button type="button" className={MEMO_TIME_CONTROL_CLASSES} onClick={onGotoDetail}>
{displayTime}
</button>
{isCurrentPage ? (
<span className="shrink-0 whitespace-nowrap text-ui text-muted-foreground select-none">{displayTime}</span>
) : (
<Link
className={cn(MEMO_TIME_CONTROL_CLASSES, "underline-offset-2 hover:underline")}
to={`/${memoName}`}
state={createMemoNavigationState(parentPage)}
viewTransition
>
{displayTime}
</Link>
)}
</TimeTooltip>
);
+24 -7
View File
@@ -60,6 +60,14 @@ function DropdownMenuGroup({ ...props }: DropdownMenuPrimitive.Group.Props) {
return <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />;
}
const dropdownMenuItemClasses = (size: DropdownMenuSize) =>
cn(
"data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center rounded-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
size === "sm"
? "min-h-7 gap-1.5 px-2 py-1 text-ui data-[inset]:ps-7 [&_svg:not([class*='size-'])]:size-3.5"
: "gap-2 px-2 py-1.5 text-sm data-[inset]:ps-8 [&_svg:not([class*='size-'])]:size-4",
);
function DropdownMenuItem({
className,
inset,
@@ -76,13 +84,21 @@ function DropdownMenuItem({
data-slot="dropdown-menu-item"
data-inset={inset}
data-variant={variant}
className={cn(
"data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center rounded-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
size === "sm"
? "min-h-7 gap-1.5 px-2 py-1 text-ui data-[inset]:ps-7 [&_svg:not([class*='size-'])]:size-3.5"
: "gap-2 px-2 py-1.5 text-sm data-[inset]:ps-8 [&_svg:not([class*='size-'])]:size-4",
className,
)}
className={cn(dropdownMenuItemClasses(size), className)}
{...props}
/>
);
}
/** A menu item that is a real link, so the browser's open-in-new-tab gestures work on it. */
function DropdownMenuLinkItem({ className, inset, ...props }: DropdownMenuPrimitive.LinkItem.Props & { inset?: boolean }) {
const size = React.useContext(DropdownMenuSizeContext);
return (
<DropdownMenuPrimitive.LinkItem
data-slot="dropdown-menu-item"
data-inset={inset}
className={cn(dropdownMenuItemClasses(size), className)}
{...props}
/>
);
@@ -242,6 +258,7 @@ export {
DropdownMenuGroup,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuLinkItem,
DropdownMenuPortal,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
-1
View File
@@ -12,7 +12,6 @@ export interface MemoDetailSidebarDescriptor {
parentStatus?: MemoParentStatus;
onParentRetry?: () => void;
from?: string;
hasExplicitOrigin?: boolean;
commentCount?: number;
readonly?: boolean;
onEdit?: () => void;
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "المزيد",
"name": "الاسم",
"nickname": "الاسم المستعار",
"open": "فتح",
"or": "أو",
"password": "كلمة المرور",
"pin": "ثبّت",
@@ -298,7 +299,6 @@
"count-memos-updated-in-date": "{{count}} {{memos}} تم التحديث في {{date}}",
"connections": "الاتصالات",
"grid-compact-hint": "تستخدم تخطيطات الشبكة دائمًا بطاقات مضغوطة.",
"go-to": "الانتقال إلى {{source}}",
"layout": "التخطيط",
"layout-auto": "تلقائي",
"layout-auto-description": "عدد الأعمدة حسب عرض الشاشة",
@@ -312,7 +312,6 @@
"parent-memo": "المذكرة الأصلية",
"task-actions": {
"check-all": "تحديد جميع المهام",
"title": "المهام",
"uncheck-all": "إلغاء تحديد جميع المهام",
"updated": "تم تحديث المهام"
},
+1 -2
View File
@@ -196,6 +196,7 @@
"name": "Ad",
"next-month": "Növbəti ay",
"nickname": "Ləqəb",
"open": "Aç",
"or": "və ya",
"password": "Parol",
"pin": "Sancaqla",
@@ -356,7 +357,6 @@
"compact-mode": "Yığcam rejim",
"connections": "Bağlantılar",
"grid-compact-hint": "Şəbəkə düzülüşləri həmişə yığcam kartlardan istifadə edir.",
"go-to": "{{source}} bölməsinə keç",
"layout": "Düzülüş",
"layout-auto": "Avtomatik",
"layout-auto-description": "Ekrana sığdığı qədər sütun",
@@ -403,7 +403,6 @@
"show-more": "Daha çox göstər",
"task-actions": {
"check-all": "Bütün tapşırıqları işarələ",
"title": "Tapşırıqlar",
"uncheck-all": "Bütün tapşırıqların işarəsini götür",
"updated": "Tapşırıqlar yeniləndi"
},
+1 -2
View File
@@ -133,6 +133,7 @@
"more": "повече",
"name": "Име",
"nickname": "Псевдоним",
"open": "Отвори",
"or": "или",
"password": "Парола",
"pin": "ПИН",
@@ -318,7 +319,6 @@
"show-more": "Покажи повече",
"task-actions": {
"check-all": "Проверете всички задачи",
"title": "Задачи",
"uncheck-all": "Премахнете отметката от всички задачи",
"updated": "Задачите са актуализирани"
},
@@ -349,7 +349,6 @@
"back-to": "Обратно към {{source}}",
"connections": "Връзки",
"grid-compact-hint": "Мрежовите оформления винаги използват компактни карти.",
"go-to": "Отидете на {{source}}",
"layout": "Оформление",
"layout-auto": "Автоматично",
"layout-auto-description": "Толкова колони, колкото се побират на екрана",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Més",
"name": "Nom",
"nickname": "Sobrenom",
"open": "Obre",
"or": "o",
"password": "Contrasenya",
"pin": "Enganxa",
@@ -290,7 +291,6 @@
"oldest-first": "El més vell primer",
"task-actions": {
"check-all": "Comproveu totes les tasques",
"title": "Tasques",
"uncheck-all": "Desmarqueu totes les tasques",
"updated": "Tasques actualitzades"
},
@@ -311,7 +311,6 @@
"back-to": "Torna a {{source}}",
"connections": "Connexions",
"grid-compact-hint": "Els dissenys de quadrícula sempre utilitzen targetes compactes.",
"go-to": "Ves a {{source}}",
"layout": "Disseny",
"layout-auto": "Automàtic",
"layout-auto-description": "Tantes columnes com càpiguen a la pantalla",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Více",
"name": "Jméno",
"nickname": "Přezdívka",
"open": "Otevřít",
"or": "nebo",
"password": "Heslo",
"pin": "Připnout",
@@ -290,7 +291,6 @@
"oldest-first": "Nejdříve nejstarší",
"task-actions": {
"check-all": "Zkontrolujte všechny úkoly",
"title": "Úkoly",
"uncheck-all": "Zrušte zaškrtnutí všech úkolů",
"updated": "Úkoly aktualizovány"
},
@@ -311,7 +311,6 @@
"back-to": "Zpět na {{source}}",
"connections": "Připojení",
"grid-compact-hint": "Mřížkové rozvržení vždy používá kompaktní karty.",
"go-to": "Přejít na {{source}}",
"layout": "Rozvržení",
"layout-auto": "Automaticky",
"layout-auto-description": "Tolik sloupců, kolik se vejde na obrazovku",
+1 -2
View File
@@ -133,6 +133,7 @@
"more": "Mere",
"name": "Navn",
"nickname": "Kaldenavn",
"open": "Åbn",
"or": "eller",
"password": "Adgangskode",
"pin": "Stift",
@@ -318,7 +319,6 @@
"show-more": "Vis mere",
"task-actions": {
"check-all": "Tjek alle opgaver",
"title": "Opgaver",
"uncheck-all": "Fjern markeringen i alle opgaver",
"updated": "Opgaver opdateret"
},
@@ -349,7 +349,6 @@
"back-to": "Tilbage til {{source}}",
"connections": "Forbindelser",
"grid-compact-hint": "Gitterlayout bruger altid kompakte kort.",
"go-to": "Gå til {{source}}",
"layout": "Layout",
"layout-auto": "Auto",
"layout-auto-description": "Så mange kolonner som der er plads til på skærmen",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Mehr",
"name": "Name",
"nickname": "Spitzname",
"open": "Öffnen",
"or": "oder",
"password": "Passwort",
"pin": "Anpinnen",
@@ -290,7 +291,6 @@
"oldest-first": "Älteste zuerst",
"task-actions": {
"check-all": "Überprüfen Sie alle Aufgaben",
"title": "Aufgaben",
"uncheck-all": "Deaktivieren Sie alle Aufgaben",
"updated": "Aufgaben aktualisiert"
},
@@ -311,7 +311,6 @@
"back-to": "Zurück zu {{source}}",
"connections": "Verbindungen",
"grid-compact-hint": "Rasterlayouts verwenden immer kompakte Karten.",
"go-to": "Gehe zu {{source}}",
"layout": "Layout",
"layout-auto": "Automatisch",
"layout-auto-description": "So viele Spalten, wie auf den Bildschirm passen",
+1 -2
View File
@@ -133,6 +133,7 @@
"more": "Περισσότερο",
"name": "Ονομα",
"nickname": "Παρατσούκλι",
"open": "Άνοιγμα",
"or": "ή",
"password": "Σύνθημα",
"pin": "Καρφίτσα",
@@ -318,7 +319,6 @@
"show-more": "Εμφάνιση περισσότερων",
"task-actions": {
"check-all": "Ελέγξτε όλες τις εργασίες",
"title": "Καθήκοντα",
"uncheck-all": "Καταργήστε την επιλογή όλων των εργασιών",
"updated": "Οι εργασίες ενημερώθηκαν"
},
@@ -349,7 +349,6 @@
"back-to": "Επιστροφή στο {{source}}",
"connections": "Συνδέσεις",
"grid-compact-hint": "Οι διατάξεις πλέγματος χρησιμοποιούν πάντα συμπαγείς κάρτες.",
"go-to": "Μετάβαση στο {{source}}",
"layout": "Διάταξη",
"layout-auto": "Αυτόματη",
"layout-auto-description": "Τόσες στήλες όσες χωράνε στην οθόνη",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "More",
"name": "Name",
"nickname": "Nickname",
"open": "Open",
"or": "or",
"password": "Password",
"pin": "Pin",
@@ -290,7 +291,6 @@
"oldest-first": "Oldest first",
"task-actions": {
"check-all": "Check all tasks",
"title": "Tasks",
"uncheck-all": "Uncheck all tasks",
"updated": "Tasks updated"
},
@@ -310,7 +310,6 @@
"back-to": "Back to {{source}}",
"connections": "Connections",
"grid-compact-hint": "Grid layouts always use compact cards.",
"go-to": "Go to {{source}}",
"layout": "Layout",
"layout-auto": "Auto",
"layout-auto-description": "As many columns as fit the screen",
+1 -2
View File
@@ -196,6 +196,7 @@
"name": "Name",
"next-month": "Next month",
"nickname": "Nickname",
"open": "Open",
"or": "or",
"password": "Password",
"pin": "Pin",
@@ -356,7 +357,6 @@
"compact-mode": "Compact mode",
"connections": "Connections",
"grid-compact-hint": "Grid layouts always use compact cards.",
"go-to": "Go to {{source}}",
"layout": "Layout",
"layout-auto": "Auto",
"layout-auto-description": "As many columns as fit the screen",
@@ -403,7 +403,6 @@
"show-more": "Show more",
"task-actions": {
"check-all": "Check all tasks",
"title": "Tasks",
"uncheck-all": "Uncheck all tasks",
"updated": "Tasks updated"
},
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Más",
"name": "Nombre",
"nickname": "Apodo",
"open": "Abrir",
"or": "o",
"password": "Contraseña",
"pin": "Enganchar",
@@ -290,7 +291,6 @@
"oldest-first": "El más viejo primero",
"task-actions": {
"check-all": "Verificar todas las tareas",
"title": "Tareas",
"uncheck-all": "Desmarque todas las tareas",
"updated": "Tareas actualizadas"
},
@@ -311,7 +311,6 @@
"back-to": "Volver a {{source}}",
"connections": "Conexiones",
"grid-compact-hint": "Los diseños de cuadrícula siempre utilizan tarjetas compactas.",
"go-to": "Ir a {{source}}",
"layout": "Diseño",
"layout-auto": "Automático",
"layout-auto-description": "Tantas columnas como quepan en la pantalla",
+1 -2
View File
@@ -133,6 +133,7 @@
"more": "Rohkem",
"name": "Nimi",
"nickname": "Hüüdnimi",
"open": "Ava",
"or": "või",
"password": "Parool",
"pin": "Pin",
@@ -318,7 +319,6 @@
"show-more": "Näita rohkem",
"task-actions": {
"check-all": "Kontrollige kõiki ülesandeid",
"title": "Ülesanded",
"uncheck-all": "Tühjendage kõigi ülesannete märge",
"updated": "Ülesanded värskendatud"
},
@@ -349,7 +349,6 @@
"back-to": "Tagasi {{source}} juurde",
"connections": "Ühendused",
"grid-compact-hint": "Ruudustikupaigutused kasutavad alati kompaktseid kaarte.",
"go-to": "Mine {{source}} juurde",
"layout": "Paigutus",
"layout-auto": "Automaatne",
"layout-auto-description": "Nii palju veerge kui ekraanile mahub",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "بیشتر",
"name": "نام",
"nickname": "نام مستعار",
"open": "باز کردن",
"or": "یا",
"password": "گذرواژه",
"pin": "نشان",
@@ -298,7 +299,6 @@
"count-memos-updated-in-date": "{{count}} {{memos}} به‌روزرسانی شده در {{date}}",
"connections": "اتصالات",
"grid-compact-hint": "طرح‌بندی‌های شبکه‌ای همیشه از کارت‌های فشرده استفاده می‌کنند.",
"go-to": "برو به {{source}}",
"layout": "طرح‌بندی",
"layout-auto": "خودکار",
"layout-auto-description": "به تعداد ستون‌هایی که صفحه نمایش را پر می‌کنند",
@@ -312,7 +312,6 @@
"parent-memo": "یادداشت والد",
"task-actions": {
"check-all": "انتخاب همه وظایف",
"title": "وظایف",
"uncheck-all": "انتخاب همه وظایف را بردارید",
"updated": "وظایف به‌روزرسانی شدند"
},
+1 -2
View File
@@ -133,6 +133,7 @@
"more": "Lisää",
"name": "Nimi",
"nickname": "Lempinimi",
"open": "Avaa",
"or": "tai",
"password": "Salasana",
"pin": "Pin",
@@ -318,7 +319,6 @@
"show-more": "Näytä lisää",
"task-actions": {
"check-all": "Tarkista kaikki tehtävät",
"title": "Tehtävät",
"uncheck-all": "Poista kaikkien tehtävien valinta",
"updated": "Tehtävät päivitetty"
},
@@ -349,7 +349,6 @@
"back-to": "Takaisin kohtaan {{source}}",
"connections": "Yhteydet",
"grid-compact-hint": "Ruudukkoasetteluissa käytetään aina kompakteja kortteja.",
"go-to": "Siirry kohtaan {{source}}",
"layout": "Asettelu",
"layout-auto": "Automaattinen",
"layout-auto-description": "Niin monta saraketta kuin näytölle mahtuu",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Plus",
"name": "Nom",
"nickname": "Surnom",
"open": "Ouvrir",
"or": "ou",
"password": "Mot de passe",
"pin": "Épingler",
@@ -290,7 +291,6 @@
"oldest-first": "Le plus ancien en premier",
"task-actions": {
"check-all": "Vérifiez toutes les tâches",
"title": "Tâches",
"uncheck-all": "Décochez toutes les tâches",
"updated": "Tâches mises à jour"
},
@@ -311,7 +311,6 @@
"back-to": "Retour à {{source}}",
"connections": "Connexions",
"grid-compact-hint": "Les mises en page en grille utilisent toujours des cartes compactes.",
"go-to": "Aller à {{source}}",
"layout": "Mise en page",
"layout-auto": "Automatique",
"layout-auto-description": "Autant de colonnes que l'écran peut en afficher",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Máis",
"name": "Nome",
"nickname": "Alcume",
"open": "Abrir",
"or": "ou",
"password": "Contrasinal",
"pin": "Fixar",
@@ -290,7 +291,6 @@
"oldest-first": "Os máis vellos primeiro",
"task-actions": {
"check-all": "Comprobe todas as tarefas",
"title": "Tarefas",
"uncheck-all": "Desmarque todas as tarefas",
"updated": "Tarefas actualizadas"
},
@@ -311,7 +311,6 @@
"back-to": "Volver a {{source}}",
"connections": "Conexións",
"grid-compact-hint": "Os deseños de cuadrícula sempre usan tarxetas compactas.",
"go-to": "Ir a {{source}}",
"layout": "Deseño",
"layout-auto": "Automático",
"layout-auto-description": "Tantas columnas como axusten á pantalla",
+1 -2
View File
@@ -169,6 +169,7 @@
"name": "שם",
"next-month": "החודש הבא",
"nickname": "כינוי",
"open": "פתח",
"or": "או",
"password": "סיסמה",
"pin": "הצמד",
@@ -360,7 +361,6 @@
"show-more": "הצג עוד",
"task-actions": {
"check-all": "סמן את כל המשימות",
"title": "משימות",
"uncheck-all": "בטל סימון של כל המשימות",
"updated": "המשימות עודכנו"
},
@@ -390,7 +390,6 @@
},
"back-to": "חזרה אל {{source}}",
"connections": "חיבורים",
"go-to": "עבור אל {{source}}",
"on-this-memo": "על תזכיר זה",
"parent-memo": "תזכיר אב"
},
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "अधिक",
"name": "नाम",
"nickname": "उपनाम",
"open": "खोलें",
"or": "या",
"password": "पासवर्ड",
"pin": "पिन करें",
@@ -298,7 +299,6 @@
"count-memos-updated-in-date": "{{count}} {{memos}} को {{date}} पर अपडेट किया गया",
"connections": "कनेक्शन",
"grid-compact-hint": "ग्रिड लेआउट हमेशा कॉम्पैक्ट कार्ड का इस्तेमाल करते हैं।",
"go-to": "{{source}} पर जाएं",
"layout": "लेआउट",
"layout-auto": "ऑटो",
"layout-auto-description": "स्क्रीन में जितने कॉलम फिट हों",
@@ -312,7 +312,6 @@
"parent-memo": "पैरेंट मेमो",
"task-actions": {
"check-all": "सभी टास्क चेक करें",
"title": "टास्क",
"uncheck-all": "सभी टास्क अनचेक करें",
"updated": "टास्क अपडेट किए गए"
},
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Više",
"name": "Ime",
"nickname": "Nadimak",
"open": "Otvori",
"or": "ili",
"password": "Lozinka",
"pin": "Prikvači",
@@ -290,7 +291,6 @@
"oldest-first": "Prvo najstariji",
"task-actions": {
"check-all": "Provjerite sve zadatke",
"title": "Zadaci",
"uncheck-all": "Odznačite sve zadatke",
"updated": "Zadaci ažurirani"
},
@@ -311,7 +311,6 @@
"back-to": "Natrag na {{source}}",
"connections": "Veze",
"grid-compact-hint": "Mrežni rasporedi uvijek koriste kompaktne kartice.",
"go-to": "Idi na {{source}}",
"layout": "Raspored",
"layout-auto": "Automatski",
"layout-auto-description": "Onoliko stupaca koliko stane na zaslon",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Több",
"name": "Név",
"nickname": "Becenév",
"open": "Megnyitás",
"or": "vagy",
"password": "Jelszó",
"pin": "Kitűzés",
@@ -290,7 +291,6 @@
"oldest-first": "Először a legidősebb",
"task-actions": {
"check-all": "Ellenőrizze az összes feladatot",
"title": "Feladatok",
"uncheck-all": "Törölje az összes feladat jelölését",
"updated": "Feladatok frissítve"
},
@@ -311,7 +311,6 @@
"back-to": "Vissza a {{source}}-hez",
"connections": "Kapcsolatok",
"grid-compact-hint": "A rácsos elrendezések mindig kompakt kártyákat használnak.",
"go-to": "Ugrás a {{source}}-hez",
"layout": "Elrendezés",
"layout-auto": "Automatikus",
"layout-auto-description": "Annyi oszlop, amennyi elfér a képernyőn",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Lainnya",
"name": "Nama",
"nickname": "Nama Panggilan",
"open": "Buka",
"or": "atau",
"password": "Kata sandi",
"pin": "Jepit",
@@ -298,7 +299,6 @@
"count-memos-updated-in-date": "{{count}} {{memos}} diperbarui pada {{date}}",
"connections": "Koneksi",
"grid-compact-hint": "Tata letak grid selalu menggunakan kartu ringkas.",
"go-to": "Buka {{source}}",
"layout": "Tata Letak",
"layout-auto": "Otomatis",
"layout-auto-description": "Sebanyak kolom yang sesuai dengan layar",
@@ -312,7 +312,6 @@
"parent-memo": "Memo induk",
"task-actions": {
"check-all": "Centang semua tugas",
"title": "Tugas",
"uncheck-all": "Hapus centang semua tugas",
"updated": "Tugas diperbarui"
},
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Altro",
"name": "Nome",
"nickname": "Nickname",
"open": "Apri",
"or": "oppure",
"password": "Password",
"pin": "Fissa",
@@ -290,7 +291,6 @@
"oldest-first": "Prima il più vecchio",
"task-actions": {
"check-all": "Controlla tutte le attività",
"title": "Compiti",
"uncheck-all": "Deseleziona tutte le attività",
"updated": "Attività aggiornate"
},
@@ -311,7 +311,6 @@
"back-to": "Torna a {{source}}",
"connections": "Connessioni",
"grid-compact-hint": "I layout a griglia utilizzano sempre schede compatte.",
"go-to": "Vai a {{source}}",
"layout": "Layout",
"layout-auto": "Automatico",
"layout-auto-description": "Tante colonne quante ne possono entrare nello schermo",
+1 -2
View File
@@ -97,6 +97,7 @@
"name": "名前",
"next-month": "翌月",
"nickname": "ニックネーム",
"open": "開く",
"or": "もしくは",
"password": "パスワード",
"pin": "ピン",
@@ -299,7 +300,6 @@
"oldest-first": "古い順",
"task-actions": {
"check-all": "すべてのタスクをチェックする",
"title": "タスク",
"uncheck-all": "すべてのタスクのチェックを外します",
"updated": "タスクが更新されました"
},
@@ -319,7 +319,6 @@
},
"back-to": "{{source}}に戻る",
"connections": "接続",
"go-to": "{{source}}へ移動",
"on-this-memo": "このメモについて",
"parent-memo": "親メモ"
},
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "მეტი",
"name": "სახელი",
"nickname": "მეტსახელი",
"open": "გახსნა",
"or": "ან",
"password": "პაროლი",
"pin": "პინი",
@@ -290,7 +291,6 @@
"oldest-first": "ჯერ ყველაზე ძველი",
"task-actions": {
"check-all": "შეამოწმეთ ყველა დავალება",
"title": "ამოცანები",
"uncheck-all": "მოხსენით ყველა დავალება",
"updated": "ამოცანები განახლებულია"
},
@@ -311,7 +311,6 @@
"back-to": "დაბრუნება {{source}}-ზე",
"connections": "კავშირები",
"grid-compact-hint": "ბადისებრი განლაგებები ყოველთვის კომპაქტურ ბარათებს იყენებს.",
"go-to": "გადასვლა {{source}}-ზე",
"layout": "განლაგება",
"layout-auto": "ავტომატური",
"layout-auto-description": "ეკრანზე რამდენიც უნდა მოთავსდეს",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "더보기",
"name": "이름",
"nickname": "닉네임",
"open": "열기",
"or": "또는",
"password": "비밀번호",
"pin": "고정",
@@ -298,7 +299,6 @@
"count-memos-updated-in-date": "{{count}} {{memos}}이 {{date}}에 업데이트되었습니다.",
"connections": "연결",
"grid-compact-hint": "그리드 레이아웃은 항상 컴팩트 카드를 사용합니다.",
"go-to": "{{source}}으로 이동",
"layout": "레이아웃",
"layout-auto": "자동",
"layout-auto-description": "화면에 맞는 열 개수",
@@ -312,7 +312,6 @@
"parent-memo": "상위 메모",
"task-actions": {
"check-all": "모든 작업 선택",
"title": "작업",
"uncheck-all": "모든 작업 선택 해제",
"updated": "작업 업데이트됨"
},
+1 -2
View File
@@ -133,6 +133,7 @@
"more": "Daugiau",
"name": "Vardas",
"nickname": "Slapyvardis",
"open": "Atidaryti",
"or": "arba",
"password": "Slaptažodis",
"pin": "Smeigtukas",
@@ -318,7 +319,6 @@
"show-more": "Rodyti daugiau",
"task-actions": {
"check-all": "Patikrinkite visas užduotis",
"title": "Užduotys",
"uncheck-all": "Panaikinkite visų užduočių žymėjimą",
"updated": "Užduotys atnaujintos"
},
@@ -349,7 +349,6 @@
"back-to": "Atgal į {{source}}",
"connections": "Ryšiai",
"grid-compact-hint": "Tinklelio išdėstymuose visada naudojamos kompaktiškos kortelės.",
"go-to": "Eiti į {{source}}",
"layout": "Išdėstymas",
"layout-auto": "Automatinis",
"layout-auto-description": "Tiek stulpelių, kiek telpa ekrane",
+1 -2
View File
@@ -133,6 +133,7 @@
"more": "Vairāk",
"name": "Vārds",
"nickname": "Segvārds",
"open": "Atvērt",
"or": "vai",
"password": "Parole",
"pin": "Piespraust",
@@ -318,7 +319,6 @@
"show-more": "Rādīt vairāk",
"task-actions": {
"check-all": "Pārbaudiet visus uzdevumus",
"title": "Uzdevumi",
"uncheck-all": "Noņemiet atzīmi no visiem uzdevumiem",
"updated": "Uzdevumi atjaunināti"
},
@@ -349,7 +349,6 @@
"back-to": "Atpakaļ uz {{source}}",
"connections": "Savienojumi",
"grid-compact-hint": "Režģa izkārtojumos vienmēr tiek izmantotas kompaktas kartes.",
"go-to": "Dodieties uz {{source}}",
"layout": "Izkārtojums",
"layout-auto": "Automātiski",
"layout-auto-description": "Tik daudz kolonnu, cik ietilpst ekrānā",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "अधिक",
"name": "नाव",
"nickname": "टोपणनाव",
"open": "उघडा",
"or": "किंवा",
"password": "गुप्त शब्द",
"pin": "पिन",
@@ -298,7 +299,6 @@
"count-memos-updated-in-date": "{{count}} {{memos}} हे {{date}} वर अद्यतनित केले",
"connections": "जोडण्या",
"grid-compact-hint": "ग्रिड लेआउटमध्ये नेहमी संक्षिप्त कार्ड वापरले जातात.",
"go-to": "{{source}} वर जा",
"layout": "लेआउट",
"layout-auto": "ऑटो",
"layout-auto-description": "स्क्रीनवर मावतील तितके स्तंभ",
@@ -312,7 +312,6 @@
"parent-memo": "पालक मेमो",
"task-actions": {
"check-all": "सर्व कार्ये तपासा",
"title": "कार्ये",
"uncheck-all": "सर्व कार्ये निवड रद्द करा",
"updated": "कार्ये अद्यतनित केली"
},
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Mer",
"name": "Navn",
"nickname": "Kallenavn",
"open": "Åpne",
"or": "eller",
"password": "Passord",
"pin": "Fest",
@@ -290,7 +291,6 @@
"oldest-first": "Eldste først",
"task-actions": {
"check-all": "Sjekk alle oppgaver",
"title": "Oppgaver",
"uncheck-all": "Fjern merket for alle oppgaver",
"updated": "Oppgaver oppdatert"
},
@@ -311,7 +311,6 @@
"back-to": "Tilbake til {{source}}",
"connections": "Tilkoblinger",
"grid-compact-hint": "Rutenettoppsett bruker alltid kompakte kort.",
"go-to": "Gå til {{source}}",
"layout": "Oppsett",
"layout-auto": "Auto",
"layout-auto-description": "Så mange kolonner som får plass på skjermen",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Meer",
"name": "Naam",
"nickname": "Bijnaam",
"open": "Openen",
"or": "of",
"password": "Wachtwoord",
"pin": "Vastzetten",
@@ -290,7 +291,6 @@
"oldest-first": "Oudste eerst",
"task-actions": {
"check-all": "Controleer alle taken",
"title": "Taken",
"uncheck-all": "Schakel alle taken uit",
"updated": "Taken bijgewerkt"
},
@@ -311,7 +311,6 @@
"back-to": "Terug naar {{source}}",
"connections": "Verbindingen",
"grid-compact-hint": "Rasterindelingen gebruiken altijd compacte kaarten.",
"go-to": "Ga naar {{source}}",
"layout": "Indeling",
"layout-auto": "Automatisch",
"layout-auto-description": "Zoveel kolommen als er op het scherm passen",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Więcej",
"name": "Nazwa",
"nickname": "Pseudonim",
"open": "Otwórz",
"or": "lub",
"password": "Hasło",
"pin": "Przypnij",
@@ -291,7 +292,6 @@
"oldest-first": "Najpierw najstarszy",
"task-actions": {
"check-all": "Sprawdź wszystkie zadania",
"title": "Zadania",
"uncheck-all": "Odznacz wszystkie zadania",
"updated": "Zadania zaktualizowane"
},
@@ -311,7 +311,6 @@
"back-to": "Powrót do {{source}}",
"connections": "Połączenia",
"grid-compact-hint": "Układy siatki zawsze korzystają z kart kompaktowych.",
"go-to": "Przejdź do {{source}}",
"layout": "Układ",
"layout-auto": "Automatycznie",
"layout-auto-description": "Tyle kolumn, ile mieści się na ekranie",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Mais",
"name": "Nome",
"nickname": "Apelido",
"open": "Abrir",
"or": "ou",
"password": "Senha",
"pin": "Fixar",
@@ -298,7 +299,6 @@
"count-memos-updated-in-date": "{{count}} {{memos}} atualizado em {{date}}",
"connections": "Conexões",
"grid-compact-hint": "Os layouts de grade sempre usam cartões compactos.",
"go-to": "Ir para {{source}}",
"layout": "Layout",
"layout-auto": "Automático",
"layout-auto-description": "Quantas colunas couberem na tela",
@@ -312,7 +312,6 @@
"parent-memo": "Memorando pai",
"task-actions": {
"check-all": "Verificar todas as tarefas",
"title": "Tarefas",
"uncheck-all": "Desmarcar todas as tarefas",
"updated": "Tarefas atualizadas"
},
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Mais",
"name": "Nome",
"nickname": "Apelido",
"open": "Abrir",
"or": "ou",
"password": "Palavra-passe",
"pin": "Afixar",
@@ -290,7 +291,6 @@
"oldest-first": "Mais antigo primeiro",
"task-actions": {
"check-all": "Verifique todas as tarefas",
"title": "Tarefas",
"uncheck-all": "Desmarque todas as tarefas",
"updated": "Tarefas atualizadas"
},
@@ -311,7 +311,6 @@
"back-to": "Voltar para {{source}}",
"connections": "Ligações",
"grid-compact-hint": "Os layouts de grelha utilizam sempre cartões compactos.",
"go-to": "Ir para {{source}}",
"layout": "Layout",
"layout-auto": "Automático",
"layout-auto-description": "Quantas colunas couberem no ecrã",
+1 -2
View File
@@ -133,6 +133,7 @@
"more": "Mai mult",
"name": "Nume",
"nickname": "Pseudonim",
"open": "Deschide",
"or": "sau",
"password": "Parolă",
"pin": "Pin",
@@ -318,7 +319,6 @@
"show-more": "Arată mai multe",
"task-actions": {
"check-all": "Verificați toate sarcinile",
"title": "Sarcini",
"uncheck-all": "Debifați toate sarcinile",
"updated": "Sarcini actualizate"
},
@@ -349,7 +349,6 @@
"back-to": "Înapoi la {{source}}",
"connections": "Conexiuni",
"grid-compact-hint": "Aspectele de tip grilă utilizează întotdeauna carduri compacte.",
"go-to": "Mergi la {{source}}",
"layout": "Aspect",
"layout-auto": "Automat",
"layout-auto-description": "Atâtea coloane câte se potrivesc pe ecran",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Еще",
"name": "Название",
"nickname": "Псевдоним",
"open": "Открыть",
"or": "или",
"password": "Пароль",
"pin": "Закрепить",
@@ -290,7 +291,6 @@
"oldest-first": "Сначала самый старый",
"task-actions": {
"check-all": "Проверьте все задачи",
"title": "Задачи",
"uncheck-all": "Снимите галочки со всех задач",
"updated": "Задачи обновлены"
},
@@ -319,7 +319,6 @@
},
"back-to": "Назад к {{source}}",
"connections": "Подключения",
"go-to": "Перейти к {{source}}",
"on-this-memo": "К этой заметке",
"parent-memo": "Родительская заметка"
},
+1 -2
View File
@@ -133,6 +133,7 @@
"more": "Viac",
"name": "Meno",
"nickname": "prezývka",
"open": "Otvoriť",
"or": "alebo",
"password": "heslo",
"pin": "Pin",
@@ -318,7 +319,6 @@
"show-more": "Ukáž viac",
"task-actions": {
"check-all": "Skontrolujte všetky úlohy",
"title": "Úlohy",
"uncheck-all": "Zrušte začiarknutie všetkých úloh",
"updated": "Úlohy aktualizované"
},
@@ -349,7 +349,6 @@
"back-to": "Späť na {{source}}",
"connections": "Pripojenia",
"grid-compact-hint": "Mriežkové rozloženia vždy používajú kompaktné karty.",
"go-to": "Prejsť na {{source}}",
"layout": "Rozloženie",
"layout-auto": "Automaticky",
"layout-auto-description": "Toľko stĺpcov, koľko sa zmestí na obrazovku",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Več",
"name": "Ime",
"nickname": "Nadimek",
"open": "Odpri",
"or": "ali",
"password": "Geslo",
"pin": "Pripni",
@@ -290,7 +291,6 @@
"oldest-first": "Najprej najstarejši",
"task-actions": {
"check-all": "Preverite vse naloge",
"title": "Naloge",
"uncheck-all": "Odkljukajte vse naloge",
"updated": "Naloge posodobljene"
},
@@ -311,7 +311,6 @@
"back-to": "Nazaj na {{source}}",
"connections": "Povezave",
"grid-compact-hint": "Mrežne postavitve vedno uporabljajo kompaktne kartice.",
"go-to": "Pojdi na {{source}}",
"layout": "Postavitev",
"layout-auto": "Samodejno",
"layout-auto-description": "Toliko stolpcev, kolikor se prilega zaslonu",
+1 -2
View File
@@ -133,6 +133,7 @@
"more": "Више",
"name": "Име",
"nickname": "Надимак",
"open": "Отвори",
"or": "или",
"password": "Лозинка",
"pin": "Пин",
@@ -318,7 +319,6 @@
"show-more": "Покажи више",
"task-actions": {
"check-all": "Проверите све задатке",
"title": "Задаци",
"uncheck-all": "Поништите избор свих задатака",
"updated": "Задаци су ажурирани"
},
@@ -349,7 +349,6 @@
"back-to": "Назад на {{source}}",
"connections": "Везе",
"grid-compact-hint": "Распореди мреже увек користе компактне картице.",
"go-to": "Иди на {{source}}",
"layout": "Распоред",
"layout-auto": "Аутоматски",
"layout-auto-description": "Колико год колона стане на екран",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Mer",
"name": "Namn",
"nickname": "Smeknamn",
"open": "Öppna",
"or": "eller",
"password": "Lösenord",
"pin": "Fäst",
@@ -290,7 +291,6 @@
"oldest-first": "Äldst först",
"task-actions": {
"check-all": "Kontrollera alla uppgifter",
"title": "Uppgifter",
"uncheck-all": "Avmarkera alla uppgifter",
"updated": "Uppgifter uppdaterade"
},
@@ -311,7 +311,6 @@
"back-to": "Tillbaka till {{source}}",
"connections": "Anslutningar",
"grid-compact-hint": "Rutnätslayouter använder alltid kompakta kort.",
"go-to": "Gå till {{source}}",
"layout": "Layout",
"layout-auto": "Auto",
"layout-auto-description": "Så många kolumner som får plats på skärmen",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "เพิ่มเติม",
"name": "ชื่อ",
"nickname": "ชื่อเล่น",
"open": "เปิด",
"or": "หรือ",
"password": "รหัสผ่าน",
"pin": "ปักหมุด",
@@ -298,7 +299,6 @@
"count-memos-updated-in-date": "{{count}} {{memos}} อัปเดตเมื่อ {{date}}",
"connections": "การเชื่อมต่อ",
"grid-compact-hint": "รูปแบบตารางจะใช้การ์ดแบบกะทัดรัดเสมอ",
"go-to": "ไปที่ {{source}}",
"layout": "รูปแบบการจัดวาง",
"layout-auto": "อัตโนมัติ",
"layout-auto-description": "จำนวนคอลัมน์มากที่สุดเท่าที่จะพอดีกับหน้าจอ",
@@ -312,7 +312,6 @@
"parent-memo": "บันทึกหลัก",
"task-actions": {
"check-all": "ตรวจสอบงานทั้งหมด",
"title": "งาน",
"uncheck-all": "ยกเลิกการเลือกงานทั้งหมด",
"updated": "อัปเดตงานแล้ว"
},
+1 -2
View File
@@ -124,6 +124,7 @@
"name": "İsim",
"next-month": "Sonraki ay",
"nickname": "Takma Ad",
"open": "Aç",
"or": "veya",
"password": "Şifre",
"pin": "Sabitle",
@@ -284,7 +285,6 @@
"compact-mode": "Kompakt mod",
"connections": "Bağlantılar",
"grid-compact-hint": "Izgara düzenleri her zaman kompakt kartlar kullanır.",
"go-to": "Git: {{source}}",
"layout": "Düzen",
"layout-auto": "Otomatik",
"layout-auto-description": "Ekrana sığdığı kadar sütun",
@@ -343,7 +343,6 @@
"on-this-memo": "Bu notta",
"task-actions": {
"check-all": "Tüm görevleri kontrol et",
"title": "Görevler",
"uncheck-all": "Tüm görevlerin işaretini kaldırın",
"updated": "Görevler güncellendi"
}
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Більше",
"name": "Назва",
"nickname": "Нікнейм",
"open": "Відкрити",
"or": "або",
"password": "Пароль",
"pin": "Закріпити",
@@ -290,7 +291,6 @@
"oldest-first": "Спочатку найстаріші",
"task-actions": {
"check-all": "Перевірити всі завдання",
"title": "завдання",
"uncheck-all": "Зніміть галочки з усіх завдань",
"updated": "Завдання оновлено"
},
@@ -311,7 +311,6 @@
"back-to": "Назад до {{source}}",
"connections": "З'єднання",
"grid-compact-hint": "Макети сітки завжди використовують компактні картки.",
"go-to": "Перейти до {{source}}",
"layout": "Макет",
"layout-auto": "Авто",
"layout-auto-description": "Стільки стовпців, скільки поміщається на екран",
+1 -2
View File
@@ -94,6 +94,7 @@
"more": "Thêm",
"name": "Tên",
"nickname": "Biệt danh",
"open": "Mở",
"or": "hoặc",
"password": "Mật khẩu",
"pin": "Ghim",
@@ -298,7 +299,6 @@
"count-memos-updated-in-date": "{{count}} {{memos}} được cập nhật vào {{date}}",
"connections": "Kết nối",
"grid-compact-hint": "Bố cục lưới luôn sử dụng thẻ nhỏ gọn.",
"go-to": "Chuyển đến {{source}}",
"layout": "Bố cục",
"layout-auto": "Tự động",
"layout-auto-description": "Số cột tùy ý cho vừa màn hình",
@@ -312,7 +312,6 @@
"parent-memo": "Ghi chú cha",
"task-actions": {
"check-all": "Chọn tất cả nhiệm vụ",
"title": "Nhiệm vụ",
"uncheck-all": "Bỏ chọn tất cả nhiệm vụ",
"updated": "Nhiệm vụ đã được cập nhật"
},
+1 -2
View File
@@ -130,6 +130,7 @@
"name": "名称",
"next-month": "下个月",
"nickname": "昵称",
"open": "打开",
"or": "或者",
"password": "密码",
"pin": "置顶",
@@ -271,7 +272,6 @@
"compact-mode": "紧凑模式",
"connections": "关联",
"grid-compact-hint": "网格布局始终使用紧凑卡片。",
"go-to": "前往{{source}}",
"layout": "布局",
"layout-auto": "自动",
"layout-auto-description": "根据屏幕宽度显示尽可能多的列",
@@ -330,7 +330,6 @@
"count-memos-updated-in-date": "{{date}} 更新了 {{count}} 条{{memos}}",
"task-actions": {
"check-all": "全部完成",
"title": "任务",
"uncheck-all": "全部取消完成",
"updated": "任务已更新"
},
+1 -2
View File
@@ -176,6 +176,7 @@
"name": "名稱",
"next-month": "下個月",
"nickname": "暱稱",
"open": "開啟",
"or": "或",
"password": "密碼",
"pin": "置頂",
@@ -367,7 +368,6 @@
"show-more": "查看更多",
"task-actions": {
"check-all": "勾選所有待辦事項",
"title": "待辦事項",
"uncheck-all": "取消勾選所有待辦事項",
"updated": "待辦事項已更新"
},
@@ -397,7 +397,6 @@
},
"back-to": "返回 {{source}}",
"connections": "關聯",
"go-to": "轉到 {{source}}",
"on-this-memo": "在此備忘錄中",
"parent-memo": "原始備忘錄"
},
-5
View File
@@ -28,7 +28,6 @@ const MemoSidebarRegistration = ({
parentStatus,
onParentRetry,
from,
hasExplicitOrigin,
commentCount,
readonly,
onEdit,
@@ -41,7 +40,6 @@ const MemoSidebarRegistration = ({
parentStatus?: MemoParentStatus;
onParentRetry?: () => void;
from: string;
hasExplicitOrigin: boolean;
commentCount?: number;
readonly: boolean;
onEdit: () => void;
@@ -58,7 +56,6 @@ const MemoSidebarRegistration = ({
parentStatus,
onParentRetry,
from,
hasExplicitOrigin,
commentCount,
readonly,
onEdit,
@@ -69,7 +66,6 @@ const MemoSidebarRegistration = ({
}, [
commentCount,
from,
hasExplicitOrigin,
memo,
onCommentCreate,
onCommentsOpen,
@@ -233,7 +229,6 @@ const MemoDetail = () => {
parentStatus={parentStatus}
onParentRetry={handleParentRetry}
from={parentPage}
hasExplicitOrigin={hasExplicitOrigin}
commentCount={isShareMode ? undefined : commentCount}
readonly={isShareMode}
onEdit={handleEdit}
+112 -58
View File
@@ -1,12 +1,14 @@
import { create } from "@bufbuild/protobuf";
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
import { MemoryRouter, useLocation } from "react-router-dom";
import { beforeEach, describe, expect, it, vi } from "vitest";
import MemoActionMenu from "@/components/MemoActionMenu";
import { State } from "@/types/proto/api/v1/common_pb";
import { MemoSchema } from "@/types/proto/api/v1/memo_service_pb";
import { type Memo, MemoSchema } from "@/types/proto/api/v1/memo_service_pb";
const handlers = vi.hoisted(() => ({
canMove: true,
isInMemoDetailPage: false,
handleTogglePinMemoBtnClick: vi.fn(),
handleEditMemoClick: vi.fn(),
handleToggleMemoStatusClick: vi.fn(),
@@ -34,87 +36,139 @@ vi.mock("@/utils/i18n", () => ({
useTranslate: () => (key: string) => key,
}));
const LocationProbe = () => {
const location = useLocation();
return (
<output data-testid="location">
{location.pathname}|{JSON.stringify(location.state)}
</output>
);
};
const openMenu = async (memo: Memo, props: { readonly?: boolean; parentPage?: string } = {}) => {
render(
<MemoryRouter initialEntries={["/explore"]}>
<MemoActionMenu memo={memo} {...props} />
<LocationProbe />
</MemoryRouter>,
);
fireEvent.click(screen.getByRole("button", { name: "common.more" }));
await screen.findByRole("menuitem", { name: "common.copy" });
};
const menuItemLabels = () => screen.getAllByRole("menuitem").map((item) => item.textContent);
const memoOf = (fields: Parameters<typeof create<typeof MemoSchema>>[1] = {}) =>
create(MemoSchema, { name: "memos/1", state: State.NORMAL, ...fields });
describe("MemoActionMenu", () => {
beforeEach(() => {
vi.clearAllMocks();
handlers.canMove = true;
handlers.canMove = false;
handlers.isInMemoDetailPage = false;
});
it.each(["move", "delete"])("places %s inside More while keeping frequent actions in the main menu", async (action) => {
render(<MemoActionMenu memo={create(MemoSchema, { name: "memos/1", state: State.NORMAL })} />);
fireEvent.click(screen.getByRole("button", { name: "common.more" }));
expect(await screen.findByRole("menuitem", { name: "common.edit" })).toBeInTheDocument();
expect(screen.getByRole("menuitem", { name: "common.archive" })).toBeInTheDocument();
expect(screen.queryByRole("menuitem", { name: "memo.move.title" })).not.toBeInTheDocument();
expect(screen.queryByRole("menuitem", { name: "common.delete" })).not.toBeInTheDocument();
it("orders an owner's memo actions and puts Delete last when Move does not apply", async () => {
await openMenu(memoOf());
expect(menuItemLabels()).toEqual(["common.open", "common.edit", "common.pin", "common.archive", "common.copy", "common.delete"]);
const separators = screen.getAllByRole("separator");
expect(separators[separators.length - 1].nextElementSibling).toBe(screen.getByRole("menuitem", { name: "common.delete" }));
});
it.each(["move", "delete"])("keeps Move and Delete together under More when Move applies (%s)", async (action) => {
handlers.canMove = true;
await openMenu(memoOf());
expect(menuItemLabels()).toEqual(["common.open", "common.edit", "common.pin", "common.archive", "common.copy", "common.more"]);
fireEvent.click(screen.getByRole("menuitem", { name: "common.more" }));
expect(await screen.findByRole("menuitem", { name: "memo.move.title" })).toBeInTheDocument();
expect(screen.getByRole("menuitem", { name: "common.delete" })).toBeInTheDocument();
fireEvent.click(screen.getByRole("menuitem", { name: action === "move" ? "memo.move.title" : "common.delete" }));
fireEvent.click(await screen.findByRole("menuitem", { name: action === "move" ? "memo.move.title" : "common.delete" }));
if (action === "move") expect(await screen.findByRole("dialog", { name: "Move to Space" })).toBeInTheDocument();
else expect(handlers.handleDeleteMemoClick).toHaveBeenCalledOnce();
});
it("omits More when neither action is available", async () => {
handlers.canMove = false;
render(<MemoActionMenu memo={create(MemoSchema, { name: "memos/1", state: State.NORMAL })} readonly />);
fireEvent.click(screen.getByRole("button", { name: "common.more" }));
expect(await screen.findByRole("menuitem", { name: "common.copy" })).toBeInTheDocument();
expect(screen.queryByRole("menuitem", { name: "common.more" })).not.toBeInTheDocument();
it("offers Unpin on a pinned memo", async () => {
await openMenu(memoOf({ pinned: true }));
fireEvent.click(screen.getByRole("menuitem", { name: "common.unpin" }));
expect(handlers.handleTogglePinMemoBtnClick).toHaveBeenCalledOnce();
});
it("shows comment actions with Delete last and no memo organization actions", async () => {
render(<MemoActionMenu memo={create(MemoSchema, { name: "memos/2", parent: "memos/1", state: State.NORMAL })} />);
fireEvent.click(screen.getByRole("button", { name: "common.more" }));
await screen.findByRole("menuitem", { name: "common.edit" });
it("opens the memo through a real link that keeps the origin page", async () => {
await openMenu(memoOf(), { parentPage: "/explore" });
const open = screen.getByRole("menuitem", { name: "common.open" });
expect(open.tagName).toBe("A");
expect(open).toHaveAttribute("href", "/memos/1");
expect(screen.getAllByRole("menuitem").map((item) => item.textContent)).toEqual(["common.edit", "common.copy", "common.delete"]);
expect(screen.getByRole("separator").nextElementSibling).toBe(screen.getByRole("menuitem", { name: "common.delete" }));
fireEvent.click(open);
expect(screen.getByTestId("location")).toHaveTextContent('/memos/1|{"from":"/explore"}');
});
it("hides Open on the memo's own page", async () => {
handlers.isInMemoDetailPage = true;
await openMenu(memoOf());
expect(menuItemLabels()[0]).toBe("common.edit");
});
it.each([
[true, "memo.task-actions.check-all", "handleCheckAllTaskListItemsClick"],
[false, "memo.task-actions.uncheck-all", "handleUncheckAllTaskListItemsClick"],
] as const)("shows one task action after Archive (open tasks: %s)", async (hasIncompleteTasks, label, handler) => {
await openMenu(memoOf({ property: { hasTaskList: true, hasIncompleteTasks } }));
expect(menuItemLabels().slice(3, 5)).toEqual(["common.archive", label]);
fireEvent.click(screen.getByRole("menuitem", { name: label }));
expect(handlers[handler]).toHaveBeenCalledOnce();
});
it.each([
["memo.copy-link", "handleCopyLink"],
["memo.copy-content", "handleCopyContent"],
] as const)("runs %s from the Copy submenu", async (label, handler) => {
await openMenu(memoOf());
fireEvent.click(screen.getByRole("menuitem", { name: "common.copy" }));
fireEvent.click(await screen.findByRole("menuitem", { name: label }));
expect(handlers[handler]).toHaveBeenCalledOnce();
});
it("offers only Restore and Delete on an archived memo", async () => {
handlers.canMove = true;
render(
<MemoryRouter>
<MemoActionMenu memo={memoOf({ state: State.ARCHIVED, property: { hasTaskList: true } })} />
</MemoryRouter>,
);
fireEvent.click(screen.getByRole("button", { name: "common.more" }));
await screen.findByRole("menuitem", { name: "common.restore" });
expect(menuItemLabels()).toEqual(["common.restore", "common.delete"]);
});
it("gives a viewer Open and Copy only", async () => {
await openMenu(memoOf(), { readonly: true });
expect(menuItemLabels()).toEqual(["common.open", "common.copy"]);
});
it.each([
[false, ["common.edit", "common.copy", "common.delete"]],
[true, ["common.edit", "memo.task-actions.check-all", "common.copy", "common.delete"]],
] as const)("shows comment actions without Open, Pin, Archive or More (tasks: %s)", async (hasTaskList, labels) => {
await openMenu(memoOf({ name: "memos/2", parent: "memos/1", property: { hasTaskList, hasIncompleteTasks: hasTaskList } }));
expect(menuItemLabels()).toEqual(labels);
fireEvent.click(screen.getByRole("menuitem", { name: "common.delete" }));
expect(handlers.handleDeleteMemoClick).toHaveBeenCalledOnce();
expect(handlers.confirmDeleteMemo).not.toHaveBeenCalled();
});
it.each([
["memo.copy-link", "handleCopyLink"],
["memo.copy-content", "handleCopyContent"],
] as const)("allows %s on a read-only comment", async (label, handler) => {
render(<MemoActionMenu memo={create(MemoSchema, { name: "memos/2", parent: "memos/1", state: State.NORMAL })} readonly />);
fireEvent.click(screen.getByRole("button", { name: "common.more" }));
await screen.findByRole("menuitem", { name: "common.copy" });
expect(screen.getAllByRole("menuitem").map((item) => item.textContent)).toEqual(["common.copy"]);
fireEvent.click(screen.getByRole("menuitem", { name: "common.copy" }));
fireEvent.click(await screen.findByRole("menuitem", { name: label }));
expect(handlers[handler]).toHaveBeenCalledOnce();
});
it.each([false, true])("only shows task actions on writable task comments (readonly: %s)", async (readonly) => {
const memo = create(MemoSchema, {
name: "memos/2",
parent: "memos/1",
state: State.NORMAL,
property: { hasTaskList: true, hasIncompleteTasks: true },
});
render(<MemoActionMenu memo={memo} readonly={readonly} />);
fireEvent.click(screen.getByRole("button", { name: "common.more" }));
await screen.findByRole("menuitem", { name: "common.copy" });
if (readonly) {
expect(screen.queryByRole("menuitem", { name: "memo.task-actions.title" })).not.toBeInTheDocument();
} else {
fireEvent.click(screen.getByRole("menuitem", { name: "memo.task-actions.title" }));
expect(await screen.findByRole("menuitem", { name: "memo.task-actions.uncheck-all" })).toBeInTheDocument();
fireEvent.click(screen.getByRole("menuitem", { name: "memo.task-actions.check-all" }));
expect(handlers.handleCheckAllTaskListItemsClick).toHaveBeenCalledOnce();
}
it("gives a read-only comment only Copy", async () => {
await openMenu(memoOf({ name: "memos/2", parent: "memos/1" }), { readonly: true });
expect(menuItemLabels()).toEqual(["common.copy"]);
});
it("is a quiet compact control that takes the accent fill while open", async () => {
const memo = create(MemoSchema, { name: "memos/1", state: State.NORMAL, pinned: false });
render(<MemoActionMenu memo={memo} />);
render(
<MemoryRouter>
<MemoActionMenu memo={memo} />
</MemoryRouter>,
);
const trigger = screen.getByRole("button", { name: "common.more" });
expect(trigger).toHaveClass("size-6", "rounded-md", "text-muted-foreground/70", "hover:bg-muted/60", "data-popup-open:bg-accent");
+35 -3
View File
@@ -10,6 +10,14 @@ import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
const mocks = vi.hoisted(() => ({
updateMemo: vi.fn(),
deleteMemo: vi.fn(),
copy: vi.fn(),
spaces: [] as { name: string }[],
}));
vi.mock("copy-to-clipboard", () => ({ default: mocks.copy }));
vi.mock("@/contexts/SpaceContext", () => ({
useSpaceContext: () => ({ spaces: mocks.spaces }),
}));
vi.mock("@/hooks/useMemoQueries", () => ({
@@ -39,15 +47,17 @@ vi.mock("react-hot-toast", () => ({
default: { success: vi.fn(), error: vi.fn() },
}));
const createMemo = (state: State, parent = ""): Memo =>
const createMemo = (state: State, parent = "", space = ""): Memo =>
({
name: "memos/1",
creator: "users/alice",
content: "memo",
state,
parent,
space,
}) as Memo;
const renderActions = (state: State, parent = "", parentPage?: string) => {
const renderActions = (state: State, parent = "", parentPage?: string, space = "") => {
const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false } } });
const invalidateQueries = vi.spyOn(queryClient, "invalidateQueries");
const wrapper = ({ children }: { children: ReactNode }) => (
@@ -60,7 +70,7 @@ const renderActions = (state: State, parent = "", parentPage?: string) => {
() => {
const location = useLocation();
const handlers = useMemoActionHandlers({
memo: createMemo(state, parent),
memo: createMemo(state, parent, space),
parentPage,
setDeleteDialogOpen: vi.fn(),
});
@@ -75,6 +85,8 @@ describe("Memo detail mutation navigation", () => {
beforeEach(() => {
mocks.updateMemo.mockReset().mockResolvedValue(undefined);
mocks.deleteMemo.mockReset().mockResolvedValue(undefined);
mocks.copy.mockReset();
mocks.spaces = [];
});
it.each([
@@ -117,4 +129,24 @@ describe("Memo detail mutation navigation", () => {
expect(invalidateQueries).toHaveBeenCalledWith({ queryKey: ["memos", "memos/parent", "comments"] });
expect(invalidateQueries).toHaveBeenCalledWith({ queryKey: ["memos", "memos/parent", "detail"] });
});
it.each([
["", "http://localhost:3000/memos/1"],
["memos/parent", "http://localhost:3000/memos/parent#1"],
])("copies a link that lands on the memo, or on the comment inside its parent (parent: %s)", (parent, link) => {
const { result } = renderActions(State.NORMAL, parent);
act(() => result.current.handlers.handleCopyLink());
expect(mocks.copy).toHaveBeenCalledWith(link);
});
it.each([
["no Space and not in one", [], "", "", false],
["a Space to move to", [{ name: "spaces/product" }], "", "", true],
["a memo already in a Space", [], "spaces/product", "", true],
["a comment", [{ name: "spaces/product" }], "", "memos/parent", false],
] as const)("offers Move only when it applies: %s", (_, spaces, space, parent, expected) => {
mocks.spaces = [...spaces];
const { result } = renderActions(State.NORMAL, parent, undefined, space);
expect(result.current.handlers.canMove).toBe(expected);
});
});
+3 -11
View File
@@ -46,11 +46,11 @@ describe("MemoDetailSidebar", () => {
currentUserState.value = { name: "users/alice" };
});
it("returns to the scoped map with its filters, viewport, and selection", () => {
it("leaves returning to the origin to browser back and the app navigation", () => {
const parentPage = "/spaces/travel/map?filter=tagSearch%3Atravel&lat=35&lng=135&zoom=12&memo=memos%2Fdetail";
renderSidebar(<MemoDetailSidebar memo={create(MemoSchema, { name: "memos/detail" })} parentPage={parentPage} hasExplicitOrigin />);
const { container } = renderSidebar(<MemoDetailSidebar memo={create(MemoSchema, { name: "memos/detail" })} parentPage={parentPage} />);
expect(screen.getByRole("link", { name: "memo.back-to:common.map" })).toHaveAttribute("href", parentPage);
expect(container.querySelector(`a[href="${parentPage}"]`)).toBeNull();
});
it("organizes source, in-page navigation, connections, and frequent actions without repeating metadata", async () => {
@@ -90,7 +90,6 @@ describe("MemoDetailSidebar", () => {
memo={memo}
parentMemo={parentMemo}
parentPage="/explore?filter=tagSearch%3Awork"
hasExplicitOrigin
commentCount={3}
onEdit={onEdit}
onCommentsOpen={onCommentsOpen}
@@ -99,7 +98,6 @@ describe("MemoDetailSidebar", () => {
/>,
);
expect(screen.getByRole("link", { name: "memo.back-to:common.explore" })).toHaveAttribute("href", "/explore?filter=tagSearch%3Awork");
expect(screen.getByText("memo.on-this-memo")).toBeInTheDocument();
expect(screen.getByTestId("outline")).toHaveTextContent("2");
expect(screen.getByRole("link", { name: /memo.comment.self/ })).toHaveTextContent("3");
@@ -155,8 +153,6 @@ describe("MemoDetailSidebar", () => {
expect(screen.queryByRole("button", { name: "common.edit" })).not.toBeInTheDocument();
expect(screen.getByRole("button", { name: "memo.comment.write-a-comment" })).toBeInTheDocument();
expect(screen.getByRole("link", { name: "common.referenced-by: Incoming backlink" })).toBeInTheDocument();
expect(screen.getByRole("link", { name: "memo.go-to:common.explore" })).toHaveAttribute("href", "/explore");
});
it("keeps a simple memo useful without rendering empty navigation or connections", () => {
@@ -169,7 +165,6 @@ describe("MemoDetailSidebar", () => {
renderSidebar(<MemoDetailSidebar memo={memo} parentPage="/" commentCount={0} onEdit={vi.fn()} onCommentCreate={vi.fn()} />);
expect(screen.getByRole("link", { name: "memo.go-to:common.home" })).toHaveAttribute("href", "/");
expect(screen.queryByText("memo.on-this-memo")).not.toBeInTheDocument();
expect(screen.queryByText("memo.connections")).not.toBeInTheDocument();
expect(screen.getByRole("button", { name: "common.edit" })).toBeInTheDocument();
@@ -206,7 +201,6 @@ describe("MemoDetailSidebar", () => {
renderSidebar(<MemoDetailSidebar memo={memo} parentPage="/archived" commentCount={2} onEdit={vi.fn()} onCommentCreate={vi.fn()} />);
expect(screen.getByRole("link", { name: "memo.go-to:common.archived" })).toBeInTheDocument();
expect(screen.getByRole("link", { name: /memo.comment.self/ })).toHaveTextContent("2");
expect(screen.queryByRole("button", { name: "common.edit" })).not.toBeInTheDocument();
expect(screen.queryByRole("button", { name: "memo.comment.write-a-comment" })).not.toBeInTheDocument();
@@ -230,7 +224,6 @@ describe("MemoDetailSidebar", () => {
memo={memo}
parentMemo={parentMemo}
parentPage="/explore"
hasExplicitOrigin
commentCount={4}
forceReadonly
onEdit={vi.fn()}
@@ -239,7 +232,6 @@ describe("MemoDetailSidebar", () => {
"/memos/shares/share-token",
);
expect(screen.queryByRole("link", { name: /memo.back-to/ })).not.toBeInTheDocument();
expect(screen.getByText("memo.on-this-memo")).toBeInTheDocument();
expect(screen.getByTestId("outline")).toHaveTextContent("2");
expect(screen.queryByRole("link", { name: /memo.comment.self/ })).not.toBeInTheDocument();
+15 -3
View File
@@ -110,7 +110,7 @@ describe("MemoHeader navigation", () => {
expect(reaction.className).not.toMatch(/border-none|rounded-full|ring-/);
});
it.each([false, true])("uses a keyboard-operable timestamp and preserves origin when showCreator=%s", (showCreator) => {
it.each([false, true])("links the timestamp to the memo and preserves origin when showCreator=%s", (showCreator) => {
if (showCreator) {
state.creator = { username: "alice", displayName: "Alice", avatarUrl: "" };
}
@@ -122,7 +122,8 @@ describe("MemoHeader navigation", () => {
</MemoryRouter>,
);
const timestamp = screen.getByRole("button", { name: "time" });
const timestamp = screen.getByRole("link", { name: "time" });
expect(timestamp).toHaveAttribute("href", "/memos/123");
if (showCreator) expect(screen.getByRole("link", { name: /Alice/ })).toHaveAttribute("href", "/?creator=alice");
timestamp.focus();
expect(timestamp).toHaveFocus();
@@ -131,6 +132,17 @@ describe("MemoHeader navigation", () => {
expect(screen.getByTestId("location")).toHaveTextContent('/memos/123|{"from":"/explore?filter=tagSearch%3Awork"}');
});
it("shows the time as plain text on the memo's own page", () => {
render(
<MemoryRouter initialEntries={["/memos/123"]}>
<MemoHeader />
</MemoryRouter>,
);
expect(screen.queryByRole("link", { name: "time" })).not.toBeInTheDocument();
expect(screen.getByText("time").closest("a, button")).toBeNull();
});
it.each([false, true])("keeps the Space pill beside the timestamp when showCreator=%s", (showCreator) => {
if (showCreator) {
state.creator = { username: "alice", displayName: "Alice", avatarUrl: "" };
@@ -142,7 +154,7 @@ describe("MemoHeader navigation", () => {
</MemoryRouter>,
);
const timestamp = screen.getByRole("button", { name: "time" });
const timestamp = screen.getByRole("link", { name: "time" });
const space = screen.getByTestId("memo-space");
const metadata = space.closest('[data-slot="memo-header-meta"]');