This PR fixes an issue introduced in #21939 where the list of models in
the language model selector could be outdated.
Since we're no longer recreating the picker each render, we now need to
make sure we are updating the list of models accordingly when there are
changes to the language model providers.
I noticed it specifically in Assistant1.
Release Notes:
- Fixed a staleness issue with the language model selector.
![CleanShot 2024-12-13 at 11 27
39@2x](https://github.com/user-attachments/assets/7c7828c0-c5c7-4dc6-931e-722366d4f15a)
- Adds the Switch component
- Updates `Selected`, `Selectable` -> `ToggleState`, `Toggleable`
- Adds `checkbox` and `switch` functions to align better with other
elements in our layout system.
We decided not to merge Switch and Checkbox. However, in a followup I'll
introduce a Toggle or AnyToggle enum so we can update
`CheckboxWithLabel` -> `ToggleWithLabel` as this component will work
exactly the same with either a Checkbox or a Switch.
Release Notes:
- N/A
While working on Assistant2, I noticed that the `LanguageModelSelector`
was recreating its `Picker` view on every single render.
This PR makes it so we create the view once and hold onto it in the
parent view.
Release Notes:
- N/A
This PR factors the language model selector out into its own
`language_model_selector` crate so that it can be reused in
`assistant2`.
Also renamed it from `ModelSelector` to `LanguageModelSelector` to be a
bit more specific.
Release Notes:
- N/A