Skip to content

Commit f137783

Browse files
committed
feat(ui): enhance timeline sidebar with slide-in animation and responsive layout
- Add slide-in animation to timeline sidebar using framer-motion - Implement responsive layout adjustments for main content area - Add proper timeline header with close button - Fix floating prompt input positioning to accommodate timeline - Reorder CSS imports for proper style precedence - Fix animation scaling issue in rotating symbol keyframes The timeline now slides in from the right with a smooth spring animation and properly adjusts the main content area width on larger screens.
1 parent 2d73a38 commit f137783

File tree

3 files changed

+59
-23
lines changed

3 files changed

+59
-23
lines changed

src/components/ClaudeCodeSession.tsx

Lines changed: 56 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,10 @@ export const ClaudeCodeSession: React.FC<ClaudeCodeSessionProps> = ({
10761076
</motion.div>
10771077

10781078
{/* Main Content Area */}
1079-
<div className="flex-1 overflow-hidden">
1079+
<div className={cn(
1080+
"flex-1 overflow-hidden transition-all duration-300",
1081+
showTimeline && "sm:mr-96"
1082+
)}>
10801083
{showPreview ? (
10811084
// Split pane layout when preview is active
10821085
<SplitPane
@@ -1241,14 +1244,19 @@ export const ClaudeCodeSession: React.FC<ClaudeCodeSessionProps> = ({
12411244
</motion.div>
12421245
)}
12431246

1244-
<FloatingPromptInput
1245-
ref={floatingPromptRef}
1246-
onSend={handleSendPrompt}
1247-
onCancel={handleCancelExecution}
1248-
isLoading={isLoading}
1249-
disabled={!projectPath}
1250-
projectPath={projectPath}
1251-
/>
1247+
<div className={cn(
1248+
"fixed bottom-0 left-0 right-0 transition-all duration-300 z-50",
1249+
showTimeline && "sm:right-96"
1250+
)}>
1251+
<FloatingPromptInput
1252+
ref={floatingPromptRef}
1253+
onSend={handleSendPrompt}
1254+
onCancel={handleCancelExecution}
1255+
isLoading={isLoading}
1256+
disabled={!projectPath}
1257+
projectPath={projectPath}
1258+
/>
1259+
</div>
12521260

12531261
{/* Token Counter - positioned under the Send button */}
12541262
{totalTokens > 0 && (
@@ -1274,17 +1282,45 @@ export const ClaudeCodeSession: React.FC<ClaudeCodeSessionProps> = ({
12741282
</ErrorBoundary>
12751283

12761284
{/* Timeline */}
1277-
{showTimeline && effectiveSession && (
1278-
<TimelineNavigator
1279-
sessionId={effectiveSession.id}
1280-
projectId={effectiveSession.project_id}
1281-
projectPath={projectPath}
1282-
currentMessageIndex={messages.length - 1}
1283-
onCheckpointSelect={handleCheckpointSelect}
1284-
onFork={handleFork}
1285-
refreshVersion={timelineVersion}
1286-
/>
1287-
)}
1285+
<AnimatePresence>
1286+
{showTimeline && effectiveSession && (
1287+
<motion.div
1288+
initial={{ x: "100%" }}
1289+
animate={{ x: 0 }}
1290+
exit={{ x: "100%" }}
1291+
transition={{ type: "spring", damping: 20, stiffness: 300 }}
1292+
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"
1293+
>
1294+
<div className="h-full flex flex-col">
1295+
{/* Timeline Header */}
1296+
<div className="flex items-center justify-between p-4 border-b border-border">
1297+
<h3 className="text-lg font-semibold">Session Timeline</h3>
1298+
<Button
1299+
variant="ghost"
1300+
size="icon"
1301+
onClick={() => setShowTimeline(false)}
1302+
className="h-8 w-8"
1303+
>
1304+
<X className="h-4 w-4" />
1305+
</Button>
1306+
</div>
1307+
1308+
{/* Timeline Content */}
1309+
<div className="flex-1 overflow-y-auto p-4">
1310+
<TimelineNavigator
1311+
sessionId={effectiveSession.id}
1312+
projectId={effectiveSession.project_id}
1313+
projectPath={projectPath}
1314+
currentMessageIndex={messages.length - 1}
1315+
onCheckpointSelect={handleCheckpointSelect}
1316+
onFork={handleFork}
1317+
refreshVersion={timelineVersion}
1318+
/>
1319+
</div>
1320+
</div>
1321+
</motion.div>
1322+
)}
1323+
</AnimatePresence>
12881324
</div>
12891325

12901326
{/* Fork Dialog */}

src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import React from "react";
22
import ReactDOM from "react-dom/client";
33
import App from "./App";
44
import { ErrorBoundary } from "./components/ErrorBoundary";
5-
import "./styles.css";
65
import "./assets/shimmer.css";
6+
import "./styles.css";
77

88
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
99
<React.StrictMode>

src/styles.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,9 @@ button:focus-visible,
423423
/* Rotating symbol animation */
424424
@keyframes rotate-symbol {
425425
0% { content: "◐"; transform: scale(1); }
426-
25% { content: "◓"; transform: scale(10); }
426+
25% { content: "◓"; transform: scale(1); }
427427
50% { content: "◑"; transform: scale(1); }
428-
75% { content: "◒"; transform: scale(10); }
428+
75% { content: "◒"; transform: scale(1); }
429429
100% { content: "◐"; transform: scale(1); }
430430
}
431431

0 commit comments

Comments
 (0)