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.

🐛 fix(onboarding): remove the workspace onboarding lab flag and send its settings read unbatched (#21401)

Rdmclin28eae86af3065
diff --git a/locales/en-US/labs.json b/locales/en-US/labs.json
index f5d61ed3df1..8a493d58eca 100644
--- a/locales/en-US/labs.json
+++ b/locales/en-US/labs.json
@@ -46,8 +46,6 @@
"features.taskVerify.title": "Acceptance",
"features.topicBugReport.desc": "Adds Report Bug to the topic menu. Send the topic’s IDs, your app environment, and optional attachments to the LobeHub support team.",
"features.topicBugReport.title": "Report Bug",
- "features.workspaceOnboarding.desc": "When you first enter a workspace you just created, set it up with the new guided flow: connect the team’s apps, get a team profile, hire the team assistant, invite members, connect team chats and devices, and pick starter tasks. Off keeps the previous setup flow.",
- "features.workspaceOnboarding.title": "New Workspace Onboarding",
"group.desktop": "Desktop",
"group.general": "General",
"group.workspace": "Workspace",
diff --git a/locales/en-US/setting.json b/locales/en-US/setting.json
index ec474902099..ee417d65c3d 100644
--- a/locales/en-US/setting.json
+++ b/locales/en-US/setting.json
@@ -3287,6 +3287,9 @@
"workspace.onboarding.flow.invite.send_one": "Invite {{count}} member",
"workspace.onboarding.flow.invite.send_other": "Invite {{count}} members",
"workspace.onboarding.flow.invite.skip": "Skip for now, invite later",
+ "workspace.onboarding.flow.learnYourTeam.budget.desc": "The team analysis uses this workspace's credits, and the balance can't cover it. Top up or upgrade the plan, then retry, or skip the analysis and finish the setup.",
+ "workspace.onboarding.flow.learnYourTeam.budget.skip": "Skip analysis",
+ "workspace.onboarding.flow.learnYourTeam.budget.title": "Not enough workspace credits for the team analysis",
"workspace.onboarding.flow.learnYourTeam.description": "Building your team profile",
"workspace.onboarding.flow.learnYourTeam.error": "Couldn't finish the team analysis. Retry or skip for now.",
"workspace.onboarding.flow.learnYourTeam.hint": "💡 You can skip ahead; the analysis keeps running in the background",
diff --git a/locales/zh-CN/labs.json b/locales/zh-CN/labs.json
index ec11dad6bf1..e1c74f61d01 100644
--- a/locales/zh-CN/labs.json
+++ b/locales/zh-CN/labs.json
@@ -46,8 +46,6 @@
"features.taskVerify.title": "任务交付验收",
"features.topicBugReport.desc": "在话题菜单中增加「报告问题」,将话题 ID、应用环境和可选附件发送给 LobeHub 支持团队。",
"features.topicBugReport.title": "报告问题",
- "features.workspaceOnboarding.desc": "首次进入新建的 Workspace 时使用新版引导:接入团队应用、生成团队画像、雇佣团队助手、邀请成员、接入团队聊天群和设备,并挑选第一批任务。关闭时沿用原来的引导流程。",
- "features.workspaceOnboarding.title": "新版 Workspace 引导",
"group.desktop": "桌面端",
"group.general": "通用",
"group.workspace": "Workspace",
diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.json
index b4b8bba961f..535771d8e60 100644
--- a/locales/zh-CN/setting.json
+++ b/locales/zh-CN/setting.json
@@ -3287,6 +3287,9 @@
"workspace.onboarding.flow.invite.send_one": "邀请 {{count}} 位成员",
"workspace.onboarding.flow.invite.send_other": "邀请 {{count}} 位成员",
"workspace.onboarding.flow.invite.skip": "先跳过,稍后邀请",
+ "workspace.onboarding.flow.learnYourTeam.budget.desc": "团队分析会消耗工作区积分,当前余额不足以完成这次分析。充值或升级套餐后可以重试,也可以跳过分析,继续完成设置。",
+ "workspace.onboarding.flow.learnYourTeam.budget.skip": "跳过分析",
+ "workspace.onboarding.flow.learnYourTeam.budget.title": "工作区积分不足,无法完成团队分析",
"workspace.onboarding.flow.learnYourTeam.description": "正在构建团队画像",
"workspace.onboarding.flow.learnYourTeam.error": "没能完成团队分析,可以重试或先跳过。",
"workspace.onboarding.flow.learnYourTeam.hint": "💡 可以先跳过,分析会在后台继续完成",
diff --git a/packages/locales/src/default/labs.ts b/packages/locales/src/default/labs.ts
index 5642fd57a24..996d7b01f4a 100644
--- a/packages/locales/src/default/labs.ts
+++ b/packages/locales/src/default/labs.ts
@@ -69,9 +69,6 @@ export default {
'features.topicBugReport.desc':
'Adds Report Bug to the topic menu. Send the topic’s IDs, your app environment, and optional attachments to the LobeHub support team.',
'features.topicBugReport.title': 'Report Bug',
- 'features.workspaceOnboarding.desc':
- 'When you first enter a workspace you just created, set it up with the new guided flow: connect the team’s apps, get a team profile, hire the team assistant, invite members, connect team chats and devices, and pick starter tasks. Off keeps the previous setup flow.',
- 'features.workspaceOnboarding.title': 'New Workspace Onboarding',
'group.desktop': 'Desktop',
'group.general': 'General',
'group.workspace': 'Workspace',
diff --git a/packages/locales/src/default/setting.ts b/packages/locales/src/default/setting.ts
index 44019768f11..bea94c896bf 100644
--- a/packages/locales/src/default/setting.ts
+++ b/packages/locales/src/default/setting.ts
@@ -3597,6 +3597,11 @@ When I am ___, I need ___
'💡 You can skip ahead; the analysis keeps running in the background',
'workspace.onboarding.flow.learnYourTeam.error':
"Couldn't finish the team analysis. Retry or skip for now.",
+ 'workspace.onboarding.flow.learnYourTeam.budget.title':
+ 'Not enough workspace credits for the team analysis',
+ 'workspace.onboarding.flow.learnYourTeam.budget.desc':
+ "The team analysis uses this workspace's credits, and the balance can't cover it. Top up or upgrade the plan, then retry, or skip the analysis and finish the setup.",
+ 'workspace.onboarding.flow.learnYourTeam.budget.skip': 'Skip analysis',
'workspace.onboarding.flow.learnYourTeam.progress.review':
'Reading team data from connected apps',
'workspace.onboarding.flow.learnYourTeam.progress.build':
diff --git a/packages/trpc/src/client/lambda.test.ts b/packages/trpc/src/client/lambda.test.ts
index e050bbcb22e..9e60980e40c 100644
--- a/packages/trpc/src/client/lambda.test.ts
+++ b/packages/trpc/src/client/lambda.test.ts
@@ -192,6 +192,24 @@ describe('lambdaClient transport lanes', () => {
expect(tokenUrl).not.toContain('agent.getAgentConfigById');
});
+ // Entering a workspace revalidates every SWR key at once; batched, the read
+ // that decides whether to open workspace onboarding waited for the slowest
+ // home read and the admin stayed on the home page.
+ it('sends the workspace settings read as its own unbatched request', async () => {
+ fetchMock.mockImplementation(respondByLane);
+
+ await Promise.all([
+ lambdaClient.workspace.getSettings.query(),
+ lambdaClient.agent.getAgentConfigById.query({ agentId: 'agt_test' }),
+ ]);
+
+ expect(fetchMock).toHaveBeenCalledTimes(2);
+ const settingsUrl = requestedUrls().find((url) => url.includes('workspace.getSettings'));
+ expect(settingsUrl).toBeDefined();
+ expect(settingsUrl).not.toContain('batch=1');
+ expect(settingsUrl).not.toContain('agent.getAgentConfigById');
+ });
+
// One-shot relay: the server reads the channel this tab subscribed from the
// request headers, so the call carries its own headers and never shares a
// batch with calls that must not be relayed.
diff --git a/packages/trpc/src/client/lambda.ts b/packages/trpc/src/client/lambda.ts
index 77c43a1036b..a005dbf50bf 100644
--- a/packages/trpc/src/client/lambda.ts
+++ b/packages/trpc/src/client/lambda.ts
@@ -219,6 +219,10 @@ const latencyCriticalProcedures = new Set([
'aiAgent.refreshGatewayToken',
// The share-visitor mirror of the same reconnect handshake.
'shareChat.refreshGatewayToken',
+ // Decides whether entering a workspace opens its onboarding page. Entering a
+ // workspace revalidates every SWR key at once; batched, this read waited for
+ // the slowest home read and the admin stayed on the home page.
+ 'workspace.getSettings',
]);
const SKIP_BATCH_PROCEDURES = new Set([
...initialLoadProcedures,
diff --git a/packages/types/src/user/preference.ts b/packages/types/src/user/preference.ts
index f0d9f2699f3..aef88d5bd10 100644
--- a/packages/types/src/user/preference.ts
+++ b/packages/types/src/user/preference.ts
@@ -249,11 +249,6 @@ export const UserLabSchema = z.object({
* instead of being thrown away with the sandbox
*/
enablePersistentSandbox: z.boolean().optional(),
- /**
- * show the redesigned onboarding flow when this user first enters a newly
- * created workspace (the previous flow otherwise)
- */
- enableWorkspaceOnboardingV2: z.boolean().optional(),
});
export type UserLab = z.infer<typeof UserLabSchema>;
diff --git a/src/features/Settings/labs/features.ts b/src/features/Settings/labs/features.ts
index b8d2edd2144..3983fb31870 100644
--- a/src/features/Settings/labs/features.ts
+++ b/src/features/Settings/labs/features.ts
@@ -31,8 +31,7 @@ type LabFeatureI18nKey =
| 'persistentSandbox'
| 'projects'
| 'selfLearning'
- | 'topicBugReport'
- | 'workspaceOnboarding';
+ | 'topicBugReport';
export interface LabFeatureItem {
/**
@@ -141,13 +140,6 @@ const ALL_LAB_FEATURES: LabFeatureItem[] = [
searchKeywords: ['artifact', 'deploy', 'publish'],
stage: 'beta',
},
- {
- flag: 'enableWorkspaceOnboardingV2',
- i18nKey: 'workspaceOnboarding',
- searchKeywords: ['workspace', 'onboarding', 'team setup'],
- stage: 'alpha',
- workspaceOnly: true,
- },
{
desktopOnly: true,
flag: 'enableDesktopSplitView',
diff --git a/src/features/Settings/labs/index.test.tsx b/src/features/Settings/labs/index.test.tsx
index 93d00a92b17..f0c03088770 100644
--- a/src/features/Settings/labs/index.test.tsx
+++ b/src/features/Settings/labs/index.test.tsx
@@ -165,15 +165,9 @@ describe('Labs settings page', () => {
);
});
- it('shows the workspace group only to users with workspace access', () => {
- renderPage();
- expect(screen.queryByText('group.workspace')).toBeNull();
- expect(screen.queryByText('features.workspaceOnboarding.title')).toBeNull();
- cleanup();
-
+ it('does not render an empty workspace group', () => {
renderPage({ enableWorkspace: true });
- expect(screen.getByText('group.workspace')).toBeDefined();
- expect(screen.getByText('features.workspaceOnboarding.title')).toBeDefined();
+ expect(screen.queryByText('group.workspace')).toBeNull();
});
it('marks internal-testing experiments as alpha and usable ones as beta', () => {
diff --git a/src/features/SettingsSearch/items.test.ts b/src/features/SettingsSearch/items.test.ts
index 75177246ee4..15a3b52621e 100644
--- a/src/features/SettingsSearch/items.test.ts
+++ b/src/features/SettingsSearch/items.test.ts
@@ -44,18 +44,6 @@ describe('settings search index', () => {
}
});
- it('shows workspace-only lab features only to users with workspace access', () => {
- const labsItems = SETTINGS_SEARCH_ITEMS.filter((item) => item.tab === SettingsTabs.Labs);
- const workspaceFeatures = LAB_FEATURES.filter((feature) => feature.workspaceOnly);
- expect(workspaceFeatures.length).toBeGreaterThan(0);
-
- for (const feature of workspaceFeatures) {
- const item = labsItems.find(({ anchor }) => anchor === `labs-${feature.flag}`)!;
- expect(item.visible?.({ ...webContext, enableWorkspace: true })).toBe(true);
- expect(item.visible?.(webContext)).toBe(false);
- }
- });
-
it('indexes the inbox notification channel', () => {
expect(SETTINGS_SEARCH_ITEMS.some((item) => item.anchor === 'notification-inbox')).toBe(true);
});
diff --git a/src/store/user/slices/preference/selectors/labPrefer.ts b/src/store/user/slices/preference/selectors/labPrefer.ts
index 8b4e78c9b36..6adf226fed9 100644
--- a/src/store/user/slices/preference/selectors/labPrefer.ts
+++ b/src/store/user/slices/preference/selectors/labPrefer.ts
@@ -36,6 +36,4 @@ export const labPreferSelectors = {
s.preference.lab?.enableTopicAcceptance ?? s.preference.lab?.enableGoals ?? false,
enableTaskVerify: (s: UserState): boolean => s.preference.lab?.enableTaskVerify ?? false,
enableTopicBugReport: (s: UserState): boolean => s.preference.lab?.enableTopicBugReport ?? false,
- enableWorkspaceOnboardingV2: (s: UserState): boolean =>
- s.preference.lab?.enableWorkspaceOnboardingV2 ?? false,
};