-
Notifications
You must be signed in to change notification settings - Fork 344
feat(content-sidebar): add ability to defer sidebar data fetching requests #4410
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
Conversation
WalkthroughAdded a new public prop Changes
Sequence DiagramsequenceDiagram
participant User
participant ContentSidebar
participant Sidebar
participant SidebarPanels
participant ActivitySidebar
participant FetchService
User->>ContentSidebar: Mount (with shouldFetchSidebarData)
ContentSidebar->>Sidebar: forward shouldFetchSidebarData
Sidebar->>SidebarPanels: forward shouldFetchSidebarData
SidebarPanels->>ActivitySidebar: render with shouldFetchSidebarData
alt shouldFetchSidebarData = false
ActivitySidebar->>ActivitySidebar: componentDidMount (no fetch)
else shouldFetchSidebarData = true
rect rgb(200,230,200)
ActivitySidebar->>FetchService: fetchFeedItems(true)
FetchService-->>ActivitySidebar: activity data
end
end
User->>ContentSidebar: Update props (shouldFetchSidebarData false→true)
ContentSidebar->>SidebarPanels: prop flows
SidebarPanels->>ActivitySidebar: prop updated
rect rgb(200,220,250)
ActivitySidebar->>ActivitySidebar: componentDidUpdate (detect transition)
ActivitySidebar->>FetchService: fetchFeedItems(true)
FetchService-->>ActivitySidebar: activity data
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
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. Comment |
Merge Queue Status✅ The pull request has been merged at 55304d8 This pull request spent 6 seconds in the queue, with no time running CI. Required conditions to merge
|
…uests (#4410) * feat(content-sidebar): add ability to defer sidebar data fetching requests * fix: address comments * fix: address comments * fix: address comments * fix: address comments
Summary
Adds deferDataFetch prop support to defer sidebar panel API calls until preview loads. File metadata is always fetched immediately (needed for sidebar structure), while heavier panel data (activity feed, comments, tasks, versions) is deferred when the prop is true.
Changes made.
ContentSidebar.js - Always fetch file metadata on mount (fast, needed for sidebar structure); removed deferDataFetch check from componentDidMount/componentDidUpdate; passes prop through to Sidebar
Sidebar.js / SidebarPanels.js - Prop drilling: passes deferDataFetch through to LoadableActivitySidebar
ActivitySidebar.js - Honors deferDataFetch prop: skips fetchFeedItems() on mount when true; fetches when prop changes from true → false (deferral lifted)
ActivitySidebar.test.js - Added tests covering: deferred mount behavior, non-deferred mount, and componentDidUpdate transitions for deferral state changes
Summary by CodeRabbit
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.