feat(frontend): improve model selection experience (#237)

* chore: remove dead code and unused exports

* fix: preserve model form during config refresh

Signed-off-by: mehmet turac <mehmetturac@gmail.com>

* loop: model-select-fix completed after 11 iterations

* fix(frontend): show provider prefix for duplicate models in quick select dropdown

When the same model exists under multiple providers, show the provider name
for both entries so users can distinguish them. Detects duplicates by modelID
across all favorites and recents.

* refactor(frontend): replace useTallScrollContent with scroll visibility hook

* fix: harden mirror push rollback

* Remove Load button from skill cards, clicking card loads skill

* feat(backend): add plugin installation support and schema updates

* refactor(frontend): remove unused useHeaderScrollVisibility hook

* refactor(frontend): replace model dropdown with bottom sheet selector

Replace DropdownMenu-based ModelQuickSelect with a bottom sheet
implementation featuring favorites, recents, provider browsing, and
search. Remove onShowModelsDialog prop from PromptInput and
SessionDetail, using data attribute trigger instead. Fix ZodIssueCode
deprecation, input text color, and portal rendering for bottom sheet.

* fix(frontend): simplify session model restore and fix mobile swipe reset

* loop: single-source-models completed after 10 iterations

* refactor(frontend): add desktop sidebar layout to model quick select

* refactor(frontend): improve model selector with connected providers, favorites, and recent management

* fix(frontend): constrain model name width to prevent overflow in prompt input

* fix(frontend): adjust padding and styling in model quick select

* fix(frontend): add optimistic removal with rollback for recent models

---------
This commit is contained in:
Chris Scott authored and GitHub committed 2026-05-25 09:47:59 -04:00
1 parent f492faa84b
commit 03bd3dac95
45 files changed
+1728 -1148

No files matched your search

@@ -1,93 +0,0 @@
import { useState, useEffect } from 'react'
import { Dialog, DialogContent } from '@/components/ui/dialog'
import { FilePreview } from './FilePreview'
import { Loader2, FileText } from 'lucide-react'
import { API_BASE_URL } from '@/config'
import type { FileInfo } from '@/types/files'
interface FilePreviewDialogProps {
isOpen: boolean
onClose: () => void
filePath: string
repoBasePath?: string
onFileSaved?: () => void
initialLineNumber?: number
}
export function FilePreviewDialog({ isOpen, onClose, filePath, repoBasePath, onFileSaved, initialLineNumber }: FilePreviewDialogProps) {
const [file, setFile] = useState<FileInfo | null>(null)
const [isLoading, setIsLoading] = useState(false)
const [error, setError] = useState<string | null>(null)
useEffect(() => {
if (!isOpen || !filePath) {
setFile(null)
setError(null)
return
}
const fetchFile = async () => {
setIsLoading(true)
setError(null)
try {
const fullPath = repoBasePath ? `${repoBasePath}/${filePath}` : filePath
const response = await fetch(`${API_BASE_URL}/api/files/${fullPath}`)
if (!response.ok) {
throw new Error(`Failed to load file: ${response.statusText}`)
}
const data = await response.json()
setFile(data)
} catch (err) {
setError(err instanceof Error ? err.message : 'Failed to load file')
} finally {
setIsLoading(false)
}
}
fetchFile()
}, [isOpen, filePath, repoBasePath])
const handleOpenChange = (open: boolean) => {
if (!open) {
onClose()
}
}
return (
<Dialog open={isOpen} onOpenChange={handleOpenChange}>
<DialogContent
className="w-screen h-screen max-w-none max-h-none p-0 bg-background border-0 flex flex-col"
hideCloseButton
fullscreen
mobileSwipeToClose
>
<div className="flex-1 overflow-hidden min-h-0">
{isLoading ? (
<div className="flex items-center justify-center h-full">
<Loader2 className="w-6 h-6 animate-spin text-muted-foreground" />
</div>
) : error ? (
<div className="flex flex-col items-center justify-center h-full text-muted-foreground">
<FileText className="w-8 h-8 mb-2 opacity-50" />
<p className="text-sm">Failed to load file</p>
<p className="text-xs mt-1">{error}</p>
</div>
) : file ? (
<FilePreview
key={file.path}
file={file}
hideHeader={false}
isMobileModal={true}
onCloseModal={onClose}
onFileSaved={onFileSaved}
initialLineNumber={initialLineNumber}
/>
) : null}
</div>
</DialogContent>
</Dialog>
)
}