Skip to content

Conversation

@QDyanbing
Copy link

@QDyanbing QDyanbing commented Jan 22, 2026

本次修改补充 SubMenuTypepopupRender 类型定义,修复 TS 类型检查报错问题。

fix ant-design/ant-design#56706

变更内容

  • SubMenuType 中补充 popupRender?: PopupRender 的类型定义

影响范围

  • 仅类型定义变更,不影响运行时逻辑

Summary by CodeRabbit

发布说明

  • 新功能
    • 支持通过全局/上下文配置为子菜单自定义弹出框渲染,便于统一定制弹出表现。
  • 重构
    • 移除单个子菜单组件上的 per-instance popupRender 属性(不再支持通过组件属性逐个定制),请改用上下文/全局配置以实现自定义渲染。

✏️ Tip: You can customize this high-level summary in your review settings.

@gemini-code-assist
Copy link

Summary of Changes

Hello @QDyanbing, 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!

此拉取请求旨在通过在 SubMenuType 接口中添加缺失的 popupRender 属性类型定义来解决一个 TypeScript 类型检查错误。此项修改纯粹是类型定义上的调整,不会对运行时逻辑产生任何影响,确保了代码的类型安全性和一致性。

Highlights

  • 类型定义修复: 为 SubMenuType 接口补充了 popupRender 属性的类型定义,以解决 TypeScript 类型检查报错问题。

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

Walkthrough

SubMenuType 接口中新增可选属性 popupRender?: PopupRender;同时在 src/SubMenu/index.tsx 中移除了对组件公开 prop popupRender 的声明,改为依赖上下文或默认行为。未引入运行时控制流或错误处理的变化。

Changes

Cohort / File(s) 变更摘要
类型定义补充
src/interface.ts
SubMenuType 接口添加可选属性 popupRender?: PopupRender(类型补全,匹配文档)。
SubMenu Props 调整
src/SubMenu/index.tsx
从导入与 SubMenuProps 中移除公开的 popupRender 声明;实例级 popupRender 不再通过 props 传入,改为依赖上下文或默认行为。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 新增类型一行新,
文件轻移未惊心,
popupRender 回归处,
文档与码齐并行,
小兔轻跳唱欢欣 ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: adding the popupRender property to SubMenuType interface.
Linked Issues check ✅ Passed The PR successfully addresses the linked issue by adding the missing popupRender type definition to SubMenuType, resolving TypeScript type-checking errors.
Out of Scope Changes check ✅ Passed Changes are limited to the intended scope: adding popupRender property to SubMenuType interface and removing it from SubMenuProps, directly addressing the issue requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link

@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

本次拉取请求通过在 SubMenuType 接口中添加 popupRender 类型定义,成功解决了 TypeScript 类型检查报错问题。此更改提高了菜单组件接口的类型安全性和正确性。

@Wxh16144
Copy link

ci lint 挂了,还需要看看是什么原因

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.

SubMenuType 中 popupRender 类型定义缺失

2 participants