Skip to content

Add AI comment selection, LLM feedback, and usage stats dashboard#3662

Open
tzj04 wants to merge 54 commits intosource-academy:masterfrom
tzj04:feature-ai-comments
Open

Add AI comment selection, LLM feedback, and usage stats dashboard#3662
tzj04 wants to merge 54 commits intosource-academy:masterfrom
tzj04:feature-ai-comments

Conversation

@tzj04
Copy link
Copy Markdown

@tzj04 tzj04 commented Mar 16, 2026

Summary

This PR adds AI-assisted grading comment UX, LLM feedback submission, and ground-control LLM usage monitoring UI.

What Changed

  • Added interactive AI comment selection in grading flow.
  • Added word-level diffing and inline editor synchronization improvements.
  • Added save guards around selected AI comment persistence.
  • Added LLM feedback submission UI in grading.
  • Added LLM request/response typings and request handlers.
  • Added ground control LLM usage stats views and dialog.
  • Refactored API call path for chosen comments to answer-based endpoint.

Frontend Scope

  • Grading UI:
    • src/pages/academy/grading/subcomponents/GradingEditor.tsx
    • src/pages/academy/grading/subcomponents/GradingCommentSelector.tsx
    • src/pages/academy/grading/subcomponents/GradingWorkspace.tsx
    • src/pages/academy/grading/subcomponents/LLMFeedbackButton.tsx
  • Request + types:
    • src/commons/sagas/RequestsSaga.ts
    • src/commons/assessment/AssessmentTypes.ts
  • Ground control stats:
    • src/pages/academy/groundControl/GroundControl.tsx
    • src/pages/academy/groundControl/subcomponents/GroundControlLLMStatsCell.tsx
    • src/pages/academy/groundControl/subcomponents/LLMStatsDialog.tsx
  • Styling:
    • src/styles/GradingCommentSelector.module.scss

@github-actions
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 23139665438

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 5 of 23 (21.74%) changed or added relevant lines in 1 file are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.09%) to 41.148%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/commons/sagas/RequestsSaga.ts 5 23 21.74%
Files with Coverage Reduction New Missed Lines %
src/commons/sagas/RequestsSaga.ts 1 13.06%
src/commons/sideContent/content/SideContentCseMachine.tsx 3 38.78%
Totals Coverage Status
Change from base Build 23139498282: -0.09%
Covered Lines: 5431
Relevant Lines: 12249

💛 - Coveralls

Copy link
Copy Markdown

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 introduces AI-assisted grading UX for selecting/editing generated comments, adds an in-grading LLM feedback submission dialog, and adds a ground-control UI for monitoring LLM usage statistics and feedback.

Changes:

  • Adds selectable AI comment suggestions in grading, with persistence of chosen indices + edited text.
  • Adds LLM feedback submission UI in grading and new request handlers/typings for LLM stats + feedback.
  • Adds a ground control “LLM statistics” cell and drill-down dialog for assessment/task usage + feedback.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/styles/GradingCommentSelector.module.scss Adds styles for selectable comment rows, edit/diff preview styling, and selected state.
src/pages/academy/groundControl/subcomponents/LLMStatsDialog.tsx New dialog to display assessment/task LLM usage stats and feedback lists.
src/pages/academy/groundControl/subcomponents/GroundControlLLMStatsCell.tsx New control cell to open the LLM stats dialog when LLM grading is enabled.
src/pages/academy/groundControl/GroundControl.tsx Wires the new LLM stats cell into the ground control row actions.
src/pages/academy/grading/subcomponents/LLMFeedbackButton.tsx New dialog/button for graders to submit rating + feedback on LLM comments.
src/pages/academy/grading/subcomponents/GradingWorkspace.tsx Passes assessmentId down to the grading editor to support feedback submission.
src/pages/academy/grading/subcomponents/GradingEditor.tsx Major refactor: selection-by-index, editor synchronization via internal markers, save guards, and feedback button integration.
src/pages/academy/grading/subcomponents/GradingCommentSelector.tsx Updates selector UI to checkbox-based selection and selected-row styling.
src/commons/sagas/RequestsSaga.ts Adds request helpers for saving chosen comments + fetching/submitting LLM stats/feedback; replaces prior save-final-comment API call.
src/commons/assessment/AssessmentTypes.ts Extends AssessmentOverview with isLlmGraded for conditional LLM stats UI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@martin-henz
Copy link
Copy Markdown
Member

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements LLM usage tracking and AI-assisted grading, adding a course-wide statistics dashboard, configurable token costs, and an updated grading editor for selecting and editing AI-generated comments. Key feedback includes addressing potential CSV corruption in report downloads due to missing field escaping, refactoring the fragile use of invisible Unicode delimiters for parsing comment strings in the editor, and improving the robustness of request ID generation currently relying on non-unique timestamps.

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