Skip to content

add graph in dependencies page and version selector#1357

Merged
benjamin-747 merged 11 commits into
gitmono-dev:mainfrom
martinwq997:main
Aug 21, 2025
Merged

add graph in dependencies page and version selector#1357
benjamin-747 merged 11 commits into
gitmono-dev:mainfrom
martinwq997:main

Conversation

@martinwq997

Copy link
Copy Markdown
Contributor

No description provided.

@vercel

vercel Bot commented Aug 19, 2025

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
mega Ready Ready Preview Comment Aug 21, 2025 9:33am

This comment was marked as outdated.

This comment was marked as outdated.

Comment thread moon/apps/web/package.json Outdated
"d3-selection": "catalog:",
"d3-zoom": "catalog:",
"date-fns": "catalog:",
"date-fns": "^4.1.0",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

需要改成"date-fns": "catalog:"

"metascraper-url": "catalog:",
"metascraper-video": "catalog:",
"metascraper-youtube": "catalog:",
"next": "catalog:",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

需要改成"next": "catalog:",

"remeda": "catalog:",
"slugify": "catalog:",
"styled-components": "catalog:",
"styled-jsx": "^5.1.7",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

需要改成catalog 形式

Comment thread moon/package.json Outdated
}
},
"dependencies": {
"merge-stream": "^2.0.0",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

请在pnpm-workspace 添加依赖

@benjamin-747 benjamin-747 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

请按照要求修改

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

不要修改不相关的文件

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

不要修改不相关的文件

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: mapan-nju <2246839805@qq.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 a graph visualization for dependency data and implements an interactive version selector component. The changes enable users to view dependency relationships in both table and graph formats while providing the ability to switch between different package versions.

  • Adds D3.js dependencies for graph visualization
  • Implements a dependencies graph page with interactive D3 visualization
  • Creates a reusable version selector dropdown component with version switching functionality

Reviewed Changes

Copilot reviewed 11 out of 14 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
moon/pnpm-workspace.yaml Adds D3.js and related type definitions to the package catalog
moon/apps/web/package.json Includes new dependencies in the web app package
moon/apps/web/pages/[org]/rust/rust-ecosystem/crate-info/[crateName]/layout.tsx Integrates version selector dropdown with state management and URL updates
moon/apps/web/pages/[org]/rust/rust-ecosystem/crate-info/[crateName]/dependencies/index.tsx Updates dependencies page to navigate to graph view and removes local view mode state
moon/apps/web/pages/[org]/rust/rust-ecosystem/crate-info/[crateName]/dependencies/graph/index.tsx New graph visualization page using D3.js for dependency relationships
moon/apps/web/components/Rust/VersionSelector/VersionSelectorDropdown.tsx Reusable dropdown component for version selection
moon/apps/web/components/Rust/Graph/DependencyGraph.tsx D3.js-based interactive graph component for visualizing dependencies
Files not reviewed (1)
  • moon/pnpm-lock.yaml: Language not supported

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

[params?.nsfront, router.query.org]
);

// 版本选择相关状态

Copilot AI Aug 21, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] Comment is in Chinese. Consider using English for consistency with the rest of the codebase.

Suggested change
// 版本选择相关状态
// Version selection related state

Copilot uses AI. Check for mistakes.
router.push(href, undefined, { shallow: true });
}, [router]);

// 版本选择处理函数

Copilot AI Aug 21, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] Comment is in Chinese. Consider using English for consistency with the rest of the codebase.

Suggested change
// 版本选择处理函数
// Handler for version selection

Copilot uses AI. Check for mistakes.
// 版本选择处理函数
const handleVersionSelect = useCallback((newVersion: string) => {
setSelectedVersion(newVersion);
// 更新URL中的版本参数

Copilot AI Aug 21, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] Comment is in Chinese. Consider using English for consistency with the rest of the codebase.

Suggested change
// 更新URL中的版本参数
// Update the version parameter in the URL

Copilot uses AI. Check for mistakes.

// 从查询参数或URL参数中获取crate信息
const crateName = (router.query.crateName as string) || params?.crateName as string || "tokio";
// const version = (router.query.version as string) || params?.version as string || "1.2.01";

Copilot AI Aug 21, 2025

Copy link

Choose a reason for hiding this comment

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

Remove commented-out code. If the version variable is not needed, delete this line entirely.

Suggested change
// const version = (router.query.version as string) || params?.version as string || "1.2.01";

Copilot uses AI. Check for mistakes.
import React, { useEffect, useRef, useState } from 'react';
import * as d3 from 'd3';
// import { useParams } from "next/navigation";

Copilot AI Aug 21, 2025

Copy link

Choose a reason for hiding this comment

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

Remove commented-out import. If useParams is not needed, delete this line entirely.

Suggested change

Copilot uses AI. Check for mistakes.
// 使用本地模拟数据替代 API 调用
const mockData = generateMockDependencyData();

// console.log('Mock data for graph:', mockData);

Copilot AI Aug 21, 2025

Copy link

Choose a reason for hiding this comment

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

Remove commented-out console.log statement. Debug code should not be included in production.

Suggested change
// console.log('Mock data for graph:', mockData);

Copilot uses AI. Check for mistakes.
<div className="border-t pt-3 mt-3">
<button
onClick={() => {
// console.log('View all versions');

Copilot AI Aug 21, 2025

Copy link

Choose a reason for hiding this comment

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

Remove commented-out console.log statement. Debug code should not be included in production.

Suggested change
// console.log('View all versions');

Copilot uses AI. Check for mistakes.
@benjamin-747
benjamin-747 added this pull request to the merge queue Aug 21, 2025
Merged via the queue into gitmono-dev:main with commit 2e3a392 Aug 21, 2025
4 checks passed
liuyangjuncong20202570 pushed a commit to liuyangjuncong20202570/mega that referenced this pull request Aug 23, 2025
* add graph in dependencies page and version selector

* change package.json file

* debug--build

* Update moon/apps/web/package.json

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: mapan-nju <2246839805@qq.com>

* reload pnpm-lock

* change pnpm-lock.yaml

---------

Signed-off-by: mapan-nju <2246839805@qq.com>
Co-authored-by: Quanyi Ma <eli@patch.sh>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

4 participants