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.

πŸ’„ style: expand device settings detail pane (#19680)

Arvin Xucc2f8dccf907
diff --git a/src/features/DeviceManager/DeviceDetailPanel.tsx b/src/features/DeviceManager/DeviceDetailPanel.tsx
index be0deeeae9b..9be1092f968 100644
--- a/src/features/DeviceManager/DeviceDetailPanel.tsx
+++ b/src/features/DeviceManager/DeviceDetailPanel.tsx
@@ -22,10 +22,22 @@ import { getDeviceIcon } from './getDeviceIcon';
import { useCanEditDevice } from './useCanEditDevice';
const styles = createStaticStyles(({ css }) => ({
- container: css`
- padding-block: 16px;
+ // Fills whatever host it lands in: inside a page-level rail the height is
+ // definite, so the body below the header scrolls on its own; inside the
+ // workspace list card the height is auto and the panel simply grows.
+ body: css`
+ overflow-y: auto;
+ flex: 1;
+
+ min-height: 0;
+ padding-block: 16px 24px;
padding-inline: 20px;
`,
+ container: css`
+ overflow: hidden;
+ height: 100%;
+ min-height: 0;
+ `,
dot: css`
flex: none;
width: 8px;
@@ -33,7 +45,9 @@ const styles = createStaticStyles(({ css }) => ({
border-radius: 50%;
`,
header: css`
- padding-block-end: 16px;
+ flex: none;
+ padding-block: 16px;
+ padding-inline: 20px;
border-block-end: 1px solid ${cssVar.colorBorderSecondary};
`,
iconTile: css`
@@ -224,7 +238,7 @@ const DeviceDetailPanel = memo<DeviceDetailPanelProps>(({ device, isCurrent, onC
};
return (
- <Flexbox className={styles.container} gap={20}>
+ <Flexbox className={styles.container}>
{/* ─── Header ─── */}
<Flexbox horizontal align={'center'} className={styles.header} gap={12}>
<span className={styles.iconTile}>{getDeviceIcon(device.platform, 18)}</span>
@@ -244,181 +258,189 @@ const DeviceDetailPanel = memo<DeviceDetailPanelProps>(({ device, isCurrent, onC
<ActionIcon icon={XIcon} size={'small'} onClick={onClose} />
</Flexbox>
- {/* Visible hint when the caller can't mutate the row β€” explains why the
- fields below are read-only without the user needing to try and hit a
- 403. Only renders for workspace devices that aren't the caller's own
- enrollment (personal scope is always editable). */}
- {!canEdit && (
- <Flexbox horizontal align={'center'} gap={8}>
- <Icon icon={LockIcon} size={14} style={{ color: cssVar.colorTextTertiary }} />
- <Text fontSize={12} type={'secondary'}>
- {t('workspaceSetting.devices.readonlyHint')}
- </Text>
- </Flexbox>
- )}
-
- {/* ─── Enrolled by (workspace only) ─── */}
- {device.scope === 'workspace' && device.enroller && (
- <Flexbox gap={8}>
- <FieldLabel>{t('workspaceSetting.devices.enrolledByLabel')}</FieldLabel>
+ <Flexbox className={styles.body} gap={20}>
+ {/* Visible hint when the caller can't mutate the row β€” explains why the
+ fields below are read-only without the user needing to try and hit a
+ 403. Only renders for workspace devices that aren't the caller's own
+ enrollment (personal scope is always editable). */}
+ {!canEdit && (
<Flexbox horizontal align={'center'} gap={8}>
- <Avatar avatar={device.enroller.avatar ?? undefined} size={24} />
- <Text>
- {device.enroller.fullName ||
- device.enroller.username ||
- t('workspaceSetting.devices.unknownEnroller')}
+ <Icon icon={LockIcon} size={14} style={{ color: cssVar.colorTextTertiary }} />
+ <Text fontSize={12} type={'secondary'}>
+ {t('workspaceSetting.devices.readonlyHint')}
</Text>
</Flexbox>
- </Flexbox>
- )}
+ )}
- {/* ─── Shared to workspaces (personal only) ─── */}
- {device.scope === 'personal' && !!device.sharedWorkspaces?.length && (
- <Flexbox gap={8}>
- <FieldLabel>{t('devices.share.detailLabel')}</FieldLabel>
- {device.sharedWorkspaces.map((share) => (
- <Flexbox horizontal align={'center'} gap={8} key={share.workspaceId}>
- <Text ellipsis style={{ flex: 1, minWidth: 0 }}>
- {share.workspaceName ?? share.workspaceId}
- </Text>
- <Tag size={'small'}>
- {share.visibility === 'private'
- ? t('devices.share.visibilityTag.private')
- : t('devices.share.visibilityTag.public')}
- </Tag>
- <ActionIcon
- icon={XIcon}
- size={'small'}
- title={t('devices.share.revoke')}
- onClick={() => handleRevokeShare(share)}
- />
- </Flexbox>
- ))}
- </Flexbox>
- )}
-
- {/* ─── Connections ─── */}
- <Flexbox gap={8}>
- <FieldLabel>{t('devices.detail.connections')}</FieldLabel>
- {channels.length > 0 ? (
- channels.map((channel, index) => (
- <Flexbox horizontal align={'center'} gap={8} key={`${channel.connectedAt}-${index}`}>
- <span className={styles.dot} style={{ background: cssVar.colorSuccess }} />
- {channel.channel && <Tag size={'small'}>{channel.channel}</Tag>}
- <Text fontSize={12} type={'secondary'}>
- {t('devices.channel.connected', { time: dayjs(channel.connectedAt).fromNow() })}
+ {/* ─── Enrolled by (workspace only) ─── */}
+ {device.scope === 'workspace' && device.enroller && (
+ <Flexbox gap={8}>
+ <FieldLabel>{t('workspaceSetting.devices.enrolledByLabel')}</FieldLabel>
+ <Flexbox horizontal align={'center'} gap={8}>
+ <Avatar avatar={device.enroller.avatar ?? undefined} size={24} />
+ <Text>
+ {device.enroller.fullName ||
+ device.enroller.username ||
+ t('workspaceSetting.devices.unknownEnroller')}
</Text>
</Flexbox>
- ))
- ) : (
- <Flexbox horizontal align={'center'} gap={8}>
- <span className={styles.dot} style={{ background: cssVar.colorTextQuaternary }} />
- <Text fontSize={12} type={'secondary'}>
- {t('devices.status.offline')} Β·{' '}
- {t('devices.lastSeen', { time: dayjs(device.lastSeen).fromNow() })}
- </Text>
</Flexbox>
)}
- </Flexbox>
- {/* ─── Name ─── */}
- <Flexbox gap={8}>
- <FieldLabel>{t('devices.edit.friendlyName')}</FieldLabel>
- {canEdit ? (
- <Input
- placeholder={t('devices.edit.friendlyNamePlaceholder')}
- value={name}
- onBlur={commitName}
- onChange={(e) => setName(e.target.value)}
- onPressEnter={commitName}
- />
- ) : device.friendlyName ? (
- // Read-only: render the canonical value (not the local draft), so a
- // value the caller can't actually commit never bleeds through.
- <Text>{device.friendlyName}</Text>
- ) : (
- <Text type={'secondary'}>β€”</Text>
+ {/* ─── Shared to workspaces (personal only) ─── */}
+ {device.scope === 'personal' && !!device.sharedWorkspaces?.length && (
+ <Flexbox gap={8}>
+ <FieldLabel>{t('devices.share.detailLabel')}</FieldLabel>
+ {device.sharedWorkspaces.map((share) => (
+ <Flexbox horizontal align={'center'} gap={8} key={share.workspaceId}>
+ <Text ellipsis style={{ flex: 1, minWidth: 0 }}>
+ {share.workspaceName ?? share.workspaceId}
+ </Text>
+ <Tag size={'small'}>
+ {share.visibility === 'private'
+ ? t('devices.share.visibilityTag.private')
+ : t('devices.share.visibilityTag.public')}
+ </Tag>
+ <ActionIcon
+ icon={XIcon}
+ size={'small'}
+ title={t('devices.share.revoke')}
+ onClick={() => handleRevokeShare(share)}
+ />
+ </Flexbox>
+ ))}
+ </Flexbox>
)}
- </Flexbox>
- {/* ─── Default working directory ─── */}
- <Flexbox gap={8}>
- <FieldLabel>{t('devices.edit.defaultCwd')}</FieldLabel>
- {canEdit ? (
- <Flexbox horizontal gap={8}>
+ {/* ─── Connections ─── */}
+ <Flexbox gap={8}>
+ <FieldLabel>{t('devices.detail.connections')}</FieldLabel>
+ {channels.length > 0 ? (
+ channels.map((channel, index) => (
+ <Flexbox horizontal align={'center'} gap={8} key={`${channel.connectedAt}-${index}`}>
+ <span className={styles.dot} style={{ background: cssVar.colorSuccess }} />
+ {channel.channel && <Tag size={'small'}>{channel.channel}</Tag>}
+ <Text fontSize={12} type={'secondary'}>
+ {t('devices.channel.connected', { time: dayjs(channel.connectedAt).fromNow() })}
+ </Text>
+ </Flexbox>
+ ))
+ ) : (
+ <Flexbox horizontal align={'center'} gap={8}>
+ <span className={styles.dot} style={{ background: cssVar.colorTextQuaternary }} />
+ <Text fontSize={12} type={'secondary'}>
+ {t('devices.status.offline')} Β·{' '}
+ {t('devices.lastSeen', { time: dayjs(device.lastSeen).fromNow() })}
+ </Text>
+ </Flexbox>
+ )}
+ </Flexbox>
+
+ {/* ─── Name ─── */}
+ <Flexbox gap={8}>
+ <FieldLabel>{t('devices.edit.friendlyName')}</FieldLabel>
+ {canEdit ? (
<Input
- placeholder={t('devices.edit.defaultCwdPlaceholder')}
- value={cwd}
- onBlur={handleCwdBlur}
- onChange={(e) => setCwd(e.target.value)}
- onPressEnter={handleCwdBlur}
+ placeholder={t('devices.edit.friendlyNamePlaceholder')}
+ value={name}
+ onBlur={commitName}
+ onChange={(e) => setName(e.target.value)}
+ onPressEnter={commitName}
/>
- {canBrowse && (
- <Button icon={<Icon icon={FolderOpenIcon} />} onClick={handleBrowse}>
- {t('devices.edit.browse')}
- </Button>
- )}
- </Flexbox>
- ) : device.defaultCwd ? (
- // Code font only when there's an actual path to read; empty falls back
- // to the same dash style as Name so the two fields look consistent.
- <Text className={styles.path}>{device.defaultCwd}</Text>
- ) : (
- <Text type={'secondary'}>β€”</Text>
- )}
- </Flexbox>
+ ) : device.friendlyName ? (
+ // Read-only: render the canonical value (not the local draft), so a
+ // value the caller can't actually commit never bleeds through.
+ <Text>{device.friendlyName}</Text>
+ ) : (
+ <Text type={'secondary'}>β€”</Text>
+ )}
+ </Flexbox>
- {/* ─── Recent directories ─── */}
- <Flexbox gap={8}>
- <FieldLabel
- extra={
- canEdit && (
- <ActionIcon
- icon={FolderPlusIcon}
- size={'small'}
- title={t('devices.detail.addDir')}
- onClick={handleAddRecent}
+ {/* ─── Default working directory ─── */}
+ <Flexbox gap={8}>
+ <FieldLabel>{t('devices.edit.defaultCwd')}</FieldLabel>
+ {canEdit ? (
+ <Flexbox horizontal gap={8}>
+ <Input
+ placeholder={t('devices.edit.defaultCwdPlaceholder')}
+ value={cwd}
+ onBlur={handleCwdBlur}
+ onChange={(e) => setCwd(e.target.value)}
+ onPressEnter={handleCwdBlur}
/>
- )
- }
- >
- {t('devices.detail.recentDirs')}
- </FieldLabel>
- {device.workingDirs.length === 0 ? (
- <Text fontSize={12} type={'secondary'}>
- {t('devices.detail.noRecent')}
- </Text>
- ) : canEdit ? (
- <SortableList
- items={device.workingDirs.map((d) => ({ id: d.path, repoType: d.repoType }))}
- renderItem={(item: { id: string; repoType?: 'git' | 'github' }) => (
- <SortableList.Item className={styles.recentItem} id={item.id} variant={'filled'}>
- <SortableList.DragHandle />
- <DirIcon repoType={item.repoType} />
- <Text className={styles.path} title={item.id}>
- {item.id}
- </Text>
+ {canBrowse && (
+ <Button icon={<Icon icon={FolderOpenIcon} />} onClick={handleBrowse}>
+ {t('devices.edit.browse')}
+ </Button>
+ )}
+ </Flexbox>
+ ) : device.defaultCwd ? (
+ // Code font only when there's an actual path to read; empty falls back
+ // to the same dash style as Name so the two fields look consistent.
+ <Text className={styles.path}>{device.defaultCwd}</Text>
+ ) : (
+ <Text type={'secondary'}>β€”</Text>
+ )}
+ </Flexbox>
+
+ {/* ─── Recent directories ─── */}
+ <Flexbox gap={8}>
+ <FieldLabel
+ extra={
+ canEdit && (
<ActionIcon
- icon={XIcon}
+ icon={FolderPlusIcon}
size={'small'}
- onClick={() => handleRemoveRecent(item.id)}
+ title={t('devices.detail.addDir')}
+ onClick={handleAddRecent}
/>
- </SortableList.Item>
- )}
- onChange={handleReorderRecent}
- />
- ) : (
- // Read-only listing: same row layout minus the drag handle and the
- // remove button. Keeps the path + repo type icon visible for context.
- device.workingDirs.map((d) => (
- <Flexbox horizontal align={'center'} className={styles.recentItem} gap={8} key={d.path}>
- <DirIcon repoType={d.repoType} />
- <Text className={styles.path} title={d.path}>
- {d.path}
- </Text>
- </Flexbox>
- ))
- )}
+ )
+ }
+ >
+ {t('devices.detail.recentDirs')}
+ </FieldLabel>
+ {device.workingDirs.length === 0 ? (
+ <Text fontSize={12} type={'secondary'}>
+ {t('devices.detail.noRecent')}
+ </Text>
+ ) : canEdit ? (
+ <SortableList
+ items={device.workingDirs.map((d) => ({ id: d.path, repoType: d.repoType }))}
+ renderItem={(item: { id: string; repoType?: 'git' | 'github' }) => (
+ <SortableList.Item className={styles.recentItem} id={item.id} variant={'filled'}>
+ <SortableList.DragHandle />
+ <DirIcon repoType={item.repoType} />
+ <Text className={styles.path} title={item.id}>
+ {item.id}
+ </Text>
+ <ActionIcon
+ icon={XIcon}
+ size={'small'}
+ onClick={() => handleRemoveRecent(item.id)}
+ />
+ </SortableList.Item>
+ )}
+ onChange={handleReorderRecent}
+ />
+ ) : (
+ // Read-only listing: same row layout minus the drag handle and the
+ // remove button. Keeps the path + repo type icon visible for context.
+ device.workingDirs.map((d) => (
+ <Flexbox
+ horizontal
+ align={'center'}
+ className={styles.recentItem}
+ gap={8}
+ key={d.path}
+ >
+ <DirIcon repoType={d.repoType} />
+ <Text className={styles.path} title={d.path}>
+ {d.path}
+ </Text>
+ </Flexbox>
+ ))
+ )}
+ </Flexbox>
</Flexbox>
</Flexbox>
);
diff --git a/src/features/DeviceManager/DeviceManager.tsx b/src/features/DeviceManager/DeviceManager.tsx
index 12cc8ff6af2..a324b6717e8 100644
--- a/src/features/DeviceManager/DeviceManager.tsx
+++ b/src/features/DeviceManager/DeviceManager.tsx
@@ -253,10 +253,16 @@ const ListSkeleton = memo<{ bordered?: boolean }>(({ bordered }) => (
));
interface DeviceManagerProps {
+ /** Render the selected device in this manager. Disable when the host owns the detail pane. */
+ inlineDetail?: boolean;
/** Open the enrollment wizard (the modal is owned by the route). */
onConnect: (tab?: 'cli' | 'desktop') => void;
+ /** Called when the selected device changes. Providing it enables controlled selection. */
+ onSelectedDeviceChange?: (deviceId?: string) => void;
/** Which device pool this surface manages. */
scope: DeviceScope;
+ /** Controlled selection for hosts that render the detail pane outside the list surface. */
+ selectedDeviceId?: string;
/**
* Workspace scope only: narrow the list to one visibility tab β€” 'public'
* (shared pool) or 'private' (the caller's own private enrollments). Omitted
@@ -271,7 +277,15 @@ interface DeviceManagerProps {
* empty state, filtered to the given `scope` (and, for workspace, the active
* visibility tab).
*/
-const DeviceManager = memo<DeviceManagerProps>(({ onConnect, scope, visibility }) => {
+const DeviceManager = memo<DeviceManagerProps>((props) => {
+ const {
+ inlineDetail = true,
+ onConnect,
+ onSelectedDeviceChange,
+ scope,
+ selectedDeviceId,
+ visibility,
+ } = props;
const { t } = useTranslation('setting');
const isWorkspace = scope === 'workspace';
@@ -294,7 +308,16 @@ const DeviceManager = memo<DeviceManagerProps>(({ onConnect, scope, visibility }
useFetchDeviceInfo();
const currentDeviceId = !isWorkspace && isDesktop ? gatewayDeviceInfo?.deviceId : undefined;
- const [selectedId, setSelectedId] = useState<string>();
+ const [internalSelectedId, setInternalSelectedId] = useState<string>();
+ const selectedId = onSelectedDeviceChange ? selectedDeviceId : internalSelectedId;
+ const setSelectedId = (deviceId?: string) => {
+ if (onSelectedDeviceChange) {
+ onSelectedDeviceChange(deviceId);
+ return;
+ }
+
+ setInternalSelectedId(deviceId);
+ };
// ─── Empty state: onboarding hero + connect options + capabilities ───
// Now gated by AsyncBoundary so a *failed* device fetch renders a failure +
@@ -369,7 +392,12 @@ const DeviceManager = memo<DeviceManagerProps>(({ onConnect, scope, visibility }
>
<Flexbox horizontal align={'flex-start'} gap={16}>
<Flexbox className={isWorkspace ? styles.listCol : styles.plainCol} flex={1}>
- <Flexbox className={styles.listScroll} gap={2} padding={isWorkspace ? 4 : 0}>
+ <Flexbox
+ className={styles.listScroll}
+ gap={2}
+ paddingBlock={4}
+ paddingInline={isWorkspace ? 4 : 0}
+ >
{devices.map((device) => (
<DeviceItem
device={device}
@@ -377,20 +405,20 @@ const DeviceManager = memo<DeviceManagerProps>(({ onConnect, scope, visibility }
key={device.deviceId}
selected={device.deviceId === selectedId}
onSelect={() =>
- setSelectedId((prev) => (prev === device.deviceId ? undefined : device.deviceId))
+ setSelectedId(selectedId === device.deviceId ? undefined : device.deviceId)
}
/>
))}
</Flexbox>
</Flexbox>
- {selected && (
+ {inlineDetail && selected && (
<Flexbox className={styles.detailCol} flex={1}>
{/* keyed on deviceId so the form state resets when the selection changes */}
<DeviceDetailPanel
device={selected}
isCurrent={isCurrent(selected.deviceId)}
key={selected.deviceId}
- onClose={() => setSelectedId(undefined)}
+ onClose={() => setSelectedId()}
/>
</Flexbox>
)}
diff --git a/src/features/DeviceManager/index.ts b/src/features/DeviceManager/index.ts
index edc3c9c6d2a..318d3d60526 100644
--- a/src/features/DeviceManager/index.ts
+++ b/src/features/DeviceManager/index.ts
@@ -1,3 +1,4 @@
export { default as DeviceConnectModal } from './DeviceConnectModal';
+export { default as DeviceDetailPanel } from './DeviceDetailPanel';
export { default as DeviceManager } from './DeviceManager';
export { useDeviceList } from './useDeviceList';
diff --git a/src/features/Settings/devices/index.tsx b/src/features/Settings/devices/index.tsx
index a11353c17cc..3fd23cffa85 100644
--- a/src/features/Settings/devices/index.tsx
+++ b/src/features/Settings/devices/index.tsx
@@ -1,5 +1,6 @@
'use client';
+import { isDesktop } from '@lobechat/const';
import { Flexbox, Form, Icon } from '@lobehub/ui';
import { ActionIcon, Button, Text } from '@lobehub/ui/base-ui';
import { MonitorUpIcon, RefreshCwIcon } from 'lucide-react';
@@ -7,12 +8,26 @@ import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { FORM_STYLE } from '@/const/layoutTokens';
-import { DeviceConnectModal, DeviceManager, useDeviceList } from '@/features/DeviceManager';
+import {
+ DeviceConnectModal,
+ DeviceDetailPanel,
+ DeviceManager,
+ useDeviceList,
+} from '@/features/DeviceManager';
+import NavHeader from '@/features/NavHeader';
+import RightPanel from '@/features/RightPanel';
+import SettingContainer from '@/features/Setting/SettingContainer';
+import { useElectronStore } from '@/store/electron';
-const Page = memo(() => {
+interface PageProps {
+ mobile?: boolean;
+}
+
+const Page = memo<PageProps>(({ mobile }) => {
const { t } = useTranslation('setting');
const [open, setOpen] = useState(false);
const [initialTab, setInitialTab] = useState<'cli' | 'desktop'>();
+ const [selectedDeviceId, setSelectedDeviceId] = useState<string>();
// Shares DeviceManager's SWR entry, so the header actions drive the list it
// renders β€” the same wiring the workspace devices page uses.
const { data, isValidating, mutate } = useDeviceList();
@@ -23,52 +38,116 @@ const Page = memo(() => {
};
const devices = (data ?? []).filter((device) => device.scope === 'personal');
+ const selectedDevice = devices.find((device) => device.deviceId === selectedDeviceId);
- return (
- <>
- <Form
- collapsible={false}
- itemsType={'group'}
- variant={'filled'}
- items={[
- {
- children: <DeviceManager scope={'personal'} onConnect={handleConnect} />,
- extra: (
- <Flexbox horizontal align={'center'} gap={8}>
- {devices.length > 0 && (
- <Text fontSize={12} type={'secondary'} weight={500}>
- {t('devices.selection.total', { count: devices.length })}
- </Text>
- )}
- <Button
- icon={<Icon icon={MonitorUpIcon} />}
- size={'small'}
- onClick={() => handleConnect()}
- >
- {t('devices.connectWizard.button')}
- </Button>
- <ActionIcon
- icon={RefreshCwIcon}
- loading={isValidating}
- size={'small'}
- title={t('devices.actions.refresh')}
- onClick={() => mutate()}
- />
- </Flexbox>
- ),
- title: t('devices.title'),
- },
- ]}
- {...FORM_STYLE}
- />
+ const useFetchDeviceInfo = useElectronStore((s) => s.useFetchGatewayDeviceInfo);
+ const gatewayDeviceInfo = useElectronStore((s) => s.gatewayDeviceInfo);
+ useFetchDeviceInfo();
+ const currentDeviceId = isDesktop ? gatewayDeviceInfo?.deviceId : undefined;
+
+ // Narrow viewports have no room beside the list, so the detail stays inside
+ // the manager (the master-detail stack DeviceManager owns by default).
+ const externalDetail = !mobile;
+
+ const list = (
+ <Form
+ collapsible={false}
+ itemsType={'group'}
+ variant={'filled'}
+ items={[
+ {
+ children: (
+ <DeviceManager
+ inlineDetail={!externalDetail}
+ scope={'personal'}
+ selectedDeviceId={selectedDeviceId}
+ onConnect={handleConnect}
+ onSelectedDeviceChange={setSelectedDeviceId}
+ />
+ ),
+ extra: (
+ <Flexbox horizontal align={'center'} gap={8}>
+ {devices.length > 0 && (
+ <Text fontSize={12} type={'secondary'} weight={500}>
+ {t('devices.selection.total', { count: devices.length })}
+ </Text>
+ )}
+ <Button
+ icon={<Icon icon={MonitorUpIcon} />}
+ size={'small'}
+ onClick={() => handleConnect()}
+ >
+ {t('devices.connectWizard.button')}
+ </Button>
+ <ActionIcon
+ icon={RefreshCwIcon}
+ loading={isValidating}
+ size={'small'}
+ title={t('devices.actions.refresh')}
+ onClick={() => mutate()}
+ />
+ </Flexbox>
+ ),
+ title: t('devices.title'),
+ },
+ ]}
+ {...FORM_STYLE}
+ />
+ );
- <DeviceConnectModal
- initialTab={initialTab}
- open={open}
- scope={'personal'}
- onClose={() => setOpen(false)}
- />
- </>
+ const connectModal = (
+ <DeviceConnectModal
+ initialTab={initialTab}
+ open={open}
+ scope={'personal'}
+ onClose={() => setOpen(false)}
+ />
+ );
+
+ if (mobile)
+ return (
+ <>
+ {list}
+ {connectModal}
+ </>
+ );
+
+ return (
+ <Flexbox horizontal flex={1} height={'100%'} style={{ overflow: 'hidden' }}>
+ <Flexbox flex={1} height={'100%'} style={{ minWidth: 0 }}>
+ <NavHeader styles={{ center: { alignItems: 'center' } }}>
+ <Text weight={500}>{t('devices.title')}</Text>
+ </NavHeader>
+ {/* The list keeps the settings reading column β€” centered at the shared
+ 1024 max width β€” so opening the detail only narrows the space it
+ centers in, it never turns the page into a left-hugging column. */}
+ <SettingContainer maxWidth={1024} paddingBlock={'24px 128px'} paddingInline={24}>
+ {list}
+ </SettingContainer>
+ </Flexbox>
+ {/* Page-level rail rather than a card beside the list: the detail is a
+ full-height surface with its own scroll, so a device with a long
+ working-directory history stays readable without stretching the page. */}
+ <RightPanel
+ defaultWidth={420}
+ expand={!!selectedDevice}
+ maxWidth={640}
+ minWidth={320}
+ onExpandChange={(next) => {
+ if (!next) setSelectedDeviceId(undefined);
+ }}
+ >
+ {selectedDevice && (
+ <DeviceDetailPanel
+ device={selectedDevice}
+ isCurrent={selectedDevice.deviceId === currentDeviceId}
+ key={selectedDevice.deviceId}
+ onClose={() => setSelectedDeviceId(undefined)}
+ />
+ )}
+ </RightPanel>
+ {connectModal}
+ </Flexbox>
);
});
diff --git a/src/features/Settings/features/SettingsContent.tsx b/src/features/Settings/features/SettingsContent.tsx
index 261ff559b76..fc94a3a7151 100644
--- a/src/features/Settings/features/SettingsContent.tsx
+++ b/src/features/Settings/features/SettingsContent.tsx
@@ -28,7 +28,6 @@ const COMPACT_HEADER_TABS = [
SettingsTabs.Appearance,
SettingsTabs.Billing,
SettingsTabs.Credits,
- SettingsTabs.Devices,
SettingsTabs.Hotkey,
SettingsTabs.Labels,
SettingsTabs.Labs,
@@ -59,7 +58,6 @@ const SettingsContent = ({ mobile, activeTab }: SettingsContentProps) => {
[SettingsTabs.Appearance]: t('setting:tab.appearance'),
[SettingsTabs.Billing]: t('subscription:tab.billing'),
[SettingsTabs.Credits]: t('subscription:tab.credits'),
- [SettingsTabs.Devices]: t('setting:devices.title'),
[SettingsTabs.Hotkey]: t('setting:tab.hotkey'),
[SettingsTabs.Labels]: t('setting:tab.labels'),
// Labs has no `setting:tab.*` entry β€” the nav label comes from the labs namespace.
@@ -97,6 +95,7 @@ const SettingsContent = ({ mobile, activeTab }: SettingsContentProps) => {
if (
[
SettingsTabs.About,
+ SettingsTabs.Devices,
SettingsTabs.ServiceModel,
SettingsTabs.Provider,
SettingsTabs.Profile,
@@ -125,6 +124,7 @@ const SettingsContent = ({ mobile, activeTab }: SettingsContentProps) => {
<>
{Object.keys(componentMap).map((tabKey) => {
const isFullWidth =
+ tabKey === SettingsTabs.Devices ||
tabKey === SettingsTabs.Provider ||
tabKey === SettingsTabs.Skill ||
tabKey === SettingsTabs.Connector ||