游玩页改成固定画布,移动端不再整页可滚

- PlatformEntryActiveFlowShell 在 game-play 舞台给页签容器加 platform-tab-panel--game-play,不再挂 overflow-auto,也不再叠加双份内边距
- index.css 新增 .platform-tab-panel--game-play,面板 overflow:hidden 并去掉右侧留白
- gameDistribution.css 让 .game-play-page 改 height:100%/min-height:0、播放器 flex:1 1 auto/min-height:0,删除移动端把页面撑高的 calc(100dvh - 8rem)
- 矮视口(max-height:26rem,横屏手机)压扁启动面板并隐藏封面,保证「开始游戏」可达,页面与面板本身仍不滚动
- PlatformEntryActiveFlowShell.test.tsx 双向锁定游玩舞台页签容器不滚动、游戏广场等舞台仍保持滚动
- check-game-distribution-web-e2e.mjs 移动端段新增「移动端游玩页不可滚动(面板与整页都不溢出)」断言
- 里程碑文档补上该修复的根因、口径与验证记录
This commit is contained in:
2026-09-30 11:44:35 +08:00
parent 055a6d6658
commit 301f66da2d
6 changed files with 96 additions and 10 deletions
@@ -494,7 +494,9 @@
display: flex;
flex-direction: column;
gap: 0.9rem;
min-height: 100%;
/* 游玩页是固定画布:撑满面板而不是撑高面板,页面本身永不滚动。 */
height: 100%;
min-height: 0;
padding: clamp(0.7rem, 1.8vw, 1.5rem);
}
.game-play-toolbar {
@@ -536,8 +538,8 @@
}
.game-player-shell {
position: relative;
flex: 1;
min-height: min(72vh, 48rem);
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
border: 1px solid rgba(199, 101, 61, 0.24);
border-radius: 1.5rem;
@@ -581,7 +583,7 @@
display: block;
width: 100%;
height: 100%;
min-height: min(72vh, 48rem);
min-height: 0;
border: 0;
opacity: 0;
transition: opacity 220ms ease;
@@ -716,9 +718,34 @@
.game-play-toolbar__actions .game-play-device-hint {
display: none;
}
.game-player-shell,
.game-player-frame {
min-height: calc(100dvh - 8rem);
}
/*
* 矮视口(横屏手机)里播放器只剩很小的高度,压扁启动面板保证
* 「开始游戏」可达;页面依旧不滚动,只有这一块在极端情况下内部兜底。
*/
@media (max-height: 26rem) {
.game-player-launch {
grid-template-columns: minmax(0, 1fr);
align-content: center;
gap: 0.5rem;
padding: 0.75rem 1rem;
text-align: center;
overflow-y: auto;
}
.game-player-launch .game-cover {
display: none;
}
.game-player-launch__copy p {
display: -webkit-box;
margin: 0.25rem 0 0.6rem;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.game-player-loading,
.game-player-timeout {
font-size: 0.8rem;
}
}
@@ -898,6 +898,35 @@ describe('游戏发布灰度入口', () => {
);
});
it('游玩舞台的页签容器不滚动', async () => {
gameDistributionMock.getGame.mockResolvedValue(null);
const { container } = render(
<StatefulPlatformEntryFlowShell initialStage="game-play" />,
);
const panel = container.querySelector('.platform-tab-panel');
expect(panel?.classList.contains('platform-tab-panel--game-play')).toBe(
true,
);
expect(panel?.className).not.toContain('overflow-auto');
});
it('游戏广场等舞台仍保持页签容器滚动', async () => {
gameDistributionMock.listGames.mockResolvedValue([]);
const { container } = render(
<StatefulPlatformEntryFlowShell initialStage="games" />,
);
expect(await screen.findByText('游戏广场')).toBeTruthy();
const panel = container.querySelector('.platform-tab-panel');
expect(panel?.classList.contains('platform-tab-panel--game-play')).toBe(
false,
);
expect(panel?.className).toContain('overflow-auto');
});
it('灰度命中时广场展示发布入口', async () => {
loginAsAuthor();
gameDistributionMock.listGames.mockResolvedValue([]);
@@ -540,6 +540,11 @@ export function PlatformEntryFlowShellImpl({
selectionStage === 'game-play' ||
selectionStage === 'game-mine' ||
selectionStage === 'game-publish';
/**
* 游玩页自己撑满剩余高度,面板不能再滚动,否则移动端会出现整页可滚的
* 半屏播放器;其余舞台继续沿用面板滚动。
*/
const isGamePlayStage = selectionStage === 'game-play';
const gameSearchParams = new URLSearchParams(
typeof window === 'undefined' ? '' : window.location.search,
);
@@ -717,7 +722,7 @@ export function PlatformEntryFlowShellImpl({
<main
id={isCreationStage ? 'platform-tab-panel-create' : undefined}
className={`platform-tab-panel min-h-0 min-w-0 flex-1 overflow-auto ${isCreationStage || isProfileStage ? '' : 'px-3 py-4 sm:px-6 sm:py-6'}`}
className={`platform-tab-panel min-h-0 min-w-0 flex-1 ${isGamePlayStage ? 'platform-tab-panel--game-play' : 'overflow-auto'} ${isCreationStage || isProfileStage || isGamePlayStage ? '' : 'px-3 py-4 sm:px-6 sm:py-6'}`}
>
{isProfileStage ? (
<PlatformActiveProfileView