Skip to content
Open
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions frontend/src/components/InputForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const InputForm: React.FC<InputFormProps> = ({
}) => {
const [internalInputValue, setInternalInputValue] = useState("");
const [effort, setEffort] = useState("medium");
const [model, setModel] = useState("gemini-2.5-flash-preview-04-17");
const [model, setModel] = useState("gemini-2.5-flash-preview-05-2025");

Choose a reason for hiding this comment

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

medium

Using hardcoded strings like gemini-2.5-flash-preview-05-2025 in multiple places (here and on line 147) can make the code harder to maintain and lead to potential errors if the value needs to be updated.

To improve this, consider defining constants for the model names at the top of your component or in a separate constants file.

const MODEL_GEMINI_2_5_FLASH = "gemini-2.5-flash-preview-05-2025";
// ...
const [model, setModel] = useState(MODEL_GEMINI_2_5_FLASH);

For an even more robust solution, you could define all models in an array of objects and generate the SelectItem components dynamically by mapping over this array. This would centralize all model-related information (value, label, icon) and make the component cleaner and easier to maintain.


const handleInternalSubmit = (e?: React.FormEvent) => {
if (e) e.preventDefault();
Expand Down Expand Up @@ -144,7 +144,7 @@ export const InputForm: React.FC<InputFormProps> = ({
</div>
</SelectItem>
<SelectItem
value="gemini-2.5-flash-preview-04-17"
value="gemini-2.5-flash-preview-05-2025"
className="hover:bg-neutral-600 focus:bg-neutral-600 cursor-pointer"
>
<div className="flex items-center">
Expand Down