Skip to content

refactor: normalizeThemeConfig code style#2481

Merged
Timeless0911 merged 1 commit intomainfrom
syt/normalize-theme-config
Aug 15, 2025
Merged

refactor: normalizeThemeConfig code style#2481
Timeless0911 merged 1 commit intomainfrom
syt/normalize-theme-config

Conversation

@SoonIter
Copy link
Copy Markdown
Member

@SoonIter SoonIter commented Aug 15, 2025

Summary

refactor: normalizeThemeConfig code style

Related Issue

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings August 15, 2025 10:02
@netlify
Copy link
Copy Markdown

netlify Bot commented Aug 15, 2025

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit 3070e5c
🔍 Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/689f1150f33433000895e7a1
😎 Deploy Preview https://deploy-preview-2481--rspress-v2.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.

Copy link
Copy Markdown
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 refactors the normalizeThemeConfig function by extracting common patterns into reusable helper functions and simplifying the navigation item transformation logic.

  • Extracts text replacement and link transformation logic into dedicated helper functions
  • Simplifies the navigation item transformation with a more generic recursive approach
  • Removes redundant property spreading and removes the tag property assignment
Comments suppressed due to low confidence (2)

packages/core/src/node/runtimeModule/siteData/normalizeThemeConfig.ts:107

  • The removal of tag: item.tag property assignment may be unintentional. If the tag property should be preserved in the normalized sidebar item, it needs to be included in the spread operation or explicitly assigned.
          items: item.items.map(subItem => {

packages/core/src/node/runtimeModule/siteData/normalizeThemeConfig.ts:119

  • The removal of tag: item.tag property assignment may be unintentional. If the tag property should be preserved in the normalized sidebar item, it needs to be included in the new implementation.
      };

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

Comment thread packages/core/src/node/runtimeModule/siteData/normalizeThemeConfig.ts Outdated
@SoonIter SoonIter changed the title refactor: normalizeThemeConfig refactor: normalizeThemeConfig code style Aug 15, 2025
@SoonIter SoonIter requested a review from Timeless0911 August 15, 2025 10:20
Timeless0911
Timeless0911 previously approved these changes Aug 15, 2025
Timeless0911
Timeless0911 previously approved these changes Aug 15, 2025
Timeless0911
Timeless0911 previously approved these changes Aug 15, 2025
@Timeless0911 Timeless0911 merged commit 785be80 into main Aug 15, 2025
8 of 9 checks passed
@Timeless0911 Timeless0911 deleted the syt/normalize-theme-config branch August 15, 2025 11:11
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