Skip to content

Small layout tweaks for project summary view#1304

Merged
annavik merged 3 commits into
mainfrom
layout/project-overview
May 14, 2026
Merged

Small layout tweaks for project summary view#1304
annavik merged 3 commits into
mainfrom
layout/project-overview

Conversation

@annavik
Copy link
Copy Markdown
Member

@annavik annavik commented May 14, 2026

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:
Screenshot 2026-05-14 at 10 37 08

After:
Screenshot 2026-05-14 at 10 36 58
Screenshot 2026-05-14 at 10 39 22

Summary by CodeRabbit

  • Style

    • Updated text styling in project summary cards with refined typography and simplified layout for improved readability.
    • Enhanced visual presentation of occurrence list items with refined text formatting.
  • Chores

    • Added localization support for user display labels, replacing hardcoded text with translated identifiers for better internationalization support.

Review Change Stack

@netlify
Copy link
Copy Markdown

netlify Bot commented May 14, 2026

Deploy Preview for antenna-ssec ready!

Name Link
🔨 Latest commit 0fbd95d
🔍 Latest deploy log https://app.netlify.com/projects/antenna-ssec/deploys/6a058b0818a8cd0008581459
😎 Deploy Preview https://deploy-preview-1304--antenna-ssec.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 14, 2026

Deploy Preview for antenna-preview ready!

Name Link
🔨 Latest commit 0fbd95d
🔍 Latest deploy log https://app.netlify.com/projects/antenna-preview/deploys/6a058b08f38b3100081cbcdf
😎 Deploy Preview https://deploy-preview-1304--antenna-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 63 (🔴 down 2 from production)
Accessibility: 89 (no change from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 92 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

📝 Walkthrough

Walkthrough

The PR introduces localized handling of anonymous user labels throughout the occurrence and summary features. A new ANONYMOUS_USER string constant is defined with English translation, then consistently applied in data models and summary UI components, accompanied by a ListItem component refactor to improve rendering and styling.

Changes

Localized Anonymous User Labeling and Summary Display

Layer / File(s) Summary
Localized Anonymous User String
ui/src/utils/language.ts
STRING enum gains ANONYMOUS_USER value; ENGLISH_STRINGS maps it to "Anonymous user".
Data Model Fallbacks
ui/src/data-services/models/occurrence-details.ts, ui/src/data-services/models/occurrence.ts
Both files import localization helpers and replace hardcoded anonymous/unknown user strings with translate(STRING.ANONYMOUS_USER) in fallback paths for missing user names.
ListItem Component Rendering
ui/src/pages/project/summary/list-item.tsx
Title and text rendering simplified: title becomes a bare truncated span; text uses body-small text-muted-foreground for improved typography and muting.
Summary Page Wiring and Styling
ui/src/pages/project/summary/summary.tsx
Empty-state paragraphs switch from text-small to body-small; three summary cards rewired to pass item.title and item.text correctly: LatestOccurrences maps dateLabel to text and taxon to title; MostIdentifications applies localized anonymous-user fallback; MostObservedTaxa passes species name via title.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • mihow

🐰 Anonymous users now have a voice,
Localized and true, they can rejoice!
Summary cards shine with cleaner spans,
Each translation fits perfectly in our plans.
The UI hops forward with style and with grace! 🌿✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: layout tweaks and styling adjustments for the project summary view.
Description check ✅ Passed The description includes a summary with context (#1296), screenshots showing before/after changes, and explains the key improvements. However, it lacks formal sections matching the template structure, testing instructions, and deployment notes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch layout/project-overview

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.

Copy link
Copy Markdown
Contributor

@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

🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between 5d2145d and 0fbd95d.

📒 Files selected for processing (5)
  • ui/src/data-services/models/occurrence-details.ts
  • ui/src/data-services/models/occurrence.ts
  • ui/src/pages/project/summary/list-item.tsx
  • ui/src/pages/project/summary/summary.tsx
  • ui/src/utils/language.ts

Comment on lines +179 to +181
title: user.name?.length
? user.name
: translate(STRING.ANONYMOUS_USER),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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.

Suggested change
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).

@annavik annavik merged commit aeb57c1 into main May 14, 2026
7 checks passed
@annavik annavik deleted the layout/project-overview branch May 14, 2026 09:00
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.

1 participant