Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kimteayon
Copy link
Collaborator

@kimteayon kimteayon commented Nov 27, 2025

中文版模板 / Chinese template

🤔 This is a ...

  • 🆕 New feature
  • 🐞 Bug fix
  • 📝 Site / documentation improvement
  • 📽️ Demo improvement
  • 💄 Component style improvement
  • 🤖 TypeScript definition improvement
  • 📦 Bundle size optimization
  • ⚡️ Performance optimization
  • ⭐️ Feature enhancement
  • 🌐 Internationalization
  • 🛠 Refactoring
  • 🎨 Code style optimization
  • ✅ Test Case
  • 🔀 Branch merge
  • ⏩ Workflow
  • ⌨️ Accessibility improvement
  • ❓ Other (about what?)

🔗 Related Issues

  • Describe the source of related requirements, such as links to relevant issue discussions.
  • For example: close #xxxx, fix #xxxx

💡 Background and Solution

  • The specific problem to be addressed.
  • List the final API implementation and usage if needed.
  • If there are UI/interaction changes, consider providing screenshots or GIFs.

📝 Change Log

Language Changelog
🇺🇸 English
🇨🇳 Chinese 文档贡献者链接更新

Summary by CodeRabbit

发布说明

  • Bug 修复
    • 优化了贡献者信息的数据源路径解析,确保贡献者信息能正确加载和显示。

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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 27, 2025

Preview is ready

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 27, 2025

📝 Walkthrough

概览

修改了 packages/x/.dumi/theme/slots/Content/index.tsx 文件中 Contributors 组件的文件路径参数,从 meta.frontmatter.filename 更新为带前缀的路径 packages/x/${meta.frontmatter.filename},以调整数据源路径解析。

变更

内聚性 / 文件(s) 变更摘要
路径前缀调整
packages/x/.dumi/theme/slots/Content/index.tsx
将 Contributors 组件接收的 filename 参数从原始文件名改为带 packages/x/ 前缀的完整路径,用于正确解析贡献者数据源

代码审查工作量评估

🎯 1 (琐碎) | ⏱️ ~3 分钟

  • 变更范围极小,仅涉及单个文件中的一行参数修改
  • 无新增逻辑或错误处理变更
  • 属于简单的路径前缀调整

诗句

🐰 一条小路加前缀,
Contributors 找到新栖息,
代码如诗,改动微细,
packages/x 的故事延续,
文件路径从此有迹可循!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 标题 "docs: contributors" 与更改内容相关。更改涉及更新 Contributors 组件的文件路径前缀,这与文档贡献者功能直接相关。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch doc_avater

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.

@dosubot dosubot bot added the documentation Improvements or additions to documentation label Nov 27, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

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

This pull request addresses an issue in the documentation site where the Contributors component was not receiving the fully qualified path for documentation files located within the packages/x directory. By prepending the packages/x/ prefix to the filename, this change ensures that contributor information is accurately fetched and displayed for these documentation pages, improving the overall integrity of the site's contributor attribution.

Highlights

  • Contributor Attribution Fix: Corrected the file path passed to the Contributors component to ensure accurate display of contributors for documentation files within the packages/x directory.
  • Documentation Improvement: Enhanced the documentation site's ability to correctly identify and display contributors for specific documentation pages.
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.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 27, 2025
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

This pull request addresses an issue with the contributor links by correctly prefixing the file path. The change is good, but it could introduce a subtle issue if meta.frontmatter.filename is not present, as it would pass a string like "packages/x/undefined" to the Contributors component. I've added a specific comment with a suggestion to fix this.

Additionally, I've noticed that meta.frontmatter.filename is used in multiple components, and the path handling seems inconsistent. For example:

  • EditButton correctly handles the path by having packages/x/ in its base URL.
  • ComponentMeta seems to have a bug, as it uses meta.frontmatter.filename directly without the packages/x/ prefix, which will likely lead to broken "Edit this page" links.

While fixing ComponentMeta is outside the scope of this PR, it would be beneficial to create a follow-up task to unify the path handling for meta.frontmatter.filename across all components. A consistent approach would make the code more robust and easier to maintain.

<div style={{ marginTop: 120 }}>
<InViewSuspense fallback={<AvatarPlaceholder />}>
<Contributors filename={meta.frontmatter.filename} />
<Contributors filename={`packages/x/${meta.frontmatter.filename}`} />
Copy link
Contributor

Choose a reason for hiding this comment

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

high

While this change correctly prefixes the filename, it can introduce an issue if meta.frontmatter.filename is undefined or null. In that case, the filename prop would become a string like "packages/x/undefined", which would bypass the !filename check inside the Contributors component, leading to an unnecessary API call with an invalid path.

