fix(web): improve logs panel scroll handling (#2305)
- forward refs through ScrollArea so logs can access the viewport - keep logs pinned to the bottom only when the user is already near it - apply import and className ordering cleanup across frontend components
This commit is contained in:
1 parent
7f7b4c430b
commit
bd56e10bb8
13 files changed
+97
-53
No files matched your search
@@ -38,7 +38,7 @@ export function MarketSkillCard({
|
||||
|
||||
return (
|
||||
<Card
|
||||
className="group relative overflow-hidden border-border/40 bg-card/40 transition-all hover:border-border/80 hover:bg-card hover:shadow-md"
|
||||
className="group border-border/40 bg-card/40 hover:border-border/80 hover:bg-card relative overflow-hidden transition-all hover:shadow-md"
|
||||
size="sm"
|
||||
>
|
||||
{result.installed && (
|
||||
@@ -51,16 +51,16 @@ export function MarketSkillCard({
|
||||
<CardTitle className="text-base font-semibold tracking-tight">
|
||||
{result.display_name || result.slug}
|
||||
</CardTitle>
|
||||
<span className="inline-flex items-center rounded-md bg-muted/60 px-2 py-0.5 text-[10px] font-semibold tracking-wider text-muted-foreground uppercase ring-1 ring-inset ring-border/50">
|
||||
<span className="bg-muted/60 text-muted-foreground ring-border/50 inline-flex items-center rounded-md px-2 py-0.5 text-[10px] font-semibold tracking-wider uppercase ring-1 ring-inset">
|
||||
{result.registry_name}
|
||||
</span>
|
||||
{result.installed ? (
|
||||
<span className="inline-flex items-center rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-600 ring-1 ring-inset ring-emerald-500/20">
|
||||
<span className="inline-flex items-center rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-600 ring-1 ring-emerald-500/20 ring-inset">
|
||||
{t("pages.agent.skills.marketplace_installed")}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
<div className="font-mono text-xs text-muted-foreground opacity-80">
|
||||
<div className="text-muted-foreground font-mono text-xs opacity-80">
|
||||
{result.slug}
|
||||
{result.version ? (
|
||||
<span className="text-muted-foreground/60">
|
||||
@@ -78,7 +78,7 @@ export function MarketSkillCard({
|
||||
href={result.url}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="inline-flex text-xs text-primary/80 transition-colors hover:text-primary hover:underline hover:underline-offset-4"
|
||||
className="text-primary/80 hover:text-primary inline-flex text-xs transition-colors hover:underline hover:underline-offset-4"
|
||||
>
|
||||
{result.url}
|
||||
</a>
|
||||
@@ -109,7 +109,7 @@ export function MarketSkillCard({
|
||||
variant="outline"
|
||||
size="xs"
|
||||
onClick={onViewInstalled}
|
||||
className="w-full shadow-sm hover:bg-muted"
|
||||
className="hover:bg-muted w-full shadow-sm"
|
||||
>
|
||||
<IconFileInfo className="mr-1 size-3.5" />
|
||||
{t("pages.agent.skills.marketplace_view_installed")}
|
||||
|
||||
@@ -2,7 +2,9 @@ import type { TFunction } from "i18next"
|
||||
|
||||
import type { ToolSupportItem } from "@/api/tools"
|
||||
|
||||
type MarketplaceTool = Pick<ToolSupportItem, "status" | "reason_code"> | undefined
|
||||
type MarketplaceTool =
|
||||
| Pick<ToolSupportItem, "status" | "reason_code">
|
||||
| undefined
|
||||
|
||||
export interface UnavailableToolMessage {
|
||||
key: "search" | "install"
|
||||
|
||||
@@ -5,17 +5,17 @@ import {
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query"
|
||||
import { useNavigate } from "@tanstack/react-router"
|
||||
import { useEffect, useRef, useState, type UIEvent } from "react"
|
||||
import { type UIEvent, useEffect, useRef, useState } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { toast } from "sonner"
|
||||
|
||||
import {
|
||||
type SkillRegistrySearchResult,
|
||||
type SkillSearchResponse,
|
||||
type SkillSupportItem,
|
||||
getSkills,
|
||||
installSkill,
|
||||
searchSkills,
|
||||
type SkillSearchResponse,
|
||||
type SkillRegistrySearchResult,
|
||||
type SkillSupportItem,
|
||||
} from "@/api/skills"
|
||||
import { getTools } from "@/api/tools"
|
||||
|
||||
@@ -71,7 +71,7 @@ export function useHubMarketplace() {
|
||||
Number(pageParam) || 0,
|
||||
),
|
||||
getNextPageParam: (lastPage: SkillSearchResponse) =>
|
||||
lastPage.has_more ? lastPage.next_offset ?? undefined : undefined,
|
||||
lastPage.has_more ? (lastPage.next_offset ?? undefined) : undefined,
|
||||
enabled: isMarketSearchActive,
|
||||
staleTime: 5 * 60 * 1000,
|
||||
refetchOnMount: false,
|
||||
@@ -112,9 +112,7 @@ export function useHubMarketplace() {
|
||||
!marketSearchData &&
|
||||
(isMarketSearchPending || isMarketSearchFetching)
|
||||
const isMarketSearchLoadingMore =
|
||||
isMarketSearchActive &&
|
||||
Boolean(marketSearchData) &&
|
||||
isFetchingNextPage
|
||||
isMarketSearchActive && Boolean(marketSearchData) && isFetchingNextPage
|
||||
const installPendingKey =
|
||||
installMutation.isPending && installMutation.variables
|
||||
? `${installMutation.variables.registry}:${installMutation.variables.slug}`
|
||||
@@ -179,7 +177,9 @@ export function useHubMarketplace() {
|
||||
void fetchNextPage()
|
||||
}
|
||||
|
||||
const getInstalledSkill = (installedName?: string): SkillSupportItem | null => {
|
||||
const getInstalledSkill = (
|
||||
installedName?: string,
|
||||
): SkillSupportItem | null => {
|
||||
if (!installedName) {
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import { IconLoader2, IconTrash } from "@tabler/icons-react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
|
||||
import type { SkillSupportItem } from "@/api/skills"
|
||||
import {
|
||||
AlertDialog,
|
||||
@@ -9,8 +12,6 @@ import {
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from "@/components/ui/alert-dialog"
|
||||
import { IconLoader2, IconTrash } from "@tabler/icons-react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
|
||||
interface DeleteDialogProps {
|
||||
open: boolean
|
||||
|
||||
@@ -23,10 +23,7 @@ import { Skeleton } from "@/components/ui/skeleton"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
import { OriginBadge } from "./origin-badge"
|
||||
import {
|
||||
getOriginLabel,
|
||||
getSkillOriginKind,
|
||||
} from "./origin-utils"
|
||||
import { getOriginLabel, getSkillOriginKind } from "./origin-utils"
|
||||
import type { SkillDetailView } from "./types"
|
||||
|
||||
const DETAIL_VIEWS = [
|
||||
@@ -86,7 +83,8 @@ export function DetailSheet({
|
||||
</div>
|
||||
<div className="min-w-0 flex-1 space-y-1 text-left">
|
||||
<SheetTitle className="truncate text-xl font-bold tracking-tight">
|
||||
{activeSkillDetail?.name || t("pages.agent.skills.viewer_title")}
|
||||
{activeSkillDetail?.name ||
|
||||
t("pages.agent.skills.viewer_title")}
|
||||
</SheetTitle>
|
||||
<SheetDescription className="line-clamp-2">
|
||||
{activeSkillDetail?.description ||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
IconLayoutGrid,
|
||||
IconLayoutList,
|
||||
IconSearch,
|
||||
} from "@tabler/icons-react"
|
||||
import { IconLayoutGrid, IconLayoutList, IconSearch } from "@tabler/icons-react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
|
||||
import { Input } from "@/components/ui/input"
|
||||
|
||||
@@ -150,7 +150,10 @@ export function useSkillsPage() {
|
||||
}, [allSkills, normalizedSearchQuery, sourceFilter])
|
||||
|
||||
const sortedSkills = useMemo(
|
||||
() => [...filteredSkills].sort((left, right) => compareSkills(left, right, sortOrder)),
|
||||
() =>
|
||||
[...filteredSkills].sort((left, right) =>
|
||||
compareSkills(left, right, sortOrder),
|
||||
),
|
||||
[filteredSkills, sortOrder],
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user