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

fix: conditional render model setting based on selected model #4300

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

urmauur
Copy link
Member

@urmauur urmauur commented Dec 19, 2024

Describe Your Changes

The changes in the ThreadRightPanel/index.tsx file involve wrapping an Accordion component and its children with an additional conditional check to ensure that a selectedModel exists before rendering the Accordion and its AccordionItem children. Here's a summary of the modifications:

  1. Conditional Rendering: Previously, the Accordion component and its AccordionItem components were rendered unconditionally. Now, they are only rendered if selectedModel is truthy.

  2. No Changes to Styling or Structure: There are no changes to the styling (className) or the internal structure of the Accordion and AccordionItem components.

  3. Preservation of Existing Logic: The logic inside AccordionItems remains intact, including checks on the length of settings.runtimeSettings, promptTemplateSettings, and settings.engineSettings, as well as the handling of onValueChanged callbacks.

This change likely introduces a dependency on the selectedModel variable, ensuring that the settings sections are conditionally displayed only when a model is selected or defined.

Fixes Issues

CleanShot 2024-12-19 at 21 22 01

  • Closes # conv
  • Closes #

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: bug Something isn't working label Dec 19, 2024
@urmauur urmauur added this to the v0.5.12 milestone Dec 19, 2024
@urmauur urmauur requested a review from louis-jan December 19, 2024 14:24
@urmauur urmauur self-assigned this Dec 19, 2024
luiyen
luiyen previously approved these changes Dec 19, 2024
Copy link
Contributor

Barecheck - Code coverage report

Total: 69.07%

Your code coverage diff: 0.00% ▴

Uncovered files and lines
FileLines
web/screens/Thread/ThreadRightPanel/index.tsx86, 99, 103, 106, 111-115, 119-120, 126, 130, 133, 159-160, 174, 179, 181-182, 184, 188, 192, 196, 202, 206, 245

Copy link
Contributor

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

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 c7a5cb5 into dev Dec 19, 2024
31 checks passed
@urmauur urmauur deleted the fix/model-setting branch December 19, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants