feat: disabled remote model and show prompt users to use on-device models when offline mode #4229
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe Your Changes
The changes made in the code are as follows:
Test Modifications (
index.test.ts
):useOnlineStatus
is defined and exported correctly from the components.Module Export Update (
index.ts
):useOnlineStatus
to the list of exported hooks from the module.Component Update (
ModelDropdown/index.tsx
):useOnlineStatus
hook from the@janhq/joi
library.WifiOff
icon from thelucide-react
library.useOnlineStatus
hook to check the online status (isOnline
) within theModelDropdown
component.searchFilter
is set to 'remote'. It includes theWifiOff
icon and a message informing the user that they are offline and should use on-device models.Screenshots
Screen.Recording.2024-12-05.at.13.11.16.mov
Fixes Issues
Self Checklist