diff --git a/frontend/src/components/Albums/ShareAlbumDialog.tsx b/frontend/src/components/Albums/ShareAlbumDialog.tsx index 52d59395a..e2836f5d6 100644 --- a/frontend/src/components/Albums/ShareAlbumDialog.tsx +++ b/frontend/src/components/Albums/ShareAlbumDialog.tsx @@ -25,6 +25,7 @@ import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Switch } from '@/components/ui/switch'; import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'; +import * as RadioGroupPrimitive from '@radix-ui/react-radio-group'; import { Separator } from '@/components/ui/separator'; import { usePictoMutation, type BackendRes } from '@/hooks/useQueryExtension'; import { createShare, revokeShare } from '@/api/api-functions'; @@ -476,26 +477,33 @@ export const ShareAlbumDialog: React.FC = ({
{/* Full width, because this is the decision the rest of the form hangs off rather than one setting among several. */} -
+ handleModeChange(value as ShareMode)} + aria-label="Share mode" + className="bg-muted grid w-full grid-cols-2 gap-1 rounded-lg p-1" + > {MODE_OPTIONS.map((option) => ( - + + ))} -
+ {mode === 'internet' && (
diff --git a/frontend/src/components/Albums/__tests__/ShareAlbumDialog.test.tsx b/frontend/src/components/Albums/__tests__/ShareAlbumDialog.test.tsx index 836331172..72c15bc6c 100644 --- a/frontend/src/components/Albums/__tests__/ShareAlbumDialog.test.tsx +++ b/frontend/src/components/Albums/__tests__/ShareAlbumDialog.test.tsx @@ -86,6 +86,16 @@ describe('ShareAlbumDialog', () => { mockOpenUrl.mockResolvedValue(undefined); }); + it('groups the share-mode radios under an accessible radiogroup', () => { + renderDialog(); + + const group = screen.getByRole('radiogroup', { name: /share mode/i }); + expect(group).toContainElement(internetToggle()); + expect(group).toContainElement( + screen.getByRole('radio', { name: /this network/i }), + ); + }); + describe('internet mode', () => { it('shares on the local network unless asked otherwise', async () => { const user = userEvent.setup();