Skip to content

Fix issue 139 Removed unnecessary error causing space from Symptoms component#146

Open
DeveloperAmrit wants to merge 3 commits intoAOSSIE-Org:mainfrom
DeveloperAmrit:fix-issue-139-clean
Open

Fix issue 139 Removed unnecessary error causing space from Symptoms component#146
DeveloperAmrit wants to merge 3 commits intoAOSSIE-Org:mainfrom
DeveloperAmrit:fix-issue-139-clean

Conversation

@DeveloperAmrit
Copy link
Contributor

@DeveloperAmrit DeveloperAmrit commented Dec 29, 2025

Closes #139

📝 Description

Problem:
Users were encountering a "Text strings must be rendered within a component" error when interacting with the Symptoms screen, specifically when rendering the list of symptom history. This error typically occurs in React Native when whitespace or text characters exist directly inside a View component without being wrapped in a Text component.

🔧 Changes Made

-Removed unnecessary space and wrapped the element in a tag to prevent the error.

📷 Screenshots or Visual Changes (if applicable)

image

🤝 Collaboration

Collaborated with: @username (optional)

✅ Checklist

  • [y ] I have read the contributing guidelines.
  • [ y] I have added tests that prove my fix is effective or that my feature works.
  • [y ] I have added necessary documentation (if applicable).
  • [y ] Any dependent changes have been merged and published in downstream modules.

Summary by CodeRabbit

  • New Features

    • Symptom tracking data refreshed: multiple entries updated and two new symptom records added.
  • Style

    • Improved symptom history text rendering for clearer display.
  • Chores

    • Dataset timestamp refreshed and general maintenance applied.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 29, 2025

📝 Walkthrough

Walkthrough

Fixes React Native rendering issues by consolidating text nodes and removing an inline comment; updates test data in Backend/cache/context_default.json by modifying four symptom entries, adding two new entries, and updating the last_updated timestamp to 2025-12-28T14:05:10.224071.

Changes

Cohort / File(s) Summary
React Native Rendering Fixes
Frontend/src/Components/HeaderWithBack.jsx, Frontend/src/Screens/SymptomsScreen.jsx
Removed an inline JSX comment that could introduce whitespace in HeaderWithBack.jsx. Consolidated the split "Week" label into a single Text element in SymptomsScreen.jsx to eliminate stray text rendering.
Test Data Update
Backend/cache/context_default.json
Replaced four symptom entries with updated week, name, note, and date values (dates moved to late 2025), appended two new symptom entries (weeks 6 and 5), and updated the last_updated timestamp.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 A tiny comment hid a troublesome space,
Weeks joined as one, each Text found its place.
Data refreshed, new entries hop in line,
Dates set to sunset, all fields now align. ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes changes to Backend/cache/context_default.json with updated symptom data and timestamps that are unrelated to the stated objective of fixing text rendering errors. Remove test/fixture data changes in context_default.json as they are unrelated to the issue #139 bug fix; focus only on SymptomsScreen.jsx and HeaderWithBack.jsx modifications.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title references fixing issue 139 and specifically mentions removing unnecessary error causing space from Symptoms component, which aligns with the actual changes in SymptomsScreen.jsx and HeaderWithBack.jsx.
Linked Issues check ✅ Passed The PR successfully addresses all objectives from issue #139: JSX refactoring in SymptomsScreen.jsx eliminates stray text nodes around week rendering, and HeaderWithBack.jsx has unnecessary whitespace removed.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ 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.

Copy link
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: 0

🧹 Nitpick comments (1)
Frontend/src/Screens/SymptomsScreen.jsx (1)

212-212: LGTM! Text consolidation fixes the rendering error.

Consolidating the week label into a single Text component with a leading space correctly resolves the "Text strings must be rendered within a component" error. The spacing provides proper visual separation from the icon.

Optional: Alternative styling approach

If you prefer to avoid leading spaces in text content, you could use marginLeft instead:

-                  <Text style={styles.entryText}> Week {entry.week_number}</Text>
+                  <Text style={[styles.entryText, {marginLeft: 8}]}>Week {entry.week_number}</Text>

Both approaches are valid; the current solution works correctly.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c2d9f82 and 48b5e0d.

📒 Files selected for processing (3)
  • Backend/cache/context_default.json
  • Frontend/src/Components/HeaderWithBack.jsx
  • Frontend/src/Screens/SymptomsScreen.jsx
🔇 Additional comments (2)
Frontend/src/Components/HeaderWithBack.jsx (1)

15-15: LGTM! Comment removal fixes the text node error.

Removing the inline JSX comment correctly resolves the "Text strings must be rendered within a component" error while preserving the spacer functionality for layout balance.

Backend/cache/context_default.json (1)

77-110: Test data updated appropriately.

The symptom entries and timestamp have been updated with recent test data. The JSON structure remains valid and consistent with the application's data model.

@DeveloperAmrit DeveloperAmrit changed the title Fix issue 139 Fix issue 139 Removed unnecessary error causing space from Symptoms component Dec 29, 2025
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.

BUG: Fix "Text strings must be rendered within a <Text> component" error in SymptomsScreen

1 participant