{showMeta && meta}
- {showMeta && truncate && (hasContent || hasAttachments) &&
ยท
}
{contentNode}
{hasAttachments &&
(truncate ? (
diff --git a/web/src/components/MemoView/components/MemoCommentListView.tsx b/web/src/components/MemoView/components/MemoCommentListView.tsx
index 8ea58a084..53b621dc8 100644
--- a/web/src/components/MemoView/components/MemoCommentListView.tsx
+++ b/web/src/components/MemoView/components/MemoCommentListView.tsx
@@ -1,23 +1,31 @@
-import { ArrowUpRightIcon } from "lucide-react";
+import { ChevronRightIcon } from "lucide-react";
import { Link } from "react-router-dom";
-import MetadataSection, { METADATA_ROW_CLASSES, METADATA_ROW_SLOT_CLASSES } from "@/components/MemoMetadata/MetadataSection";
+import MetadataSection, { METADATA_COMPACT_ROW_CLASSES, METADATA_ROW_SLOT_CLASSES } from "@/components/MemoMetadata/MetadataSection";
import { MemoPreview } from "@/components/MemoPreview";
-import { buttonVariants } from "@/components/ui/button";
+import { FOCUS_VISIBLE_OUTLINE_CLASSES } from "@/components/ui/focus";
import { useMemoComments } from "@/hooks/useMemoQueries";
import { useNearViewport } from "@/hooks/useNearViewport";
import { useUsersByNames } from "@/hooks/useUserQueries";
import { MEMO_COMMENTS_ANCHOR_ID } from "@/lib/memo-comments";
import { extractMemoIdFromName } from "@/lib/resource-names";
+import { cn } from "@/lib/utils";
import { useTranslate } from "@/utils/i18n";
import UserAvatar from "../../UserAvatar";
import { useMemoViewContext, useMemoViewDerived } from "../MemoViewContext";
import { createMemoNavigationState } from "../navigation";
-const VIEW_ALL_CLASSES = buttonVariants({ variant: "quiet", size: "sm" });
+/**
+ * "View all" speaks at the header's scale: 11px muted ink in a box as tall as the compact
+ * header, so it sits on the title's line instead of stretching it.
+ */
+const VIEW_ALL_CLASSES = cn(
+ "inline-flex h-5 items-center gap-0.5 rounded-md px-2 text-2xs text-muted-foreground/60 transition-colors hover:bg-muted/60 hover:text-foreground",
+ FOCUS_VISIBLE_OUTLINE_CLASSES,
+);
/**
- * The comment strip hangs off the card's bottom edge: a titled list of up to three
- * comments, each a row whose avatar sits in the leading slot on the card's text edge.
+ * The comment strip hangs off the card's bottom edge: a compact titled list of up to three
+ * comments, each a 24px row whose avatar sits in the leading slot on the card's text edge.
*/
const MemoCommentListView: React.FC = () => {
const t = useTranslate();
@@ -38,14 +46,15 @@ const MemoCommentListView: React.FC = () => {
}
return (
-
+
{t("common.view-all")}
-
+
}
>
@@ -58,7 +67,7 @@ const MemoCommentListView: React.FC = () => {
to={`/${memo.name}#${uid}`}
state={createMemoNavigationState(parentPage)}
viewTransition
- className={METADATA_ROW_CLASSES}
+ className={METADATA_COMPACT_ROW_CLASSES}
>
diff --git a/web/tests/memo-action-menu.test.tsx b/web/tests/memo-action-menu.test.tsx
index 79e8254a3..fb10ec321 100644
--- a/web/tests/memo-action-menu.test.tsx
+++ b/web/tests/memo-action-menu.test.tsx
@@ -62,9 +62,9 @@ describe("MemoActionMenu", () => {
handlers.isInMemoDetailPage = false;
});
- it("orders an owner's memo actions and puts Delete last, with no Move entry", async () => {
+ it("groups an owner's memo actions by what they do to the card and puts Delete last, with no Move entry", async () => {
await openMenu(memoOf({ space: "spaces/work" }));
- expect(menuItemLabels()).toEqual(["common.open", "common.edit", "common.pin", "common.archive", "common.copy", "common.delete"]);
+ expect(menuItemLabels()).toEqual(["common.edit", "common.pin", "common.archive", "common.open", "common.copy", "common.delete"]);
const separators = screen.getAllByRole("separator");
expect(separators[separators.length - 1].nextElementSibling).toBe(screen.getByRole("menuitem", { name: "common.delete" }));
});
@@ -88,15 +88,15 @@ describe("MemoActionMenu", () => {
it("hides Open on the memo's own page", async () => {
handlers.isInMemoDetailPage = true;
await openMenu(memoOf());
- expect(menuItemLabels()[0]).toBe("common.edit");
+ expect(menuItemLabels()).toEqual(["common.edit", "common.pin", "common.archive", "common.copy", "common.delete"]);
});
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) => {
+ ] as const)("shows one task action right after Edit (open tasks: %s)", async (hasIncompleteTasks, label, handler) => {
await openMenu(memoOf({ property: { hasTaskList: true, hasIncompleteTasks } }));
- expect(menuItemLabels().slice(3, 5)).toEqual(["common.archive", label]);
+ expect(menuItemLabels().slice(0, 3)).toEqual(["common.edit", label, "common.pin"]);
fireEvent.click(screen.getByRole("menuitem", { name: label }));
expect(handlers[handler]).toHaveBeenCalledOnce();
});