From 2dc197a905001f65127774fde3ceb02e0e2cfc8f Mon Sep 17 00:00:00 2001
From: Quick104 <31828688+Quick104@users.noreply.github.com>
Date: Fri, 20 Nov 2026 23:19:29 -0500
Subject: [PATCH] fix(web): keep restore names that can't wrap inside their box
A name holding a run no line break can split, such as emoji joined by
zero-width joiners, ran past its box on the backup restore screens: the
Choose step's library heading and its summary panel, the Review step's
plan sentences and left-out list, and the Run report's item and profile
lines. In the summary panel the sentence also set the width of the
phone layout's only column, so every section ran past the screen.
Each of these now clips such a run sideways at its edge, as the profile
rows do since #4755. The summary panel no longer widens the column, and
its sentences wrap like the Review step's. Every other name renders as
before.
Co-Authored-By: Claude Opus 5.5
---
web/src/pages/admin-backups/RestoreChoose.tsx | 28 ++++++-----
web/src/pages/admin-backups/RestoreReview.tsx | 47 ++++++++++++++++---
web/src/pages/admin-backups/RestoreRun.tsx | 17 +++++--
3 files changed, 68 insertions(+), 24 deletions(-)
diff --git a/web/src/pages/admin-backups/RestoreChoose.tsx b/web/src/pages/admin-backups/RestoreChoose.tsx
index 9e1bdf8031..3e2c9a1539 100644
--- a/web/src/pages/admin-backups/RestoreChoose.tsx
+++ b/web/src/pages/admin-backups/RestoreChoose.tsx
@@ -29,6 +29,7 @@ import { SettingFieldStatus } from "@/pages/admin-settings/SettingField";
import { OmittedAccounts } from "./BackupWarningDetails";
import { Disclosure } from "./Disclosure";
+import { PlanSentences } from "./RestoreReview";
import { ItemRow, SameRow, type ToggleKeys } from "./RestoreRows";
import { AccountRow, DataTypesPanel } from "./RestoreUsers";
import {
@@ -240,13 +241,20 @@ function LibraryGroupRows({
open={open}
onOpenChange={setOpen}
controls={listId}
- className="text-foreground gap-1.5 text-[13px] font-medium"
+ className="text-foreground max-w-full gap-1.5 text-[13px] font-medium"
>
{/* One run of text, so the count follows the name's last word. A name
with no spaces still breaks to fit. The name keeps its own direction,
so a name in another script can't pull the count across it. The count
- is an inline block, so it moves to the next line whole. */}
-
+ is an inline block, so it moves to the next line whole. The button and
+ the text stay within the row, which clips sideways the part of a name
+ that can't wrap, such as one long run of joined emoji. The 0.25em of
+ padding, offset by a negative margin, keeps letters whole whose ink
+ reaches past their edge. */}
+
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx -- a space, not text */}
{name}{" "}
@@ -639,9 +647,11 @@ export function RestoreChoose({
))}
+ {/* min-w-0: on a narrow screen the summary shares the sections' column, so a
+ sentence it can't wrap would otherwise widen every section past the screen. */}
diff --git a/web/src/pages/admin-backups/RestoreReview.tsx b/web/src/pages/admin-backups/RestoreReview.tsx
index ba0704c072..bfd5e62c92 100644
--- a/web/src/pages/admin-backups/RestoreReview.tsx
+++ b/web/src/pages/admin-backups/RestoreReview.tsx
@@ -3,6 +3,7 @@ import { Button } from "@/components/ui/button";
import { Checkbox } from "@/components/ui/checkbox";
import { Label } from "@/components/ui/label";
import { useT } from "@/i18n";
+import { cn } from "@/lib/utils";
import { FieldGroup } from "@/pages/admin-settings/FieldGroup";
import { restoreCaveats, restorePlan, type SelectionKeys } from "./restoreModel";
@@ -37,6 +38,36 @@ export interface RestoreReviewProps {
*/
const REFUSAL_ACTION = "h-auto min-h-8 max-w-full py-1 text-balance whitespace-normal";
+/**
+ * The plan's sentences as a bulleted list, here and in the Choose step's summary. The part
+ * of a name that can't wrap, such as one long run of joined emoji, is clipped sideways at
+ * the list's edge; the words around it still wrap. The clip has 0.25em of padding, offset by
+ * a negative margin, so letters whose ink reaches past their edge stay whole. It sits on the
+ * end side only: the start padding already gives that room and holds the bullets, which
+ * clipping each item would cut off.
+ */
+export function PlanSentences({
+ sentences,
+ className,
+}: {
+ sentences: readonly string[];
+ className?: string;
+}) {
+ const t = useT();
+ return (
+
+ );
+}
+
/** Step 2: the whole plan in sentences, what it leaves out, and the button. */
export function RestoreReview({
set,
@@ -58,11 +89,7 @@ export function RestoreReview({
+ {/* Clips a name that can't wrap like PlanSentences, but on both sides: this list
+ has no start padding or bullets. The name's title shows it in full. */}
+
+ {/* Part of a name that can't wrap, such as one long run of joined emoji, is clipped
+ sideways at the row's edge, in the item's line and in its profiles' lines; the words
+ around it still wrap. The 0.25em of padding, offset by a negative margin, keeps
+ letters whole whose ink reaches past their edge. */}
+
{t("web.admin.backups.restore.run.itemLine", {
- label: displayLabel(item),
+ label,
section: t(SECTION_TITLES[item.section]),
// The status stays whole: no break at its spaces or between its Chinese, Japanese,
// or Korean characters. One wider than the line still breaks, through
@@ -102,7 +107,11 @@ function ReportRow({ item }: { item: RestoreReportItem }) {
// the message's "ยท" at the end of a line.) keeps the direction isolation a
// string value gets in right-to-left languages.
outcome: {nonBreaking(t(outcome.label))},
- b: (chunks) => {chunks},
+ b: (chunks) => (
+
+ {chunks}
+
+ ),
muted: (chunks) => (
{keepSeparatorsWithNext(chunks)}
),
@@ -172,7 +181,7 @@ function AccountReport({
{/* isolates the name's direction. It sits inside the span, so the
margin follows the page's direction, not the name's. */}
- {profile.label}
+ {profile.label}