To prevent this, we should conditionally construct the path only when meta.frontmatter.filename is available.

Suggested change
<Contributors filename={`packages/x/${meta.frontmatter.filename}`} />
<Contributors filename={meta.frontmatter.filename && `packages/x/${meta.frontmatter.filename}`} />

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a95a3a0 and b74bfa6.

📒 Files selected for processing (1)
  • packages/x/.dumi/theme/slots/Content/index.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: afc163
Repo: ant-design/x PR: 0
File: :0-0
Timestamp: 2025-04-11T14:47:09.527Z
Learning: 当评审 ant-design/x 仓库中的 PR 时,需要用中文回复中文评论。该项目的文档支持中英双语。
Learnt from: afc163
Repo: ant-design/x PR: 0
File: :0-0
Timestamp: 2025-04-11T14:47:09.527Z
Learning: 当评审 ant-design/x 仓库中的 PR 时,需要用中文回复中文评论。该项目的文档支持中英双语。
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: build preview
  • GitHub Check: size
  • GitHub Check: test
  • GitHub Check: test
  • GitHub Check: Cloudflare Pages

<div style={{ marginTop: 120 }}>
<InViewSuspense fallback={<AvatarPlaceholder />}>
<Contributors filename={meta.frontmatter.filename} />
<Contributors filename={`packages/x/${meta.frontmatter.filename}`} />
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find and examine the related component implementations

echo "=== Content/index.tsx file structure ==="
wc -l packages/x/.dumi/theme/slots/Content/index.tsx

echo -e "\n=== Lines around the three components ==="
sed -n '65,75p' packages/x/.dumi/theme/slots/Content/index.tsx
echo "..."
sed -n '85,95p' packages/x/.dumi/theme/slots/Content/index.tsx
echo "..."
sed -n '100,110p' packages/x/.dumi/theme/slots/Content/index.tsx

echo -e "\n=== Searching for Contributors component definition ==="
fd -t f Contributors.tsx packages/x/.dumi/theme -o -name "*ontributors*"

echo -e "\n=== Searching for EditButton component definition ==="
fd -t f EditButton.tsx packages/x/.dumi/theme -o -name "*ditButton*"

echo -e "\n=== Searching for ComponentMeta component definition ==="
fd -t f ComponentMeta.tsx packages/x/.dumi/theme -o -name "*omponentMeta*"

Repository: ant-design/x

Length of output: 2521


🏁 Script executed:

#!/bin/bash
# Search for component definitions using rg

echo "=== Searching for Contributors component definition ==="
rg -l "export.*Contributors" packages/x/.dumi/theme --type tsx --type ts | head -10

echo -e "\n=== Searching for EditButton component definition ==="
rg -l "export.*EditButton" packages/x/.dumi/theme --type tsx --type ts | head -10

echo -e "\n=== Searching for ComponentMeta component definition ==="
rg -l "export.*ComponentMeta" packages/x/.dumi/theme --type tsx --type ts | head -10

echo -e "\n=== Looking in parent theme directories ==="
find packages/x/.dumi/theme -type d | head -20

Repository: ant-design/x

Length of output: 1236


🏁 Script executed:

#!/bin/bash
# Find component directories and their implementations

echo "=== Looking for Contributors directory ==="
find packages/x/.dumi/theme -type d -name "*ontributor*"

echo -e "\n=== Looking for EditButton directory ==="
find packages/x/.dumi/theme -type d -name "*ditButton*"

echo -e "\n=== ComponentMeta implementation ==="
find packages/x/.dumi/theme/builtins/ComponentMeta -type f | head -5

echo -e "\n=== All builtins directories ==="
ls -1 packages/x/.dumi/theme/builtins | grep -E "Contributor|EditButton|ComponentMeta"

echo -e "\n=== Search for Contributors in entire builtins ==="
find packages/x/.dumi/theme/builtins -type d | sort

Repository: ant-design/x

Length of output: 1499


🏁 Script executed:

#!/bin/bash
# Search entire codebase for component definitions

echo "=== Search for Contributors component ==="
rg "Contributors" packages/x/.dumi/theme --type js | grep -E "(import|export|function|const)" | head -10

echo -e "\n=== Search for EditButton component ==="
rg "EditButton" packages/x/.dumi/theme --type js | grep -E "(import|export|function|const)" | head -10

echo -e "\n=== Read ComponentMeta implementation ==="
cat packages/x/.dumi/theme/builtins/ComponentMeta/index.tsx

echo -e "\n=== Search for Contributors and EditButton in entire packages/x ==="
rg "export.*Contributors|export.*EditButton" packages/x --type js | head -20

