Skip to content

fix(desktop): 修复自动任务模型菜单层级 - #4017

Open
dashhuang wants to merge 1 commit into
mainfrom
dash/fix-model-menu-layer
Open

fix(desktop): 修复自动任务模型菜单层级#4017
dashhuang wants to merge 1 commit into
mainfrom
dash/fix-model-menu-layer

Conversation

@dashhuang

Copy link
Copy Markdown
Member

这次改了什么

摘要

修复自动任务设置中的模型选择器配置子面板被对话框遮挡的问题:调用方传入的高层级 class 现在会应用到实际定位 wrapper。

变更类型

  • fix 缺陷修复

范围

  • 本 PR 包含:修正 ModelSelector 浮层 wrapper 的层级 class 传递。
  • 明确不包含:其他页面布局或产品行为调整。
  • 用户可见变化:自动任务设置中的模型选项菜单始终显示在对话框上层。
  • 是否存在 breaking change:无

UI 变化

  • 引用的设计规范:不涉及视觉样式变化;仅修复浮层层级行为。

怎么验证的

自动验证

git diff --check
结果:通过

手工验证

未执行。

未执行的验证

项目测试未执行:当前环境未安装 pnpm。

风险

风险分类

  • 无已知风险

影响与回滚

  • 影响范围:ModelSelector 配置子面板的定位 wrapper 层级。
  • 回滚 / 降级方式:回滚本 PR commit 即可。

提交前检查

  • 已 review 完整 diff
  • 每个 commit 都带 DCO 签名
  • 未提交凭证、令牌或授权文件

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
@dashhuang
dashhuang requested a review from a team as a code owner September 6, 2026 22:14
@greptile-apps

greptile-apps Bot commented Sep 6, 2026

Copy link
Copy Markdown

Greptile Summary

本 PR 修复桌面端自动任务模型选择器次级浮层的层级传递问题,将调用方提供的 overlay class 合并到实际负责定位和层叠的 wrapper。

  • 高层级 z-index 现在能够覆盖 wrapper 的默认 z-50
  • 实现与现有 overlayContentClassName 的用途一致。
  • 建议补充直接覆盖 wrapper 层级行为的回归测试。

Confidence Score: 4/5

该修复实现本身看起来可以安全合并,但建议补充定位 wrapper 层级的回归测试以防原问题再次出现。

调用方的高层级类能够通过 tailwind-merge 覆盖 wrapper 默认层级,未发现功能性故障;唯一问题是关键行为没有被现有测试直接验证。

Files Needing Attention: apps/desktop/src/renderer/components/new-chat/ModelSelector.tsx

Important Files Changed

Filename Overview
apps/desktop/src/renderer/components/new-chat/ModelSelector.tsx 将调用方提供的浮层样式合并到次级模型面板的定位 wrapper;实现合理,但关键修复路径缺少直接回归测试。
Prompt To Fix All With AI
### Issue 1
apps/desktop/src/renderer/components/new-chat/ModelSelector.tsx:267
**缺少层级回归测试**

本次修复依赖把 `overlayContentClassName` 应用到实际的 `data-radix-popper-content-wrapper`,但现有测试只检查属性透传或内部面板,没有断言定位 wrapper 获得调用方传入的高层级类。因此,代码即使退回到仅给内部元素设置 z-index 的状态,测试仍可能通过。建议打开次级模型面板后,直接断言其最近的定位 wrapper 包含 `z-[10010]``z-[10020]`---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "fix(desktop): preserve model menu overla..." | Re-trigger Greptile

ref={refs.setFloating}
data-radix-popper-content-wrapper=""
className="z-50 w-[248px]"
className={cn('z-50 w-[248px]', className)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 缺少层级回归测试

本次修复依赖把 overlayContentClassName 应用到实际的 data-radix-popper-content-wrapper,但现有测试只检查属性透传或内部面板,没有断言定位 wrapper 获得调用方传入的高层级类。因此,代码即使退回到仅给内部元素设置 z-index 的状态,测试仍可能通过。建议打开次级模型面板后,直接断言其最近的定位 wrapper 包含 z-[10010]z-[10020]

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/components/new-chat/ModelSelector.tsx
Line: 267

Comment:
**缺少层级回归测试**

本次修复依赖把 `overlayContentClassName` 应用到实际的 `data-radix-popper-content-wrapper`,但现有测试只检查属性透传或内部面板,没有断言定位 wrapper 获得调用方传入的高层级类。因此,代码即使退回到仅给内部元素设置 z-index 的状态,测试仍可能通过。建议打开次级模型面板后,直接断言其最近的定位 wrapper 包含 `z-[10010]``z-[10020]`---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9af4199068

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

ref={refs.setFloating}
data-radix-popper-content-wrapper=""
className="z-50 w-[248px]"
className={cn('z-50 w-[248px]', className)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 将层级应用到自动任务真正使用的浮层 wrapper

自动任务的 ModelEffortChipScheduleChips.tsx:1217-1241 直接渲染 ModelSelectorContent,并保留 unifiedPanel=true 的默认值,因此 ModelSelector.tsx:2763 会提前返回,永远不会执行这里的 ModelOptionsFloatingPanel。配置卡实际由 UnifiedFlyoutHost 渲染,而其 portal wrapper 在 UnifiedFlyoutHost.tsx:145-152 仍是 fixed z-50;传入的 z-[10020] 只落在内层卡片,无法越过父级 z-50 stacking context 和 z-[10000] 对话框。所以自动任务模型配置卡仍会被遮挡,应将覆盖层级传给 UnifiedFlyoutHost 的定位 wrapper。

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T22:17:32.987634Z 9af4199 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@MagicLizi MagicLizi added the touches:product-ui 改动碰到产品 / UI 面(review-pr 自动维护,仅展示) label Sep 6, 2026
@MagicLizi

Copy link
Copy Markdown
Contributor

命中 UI 路径(apps/desktop/src/renderer/components/new-chat/ModelSelector.tsx)但 description 未附界面效果证据——建议补充改动后效果:截图/录屏,或改动后界面的 HTML 页面(```html 代码块、.html 附件或在线预览链接),便于确认界面符合 DESIGN.md 设计规范。不阻断合并。

@MagicLizi

Copy link
Copy Markdown
Contributor

@dashhuang 👋 这个 PR 还有 2 条 review conversation 没 resolve(apps/desktop/src/renderer/components/new-chat/ModelSelector.tsx),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

touches:product-ui 改动碰到产品 / UI 面(review-pr 自动维护,仅展示)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants