Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

✨ feat: enhance onboarding process by removing mode selection step and adding export functionality in advanced settings

YuTengjing8b6c30ebef25
diff --git a/package.json b/package.json
index 3be93fcc9be..ad1572f2126 100644
--- a/package.json
+++ b/package.json
@@ -32,7 +32,7 @@
"apps/desktop/src/main"
],
"scripts": {
- "prebuild": "tsx scripts/prebuild.mts && npm run lint",
+ "prebuild": "echo $NEXT_PUBLIC_AUTH_URL && echo $NEXTAUTH_URL && echo $APP_URL && echo $VERCEL_URL && tsx scripts/prebuild.mts && npm run lint",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 next build --webpack",
"postbuild": "npm run build-sitemap && npm run build-migrate-db",
"build-migrate-db": "bun run db:migrate",
diff --git a/src/app/[variants]/(main)/settings/storage/Advanced.tsx b/src/app/[variants]/(main)/settings/storage/Advanced.tsx
index b4986b14d14..1b3ee0cc9ad 100644
--- a/src/app/[variants]/(main)/settings/storage/Advanced.tsx
+++ b/src/app/[variants]/(main)/settings/storage/Advanced.tsx
@@ -1,6 +1,6 @@
'use client';
-import { BRANDING_NAME } from '@lobechat/business-const';
+import { BRANDING_NAME, ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const';
import { DEFAULT_SETTINGS } from '@lobechat/config';
import { Button, Form, type FormGroupItemType, Icon } from '@lobehub/ui';
import { App, Switch } from 'antd';
@@ -83,6 +83,24 @@ const AdvancedActions = () => {
title: t('analytics.title'),
};
+ const renderExportButtonFormItem = () => {
+ return {
+ children: (
+ <Button
+ icon={<Icon icon={HardDriveUpload} />}
+ onClick={() => {
+ configService.exportAll();
+ }}
+ >
+ {t('storage.actions.export.button')}
+ </Button>
+ ),
+ label: t('storage.actions.export.title'),
+ layout: 'horizontal',
+ minWidth: undefined,
+ } as const;
+ };
+
const system: FormGroupItemType = {
children: [
{
@@ -97,21 +115,7 @@ const AdvancedActions = () => {
layout: 'horizontal',
minWidth: undefined,
},
- {
- children: (
- <Button
- icon={<Icon icon={HardDriveUpload} />}
- onClick={() => {
- configService.exportAll();
- }}
- >
- {t('storage.actions.export.button')}
- </Button>
- ),
- label: t('storage.actions.export.title'),
- layout: 'horizontal',
- minWidth: undefined,
- },
+ ...(ENABLE_BUSINESS_FEATURES ? [renderExportButtonFormItem()] : []),
{
children: (
<Button danger onClick={handleClear} type={'primary'}>
diff --git a/src/app/[variants]/onboarding/index.tsx b/src/app/[variants]/onboarding/index.tsx
index 879ac68b932..a556131dd0a 100644
--- a/src/app/[variants]/onboarding/index.tsx
+++ b/src/app/[variants]/onboarding/index.tsx
@@ -10,7 +10,6 @@ import { onboardingSelectors } from '@/store/user/selectors';
import OnboardingContainer from './_layout';
import FullNameStep from './features/FullNameStep';
import InterestsStep from './features/InterestsStep';
-import ModeSelectionStep from './features/ModeSelectionStep';
import ProSettingsStep from './features/ProSettingsStep';
import ResponseLanguageStep from './features/ResponseLanguageStep';
import TelemetryStep from './features/TelemetryStep';
@@ -42,9 +41,6 @@ const OnboardingPage = memo(() => {
return <ResponseLanguageStep onBack={goToPreviousStep} onNext={goToNextStep} />;
}
case 5: {
- return <ModeSelectionStep onBack={goToPreviousStep} onNext={goToNextStep} />;
- }
- case 6: {
return <ProSettingsStep onBack={goToPreviousStep} />;
}
default: {
diff --git a/src/store/user/slices/onboarding/action.ts b/src/store/user/slices/onboarding/action.ts
index ca06ac7a0ba..55d1db73a2f 100644
--- a/src/store/user/slices/onboarding/action.ts
+++ b/src/store/user/slices/onboarding/action.ts
@@ -81,10 +81,12 @@ export const createOnboardingSlice: StateCreator<
while (get().stepUpdateQueue.length > 0) {
const step = get().stepUpdateQueue[0];
+ const finishedAt = onboardingSelectors.finishedAt(get());
try {
await userService.updateOnboarding({
currentStep: step,
+ finishedAt,
version: CURRENT_ONBOARDING_VERSION,
});
} catch (error) {
@@ -125,8 +127,10 @@ export const createOnboardingSlice: StateCreator<
// Optimistic update
set({ localOnboardingStep: step }, false, 'setOnboardingStep/optimistic');
+ const finishedAt = onboardingSelectors.finishedAt(get());
await userService.updateOnboarding({
currentStep: step,
+ finishedAt,
version: CURRENT_ONBOARDING_VERSION,
});