Related Area
Frontend
Is there an existing issue for this?
Describe the bug
Bug description
The article detail screen renders a boolean expression for viewCount instead of a readable view-count label.
In frontend/src/screens/article/ArticleScreen.tsx, the view count is currently rendered like this:
{article?.viewCount
? article.viewCount > 1
: `${article.viewCount} view`}
When article.viewCount is greater than 0, the expression returns true or false instead of text such as 1 view or 12 views. React Native does not render booleans as useful user-facing text, so the article view count can appear missing or incorrect.
Steps to reproduce
- Open the UltimateHealth mobile app.
- Navigate to any published article that has viewCount > 0.
- Look at the view-count text near the top of the article detail screen.
Actual behavior
The UI evaluates article.viewCount > 1 and does not show a proper view-count label for articles with views.
Expected behavior
The article detail screen should show a readable count:
0 views
1 view
2 views
125 views
Add ScreenShots
Suggested fix
Replace the boolean expression with formatted text:
{`${article.viewCount ?? 0} ${(article.viewCount ?? 0) === 1 ? 'view' : 'views'}`}
Optional improvement: move this into a small helper such as formatViewCount(count?: number) and add a unit test for 0, 1, and plural counts.
What browsers are you seeing the problem on?
No response
Record
Related Area
Frontend
Is there an existing issue for this?
Describe the bug
Bug description
The article detail screen renders a boolean expression for viewCount instead of a readable view-count label.
In frontend/src/screens/article/ArticleScreen.tsx, the view count is currently rendered like this:
When article.viewCount is greater than 0, the expression returns true or false instead of text such as 1 view or 12 views. React Native does not render booleans as useful user-facing text, so the article view count can appear missing or incorrect.
Steps to reproduce
Actual behavior
The UI evaluates article.viewCount > 1 and does not show a proper view-count label for articles with views.
Expected behavior
The article detail screen should show a readable count:
0 views
1 view
2 views
125 views
Add ScreenShots
Suggested fix
Replace the boolean expression with formatted text:
What browsers are you seeing the problem on?
No response
Record