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(settings): add Subscription Accounts to personal settings (#23270)

Rdmclin231b250238bf9
diff --git a/src/components/Skeleton/Settings/tabs/SubscriptionAccounts.tsx b/src/components/Skeleton/Settings/tabs/SubscriptionAccounts.tsx
new file mode 100644
index 00000000000..101342417a7
--- /dev/null
+++ b/src/components/Skeleton/Settings/tabs/SubscriptionAccounts.tsx
@@ -0,0 +1,29 @@
+'use client';
+
+import { Flexbox } from '@lobehub/ui';
+import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';
+
+import SkeletonBar from '../../Bar';
+import type { SettingsTabSkeleton } from './types';
+
+/**
+ * What `SubscriptionAccounts` itself shows while its first list read settles:
+ * the refresh button alone (search and the provider filter only appear once
+ * there are accounts) over five row bars, so the hand-over keeps one shape.
+ */
+const Body = () => (
+ <Flexbox gap={16} width={'100%'}>
+ <Flexbox horizontal align={'center'} gap={8} justify={'flex-end'}>
+ <SkeletonBar height={28} width={28} />
+ </Flexbox>
+ <Flexbox gap={4}>
+ {Array.from({ length: 5 }, (_, i) => (
+ <SkeletonBar height={56} key={i} radius={cssVar.borderRadius} />
+ ))}
+ </Flexbox>
+ </Flexbox>
+);
+
+const SubscriptionAccountsSkeleton: SettingsTabSkeleton = { Body };
+
+export default SubscriptionAccountsSkeleton;
diff --git a/src/components/Skeleton/Settings/tabs/index.ts b/src/components/Skeleton/Settings/tabs/index.ts
index f51903b3734..c3ccd1c17c1 100644
--- a/src/components/Skeleton/Settings/tabs/index.ts
+++ b/src/components/Skeleton/Settings/tabs/index.ts
@@ -28,6 +28,7 @@ import ServiceModelSkeleton from './ServiceModel';
import SkillSkeleton from './Skill';
import StatsSkeleton from './Stats';
import StorageSkeleton from './Storage';
+import SubscriptionAccountsSkeleton from './SubscriptionAccounts';
import SystemToolsSkeleton from './SystemTools';
import ToolsSkeleton from './Tools';
import TrashSkeleton from './Trash';
@@ -68,6 +69,7 @@ export const SETTINGS_TAB_SKELETONS: Partial<Record<SettingsTabs, SettingsTabSke
[SettingsTabs.Skill]: SkillSkeleton,
[SettingsTabs.Stats]: StatsSkeleton,
[SettingsTabs.Storage]: StorageSkeleton,
+ [SettingsTabs.SubscriptionAccounts]: SubscriptionAccountsSkeleton,
[SettingsTabs.SystemTools]: SystemToolsSkeleton,
[SettingsTabs.Tools]: ToolsSkeleton,
[SettingsTabs.Trash]: TrashSkeleton,
diff --git a/src/features/Settings/features/componentMap.desktop.ts b/src/features/Settings/features/componentMap.desktop.ts
index 7358820055c..cfba646d0cf 100644
--- a/src/features/Settings/features/componentMap.desktop.ts
+++ b/src/features/Settings/features/componentMap.desktop.ts
@@ -30,6 +30,7 @@ import ServiceModel from '../service-model';
import Skill from '../skill';
import Stats from '../stats';
import Storage from '../storage';
+import SubscriptionAccounts from '../subscription-accounts';
import SystemTools from '../system-tools';
import Tools from '../tools';
import Trash from '../trash';
@@ -53,6 +54,7 @@ export const componentMap = {
[SettingsTabs.Trash]: Trash,
[SettingsTabs.Devices]: Devices,
[SettingsTabs.Environments]: Environments,
+ [SettingsTabs.SubscriptionAccounts]: SubscriptionAccounts,
[SettingsTabs.Labels]: Labels,
// Profile related tabs
[SettingsTabs.Profile]: Profile,
diff --git a/src/features/Settings/features/componentMap.ts b/src/features/Settings/features/componentMap.ts
index eb6726c9a87..f60b1c2ba02 100644
--- a/src/features/Settings/features/componentMap.ts
+++ b/src/features/Settings/features/componentMap.ts
@@ -61,6 +61,9 @@ export const componentMap = {
[SettingsTabs.Environments]: dynamic(() => import('../environments'), {
loading: loading('Settings > Environments'),
}),
+ [SettingsTabs.SubscriptionAccounts]: dynamic(() => import('../subscription-accounts'), {
+ loading: loading('Settings > Subscription Accounts'),
+ }),
[SettingsTabs.Labels]: dynamic(() => import('../labels'), {
loading: loading('Settings > Labels'),
}),
diff --git a/src/features/Settings/features/ownFrameTabs.test.ts b/src/features/Settings/features/ownFrameTabs.test.ts
index f8f95fef6fb..4e532e79d09 100644
--- a/src/features/Settings/features/ownFrameTabs.test.ts
+++ b/src/features/Settings/features/ownFrameTabs.test.ts
@@ -14,6 +14,10 @@ describe('getSettingsContainerMaxWidth', () => {
expect(SETTINGS_PLANS_MAX_WIDTH).toBeGreaterThan(SETTINGS_CONTAINER_MAX_WIDTH);
});
+ it('lets the subscription account list span the pane, as on the workspace page', () => {
+ expect(getSettingsContainerMaxWidth(SettingsTabs.SubscriptionAccounts)).toBe('100%');
+ });
+
it('keeps every other tab on the shared column', () => {
expect(getSettingsContainerMaxWidth(SettingsTabs.Billing)).toBe(SETTINGS_CONTAINER_MAX_WIDTH);
expect(getSettingsContainerMaxWidth(SettingsTabs.Appearance)).toBe(
diff --git a/src/features/Settings/features/ownFrameTabs.ts b/src/features/Settings/features/ownFrameTabs.ts
index 991f1d0ec60..60986d76da3 100644
--- a/src/features/Settings/features/ownFrameTabs.ts
+++ b/src/features/Settings/features/ownFrameTabs.ts
@@ -26,9 +26,17 @@ export const SETTINGS_CONTAINER_MAX_WIDTH = 1024;
*/
export const SETTINGS_PLANS_MAX_WIDTH = 1280;
+/**
+ * Tabs whose content spans the full pane, as on the workspace settings page:
+ * the subscription account list, whose usage columns need the room.
+ */
+const FULL_WIDTH_SETTINGS_TABS = new Set<string>([SettingsTabs.SubscriptionAccounts]);
+
/**
* Content column width for a tab. Every tab shares
- * `SETTINGS_CONTAINER_MAX_WIDTH` except the Plans tab.
+ * `SETTINGS_CONTAINER_MAX_WIDTH` except the Plans tab and the full-width tabs.
*/
-export const getSettingsContainerMaxWidth = (tab: string) =>
- tab === SettingsTabs.Plans ? SETTINGS_PLANS_MAX_WIDTH : SETTINGS_CONTAINER_MAX_WIDTH;
+export const getSettingsContainerMaxWidth = (tab: string): number | string => {
+ if (FULL_WIDTH_SETTINGS_TABS.has(tab)) return '100%';
+ return tab === SettingsTabs.Plans ? SETTINGS_PLANS_MAX_WIDTH : SETTINGS_CONTAINER_MAX_WIDTH;
+};
diff --git a/src/features/Settings/features/tabTitles.ts b/src/features/Settings/features/tabTitles.ts
index 2d71e5262dc..2b29bf43fbc 100644
--- a/src/features/Settings/features/tabTitles.ts
+++ b/src/features/Settings/features/tabTitles.ts
@@ -22,6 +22,7 @@ export const SETTINGS_TAB_TITLE_KEYS: Partial<Record<SettingsTabs, TitleKey>> =
[SettingsTabs.Credits]: ['subscription', 'tab.credits'],
[SettingsTabs.Devices]: ['setting', 'devices.title'],
[SettingsTabs.Environments]: ['setting', 'tab.environments'],
+ [SettingsTabs.SubscriptionAccounts]: ['setting', 'tab.subscriptionAccounts'],
[SettingsTabs.Hotkey]: ['setting', 'tab.hotkey'],
[SettingsTabs.Integrations]: ['setting', 'tab.integrations'],
[SettingsTabs.Labels]: ['setting', 'tab.labels'],
diff --git a/src/features/Settings/hooks/useCategory.tsx b/src/features/Settings/hooks/useCategory.tsx
index aa27fec6b08..4e2cd77d3da 100644
--- a/src/features/Settings/hooks/useCategory.tsx
+++ b/src/features/Settings/hooks/useCategory.tsx
@@ -16,6 +16,7 @@ import {
EllipsisIcon,
EthernetPort,
FlaskConical,
+ GaugeIcon,
Gift,
Info,
KeyboardIcon,
@@ -254,6 +255,13 @@ export const useCategory = () => {
key: SettingsTabs.Devices,
label: t('tab.devices'),
},
+ // The coding-agent subscriptions this member's devices signed in to:
+ // the capacity their agents are balanced onto.
+ {
+ icon: GaugeIcon,
+ key: SettingsTabs.SubscriptionAccounts,
+ label: t('tab.subscriptionAccounts'),
+ },
// Always there: a code environment is a definition, written down before
// anything runs it, and useful with or without a drive to run it on.
{
diff --git a/src/features/Settings/subscription-accounts/index.tsx b/src/features/Settings/subscription-accounts/index.tsx
new file mode 100644
index 00000000000..611bbf0007e
--- /dev/null
+++ b/src/features/Settings/subscription-accounts/index.tsx
@@ -0,0 +1,10 @@
+'use client';
+
+import SubscriptionAccounts from '@/features/SubscriptionAccounts';
+
+/**
+ * The personal pool: the coding-agent subscriptions this member's devices
+ * reported outside any workspace. The same list as the workspace page, without
+ * its Workspace / Private tabs (a personal account has no team to share with).
+ */
+export default SubscriptionAccounts;
diff --git a/src/features/SettingsSearch/items.ts b/src/features/SettingsSearch/items.ts
index 2d3ad33732e..20c89136d83 100644
--- a/src/features/SettingsSearch/items.ts
+++ b/src/features/SettingsSearch/items.ts
@@ -88,6 +88,14 @@ export const TAB_SEARCH_EN_KEYWORDS: Partial<Record<string, string[]>> = {
[SettingsTabs.Hotkey]: ['hotkey', 'shortcut', 'keyboard'],
[SettingsTabs.Labs]: ['labs', 'experiment', 'beta', 'preview', 'developer'],
[SettingsTabs.Memory]: ['memory', 'memories', 'personalization'],
+ [SettingsTabs.SubscriptionAccounts]: [
+ 'subscription accounts',
+ 'claude code',
+ 'codex',
+ 'kimi code',
+ 'quota',
+ 'load balancing',
+ ],
[SettingsTabs.Environments]: [
'sandbox',
'environments',
diff --git a/src/store/global/initialState.ts b/src/store/global/initialState.ts
index 6bfbae0c9ff..fdb6091a00e 100644
--- a/src/store/global/initialState.ts
+++ b/src/store/global/initialState.ts
@@ -105,6 +105,7 @@ export enum SettingsTabs {
Stats = 'stats',
Storage = 'storage',
+ SubscriptionAccounts = 'subscription-accounts',
SystemTools = 'system-tools',
Tools = 'tools',
Trash = 'trash',