fix(ui): let the project MCP tab scroll with the page

The rail layout gives its list a viewport-height scroll box, which suits the
MCP page but nests a second scroll area under the project page's header and
tabs, and its narrow padding clipped Playful borders.
This commit is contained in:
Willie
2026-09-21 14:05:29 +08:00
parent 203c40013a
commit 4660e8133d
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -19,11 +19,12 @@ const PANE = 'sticky top-6 max-h-[calc(100vh-11rem)]';
* The list side is padded by what it is pulled out by, so the scroll box does not clip shadows.
* Its children must not shrink: `.ss-list` clips its corners with overflow:hidden, which lets a
* flex item go below its content height, and it would be squashed instead of scrolled.
* `pageScroll` keeps the list in the page's own scroll, for a page that has more above it.
*/
export function RailLayout({ rail, children }: { rail: ReactNode; children: ReactNode }) {
export function RailLayout({ rail, children, pageScroll }: { rail: ReactNode; children: ReactNode; pageScroll?: boolean }) {
return (
<div className="grid grid-cols-[minmax(0,1fr)_320px] items-start gap-8">
<div className={`${PANE} -m-2 flex min-w-0 flex-col gap-3 overflow-y-auto p-2 [&>*]:shrink-0`}>{children}</div>
<div className={pageScroll ? 'flex min-w-0 flex-col gap-3' : `${PANE} -m-2 flex min-w-0 flex-col gap-3 overflow-y-auto p-2 [&>*]:shrink-0`}>{children}</div>
<aside className={`${PANE} flex flex-col gap-7`}>{rail}</aside>
</div>
);
+1 -1
View File
@@ -110,7 +110,7 @@ export default function MCPProjectView({ data, root, offered, onChanged, onRemov
return (
<div>
<RailLayout rail={data.plan && <MCPSyncBox changes={changes} roots={roots} />}>
<RailLayout pageScroll rail={data.plan && <MCPSyncBox changes={changes} roots={roots} />}>
<div className="ss-box flex flex-col gap-3.5">
<dl className="ss-kv !grid-cols-[110px_minmax(0,1fr)] items-center">
<dt>{t('mcp.targets')}</dt>