收口 Makelore 客户端变更
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
inman
2026-08-12 22:35:06 +08:00
parent 253bad8b40
commit f4113a872f
232 changed files with 4617 additions and 20121 deletions

View File

@@ -15,11 +15,21 @@ const moduleSelectionContent: Record<AiModuleId, { label: string; image: string;
learning: { label: 'Learning 学习', image: moduleLearningImage, imageAlt: '数学科技宇宙' },
};
export function ModuleSelection() {
export function ModuleSelection({ authRequired = true }: { authRequired?: boolean }) {
const navigate = useNavigate();
const authUser = useAuthStore((state) => state.user);
const authenticated = useAuthStore((state) => state.isAuthenticated());
const userDisplayName = getAuthUserDisplayName(authUser);
const openModule = (route: string | null) => {
if (!route) return;
if (authRequired && !authenticated) {
navigate('/login');
return;
}
navigate(route);
};
return (
<main data-testid="ai-module-selection-page" className="relative min-h-[100dvh] overflow-auto bg-background px-4 py-6 text-foreground sm:px-8 sm:py-10">
<div className="mx-auto flex min-h-[calc(100dvh-3rem)] max-w-6xl flex-col">
@@ -47,9 +57,7 @@ export function ModuleSelection() {
type="button"
data-testid={`ai-module-option-${module.id}`}
disabled={!module.enabled}
onClick={() => {
if (module.route) navigate(module.route);
}}
onClick={() => openModule(module.route)}
aria-label={`${content.label}:${module.description}`}
className={cn(
'module-option-card group motion-press flex h-[254px] w-full max-w-[190px] flex-col justify-end rounded-lg border border-transparent bg-transparent p-0 text-left shadow-none disabled:cursor-not-allowed disabled:bg-transparent disabled:text-muted-foreground/70 disabled:opacity-75',