Skip to content

Commit 443e8e1

Browse files
committed
feat: enhance timeline UI with slide-in animation and improved layout
- Add slide-in animation for timeline panel using framer-motion - Implement responsive layout adjustments when timeline is open - Add close button (X icon) to timeline header for better UX - Wrap timeline in AnimatePresence for smooth enter/exit transitions - Adjust main content and floating prompt input positioning when timeline is visible - Improve timeline visual hierarchy with proper header and content sections - Add spring animation with damping for smooth timeline panel transitions
1 parent 2dfdf31 commit 443e8e1

1 file changed

Lines changed: 60 additions & 23 deletions

File tree

src/components/ClaudeCodeSession.tsx

Lines changed: 60 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import {
99
ChevronDown,
1010
GitBranch,
1111
Settings,
12-
Globe
12+
Globe,
13+
X
1314
} from "lucide-react";
1415
import { Button } from "@/components/ui/button";
1516
import { Input } from "@/components/ui/input";
@@ -971,7 +972,10 @@ export const ClaudeCodeSession: React.FC<ClaudeCodeSessionProps> = ({
971972
</motion.div>
972973

973974
{/* Main Content Area */}
974-
<div className="flex-1 overflow-hidden">
975+
<div className={cn(
976+
"flex-1 overflow-hidden transition-all duration-300",
977+
showTimeline && "sm:mr-96"
978+
)}>
975979
{showPreview ? (
976980
// Split pane layout when preview is active
977981
<SplitPane
@@ -1018,29 +1022,62 @@ export const ClaudeCodeSession: React.FC<ClaudeCodeSessionProps> = ({
10181022
</div>
10191023

10201024
{/* Floating Prompt Input - Always visible */}
1021-
<ErrorBoundary>
1022-
<FloatingPromptInput
1023-
ref={floatingPromptRef}
1024-
onSend={handleSendPrompt}
1025-
onCancel={handleCancelExecution}
1026-
isLoading={isLoading}
1027-
disabled={!projectPath}
1028-
projectPath={projectPath}
1029-
/>
1030-
</ErrorBoundary>
1025+
<div className={cn(
1026+
"fixed bottom-0 left-0 right-0 transition-all duration-300 z-50",
1027+
showTimeline && "sm:right-96"
1028+
)}>
1029+
<ErrorBoundary>
1030+
<FloatingPromptInput
1031+
ref={floatingPromptRef}
1032+
onSend={handleSendPrompt}
1033+
onCancel={handleCancelExecution}
1034+
isLoading={isLoading}
1035+
disabled={!projectPath}
1036+
projectPath={projectPath}
1037+
/>
1038+
</ErrorBoundary>
1039+
</div>
10311040

10321041
{/* Timeline */}
1033-
{showTimeline && effectiveSession && (
1034-
<TimelineNavigator
1035-
sessionId={effectiveSession.id}
1036-
projectId={effectiveSession.project_id}
1037-
projectPath={projectPath}
1038-
currentMessageIndex={messages.length - 1}
1039-
onCheckpointSelect={handleCheckpointSelect}
1040-
onFork={handleFork}
1041-
refreshVersion={timelineVersion}
1042-
/>
1043-
)}
1042+
<AnimatePresence>
1043+
{showTimeline && effectiveSession && (
1044+
<motion.div
1045+
initial={{ x: "100%" }}
1046+
animate={{ x: 0 }}
1047+
exit={{ x: "100%" }}
1048+
transition={{ type: "spring", damping: 20, stiffness: 300 }}
1049+
className="fixed right-0 top-0 h-full w-full sm:w-96 bg-background border-l border-border shadow-xl z-30 overflow-hidden"
1050+
>
1051+
<div className="h-full flex flex-col">
1052+
{/* Timeline Header */}
1053+
<div className="flex items-center justify-between p-4 border-b border-border">
1054+
<h3 className="text-lg font-semibold">Session Timeline</h3>
1055+
<Button
1056+
variant="ghost"
1057+
size="icon"
1058+
onClick={() => setShowTimeline(false)}
1059+
className="h-8 w-8"
1060+
>
1061+
<X className="h-4 w-4" />
1062+
</Button>
1063+
</div>
1064+
1065+
{/* Timeline Content */}
1066+
<div className="flex-1 overflow-y-auto p-4">
1067+
<TimelineNavigator
1068+
sessionId={effectiveSession.id}
1069+
projectId={effectiveSession.project_id}
1070+
projectPath={projectPath}
1071+
currentMessageIndex={messages.length - 1}
1072+
onCheckpointSelect={handleCheckpointSelect}
1073+
onFork={handleFork}
1074+
refreshVersion={timelineVersion}
1075+
/>
1076+
</div>
1077+
</div>
1078+
</motion.div>
1079+
)}
1080+
</AnimatePresence>
10441081
</div>
10451082

10461083
{/* Fork Dialog */}

0 commit comments

Comments
 (0)