Skip to content

fix: mobile sidebar - #6760

Merged
seefs001 merged 2 commits into
QuantumNous:mainfrom
seefs001:fix/mobile-ui
Aug 11, 2026
Merged

fix: mobile sidebar#6760
seefs001 merged 2 commits into
QuantumNous:mainfrom
seefs001:fix/mobile-ui

Conversation

@seefs001

@seefs001 seefs001 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

⚠️ 提交说明 / PR Notice

Important

  • 请提供人工撰写的简洁摘要,避免直接粘贴未经整理的 AI 输出。

📝 变更描述 / Description

(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)

移动端不渲染base ui的Tooltip
Sheet 内容提升为 z-60,明确位于 z-50 遮罩层之上
移动端侧栏链接现在禁用触摸意图预加载

(GPT-5.6-SOL给的排查和建议 )

iOS 显示菜单高亮发生在 touchstart,但真正导航依赖后续合成的 click。
项目全局配置了:
defaultPreload: 'intent'
defaultPreloadStaleTime: 0

因此触摸侧栏链接时,TanStack Router 会在 touchstart 阶段立即执行目标路由预加载和 beforeLoad。日志页面加载完成后 DOM 和运行负载较重,这段点击前的异步工作会导致 iOS 取消后续合成 click,表现为:
• 菜单项能够高亮;
• onClick 没有执行;
• 侧栏不关闭;
• 路由不切换。

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug
  • ✨ 新功能 (New feature) - 重大特性建议先通过 Issue 沟通
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

  • Closes # (如有)

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

(请在此粘贴截图、关键日志或测试报告,以证明变更生效)

Summary by CodeRabbit

  • Bug Fixes

    • Improved mobile sidebar interaction by ensuring sidebar sheets respond to pointer input.
    • Refined sidebar menu tooltips so they appear only when relevant—when the sidebar is collapsed, a tooltip is provided, and the viewport supports it.
  • Performance

    • Reduced unnecessary route preloading from mobile sidebar navigation while preserving navigation and sidebar-closing behavior.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The sidebar mobile sheet now accepts pointer events. Menu tooltips now render only for collapsed, non-mobile sidebars. Mobile navigation links disable route preloading while preserving sidebar close behavior.

Changes

Sidebar navigation

Layer / File(s) Summary
Sidebar pointer and tooltip behavior
web/src/components/ui/sidebar.tsx
The mobile sheet adds pointer-events-auto. Menu tooltips render only when tooltip data exists, the sidebar is collapsed, and the viewport is not mobile.
Mobile navigation preload control
web/src/components/layout/components/nav-group.tsx, web/src/components/layout/components/sidebar-view-header.tsx
Mobile sidebar links and parent-view links set preload to false. Existing mobile-sidebar close behavior remains.
Chat navigation preload control
web/src/components/layout/components/chat-presets-item.tsx
ChatMenuItem accepts an optional preload prop. Expanded mobile chat navigation passes false.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A rabbit checks the sidebar door,
Pointer events now work once more.
Desktop tooltips softly gleam,
Mobile links skip preload streams.
The menu closes as before.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: fixing mobile sidebar behavior.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 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 marked this pull request as ready for review August 11, 2026 05:50
@seefs001
seefs001 merged commit 4eaeefb into QuantumNous:main Aug 11, 2026
2 of 3 checks passed
0401lucky pushed a commit to 0401lucky/new-api that referenced this pull request Aug 16, 2026
* fix: mobile sidebar

* fix(web): prevent iOS sidebar taps from being swallowed
junjundesk pushed a commit to junjundesk/new-api that referenced this pull request Aug 17, 2026
* fix: mobile sidebar

* fix(web): prevent iOS sidebar taps from being swallowed
DayFliggy pushed a commit to DayFliggy/Ren2Hub that referenced this pull request Aug 17, 2026
* fix: mobile sidebar

* fix(web): prevent iOS sidebar taps from being swallowed

Upstream-Commit: 4eaeefb
330079598 pushed a commit to 330079598/new-api that referenced this pull request Aug 19, 2026
* fix: mobile sidebar

* fix(web): prevent iOS sidebar taps from being swallowed
biubiubiu125 pushed a commit to biubiubiu125/newapi that referenced this pull request Aug 29, 2026
* fix: mobile sidebar

* fix(web): prevent iOS sidebar taps from being swallowed
salem-2007 added a commit to salem-2007/new-api that referenced this pull request Sep 10, 2026
* fix: mobile sidebar

* fix(web): prevent iOS sidebar taps from being swallowed
MAakber pushed a commit to MAakber/new-api that referenced this pull request Sep 11, 2026
* fix: mobile sidebar

* fix(web): prevent iOS sidebar taps from being swallowed

(cherry picked from commit 4eaeefb)
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