Skip to content

Conversation

@imnasnainaec
Copy link
Collaborator

@imnasnainaec imnasnainaec commented Jan 6, 2026

Sometimes the domain name can be very long, causing the last columns to overflow the available table width. Moving most-recent-domain to be the last column resolves that.

Should we also consider adding a max width to that column in case more columns are added after it in the future?


This change is Reviewable

Summary by CodeRabbit

  • New Features

    • Added wordCount metric to the user statistics table display.
  • Improvements

    • Reordered statistics table columns to optimize data layout and removed duplicate column entries.

✏️ Tip: You can customize this high-level summary in your review settings.

@imnasnainaec imnasnainaec self-assigned this Jan 6, 2026
@imnasnainaec imnasnainaec added the bug Something isn't working label Jan 6, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

The UserStatistics component's table columns are reorganized, reordering recentDomain and domainCount relative to their previous layout. Duplicate domainCount and wordCount cells at the end of rows are removed, with wordCount inserted after username and domainCount positioned after wordCount. Column headers and data cells are synchronized to the new order.

Changes

Cohort / File(s) Summary
Table Column Reordering
src/components/Statistics/UserStatistics.tsx
Reorganized table columns: inserted wordCount after username, moved domainCount to follow wordCount, swapped positions of domainCount and recentDomain, removed duplicate cells at row end. Updated both header and body cell rendering to reflect new column sequence.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 With whiskers twitching, columns dance anew,
Swapped and shuffled in a sparkling queue,
Duplicates gone, the table gleams bright,
Data aligned in perfect order—what a sight!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: reordering columns in the user statistics table to address overflow issues with long domain names.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@imnasnainaec imnasnainaec added 🟨Medium Medium-priority PR and removed frontend labels Jan 6, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI Agents
In @src/components/Statistics/UserStatistics.tsx:
- Around line 43-46: The second column header TitleId is wrong: HeadCell
currently uses titleId="statistics.column.senseCount" while the data cell
renders t.wordCount; update the header to match the data by changing the
HeadCell titleId to "statistics.column.wordCount" (or alternatively change the
data cell to render t.senseCount if the intent was to show senses), ensuring
HeadCell and the corresponding data cell use the same key so the header
correctly describes the t.wordCount value.
🧹 Nitpick comments (1)
src/components/Statistics/UserStatistics.tsx (1)

52-64: Column reordering looks good; consider adding max-width to recentDomain.

The approach of moving the recentDomain column to the end effectively prevents overflow of other columns when domain names are long. The data cell rendering is correct and properly handles null values for recentDomain.

Regarding your question about adding a max-width: Yes, adding a max-width constraint to the recentDomain column would be a good safeguard. This would ensure that even extremely long domain names don't break the layout, especially if additional columns are added in the future.

💡 Suggested enhancement for max-width

Consider adding a sx prop to the recentDomain Cell to constrain its width:

             <Cell
+              sx={{ maxWidth: 250, overflow: "hidden", textOverflow: "ellipsis" }}
               body={
                 t.recentDomain ? (
                   <DomainChip
                     domain={{ ...t.recentDomain, userId: undefined }}
                     provenance
                   />
                 ) : null
               }
             />

Note: You may need to update the Cell component's props interface in TableCells.tsx to accept an optional sx prop and pass it to the underlying TableCell.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d341163 and 4d8256b.

📒 Files selected for processing (1)
  • src/components/Statistics/UserStatistics.tsx
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: imnasnainaec
Repo: sillsdev/TheCombine PR: 4046
File: Backend/Controllers/StatisticsController.cs:131-131
Timestamp: 2025-12-10T21:52:47.388Z
Learning: In TheCombine repository, the GetDomainWordCount endpoint in StatisticsController uses Permission.WordEntry (not Permission.Statistics) because it serves the TreeView component used during word entry workflow, so the permission should align with who needs access to this data.
🧬 Code graph analysis (1)
src/components/Statistics/UserStatistics.tsx (1)
src/components/Statistics/TableCells.tsx (2)
  • HeadCell (5-13)
  • Cell (20-27)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Analyze (csharp)
  • GitHub Check: test_coverage (22)
  • GitHub Check: tox (3.12)

@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.02%. Comparing base (d341163) to head (4d8256b).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4078      +/-   ##
==========================================
- Coverage   74.57%   66.02%   -8.55%     
==========================================
  Files         295      241      -54     
  Lines       10938     6161    -4777     
  Branches     1372      783     -589     
==========================================
- Hits         8157     4068    -4089     
+ Misses       2385     1841     -544     
+ Partials      396      252     -144     
Flag Coverage Δ
backend ?
frontend 66.02% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

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

@jasonleenaylor reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec).

@imnasnainaec imnasnainaec merged commit a25a810 into master Jan 6, 2026
17 checks passed
@imnasnainaec imnasnainaec deleted the stats-col-order branch January 6, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend 🟨Medium Medium-priority PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants