Skip to content
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

feat(frontend): add help tooltip for model selection #2318

Merged
merged 1 commit into from
Mar 7, 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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ export const ModelSelection = (props: ModelSelectionProps): JSX.Element => {
value: accessibleModelOptions[0].value as Model,
})}
>
<FieldHeader label="Model" iconName="robot" />
<FieldHeader
label="Model"
iconName="robot"
help="Changing the model could make this brain smarter, understanding you better and giving you more helpful answers."
/>
<SingleSelector
options={accessibleModelOptions}
onChange={(option) => {
Expand All @@ -44,7 +48,11 @@ export const ModelSelection = (props: ModelSelectionProps): JSX.Element => {
/>
</fieldset>
<fieldset>
<FieldHeader label="Max tokens" iconName="hashtag" />
<FieldHeader
label="Max tokens"
iconName="hashtag"
help="Increasing the number of tokens this brain can use in its replies will give you more detailed answers"
/>
<div className={styles.max_tokens}>
<input
className={styles.slider}
Expand Down
11 changes: 11 additions & 0 deletions frontend/lib/components/ui/FieldHeader/FieldHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
import Tooltip from "@/lib/components/ui/Tooltip/Tooltip";

import styles from "./FieldHeader.module.scss";

import { Icon } from "../Icon/Icon";

type FieldHeaderProps = {
iconName: string;
label: string;
help?: string;
};

export const FieldHeader = ({
iconName,
label,
help,
}: FieldHeaderProps): JSX.Element => {
return (
<div className={styles.field_header_wrapper}>
<Icon name={iconName} color="black" size="small" />
<label>{label}</label>
{help && (
<Tooltip tooltip={help}>
<div>
<Icon name="help" size="normal" color="black" handleHover={true} />
</div>
</Tooltip>
)}
</div>
);
};