fix(knowledge): enable mobile settings scrolling

This commit is contained in:
GuoQing Zhang
2026-08-13 17:27:30 +08:00
parent 384c7662d4
commit 34746ed0bb
2 changed files with 14 additions and 1 deletions
@@ -320,10 +320,15 @@ export default function MainLayout() {
);
const isAppChatRoute = /^\/app(\/|$)/.test(pathname);
const isChannelRoute = /^\/channel(\/|$)/.test(pathname);
/** 订阅 / 应用中心 / 应用对话:白卡片不滚动,把高度交给页面内层(含移动端 ≤767 与桌面窄窗) */
const isKnowledgeSettingsRoute = Boolean(
matchPath({ path: '/knowledge/create', end: true }, pathForMatch) ||
matchPath({ path: '/knowledge/space/:spaceId/settings', end: true }, pathForMatch),
);
/** These full-height surfaces keep the white shell fixed and delegate scrolling to their page content. */
const innerScrollShell =
/^\/(c|linsight)(\/|$)/.test(pathname) ||
isChannelRoute ||
isKnowledgeSettingsRoute ||
isAppChatRoute ||
(isAppsArea && !isAppsExploreRoute);
const isKnowledgeRoute = /^\/knowledge(\/|$)/.test(pathname);
@@ -21,6 +21,14 @@ describe("F044 unified permission entry structure", () => {
expect(routes).toContain("default: module.ChannelSettingsPage");
});
it("gives knowledge create and settings pages an inner scrolling shell", () => {
const layout = source("layouts/MainLayout.tsx");
expect(layout).toContain("path: '/knowledge/create'");
expect(layout).toContain("path: '/knowledge/space/:spaceId/settings'");
expect(layout).toContain("isKnowledgeSettingsRoute ||");
});
it("uses one settings callback and retains unrelated channel actions", () => {
const articleMenu = source("pages/Subscription/ArticleList/ChannelActionsMenu.tsx");
const sidebarItem = source("pages/Subscription/Sidebar/ChannelItem.tsx");