Skip to content

Conversation

@Hemomoo
Copy link
Collaborator

@Hemomoo Hemomoo commented Jan 31, 2026

PR 描述

PR 类型

  1. 修复配置弹窗层级问题
  2. 增加深度思考和联网
  • 🐛 Bug 修复
  • ✨ 新功能
  • 💄 UI/UX 改进
  • ♻️ 重构
  • 🚀 性能优化
  • 📝 文档更新
  • 🔄 其他

Issue 关联

Closes #

其他信息

image image
邓亮 added 3 commits January 31, 2026 17:10
将用户信息展示和操作功能从 ChatSidebar 组件移动到 ChatAIPanels 组件
移除 ChatSidebar 中未使用的导入和状态
调整 ModelConfigModal 的样式和 z-index 设置
在聊天输入框下方添加网页搜索和深度思考的切换按钮,允许用户启用或禁用这些功能
允许通过 children 属性自定义 ModelConfigModal 的触发器内容,提升组件灵活性
@netlify
Copy link

netlify bot commented Jan 31, 2026

Deploy Preview for ornate-blancmange-89db6b ready!

Name Link
🔨 Latest commit fd6bc33
🔍 Latest deploy log https://app.netlify.com/projects/ornate-blancmange-89db6b/deploys/697ddc71bf97c4000856379b
😎 Deploy Preview https://deploy-preview-274--ornate-blancmange-89db6b.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Hemomoo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求主要解决了配置弹窗的层级显示问题,并为 AI 聊天功能引入了新的能力。它将“深度思考”和“网页搜索”的切换按钮直接集成到聊天界面中,显著增强了 AI 的功能。此外,还重新调整了用户账户菜单的位置,以提高可访问性,并简化了用户访问模型配置的方式。

Highlights

  • 修复配置弹窗层级问题: 通过调整 ModelConfigModal 的 z-index 属性,确保配置弹窗能够正确显示在其他元素之上,解决了层级覆盖的问题。
  • 增加深度思考和联网功能: 在聊天输入区域新增了“网页搜索”和“深度思考”的切换按钮,用户可以根据需要启用或禁用这些 AI 增强功能。
  • 调整用户账户菜单位置: 用户账户的下拉菜单已从侧边栏移动到聊天面板的顶部标题栏,优化了布局,使其在聊天界面中更易于访问。
  • 优化模型配置弹窗触发方式: 现在可以直接点击聊天面板顶部的模型名称来打开模型配置弹窗,提供了更直观和便捷的交互体验。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

本次 PR 主要有两个目的:修复配置弹窗的层级问题,以及增加了“深度思考”和“联网搜索”两个新功能。同时,代码还将用户菜单从侧边栏移动到了主聊天面板的头部,这是一个不错的 UI/UX 优化。

整体代码质量不错,新功能的实现看起来是正确的。我主要提出了两点改进建议:

  1. ChatAIPanels.tsx 中,被移动过来的用户菜单组件代码可以进一步优化,以更好地适应其在头部的新位置。
  2. ModelConfigModal.tsx 中,修复 z-index 问题时使用了 !important,这可能不是最佳实践,我提供了一个替代建议。

请查看具体的评论以获取更多细节。

Comment on lines +375 to +415
<div className="border-t border-gray-100 bg-gray-50/50">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<button className="w-full flex items-center gap-3 p-2 rounded-xl border border-transparent hover:border-blue-100 hover:bg-white hover:shadow-sm transition-all duration-200 text-left group">
<Avatar className="h-9 w-9 ring-2 ring-white shadow-sm group-hover:ring-blue-50 transition-all">
<AvatarImage src={user.avatar_url || ''} />
<AvatarFallback className="bg-blue-500 text-white">
{user.name?.charAt(0) || 'U'}
</AvatarFallback>
</Avatar>
</button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-56 mb-2">
<DropdownMenuLabel>我的账户</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem
className="cursor-pointer"
onClick={() => router.push('/dashboard/user')}
>
<UserIcon className="mr-2 h-4 w-4" />
<span>个人中心</span>
</DropdownMenuItem>
<DropdownMenuItem
className="cursor-pointer"
onClick={() => router.push('/dashboard/settings')}
>
<Settings className="mr-2 h-4 w-4" />
<span>账户设置</span>
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem
className="cursor-pointer text-red-600 focus:text-red-600 focus:bg-red-50"
disabled={logoutMutation.isPending}
onClick={() => logoutMutation.mutate()}
>
<LogOut className="mr-2 h-4 w-4" />
<span>退出登录</span>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

