Skip to content

fix(skin-market): stop the market dialog from resizing while loading - #2151

Merged
bobleer merged 2 commits into
GCWing:mainfrom
bobleer:bob/skin-market-loading-stability
Aug 7, 2026
Merged

fix(skin-market): stop the market dialog from resizing while loading#2151
bobleer merged 2 commits into
GCWing:mainfrom
bobleer:bob/skin-market-loading-stability

Conversation

@bobleer

@bobleer bobleer commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

问题

打开 Skin 市场点「浏览市场」时,弹窗高度连续变了三次:

  1. 首帧 loading 还是 falseitems 为空 → 先闪一下「没有符合条件的外观包」空态;
  2. 请求发出后换成一行「正在加载 Skin 市场…」(min-height: 280px);
  3. 卡片到达后网格撑开 —— __grid 虽然写了 overflow-y: auto,但父级只有 min-height、没有确定高度,所以它不是内部滚动,而是把弹窗一路顶到 max-height

三次高度跳变叠在一起,看上去就是抖动。

改法

弹窗定高,各视图自己滚。 .modal__content--fill-flex 并锁定 min/max-height: min(720px, 78vh).appearance-market 变成 flex: 1; min-height: 0 的列。浏览网格、详情页、投稿列表各自拿到 flex: 1; min-height: 0; overflow-y: auto,内容再多也只在内部滚动,弹窗尺寸恒定 —— 切 tab、进详情同样不再改变大小。

加载态占住位置,而不是替换位置。

  • 首屏未加载完 → 网格里渲染与真实卡片同尺寸的骨架卡(带 shimmer,prefers-reduced-motion 下静止),加载完成直接换成真卡片,高度不变;
  • 换筛选/排序重新加载 → 保留当前卡片,只做 opacity 淡化,不清空、不重排;
  • 「加载更多」→ 行始终在位,按钮进 loading 态,不再整行消失;
  • 空态只在首次加载真正结束后才显示,首帧不再闪;
  • 「正在加载 Skin 市场…」文案移到 sr-only live region,读屏仍然播报。

投稿页顺带补了一个 __workflow-body 滚动容器 —— 定高之后,展开的手动投稿表单需要有地方滚。

验证

  • AppearanceMarketDialog.test.tsx 新增两条回归用例:首屏加载期间渲染骨架卡且不出现空态文案;空结果落定后才显示空态。
  • npx vitest run src/infrastructure/config/components/ → 15 文件 128 用例通过。
  • npm run buildeslint 通过。
  • 说明:改动是布局层面的,我没有起桌面端做人工目视确认,正确性靠上述测试与 CSS 盒模型推导。

bobleer added 2 commits August 6, 2026 20:06
Opening 浏览市场 flashed the empty state, swapped in a short "loading"
line, then grew the dialog once the cards arrived — three height changes
in a row, which read as a shake.

The dialog now keeps one height: the modal content is a fixed-height flex
column and each view (browse grid, detail, submissions) scrolls
internally instead of stretching the dialog. While the first page is in
flight the grid holds placeholder cards of the real card size, so the
loaded state drops straight in; a refresh keeps the current cards mounted
and only dims them, and 加载更多 keeps its row in place with a loading
button. The loading text moves to an sr-only live region.
…tract

marketBrowse, marketResults and the loading state are new data-bf hooks;
the contract audit rejects any part or state a Skin cannot target.
@bobleer
bobleer merged commit af0c906 into GCWing:main Aug 7, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant