diff --git a/src/frontend/components/form-modal.tsx b/src/frontend/components/form-modal.tsx index 43aa10e..05e18eb 100644 --- a/src/frontend/components/form-modal.tsx +++ b/src/frontend/components/form-modal.tsx @@ -5,6 +5,7 @@ import React, { type FormEvent, type ReactNode } from "react"; interface FormModalProps { children: ReactNode; description?: string; + dialogSize?: "large" | "viewport"; isSaving: boolean; onClose: () => void; onSubmit: (event: FormEvent) => void; @@ -16,6 +17,7 @@ interface FormModalProps { export function FormModal({ children, description, + dialogSize = "large", isSaving, onClose, onSubmit, @@ -31,7 +33,10 @@ export function FormModal({ role="dialog" tabIndex={-1} > -
+
diff --git a/src/frontend/components/revit-csv-modal.tsx b/src/frontend/components/revit-csv-modal.tsx index d62e78b..35affc1 100644 --- a/src/frontend/components/revit-csv-modal.tsx +++ b/src/frontend/components/revit-csv-modal.tsx @@ -1,6 +1,6 @@ "use client"; -import { useEffect, useMemo, useState, type FormEvent } from "react"; +import React, { useEffect, useMemo, useState, type FormEvent } from "react"; import { createDefaultExternalCsvConfiguration, type ExternalCsvConfiguration, @@ -132,6 +132,7 @@ export function RevitCsvModal({ return ( { ]); }); }); + +describe("Revit CSV modal presentation", () => { + it("uses the viewport-wide dialog variant", () => { + const markup = renderToStaticMarkup( + createElement(RevitCsvModal, { + currentRevision: 0, + onClose: () => undefined, + onRevisionChange: () => undefined, + projectId: "project-1", + }) + ); + + assert.match(markup, /max-width:calc\(100vw - 2rem\)/); + assert.doesNotMatch(markup, /modal-lg/); + }); +});