mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-12 02:37:45 +08:00
feat: 集成 NativeSessionPanel 到 HistoryPage,支持查看原生CLI会话
在历史记录页面中集成 NativeSessionPanel 组件,用户可通过 ConversationCard 的下拉菜单查看 Gemini/Codex/Qwen 原生会话详情。
This commit is contained in:
@@ -18,6 +18,7 @@ import { cn } from '@/lib/utils';
|
|||||||
import { useHistory } from '@/hooks/useHistory';
|
import { useHistory } from '@/hooks/useHistory';
|
||||||
import { ConversationCard } from '@/components/shared/ConversationCard';
|
import { ConversationCard } from '@/components/shared/ConversationCard';
|
||||||
import { CliStreamPanel } from '@/components/shared/CliStreamPanel';
|
import { CliStreamPanel } from '@/components/shared/CliStreamPanel';
|
||||||
|
import { NativeSessionPanel } from '@/components/shared/NativeSessionPanel';
|
||||||
import { Button } from '@/components/ui/Button';
|
import { Button } from '@/components/ui/Button';
|
||||||
import { Input } from '@/components/ui/Input';
|
import { Input } from '@/components/ui/Input';
|
||||||
import {
|
import {
|
||||||
@@ -50,6 +51,8 @@ export function HistoryPage() {
|
|||||||
const [deleteTarget, setDeleteTarget] = React.useState<string | null>(null);
|
const [deleteTarget, setDeleteTarget] = React.useState<string | null>(null);
|
||||||
const [selectedExecution, setSelectedExecution] = React.useState<string | null>(null);
|
const [selectedExecution, setSelectedExecution] = React.useState<string | null>(null);
|
||||||
const [isPanelOpen, setIsPanelOpen] = React.useState(false);
|
const [isPanelOpen, setIsPanelOpen] = React.useState(false);
|
||||||
|
const [nativeExecutionId, setNativeExecutionId] = React.useState<string | null>(null);
|
||||||
|
const [isNativePanelOpen, setIsNativePanelOpen] = React.useState(false);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
executions,
|
executions,
|
||||||
@@ -88,6 +91,12 @@ export function HistoryPage() {
|
|||||||
setIsPanelOpen(true);
|
setIsPanelOpen(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// View native session handler
|
||||||
|
const handleViewNative = (execution: CliExecution) => {
|
||||||
|
setNativeExecutionId(execution.id);
|
||||||
|
setIsNativePanelOpen(true);
|
||||||
|
};
|
||||||
|
|
||||||
// Delete handlers
|
// Delete handlers
|
||||||
const handleDeleteClick = (id: string) => {
|
const handleDeleteClick = (id: string) => {
|
||||||
setDeleteType('single');
|
setDeleteType('single');
|
||||||
@@ -274,6 +283,7 @@ export function HistoryPage() {
|
|||||||
key={execution.id}
|
key={execution.id}
|
||||||
execution={execution}
|
execution={execution}
|
||||||
onClick={handleCardClick}
|
onClick={handleCardClick}
|
||||||
|
onViewNative={handleViewNative}
|
||||||
onDelete={handleDeleteClick}
|
onDelete={handleDeleteClick}
|
||||||
actionsDisabled={isDeleting}
|
actionsDisabled={isDeleting}
|
||||||
/>
|
/>
|
||||||
@@ -288,6 +298,13 @@ export function HistoryPage() {
|
|||||||
onOpenChange={setIsPanelOpen}
|
onOpenChange={setIsPanelOpen}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{/* Native Session Panel */}
|
||||||
|
<NativeSessionPanel
|
||||||
|
executionId={nativeExecutionId || ''}
|
||||||
|
open={isNativePanelOpen}
|
||||||
|
onOpenChange={setIsNativePanelOpen}
|
||||||
|
/>
|
||||||
|
|
||||||
{/* Delete Confirmation Dialog */}
|
{/* Delete Confirmation Dialog */}
|
||||||
<Dialog open={deleteDialogOpen} onOpenChange={setDeleteDialogOpen}>
|
<Dialog open={deleteDialogOpen} onOpenChange={setDeleteDialogOpen}>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
|
|||||||
Reference in New Issue
Block a user