add landing page - #505
Conversation
Greptile OverviewGreptile SummaryAdded a visually engaging landing page with an interactive staircase animation for unauthenticated users. The new landing page replaces the simple centered layout with a split-screen design featuring an animated staircase that responds to mouse movement. Key Changes:
Minor Performance Concerns:
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant HomePage
participant useAuth
participant LandingPage
participant InteractiveStaircase
participant ChatInterface
User->>HomePage: Navigate to root path
HomePage->>useAuth: Check auth status
alt Not authenticated
useAuth-->>HomePage: User not logged in
HomePage->>LandingPage: Render landing page
LandingPage->>InteractiveStaircase: Mount with anchorTop prop
InteractiveStaircase->>InteractiveStaircase: Calculate initial layout
InteractiveStaircase->>InteractiveStaircase: Add resize listener
User->>InteractiveStaircase: Mouse move
InteractiveStaircase->>InteractiveStaircase: Calculate distance and scale
InteractiveStaircase-->>User: Animate squares
User->>LandingPage: Click sign in button
LandingPage-->>User: Navigate to auth page
else Authenticated
useAuth-->>HomePage: User logged in
HomePage->>ChatInterface: Render chat interface
ChatInterface-->>User: Show chat UI
end
|
| > | ||
| {squares.map(({ col, row, key }) => { | ||
| const rightPos = (gridSize - 1 - col) * stepSize | ||
| const verticalPos = row * stepSize |
There was a problem hiding this comment.
getBoundingClientRect() called inside map() causes layout thrashing on every square render - move outside the loop for better performance
| setLayout({ gridSize, squareSize: Math.max(squareSize, 40) }) | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
50ms delay for layout calculation seems arbitrary - check if this causes visible layout shifts on mount
|
@claude can u optimize the code "getBoundingClientRect() called inside map() causes layout thrashing on every square render - move outside the loop for better performance" |
- Cache container rect in ref to avoid getBoundingClientRect() on every mouse move - Replace arbitrary 50ms setTimeout with requestAnimationFrame for proper timing - Remove unused ChangelogButton import Addresses review feedback from Greptile about layout thrashing and timing. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
leoisadev1
left a comment
There was a problem hiding this comment.
LGTM! The landing page looks good and the performance optimizations have been applied:
Fixes applied:
- ✅ getBoundingClientRect() optimization - Container rect is now cached in a ref and only updated on resize, avoiding layout thrashing on every mouse move
- ✅ setTimeout(50) replaced - Now uses
requestAnimationFramefor proper timing of initial layout calculation - ✅ Removed unused import -
ChangelogButtonimport cleaned up
The interactive staircase animation should now be much smoother, especially on lower-end devices.
No description provided.