diff --git a/app/layout.tsx b/app/layout.tsx index fac6abf..b231b3f 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -3,6 +3,7 @@ import { SiteFooter } from '@/components/layout/site-footer'; import { HelpBot } from '@/components/layout/help-bot'; import { OnboardingGuide } from '@/components/onboarding/guide'; import { ScrollToTop } from '@/components/layout/scroll-to-top'; +import { AndroidAppBanner } from '@/components/layout/android-app-banner'; import Image from 'next/image'; import Link from 'next/link'; import { headers } from 'next/headers'; @@ -56,6 +57,7 @@ export default async function RootLayout({ children }: Readonly<{ children: Reac + {/* on phones: 16px gutters, tighter gaps, and the name and buttons' words drop to icons (TL-471) */}
diff --git a/components/intake/request-form.test.tsx b/components/intake/request-form.test.tsx index 34e1c12..8fa56ff 100644 --- a/components/intake/request-form.test.tsx +++ b/components/intake/request-form.test.tsx @@ -10,7 +10,7 @@ const form = (state: Parameters[0]['state']) => test('the public form: bug or feature, title, optional details and contact, a hidden honeypot', () => { const html = form('open'); - for (const s of ['Send a request', 'Bug report', 'Feature request', '>Title<', 'Details', 'How can we reach you?', 'Send request']) expect(html).toContain(s); + for (const s of ['Send a request', 'Bug report', 'Feature request', 'Account deletion', '>Title<', 'Details', 'How can we reach you?', 'Send request']) expect(html).toContain(s); expect(html).toMatch(/aria-hidden="true"[^>]*>.*name="website"/); expect(html).toMatch(/name="website"[^>]*tabindex="-1"|tabindex="-1"[^>]*name="website"/i); }); diff --git a/components/intake/request-form.tsx b/components/intake/request-form.tsx index 6a04cd3..53bf4c0 100644 --- a/components/intake/request-form.tsx +++ b/components/intake/request-form.tsx @@ -8,14 +8,14 @@ import { useEffect, useState, type FormEvent } from 'react'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group'; -import { ApiError, intake, type IntakeRequest } from '@/lib/api'; +import { ApiError, intake, type IntakeRequest, type IntakeType } from '@/lib/api'; export type FormState = 'loading' | 'closed' | 'open' | 'sent'; // sendError says what went wrong sending a request, in words a visitor can act on. export function sendError(i18n: I18n, err: unknown): string { if (err instanceof ApiError) { - if (err.status === 400) return i18n._(msg`Please add a title (up to 200 characters) and choose bug or feature.`); + if (err.status === 400) return i18n._(msg`Please add a title (up to 200 characters), choose what it is, and for account deletion say how to reach you.`); if (err.status === 404) return i18n._(msg`This form isn’t taking requests any more.`); if (err.status === 429) return i18n._(msg`You’ve sent a few requests already. Please try again in an hour.`); } @@ -34,7 +34,8 @@ export function RequestPage({ token }: { token: string }) { // RequestFormView: the form and its states (pure, for tests). export function RequestFormView({ state, onSend, onAnother }: { state: FormState; onSend: (req: IntakeRequest) => Promise; onAnother: () => void }) { const { t, i18n } = useLingui(); - const [type, setType] = useState<'bug' | 'feature'>('bug'); + const [type, setType] = useState('bug'); + const deletion = type === 'account_deletion'; const [title, setTitle] = useState(''); const [details, setDetails] = useState(''); const [contact, setContact] = useState(''); @@ -67,6 +68,10 @@ export function RequestFormView({ state, onSend, onAnother }: { state: FormState setError(t`Please add a title.`); return; } + if (deletion && !contact.trim()) { + setError(t`Please add the email on your account so the team can find and delete it.`); + return; + } setSending(true); setError(''); try { @@ -82,28 +87,31 @@ export function RequestFormView({ state, onSend, onAnother }: { state: FormState

Send a request

-

Report a bug or suggest a feature. You don't need an account.

+

Report a bug, suggest a feature or ask for your account to be deleted. You don't need to sign in.

What is it? - v[0] && setType(v[0] as 'bug' | 'feature')}> + v[0] && setType(v[0] as IntakeType)}> Bug report Feature request + Account deletion
{/* honeypot: hidden from people and screen readers; bots that fill it are dropped */}