Refactor Landing Page with Auto-Auth Flow (v2.0.0-alpha-3)#133
Merged
Conversation
…cture - Move landing page into (landing) route group with dedicated components - Add LandingHeader with logo, nav links, and auth-aware sign-in button - Add HeroSection with version badge, gradient heading, and CTA buttons - Add TerminalDemo with interactive CLI simulation and file tree display - Remove old monolithic app/page.tsx in favor of component-based structure - Remove global span color rule that was overriding button text colors - Replace dead <a href="#"> link with non-interactive <span> in terminal demo - Always show 'Start Building Now' on CTA button regardless of auth state - Clean up unused isAuthenticated prop from HeroSection
- Refactored LandingPage to a Server Component with ISR data fetching - Created LandingClient component to handle auth and navigation logic - Updated LandingHeader to display live GitHub star count - Added global prefers-reduced-motion CSS rule for accessibility
- Auto-trigger Sealos authentication on page load - Use ancestorOrigins for reliable Sealos environment detection - Replace full-screen loading overlay with button-only loading state - Add dynamic button text based on auth status and environment - Hoist static JSX outside component to avoid re-creation on every render - Reorganize hero-section.tsx with high-level first structure The authentication flow now automatically attempts Sealos auth on page load if the environment is detected, providing a smoother UX. Button text dynamically updates to 'Go to Projects' or 'Start Building Now' based on authentication status and environment.
✅ PR Check Results: PassedBuild Checks
✨ Great work!All checks passed successfully. Your PR is ready for review. Details:
🔗 View Details: |
Wrap setState calls in queueMicrotask to prevent synchronous state updates within useEffect, which can trigger cascading renders. Also fix import sorting via eslint --fix. Fixes react-hooks/set-state-in-effect lint warning.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor Landing Page with Auto-Auth Flow (v2.0.0-alpha-3)
Overview
Complete overhaul of the marketing landing page, transitioning from a centered card layout to a professional dual-pane enterprise design. Implemented automatic Sealos authentication flow that triggers on page load, eliminating manual user intervention.
Key Changes
🎨 Visual Design Overhaul
🔐 Authentication Flow Refactor
Previous Flow (User-initiated):
New Flow (Auto-triggered):
ancestorOrigins→ Auto-authenticate → Button shows loading → Success → User clicks "Go to Projects"Key Improvements:
ancestorOrigins[0]🏗️ Architecture Improvements
Route Group Pattern:
Server/Client Separation:
page.tsx: Server Component - Fetches GitHub stars via ISR (1-hour cache)landing-client.tsx: Client Component - All interactive logic and state management🚀 Performance Optimizations
revalidate: 3600)Files Changed
Modified
app/(landing)/_components/hero-section.tsx- Dynamic button text, static JSX optimizationapp/(landing)/_components/landing-client.tsx- Auto-auth logic, state managementapp/(landing)/_components/landing-header.tsx- Server-fetched star count, dynamic button textprovider/sealos.tsx- Simplified environment detection withancestorOriginsapp/globals.css- Added cursor blink animation, reduced motion supportapp/page.tsx- Removed (replaced by landing page improvements)package.json- Version bumpAdded
app/(landing)/page.tsx- Server Component with ISRapp/(landing)/_components/terminal-demo.tsx- Interactive terminal showcaseTechnical Highlights
Sealos Environment Detection
Auto-Authentication Logic
Server-Side Star Count with ISR
Testing Scenarios
✅ Scenario 1: Sealos Environment (Unauthenticated)
✅ Scenario 2: Sealos Environment (Authenticated)
/projects✅ Scenario 3: Standard Environment (Unauthenticated)
/login✅ Scenario 4: Standard Environment (Authenticated)
/projects✅ Scenario 5: Error Handling
Design System Compliance
All components strictly follow
docs/design-system.md:text-foreground,bg-background,border-border)font-[family-name:var(--font-heading)])role,aria-*)Code Quality
Breaking Changes
None. The landing page is completely redesigned but maintains backward compatibility with existing auth flows.
Next Steps
react-iconsimports in Next.js configcomponents/home-page.tsxandMatrixRain.tsxScreenshots
Commits:
45b4d79- refactor(landing): improve auth flow and optimize rendering87ad21a- chore: update project version9707770- feat: add server-side star count & interactive landing client2808a9f- refactor: rebuild landing page with route group and component architectureStats: 9 files changed, 578 insertions(+), 17 deletions(-)