fix: chore UI issues (#5116)

* fix: app log outputs with debug level

* fix: reasoning block still show loading indicator when stopped

* chore: fix mistral AI base url
This commit is contained in:
Louis 2025-05-27 19:38:21 +07:00 committed by GitHub
parent 0b8c7bae69
commit 26154941ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 6 deletions

View File

@ -85,7 +85,7 @@ pub fn run() {
.setup(|app| { .setup(|app| {
app.handle().plugin( app.handle().plugin(
tauri_plugin_log::Builder::default() tauri_plugin_log::Builder::default()
.level(log::LevelFilter::Info) .level(log::LevelFilter::Debug)
.targets([ .targets([
tauri_plugin_log::Target::new(tauri_plugin_log::TargetKind::Stdout), tauri_plugin_log::Target::new(tauri_plugin_log::TargetKind::Stdout),
tauri_plugin_log::Target::new(tauri_plugin_log::TargetKind::Webview), tauri_plugin_log::Target::new(tauri_plugin_log::TargetKind::Webview),

View File

@ -1,6 +1,7 @@
import { ChevronDown, ChevronUp, Loader } from 'lucide-react' import { ChevronDown, ChevronUp, Loader } from 'lucide-react'
import { create } from 'zustand' import { create } from 'zustand'
import { RenderMarkdown } from './RenderMarkdown' import { RenderMarkdown } from './RenderMarkdown'
import { useAppState } from '@/hooks/useAppState'
interface Props { interface Props {
text: string text: string
@ -26,7 +27,8 @@ const useThinkingStore = create<ThinkingBlockState>((set) => ({
const ThinkingBlock = ({ id, text }: Props) => { const ThinkingBlock = ({ id, text }: Props) => {
const { thinkingState, toggleState } = useThinkingStore() const { thinkingState, toggleState } = useThinkingStore()
const loading = !text.includes('</think>') const { streamingContent } = useAppState()
const loading = !text.includes('</think>') && streamingContent
const isExpanded = thinkingState[id] ?? false const isExpanded = thinkingState[id] ?? false
const handleClick = () => toggleState(id) const handleClick = () => toggleState(id)

View File

@ -306,7 +306,7 @@ export const mockModelProvider = [
{ {
active: true, active: true,
api_key: '', api_key: '',
base_url: 'https://api.mistral.ai/v1', base_url: 'https://api.mistral.ai',
explore_models_url: explore_models_url:
'https://docs.mistral.ai/getting-started/models/models_overview/', 'https://docs.mistral.ai/getting-started/models/models_overview/',
provider: 'mistral', provider: 'mistral',
@ -331,8 +331,8 @@ export const mockModelProvider = [
'The base endpoint to use. See the [Mistral documentation](https://docs.mistral.ai/getting-started/models/models_overview/) for more information.', 'The base endpoint to use. See the [Mistral documentation](https://docs.mistral.ai/getting-started/models/models_overview/) for more information.',
controller_type: 'input', controller_type: 'input',
controller_props: { controller_props: {
placeholder: 'https://api.mistral.ai/v1', placeholder: 'https://api.mistral.ai',
value: 'https://api.mistral.ai/v1', value: 'https://api.mistral.ai',
}, },
}, },
], ],

View File

@ -194,7 +194,12 @@ export const importModel = async (
if (!path) throw new Error('No file selected') if (!path) throw new Error('No file selected')
// Extract filename from path to use as model ID if not provided // Extract filename from path to use as model ID if not provided
const defaultModelId = path.split(/[/\\]/).pop()?.replace(/ /g, '-') || path const defaultModelId =
path
.split(/[/\\]/)
.pop()
?.replace(/ /g, '-')
.replace(/\.gguf$/i, '') || path
const modelIdToUse = modelId || defaultModelId const modelIdToUse = modelId || defaultModelId
return await extension.importModel(modelIdToUse, path, provider) return await extension.importModel(modelIdToUse, path, provider)