feat: 集成 NativeSessionPanel 到 HistoryPage,支持查看原生CLI会话

在历史记录页面中集成 NativeSessionPanel 组件,用户可通过
ConversationCard 的下拉菜单查看 Gemini/Codex/Qwen 原生会话详情。
This commit is contained in:
catlog22
2026-02-06 23:10:22 +08:00
parent 3d862e6ed8
commit 62a1c9ab21

View File

@@ -18,6 +18,7 @@ import { cn } from '@/lib/utils';
import { useHistory } from '@/hooks/useHistory';
import { ConversationCard } from '@/components/shared/ConversationCard';
import { CliStreamPanel } from '@/components/shared/CliStreamPanel';
import { NativeSessionPanel } from '@/components/shared/NativeSessionPanel';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import {
@@ -50,6 +51,8 @@ export function HistoryPage() {
const [deleteTarget, setDeleteTarget] = React.useState<string | null>(null);
const [selectedExecution, setSelectedExecution] = React.useState<string | null>(null);
const [isPanelOpen, setIsPanelOpen] = React.useState(false);
const [nativeExecutionId, setNativeExecutionId] = React.useState<string | null>(null);
const [isNativePanelOpen, setIsNativePanelOpen] = React.useState(false);
const {
executions,
@@ -88,6 +91,12 @@ export function HistoryPage() {
setIsPanelOpen(true);
};
// View native session handler
const handleViewNative = (execution: CliExecution) => {
setNativeExecutionId(execution.id);
setIsNativePanelOpen(true);
};
// Delete handlers
const handleDeleteClick = (id: string) => {
setDeleteType('single');
@@ -274,6 +283,7 @@ export function HistoryPage() {
key={execution.id}
execution={execution}
onClick={handleCardClick}
onViewNative={handleViewNative}
onDelete={handleDeleteClick}
actionsDisabled={isDeleting}
/>
@@ -288,6 +298,13 @@ export function HistoryPage() {
onOpenChange={setIsPanelOpen}
/>
{/* Native Session Panel */}
<NativeSessionPanel
executionId={nativeExecutionId || ''}
open={isNativePanelOpen}
onOpenChange={setIsNativePanelOpen}
/>
{/* Delete Confirmation Dialog */}
<Dialog open={deleteDialogOpen} onOpenChange={setDeleteDialogOpen}>
<DialogContent>