diff --git a/app/features/vods/routes/vods.new.browser.test.tsx b/app/features/vods/routes/vods.new.browser.test.tsx index 7831a6b58..e91ad05d8 100644 --- a/app/features/vods/routes/vods.new.browser.test.tsx +++ b/app/features/vods/routes/vods.new.browser.test.tsx @@ -177,6 +177,19 @@ describe("VodForm", () => { expect(fieldsets.length).toBe(2); }); + test("added match defaults to Splat Zones", async () => { + const screen = await renderForm(); + + const addButton = screen.getByRole("button", { name: "Add" }); + await userEvent.click(addButton.element()); + + const addedFieldset = screen.container.querySelectorAll("fieldset")[1]; + const checkedMode = addedFieldset.querySelector( + 'input[type="radio"]:checked', + ); + expect(checkedMode?.value).toBe("SZ"); + }); + test("can remove matches when more than 1", async () => { const screen = await renderForm({ defaultValues: { diff --git a/app/features/vods/vods-schemas.ts b/app/features/vods/vods-schemas.ts index 8f2daca65..7e480208f 100644 --- a/app/features/vods/vods-schemas.ts +++ b/app/features/vods/vods-schemas.ts @@ -123,6 +123,7 @@ const matchFieldsetSchema = v.object({ label: `modes.${mode}` as const, value: mode, })), + initialValue: "SZ", }), stageId: stageSelect({ label: "labels.vodStage" }), weapon: weaponSelectOptional({ label: "labels.vodWeapon" }), diff --git a/app/form/fields.ts b/app/form/fields.ts index c82001579..d55389f31 100644 --- a/app/form/fields.ts +++ b/app/form/fields.ts @@ -565,7 +565,10 @@ export function radioGroup( Omit, "type" | "initialValue">, V > - >, + > & { + /** Value selected when the form has no default value for the field. Defaults to the first item. */ + initialValue?: V; + }, ): v.GenericSchema, ItemValue> { return register(itemsSchema(args.items), { ...args, @@ -573,7 +576,7 @@ export function radioGroup( bottomText: prefixKey(args.bottomText), items: prefixItems(args.items), type: "radio-group", - initialValue: args.items[0].value, + initialValue: args.initialValue ?? args.items[0].value, }); } diff --git a/changelog/2026-09-29-vod-new-game-splat-zones.md b/changelog/2026-09-29-vod-new-game-splat-zones.md new file mode 100644 index 000000000..00169b68b --- /dev/null +++ b/changelog/2026-09-29-vod-new-game-splat-zones.md @@ -0,0 +1,5 @@ +--- +navItem: vods +type: bug +--- +Games added to a VoD now default to Splat Zones like the first game