-
Notifications
You must be signed in to change notification settings - Fork 536
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: UI Issues in Data Fetch Scroll, Text Area Overflow, and User Profile Navigation in notes tab #10200
base: develop
Are you sure you want to change the base?
Conversation
…in EncounterNotesTab
…o shaurya/fix-notes
…o shaurya/fix-notes
WalkthroughThis pull request addresses multiple UI/UX improvements in the Encounters Notes Tab. The changes include modifying the Cypress command in Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this 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/pages/Encounters/tabs/EncounterNotesTab.tsx (1)
Line range hint
1-1
: Consider adding error boundaries.While the implementation is solid, consider wrapping the component with an error boundary to gracefully handle runtime errors and provide fallback UI.
+import { ErrorBoundary } from '@/components/Common/ErrorBoundary'; + export const EncounterNotesTab = ({ encounter }: EncounterTabProps) => { // ... existing code ... return ( + <ErrorBoundary fallback={<div>Error loading notes. Please try again.</div>}> <div className="flex h-[calc(100vh-12rem)]"> {/* ... existing JSX ... */} </div> + </ErrorBoundary> ); };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
cypress/support/commands.ts
(1 hunks)src/components/Resource/ResourceBoard.tsx
(1 hunks)src/pages/Encounters/tabs/EncounterNotesTab.tsx
(10 hunks)
✅ Files skipped from review due to trivial changes (1)
- src/components/Resource/ResourceBoard.tsx
🔇 Additional comments (5)
cypress/support/commands.ts (1)
65-65
: LGTM! Important fix for Cypress command chain.Adding the
return
statement ensures proper promise chain handling in thegetAttached
command, preventing potential race conditions in tests.src/pages/Encounters/tabs/EncounterNotesTab.tsx (4)
124-128
: LGTM! User profile navigation implementation.The implementation correctly uses the facility slug for constructing the profile URL and adds click handlers to both avatar and username elements.
Also applies to: 146-150, 166-169
312-312
: LGTM! Improved scroll behavior control.The new
scrollToBottom
state variable and modified scroll logic effectively prevent unwanted scrolling while ensuring proper scroll behavior when needed (initial load, new messages).Also applies to: 391-391, 408-415
630-630
: LGTM! Fixed text area overflow.The
max-height-[150px]
class effectively prevents infinite expansion while maintaining usability.
598-606
: LGTM! Enhanced loading indicator UI.The new loading indicator provides better visual feedback with centered positioning and proper contrast.
👋 Hi, @shauryag2002, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
@@ -393,8 +405,14 @@ export const EncounterNotesTab = ({ encounter }: EncounterTabProps) => { | |||
|
|||
// Scroll to bottom on initial load and thread change | |||
useEffect(() => { | |||
if (messagesData && !messagesLoading && !isFetchingNextPage) { | |||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue with this approach is that it will just scroll to the top. Instead it should scroll to the very bottom of the newly loaded data, so navigating the conversation would be seamless for the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm currently stuck on implementing this properly. Right now, the scroll jumps to the top instead of smoothly moving to the bottom of the newly loaded data. Could you guide me on how to fix this in code and achieve the desired behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking into a few different approaches yesterday, but wasn't satisfied with the result 🤔 Let's remove the changes for scroll behavior for now, I'll take that up. Clear the merge conflicts so we can get this PR merged.
…o shaurya/fix-notes
@Jacobjeevan can you reply back the query |
Proposed Changes
Fixes UI Issues in Data Fetch Scroll, Text Area Overflow, and User Profile Navigation #9918
Fixed cypress command error.
Scroll Behavior on Data Fetch:
Loading...
appears without forcing the component to scroll to the bottom.Resizable Input Text Area Overflow:
Unresponsive User Avatar and Username:
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit
New Features
Bug Fixes
Chores