Skip to content

fix(site): fix parameters field size #12231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions site/src/components/Form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import {
createContext,
type FC,
type HTMLProps,
type PropsWithChildren,
useContext,
ReactNode,
ComponentProps,
} from "react";
import { AlphaBadge, DeprecatedBadge } from "components/Badges/Badges";
import { Stack } from "components/Stack/Stack";
Expand Down Expand Up @@ -135,11 +135,14 @@ export const FormSection: FC<FormSectionProps> = ({
);
};

export const FormFields: FC<PropsWithChildren> = ({ children }) => {
export const FormFields: FC<ComponentProps<typeof Stack>> = (props) => {
return (
<Stack direction="column" spacing={3} css={styles.formSectionFields}>
{children}
</Stack>
<Stack
direction="column"
spacing={3}
{...props}
css={styles.formSectionFields}
/>
);
};

Expand Down
15 changes: 9 additions & 6 deletions site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,14 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
title="Parameters"
description="These are the settings used by your template. Please note that immutable parameters cannot be modified once the workspace is created."
>
{/*
Opted not to use FormFields in order to increase spacing.
This decision was made because rich parameter inputs are more visually dense than standard text fields.
*/}
<div css={{ display: "flex", flexDirection: "column", gap: 36 }}>
{/* The parameter fields are densely packed and carry significant information,
/* hence they require additional vertical spacing for better
/*readability and user experience. */}
<FormFields
css={{
gap: 36,
}}
>
{parameters.map((parameter, index) => {
const parameterField = `rich_parameter_values.${index}`;
const parameterInputName = `${parameterField}.value`;
Expand All @@ -285,7 +288,7 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
/>
);
})}
</div>
</FormFields>
</FormSection>
)}

Expand Down