Skip to content

Conversation

jamesmcroft
Copy link
Owner

@jamesmcroft jamesmcroft commented Aug 8, 2025

This PR introduces the GPT-5 model into the calculation.

Resolves #68

This pull request also introduces enhancements to the ImageEditor component to improve the user experience when selecting and editing image presets, and adds a new model to the modelStore. The main changes include better handling of the "Custom" preset, improved input control for preset selection, and automatic updating of preset labels when image dimensions match a known preset.

ModelStore update:

  • Added a new "GPT-5" model with its configuration to the models array in modelStore.

ImageEditor improvements:

  • Added useMemo and useState hooks to manage preset options and input values, ensuring the "Custom" option is consistently available and input behavior is smoother. [1] [2]
  • Refactored the Autocomplete component to use the unified allPresetOptions, maintain input values per image, and reset the input when options are opened or changed. This prevents filtering out the "Custom" option and keeps the dropdown user-friendly.
  • Updated the logic for changing image height or width so that if the new dimensions match a preset, the corresponding preset label is automatically selected; otherwise, the preset is set to "Custom". [1] [2]

@jamesmcroft jamesmcroft requested a review from Copilot August 8, 2025 06:20
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request enhances the ImageEditor component's preset selection functionality and adds the GPT-5 model to the model store. The changes focus on improving user experience when working with image presets by providing better autocomplete behavior and automatic preset detection.

  • Enhanced ImageEditor with improved preset selection and automatic preset detection when dimensions match
  • Added GPT-5 model configuration to the model store
  • Implemented better input control for the autocomplete component to prevent filtering issues

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/stores/ModelStore.js Added GPT-5 model configuration with token costs and image processing parameters
src/components/calculator/ImageEditor.jsx Enhanced preset selection with useMemo/useState hooks, improved autocomplete behavior, and automatic preset detection

@jamesmcroft jamesmcroft merged commit df61360 into main Aug 8, 2025
4 checks passed
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.

Add GPT-5

1 participant