Skip to content

fix(pricing): 修复排序菜单打开时导航栏横向位移 - #7145

Merged
seefs001 merged 1 commit into
QuantumNous:mainfrom
jimmyleocn:fix/pricing-sort-menu-layout-shift
Sep 14, 2026
Merged

seefs001 merged 1 commit into
QuantumNous:mainfrom
jimmyleocn:fix/pricing-sort-menu-layout-shift

Conversation

@jimmyleocn

@jimmyleocn jimmyleocn commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Agent

  • Tool: Codex
  • Tool version: 0.150.1
  • Model (full id): gpt-5.6-sol
  • Host (CLI / IDE / GitHub coding agent / other): CLI
  • Date (UTC): 2026-09-01
  • Disclosure: 本次代码修改、检查与 PR 描述由 Codex AI 辅助完成。

Links

User request

修复模型广场点击“名称 / 价格”排序下拉菜单时顶部导航栏左右晃动的问题;保持修改最小化,不添加自动化测试相关改动。

Out of scope — refuse

  • Matched: no
  • If yes, what was told to the user (stop here; do not open a PR): 不适用

Kind

  • Bug fix
  • New feature
  • Performance / refactor
  • Docs
  • Other:

Issue facts

  • Actual behavior: /pricing 页面存在垂直滚动条时,打开或关闭“名称 / 价格”排序菜单会改变页面可用宽度,顶部固定导航栏随之横向位移。
  • Impact: 排序功能可用,但每次打开和关闭菜单都会产生明显的视觉抖动。
  • Frequency: 在报告环境 Google Chrome 126.0.6478.26(64 位)、默认浅色主题中稳定复现。
  • Evidence that the problem is in new-api rather than the client or upstream: 仅操作 new-api 内置模型广场排序菜单即可触发,不涉及模型请求、渠道或第三方上游;菜单打开时的页面滚动状态变化与导航栏位移同步。
  • Applicable types and their fields (relay / billing / frontend / deployment; write "not applicable" otherwise): Frontend;页面 /pricing,排序菜单 DropdownMenu 的 modal 属性。Relay、billing、deployment 不适用。

Change

将模型广场排序菜单的 DropdownMenu 设置为 modal={false}。Base UI 菜单默认使用 modal 模式;该模式打开时会管理文档滚动。此排序菜单不需要阻止页面其余区域交互,因此仅在该菜单关闭 modal 行为,避免滚动锁改变视口可用宽度,并保持修改局限在问题入口。

Research

Duplicate / prior art

  • Search queries (issues, PRs): scrollbar、"layout shift"、"scroll lock"、dropdown navbar pricing、"model square" dropdown、模型广场 排序 下拉 导航栏、模型广场 晃动、模型广场 抖动、modal false pricing、#7144。
  • What already existed and why this is not a duplicate: 找到的模型广场相关记录主要涉及排序能力、排序结果或供应商顺序;未发现修复“排序菜单滚动锁导致顶部导航栏横向位移”的 Issue 或 PR。

Docs and code

Alternatives considered

  • Option A: 全局修改共享 DropdownMenu 的默认 modal 行为。会改变所有下拉菜单的交互和焦点语义,范围过大。
  • Option B: 为页面、滚动条或导航栏增加宽度补偿 CSS。属于对症状的全局补偿,可能影响其他弹层和浏览器。
  • Why this approach: 在问题菜单调用点使用组件原生属性即可消除根因,只修改一行且不影响其他菜单。

Files

Path Why
web/src/features/pricing/components/pricing-toolbar.tsx 仅关闭模型广场排序菜单的 modal 滚动锁行为。

Behavior

  • Before: 打开排序菜单时 modal 滚动锁改变页面可用宽度,顶部固定导航栏横向移动;关闭后恢复。
  • After: 打开和关闭排序菜单不再触发该滚动锁,导航栏保持稳定,排序选择仍正常工作。
  • Explicit non-goals / leftover work: 不修改共享 DropdownMenu 默认行为,不调整导航栏样式,不处理其他页面菜单。

Verification

