Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

♿ Fix accessibility gaps in app forms and states (#2768)

Luke Vellaa680798c542e
diff --git a/apps/web/public/locales/en/app.json b/apps/web/public/locales/en/app.json
index bd9fe08ff..48e981841 100644
--- a/apps/web/public/locales/en/app.json
+++ b/apps/web/public/locales/en/app.json
@@ -161,9 +161,6 @@
"createPollPollCreated": "Poll created",
"createSpace": "Create Space",
"createSpaceDescription": "Create a new space to organize your polls and events.",
- "createSpaceError": "Failed to create space",
- "createSpaceLoading": "Creating space...",
- "createSpaceSuccess": "Space created successfully",
"creatingPoll": "Creating poll...",
"cropPreview": "Crop preview",
"currentlyUsing": "Currently using {usedSeats} of {currentSeats} seats",
@@ -207,6 +204,7 @@
"deletePollDescription": "All data related to this poll will be deleted. This action cannot be undone.",
"deletePollPrompt": "Are you sure you want to delete <b>{title}</b>?",
"deleteSpace": "Delete Space",
+ "deleteSpaceConfirmLabel": "Confirm space name",
"deleteSpaceDescription": "Permanently delete this space and all its contents. This action cannot be undone.",
"deleteSpaceDialogDescription": "This will permanently delete the space and all polls inside it. This action cannot be undone.",
"deleteSpaceDialogTitle": "Delete Space",
@@ -479,6 +477,7 @@
"noUsers": "No users found",
"noUsersDescription": "Try adjusting your search",
"noVotes": "No one has voted for this option",
+ "numberOfSeats": "Number of seats",
"oidcAutoSignInDescription": "You are being redirected to the login page...",
"openPollCount": "{count, plural, other {# open}}",
"optional": "optional",
@@ -674,7 +673,6 @@
"spaceUpdatedSuccess": "Space updated successfully",
"ssoAuthenticationOnly": "Authentication is managed through Single Sign-On (SSO). Password management is not available.",
"startOfWeek": "Start of week",
- "submit": "Submit",
"subscriptionCardAmountDiscount": "{amount} discount applied",
"subscriptionCardEndsOn": "Ends {date}",
"subscriptionCardPercentDiscount": "{percent}% discount applied",
diff --git a/apps/web/src/app/[locale]/(optional-space)/poll/[urlId]/duplicate-form.tsx b/apps/web/src/app/[locale]/(optional-space)/poll/[urlId]/duplicate-form.tsx
index 2d67cf4b3..13a9ff878 100644
--- a/apps/web/src/app/[locale]/(optional-space)/poll/[urlId]/duplicate-form.tsx
+++ b/apps/web/src/app/[locale]/(optional-space)/poll/[urlId]/duplicate-form.tsx
@@ -2,10 +2,12 @@
import { zodResolver } from "@hookform/resolvers/zod";
import {
Form,
+ FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
+ FormMessage,
} from "@rallly/ui/form";
import { Input } from "@rallly/ui/input";
import { useForm } from "react-hook-form";
@@ -48,13 +50,16 @@ export function DuplicateForm({
<FormLabel>
<Trans i18nKey="duplicateTitleLabel" defaults="Title" />
</FormLabel>
- <Input {...field} className="w-full" />
+ <FormControl>
+ <Input {...field} className="w-full" />
+ </FormControl>
<FormDescription>
<Trans
i18nKey="duplicateTitleDescription"
defaults="Hint: Give your new poll a unique title"
/>
</FormDescription>
+ <FormMessage />
</FormItem>
);
}}
diff --git a/apps/web/src/app/[locale]/(space)/(dashboard)/events/events-tabbed-view.tsx b/apps/web/src/app/[locale]/(space)/(dashboard)/events/events-tabbed-view.tsx
index e45bbed42..5127712c4 100644
--- a/apps/web/src/app/[locale]/(space)/(dashboard)/events/events-tabbed-view.tsx
+++ b/apps/web/src/app/[locale]/(space)/(dashboard)/events/events-tabbed-view.tsx
@@ -46,12 +46,16 @@ export function EventsTabbedView({ children }: { children: React.ReactNode }) {
tabIndex={-1}
value={tab}
key={tab}
+ aria-busy={isPending}
className={cn(
isPending ? "pointer-events-none animate-pulse opacity-50" : "",
)}
>
{children}
</TabsContent>
+ <output aria-live="polite" className="sr-only">
+ {isPending ? <Trans i18nKey="loading" defaults="Loading…" /> : null}
+ </output>
</Tabs>
);
}
diff --git a/apps/web/src/app/[locale]/(space)/(dashboard)/polls/polls-tabbed-view.tsx b/apps/web/src/app/[locale]/(space)/(dashboard)/polls/polls-tabbed-view.tsx
index e4ecad36e..831ff6a90 100644
--- a/apps/web/src/app/[locale]/(space)/(dashboard)/polls/polls-tabbed-view.tsx
+++ b/apps/web/src/app/[locale]/(space)/(dashboard)/polls/polls-tabbed-view.tsx
@@ -70,10 +70,14 @@ export function PollsTabbedView({
tabIndex={-1}
value={tab}
key={tab}
+ aria-busy={isPending}
className={cn(isPending ? "pointer-events-none opacity-50" : "")}
>
{children}
</TabsContent>
+ <output aria-live="polite" className="sr-only">
+ {isPending ? <Trans i18nKey="loading" defaults="Loading…" /> : null}
+ </output>
</Tabs>
);
}
diff --git a/apps/web/src/app/[locale]/(space)/settings/billing/components/manage-seats-dialog.tsx b/apps/web/src/app/[locale]/(space)/settings/billing/components/manage-seats-dialog.tsx
index 602f12973..a400e0766 100644
--- a/apps/web/src/app/[locale]/(space)/settings/billing/components/manage-seats-dialog.tsx
+++ b/apps/web/src/app/[locale]/(space)/settings/billing/components/manage-seats-dialog.tsx
@@ -16,7 +16,7 @@ import { Input } from "@rallly/ui/input";
import { Label } from "@rallly/ui/label";
import { MinusIcon, PlusIcon } from "lucide-react";
import { useCallback, useState } from "react";
-import { Trans } from "@/i18n/client";
+import { Trans, useTranslation } from "@/i18n/client";
import { trpc } from "@/trpc/client";
interface ManageSeatsButtonProps {
@@ -37,6 +37,7 @@ function SeatCountSelector({
currentSeats,
minSeats,
}: SeatCountSelectorProps) {
+ const { t } = useTranslation();
const handleIncrement = useCallback(() => {
onChange(value + 1);
}, [value, onChange]);
@@ -93,6 +94,7 @@ function SeatCountSelector({
<Input
type="number"
+ aria-label={t("numberOfSeats", { defaultValue: "Number of seats" })}
value={value}
onChange={handleInputChange}
onBlur={handleInputBlur}
diff --git a/apps/web/src/app/[locale]/(space)/settings/general/components/delete-space-button.tsx b/apps/web/src/app/[locale]/(space)/settings/general/components/delete-space-button.tsx
index 55712fc60..9ea731299 100644
--- a/apps/web/src/app/[locale]/(space)/settings/general/components/delete-space-button.tsx
+++ b/apps/web/src/app/[locale]/(space)/settings/general/components/delete-space-button.tsx
@@ -12,7 +12,15 @@ import {
DialogTitle,
DialogTrigger,
} from "@rallly/ui/dialog";
-import { Form, FormField, FormItem, FormMessage } from "@rallly/ui/form";
+import {
+ Form,
+ FormControl,
+ FormDescription,
+ FormField,
+ FormItem,
+ FormLabel,
+ FormMessage,
+} from "@rallly/ui/form";
import { Input } from "@rallly/ui/input";
import { toast } from "@rallly/ui/sonner";
import { useRouter } from "next/navigation";
@@ -76,13 +84,6 @@ function DeleteSpaceDialog({
</DialogDescription>
</DialogHeader>
<div className="space-y-4 py-4">
- <p className="text-sm">
- <Trans
- i18nKey="deleteSpaceInstruction"
- defaults="Please type the space name to confirm: {{spaceName}}"
- values={{ spaceName }}
- />
- </p>
<FormField
control={form.control}
name="spaceName"
@@ -98,12 +99,27 @@ function DeleteSpaceDialog({
}}
render={({ field }) => (
<FormItem>
- <Input
- autoComplete="off"
- data-1p-ignore
- placeholder={spaceName}
- {...field}
- />
+ <FormLabel>
+ <Trans
+ i18nKey="deleteSpaceConfirmLabel"
+ defaults="Confirm space name"
+ />
+ </FormLabel>
+ <FormDescription>
+ <Trans
+ i18nKey="deleteSpaceInstruction"
+ defaults="Please type the space name to confirm: {{spaceName}}"
+ values={{ spaceName }}
+ />
+ </FormDescription>
+ <FormControl>
+ <Input
+ autoComplete="off"
+ data-1p-ignore
+ placeholder={spaceName}
+ {...field}
+ />
+ </FormControl>
<FormMessage />
</FormItem>
)}
diff --git a/apps/web/src/app/[locale]/(space)/settings/members/components/invite-member-dialog.tsx b/apps/web/src/app/[locale]/(space)/settings/members/components/invite-member-dialog.tsx
index ed23a97d3..62625e4f7 100644
--- a/apps/web/src/app/[locale]/(space)/settings/members/components/invite-member-dialog.tsx
+++ b/apps/web/src/app/[locale]/(space)/settings/members/components/invite-member-dialog.tsx
@@ -135,7 +135,7 @@ export function InviteMemberForm({ onSuccess }: { onSuccess?: () => void }) {
return (
<Form {...form}>
<form onSubmit={form.handleSubmit((data) => inviteMember.execute(data))}>
- <fieldset className="space-y-4">
+ <div className="space-y-4">
<FormField
control={form.control}
name="email"
@@ -231,7 +231,7 @@ export function InviteMemberForm({ onSuccess }: { onSuccess?: () => void }) {
)}
/>
<FormMessage />
- </fieldset>
+ </div>
<div className="mt-4 flex">
<Button
variant="primary"
diff --git a/apps/web/src/app/[locale]/(space)/settings/preferences/components/theme-preference.tsx b/apps/web/src/app/[locale]/(space)/settings/preferences/components/theme-preference.tsx
index 7e9545006..6499e594b 100644
--- a/apps/web/src/app/[locale]/(space)/settings/preferences/components/theme-preference.tsx
+++ b/apps/web/src/app/[locale]/(space)/settings/preferences/components/theme-preference.tsx
@@ -3,7 +3,7 @@
import { RadioGroup, RadioGroupItem } from "@rallly/ui/radio-group";
import { MonitorIcon, MoonIcon, SunIcon } from "lucide-react";
import React from "react";
-import { Trans } from "@/i18n/client";
+import { Trans, useTranslation } from "@/i18n/client";
import { useTheme } from "@/lib/theme";
function ThemeOption({
@@ -30,6 +30,7 @@ function ThemeOptionLabel({ children }: { children: React.ReactNode }) {
}
export function ThemePreference() {
+ const { t } = useTranslation();
const { theme, setTheme } = useTheme();
const [mounted, setMounted] = React.useState(false);
@@ -42,6 +43,7 @@ export function ThemePreference() {
// render, so remount the group once the theme is known after hydration
<RadioGroup
key={mounted ? "mounted" : "ssr"}
+ aria-label={t("theme", { defaultValue: "Theme" })}
value={mounted ? theme : undefined}
onValueChange={setTheme}
className="flex flex-wrap gap-2"
diff --git a/apps/web/src/app/[locale]/(space)/settings/profile/components/profile-settings.tsx b/apps/web/src/app/[locale]/(space)/settings/profile/components/profile-settings.tsx
index fbf49f8f0..e42fae774 100644
--- a/apps/web/src/app/[locale]/(space)/settings/profile/components/profile-settings.tsx
+++ b/apps/web/src/app/[locale]/(space)/settings/profile/components/profile-settings.tsx
@@ -61,7 +61,7 @@ export const ProfileSettings = ({
<Trans i18nKey="name" />
</FormLabel>
<FormControl>
- <Input id="name" {...field} />
+ <Input id="name" autoComplete="name" {...field} />
</FormControl>
<FormMessage />
</FormItem>
diff --git a/apps/web/src/app/global-error.tsx b/apps/web/src/app/global-error.tsx
index 4f9c8a9dd..252fd1af2 100644
--- a/apps/web/src/app/global-error.tsx
+++ b/apps/web/src/app/global-error.tsx
@@ -6,8 +6,10 @@ import { useEffect } from "react";
export default function GlobalError({
error,
+ reset,
}: {
error: Error & { digest?: string };
+ reset: () => void;
}) {
useEffect(() => {
Sentry.captureException(error);
@@ -21,6 +23,15 @@ export default function GlobalError({
does not expose status codes for errors, we simply pass 0 to render a
generic error message. */}
<NextError statusCode={0} />
+ {/* global-error replaces the root layout, so it renders above the
+ [locale] segment that mounts I18nProvider. There is no locale and no
+ i18n instance to read here, which is why `NextError` above is also
+ untranslated. The retry label stays hardcoded to match. */}
+ <div style={{ textAlign: "center", marginTop: 16 }}>
+ <button type="button" onClick={() => reset()}>
+ Try again
+ </button>
+ </div>
</body>
</html>
);