From 7d06ea04fece85c1a56bf9c62b5330380c3a70c5 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 22 Aug 2026 00:05:32 +0000 Subject: [PATCH] r3dr: mint i.iili.uk short links; iili joins Elsewhere MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Short links moved to i.iili.uk (Caddy on the consolidated host -> r3dr_v2; MoonBase#1432) — the SPA at iili.uk no longer answers /r/*. Update the mint base and the tests that pin the minted shape, and add the standalone iili.uk site to the Elsewhere menu. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01ST7XLGWstRE4CfUF84ijKD --- src/apps/r3dr/__tests__/CopyButton.test.tsx | 2 +- src/apps/r3dr/__tests__/R3drPage.test.tsx | 4 ++-- src/apps/r3dr/__tests__/ShortenCard.test.tsx | 4 ++-- src/apps/r3dr/__tests__/api.test.ts | 6 +++--- src/apps/r3dr/api.ts | 7 ++++--- src/shared/components/Navigation.tsx | 1 + src/shared/components/__tests__/Navigation.test.tsx | 1 + 7 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/apps/r3dr/__tests__/CopyButton.test.tsx b/src/apps/r3dr/__tests__/CopyButton.test.tsx index 2693261..e568571 100644 --- a/src/apps/r3dr/__tests__/CopyButton.test.tsx +++ b/src/apps/r3dr/__tests__/CopyButton.test.tsx @@ -12,7 +12,7 @@ function stubClipboard(writeText: (text: string) => Promise) { }) } -const TEXT = 'https://iili.uk/r/AQA' +const TEXT = 'https://i.iili.uk/r/AQA' describe('CopyButton', () => { it('copies the exact text and confirms', async () => { diff --git a/src/apps/r3dr/__tests__/R3drPage.test.tsx b/src/apps/r3dr/__tests__/R3drPage.test.tsx index 0766112..dea97d8 100644 --- a/src/apps/r3dr/__tests__/R3drPage.test.tsx +++ b/src/apps/r3dr/__tests__/R3drPage.test.tsx @@ -28,7 +28,7 @@ describe('R3drPage', () => { await user.click(screen.getByRole('button', { name: 'Shorten' })) const recent = await screen.findByRole('region', { name: 'Recent links' }) - expect(within(recent).getByRole('link', { name: 'iili.uk/r/AQA' })).toBeDefined() + expect(within(recent).getByRole('link', { name: 'i.iili.uk/r/AQA' })).toBeDefined() expect(localStorage.getItem('r3dr.recent')).toContain('"AQA"') }) @@ -43,7 +43,7 @@ describe('R3drPage', () => { render() const recent = screen.getByRole('region', { name: 'Recent links' }) - expect(within(recent).getByRole('link', { name: 'iili.uk/r/AQA' })).toBeDefined() + expect(within(recent).getByRole('link', { name: 'i.iili.uk/r/AQA' })).toBeDefined() expect(within(recent).queryByText(/DAA/)).toBeNull() }) diff --git a/src/apps/r3dr/__tests__/ShortenCard.test.tsx b/src/apps/r3dr/__tests__/ShortenCard.test.tsx index 7f34a1f..607979f 100644 --- a/src/apps/r3dr/__tests__/ShortenCard.test.tsx +++ b/src/apps/r3dr/__tests__/ShortenCard.test.tsx @@ -10,7 +10,7 @@ const NOW = 1755000000000 const MINUTE = 60 * 1000 const HOUR = 60 * MINUTE const DAY = 24 * HOUR -const LINK_NAME = 'iili.uk/r/AQA' +const LINK_NAME = 'i.iili.uk/r/AQA' describe('ShortenCard', () => { beforeEach(() => { @@ -37,7 +37,7 @@ describe('ShortenCard', () => { expect(api.shorten).toHaveBeenCalledWith('https://example.com/page', NOW + 7 * DAY) expect(await screen.findByRole('link', { name: LINK_NAME })).toHaveAttribute( 'href', - 'https://iili.uk/r/AQA' + 'https://i.iili.uk/r/AQA' ) expect(screen.getByText(/expires in 7 days/)).toBeDefined() expect(onMinted).toHaveBeenCalledWith({ diff --git a/src/apps/r3dr/__tests__/api.test.ts b/src/apps/r3dr/__tests__/api.test.ts index d1271bc..dfda0dd 100644 --- a/src/apps/r3dr/__tests__/api.test.ts +++ b/src/apps/r3dr/__tests__/api.test.ts @@ -79,8 +79,8 @@ describe('shorten', () => { }) describe('shortLink', () => { - it('mints iili.uk short links, labelled sans scheme', () => { - expect(shortLink('AQA')).toBe('https://iili.uk/r/AQA') - expect(shortLinkLabel('AQA')).toBe('iili.uk/r/AQA') + it('mints i.iili.uk short links, labelled sans scheme', () => { + expect(shortLink('AQA')).toBe('https://i.iili.uk/r/AQA') + expect(shortLinkLabel('AQA')).toBe('i.iili.uk/r/AQA') }) }) diff --git a/src/apps/r3dr/api.ts b/src/apps/r3dr/api.ts index 1e4776c..6ae1f2a 100644 --- a/src/apps/r3dr/api.ts +++ b/src/apps/r3dr/api.ts @@ -3,9 +3,10 @@ const API_BASE: string = (import.meta.env.VITE_R3DR_API_URL as string | undefined) || 'https://api.muchq.com/r3dr/v2' -// Short links live on the standalone site's short domain, whose worker -// 302s /r/{slug} through the same API this page mints against. -const SHORT_LINK_BASE = 'https://iili.uk/r/' +// Short links resolve on i.iili.uk, where Caddy on the consolidated host +// rewrites /r/{slug} onto the same API this page mints against. The +// standalone SPA lives at iili.uk; the short domain only redirects. +const SHORT_LINK_BASE = 'https://i.iili.uk/r/' export function shortLink(slug: string): string { // Identity on the slug alphabet; a URL-context barrier for anything else. diff --git a/src/shared/components/Navigation.tsx b/src/shared/components/Navigation.tsx index a39089d..72b3dab 100644 --- a/src/shared/components/Navigation.tsx +++ b/src/shared/components/Navigation.tsx @@ -63,6 +63,7 @@ const MENU: MenuGroup[] = [ { label: 'tty1', to: 'https://tty1.uk', external: true, description: 'Web terminal' }, { label: '里に春が来ました', to: 'https://sato-ni-haru-ga-kimashita.uk', external: true, description: 'Japanese sentence breakdown' }, { label: 'p2bx', to: 'https://p2bx.uk', external: true, description: 'Stone–Čech compactification' }, + { label: 'iili', to: 'https://iili.uk', external: true, description: 'URL shortener' }, ], }, { diff --git a/src/shared/components/__tests__/Navigation.test.tsx b/src/shared/components/__tests__/Navigation.test.tsx index a3edddf..961417b 100644 --- a/src/shared/components/__tests__/Navigation.test.tsx +++ b/src/shared/components/__tests__/Navigation.test.tsx @@ -46,6 +46,7 @@ describe('Navigation', () => { [/^tty1\s?\(external site\)/, 'https://tty1.uk', 'Web terminal'], [/^里に春が来ました\s?\(external site\)/, 'https://sato-ni-haru-ga-kimashita.uk', 'Japanese sentence breakdown'], [/^p2bx\s?\(external site\)/, 'https://p2bx.uk', 'Stone–Čech compactification'], + [/^iili\s?\(external site\)/, 'https://iili.uk', 'URL shortener'], ] for (const [name, href, description] of expected) { const link = group.getByRole('link', { name })