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: remove overlapping of text and icons #9490

Merged
merged 5 commits into from
Dec 23, 2024

Conversation

Tanuj1718
Copy link
Contributor

@Tanuj1718 Tanuj1718 commented Dec 18, 2024

Proposed Changes

@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

Summary by CodeRabbit

  • Style
    • Updated class names in the ShiftingTable component to enhance layout and responsiveness.
  • Bug Fixes
    • Maintained existing error handling and control flow for transfer completion.

@Tanuj1718 Tanuj1718 requested a review from a team as a code owner December 18, 2024 17:27
Copy link
Contributor

coderabbitai bot commented Dec 18, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request modifies the ShiftingTable component in the Shifting feature, focusing on layout adjustments. The changes involve removing horizontal padding (px-3) from a div containing buttons and adding flex-wrap to an inner div with status indicators. These modifications aim to address potential layout and responsiveness issues, particularly in how elements are displayed across different screen sizes.

Changes

File Change Summary
src/components/Shifting/ShiftingTable.tsx - Removed px-3 padding from outer div container
- Added flex-wrap to status indicators div
- Updated class name for assigned facility's dd element
- Changed button class to include text-wrap

Assessment against linked issues

Objective Addressed Explanation
Resolve text and icon overlapping [#9461]
Improve status column text wrapping [#9461]

Possibly related PRs

  • fix: remove overlapping of text and icons #9490: This PR directly modifies the ShiftingTable component, making similar changes to class names and layout as in the main PR, specifically addressing the removal of padding and the addition of flex-wrap.

Suggested reviewers

  • Jacobjeevan

Poem

🐰 In the realm of shifting tables bright,
Pixels dance with newfound might
Wrapping text with gentle care
No more icons in despair
A layout clean, a coder's delight! 🖥️


📜 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 dcc237f and 802c355.

📒 Files selected for processing (1)
  • src/components/Shifting/ShiftingTable.tsx (4 hunks)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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. (Beta)
  • @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 Dec 18, 2024

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit 802c355
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/67693577e3c65700083cd20f
😎 Deploy Preview https://deploy-preview-9490--care-ohc.netlify.app
📱 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.

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/Shifting/ShiftingTable.tsx (1)

137-138: Consider extracting responsive patterns into reusable classes.

The component uses complex responsive patterns with multiple breakpoint-specific classes. Consider extracting these commonly used responsive patterns into custom Tailwind components or utility classes to improve maintainability and ensure consistency across the application.

Example approach:

// In your Tailwind config
theme: {
  extend: {
    components: {
      '.responsive-status-container': {
        '@apply flex flex-wrap gap-2 sm:flex-row md:flex-row lg:flex-col xl:flex-row 2xl:flex-row 3xl:flex-row': {}
      }
    }
  }
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1d50f53 and 89bc5c6.

📒 Files selected for processing (1)
  • src/components/Shifting/ShiftingTable.tsx (1 hunks)
🔇 Additional comments (2)
src/components/Shifting/ShiftingTable.tsx (2)

138-138: LGTM: flex-wrap addition improves responsive behavior.

The addition of flex-wrap to the status indicators container is a good solution to prevent overflow and maintain layout integrity across different viewport sizes. This effectively addresses the text and icon overlap issue.

However, given the complex responsive layout with multiple breakpoints (sm, md, lg, xl, 2xl, 3xl), thorough testing across all viewport sizes is recommended.

Let's check for similar responsive patterns in the codebase:

✅ Verification successful

LGTM: flex-wrap addition is consistent with codebase patterns

The addition of flex-wrap to the status indicators container aligns with established patterns in the codebase. The search results show:

  1. Similar responsive containers in the codebase consistently use flex-wrap when dealing with dynamic content that needs to adapt across breakpoints.
  2. The exact same pattern exists in ResourceList.tsx which has an identical responsive class structure.
  3. Multiple other components use flex-wrap with responsive breakpoints to handle overflow gracefully.

The change follows the project's best practices for responsive design and effectively prevents content overflow.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for similar responsive patterns to ensure consistency
rg "flex.*sm:flex-row.*md:flex-row.*lg:flex-col.*xl:flex-row.*2xl:flex-row" --type tsx

Length of output: 116


Script:

#!/bin/bash
# Search for similar responsive patterns with flex-row/col combinations
rg "flex.*(sm:|md:|lg:|xl:|2xl:|3xl:)flex-(row|col)" --type-add 'tsx:*.tsx' --type tsx

# Also check for flex-wrap usage patterns
rg "flex-wrap" --type-add 'tsx:*.tsx' --type tsx

Length of output: 32751


137-137: LGTM: Padding removal helps prevent content overflow.

The removal of horizontal padding (px-3) is appropriate since the parent container already provides sufficient padding (p-4). This change helps prevent potential text overflow issues.

Let's verify there are no unintended padding issues in other viewports:

✅ Verification successful

Padding removal is appropriate and consistent with the codebase

The verification shows that:

  1. The parent div has p-4 padding, ensuring sufficient spacing
  2. The component maintains consistent layout with other similar components in the codebase
  3. The flex-wrap addition complements the padding removal to prevent overflow

Reasoning:

  • The search results show similar components using px-2 or px-3 padding, confirming our component's new padding-free approach is safe since it relies on parent padding
  • The component is used in both ShiftingList and ShiftingHistory, and the layout changes don't disrupt either usage
  • The flex-wrap addition (flex-wrap class in the child div) works together with the padding removal to properly handle content overflow
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other similar padding patterns in the codebase
rg "px-3.*flex-col" --type tsx

Length of output: 60


Script:

#!/bin/bash
# Search for similar padding patterns in the codebase, adjusting the file type
rg "px-3.*flex-col" -t ts -t tsx -t jsx -t js

Length of output: 75


Script:

#!/bin/bash
# Let's also check the parent component's padding to verify our assumption
rg -A 2 -B 2 "col-span-1 flex flex-col" -t ts -t tsx -t jsx -t js

Length of output: 95


Script:

#!/bin/bash
# Check if there are any similar components with potential padding conflicts
fd -e tsx -e ts -e jsx -e js -E '*.test.*' -E '*.spec.*' --exec grep -l "ShiftingTable"

Length of output: 237


Script:

#!/bin/bash
# Let's try with ripgrep without file type specifications
rg -B 3 -A 3 'col-span-1 flex flex-col.*text-left' 

# Also check the parent div's padding
rg -B 5 'col-span-1 flex flex-col.*text-left' 

# Check the related components for similar patterns
cat ./src/components/Shifting/ShiftingList.tsx ./src/components/Patient/PatientDetailsTab/ShiftingHistory.tsx

Length of output: 10922

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

image

@Tanuj1718
Copy link
Contributor Author

image

I am not able to see this overflow of text in my device. Can you please tell more?

Screenshot 2024-12-18 at 11 28 47 PM

@github-actions github-actions bot added needs-triage question Further information is requested labels Dec 18, 2024
@Jacobjeevan
Copy link
Contributor

image

I am not able to see this overflow of text in my device. Can you please tell more?
Screenshot 2024-12-18 at 11 28 47 PM

Check using your browser's device mode and try different viewports (for example: iPad layout horizontal and you will see this).

@Jacobjeevan Jacobjeevan removed question Further information is requested needs-triage labels Dec 20, 2024
@nihal467
Copy link
Member

LGTM

src/components/Shifting/ShiftingTable.tsx Outdated Show resolved Hide resolved
@rithviknishad rithviknishad merged commit 8244486 into ohcnetwork:develop Dec 23, 2024
7 of 10 checks passed
Copy link

@Tanuj1718 Your efforts have helped advance digital healthcare and TeleICU systems. 🚀 Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! 🙌

@coderabbitai coderabbitai bot mentioned this pull request Dec 31, 2024
6 tasks
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.

Overlapping in text and icons
4 participants