Skip to content

Commit fc3edfa

Browse files
ryanbarlow97claude
andcommitted
Drop redirects for old skin and drink addresses
Only /drinks stays, because the in-game drink code message names it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent e09eb1a commit fc3edfa

4 files changed

Lines changed: 5 additions & 17 deletions

File tree

‎frontend/app/components/profile/ProfilePanel.test.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ it("falls back to sign-in when a code's session has run out", async () => {
11211121
expect(getSkinsSession()).toBeNull();
11221122
});
11231123

1124-
it("opens the code form for old skin and drink links", async () => {
1124+
it("opens the code form on the Skins and Drinks tabs", async () => {
11251125
vi.mocked(getAccount).mockResolvedValue(null);
11261126
visit("drinks");
11271127
render(<ProfilePanel />);
@@ -1142,7 +1142,7 @@ it("lets a Discord account without a Minecraft link open a wardrobe with a code"
11421142
visit("skins");
11431143
render(<ProfilePanel />);
11441144
const toggle = await screen.findByRole("button", { name: "Enter code" });
1145-
// Old /skins links land here with the form open.
1145+
// The Skins tab opens with the form showing.
11461146
expect(toggle.getAttribute("aria-expanded")).toBe("true");
11471147
fireEvent.change(screen.getByLabelText("Log in with code"), { target: { value: "SKIN-CODE" } });
11481148
fireEvent.click(screen.getByRole("button", { name: "Enter" }));

‎frontend/app/components/profile/ProfilePanel.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export default function ProfilePanel({
206206
const [loggingOut, setLoggingOut] = useState(false);
207207
// Skin and drink codes' sessions, which open just their wardrobes when there's no Profile session.
208208
const [codes, setCodes] = useState<CodeSessions>(NO_CODE_SESSIONS);
209-
// The old /skins and /drinks addresses land on those tabs, from in-game messages about codes.
209+
// The Skins and Drinks tabs open with the code form showing (the in-game drink code message links /drinks).
210210
const [showCode, setShowCode] = useState(tab === "skins" || tab === "drinks");
211211
const codeId = useId();
212212
const panelId = useId();

‎frontend/lib/profile/paths.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import type { ProfileTab } from "./tabs";
22

33
/**
44
* Profile's addresses. A skin or drink opens inside its tab: `?tab=skins&skin=new` is the editor and
5-
* `&skin=<id>` one skin. The old /skins, /drinks and /profile/{skins,drinks}/* addresses redirect here
6-
* (next.config.ts).
5+
* `&skin=<id>` one skin.
76
*/
87
const ITEM_PARAMS: Partial<Record<ProfileTab, "skin" | "drink">> = { skins: "skin", drinks: "drink" };
98

‎frontend/next.config.ts‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,8 @@ const nextConfig: NextConfig = {
2626
{ source: "/account", destination: "/profile?tab=accounts", permanent: false },
2727
// The character list lives on Profile's Characters tab.
2828
{ source: "/character", destination: "/profile", permanent: false },
29-
// Skins and drinks are made and followed inside Profile's tabs. Ids are slugs, so /skins/skin.png
30-
// and /drinks/assets/* (public files) don't match.
31-
{ source: "/skins", destination: "/profile?tab=skins", permanent: false },
32-
{ source: "/skins/:id([a-z][a-z0-9_]{1,47})", destination: "/profile?tab=skins&skin=:id", permanent: false },
29+
// The in-game /token create drink message sends players to /drinks.
3330
{ source: "/drinks", destination: "/profile?tab=drinks", permanent: false },
34-
{ source: "/drinks/:id([a-z][a-z0-9_]{1,47})", destination: "/profile?tab=drinks&drink=:id", permanent: false },
35-
// Their old pages under Profile; "new" is the editor. The drinks dev preview keeps its page.
36-
{ source: "/profile/skins/:id", destination: "/profile?tab=skins&skin=:id", permanent: false },
37-
{
38-
source: "/profile/drinks/:id((?!dev-preview$)[^/]+)",
39-
destination: "/profile?tab=drinks&drink=:id",
40-
permanent: false,
41-
},
4231
// Staff tools that moved into the staff panel.
4332
{ source: "/precedent", destination: "/admin/precedent", permanent: false },
4433
{ source: "/inspect", destination: "/admin/codes", permanent: false },

0 commit comments

Comments
 (0)