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

+38 -3
View File
@@ -3,6 +3,8 @@ import type { Message } from '@/api/types'
const SCROLL_LOCK_MS = 300
const BOTTOM_THRESHOLD_PX = 48
const SHOW_SCROLL_BUTTON_THRESHOLD_PX = 120
const SCROLL_TO_BOTTOM_FRAME_COUNT = 2
interface UseAutoScrollOptions {
containerRef?: React.RefObject<HTMLDivElement | null>
@@ -30,6 +32,8 @@ export function useAutoScroll({
const pointerStartYRef = useRef<number | null>(null)
const pointerActiveRef = useRef(false)
const onScrollStateChangeRef = useRef(onScrollStateChange)
const scrollRequestIdRef = useRef(0)
const isScrollButtonVisibleRef = useRef(false)
onScrollStateChangeRef.current = onScrollStateChange
@@ -37,7 +41,25 @@ export function useAutoScroll({
if (!containerRef?.current) return
userScrolledAtRef.current = 0
userDisengagedRef.current = false
containerRef.current.scrollTop = containerRef.current.scrollHeight
isScrollButtonVisibleRef.current = false
const scrollRequestId = scrollRequestIdRef.current + 1
scrollRequestIdRef.current = scrollRequestId
const scroll = () => {
if (!containerRef?.current) return
containerRef.current.scrollTop = containerRef.current.scrollHeight
}
scroll()
let frameCount = 0
const scrollAfterLayout = () => {
if (scrollRequestIdRef.current !== scrollRequestId) return
frameCount += 1
scroll()
if (frameCount < SCROLL_TO_BOTTOM_FRAME_COUNT) {
requestAnimationFrame(scrollAfterLayout)
}
}
requestAnimationFrame(scrollAfterLayout)
onScrollStateChangeRef.current?.(false)
}, [containerRef])
@@ -53,8 +75,13 @@ export function useAutoScroll({
if (!container) return
const markDisengaged = () => {
const container = containerRef?.current
if (!container) return
const distanceFromBottom = container.scrollHeight - container.scrollTop - container.clientHeight
userScrolledAtRef.current = Date.now()
if (!userDisengagedRef.current) {
scrollRequestIdRef.current += 1
if (!isScrollButtonVisibleRef.current && distanceFromBottom > SHOW_SCROLL_BUTTON_THRESHOLD_PX) {
isScrollButtonVisibleRef.current = true
onScrollStateChangeRef.current?.(true)
}
userDisengagedRef.current = true
@@ -63,6 +90,7 @@ export function useAutoScroll({
const handlePointerDown = (e: PointerEvent) => {
pointerStartYRef.current = e.clientY
pointerActiveRef.current = true
scrollRequestIdRef.current += 1
}
const handlePointerMove = (e: PointerEvent) => {
@@ -98,12 +126,19 @@ export function useAutoScroll({
if (userDisengagedRef.current) {
userScrolledAtRef.current = 0
userDisengagedRef.current = false
isScrollButtonVisibleRef.current = false
onScrollStateChangeRef.current?.(false)
}
} else if (userDisengagedRef.current && !isScrollButtonVisibleRef.current && scrollHeight - scrollTop - clientHeight > SHOW_SCROLL_BUTTON_THRESHOLD_PX) {
isScrollButtonVisibleRef.current = true
onScrollStateChangeRef.current?.(true)
} else if (pointerActiveRef.current && !userDisengagedRef.current) {
userScrolledAtRef.current = Date.now()
userDisengagedRef.current = true
onScrollStateChangeRef.current?.(true)
if (scrollHeight - scrollTop - clientHeight > SHOW_SCROLL_BUTTON_THRESHOLD_PX) {
isScrollButtonVisibleRef.current = true
onScrollStateChangeRef.current?.(true)
}
}
}