Small layout tweaks for project summary view#1304
Conversation
✅ Deploy Preview for antenna-ssec ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for antenna-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThe PR introduces localized handling of anonymous user labels throughout the occurrence and summary features. A new ChangesLocalized Anonymous User Labeling and Summary Display
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ui/src/pages/project/summary/summary.tsx`:
- Around line 179-181: The current title expression uses user.name?.length so
whitespace-only names like " " bypass the anonymous fallback; update the
ternary to check the trimmed name and use the trimmed value for display, e.g.
compute const displayName = user.name?.trim(); then set title:
displayName?.length ? displayName : translate(STRING.ANONYMOUS_USER)
(referencing user.name, title, and translate(STRING.ANONYMOUS_USER) to locate
the change).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 72d2f6bb-769b-4ce7-8e57-83d2d66ed79f
📒 Files selected for processing (5)
ui/src/data-services/models/occurrence-details.tsui/src/data-services/models/occurrence.tsui/src/pages/project/summary/list-item.tsxui/src/pages/project/summary/summary.tsxui/src/utils/language.ts
| title: user.name?.length | ||
| ? user.name | ||
| : translate(STRING.ANONYMOUS_USER), |
There was a problem hiding this comment.
Handle whitespace-only names in anonymous fallback.
Line 179 uses .length, so a value like " " bypasses the fallback and renders as an empty-looking label. Trim before checking.
Suggested fix
- title: user.name?.length
- ? user.name
+ title: user.name?.trim().length
+ ? user.name.trim()
: translate(STRING.ANONYMOUS_USER),📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| title: user.name?.length | |
| ? user.name | |
| : translate(STRING.ANONYMOUS_USER), | |
| title: user.name?.trim().length | |
| ? user.name.trim() | |
| : translate(STRING.ANONYMOUS_USER), |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@ui/src/pages/project/summary/summary.tsx` around lines 179 - 181, The current
title expression uses user.name?.length so whitespace-only names like " "
bypass the anonymous fallback; update the ternary to check the trimmed name and
use the trimmed value for display, e.g. compute const displayName =
user.name?.trim(); then set title: displayName?.length ? displayName :
translate(STRING.ANONYMOUS_USER) (referencing user.name, title, and
translate(STRING.ANONYMOUS_USER) to locate the change).

Some small tweaks for the new project summary view (introduced in #1296). We now use the space in a bit more effective way and present users without name set as "Anonymous user". Also we streamline font weights.
Before:

After:


Summary by CodeRabbit
Style
Chores