From ba94def3c8673bce0ea4a60f0feeb7fafe8f3add Mon Sep 17 00:00:00 2001 From: claude code agent 227 Date: Fri, 3 Jul 2026 23:17:22 +0300 Subject: [PATCH] fix(temporary-notes): keep the banner usable on mobile (#321) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On narrow screens the temporary-note banner squeezed its text into a one-word-per-line ladder and overflowing words slid under the subtle "Move to trash" button. Two layout causes, both fixed here (layout-only; no handler/logic/i18n changes): - The text Group had `flex: 1` (= basis 0), so the outer `wrap="wrap"` never wrapped the buttons to a second row — it crushed the text instead. Give it a non-zero basis (`flex: 1 1 16rem`) so the wrap engages on narrow containers. - Mirror DeletedPageBanner's adaptive actions: labeled Buttons visibleFrom="sm", icon-only ActionIcon + Tooltip + aria-label hiddenFrom="sm" (same handlers, loading flags, and t() keys). This also fixes the ru locale, whose long labels no longer render on mobile. The sibling DeletedPageBanner already uses this pattern; adding the second button in #273/#277 didn't carry the adaptive part over. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../page/components/temporary-note-banner.tsx | 92 ++++++++++++++----- 1 file changed, 68 insertions(+), 24 deletions(-) diff --git a/apps/client/src/features/page/components/temporary-note-banner.tsx b/apps/client/src/features/page/components/temporary-note-banner.tsx index f5bef76a..d30087f1 100644 --- a/apps/client/src/features/page/components/temporary-note-banner.tsx +++ b/apps/client/src/features/page/components/temporary-note-banner.tsx @@ -1,4 +1,11 @@ -import { Button, Group, Paper, Text } from "@mantine/core"; +import { + ActionIcon, + Button, + Group, + Paper, + Text, + Tooltip, +} from "@mantine/core"; import { IconClockHour4, IconTrash } from "@tabler/icons-react"; import { useState } from "react"; import { Trans, useTranslation } from "react-i18next"; @@ -70,7 +77,14 @@ export function TemporaryNoteBanner({ slugId }: TemporaryNoteBannerProps) { return ( - + {/* A non-zero flex-basis lets the outer wrap="wrap" drop the buttons to + their own row on narrow screens; flex:1 (basis 0) never wraps and + instead crushes the text into a one-word-per-line ladder. */} + {canEdit && ( - - - - + <> + {/* Desktop: full labeled buttons. */} + + + + + {/* Mobile: icon-only actions so they never overflow the narrow row. */} + + + + + + + + + + + + + )} -- 2.52.0