这部分用户菜单的实现似乎是从 ChatSidebar 组件中直接复制而来,但没有完全适应其在 ChatAIPanels 头部的新上下文。存在一些可以改进的地方:

  1. 多余的包裹 div:包裹 DropdownMenudiv 带有 border-t 样式,这会在头部区域的用户头像上方添加一条顶部分割线,这在视觉上可能不是预期的效果。可以直接移除这个 div
  2. 不正确的按钮样式:触发按钮 buttonclassName 中包含了 w-fulltext-left,这对于一个只包含头像的按钮来说是不必要的,并且可能导致布局问题。gap-3 也是多余的。

建议简化这部分代码,使其更适合作为头部的一个独立元素。

            <DropdownMenu>
              <DropdownMenuTrigger asChild>
                <button className="p-1 rounded-full transition-all duration-200 group focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2">
                  <Avatar className="h-8 w-8 ring-2 ring-white shadow-sm group-hover:ring-blue-50 transition-all">
                    <AvatarImage src={user.avatar_url || ''} />
                    <AvatarFallback className="bg-blue-500 text-white">
                      {user.name?.charAt(0) || 'U'}
                    </AvatarFallback>
                  </Avatar>
                </button>
              </DropdownMenuTrigger>
              <DropdownMenuContent align="end" className="w-56 mb-2">
                <DropdownMenuLabel>我的账户</DropdownMenuLabel>
                <DropdownMenuSeparator />
                <DropdownMenuItem
                  className="cursor-pointer"
                  onClick={() => router.push('/dashboard/user')}
                >
                  <UserIcon className="mr-2 h-4 w-4" />
                  <span>个人中心</span>
                </DropdownMenuItem>
                <DropdownMenuItem
                  className="cursor-pointer"
                  onClick={() => router.push('/dashboard/settings')}
                >
                  <Settings className="mr-2 h-4 w-4" />
                  <span>账户设置</span>
                </DropdownMenuItem>
                <DropdownMenuSeparator />
                <DropdownMenuItem
                  className="cursor-pointer text-red-600 focus:text-red-600 focus:bg-red-50"
                  disabled={logoutMutation.isPending}
                  onClick={() => logoutMutation.mutate()}
                >
                  <LogOut className="mr-2 h-4 w-4" />
                  <span>退出登录</span>
                </DropdownMenuItem>
              </DropdownMenuContent>
            </DropdownMenu>
)}
</DialogTrigger>
<DialogContent className="sm:max-w-[700px] max-h-[90vh] p-0 overflow-hidden flex flex-col rounded-xl border-none shadow-2xl">
<DialogContent className="sm:max-w-[700px] max-h-[90vh] p-0 overflow-hidden flex flex-col rounded-xl border-none shadow-2xl !z-[99999]">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

使用 !z-[99999] 强制设置 z-index 虽然可以解决层级问题,但它是一个“魔法数字”并且使用了 !important 修饰符,这可能会让未来的样式调试和维护变得更加困难。如果项目中定义了 z-index 的层级规范(例如在 tailwind.config.js 中),建议使用预设的变量(如 z-modal)。如果没有,可以考虑移除 !,因为 DialogContent 已经通过 Portal 渲染,通常不需要 !important 就能覆盖其他元素。

Suggested change
<DialogContent className="sm:max-w-[700px] max-h-[90vh] p-0 overflow-hidden flex flex-col rounded-xl border-none shadow-2xl !z-[99999]">
<DialogContent className="sm:max-w-[700px] max-h-[90vh] p-0 overflow-hidden flex flex-col rounded-xl border-none shadow-2xl z-[99999]">
@xun082 xun082 merged commit 8109d58 into xun082:main Feb 1, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants