[UserStatistics] Add recent semantic domain column
Adds a column to the user statistics table showing each user's most recently added semantic domain with timestamp and provenance.
Backend
- Extended
SemanticDomainUserCountmodel withRecentDomainproperty - Modified
GetSemanticDomainUserCountsto track most recent domain byCreatedtimestamp, removingUserIdfrom returned clone - Added test verifying correct timestamp comparison and userId removal
Frontend
- Added column between "Domains" and "Words" using
DomainChipwithprovenanceenabled - Updated TypeScript model and factory function to include
recentDomainfield - Added translation key
statistics.column.recentDomain
The DomainChip component displays the domain ID and name, with hover text showing the creation timestamp and username (fetched separately by the chip).
Original prompt
This section details on the original issue you should resolve
<issue_title>[Statistics]</issue_title> <issue_description>In
src/.components/Statistics/UserStatistics.tsx, there's a table with 3 columns. Add a new column that gives the most recent semantic domain added by the user.Details:
GetSemanticDomainUserCountsinBackend/Services/StatisticsService.cswill need to also return the semantic domain with the most recent timestamp for each project user- new
UserStatistics.tsxcolumn: recentDomain, right after domainCount- cell content uses
src/components/WordCard/DomainChip.tsxwith the following props:
- provenance: true
- most recent domain with userId removed</issue_description>
<agent_instructions>Commit messages should satisfy https://github.com/sillsdev/TheCombine/blob/master/.github/workflows/commit_message_check.yml</agent_instructions>
Comments on the Issue (you are @copilot in this section)
- Fixes sillsdev/TheCombine#4021
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 74.64%. Comparing base (a54e777) to head (69ef847).
:warning: Report is 10 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #4022 +/- ##
==========================================
+ Coverage 74.58% 74.64% +0.05%
==========================================
Files 293 293
Lines 10817 10829 +12
Branches 1353 1355 +2
==========================================
+ Hits 8068 8083 +15
+ Misses 2354 2351 -3
Partials 395 395
| Flag | Coverage Δ | |
|---|---|---|
| backend | 85.55% <100.00%> (+0.09%) |
:arrow_up: |
| frontend | 66.23% <100.00%> (+<0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Before:
After (with hover-text shown for one chip):