fix(F2,F3): onboarding chip in Header, auth catch-all redirects to dashboard
Some checks failed
app-ci-deploy / test-build-deploy (push) Has been cancelled

F3: authenticated unknown routes now redirect to /dashboard instead of
rendering private NotFound.

F2: Header shows a warning Chip with the current onboarding next_step
when the user has not completed onboarding (next_step != 'ready').
Chip navigates to /dashboard on click. Hidden on xs screens.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
kcar 2026-05-31 11:00:55 +00:00
parent fedbd903ff
commit bf592886c6
2 changed files with 12 additions and 2 deletions

View File

@ -169,8 +169,8 @@ const AppRoutes: React.FC = () => {
</Route> </Route>
)} )}
{/* Fallback route - use different NotFound pages based on auth state */} {/* Fallback route - authenticated users go to dashboard, unauthenticated see public 404 */}
<Route path="*" element={user ? <NotFound /> : <NotFoundPublic />} /> <Route path="*" element={user ? <Navigate to="/dashboard" replace /> : <NotFoundPublic />} />
</Routes> </Routes>
</Layout> </Layout>
); );

View File

@ -7,6 +7,7 @@ import {
Typography, Typography,
IconButton, IconButton,
Box, Box,
Chip,
useTheme, useTheme,
Menu, Menu,
MenuItem, MenuItem,
@ -126,6 +127,15 @@ const Header: React.FC = () => {
</Typography> </Typography>
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2 }}> <Box sx={{ display: 'flex', alignItems: 'center', gap: 2 }}>
{isAuthenticated && bootstrapData?.onboarding?.next_step && bootstrapData.onboarding.next_step !== 'ready' && (
<Chip
label={bootstrapData.onboarding.next_step.replace(/_/g, ' ')}
color="warning"
size="small"
onClick={() => navigate('/dashboard')}
sx={{ cursor: 'pointer', display: { xs: 'none', sm: 'flex' } }}
/>
)}
{isAuthenticated && ( {isAuthenticated && (
<Typography <Typography
variant="body2" variant="body2"