feat(app): update manage servers dialog styling and behavior

This commit is contained in:
David Hill
2026-01-24 20:51:53 +00:00
parent a98add29d1
commit 02aea77e92
3 changed files with 79 additions and 35 deletions

View File

@@ -66,7 +66,7 @@
[data-slot="dialog-header"] {
display: flex;
padding: 16px 16px 16px 24px;
padding: 20px;
justify-content: space-between;
align-items: center;
flex-shrink: 0;

View File

@@ -13,6 +13,7 @@ export interface FilteredListProps<T> {
sortBy?: (a: T, b: T) => number
sortGroupsBy?: (a: { category: string; items: T[] }, b: { category: string; items: T[] }) => number
onSelect?: (value: T | undefined, index: number) => void
noInitialSelection?: boolean
}
export function useFilteredList<T>(props: FilteredListProps<T>) {
@@ -57,6 +58,7 @@ export function useFilteredList<T>(props: FilteredListProps<T>) {
})
function initialActive() {
if (props.noInitialSelection) return ""
if (props.current) return props.key(props.current)
const items = flat()
@@ -71,6 +73,10 @@ export function useFilteredList<T>(props: FilteredListProps<T>) {
})
const reset = () => {
if (props.noInitialSelection) {
list.setActive("")
return
}
const all = flat()
if (all.length === 0) return
list.setActive(props.key(all[0]))