Skip to content

Conversation

@JounQin
Copy link
Member

@JounQin JounQin commented Aug 18, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Ensure base path is correctly included in generated URLs.
    • Improve sidebar link handling to avoid invalid paths.
  • Refactor

    • Migrate components to use site-level data for titles, language, and theme, aligning with newer runtime APIs. No user-facing behavior changes expected.
  • Chores

    • Update multiple dependencies to latest versions for stability and tooling improvements.
    • Remove deprecated lint suppressions and minor code cleanups.

@JounQin JounQin self-assigned this Aug 18, 2025
Copilot AI review requested due to automatic review settings August 18, 2025 09:39
@JounQin JounQin added bug Something isn't working dependencies Pull requests that update a dependency file labels Aug 18, 2025
@changeset-bot
Copy link

changeset-bot bot commented Aug 18, 2025

🦋 Changeset detected

Latest commit: 572559b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@alauda/doom Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Aug 18, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Caution

Review failed

The pull request is closed.

Walkthrough

Switch runtime data access from usePageData to useSite/usePage across several components, remove deprecated ESLint disables, tweak sidebar link resolution in theme.tsx, bump multiple dependencies, and add a changeset noting a patch fix for pathname base inclusion. No exported APIs changed.

Changes

Cohort / File(s) Summary of changes
Release metadata
./.changeset/clever-melons-talk.md
Added patch changeset for @alauda/doom documenting “fix: base is not included in pathname”.
Dependency bumps
./package.json
Version bumps for @rspress/*, @eslint-react/eslint-plugin, @inquirer/prompts, es-toolkit, @changesets/cli, @swc-node/register, @types/node. No code changes.
Runtime hook migration
./src/global/VersionsNav/index.tsx, ./src/runtime/components/ExternalSiteLink.tsx, ./src/runtime/components/OpenAPIRef.tsx, ./src/theme.tsx
Replace usePageData with useSite/usePage; update references (siteData → site). In theme.tsx, also adjust sidebar link computation (use sidebar.link
Lint cleanup (no runtime change)
./src/global/SiteOverrides/index.tsx, ./src/runtime/components/Overview.tsx
Removed inline ESLint disable comments; no logic changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Component (VersionsNav/ExternalSiteLink/OpenAPIRef/Layout)
  participant R as @rspress/core/runtime
  participant S as Site/Page Data

  C->>R: useSite() / usePage()
  R-->>C: { site } / { page }
  C->>C: Read site.lang/title/themeConfig
  C-->>C: Render UI / compute links
Loading
sequenceDiagram
  autonumber
  participant L as Layout (theme.tsx)
  participant S as Site
  participant U as URL Utils

  L->>S: site = useSite().site
  L->>U: sidebar.link || '' → cleanupUrlPath(...)
  U-->>L: normalized sidebarLink
  L->>U: withBase(pdfLink)
  U-->>L: pdf href
  L-->>L: Render with updated links
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

A nibble of base in the path at last,
I hop through hooks—useSite, not past.
Sidebars tidied, links align,
Dependencies fresh and fine.
With whiskers twitching, I review and say:
Patch released—onward, thump-hooray! 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between aed64d2 and 572559b.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (8)
  • .changeset/clever-melons-talk.md (1 hunks)
  • package.json (2 hunks)
  • src/global/SiteOverrides/index.tsx (0 hunks)
  • src/global/VersionsNav/index.tsx (2 hunks)
  • src/runtime/components/ExternalSiteLink.tsx (2 hunks)
  • src/runtime/components/OpenAPIRef.tsx (2 hunks)
  • src/runtime/components/Overview.tsx (0 hunks)
  • src/theme.tsx (3 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/sidebar_link_match

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Signed-off-by: JounQin <admin@1stg.me>
@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 18, 2025

Open in StackBlitz

yarn add https://pkg.pr.new/@alauda/doom@152.tgz

commit: 572559b

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 migrates from deprecated usePageData hook to the new usePage and useSite hooks from @rspress/core/runtime, while also updating package versions. The changes address the deprecation warnings and ensure compatibility with the updated @RsPress framework.

  • Replace usePageData with usePage and useSite hooks across multiple components
  • Remove withBase usage in sidebar link processing
  • Update @RsPress packages from beta.26 to beta.27 and other dependency versions

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/theme.tsx Replace usePageData with useSite and remove withBase from sidebar link processing
src/runtime/components/Overview.tsx Remove deprecated comment about usePage not being exported
src/runtime/components/OpenAPIRef.tsx Replace usePageData with usePage hook
src/runtime/components/ExternalSiteLink.tsx Replace usePageData with useSite hook
src/global/VersionsNav/index.tsx Replace usePageData with useSite hook and update variable references
src/global/SiteOverrides/index.tsx Remove deprecated comment
package.json Update @RsPress packages and other dependencies to newer versions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@JounQin JounQin merged commit 25fe495 into main Aug 18, 2025
15 checks passed
@JounQin JounQin deleted the fix/sidebar_link_match branch August 18, 2025 09:53
github-actions bot pushed a commit that referenced this pull request Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants