Conversation
- 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
…and analysis state
- 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
Deploying githubrepoanalyzer with
|
| Latest commit: |
d54ca3e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://36aba91f.githubrepoanalyzer.pages.dev |
There was a problem hiding this comment.
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
RepoContextto replaceuseStudentStorefor managingrepoStudentsand ordering - Refactored bonus marks tab, summary, teamwork, PRs, issues, and commits tabs to use context-driven student order
- Applied
cursor: defaultstyling 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
rowobjects do not includedragAttributesordragListeners, so these props will always be undefined. Remove these from therowand letDraggableRowinject 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
repoStudentsandisInitialized. Add tests to verify initial student order setup and data-change handling.
useEffect(() => {
| dragAttributes?: any; | ||
| dragListeners?: any; |
There was a problem hiding this comment.
Avoid using any for dragAttributes and dragListeners; import the specific types from @dnd-kit (e.g., DraggableAttributes, DraggableListeners) to improve type safety.
| dragAttributes?: any; | |
| dragListeners?: any; | |
| dragAttributes?: DraggableAttributes; | |
| dragListeners?: DraggableListeners; |
| 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"; |
There was a problem hiding this comment.
[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.
| ]) | ||
| ); | ||
| // 只有在未初始化状态或初次加载数据时才进行初始化 | ||
| if (!isInitialized) { |
There was a problem hiding this comment.
[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.
Description
This pull request includes the following updates and improvements:
Style adjustments:
Refactoring and fixes:
studentOrderwithrepoStudentsfor better state management usingRepoContext.New features:
RepoContextto centrally manage the student order and analysis state.ContributorCelldrag-and-drop functionality and optimized drag-and-drop implementation in ContributorsTable.Build updates:
0.4.7.Checklist