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: handle case thread when original model deleted #4280

Merged
merged 2 commits into from
Dec 18, 2024
Merged

Conversation

urmauur
Copy link
Member

@urmauur urmauur commented Dec 17, 2024

Describe Your Changes

  1. ModelDropdown Component (index.tsx)

    • Imported atom from jotai.
    • Introduced a new atom modelDropdownStateAtom initialized to false.
    • Updated the state handling of the dropdown's open/close status to use the new atom.
    • Added a useEffect to sync the dropdown open state with the chatInputMode.
  2. useCreateNewThread Hook

    • Removed import and usage of the useRecommendedModel hook.
    • Adjusted logic to set defaultModel without using recommendedModel.
  3. useSendChatMessage Hook

    • Imported modelDropdownStateAtom and added logic to open the model dropdown if no model is selected when sending a chat message.
  4. RichTextEditor Component

    • Added import for selectedModelAtom and used it to determine if the editor should reset after sending a message.
  5. ChatInput Component

    • Added logic to automatically set the input box as active if no model is selected.
    • Slightly reorganized the activeSettingInputBox rendering logic to always include the setting input box with conditionally visible elements based on the selectedModel.

Fixes Issues

CleanShot 2024-12-17 at 15 12 36

CleanShot 2024-12-17 at 15 12 58

CleanShot 2024-12-17 at 15 23 40

CleanShot 2024-12-17 at 15 33 43

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

@urmauur urmauur added the type: feature request A new feature label Dec 17, 2024
@urmauur urmauur added this to the v0.5.12 milestone Dec 17, 2024
@urmauur urmauur requested a review from louis-jan December 17, 2024 08:35
@urmauur urmauur self-assigned this Dec 17, 2024
Copy link
Contributor

github-actions bot commented Dec 17, 2024

Copy link
Contributor

This is the build for this pull request. You can download it from the Artifacts section here: Build URL.

@urmauur urmauur merged commit 7d07e99 into dev Dec 18, 2024
9 checks passed
@urmauur urmauur deleted the feat/model-selector branch December 18, 2024 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants