Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: scrollbar position (#20730)

ecmadaoaab7a9a16f59
diff --git a/frontend/src/react/components/sql-review/ReviewCreation.tsx b/frontend/src/react/components/sql-review/ReviewCreation.tsx
index fc41e16818..87feb0729b 100644
--- a/frontend/src/react/components/sql-review/ReviewCreation.tsx
+++ b/frontend/src/react/components/sql-review/ReviewCreation.tsx
@@ -343,7 +343,7 @@ export function ReviewCreation({
return (
<div className="w-full h-full flex flex-col">
{/* Step bar */}
- <div className="sticky top-0 z-10 bg-background border-b pb-4">
+ <div className="sticky top-0 z-10 bg-background border-b px-4 pb-4">
<div className="flex items-center gap-x-2">
{steps.map((step, index) => (
<div key={index} className="flex items-center gap-x-2">
@@ -368,7 +368,7 @@ export function ReviewCreation({
</div>
{/* Step content */}
- <div className="flex-1 overflow-y-auto py-4 px-2">
+ <div className="flex-1 overflow-y-auto p-4">
{currentStep === STEP_BASIC_INFO && (
<div className="flex flex-col gap-y-4 max-w-2xl">
<div className="flex flex-col gap-y-2 max-w-2xl">
@@ -457,7 +457,7 @@ export function ReviewCreation({
</div>
{/* Footer navigation */}
- <div className="sticky bottom-0 z-10 border-t bg-background py-4 flex justify-between">
+ <div className="sticky bottom-0 z-10 border-t bg-background px-4 py-4 flex justify-between">
<div>
{currentStep === STEP_BASIC_INFO && (
<Button variant="outline" onClick={() => handleCancel()}>
diff --git a/frontend/src/react/pages/settings/CreateInstancePage.test.tsx b/frontend/src/react/pages/settings/CreateInstancePage.test.tsx
index 5fc489bfe6..e2b85fe530 100644
--- a/frontend/src/react/pages/settings/CreateInstancePage.test.tsx
+++ b/frontend/src/react/pages/settings/CreateInstancePage.test.tsx
@@ -50,8 +50,10 @@ vi.mock("@/react/components/instance", () => ({
<div>{children}</div>
),
InfoPanelContent: () => <div />,
- InstanceFormBody: () => <div />,
- InstanceFormButtons: () => <div />,
+ InstanceFormBody: () => <div data-testid="instance-form-body" />,
+ InstanceFormButtons: ({ className }: { className?: string }) => (
+ <div data-testid="instance-form-buttons" className={className} />
+ ),
InstanceFormProvider: ({ children }: { children: React.ReactNode }) => (
<div>{children}</div>
),
@@ -71,6 +73,35 @@ beforeEach(async () => {
});
describe("CreateInstancePage", () => {
+ test("keeps the scroll container flush with the page edge", () => {
+ const container = document.createElement("div");
+ const root = createRoot(container);
+
+ act(() => {
+ root.render(<CreateInstancePage />);
+ });
+
+ const page = container.firstElementChild;
+ expect(page).not.toHaveClass("px-4");
+ expect(page).not.toHaveClass("sm:px-6");
+
+ const bodyPadding = container.querySelector(
+ "[data-testid='instance-form-body']"
+ )?.parentElement;
+ expect(bodyPadding).toHaveClass("px-4");
+ expect(bodyPadding).toHaveClass("sm:px-6");
+
+ const buttons = container.querySelector(
+ "[data-testid='instance-form-buttons']"
+ );
+ expect(buttons).toHaveClass("px-4");
+ expect(buttons).toHaveClass("sm:px-6");
+
+ act(() => {
+ root.unmount();
+ });
+ });
+
test("guards navigation when the create form has unsaved changes", () => {
const container = document.createElement("div");
const root = createRoot(container);
diff --git a/frontend/src/react/pages/settings/CreateInstancePage.tsx b/frontend/src/react/pages/settings/CreateInstancePage.tsx
index 4c7b27df50..40f8c6af63 100644
--- a/frontend/src/react/pages/settings/CreateInstancePage.tsx
+++ b/frontend/src/react/pages/settings/CreateInstancePage.tsx
@@ -45,7 +45,7 @@ export function CreateInstancePage() {
}, []);
return (
- <div className="h-full overflow-hidden px-4 sm:px-6">
+ <div className="h-full overflow-hidden">
<InstanceFormProvider onDismiss={goBack}>
<CreateInstanceFormInner />
</InstanceFormProvider>
@@ -130,13 +130,15 @@ function CreateInstanceFormInner() {
>
<div className="min-w-0 min-h-0 flex-1 flex flex-col">
{/* Body */}
- <div className="flex-1 min-h-0 overflow-auto py-4">
- <InstanceFormBody onOpenInfoPanel={handleOpenInfoPanel} />
+ <div className="flex-1 min-h-0 overflow-auto">
+ <div className="px-4 py-4 sm:px-6">
+ <InstanceFormBody onOpenInfoPanel={handleOpenInfoPanel} />
+ </div>
</div>
{/* Sticky footer */}
<div className="sticky bottom-0 z-10 bg-background">
- <InstanceFormButtons />
+ <InstanceFormButtons className="px-4 sm:px-6" />
</div>
<UnsavedChangesGuard />
</div>
diff --git a/frontend/src/react/pages/settings/SQLReviewCreatePage.test.tsx b/frontend/src/react/pages/settings/SQLReviewCreatePage.test.tsx
index 1ce4199bd9..2b42839ee8 100644
--- a/frontend/src/react/pages/settings/SQLReviewCreatePage.test.tsx
+++ b/frontend/src/react/pages/settings/SQLReviewCreatePage.test.tsx
@@ -40,6 +40,7 @@ describe("SQLReviewCreatePage", () => {
expect(container.firstElementChild).toHaveClass("pt-4");
expect(container.firstElementChild).not.toHaveClass("py-4");
+ expect(container.firstElementChild).not.toHaveClass("px-4");
act(() => {
root.unmount();
diff --git a/frontend/src/react/pages/settings/SQLReviewCreatePage.tsx b/frontend/src/react/pages/settings/SQLReviewCreatePage.tsx
index fa583b6ccf..5de73d8511 100644
--- a/frontend/src/react/pages/settings/SQLReviewCreatePage.tsx
+++ b/frontend/src/react/pages/settings/SQLReviewCreatePage.tsx
@@ -7,7 +7,7 @@ import {
export function SQLReviewCreationPage(props: ReviewCreationProps) {
return (
- <div className="px-4 pt-4 h-full min-h-0 flex flex-col">
+ <div className="pt-4 h-full min-h-0 flex flex-col">
<ReviewCreation {...props} />
</div>
);