Skip to content

Commit 44c979a

Browse files
committed
fix(editor): show the rotation tip on 180° only
The tip explains turning the picture upside down; on the 0° option it described the opposite of what the button does.
1 parent 240c62e commit 44c979a

2 files changed

Lines changed: 22 additions & 5 deletions

File tree

‎src/components/ai-edition/EditClipModal.test.tsx‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,26 @@ describe("EditClipModal rotation", () => {
394394
expect(screen.getByRole("button", { name: "Apply" })).toBeDisabled();
395395
});
396396

397+
// The tip explains turning the picture, so it belongs on 180° alone: on 0° it described
398+
// the opposite of what the button does.
399+
it("explains the turn on 180° and leaves 0° without a tip", () => {
400+
renderTurned();
401+
const tooltipOf = (name: string) => {
402+
const button = rotationButton(name);
403+
// A keyboard focus: one the mouse gave opens no tooltip.
404+
fireEvent.keyDown(window, { key: "Tab" });
405+
act(() => button.focus());
406+
const shown = screen.queryByRole("tooltip")?.textContent ?? null;
407+
act(() => button.blur());
408+
return shown;
409+
};
410+
411+
expect(tooltipOf("180°")).toBe(
412+
"Turn the picture upside down, e.g. for a camera mounted overhead",
413+
);
414+
expect(tooltipOf("0°")).toBeNull();
415+
});
416+
397417
it("keeps the stored crop when the rotation is toggled", () => {
398418
const { onApply } = renderTurned();
399419

‎src/components/ai-edition/Modals.tsx‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,11 +1277,8 @@ export function EditClipModal({
12771277
<ChoiceRow<ClipRotation>
12781278
label={t("editClipDialog.rotation")}
12791279
options={[
1280-
{
1281-
value: 0,
1282-
label: t("editClipDialog.rotationUpright"),
1283-
title: t("editClipDialog.rotationTip"),
1284-
},
1280+
// The tip explains the turn, so 0° carries none: its label says all of it.
1281+
{ value: 0, label: t("editClipDialog.rotationUpright") },
12851282
{
12861283
value: 180,
12871284
label: t("editClipDialog.rotationTurned"),

0 commit comments

Comments
 (0)