-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General
: Display total LLM cost as text instead of pie chart
#10088
base: develop
Are you sure you want to change the base?
Conversation
Introduces the calculation and visualization of total LLM costs per course. Back-end changes include a repository query and DTO update, while front-end changes add a doughnut chart and i18n labels to display the cost. This enhances transparency of LLM usage.
WalkthroughThis pull request modifies the presentation of LLM cost and statistics in the course detail view. The changes involve simplifying the doughnut chart component's HTML template and updating the course detail component to display the LLM cost as a text element instead of a graphical chart. The modifications aim to improve the clarity and readability of cost and statistical information in the user interface. Changes
Sequence DiagramsequenceDiagram
participant UI as User Interface
participant Component as Course Detail Component
participant Service as Data Service
UI->>Component: Request Course Details
Component->>Service: Fetch Course Statistics
Service-->>Component: Return Statistics
alt LLM Chat Enabled
Component->>UI: Display LLM Cost as Text
else LLM Chat Disabled
Component->>UI: Hide LLM Cost
end
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/main/webapp/app/course/manage/detail/course-detail.component.html (1)
44-48
: LGTM! Successfully replaces chart with text display.The implementation aligns with the PR objective to display LLM cost as text instead of a pie chart. The conditional rendering and translation handling are correct.
Consider these improvements for better i18n support:
-{{ 'artemisApp.course.detail.currentTotalLLMCostTitle' | artemisTranslate }}{{ ': ' + courseDTO?.currentTotalLlmCostInEur + ' €' }} +{{ 'artemisApp.course.detail.currentTotalLLMCostWithValue' | artemisTranslate: { cost: courseDTO?.currentTotalLlmCostInEur } }}This assumes adding a new translation key that includes the full format with currency symbol, allowing for proper localization of both the text format and currency symbol.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/main/webapp/app/course/manage/detail/course-detail-doughnut-chart.component.html
(1 hunks)src/main/webapp/app/course/manage/detail/course-detail.component.html
(1 hunks)
🧰 Additional context used
🔇 Additional comments (1)
src/main/webapp/app/course/manage/detail/course-detail-doughnut-chart.component.html (1)
13-14
: LGTM! Clean template simplification.
The simplified display of statistics improves readability while maintaining all necessary information. The template correctly uses the new Angular @if
syntax as per guidelines.
Checklist
General
Client
Motivation and Context
There is no max value for LLM usage given. Hence, displaying it as a pie chart does not make sense.
Description
Instead, the total LLM cost is displayed as text in the course details view. In a future PR the design will be improved as it will be integrated in the existing statistics page.
Steps for Testing
Prerequisites:
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.
Review Progress
Performance Review
Code Review
Manual Tests
Exam Mode Test
Performance Tests
Test Coverage
Screenshots
Summary by CodeRabbit