Repository: ant-design/x

Length of output: 6404


🏁 Script executed:

#!/bin/bash
# Look at imports in the Content/index.tsx file

echo "=== Read full Content/index.tsx file ==="
cat packages/x/.dumi/theme/slots/Content/index.tsx

echo -e "\n=== Search for EditButton and Contributors imports in entire theme ==="
rg "import.*EditButton|import.*Contributors" packages/x/.dumi/theme -A 1 -B 1

Repository: ant-design/x

Length of output: 6016


🏁 Script executed:

#!/bin/bash
# Read Contributors and EditButton implementations

echo "=== Read Contributors.tsx ==="
cat packages/x/.dumi/theme/slots/Content/Contributors.tsx

echo -e "\n=== Read EditButton ==="
cat packages/x/.dumi/theme/common/EditButton.tsx

Repository: ant-design/x

Length of output: 3096


🏁 Script executed:

#!/bin/bash
# Verify the branch names in the EditButton and ComponentMeta

echo "=== EditButton branchUrl ==="
rg "branchUrl.*=" packages/x/.dumi/theme/common/EditButton.tsx

echo -e "\n=== ComponentMeta branchUrl ==="
rg "branchUrl.*=" packages/x/.dumi/theme/builtins/ComponentMeta/index.tsx

echo -e "\n=== Contributors filename usage ==="
rg "fileName=" packages/x/.dumi/theme/slots/Content/Contributors.tsx -A 2 -B 2

Repository: ant-design/x

Length of output: 443


组件 filename 路径前缀不完整 - ComponentMeta 也需要更新

当前更改为 Contributors 组件添加了 packages/x/ 前缀,但 ComponentMeta 组件也需要相同的更新。两个组件的 branchUrl 都不包含 packages/x/ 路径:

  • ComponentMeta (line 90): branchUrl = 'https://github.com/ant-design/x/edit/main/' - 需要完整路径
  • Contributors (line 105): 已正确更新为 packages/x/${meta.frontmatter.filename}
  • EditButton (line 71): 无需修改,因为其 branchUrl 已包含 'https://github.com/ant-design/x/edit/next/packages/x/'

建议将 ComponentMeta 的 filename 也更新为:filename={packages/x/${meta.frontmatter.filename}}

🤖 Prompt for AI Agents
In packages/x/.dumi/theme/slots/Content/index.tsx around lines 90 to 105,
ComponentMeta's branchUrl/filename usage still points to the repo root path
(missing the packages/x/ prefix) while Contributors (line 105) was updated;
update ComponentMeta at line 90 to use the same filename path as Contributors by
prepending "packages/x/" to meta.frontmatter.filename (i.e., make
ComponentMeta's filename prop
filename={`packages/x/${meta.frontmatter.filename}`}) so both components
generate correct branchUrl paths.

@cloudflare-workers-and-pages
Copy link

Deploying ant-design-x with  Cloudflare Pages  Cloudflare Pages

Latest commit: b74bfa6
Status: ✅  Deploy successful!
Preview URL: https://588cc86f.ant-design-x.pages.dev
Branch Preview URL: https://doc-avater.ant-design-x.pages.dev

View logs

@kimteayon kimteayon merged commit 07ccf0a into main Nov 27, 2025
15 checks passed
@kimteayon kimteayon deleted the doc_avater branch November 27, 2025 10:25
@codecov
Copy link

codecov bot commented Nov 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.01%. Comparing base (a95a3a0) to head (b74bfa6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1384      +/-   ##
==========================================
- Coverage   94.07%   94.01%   -0.06%     
==========================================
  Files         144      144              
  Lines        3710     3710              
  Branches     1022     1038      +16     
==========================================
- Hits         3490     3488       -2     
- Misses        218      220       +2     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
packages/x/dist/antdx.min.js 55.39 KB
packages/x-sdk/dist/x-sdk.min.js 7.29 KB
packages/x-markdown/dist/x-markdown.min.js 50.7 KB
packages/x-markdown/dist/plugins/code-high-light.min.js 317.91 KB
packages/x-markdown/dist/plugins/latex.min.js 61.95 KB
packages/x-markdown/dist/plugins/mermaid.min.js 885.83 KB

@codecov
Copy link

codecov bot commented Nov 30, 2025

Bundle Report

Changes will decrease total bundle size by 5.04MB (-54.01%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
x-markdown-array-push 4.15MB -5.04MB (-54.83%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: x-markdown-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
mermaid.min.js (New) 4.15MB 4.15MB 100.0% 🚀
mermaid.js (Deleted) -9.19MB 0 bytes -100.0% 🗑️

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

Labels

documentation Improvements or additions to documentation lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants