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: #1142 setting groups toggle does not turn off it's nested settings #3681

Merged

Conversation

louis-jan
Copy link
Contributor

Description

This is an app bug where it does not reset other settings when the experimental feature is toggled off.

Two of the major changes:

  • Fixed the wrong HTMLInputElement (Experimental Toggle) target value (e.target.checked instead of e)
  • Added tests to Advanced Settings component

Scenarios:

  1. Users toggle ON the Experimental Settings & Vulkan Support
  2. Users toggle OFF the Experimental Settings. The app should toggle off others automatically.

Bug fix:

It should toggle off features gated by Experimental Settings when toggling off.

Regarding the issue where app could not get Vulkan device VRAM which is not scoped by the issue, it should be a part of janhq/cortex.cpp#1165

all local models will still appear as "Slow on your device"

Fixes Issues

Changes made

Added components and attributes:

  • A new data-testid attribute was added to the Switch component inside the onExperimentalFeature section to help with testing.
  • A data-testid attribute was added to the proxy-switch and proxy-input components inside the onProxy section to help with testing.
  • A data-testid attribute was added to the ignore-ssl-switch component inside the onIgnoreSSL section to help with testing.
  • A data-testid attribute was added to the quick-ask-switch component inside the onQuickAskEnabled section to help with testing.
  • A data-testid attribute was added to the clear-logs button component to help with testing.
  • The clear-logs button received a new implementation of the Button component with a destructive theme.
  • The toggle function was added to handle click outside functionality.
  • The hideDropdown function was removed, likely due to being unused.

Updated functions:

  • The updateExperimentalEnabled function was modified to not reset other settings when updating experimental enabled.
  • The handleGPUChange function was modified to remove the GPU from the gpusInUse state when it's removed.
  • The updateQuickAskEnabled function was implemented to update quick ask enabled.
  • The updateVulkanEnabled function was implemented to update vulkan enabled.
  • The clearLogs function was implemented to clear logs.

Removed unnecessary code:

  • An array of objects (test) with two GPU objects was removed as it's no longer used in the component.
  • The gpusInUse state was initialized as an empty array.

Miscellaneous:

  • Some code style changes were made to conform to a consistent coding style.

Self Checklist

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

Copy link
Contributor

Barecheck - Code coverage report

Total: 57.31%

Your code coverage diff: 0.00% ▴

✅ All code changes are covered

@louis-jan louis-jan changed the title Fix: #1142 experimental toggle does not turn off gated features Fix: #1142 setting groups toggle does not turn off it's nested settings Sep 17, 2024
@louis-jan louis-jan merged commit 031b351 into dev Sep 17, 2024
11 checks passed
@louis-jan louis-jan deleted the fix/1142-experimental-toggle-does-not-turn-off-gated-features branch September 17, 2024 11:17
@github-actions github-actions bot added this to the v0.5.5 milestone Sep 17, 2024
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.

2 participants