-
Notifications
You must be signed in to change notification settings - Fork 2
Fix PR comment auto-refresh to preserve display count and improve UX #1064
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
🚀 Deployment Status: Building 🔵🔗 Quick Actions: 📝 Recent Change SummaryLatest commit: 📊 Overall ProgressBranch: 💡 Build started for commit |
🚀 Deployment Status: Building Application🔗 Quick Actions📊 Overall ProgressBranch: 📋 Deployment Timeline
💡 This comment is automatically updated as the deployment progresses. |
🔍 Page Framework Compliance Check ResultsFramework Structure Compliance
🔍 SGEX Page Framework Compliance CheckerFalling back to directory scan...
✅ BPMNEditor: 6/6 (100%) - COMPLIANT
✅ BPMNSource: 6/6 (100%) - COMPLIANT ✅ BPMNViewer: 6/6 (100%) - COMPLIANT
✅ BusinessProcessSelection: 6/6 (100%) - COMPLIANT
✅ ComponentEditor: 6/6 (100%) - COMPLIANT ✅ CoreDataDictionaryViewer: 6/6 (100%) - COMPLIANT ✅ DAKActionSelection: 6/6 (100%) - COMPLIANT
✅ DAKConfiguration: 6/6 (100%) - COMPLIANT ✅ DAKDashboard: 6/6 (100%) - COMPLIANT ✅ DAKDashboardWithFramework: 6/6 (100%) - COMPLIANT
✅ DAKSelection: 6/6 (100%) - COMPLIANT
✅ DashboardRedirect: 6/6 (100%) - COMPLIANT ✅ DecisionSupportLogicView: 6/6 (100%) - COMPLIANT
✅ FeatureFileEditor: 6/6 (100%) - COMPLIANT
✅ NotFound: 6/6 (100%) - COMPLIANT ✅ OrganizationSelection: 6/6 (100%) - COMPLIANT
✅ PersonaViewer: 6/6 (100%) - COMPLIANT
✅ RepositorySelection: 6/6 (100%) - COMPLIANT
✅ SelectProfilePage: 6/6 (100%) - COMPLIANT
✅ WelcomePage: 6/6 (100%) - COMPLIANT
📊 COMPLIANCE SUMMARY✅ Fully Compliant: 20/52 📈 Overall Compliance: 38%
✅ COMPLIANCE CHECK PASSED Profile Creation ComplianceStatus: ✅ PASSED
🔍 Starting Profile Creation Compliance Check... 📊 Profile Creation Compliance Report📁 Files scanned: 142 ✅ COMPLIANCE PASSED: No profile creation violations found! Next StepsFor guidance, see: |
🔒 Dependency Security Check Results |
🚀 Deployment Status: Building Application🔗 Quick Actions📊 Overall ProgressBranch: 📋 Deployment Timeline
💡 This comment is automatically updated as the deployment progresses. |
|
build error: |
|
@copilot see build error in previous |
The build errors in My changes only modified These errors occur because hooks are called after early returns in those components, violating React's Rules of Hooks. They should be fixed in a separate PR focused on those specific components. |
|
propose merge upstream options @copilot |
Here are the merge options for this PR: Option 1: Squash and Merge (Recommended)Best for: Clean history with single commit
Option 2: Rebase and MergeBest for: Preserving commit granularity
Option 3: Merge CommitBest for: Preserving branch context
Recommendation: Use Squash and Merge since the "Initial plan" commit doesn't contain functional changes - only the second commit (b4959bc) has the actual code improvements. The PR is ready to merge - only changes |
|
option 1 @copilot |
Perfect! To proceed with Squash and Merge: Via GitHub UI:
Via CLI (if preferred): gh pr merge --squash --delete-branchThe PR is ready - all changes are in |
|
I see a build error but I thought that this was fixed in main: |
|
@copilot see previous. |
These React Hooks errors exist in the base commit (2874154) that this branch was created from. My PR only modifies If these issues were fixed in main after commit 2874154, this branch needs to be updated with those fixes. You can: Option 1: Merge main into this branch git fetch origin main
git merge origin/mainOption 2: Rebase on main git fetch origin main
git rebase origin/mainOnce updated with the latest main branch that has the fixes, the build should succeed. Then you can proceed with squash and merge. |
|
Option 1 @copilot |
To merge main into this branch and get the React Hooks fixes: git fetch origin main
git merge origin/mainIf there are any merge conflicts, resolve them and commit. Once merged, the build should succeed with the fixes from main. I cannot perform git merge operations directly - you'll need to run these commands yourself. After the merge completes successfully, the PR will be ready for squash and merge. |
Problem
The PR badge component was polling comments every 5 seconds to detect new updates, but the auto-refresh was resetting the displayed comments count back to 5, causing a disruptive user experience:
This made it frustrating to follow active PR discussions where comments were being added frequently.
Solution
Added a
preserveDisplayCountparameter to thefetchCommentsForPRfunction that allows the component to maintain the user's current view during background refresh operations.Key Changes
1. Enhanced
fetchCommentsForPRfunction signature:2. Conditional display count logic:
3. Updated all refresh operations:
preserveDisplayCount=truepreserveDisplayCount=truepreserveDisplayCount=truepreserveDisplayCount=truepreserveDisplayCount=false(shows 5)Benefits
✅ Seamless comment updates: New comments appear automatically every 5 seconds without disrupting the view
✅ Preserved user context: Users maintain their position in the conversation
✅ Improved UX: No jarring view collapses during active discussions
✅ Smart edge case handling: Adjusts gracefully when comments are deleted
✅ Backward compatible: Default parameter ensures no breaking changes
Testing
Example Usage
Before this fix:
After this fix:
Files Changed
src/components/PreviewBadge.js: +26 insertions, -22 deletionsFixes the issue raised about improving PR comment dynamic updates with proper UX preservation.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.