Skip to content

Enhance GitHub components and improve student order management#17

Merged
qinscode merged 10 commits into
mainfrom
release
May 21, 2025
Merged

Enhance GitHub components and improve student order management#17
qinscode merged 10 commits into
mainfrom
release

Conversation

@qinscode

Copy link
Copy Markdown
Owner

Description

This pull request includes the following updates and improvements:

  • Style adjustments:

    • Refined typography and spacing in various components.
    • Improved table head and draggable text cursor styling.
  • Refactoring and fixes:

    • Replaced studentOrder with repoStudents for better state management using RepoContext.
    • Improved sorting and initialization logic for student order in multiple tabs (e.g., Commits, Issues, Pull Requests, and others).
  • New features:

    • Introduced RepoContext to centrally manage the student order and analysis state.
    • Enhanced ContributorCell drag-and-drop functionality and optimized drag-and-drop implementation in ContributorsTable.
  • Build updates:

    • Bumped project version to 0.4.7.
    • Updated version displays across the project.

Checklist

  • Includes tests for new features/functionality.
  • Documentation has been updated as necessary.
  • Follows code style and standards of the project.

qinscode added 10 commits May 20, 2025 23:47
- Update ContributorCell to accept dragAttributes and dragListeners props
- Modify ContributorsTable to pass drag props to ContributorCell
- Adjust DraggableRow to clone children and provide drag props to the first cell
…entation

- Remove unnecessary dragAttributes and dragListeners props from ContributorCell
- Handle ContributorCell rendering specially in renderRow method
- Simplify column.format usage in table cells
…entation

- Remove unnecessary dragAttributes and dragListeners props from ContributorCell
- Handle ContributorCell rendering specially in renderRow method
- Simplify column.format usage in table cells
# Conflicts:
#	src/components/github/analysis/tabs/bonusMarks/ContributorsTable.tsx
…ion to 0.4.7 in package.json

- Update version display in GitHub.tsx and Root.tsx
- Add userSelect: "none" style to repository analysis title
- Use RepoContext to manage student order and initialization state
- Sort contributors based on student order and alphabetically for non-students
- Optimize student order initialization in SummaryTab and RepoResults
- Update BonusMarksTab to use sorted contributors and repo-specific student order
- Remove usage of studentOrder from various tabs (Commits, Issues, Pull Requests, Teamwork)
- Replace with repoStudents from RepoContext
- Update import statements for RepoContext
- Remove unused import of useStudentStore
- Add cursor: "default" styling to table head in DataTable component
- Add cursor: "default" styling to draggable text in StudentOrderer component
- Remove unnecessary
- Remove unnecessary vertical spacing from BatchResults
- Reorder variant and sx props in RepoStatusList for better readability
Copilot AI review requested due to automatic review settings May 21, 2025 09:22
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying githubrepoanalyzer with  Cloudflare Pages  Cloudflare Pages

Latest commit: d54ca3e
Status: ✅  Deploy successful!
Preview URL: https://36aba91f.githubrepoanalyzer.pages.dev

View logs

@qinscode qinscode merged commit e1917e8 into main May 21, 2025
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

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 centralizes student order management via a new RepoContext, enhances drag-and-drop functionality in GitHub analysis tables, and applies consistent cursor styling across form components.

  • Introduced RepoContext to replace useStudentStore for managing repoStudents and ordering
  • Refactored bonus marks tab, summary, teamwork, PRs, issues, and commits tabs to use context-driven student order
  • Applied cursor: default styling across form labels and added proper drag attribute passing

Reviewed Changes

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

Show a summary per file
File Description
src/components/github/forms/RepoUrlsInput.tsx Added cursor: default to labels and inputs
src/components/github/forms/RepoStatusList.tsx Added cursor: default to status header typography
src/components/github/forms/GitHubTokenInput.tsx Applied cursor: default styling to token label and hint
src/components/github/forms/AnalysisOptions.tsx Added default cursor on analysis option icons
src/components/github/analysis/tabs/bonusMarks/types.ts Extended ContributorCellProps with dragAttributes and dragListeners
src/components/github/analysis/tabs/bonusMarks/index.tsx Switched to RepoContext for student order and reordering
src/components/github/analysis/tabs/bonusMarks/DraggableRow.tsx Injected React import and scoped drag props to first cell
src/components/github/analysis/tabs/bonusMarks/ContributorsTable.tsx Sorted contributors by repoStudents and customized row rendering
src/components/github/analysis/tabs/TeamworkTab.tsx Replaced global store with RepoContext in sorting logic
src/components/github/analysis/tabs/SummaryTab.tsx Migrated initialization logic to use context-driven state
src/components/github/analysis/tabs/PullRequestsTab.tsx Updated PR tab to consume repoStudents from context
src/components/github/analysis/tabs/IssuesTab.tsx Refactored issue tab sorting to use repoStudents
src/components/github/analysis/tabs/CommitsTab.tsx Changed commits tab to context-based student ordering
src/components/github/analysis/components/StudentOrderer.tsx Swapped store hooks for RepoContext and cleaned up drag IDs
src/components/github/analysis/components/NoDataDisplay.tsx Added default cursor styling on no-data messages
src/components/github/analysis/components/ContributionTable.tsx Ensured default cursor on table headers and cells
src/components/github/analysis/components/CommitBarChart.tsx Added cursor: default to empty-state commit typography
src/components/github/analysis/components/ChartTip.tsx Applied default cursor to chart tip text
package.json Bumped project version from 0.4.0 to 0.4.7
Comments suppressed due to low confidence (2)

src/components/github/analysis/tabs/bonusMarks/ContributorsTable.tsx:151

  • The row objects do not include dragAttributes or dragListeners, so these props will always be undefined. Remove these from the row and let DraggableRow inject its own attributes/listeners into the first child.
<ContributorCell dragAttributes={row.dragAttributes} dragListeners={row.dragListeners} isDragging={value === activeId} value={value} />

src/components/github/analysis/tabs/SummaryTab.tsx:22

  • There are no unit tests covering the initialization logic around repoStudents and isInitialized. Add tests to verify initial student order setup and data-change handling.
useEffect(() => {

Comment on lines +49 to +50
dragAttributes?: any;
dragListeners?: any;

Copilot AI May 21, 2025

Copy link

Choose a reason for hiding this comment

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

Avoid using any for dragAttributes and dragListeners; import the specific types from @dnd-kit (e.g., DraggableAttributes, DraggableListeners) to improve type safety.

Suggested change
dragAttributes?: any;
dragListeners?: any;
dragAttributes?: DraggableAttributes;
dragListeners?: DraggableListeners;

Copilot uses AI. Check for mistakes.
import { bonusMarksTheme } from "../../components/AnalysisThemes";
import AnalysisTabLayout from "../../components/layout/AnalysisTabLayout.tsx";
import { useStudentStore } from "@/store/useStudentStore";
import { RepoContext } from "@/components/github/repo-analysis/RepoResults";

Copilot AI May 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] Consider adding JSDoc or inline comments to explain the RepoContext API (e.g., available values and update methods) to help future contributors understand its usage.

Copilot uses AI. Check for mistakes.
])
);
// 只有在未初始化状态或初次加载数据时才进行初始化
if (!isInitialized) {

Copilot AI May 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] This useEffect handles both initialization and data-change logic; consider extracting it into a custom hook (e.g., useRepoStudentsInitializer) to simplify the component and improve readability.

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.

2 participants