Skip to content

Conversation

@longsizhuo
Copy link
Member

No description provided.

@vercel
Copy link

vercel bot commented Oct 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
involutionhell-github-io Ready Ready Preview Comment Oct 13, 2025 2:30pm
website-preview Ready Ready Preview Comment Oct 13, 2025 2:30pm

Copy link

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

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.

ℹ️ 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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds MDX image handling and remark plugins to support fumadocs functionality. The changes implement proper image processing for documentation by integrating fumadocs-core's MDX plugins and creating a custom image component.

  • Added remarkImage plugin configuration to process external images
  • Implemented custom MdxImage component to handle both Next.js Image optimization and fallback img elements
  • Added new image domain allowlists for external image sources

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
next.config.mjs Added remarkImage plugin configuration and external image domain allowlists
mdx-components.tsx Implemented custom MdxImage component with Next.js Image optimization
app/docs/ai/MoE/moe-update.md Added new documentation content about MoE theory
Files not reviewed (1)
  • .idea/workspace.xml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +15 to +23
return (
<img
src={src as string}
alt={alt}
width={width}
height={height}
{...rest}
/>
);
Copy link

Copilot AI Oct 11, 2025

Choose a reason for hiding this comment

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

The logic is inverted. When src is falsy, the code renders an img element with src={src as string}, which will result in an empty or undefined src attribute. The condition should be if (!src) with an early return or error handling, not rendering an img with the falsy src value.

Suggested change
return (
<img
src={src as string}
alt={alt}
width={width}
height={height}
{...rest}
/>
);
return null;

Copilot uses AI. Check for mistakes.
Comment on lines +33 to +34
width={numericWidth}
height={numericHeight}
Copy link

Copilot AI Oct 11, 2025

Choose a reason for hiding this comment

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

The Next.js Image component requires both width and height to be defined numbers when using static imports or external URLs. If either numericWidth or numericHeight is undefined or NaN after conversion, this will cause a runtime error. Add validation to ensure both values are valid numbers before passing to the Image component.

Copilot uses AI. Check for mistakes.
next.config.mjs Outdated
pathname: "/**",
},
{ protocol: "https", hostname: "img.coly.cc", pathname: "/**" },
{ protocol: "https", hostname: "pub-*.r2.dev", pathname: "/**" },
Copy link

Copilot AI Oct 11, 2025

Choose a reason for hiding this comment

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

[nitpick] The wildcard pattern pub-*.r2.dev may be too permissive for security purposes. Consider using more specific hostnames or implementing additional validation to ensure only trusted R2 buckets are allowed.

Suggested change
{ protocol: "https", hostname: "pub-*.r2.dev", pathname: "/**" },
// Only allow specific trusted R2 buckets:
{ protocol: "https", hostname: "pub-myproject.r2.dev", pathname: "/**" },
// Add more trusted hostnames as needed, e.g.:
// { protocol: "https", hostname: "pub-assets.r2.dev", pathname: "/**" },

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@TSK-Glofy TSK-Glofy left a comment

Choose a reason for hiding this comment

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

preview格式正确

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • .idea/workspace.xml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


if (!Number.isFinite(numericWidth) || !Number.isFinite(numericHeight)) {
// fallback: 当 width/height 不是可解析数值时,直接使用原生 <img>
return <img src={src ?? ""} alt={alt ?? ""} {...rest} />;
Copy link

Copilot AI Oct 11, 2025

Choose a reason for hiding this comment

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

The condition checks if either width or height is not finite, but the fallback doesn't pass the width and height props to the img element. This could result in missing dimensions that were intended to be applied.

Suggested change
return <img src={src ?? ""} alt={alt ?? ""} {...rest} />;
return <img src={src ?? ""} alt={alt ?? ""} width={width} height={height} {...rest} />;

Copilot uses AI. Check for mistakes.
next.config.mjs Outdated
pathname: "/**",
},
{ protocol: "https", hostname: "img.coly.cc", pathname: "/**" },
{ protocol: "https", hostname: "pub-*.r2.dev", pathname: "/**" },
Copy link

Copilot AI Oct 11, 2025

Choose a reason for hiding this comment

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

The wildcard pattern 'pub-*.r2.dev' for hostname may not work as expected in Next.js image configuration. Consider using a more specific hostname or verify that this wildcard pattern is supported by Next.js remotePatterns.

Suggested change
{ protocol: "https", hostname: "pub-*.r2.dev", pathname: "/**" },

Copilot uses AI. Check for mistakes.
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.

3 participants