Skip to content

made configuration labels in-line - #27

Merged
AlexKempen merged 9 commits into
certfrom
inline-configuration-label
Aug 6, 2026
Merged

made configuration labels in-line#27
AlexKempen merged 9 commits into
certfrom
inline-configuration-label

Conversation

@MrAtomicBombHead

Copy link
Copy Markdown
Collaborator

Moved the labels for configuration windows from above the input box to the left of it so they are in-line.

@AlexKempen AlexKempen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, some minor tweaks/enhancements

Comment thread src/frontend/insert/configurations.tsx Outdated
onValueChange(checked ? "true" : "false")
)}
/>
<Group gap="sm" align="center" mt="sm">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think the existing checkbox implementation was pretty good and is fairly representative of what we should be aiming for in terms of styling
Image

Comment thread src/frontend/insert/configurations.tsx Outdated
onChange={(event) => onValueChange(event.currentTarget.value)}
/>
<Group gap="sm" align="center" mt="sm">
<Text size="sm" style={{ minWidth: "120px", flexShrink: 0 }}>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think removing minWidth to more closely match the existing inputs would be good

Comment thread src/frontend/insert/configurations.tsx Outdated
}}
/>
<Group gap="sm" align="center" mt="sm">
<Text size="sm" style={{ minWidth: "120px", flexShrink: 0 }}>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add component="label" and htmlFor={parameter.id}, you can link the text to the select so clicking the text also activates the select (this also applies to the other components)

@AlexKempen AlexKempen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I did have Claude factor out a separate InputLabel component to capture the shared code between each of the *Input components but that wasn't really a functional change.

/**
 * The height of a default sized Mantine input.
 */
const INPUT_HEIGHT = "36px";

interface InputLabelProps {
    label: string;
    /**
     * The id of the input the label describes.
     */
    htmlFor: string;
    children: ReactNode;
}

/**
 * A label displayed to the left of a parameter input.
 *
 * The label is given the height of an input so it stays aligned with the input
 * itself rather than drifting when the input grows to show an error message.
 */
function InputLabel(props: InputLabelProps) {
    const { label, htmlFor, children } = props;
    return (
        <Group gap="sm" align="flex-start" mt="sm">
            <Text
                size="sm"
                style={{
                    display: "flex",
                    alignItems: "center",
                    height: INPUT_HEIGHT,
                    cursor: "pointer"
                }}
                component="label"
                htmlFor={htmlFor}
            >
                {label}
            </Text>
            {children}
        </Group>
    );
}

@AlexKempen
AlexKempen merged commit 9425604 into cert Aug 6, 2026
1 check passed
@AlexKempen
AlexKempen deleted the inline-configuration-label branch August 21, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants