Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Minor UI Enhancement in questionnaire #10987

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

AdityaJ2305
Copy link
Contributor

@AdityaJ2305 AdityaJ2305 commented Mar 3, 2025

Proposed Changes

  • Fixes Minor UI Enhancement in questionnaire #10253
  • Fix: when we complete remove the dosage field, 0 get auto-filled and users are not able to erase it in medicine request
  • once the encounter class is changed by a user to a non-hospitalisation class, the existing hospitalization data should be overwritten to undefined
  • n the questionniare in the update encounter, its clipping in on normal review
Screenshot 2025-03-05 at 3 35 41 AM Screenshot 2025-03-05 at 6 09 45 PM Screenshot 2025-03-06 at 1 20 15 AM

@ohcnetwork/care-fe-code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA
  • Completion of QA in Mobile Devices
  • Completion of QA in Desktop Devices

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced the encounter flow to properly initialize hospitalization details for specific encounter categories, ensuring consistent data handling.
    • Refined the medication form so that dosage inputs now accept a wider range of formats, improving user input flexibility and reliability.
    • Introduced a structured table layout for the DiagnosisQuestion component, improving organization and usability of diagnosis data.
    • Transitioned the SymptomQuestion component to a table layout for better organization and readability of symptom data.
  • Style

    • Updated the styling and layout of the AllergyQuestion component for improved visual consistency without altering functionality.
    • Adjusted the layout and styling of the DiagnosisQuestion and SymptomQuestion components to enhance clarity and usability.

@AdityaJ2305 AdityaJ2305 requested a review from a team as a code owner March 3, 2025 18:31
Copy link
Contributor

coderabbitai bot commented Mar 3, 2025

Walkthrough

The pull request introduces modifications to four components. In the EncounterQuestion component, the handleUpdateEncounter function now conditionally initializes the hospitalization property based on the encounter_class values "amb", "vr", or "hh", and a new Hospitalization type is added. The MedicationRequestQuestion component changes the dosage input type from number to text, allowing for a broader range of input formats while maintaining the conversion logic for state updates. The AllergyQuestion component updates class names for styling adjustments, and the DiagnosisQuestion component transitions from a list to a structured table layout for better organization of diagnosis data.

Changes

File(s) Change Summary
src/components/.../EncounterQuestion.tsx
src/types/.../encounter
Added conditional logic in handleUpdateEncounter to initialize hospitalization for encounter classes "amb", "vr", or "hh". Introduced new Hospitalization type.
src/components/.../MedicationRequestQuestion.tsx Changed dosage input type from number to text, allowing for different input formats while keeping existing change handling logic.
src/components/.../AllergyQuestion.tsx Modified class names for TableHead and TableCell components to remove specific width specifications, affecting the styling and layout.
src/components/.../DiagnosisQuestion.tsx Transitioned from a list representation to a structured table layout, enhancing organization and visibility of diagnosis data. Updated component names and refactored logic for toggling notes visibility.
src/components/.../SymptomQuestion.tsx Restructured SymptomRow to use a table layout instead of divs, improving organization and readability. Updated imports for new UI components.

Possibly related PRs

  • Encounter Qustions dropdown values moved to constants and i18 applied for all strings #9859: The changes in the main PR to the handleUpdateEncounter function in EncounterQuestion.tsx are related to the modifications in the same file in the retrieved PR, which also involves updates to the EncounterQuestion component.
  • Re-design Encounter Card #10579: The changes in the main PR, specifically the modifications to the handleUpdateEncounter function in the EncounterQuestion component, are related to the updates in the encounterIcons constant in the retrieved PR, as both involve handling encounter classes and their associated properties.

Suggested labels

tested, reviewed

Suggested reviewers

  • rithviknishad
  • Jacobjeevan

Poem

I'm a rabbit, hopping through the code,
Scanning changes on this winding road.
Encounter and Medication refine their flow,
With logic that clearly starts to glow.
A joyful skip in every new line—
Celebrating diff changes, oh so fine! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f29ebc5 and 02ddbb0.

📒 Files selected for processing (1)
  • src/components/Questionnaire/QuestionTypes/MedicationRequestQuestion.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/Questionnaire/QuestionTypes/MedicationRequestQuestion.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: cypress-run (1)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Mar 3, 2025

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit 02ddbb0
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/67cec9804b40650007fa011c
😎 Deploy Preview https://deploy-preview-10987.preview.ohc.network
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@AdityaJ2305
Copy link
Contributor Author

AdityaJ2305 commented Mar 3, 2025

@nihal467 @rithviknishad @amjithtitus09

  • In the questionnaire under "Update Encounter," the content is getting clipped in normal review mode.

  • When the dosage field is completely removed in a medicine request, 0 gets auto-filled, and users are unable to erase it.

  • When all symptoms, diagnoses, and allergies are removed, the message shows "No recorded." Update it to "No active available" or provide an option to view removed items, even if none are currently active.

    Please confirm the expected behavior, as this requires significant changes based on the final decision.

  • Display the recorded time in questionnaires in a human-readable format.

    This seems to be caused by broken data. A similar issue was previously assigned to me but was closed as "Not Planned": Issue #10661.

  • If the encounter class is changed to a non-hospitalization class, any existing hospitalization data should be cleared.

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)
src/components/Questionnaire/QuestionTypes/MedicationRequestQuestion.tsx (1)

662-665: Fixed issue with clearing the dosage field

This change resolves the original issue where users couldn't completely remove dosage values. Now when a user clears the input, it will properly set the value to undefined instead of defaulting to 0.

The type casting approach (undefined as unknown as number) works but is a bit unconventional. Consider using an optional type in the interface instead of forcing undefined into a number type.

A more type-safe approach might be:

-value: value
-  ? Number(value)
-  : (undefined as unknown as number),
+value: value ? Number(value) : undefined,
+// And update the type definition to allow undefined for the value property

This would require updating the type definition for bounds_duration to allow undefined for the value property, but would be more type-safe.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d04d47a and 373c177.

