feat(setup): implement functional setup wizard with multi-step flow
Add complete setup wizard implementation with the following features: - Welcome step with feature highlights - Environment check step with Node.js, OpenClaw, and Gateway verification - AI Provider selection with API key input and validation UI - Channel connection step with QR code placeholder - Skill bundle selection with recommended bundles pre-selected - Completion summary showing all configured options Additional changes: - Add setupComplete state and markSetupComplete action to settings store - Auto-redirect to setup wizard on first launch - Track setup completion in persisted settings
This commit is contained in:
11
src/App.tsx
11
src/App.tsx
@@ -2,7 +2,7 @@
|
||||
* Root Application Component
|
||||
* Handles routing and global providers
|
||||
*/
|
||||
import { Routes, Route, useNavigate } from 'react-router-dom';
|
||||
import { Routes, Route, useNavigate, useLocation } from 'react-router-dom';
|
||||
import { useEffect } from 'react';
|
||||
import { Toaster } from 'sonner';
|
||||
import { MainLayout } from './components/layout/MainLayout';
|
||||
@@ -18,7 +18,9 @@ import { useGatewayStore } from './stores/gateway';
|
||||
|
||||
function App() {
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
const theme = useSettingsStore((state) => state.theme);
|
||||
const setupComplete = useSettingsStore((state) => state.setupComplete);
|
||||
const initGateway = useGatewayStore((state) => state.init);
|
||||
|
||||
// Initialize Gateway connection on mount
|
||||
@@ -26,6 +28,13 @@ function App() {
|
||||
initGateway();
|
||||
}, [initGateway]);
|
||||
|
||||
// Redirect to setup wizard if not complete
|
||||
useEffect(() => {
|
||||
if (!setupComplete && !location.pathname.startsWith('/setup')) {
|
||||
navigate('/setup');
|
||||
}
|
||||
}, [setupComplete, location.pathname, navigate]);
|
||||
|
||||
// Listen for navigation events from main process
|
||||
useEffect(() => {
|
||||
const handleNavigate = (...args: unknown[]) => {
|
||||
|
||||
Reference in New Issue
Block a user