解决pnpm lint问题
This commit is contained in:
@@ -7,7 +7,11 @@ import { open } from "@tauri-apps/plugin-dialog"
|
|||||||
import Image from "next/image"
|
import Image from "next/image"
|
||||||
import { useTranslations } from "next-intl"
|
import { useTranslations } from "next-intl"
|
||||||
import { Button } from "@/components/ui/button"
|
import { Button } from "@/components/ui/button"
|
||||||
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"
|
import {
|
||||||
|
Popover,
|
||||||
|
PopoverContent,
|
||||||
|
PopoverTrigger,
|
||||||
|
} from "@/components/ui/popover"
|
||||||
import { Textarea } from "@/components/ui/textarea"
|
import { Textarea } from "@/components/ui/textarea"
|
||||||
import { Ellipsis, FileSearch, Plus, Send, Square, X } from "lucide-react"
|
import { Ellipsis, FileSearch, Plus, Send, Square, X } from "lucide-react"
|
||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils"
|
||||||
@@ -1133,9 +1137,7 @@ export function MessageInput({
|
|||||||
<Plus className="size-4" />
|
<Plus className="size-4" />
|
||||||
</Button>
|
</Button>
|
||||||
{/* 宽屏内联显示,窄屏(<300px)通过"更多"气泡显示 */}
|
{/* 宽屏内联显示,窄屏(<300px)通过"更多"气泡显示 */}
|
||||||
<div className="hidden @[300px]:contents">
|
<div className="hidden @[300px]:contents">{selectorItems}</div>
|
||||||
{selectorItems}
|
|
||||||
</div>
|
|
||||||
{hasAnySelector && (
|
{hasAnySelector && (
|
||||||
<Popover>
|
<Popover>
|
||||||
<PopoverTrigger asChild>
|
<PopoverTrigger asChild>
|
||||||
|
|||||||
@@ -245,6 +245,10 @@ const ConversationTabView = memo(function ConversationTabView({
|
|||||||
disconnect: connDisconnect,
|
disconnect: connDisconnect,
|
||||||
sessionId: connSessionId,
|
sessionId: connSessionId,
|
||||||
} = conn
|
} = conn
|
||||||
|
const connStatusRef = useRef(connStatus)
|
||||||
|
useEffect(() => {
|
||||||
|
connStatusRef.current = connStatus
|
||||||
|
}, [connStatus])
|
||||||
const isConnecting =
|
const isConnecting =
|
||||||
connStatus === "connecting" || connStatus === "downloading"
|
connStatus === "connecting" || connStatus === "downloading"
|
||||||
const connectionModes = useMemo(
|
const connectionModes = useMemo(
|
||||||
@@ -281,7 +285,7 @@ const ConversationTabView = memo(function ConversationTabView({
|
|||||||
// resetting syncState while streaming. The useEffect with the
|
// resetting syncState while streaming. The useEffect with the
|
||||||
// connStatus === "prompting" guard will handle it naturally
|
// connStatus === "prompting" guard will handle it naturally
|
||||||
// once prompting ends.
|
// once prompting ends.
|
||||||
if (prevStatusRef.current === "prompting") return
|
if (connStatusRef.current === "prompting") return
|
||||||
acknowledgePersistedDetail(refreshConversationId, refreshed)
|
acknowledgePersistedDetail(refreshConversationId, refreshed)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setSyncState(refreshConversationId, "failed")
|
setSyncState(refreshConversationId, "failed")
|
||||||
@@ -348,11 +352,14 @@ const ConversationTabView = memo(function ConversationTabView({
|
|||||||
acknowledgePersistedDetail(dbConversationId, detail)
|
acknowledgePersistedDetail(dbConversationId, detail)
|
||||||
}, [acknowledgePersistedDetail, connStatus, dbConversationId, detail])
|
}, [acknowledgePersistedDetail, connStatus, dbConversationId, detail])
|
||||||
|
|
||||||
const prevStatusRef = useRef(connStatus)
|
const [prevConnStatus, setPrevConnStatus] = useState(connStatus)
|
||||||
|
const promptingJustEnded =
|
||||||
|
prevConnStatus === "prompting" && connStatus !== "prompting"
|
||||||
|
if (prevConnStatus !== connStatus) {
|
||||||
|
setPrevConnStatus(connStatus)
|
||||||
|
}
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const prev = prevStatusRef.current
|
if (!promptingJustEnded) return
|
||||||
prevStatusRef.current = connStatus
|
|
||||||
if (prev !== "prompting" || connStatus === "prompting") return
|
|
||||||
|
|
||||||
setSyncState(effectiveConversationId, "reconciling")
|
setSyncState(effectiveConversationId, "reconciling")
|
||||||
const persistedId = dbConvIdRef.current
|
const persistedId = dbConvIdRef.current
|
||||||
@@ -374,6 +381,7 @@ const ConversationTabView = memo(function ConversationTabView({
|
|||||||
}, [
|
}, [
|
||||||
clearReconcileTimer,
|
clearReconcileTimer,
|
||||||
connStatus,
|
connStatus,
|
||||||
|
promptingJustEnded,
|
||||||
effectiveConversationId,
|
effectiveConversationId,
|
||||||
refreshConversations,
|
refreshConversations,
|
||||||
refreshFromDb,
|
refreshFromDb,
|
||||||
|
|||||||
Reference in New Issue
Block a user