📒 Files selected for processing (2)
  • src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx (2 hunks)
  • src/components/Questionnaire/QuestionTypes/MedicationRequestQuestion.tsx (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: OSSAR-Scan
🔇 Additional comments (3)
src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx (2)

32-32: Import of Hospitalization type looks good

The import of the Hospitalization type is correctly added to support the implementation of resetting hospitalization data.


118-124: Great addition to clear hospitalization data for non-inpatient encounters

This change properly addresses the requirement to reset hospitalization data when switching to a non-hospitalization encounter class. When the user changes the encounter class to ambulatory ("amb"), virtual ("vr"), or home health ("hh"), the hospitalization data is correctly reset to an empty object.

This fix will prevent outdated hospitalization data from persisting after changing encounter types, which aligns with the PR objective.

src/components/Questionnaire/QuestionTypes/MedicationRequestQuestion.tsx (1)

649-652: Good fix for dosage input rendering

Using the nullish coalescing operator is an appropriate way to handle potentially undefined values. This ensures the input field displays properly when there is no value instead of showing "0".

@github-actions github-actions bot added needs-triage question Further information is requested labels Mar 3, 2025
@rithviknishad rithviknishad added needs testing needs review and removed question Further information is requested needs-triage labels Mar 4, 2025
@amjithtitus09
Copy link
Contributor

@nihal467 @rithviknishad @amjithtitus09

  • In the questionnaire under "Update Encounter," the content is getting clipped in normal review mode.

    I couldn't understand the issue clearly. Could you share a screenshot? If it's the first one you shared in the issue, it is outdated issue then.

  • When the dosage field is completely removed in a medicine request, 0 gets auto-filled, and users are unable to erase it.
  • When all symptoms, diagnoses, and allergies are removed, the message shows "No recorded." Update it to "No active available" or provide an option to view removed items, even if none are currently active.

    Please confirm the expected behavior, as this requires significant changes based on the final decision.

  • Display the recorded time in questionnaires in a human-readable format.

    This seems to be caused by broken data. A similar issue was previously assigned to me but was closed as "Not Planned": Issue #10661.

  • If the encounter class is changed to a non-hospitalization class, any existing hospitalization data should be cleared.

@AdityaJ2305 Why not clear these doubts in the issue itself?

@github-actions github-actions bot added needs-triage question Further information is requested labels Mar 4, 2025
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: 1

🧹 Nitpick comments (3)
src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx (3)

202-233: Responsive desktop table layout.
This block cleanly displays diagnoses in a tabular format for larger screens. The structure is correct, but be aware of potential duplication with the mobile layout below. Consider abstracting shared logic if the code grows further.


235-420: Mobile-friendly layout.
This layout replicates the desktop features for smaller screens. The result is readable, but there is visible duplication between desktop and mobile views. Should you need to maintain more logic or additional fields, consider a unified or shared component to reduce repetition.


470-544: Main row structure and status fields.
Using a table row with separate cells for date, clinical status, and verification status is organized. Attempt to use a unique, stable key for each rendered row. Currently, the list uses key={index}, which could cause React to misinterpret row updates.

- <DiagnosisTableRow
-   key={index}
-   ...
+ <DiagnosisTableRow
+   key={diagnosis.id || index}
+   ...
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3a13c1a and 77c45e3.

📒 Files selected for processing (1)
  • src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: cypress-run (1)
🔇 Additional comments (6)
src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx (6)

2-3: No concerns with the icon imports.
They are used correctly for marking statuses and actions.


11-11: Ensure all side effects are intended.
The useEffect hook is fetching patientDiagnoses and updating the questionnaire response preemptively. Ensure no re-render loops or unintended side effects occur if patientDiagnoses changes repeatedly.


30-37: New table component imports look correct.
The imports match the usage of <Table>, <TableBody>, <TableCell>, <TableHead>, <TableHeader>, and <TableRow>.


441-446: Introduction of DiagnosisTableRow.
Splitting out a dedicated component for table rows improves readability and maintainability. This separation makes sense, especially due to the more complex UI controls.


546-573: Dropdown menu actions.
Marking a diagnosis as active, inactive, or resolved from this menu is clear. The icons are well chosen, and the destructuring approach to updating fields is consistent and concise. No issues found.


585-601: Conditional notes row.
In-table notes are a neat UX addition. Ensure to update your test coverage or manual QA to verify the notes row is displayed and updated correctly in all scenarios (active, inactive, resolved, etc.).

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 (3)
src/components/Questionnaire/QuestionTypes/SymptomQuestion.tsx (3)

255-282: Consider reusing the existing SymptomActionsMenu component instead of duplicating code.

The dropdown menu implementation here duplicates much of the functionality already available in the SymptomActionsMenu component (defined on lines 104-148), leading to code duplication.

-        <TableCell className="min-w-[35px] py-1 px-0">
-          <DropdownMenu>
-            <DropdownMenuTrigger asChild>
-              <Button
-                variant="ghost"
-                size="icon"
-                disabled={disabled}
-                className="h-7 w-6 px-0"
-              >
-                <DotsVerticalIcon className="h-3.5 w-3.5" />
-              </Button>
-            </DropdownMenuTrigger>
-            <DropdownMenuContent align="end">
-              <DropdownMenuItem onClick={handleToggleNotes}>
-                <Pencil2Icon className="h-4 w-4 mr-2" />
-                {showNotes ? t("hide_notes") : t("add_notes")}
-              </DropdownMenuItem>
-              <DropdownMenuSeparator />
-              <DropdownMenuItem
-                className="text-destructive focus:text-destructive"
-                onClick={handleRemove}
-              >
-                <MinusCircledIcon className="h-4 w-4 mr-2" />
-                {t("remove_symptom")}
-              </DropdownMenuItem>
-            </DropdownMenuContent>
-          </DropdownMenu>
+        <TableCell className="min-w-[35px] py-1 px-0">
+          <SymptomActionsMenu
+            showNotes={showNotes}
+            verificationStatus={symptom.verification_status}
+            disabled={disabled}
+            onToggleNotes={handleToggleNotes}
+            onRemove={handleRemove}
+          />
        </TableCell>

422-438: Consider adding ARIA attributes for improved accessibility.

While the mobile view implementation is excellent, consider enhancing it with additional ARIA attributes for better screen reader support.

-          <div className="md:hidden divide-y divide-gray-200">
+          <div className="md:hidden divide-y divide-gray-200" role="table" aria-label={t("symptoms_list")}>
            {symptoms.map((symptom, index) => (
-              <div key={index} className="p-3 space-y-3">
+              <div key={index} className="p-3 space-y-3" role="row">
-                <div className="flex items-center justify-between">
+                <div className="flex items-center justify-between" role="cell">
                  <div className="font-medium">{symptom.code.display}</div>
                  <SymptomActionsMenu
                    showNotes={Boolean(symptom.note)}
                    verificationStatus={symptom.verification_status}
                    disabled={disabled}
                    onToggleNotes={() =>
                      handleUpdateSymptom(index, {
                        note: symptom.note ? undefined : "",
                      })
                    }
                    onRemove={() => handleRemoveSymptom(index)}
                  />
                </div>

518-534: Consider conditionally handling empty notes.

The current implementation renders the notes section if symptom.note !== undefined, but it might still show an empty input field if symptom.note is an empty string. Consider adjusting the condition to also check for empty strings.

-                {symptom.note !== undefined && (
+                {symptom.note !== undefined && (
                  <div>
                    <Label className="text-xs text-gray-500">
                      {t("notes")}
                    </Label>
                    <Input
                      type="text"
                      placeholder={t("add_notes_about_symptom")}
                      value={symptom.note ?? ""}
                      onChange={(e) =>
                        handleUpdateSymptom(index, { note: e.target.value })
                      }
                      disabled={disabled}
                      className="mt-1"
                    />
                  </div>
                )}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 77c45e3 and 97d2a47.

📒 Files selected for processing (1)
  • src/components/Questionnaire/QuestionTypes/SymptomQuestion.tsx (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: cypress-run (1)
🔇 Additional comments (5)
src/components/Questionnaire/QuestionTypes/SymptomQuestion.tsx (5)

22-22: Good addition of new UI components for better structure.

These imports support the migration from a div-based layout to a more semantic table-based layout, along with proper form labeling.

Also applies to: 30-37


192-299: Excellent restructuring with semantic table layout.

The restructuring of the SymptomRow component from divs to a table-based layout significantly improves the semantic structure, readability, and accessibility of the UI. This approach:

  1. Uses proper table semantics with TableRow and TableCell
  2. Maintains good responsive styling with appropriate class names
  3. Correctly implements the notes section as a full-width row when displayed
  4. Preserves all the existing functionality while improving structure

391-421: Well-implemented desktop view with proper table semantics.

The implementation of the table structure with proper TableHeader, TableHead, and related components provides good semantic structure and improves accessibility. The column layout is well organized with appropriate widths for each type of content.


422-537: Excellent responsive design implementation for mobile view.

The mobile-specific view is well implemented with:

  1. Clear separation using the md:hidden class
  2. Proper layout with appropriate spacing and formatting
  3. Good use of Label components for improved accessibility
  4. Descriptive section organization with appropriate grid structure

The implementation properly handles the responsive design requirements while maintaining all functionality.


395-405:

❓ Verification inconclusive

Verify if the width classes are defined correctly in your CSS system.

The table header uses width classes like w-55, w-25, w-21, etc., which are not standard Tailwind CSS classes. Ensure these custom width classes are properly defined in your CSS system.


🏁 Script executed:

#!/bin/bash
# Check for custom width classes definition in CSS files or Tailwind config

echo "Searching for custom width class definitions..."
rg -t css -t js -t ts -t jsx -t tsx "w-55|w-25|w-21|w-9" --no-ignore

Length of output: 203


Action Required: Verify Custom Width Class Definitions
Please double-check that the custom width classes (w-55, w-25, w-21, and w-9) used in src/components/Questionnaire/QuestionTypes/SymptomQuestion.tsx (lines 395–405) are properly defined in your CSS system or Tailwind configuration. The initial search command encountered an error due to including the unsupported JSX file type. The revised search (above) should help confirm whether these custom classes are declared; if no definitions are found, please update your configuration accordingly.


🏁 Script executed:

#!/bin/bash
echo "Searching for custom width class definitions (excluding JSX files)..."
rg -t css -t js -t ts -t tsx "w-55|w-25|w-21|w-9" --no-ignore

Length of output: 362


Ensure Custom Width Classes Are Defined in Your CSS/Tailwind Config
Please double-check that the custom width classes (w-55, w-25, w-21, w-9) used in src/components/Questionnaire/QuestionTypes/SymptomQuestion.tsx (lines 395–405) are properly defined. Our initial search efforts ran into file type issues with JSX/TSX files. The revised script above adds custom type definitions for JSX and TSX. If this new search still yields no results, manually verify whether these classes are defined in your CSS or in your Tailwind configuration (e.g., tailwind.config.js). If they’re missing, please update your config accordingly.


🏁 Script executed:

#!/bin/bash
echo "Searching for custom width class definitions with added type definitions (including JSX/TSX)..."
rg --type-add 'jsx:*.jsx' --type-add 'tsx:*.tsx' -t css -t js -t ts -t tsx -t jsx "w-55|w-25|w-21|w-9" --no-ignore

Length of output: 65976


Action: Confirm Custom Width Class Definitions

The table header in src/components/Questionnaire/QuestionTypes/SymptomQuestion.tsx (lines 395–405) uses custom width classes (w-55, w-25, w-21, w-9), which aren’t standard Tailwind classes. An automated search (excluding files from node_modules) did not conclusively find definitions for these classes. Please manually verify whether these classes are defined in your CSS or Tailwind configuration (e.g., in your tailwind.config.js or a related CSS file). If they’re missing or unintended, update your CSS configuration or consider replacing them with standard Tailwind width utilities.

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: 1

🧹 Nitpick comments (2)
src/components/Questionnaire/QuestionTypes/SymptomQuestion.tsx (2)

403-518: Comprehensive mobile-friendly implementation.

The mobile view implementation shows careful attention to user experience on smaller screens, with proper labeling and stacked layout. This addresses the "clipping issue in the questionnaire" mentioned in the PR objectives.

However, there's some code duplication between desktop and mobile views that could be refactored.

Consider extracting common logic for symptom manipulation into shared helper functions instead of duplicating them in both views. For example, the input change handlers could be shared:

// Add this shared function
+const createSymptomUpdateHandler = (index, field, handleUpdateSymptom) => (value) => {
+  const update = field === 'onset' 
+    ? { onset: { onset_datetime: typeof value === 'string' ? value : value.target.value } }
+    : { [field]: value };
+  handleUpdateSymptom(index, update);
+};

// Then in the mobile view, replace inline handlers:
-onChange={(e) =>
-  handleUpdateSymptom(index, {
-    onset: { onset_datetime: e.target.value },
-  })
-}
+onChange={createSymptomUpdateHandler(index, 'onset', handleUpdateSymptom)}

209-209: UI consistency improvement for input heights.

The desktop view uses shorter inputs (h-7) while the mobile view uses taller inputs (h-8). Consider standardizing input heights across different viewports for better visual consistency.

-className="h-7 text-sm px-1"
+className="h-8 text-sm px-1"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 97d2a47 and f29ebc5.

📒 Files selected for processing (1)
  • src/components/Questionnaire/QuestionTypes/SymptomQuestion.tsx (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Redirect rules - care-ohc
  • GitHub Check: Header rules - care-ohc
  • GitHub Check: Pages changed - care-ohc
  • GitHub Check: Test
  • GitHub Check: cypress-run (1)
🔇 Additional comments (6)
src/components/Questionnaire/QuestionTypes/SymptomQuestion.tsx (6)

22-22: Improved UI structure with semantic table components.

Good addition of UI components that enhance the semantic structure of the questionnaire, making it more accessible and organized. The Table components provide better structure than div-based layouts previously used.

Also applies to: 30-37


193-264: Excellent transition to table-based layout for improved organization.

The restructuring from div-based layout to TableRow and TableCell components creates a better semantic structure, improving accessibility and visual organization of symptom data. The table cells are properly aligned with appropriate minimum widths and styling.


266-279: Good pattern for expandable notes within the table structure.

Using a separate TableRow with colSpan maintains the table structure while allowing for expandable notes. This is a good UI pattern for complex forms.


372-402: Well-implemented responsive desktop view.

The desktop view properly uses TableHeader and TableBody components with appropriate column headings. This creates a clean, professional presentation of symptom data that aligns with the PR objective of addressing UI clipping issues.


423-435: Enhanced accessibility with proper labeling in mobile view.

Good use of the Label component for form fields in the mobile view. This improves accessibility and follows best practices for form design.


376-387:

❓ Verification inconclusive

Verify column alignment and width constraints.

The table header widths are set to fixed values (w-55, w-25, etc.) which may not be standard Tailwind classes. Ensure that these classes are properly defined in your tailwind configuration, or consider using standard Tailwind width classes.


🏁 Script executed:

#!/bin/bash
# Look for custom width classes in the tailwind config
grep -r "w-55\|w-25\|w-21\|w-9" --include="*.js" --include="*.ts" --include="*.tsx" .

Length of output: 65624


Custom Tailwind width classes need verification

It appears that no locally defined custom classes (e.g. “w-55”, “w-25”, “w-21”, “w-9”) were found in the repository’s configuration. Please double-check your Tailwind configuration to confirm that these width classes are intentionally defined. If they are missing or unintended, consider switching to standard Tailwind width classes (or using Tailwind’s arbitrary value syntax) to ensure consistent column alignment.

  • Verify your tailwind.config.js (or equivalent) includes extensions for these custom classes.
  • If not defined, update the widths to standard Tailwind classes or define custom settings accordingly.

@Jacobjeevan Jacobjeevan removed the invalid This doesn't seem right label Mar 7, 2025
@amjithtitus09
Copy link
Contributor

@AdityaJ2305 Date field looks very weird
image

@amjithtitus09 amjithtitus09 removed question Further information is requested needs-triage labels Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minor UI Enhancement in questionnaire
4 participants