Only what was actually run.

  • Commands and results:
    • cd web && bun install --frozen-lockfile:通过。
    • cd web && bun run typecheck:通过。
    • cd web && bun x oxlint -c .oxlintrc.json src/features/pricing/components/pricing-toolbar.tsx:0 errors;存在 1 个与本次改动无关的既有 react(self-closing-comp) warning(第 137 行)。
    • cd web && bun x oxfmt --check src/features/pricing/components/pricing-toolbar.tsx:通过。
    • cd web && bun run build:通过。
    • git diff --check origin/main...HEAD:通过。
    • GitNexus detect_changes(scope: compare, base_ref: origin/main):1 个符号、1 个文件、0 个受影响流程,LOW。
  • Manual steps and observed result: 在 Chrome 中打开存在垂直滚动条的 /pricing,反复打开和关闭排序菜单;顶部导航栏不再横向位移,名称和价格排序选择正常。
  • UI: 问题复现录屏见 [Bug] 模型广场打开排序下拉菜单时顶部导航栏左右晃动 #7144。
  • Tests added or updated, or why none: 未添加或修改自动化测试;按本次提交范围要求仅保留一行组件属性修复,并通过现有类型、lint、格式、构建及手动浏览器验证。
  • Databases / providers / platforms exercised: 前端 Chrome;数据库、模型供应商和 Relay 不适用。
  • Not verified: Firefox、Safari、Edge、深色主题、macOS overlay scrollbar 和移动端。

Risks

  • Failure modes: 非 modal 菜单允许菜单打开时与页面其他区域交互及继续滚动;对于工具栏中的简单排序菜单属于预期行为。菜单定位、选择及键盘/焦点管理仍由 Base UI 处理。
  • Billing / quota / auth impact: 无。
  • Follow-ups: 如其他普通下拉菜单出现相同现象,应逐个评估是否同样不需要 modal 行为;本 PR 不做全局修改。

Scope check

  • Single focused change: yes
  • Secrets included: no
  • Out of scope (Coding Plan / reverse-engineered channel / third-party wrapper / Codex): no

Summary by CodeRabbit

  • Bug Fixes
    • Improved the pricing sort menu so it no longer blocks interaction with the rest of the page when open.

@coderabbitai

coderabbitai Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: f48103ac-7d5e-409e-8d03-6ea82c80fa45

📥 Commits

Reviewing files that changed from the base of the PR and between 0ed497f and e4d5b6d.

📒 Files selected for processing (1)
  • web/src/features/pricing/components/pricing-toolbar.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

Changes

模型广场排序菜单

Layer / File(s) Summary
禁用排序菜单的模态行为
web/src/features/pricing/components/pricing-toolbar.tsx
排序 DropdownMenu 设置 modal={false},打开菜单时不再以模态覆盖层方式锁定页面滚动。

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to e4d5b

This localized change disables modal scroll locking only for the pricing sort menu, preventing navigation-bar movement while preserving sorting behavior. No actionable merge-blocking risk remains after normal checks and review.

Poem

小兔打开排序门
页面宽度稳如春
导航不再左右跳
菜单键盘仍灵巧
胡萝卜旁庆修成

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning 改动在模型广场排序菜单上设置了 modal={false},符合修复页面宽度变化、导航栏位移和限制全局行为的要求。[#7144] 但 Issue #7144 明确要求添加回归测试,本 PR 未添加测试。 添加前端回归测试,覆盖存在垂直滚动条时打开和关闭排序菜单不会改变页面宽度或导航栏位置,并验证名称、价格排序及鼠标和键盘交互仍然正常。
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确描述了定价页面排序菜单导致导航栏横向位移的主要修复,内容简洁且与改动一致。
Out of Scope Changes check ✅ Passed PR 仅修改 web/src/features/pricing/components/pricing-toolbar.tsx 中的模型广场排序菜单,未修改共享下拉菜单默认行为,也未引入与 Issue #7144 无关的代码。
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seefs001
seefs001 merged commit 2bfb89c into QuantumNous:main Sep 14, 2026
2 checks passed
Javabcd pushed a commit to Javabcd/new-api that referenced this pull request Sep 16, 2026
GuDong2003 pushed a commit to GuDong2003/new-api that referenced this pull request Sep 25, 2026
TomJKS pushed a commit to TomJKS/new-api that referenced this pull request Sep 28, 2026
timwenx pushed a commit to timwenx/new-api that referenced this pull request Nov 18, 2026
xiaolanawaqaq pushed a commit to xiaolanawaqaq/new-apiaaa that referenced this pull request Nov 26, 2026
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.

[Bug] 模型广场打开排序下拉菜单时顶部导航栏左右晃动

2 participants