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(workspace-settings): restore provider list scrolling in desktop (#20479)

Rdmclin2f3d4cbf1b592
diff --git a/apps/server/src/services/agentDocuments/modifyNodes.regression.test.ts b/apps/server/src/services/agentDocuments/modifyNodes.regression.test.ts
index b33b9cc6688..6588835b2c7 100644
--- a/apps/server/src/services/agentDocuments/modifyNodes.regression.test.ts
+++ b/apps/server/src/services/agentDocuments/modifyNodes.regression.test.ts
@@ -182,10 +182,10 @@ describe('agent document modifyNodes regressions', () => {
expect(twice.content).toBe('# T\n\n- one\n- two v3\n- three\n');
});
- // Upstream @lobehub/editor re-parses a modified node without keeping its key,
- // so the id changes after every modify. A stale id in a later batch is now
- // rejected loudly (R5); keeping the id needs the editor dependency to change.
- it.fails('R7b modifying a <li> keeps its id', async () => {
+ // @lobehub/editor 4.29.2 keeps a modified node's key, so the id survives a
+ // modify and a later batch can keep addressing it. The floor in package.json
+ // pins that behavior; before it, the editor re-parsed the node under a new id.
+ it('R7b modifying a <li> keeps its id', async () => {
const base = await load('# T\n\n- one\n- two\n- three\n');
const id = liId(base.litexml!, 'two');
const once = await editThenRead(base, [
diff --git a/package.json b/package.json
index c9bddbab968..ebbe0d63b3b 100644
--- a/package.json
+++ b/package.json
@@ -322,7 +322,7 @@
"@lobehub/analytics": "^1.6.4",
"@lobehub/charts": "^5.4.0",
"@lobehub/desktop-ipc-typings": "workspace:*",
- "@lobehub/editor": "^4.27.3",
+ "@lobehub/editor": "^4.29.2",
"@lobehub/icons": "^5.18.0",
"@lobehub/market-sdk": "0.42.0",
"@lobehub/tts": "^5.1.2",
diff --git a/src/features/WorkspaceSetting/Layout.test.tsx b/src/features/WorkspaceSetting/Layout.test.tsx
index d87a84f02ce..9d622dad5e9 100644
--- a/src/features/WorkspaceSetting/Layout.test.tsx
+++ b/src/features/WorkspaceSetting/Layout.test.tsx
@@ -3,7 +3,7 @@ import { renderToStaticMarkup } from 'react-dom/server';
import { MemoryRouter, Route, Routes } from 'react-router';
import { describe, expect, it, vi } from 'vitest';
-import { WorkspaceSettingsContentLayout } from './Layout';
+import WorkspaceSettingsLayout, { WorkspaceSettingsContentLayout } from './Layout';
vi.mock('@/features/NavHeader', () => ({
default: ({ children }: { children?: React.ReactNode }) =>
@@ -97,3 +97,23 @@ describe('WorkspaceSettingsContentLayout', () => {
expect(html).toContain('<main><div>Page content</div></main>');
});
});
+
+describe('WorkspaceSettingsLayout', () => {
+ // Electron tab panes are plain block boxes, so full-bleed pages (Provider)
+ // need the layout itself to give the outlet a bounded flex column to scroll.
+ it('renders the outlet inside a full-height flex container', () => {
+ const html = renderToStaticMarkup(
+ <MemoryRouter initialEntries={['/acme/settings/provider']}>
+ <Routes>
+ <Route element={<WorkspaceSettingsLayout />} path="/:workspaceSlug/settings">
+ <Route element={<div>Provider page</div>} path=":tab" />
+ </Route>
+ </Routes>
+ </MemoryRouter>,
+ );
+
+ expect(html).toMatch(
+ /<div class="lobe-flex" style="[^"]*--lobe-flex:1;[^"]*--lobe-flex-height:100%[^"]*overflow:hidden;position:relative"><div>Provider page<\/div><\/div>/,
+ );
+ });
+});
diff --git a/src/features/WorkspaceSetting/Layout.tsx b/src/features/WorkspaceSetting/Layout.tsx
index 85c306d778f..d4d43deb3c4 100644
--- a/src/features/WorkspaceSetting/Layout.tsx
+++ b/src/features/WorkspaceSetting/Layout.tsx
@@ -1,7 +1,8 @@
'use client';
+import { Flexbox } from '@lobehub/ui';
import { Text } from '@lobehub/ui/base-ui';
-import { type FC, memo } from 'react';
+import { type CSSProperties, type FC, memo } from 'react';
import { useTranslation } from 'react-i18next';
import { Outlet, useMatch } from 'react-router';
@@ -39,17 +40,26 @@ const COMPACT_HEADER_TABS = new Set<string>([
WorkspaceSettingsTabs.Usage,
]);
+const outletContainerStyle: CSSProperties = { overflow: 'hidden', position: 'relative' };
+
/**
* Bare workspace settings shell — sidebar + outlet, no content padding.
* Use this when a child route owns its own full-bleed layout (e.g. Provider).
+ *
+ * The outlet sits in its own full-height flex column: on web the router outlet
+ * is already a flex item, but each Electron tab pane is a plain block box, so
+ * full-bleed pages sized with `max-height: 100%` (Provider) lost their bounded
+ * height there and their inner scroll area stopped scrolling.
*/
const WorkspaceSettingsLayout: FC = () => {
return (
<>
<SideBar />
- <RouteSkeletonChromeProvider>
- <Outlet />
- </RouteSkeletonChromeProvider>
+ <Flexbox allowShrink flex={1} height={'100%'} style={outletContainerStyle} width={'100%'}>
+ <RouteSkeletonChromeProvider>
+ <Outlet />
+ </RouteSkeletonChromeProvider>
+ </Flexbox>
</>
);
};